game_sync/worldsrv/serverctrl.go

24 lines
511 B
Go

package main
import (
"mongo.games.com/goserver/core/logger"
"mongo.games.com/game/common"
"mongo.games.com/game/model"
"mongo.games.com/game/protocol/server"
)
func init() {
common.RegisterServerCtrlCallback(func(msg *server.ServerCtrl) {
switch msg.GetCtrlCode() {
case common.SrvCtrlStateSwitchCode:
if model.GameParamData.SrvMaintain {
common.SrvIsMaintaining = !common.SrvIsMaintaining
}
default:
logger.Logger.Errorf("unknown server ctrl code:%d", msg.GetCtrlCode())
}
})
}