luopeiyu / million_game_server

《百万在线:大型游戏服务端开发》是C++与Lua方向游戏服务端开发的入门书籍,内容涵盖Skynet引擎、C++底层开发、服务端架构设计等多个方面,全景展现网络游戏核心技术。
455 stars 101 forks source link

这里怎么执行的? #8

Open asyncrun opened 3 years ago

asyncrun commented 3 years ago
[root@iZbp1j690hvz1x9t0yq6ygZ soleTownServer]# ls
etc  luaclib  lualib  service  skynet  start.sh
[root@iZbp1j690hvz1x9t0yq6ygZ soleTownServer]# sh start.sh 
[skynet config]:17: ././etc/config.node: No such file or directory
[root@iZbp1j690hvz1x9t0yq6ygZ soleTownServer]# 

start.sh ./skynet/skynet ./etc/config.node$1

如果这样

[root@iZbp1j690hvz1x9t0yq6ygZ soleTownServer]# ./skynet/skynet ./etc/config.node1
[:00000002] LAUNCH snlua bootstrap
[:00000002] lua loader error : error loading module 'skynet' from file './skynet/luaclib/skynet.so':
 ./skynet/luaclib/skynet.so: undefined symbol: luaopen_skynet
stack traceback:
 [C]: in ?
 [C]: in function 'require'
 ./skynet/service/bootstrap.lua:1: in local 'main'
 ./skynet/lualib/loader.lua:48: in main chunk
[:00000002] KILL self
luopeiyu commented 3 years ago

用“sh start.sh 1”来调用,sh中的“$1”相当于获取“1”这个参数,所以实际折行的语句是“./skynet/skynet ./etc/config.node1”。

至于提示error loading module 'skynet',目测没有编译好skynet,建议重新编译一次。