最近准备玩Core-Keeper,但是咱家网络环境极差,又要当主机。如果依靠传统的联机方式很容易让除了我以外的人都享受到极致的游戏体验。今天写完mongodb备份方法以后就顺带瞄到了Core-Keeper推出了服务端,就顺便介绍一下如何搭建。
准备
服务器一台,配置差不多就行,不需要太好(学生机就行)。Win/Linux都可以,但是我手头国内服务器Win比较多,就用Windows做演示
SteamCMD,传送门:https://steamcdn-a.akamaihd.net/client/installer/steamcmd.zip,用来下载Core-Keeper服务端,丢到服务器上即可。
公网IP一枚,需要放行服务器的20715-20716端口(UDP协议)
下载Core-Keeper服务端
首先解压steamcmd,随后在解压的文件夹内右键->打开命令行(Powershell)窗口,随后直接执行steamcmd.exe
等到下载完,出现“steam>”的时候就可以开始下一步了。
接着输入 “login anonymous” 以匿名身份登陆steam。
国内服务器很可能连不上去,可以多试几次,或者在本地完成操作以后把服务端复制过去,或者在服务器那边挂个代理。
Steam>login anonymous
Connecting anonymously to Steam Public...Retrying. . .
OK
Waiting for client config...OK
Waiting for user info...OK
Steam>
出现第二次 “Steam>” 的时候便可进行下一步。
通过SteamDB搜索“CoreKeeper” 得到 Core Keeper Dedicated Server 的APP_ID为 1963720,于是我们开始使用steamcmd直接进行下载。
输入 app_update 1963720 开始下载服务端
Steam>app_update 1963720
Update state (0x3) reconfiguring, progress: 0.00 (0 / 0)
Update state (0x3) reconfiguring, progress: 0.00 (0 / 0)
Update state (0x3) reconfiguring, progress: 0.00 (0 / 0)
Update state (0x61) downloading, progress: 36.47 (70625001 / 193674799)
Update state (0x81) verifying update, progress: 33.02 (63946454 / 193674799)
Success! App '1963720' fully installed.
Steam>
后续更新啥的重复这一流程即可。
游戏会下载到该目录底下的 steamapps\common\Core Keeper Dedicated Server
开服
目前游戏还没有很复杂的配置,只需要到服务端目录底下双击启动 “Launch.bat” 即可。
详细的日志会被输出到同目录的“CoreKeeperServerLog.txt” 底下,当你在窗口中看到类似于下面的这段话的时候,服务器就开启成功了。
Started CoreKeeperServer.exe
Game ID: j[Censored]8
Press q to quit, DON'T close the window or the server process will just keep running
需要记住这个GameId,它是进服的关键,尚不清楚重启会不会重置GameId,服务端目前也不怎么完善,不建议直接公开。
进服
打开Core-Keeper,在主菜单中点击“加入游戏”,输入那一长串GameId即可。
服务器似乎会将第一个进入的玩家认作管理员,管理员可以在游戏中简单的管理玩家。