Advertisement
mojito-ice

Untitled

Nov 7th, 2014
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.73 KB | None | 0 0
  1. void OpcodeTable::ValidateAndSetOpcode(OpcodeServer opcode, char const* name, SessionStatus status)
  2. {
  3.     if (uint32(opcode) == 0xBADD)
  4.     {
  5.         TC_LOG_ERROR("network", "Opcode %s does not have a value", name);
  6.         return;
  7. }
  8.  
  9.     if (uint32(opcode) >= NUM_OPCODE_HANDLERS)
  10. {
  11.     TC_LOG_ERROR("network", "Tried to set handler for an invalid opcode %d", opcode);
  12.         return;
  13. }
  14.  
  15.     if (_internalTableServer[opcode] != NULL)
  16. {
  17.         TC_LOG_ERROR("network", "Tried to override server handler of %s with %s (opcode %u)", opcodeTable[opcode]->Name, name, opcode);
  18.         return;
  19. }
  20.  
  21.     _internalTableServer[opcode] = new PacketHandler<WorldPacket, &WorldSession::Handle_ServerSide>(name, status, PROCESS_INPLACE);
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement