OregonCore  revision 3611e8a-git
Your Favourite TBC server
Opcodes.h
Go to the documentation of this file.
1 /*
2  * This file is part of the OregonCore Project. See AUTHORS file for Copyright information
3  *
4  * This program is free software; you can redistribute it and/or modify it
5  * under the terms of the GNU General Public License as published by the
6  * Free Software Foundation; either version 2 of the License, or (at your
7  * option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful, but WITHOUT
10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12  * more details.
13  *
14  * You should have received a copy of the GNU General Public License along
15  * with this program. If not, see <http://www.gnu.org/licenses/>.
16  */
17 
18 #ifndef _OPCODES_H
19 #define _OPCODES_H
20 
21 #include "Common.h"
22 
23 // Note: this include need for be sure have full definition of class WorldSession
24 // if this class definition not complite then VS for x64 release use different size for
25 // struct OpcodeHandler in this header and Opcode.cpp and get totally wrong data from
26 // table opcodeTable in source when Opcode.h included but WorldSession.h not included
27 #include "WorldSession.h"
28 
29 // List of Opcodes
30 enum Opcodes
31 {
32  MSG_NULL_ACTION = 0x000,
33  CMSG_BOOTME = 0x001,
34  CMSG_DBLOOKUP = 0x002,
35  SMSG_DBLOOKUP = 0x003,
42  CMSG_ZONE_MAP = 0x00A,
43  SMSG_ZONE_MAP = 0x00B,
47  CMSG_RECHARGE = 0x00F,
51  CMSG_CREATEITEM = 0x013,
60  CMSG_PETGODMODE = 0x01C,
61  SMSG_PETGODMODE = 0x01D,
66  CMSG_GODMODE = 0x022,
67  SMSG_GODMODE = 0x023,
74  CMSG_FLAG_QUEST = 0x02A,
77  CMSG_SEND_EVENT = 0x02D,
87  CMSG_CHAR_ENUM = 0x037,
91  SMSG_CHAR_ENUM = 0x03B,
94  SMSG_NEW_WORLD = 0x03E,
130  CMSG_WHO = 0x062,
131  SMSG_WHO = 0x063,
132  CMSG_WHOIS = 0x064,
133  SMSG_WHOIS = 0x065,
203  CMSG_USE_ITEM = 0x0AB,
204  CMSG_OPEN_ITEM = 0x0AC,
205  CMSG_READ_ITEM = 0x0AD,
215  MSG_MOVE_STOP = 0x0B7,
219  MSG_MOVE_JUMP = 0x0BB,
268  MSG_MOVE_ROOT = 0x0EC,
279  MSG_MOVE_HOVER = 0x0F7,
290  CMSG_EMOTE = 0x102,
291  SMSG_EMOTE = 0x103,
300  CMSG_SWAP_ITEM = 0x10C,
308  CMSG_INSPECT = 0x114,
309  SMSG_INSPECT = 0x115,
338  SMSG_SPELL_GO = 0x132,
351  CMSG_UNUSED = 0x13F,
352  CMSG_UNUSED2 = 0x140,
381  CMSG_LOOT = 0x15D,
410  SMSG_PET_MODE = 0x17A,
448  CMSG_SELL_ITEM = 0x1A0,
449  SMSG_SELL_ITEM = 0x1A1,
450  CMSG_BUY_ITEM = 0x1A2,
452  SMSG_BUY_ITEM = 0x1A4,
472  SMSG_SHOW_BANK = 0x1B8,
490  CMSG_BUG = 0x1CA,
499  CMSG_WRAP_ITEM = 0x1D3,
502  SMSG_RESISTLOG = 0x1D6,
508  CMSG_PING = 0x1DC,
509  SMSG_PONG = 0x1DD,
517  CMSG_GHOST = 0x1E5,
518  CMSG_GM_INVIS = 0x1E6,
521  MSG_GM_SUMMON = 0x1E9,
538  CMSG_GM_NUKE = 0x1FA,
542  SMSG_RWHOIS = 0x1FE,
548  CMSG_DECHARGE = 0x204,
559  CMSG_GM_TEACH = 0x20F,
577  CMSG_XP_CHEAT = 0x221,
582  CMSG_GM_VISION = 0x226,
589  CMSG_GM_FREEZE = 0x22D,
600  CMSG_SEND_MAIL = 0x238,
648  CMSG_SET_AMMO = 0x268,
666  CMSG_FAR_SIGHT = 0x27A,
704  CMSG_LOOT_ROLL = 0x2A0,
706  SMSG_LOOT_ROLL = 0x2A2,
723  CMSG_SELF_RES = 0x2B3,
788  SMSG_WEATHER = 0x2F4,
835  CMSG_LUA_USAGE = 0x323,
861  SMSG_MOTD = 0x33D,
916  CMSG_SET_TITLE = 0x374,
972  SMSG_DISMOUNT = 0x3AC,
998  CMSG_COMPLAIN = 0x3C6,
1092 };
1093 
1094 // Don't forget to change this value and add opcode name to Opcodes.cpp when you add new opcode!
1095 #define NUM_MSG_TYPES 0x424
1096 
1099 {
1100  STATUS_AUTHED = 0x01,
1103  STATUS_NEVER = 0x08,
1105 };
1106 
1107 class WorldPacket;
1108 
1110 {
1111  char const* name;
1112  unsigned long status;
1113  void (WorldSession::*handler)(WorldPacket& recvPacket);
1114 };
1115 
1117 
1118 // Lookup opcode name for human understandable logging
1119 inline const char* LookupOpcodeName(uint16 id)
1120 {
1121  if (id >= NUM_MSG_TYPES)
1122  return "Received unknown opcode, it's more than max!";
1123  return opcodeTable[id].name;
1124 }
1125 #endif
1126 
Player authenticated.
Definition: Opcodes.h:1100
void(WorldSession::* handler)(WorldPacket &recvPacket)
Definition: Opcodes.h:1113
Using this opcode is time protected.
Definition: Opcodes.h:1104
Player transferring to another map.
Definition: Opcodes.h:1102
char const * name
Definition: Opcodes.h:1111
OpcodeHandler opcodeTable[NUM_MSG_TYPES]
Definition: Opcodes.cpp:22
Opcode not accepted from client (deprecated or server side only)
Definition: Opcodes.h:1103
unsigned long status
Definition: Opcodes.h:1112
Opcodes
Definition: Opcodes.h:30
const char * LookupOpcodeName(uint16 id)
Definition: Opcodes.h:1119
SessionStatus
Player state.
Definition: Opcodes.h:1098
#define NUM_MSG_TYPES
Definition: Opcodes.h:1095
ACE_UINT16 uint16
Definition: Define.h:72
Player in game.
Definition: Opcodes.h:1101