diff --git a/src/engine/net/client/Protocol.java b/src/engine/net/client/Protocol.java index 3c68e34f..4c7a727b 100644 --- a/src/engine/net/client/Protocol.java +++ b/src/engine/net/client/Protocol.java @@ -286,6 +286,33 @@ public enum Protocol { } } + public static boolean handleClientMsg(ClientNetMsg msg) { + + if (msg == null) + return false; + + try { + + Protocol protocol = msg.getProtocolMsg(); + + // Unhandled opcode + + if (protocol == null) + return true; + + AbstractClientMsgHandler msgHandler = protocol.handler; + + if (msgHandler == null) + return true; + + } catch (Exception e) { + Logger.error("handler for " + msg.getProtocolMsg() + " failed: " + e); + return false; + } + + return true; + } + public static Protocol getByOpcode(int opcode) { Protocol protocol = _protocolMsgByOpcode.get(opcode);