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

This commit is contained in:
昔念
2026-02-07 00:18:14 +08:00
parent 637a49e274
commit 3947fbce4b
14 changed files with 61 additions and 44 deletions

View File

@@ -63,7 +63,7 @@ func (s *Server) OnClose(c gnet.Conn, err error) (action gnet.Action) {
//logging.Infof("conn[%v] disconnected", c.RemoteAddr().String())
v, _ := c.Context().(*player.ClientData)
v.LF.Close()
v.LF.Close() //关闭继续接受
if v.Player != nil {
v.Player.Save() //保存玩家数据
@@ -153,7 +153,11 @@ func (s *Server) OnTraffic(c gnet.Conn) (action gnet.Action) {
t := c.Context().(*player.ClientData)
for _, msg := range messages {
t.LF.Producer().Write(msg.Payload)
if t.LF.Running() {
t.LF.Producer().Write(msg.Payload)
}
//t.OnEvent(msg.Payload)
}
@@ -177,7 +181,10 @@ func (s *Server) handleTCP(conn gnet.Conn) (action gnet.Action) {
}
if t, ok := conn.Context().(*player.ClientData); ok {
t.LF.Producer().Write(data)
if t.LF.Running() {
t.LF.Producer().Write(data)
}
}
if conn.InboundBuffered() > 0 {