修改底层连接,防止无限升级协议

This commit is contained in:
1
2025-10-06 05:30:48 +00:00
parent 864078f577
commit 63b7699c56
2 changed files with 5 additions and 1 deletions

View File

@@ -100,7 +100,10 @@ func (s *Server) OnTraffic(c gnet.Conn) (action gnet.Action) {
return action
}
if !ok { //升级失败,说明是tcp连接
if c.Context().(*player.ClientData).ERROR_CONNUT > 5 {
return gnet.Close
}
c.Context().(*player.ClientData).ERROR_CONNUT += 1
return s.handleTcp(c)
}