Merge pull request #22 from ldmonster/chore/split-mega-switch-to-map

[chore] refactor(game): replace 3,300-line switch with dispatch table in GameHandler
This commit is contained in:
Kelsi Rae Davis 2026-03-24 23:12:49 -07:00 committed by GitHub
commit 3ca8f20585
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6480 additions and 7223 deletions

View file

@ -2321,6 +2321,7 @@ private:
* Handle incoming packet from world server
*/
void handlePacket(network::Packet& packet);
void registerOpcodeHandlers();
void enqueueIncomingPacket(const network::Packet& packet);
void enqueueIncomingPacketFront(network::Packet&& packet);
void processQueuedIncomingPackets();
@ -2646,6 +2647,10 @@ private:
float localOrientation);
void clearTransportAttachment(uint64_t childGuid);
// Opcode dispatch table — built once in registerOpcodeHandlers(), called by handlePacket()
using PacketHandler = std::function<void(network::Packet&)>;
std::unordered_map<LogicalOpcode, PacketHandler> dispatchTable_;
// Opcode translation table (expansion-specific wire ↔ logical mapping)
OpcodeTable opcodeTable_;

File diff suppressed because it is too large Load diff