From 2ac8c8cf62dfce6f471af4c17428115b3148f84a Mon Sep 17 00:00:00 2001 From: Houmgaor Date: Wed, 18 Feb 2026 23:02:44 +0100 Subject: [PATCH] fix(stage): return valid response for empty stage binary requests GetStageBinary and WaitStageBinary silently dropped the ACK when the requested stage did not exist, leaving the client waiting indefinitely. Additionally, BinaryType1 == 4 and unknown binary types returned a completely empty response (zero bytes), which earlier clients cannot parse as a counted structure. Return a 4-byte zero response (empty entry count) in all fallback paths so the client always receives a valid ACK it can parse. --- server/channelserver/handlers_stage.go | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/server/channelserver/handlers_stage.go b/server/channelserver/handlers_stage.go index 820a06974..698c85940 100644 --- a/server/channelserver/handlers_stage.go +++ b/server/channelserver/handlers_stage.go @@ -393,17 +393,19 @@ func handleMsgSysGetStageBinary(s *Session, p mhfpacket.MHFPacket) { if binaryData, exists := stage.rawBinaryData[stageBinaryKey{pkt.BinaryType0, pkt.BinaryType1}]; exists { doAckBufSucceed(s, pkt.AckHandle, binaryData) } else if pkt.BinaryType1 == 4 { - // Unknown binary type that is supposedly generated server side - // Temporary response - doAckBufSucceed(s, pkt.AckHandle, []byte{}) + // Server-generated binary used for guild room checks and lobby state. + // Earlier clients (G1) crash on a completely empty response when parsing + // this during lobby initialization, so return a minimal valid structure + // with a zero entry count. + doAckBufSucceed(s, pkt.AckHandle, make([]byte, 4)) } else { s.logger.Warn("Failed to get stage binary", zap.Uint8("BinaryType0", pkt.BinaryType0), zap.Uint8("pkt.BinaryType1", pkt.BinaryType1)) - s.logger.Warn("Sending blank stage binary") - doAckBufSucceed(s, pkt.AckHandle, []byte{}) + doAckBufSucceed(s, pkt.AckHandle, make([]byte, 4)) } stage.Unlock() } else { s.logger.Warn("Failed to get stage", zap.String("StageID", pkt.StageID)) + doAckBufSucceed(s, pkt.AckHandle, make([]byte, 4)) } s.logger.Debug("MsgSysGetStageBinary Done!") } @@ -435,6 +437,7 @@ func handleMsgSysWaitStageBinary(s *Session, p mhfpacket.MHFPacket) { doAckBufSucceed(s, pkt.AckHandle, []byte{}) } else { s.logger.Warn("Failed to get stage", zap.String("StageID", pkt.StageID)) + doAckBufSucceed(s, pkt.AckHandle, make([]byte, 4)) } s.logger.Debug("MsgSysWaitStageBinary Done!") }