fix(handlers): fix softlock on forge purchases and N-points

MSG_CA_EXCHANGE_ITEM and MSG_MHF_USE_UD_SHOP_COIN had Parse() returning
"NOT IMPLEMENTED". The dispatch loop in handlePacketGroup treats any
Parse error as a silent drop — no ACK is sent, causing the client to
wait indefinitely (softlock). Reported on 9.3.0-rc1 for forge item
purchases and Hunting Road N-point interactions.

Fix follows the pattern from d27da5e: parse only the AckHandle, return
nil from Parse, and respond with doAckBufFail so the client's error
branch exits cleanly without reading response fields.
This commit is contained in:
Houmgaor
2026-03-23 22:20:32 +01:00
parent 72088db4ff
commit abab6dc3a1
11 changed files with 33 additions and 27 deletions

View File

@@ -559,13 +559,8 @@ func TestHandleMsgCaExchangeItem(t *testing.T) {
server := createMockServer()
session := createMockSession(1, server)
defer func() {
if r := recover(); r != nil {
t.Errorf("handleMsgCaExchangeItem panicked: %v", r)
}
}()
handleMsgCaExchangeItem(session, nil)
pkt := &mhfpacket.MsgCaExchangeItem{AckHandle: 1}
handleMsgCaExchangeItem(session, pkt)
}
func TestHandleMsgMhfServerCommand(t *testing.T) {
@@ -1068,7 +1063,6 @@ func TestEmptyHandlers_HandlersGo(t *testing.T) {
{"handleMsgSysUpdateRight", func() { handleMsgSysUpdateRight(session, nil) }},
{"handleMsgSysAuthQuery", func() { handleMsgSysAuthQuery(session, nil) }},
{"handleMsgSysAuthTerminal", func() { handleMsgSysAuthTerminal(session, nil) }},
{"handleMsgCaExchangeItem", func() { handleMsgCaExchangeItem(session, nil) }},
{"handleMsgMhfServerCommand", func() { handleMsgMhfServerCommand(session, nil) }},
{"handleMsgMhfSetLoginwindow", func() { handleMsgMhfSetLoginwindow(session, nil) }},
{"handleMsgSysTransBinary", func() { handleMsgSysTransBinary(session, nil) }},
@@ -1106,7 +1100,6 @@ func TestEmptyHandlers_Concurrent(t *testing.T) {
handleMsgSysUpdateRight,
handleMsgSysAuthQuery,
handleMsgSysAuthTerminal,
handleMsgCaExchangeItem,
handleMsgMhfServerCommand,
handleMsgMhfSetLoginwindow,
handleMsgSysTransBinary,