feat(socket): 统一使用 glog.Info 替代 glog.Infof

将 ServerEvent.go 中的 glog.Infof 更改为 glog.Info,以统一日志输出方式并减少格式化开销。

feat(controller): 优化宠物经验设置逻辑与错误码返回

在 SetPetExp 方法中提前返回结果,并修正最终返回的错误码为 ErrSystemError。同时规范化注释格式。

feat(space): 支持天气地图判断与动态天气 BOSS 刷新

引入 lo 包用于查找
This commit is contained in:
2025-12-13 18:35:17 +08:00
parent f638113c1a
commit 2ab7f59667
7 changed files with 24 additions and 14 deletions

View File

@@ -77,7 +77,7 @@ func (s *Server) OnClose(c gnet.Conn, err error) (action gnet.Action) {
return
}
func (s *Server) OnTick() (delay time.Duration, action gnet.Action) {
glog.Infof(context.Background(), gtime.Now().ISO8601(), "链接数", atomic.LoadInt64(&s.connected))
glog.Info(context.Background(), gtime.Now().ISO8601(), "链接数", atomic.LoadInt64(&s.connected))
if s.quit && atomic.LoadInt64(&s.connected) == 0 {
//执行正常退出逻辑
os.Exit(0)