private bool RaisePacketHandler(Type packetType, ClientType client, IPacket data) { PacketCallback<ClientType> callback = null; lock (_callbackLock) { if (_packetCallbacks.ContainsKey(packetType)) callback = _packetCallbacks[packetType]; } if (callback == null) { return false; } callback?.Raise(client, data); return true; }
private bool RaisePacketHandler(Type packetType, ClientType client, IPacket data) { PacketCallback <ClientType> callback = null; lock (CallbackLock) { if (PacketCallbacks.ContainsKey(packetType)) { callback = PacketCallbacks[packetType]; } } if (callback == null) { return(false); } else { callback?.Raise(client, data); return(true); } }