public static ServerPacketType Register(String name, ushort typeID, ServerPacketHandlerDelegate handler) { ServerPacketType type = Register(name, handler); SetTypeID(name, typeID); return(type); }
public void RegisterHandler(Opcode packetid, ServerPacketHandlerDelegate method) { if (PacketMethodMap.ContainsKey(packetid)) { PacketMethodMap[packetid].Method += method; } else { PacketMethodMap.Add(packetid, new ServerPacketMethod(method)); } }
public void RemoveHandler(Opcode packetid, ServerPacketHandlerDelegate method) { if (PacketMethodMap.ContainsKey(packetid)) { PacketMethodMap[packetid].Method -= method; if (PacketMethodMap[packetid].Method.IsNull()) { PacketMethodMap.Remove(packetid); } } }
public static ServerPacketType Register( String name, ServerPacketHandlerDelegate handler) { if ( stTypeNames.ContainsKey( name ) ) throw new Exception( "Can not register new packet type: " + "packet type already registered with the name \"" + name + "\"" ); ServerPacketType type = new ServerPacketType( name, handler ); stTypeNames.Add( name, type ); return type; }
public static ServerPacketType Register(String name, ServerPacketHandlerDelegate handler) { if (stTypeNames.ContainsKey(name)) { throw new Exception("Can not register new packet type: " + "packet type already registered with the name \"" + name + "\""); } ServerPacketType type = new ServerPacketType(name, handler); stTypeNames.Add(name, type); return(type); }
public ServerPacketMethod(ServerPacketHandlerDelegate method) { Method = method; }
internal ServerPacketType(String name, ServerPacketHandlerDelegate handler) : base(0xFFFF, name) { PacketHandler = handler; }
public static ServerPacketType Register( String name, ushort typeID, ServerPacketHandlerDelegate handler) { ServerPacketType type = Register( name, handler ); SetTypeID( name, typeID ); return type; }
internal ServerPacketType( String name, ServerPacketHandlerDelegate handler ) : base(0xFFFF, name) { PacketHandler = handler; }
public void RemoveHandler(Opcode packetid, ServerPacketHandlerDelegate method) { if(PacketMethodMap.ContainsKey(packetid)) { PacketMethodMap[packetid].Method -= method; if(PacketMethodMap[packetid].Method.IsNull()) PacketMethodMap.Remove(packetid); } }
public void RegisterHandler(Opcode packetid, ServerPacketHandlerDelegate method) { if(PacketMethodMap.ContainsKey(packetid)) PacketMethodMap[packetid].Method += method; else PacketMethodMap.Add(packetid, new ServerPacketMethod(method)); }