Infinideastudio / NEWorld

NEWorld is a free game with similar game rules to Minecraft.
116 stars 29 forks source link

服务端调用客户端插件会导致PluginApi用的是客户端的版本 #77

Closed harrynull closed 8 years ago

harrynull commented 8 years ago

具体表现:启动服务器-添加方块-崩溃 原因:nwRegisterBlock调用的是NEWorld.dll的PluginAPI::Blocks,而这个值为nullptr(正常应该是调用NEWorldServer.dll的PluginAPI::Blocks)

bridgekat commented 8 years ago

nwapi.h里通过#define NEWORLD_PLUGIN_CLIENT#define NEWORLD_PLUGIN_SERVER来区分客户端和服务端,如果没有define或者两个都define了就#error一下 233

bridgekat commented 8 years ago

然后C++版的插件,理论上客户端和服务端要分别配置附加依赖项为client.dll和server.dll FB版插件直接在nwapi.h里用预处理器#inclib一下就好辣

harrynull commented 8 years ago

@qiaozhanrong 那就需要生成2~3个dll了啊 碎片化严重 有的东西是shared的,比如添加方块

bridgekat commented 8 years ago

插件dll只要生成2个啊,shared的东西是client.dll和server.dll里都有的辣

harrynull commented 8 years ago

@qiaozhanrong 写两份代码吗……还是引用同一个源码文件

bridgekat commented 8 years ago

插件也做个shared client server啊2333 然后编译出来也是俩dll

harrynull commented 8 years ago

@qiaozhanrong 好复杂的样子……那这样最好就给开发者提供个框架了

bridgekat commented 8 years ago

不同IDE框架不一样啊

harrynull commented 8 years ago

@qiaozhanrong 直接给CMakeLists.txt好了

bridgekat commented 8 years ago

额ok

ascchrvalstr commented 8 years ago

NEWorld Development Kit

Miigon commented 8 years ago

所以你们想通要用CMakeLists.txt来开发了? 说实话不喜欢VS Project,现在有大半commit是在维护那个文件,而CMakeLists.txt 除非引入新库否则没有修改的必要 shared是编译成静态库链接到server和client里的,所以shared里的符号客户端和服务端也会有

harrynull commented 8 years ago

@Miigon 没有,只是准备弄个插件开发模板(NDK)

harrynull commented 8 years ago

Fixed