Ejemplo n.º 1
0
        public static ServerPacketType Register(String name, ushort typeID,
                                                ServerPacketHandlerDelegate handler)
        {
            ServerPacketType type = Register(name, handler);

            SetTypeID(name, typeID);

            return(type);
        }
Ejemplo n.º 2
0
 public void RegisterHandler(Opcode packetid, ServerPacketHandlerDelegate method)
 {
     if (PacketMethodMap.ContainsKey(packetid))
     {
         PacketMethodMap[packetid].Method += method;
     }
     else
     {
         PacketMethodMap.Add(packetid, new ServerPacketMethod(method));
     }
 }
Ejemplo n.º 3
0
        public void RemoveHandler(Opcode packetid, ServerPacketHandlerDelegate method)
        {
            if (PacketMethodMap.ContainsKey(packetid))
            {
                PacketMethodMap[packetid].Method -= method;

                if (PacketMethodMap[packetid].Method.IsNull())
                {
                    PacketMethodMap.Remove(packetid);
                }
            }
        }
Ejemplo n.º 4
0
        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;
        }
Ejemplo n.º 5
0
        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);
        }
Ejemplo n.º 6
0
 public ServerPacketMethod(ServerPacketHandlerDelegate method)
 {
     Method = method;
 }
Ejemplo n.º 7
0
 internal ServerPacketType(String name, ServerPacketHandlerDelegate handler)
     : base(0xFFFF, name)
 {
     PacketHandler = handler;
 }
Ejemplo n.º 8
0
 public ServerPacketMethod(ServerPacketHandlerDelegate method)
 {
     Method = method;
 }
Ejemplo n.º 9
0
        public static ServerPacketType Register( String name, ushort typeID,
            ServerPacketHandlerDelegate handler)
        {
            ServerPacketType type = Register( name, handler );

            SetTypeID( name, typeID );

            return type;
        }
Ejemplo n.º 10
0
 internal ServerPacketType( String name, ServerPacketHandlerDelegate handler )
     : base(0xFFFF, name)
 {
     PacketHandler = handler;
 }
Ejemplo n.º 11
0
        public void RemoveHandler(Opcode packetid, ServerPacketHandlerDelegate method)
        {
            if(PacketMethodMap.ContainsKey(packetid))
            {
                PacketMethodMap[packetid].Method -= method;

                if(PacketMethodMap[packetid].Method.IsNull())
                    PacketMethodMap.Remove(packetid);
            }
        }
Ejemplo n.º 12
0
 public void RegisterHandler(Opcode packetid, ServerPacketHandlerDelegate method)
 {
     if(PacketMethodMap.ContainsKey(packetid))
         PacketMethodMap[packetid].Method += method;
     else
         PacketMethodMap.Add(packetid, new ServerPacketMethod(method));
 }