系统优化
This commit is contained in:
parent
3bdf9850b9
commit
a7305f66dc
@ -424,7 +424,6 @@ func G_getGameLogic() *GameLogic {
|
||||
G_GameLogicPtr.M_Players = sync.Map{}
|
||||
G_GameLogicPtr.NotInitPlayer = new(Player)
|
||||
G_GameLogicPtr.M_LimitActiveList = []int{}
|
||||
G_GameLogicPtr.LoadSvrGlobalData() // 加载服务器全局数据
|
||||
G_GameLogicPtr.OpenTimestampTick() // 开启时间戳计时器
|
||||
G_GameLogicPtr.RegisterEvent() // 注册事件
|
||||
G_GameLogicPtr.RegisterNetWorkFunc() // 注册客户端接口
|
||||
@ -502,24 +501,6 @@ func (ad *GameLogic) ClearData(args []interface{}) {
|
||||
}
|
||||
}
|
||||
|
||||
func (ad *GameLogic) LoadSvrGlobalData() {
|
||||
sqlStr := "SELECT * FROM t_server_global_data WHERE Id = ?"
|
||||
|
||||
ad.M_SvrGlobal = db.SqlSvrGlobalStruct{}
|
||||
|
||||
if err := db.SqlDb.Get(&ad.M_SvrGlobal, sqlStr, 1); err != nil {
|
||||
log.Debug("get data failed, err:%v\n", err)
|
||||
timeStamp := time.Now().Unix()
|
||||
t := time.Unix(timeStamp, 0).Local()
|
||||
zero := timeStamp - (int64)(t.Hour()*3600+t.Minute()*60+t.Second())
|
||||
ad.M_SvrGlobal.StartMileStoneSvrTime = int32(zero)
|
||||
ad.M_SvrGlobal.Id = 1
|
||||
db.FormatAllMemInsertDb(&ad.M_SvrGlobal, "t_server_global_data")
|
||||
} else {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
func (ad *GameLogic) RegisterEvent() {
|
||||
|
||||
GoUtil.RegisterEvent(MergeConst.Notify_Socket_Closed, ad.ClearData, nil)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user