package dnfbridge // 骑士马战(joust)活动已取消后,模块本身不再注册, // 因此原先针对 joust 路由与 op1240/1241/1242/1243 推送的用例已随 // gameplay_module_joust.go 的模块注册一并删除。 // // 恢复活动时请同时恢复被删除的用例(可从版本库历史取回)。 import ( "testing" "longheng.io/server/internal/modules/dnf/dnfenum" ) // TestJoustOpcodesAreUnregistered 确认三个马战 opcode 在活动取消后没有任何路由。 func TestJoustOpcodesAreUnregistered(t *testing.T) { for _, opcode := range []uint16{ uint16(dnfenum.CmdPacketJoustInfo), uint16(dnfenum.CmdPacketJoustBetting), uint16(dnfenum.CmdPacketJoustMatchHistory), } { if route, ok := currentGameplayModules.legacyHandlers[opcode]; ok { t.Errorf("legacy opcode=%d still routed to module=%q", opcode, route.module) } if route, ok := currentGameplayModules.upperHandlers[opcode]; ok { t.Errorf("upper opcode=%d still routed to module=%q", opcode, route.module) } if route, ok := currentGameplayModules.legacyNormalizers[opcode]; ok { t.Errorf("normalizer opcode=%d still routed to module=%q", opcode, route.module) } } for _, name := range currentGameplayModules.names { if name == "joust" { t.Error("joust module is still registered") } } }