1
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful

This commit is contained in:
昔念
2026-02-12 12:43:28 +08:00
parent d0cf598ced
commit 2f756c77bb
9 changed files with 128 additions and 18 deletions

View File

@@ -58,14 +58,14 @@ func (s *Server) OnClose(c gnet.Conn, err error) (action gnet.Action) {
if t, ok := c.Context().(*player.ClientData); ok {
if t.Player != nil {
if t.Player.Info != nil {
cool.Logger.Error(context.TODO(), "OnClose 错误:", t.Player.Info.UserID, err)
cool.Logger.Error(context.TODO(), "OnClose 错误:", cool.Config.ServerInfo.OnlineID, t.Player.Info.UserID, err)
t.Player.Service.Info.Save(*t.Player.Info)
}
}
} else {
cool.Logger.Error(context.TODO(), "OnClose 错误:", err)
cool.Logger.Error(context.TODO(), "OnClose 错误:", cool.Config.ServerInfo.OnlineID, err)
}
@@ -132,7 +132,7 @@ func (s *Server) OnTraffic(c gnet.Conn) (action gnet.Action) {
if t, ok := c.Context().(*player.ClientData); ok {
if t.Player != nil {
if t.Player.Info != nil {
cool.Logger.Error(context.TODO(), "OnTraffic 错误:", t.Player.Info.UserID, err)
cool.Logger.Error(context.TODO(), "OnTraffic 错误:", cool.Config.ServerInfo.OnlineID, t.Player.Info.UserID, err)
t.Player.Service.Info.Save(*t.Player.Info)
}