liuhaopen / UnityMMO

an unity mmo demo, base on ecs(game play), xlua(ui)
MIT License
1.68k stars 438 forks source link

启动服务器报错lua loader error : /root/Server/game/service/chat.lua:5: attempt to index a nil value #16

Open gsm958708323 opened 5 years ago

gsm958708323 commented 5 years ago

报错内容如下: lua loader error : /root/Server/game/service/chat.lua:5: attempt to index a nil value (global 'ErrorCode') stack traceback: /root/Server/game/service/chat.lua:5: in local 'main' /root/Server/skynet/lualib/loader.lua:48: in main chunk [:01000024] KILL self [:01000016] lua call [1000008 to :1000016 : 14 msgsz = 106] error : /root/Server/skynet/lualib/skynet.lua:617: /root/Server/skynet/lualib/skynet.lua:184: /root/Server/skynet/lualib/skynet.lua:628: /root/Server/skynet/service/service_mgr.lua:25: /root/Server/skynet/lualib/skynet.lua:359: call failed stack traceback: [C]: in function 'assert' /root/Server/skynet/lualib/skynet.lua:628: in function 'skynet.uniqueservice' /root/Server/service/gated.lua:105: in function </root/Server/service/gated.lua:95> (...tail calls...) /root/Server/skynet/lualib/snax/gateserver.lua:149: in upvalue 'f' /root/Server/skynet/lualib/skynet.lua:141: in function </root/Server/skynet/lualib/skynet.lua:113> stack traceback: [C]: in function 'assert' /root/Server/skynet/lualib/skynet.lua:617: in function 'skynet.dispatch_message' [:01000009] init service failed: /root/Server/skynet/lualib/skynet.lua:359: call failed stack traceback: [C]: in function 'error' /root/Server/skynet/lualib/skynet.lua:359: in upvalue 'yield_call' /root/Server/skynet/lualib/skynet.lua:376: in function 'skynet.call' /root/Server/service/main.lua:16: in local 'start' /root/Server/skynet/lualib/skynet.lua:721: in function </root/Server/skynet/lualib/skynet.lua:718> [C]: in function 'xpcall' /root/Server/skynet/lualib/skynet.lua:725: in function 'skynet.pcall' /root/Server/skynet/lualib/skynet.lua:729: in function 'skynet.init_service' /root/Server/skynet/lualib/skynet.lua:742: in upvalue 'f' /root/Server/skynet/lualib/skynet.lua:114: in function </root/Server/skynet/lualib/skynet.lua:113>

gsm958708323 commented 5 years ago

image 好像是没有找到Proto文件夹,但是我已经把文件夹放到对应文件夹了。 image

liuhaopen commented 5 years ago

/root/Server/game/service/chat.lua:5: attempt to index a nil value (global 'ErrorCode') 这个是拉了 dev 分支了,开发分支不保证都能运行,切回 master 分支就好了。 Proto 目录的话需要保持好原有的层级关系,把 Lua 文件夹连同里面的 Proto 等复制到 Server 同级目录