配置服务端
RW-HPS提供了3个配置文件
Config.json为共用(不管哪种运行模式都会生效。)
ServerConfig.json为Server模式配置
ConfigRelay.json为Relay模式配置
注意: RW-HPS不支持热重载配置,每次修改配置请先关闭服务器!
Config.json
Section titled “Config.json”defStartCommand
Section titled “defStartCommand”服务器默认启动命令(str)
Section titled “服务器默认启动命令(str)”Server模式为start
Relay模式为startrelay/startrelaytest
startrelay 直接转发消耗更多带宽,效果与使用 VPN 转发相同
startrelaytest 使用多播, 减少宽带消耗
默认配置为start
log记录等级(str)
Section titled “log记录等级(str)”决定log记录的级别,通常级别越高输出内容越多
输入错的则默认 ALL
OFF FATAL ERROR WARN INFO DEBUG TRACE ALL
默认配置为WARN
cmdTitle
Section titled “cmdTitle”终端标题(str)
Section titled “终端标题(str)”RW-HPS在启动完成时会更改终端标题
在Windows上,使用native方法
在Linux上,使用vt100控制符
若未配置,则显示
[RW-HPS] Port: 5123, Run Server: ${NetStaticData.ServerNetType.name}
默认未配置
followBetaVersion
Section titled “followBetaVersion”使用测试版本更新服务器(bool)
Section titled “使用测试版本更新服务器(bool)”RW-HPS支持在服务器控制台处更新服务器,只需输入tryupdate即可
如果启用,则使用测试版本更新服务器,您会提前体验到新功能也会体验到新bug
如果禁用,则使用稳定版更新服务器
默认配置为禁用
服务器端口(int)
Section titled “服务器端口(int)”指定服务器所使用的端口
默认配置为5123
serverName
Section titled “serverName”服务器名(str)
Section titled “服务器名(str)”服务器在列表处的服务器名
默认配置为RW-HPS
subtitle
Section titled “subtitle”地图名(str)
Section titled “地图名(str)”服务器在列表处的地图名
未配置则为地图名
默认未配置
autoUpList
Section titled “autoUpList”自动上列表(bool)
Section titled “自动上列表(bool)”可以让服务器启动时自动上列表(相当于uplist add)
默认配置为禁用
ipCheckMultiLanguageSupport
Section titled “ipCheckMultiLanguageSupport”基于IP判断多语言支持(bool)
Section titled “基于IP判断多语言支持(bool)”可以通过玩家IP判断玩家的国家从而对每个玩家都显示它的本国语言(前提是翻译文件有那个语言)
默认配置为禁用
singleUserRelay
Section titled “singleUserRelay”Relay单用户模式(bool)
Section titled “Relay单用户模式(bool)”类似与Relay模式,但是只有一个房间
默认配置为禁用
singleUserRelayMod
Section titled “singleUserRelayMod”Relay单用户模式的mod支持(bool)
Section titled “Relay单用户模式的mod支持(bool)”为Relay单用户模式启用mod支持
默认配置为禁用
webToken
Section titled “webToken”HttpApi令牌(str)
Section titled “HttpApi令牌(str)”此令牌在HttpApi-外链处使用
默认配置为随机生成
webHOST
Section titled “webHOST”HTTP主机限制(str)
Section titled “HTTP主机限制(str)”限制HTTP的Host,防止从IP访问
默认未配置
webPort
Section titled “webPort”HTTP服务器端口(int)
Section titled “HTTP服务器端口(int)”指定HTTP服务器所使用的端口,0为禁用HTTP服务器
注意: 现已不支持端口复用,请勿与游戏服务器设置同一端口
默认配置为禁用
启用HTTPS(bool)
Section titled “启用HTTPS(bool)”不建议使用SSL
启用HTTP服务器的SSL(即HTTPS)
默认配置为禁用
sslPasswd
Section titled “sslPasswd”SSL证书的密码(str)
Section titled “SSL证书的密码(str)”警告: 明文密码
要配置SSL,你需要在和jar同级的地方放置ssl.jks(大小写敏感)
然后在此配置项输入JKS证书密码
默认未配置
runPid
Section titled “runPid”服务器运行PID(int)
Section titled “服务器运行PID(int)”你不需要知道这是干什么的,也不需要动它
如果你想知道的话:
提供当前 JVM 的 pid, 便于使用其他程序关闭 JVM
ServerConfig.json
Section titled “ServerConfig.json”enterAd
Section titled “enterAd”进入消息(str)
Section titled “进入消息(str)”玩家进入时服务器发送给玩家的消息
默认未配置
startAd
Section titled “startAd”开始消息(str)
Section titled “开始消息(str)”游戏开始时服务器发送给玩家的消息
默认未配置
maxPlayerAd
Section titled “maxPlayerAd”满员消息(str)
Section titled “满员消息(str)”进入服务器时,服务器已满员时拒绝玩家进入的消息
默认未配置
startPlayerAd
Section titled “startPlayerAd”已开始消息(str)
Section titled “已开始消息(str)”进入服务器时,服务器已开始游戏时拒绝玩家进入的消息
默认未配置
passwd
Section titled “passwd”服务器密码(str)
Section titled “服务器密码(str)”给服务器设置密码,所有玩家进入服务器时需要输入密码才能进入
未配置则不设置密码
默认未配置
maxPlayer
Section titled “maxPlayer”最大玩家数(int)
Section titled “最大玩家数(int)”设置服务器所能容纳的最大玩家数
默认配置为10
maxGameIngTime
Section titled “maxGameIngTime”最长游戏时间(int)
Section titled “最长游戏时间(int)”设置游戏运行的时间,若达到设定的时间,则关闭此房间(不关闭服务器)
配置为-1时则无限制
单位: 秒(sec)
默认配置为7200
maxOnlyAIGameIngTime
Section titled “maxOnlyAIGameIngTime”没有其他玩家的最长游戏时间(int)
Section titled “没有其他玩家的最长游戏时间(int)”当服务器只有AI时(也就是只有一群AI),若到达设定的时间,则关闭此房间(不关闭服务器)
配置为-1时则无限制
单位: 秒(sec)
默认配置为3600
startMinPlayerSize
Section titled “startMinPlayerSize”最小开始人数(int)
Section titled “最小开始人数(int)”服务器开始游戏所需的最小人数
配置为-1则无限制
默认配置为无限制
autoStartMinPlayerSize
Section titled “autoStartMinPlayerSize”自动开始人数(int)
Section titled “自动开始人数(int)”当服务器人数大于或等于(≥)此配置项时,服务器将自动开始游戏
配置为-1则禁用此功能
默认配置为4
maxMessageLen
Section titled “maxMessageLen”最大发言长度(int)
Section titled “最大发言长度(int)”服务器所允许的最大发言长度
默认配置为40
maxUnit
Section titled “maxUnit”最大单位数量(int)
Section titled “最大单位数量(int)”服务器所允许的最大单位数量
默认配置为200
defIncome
Section titled “defIncome”默认倍率(float)
Section titled “默认倍率(float)”服务器默认资金倍率(支持小数)
默认配置为1.0
turnStoneIntoGold
Section titled “turnStoneIntoGold”点石成金(bool)
Section titled “点石成金(bool)”字面意思
建筑单位不需要时间并且不需要资金
默认配置为禁用
oneAdmin
Section titled “oneAdmin”将第一个进入的玩家设置为管理员(bool)
Section titled “将第一个进入的玩家设置为管理员(bool)”服务器将第一个进入服务器的玩家设置为管理员
默认配置为启用
saveRePlayFile
Section titled “saveRePlayFile”保存RePlay文件(bool)
Section titled “保存RePlay文件(bool)”服务器允许客户端保存RePlay文件用于回放游戏过程
默认配置为启用
ConfigRelay.json
Section titled “ConfigRelay.json”mainID
Section titled “mainID”前置ID(str)
Section titled “前置ID(str)”Relay模式下的房间前置ID
未配置的话默认只有数字
默认未配置
mainServer
Section titled “mainServer”是否是 RELAY 主节点(bool)
Section titled “是否是 RELAY 主节点(bool)”主节点将可以分配分节点分ID, 例如 RCN 分配 RA, 那么如果是 true, RA就会被跳转, 如果是 false, 就会解析 默认配置为启用
upList
Section titled “upList”TODO(bool)
Section titled “TODO(bool)”服务器是否支持 uplist 默认配置为禁用
mainServerIP
Section titled “mainServerIP”TODO(str)
Section titled “TODO(str)”mainServerPort
Section titled “mainServerPort”TODO(int)
Section titled “TODO(int)”什么?你问我为什么是
TODO?
其实我也不知道为什么是TODO呀
也许是Dr太懒了吧