aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2015-04-08 23:35:27 +0200
committerShauren <shauren.trinity@gmail.com>2015-04-08 23:35:27 +0200
commite651dbec0ebb7e864c837741977f0412ec068281 (patch)
tree741cd8d5cc58d03f543251a19085f2d15aa2687f /src
parentf0f027a79e2ee316f1a2dda6439950fbf8ab9e93 (diff)
Core/Misc: Added a nice static_assert to prevent adding server opcode "handlers" with status other than UNHANDLED or NEVER
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Server/Protocol/Opcodes.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp
index a61333f93b0..cd33bef7335 100644
--- a/src/server/game/Server/Protocol/Opcodes.cpp
+++ b/src/server/game/Server/Protocol/Opcodes.cpp
@@ -829,6 +829,7 @@ void OpcodeTable::Initialize()
#undef DEFINE_HANDLER
#define DEFINE_SERVER_OPCODE_HANDLER(opcode, status, con) \
+ static_assert(status == STATUS_NEVER || status == STATUS_UNHANDLED, "Invalid status for server opcode"); \
ValidateAndSetServerOpcode(opcode, #opcode, status, con)
DEFINE_SERVER_OPCODE_HANDLER(SMSG_ABORT_NEW_WORLD, STATUS_UNHANDLED, CONNECTION_TYPE_REALM);