internal void Invoke(Packet packet) { int key = NetworkHelper.EncodePacketID(packet.module, packet.command); if (this._cmdToHandler.TryGetValue(key, out PacketHandler handler2)) { handler2.Invoke(packet); } }
public PacketAttribute(byte module, ushort command) { this.id = NetworkHelper.EncodePacketID(module, command); }
public void RemoveListener(byte module, ushort cmd, PacketHandler handler) { this._listener.Remove(NetworkHelper.EncodePacketID(module, cmd), handler); }
internal static Type GetPacketType(byte module, ushort command) { return(!PACKET_MAP.TryGetValue(NetworkHelper.EncodePacketID(module, command), out Type type) ? null : type); }