feat(config): 增加服务器在线状态检测功能

- 在ServerEvent中添加OnlineID到日志输出
- 修改玩家宠物闪光逻辑,仅在ShinyInfo为空时添加新闪光信息
- 在server.go中增加PageQueryOp配置,实现服务器假踢人功能
- 添加在线状态检测逻辑,通过GetClient获取连接状态并更新服务器列表
- 引入context、g和gconv依赖包用于服务逻辑处理
```
This commit is contained in:
2026-01-08 03:55:24 +08:00
parent 174562b895
commit 97dfc61939
5 changed files with 28 additions and 2 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.Info(context.Background(), gtime.Now().ISO8601(), "链接数", atomic.LoadInt64(&s.connected))
glog.Info(context.Background(), gtime.Now().ISO8601(), cool.Config.ServerInfo.OnlineID, "链接数", atomic.LoadInt64(&s.connected))
if s.quit && atomic.LoadInt64(&s.connected) == 0 {
//执行正常退出逻辑
os.Exit(0)