fix: improve endgame clock and gameplay stability

This commit is contained in:
CAtlas0784 committed 2026-11-04 15:59:48 +07:00
1 parent ce6aabfc55
commit 658298ee86
46 files changed
+1915 -99

No files matched your search

+7 -1
View File
@@ -164,7 +164,11 @@ func DispatchMessage(s *Session, cmdID uint16, payload []byte) {
// 1. empty-dummy responses
if rspID, ok := dummyResponses[cmdID]; ok {
_ = s.SendRaw(&NetPacket{CmdType: rspID})
if err := s.SendRaw(&NetPacket{CmdType: rspID}); err != nil {
Log(fmt.Sprintf("[DISPATCH] response %d (%s) failed: %v", rspID, goproto.NameByCmdID[rspID], err))
} else {
Log(fmt.Sprintf("[PACKET] queued empty response cmd_id: %d (%s)", rspID, goproto.NameByCmdID[rspID]))
}
return
}
@@ -172,6 +176,7 @@ func DispatchMessage(s *Session, cmdID uint16, payload []byte) {
if h, ok := rawHandlers[cmdID]; ok {
if err := h(s, payload); err != nil {
PacketLog("[ERROR] raw handler " + fmt.Sprint(cmdID) + ": " + err.Error())
Log(fmt.Sprintf("[DISPATCH] raw handler %d failed: %v", cmdID, err))
}
return
}
@@ -180,6 +185,7 @@ func DispatchMessage(s *Session, cmdID uint16, payload []byte) {
if h, ok := typedHandlers[cmdID]; ok {
if err := h(s, payload); err != nil {
PacketLog("[ERROR] handler cmd " + fmt.Sprint(cmdID) + ": " + err.Error())
Log(fmt.Sprintf("[DISPATCH] handler %d failed: %v", cmdID, err))
}
return
}