/// <summary>
 /// registers a packet
 /// </summary>
 /// <param name="opCode">Server opcode</param>
 /// <param name="handeler">Handeler</param>
 public void registerPacket(ClientOpCode opCode, PacketRegistery<ClientOpCode, ClientIncomingPacket>.handlePacket handeler, bool handleImmidiate = false)
 {
     if (handleImmidiate)
     {
         immidiateHandeler.registerPacket(opCode, handeler);
     }
     else {
         this.queueHandeler.registerPacket(opCode, handeler);
     }
 }
Example #2
0
 public ClientIncomingPacket(byte[] bytes)
     : base(bytes)
 {
     if (ClientOpcodeCheck.isOpCode(base.packetID))
     {
         this.mOpcode = (ClientOpCode)base.packetID;
     }
     else
     {
         throw new PacketMalformedException("Invalid packet bytes data. Must atleast be 4 bytes.", this);
     }
 }
Example #3
0
 public ClientIncomingPacket(byte[] bytes)
     : base(bytes)
 {
     if (ClientOpcodeCheck.isOpCode(base.packetID))
     {
         this.mOpcode = (ClientOpCode)base.packetID;
     }
     else
     {
         throw new PacketMalformedException("Invalid packet bytes data. Must atleast be 4 bytes.", this);
     }
 }
 /// <summary>
 /// Removes a packet from the opcode list
 /// </summary>
 /// <param name="code">The opcode to remove</param>
 public void removePacket(ClientOpCode code)
 {
     this.processor.removePacket(code);
 }
 /// <summary>
 /// Adds or replaces a packet handeler
 /// </summary>
 /// <param name="code">The Client code</param>
 /// <param name="packetFunction">The packet function which can handle a packet</param>
 public void registerPacket(ClientOpCode code, PacketRegistery<ClientOpCode, ClientIncomingPacket>.handlePacket packetFunction, bool handleImmidiate = false)
 {
     this.processor.registerPacket(code, packetFunction, handleImmidiate);
 }
Example #6
0
 public ServerOutgoingPacket(ClientOpCode opcode)
     : base((short)opcode)
 {
     mOpcode = opcode;
 }
 /// <summary>
 /// Removes a packet from the packet handeler
 /// </summary>
 /// <param name="code">The opcode that is removed from the game</param>
 public void removePacket(ClientOpCode code)
 {
     immidiateHandeler.removePacket(code);
     queueHandeler.removePacket(code);
 }
Example #8
0
 public ServerOutgoingPacket(ClientOpCode opcode)
     : base((short)opcode)
 {
     mOpcode = opcode;
 }