Exemple #1
0
        public void Send(uint packetId, IDataSerializer packet)
        {
            Packet pck = GetPacket(packetId);

            pck.WritePacket(packet);
            Send(pck);
            DataStreamPool.Return(pck.Stream);
        }
Exemple #2
0
 public void ReturnWriter(PacketWriter writer)
 {
     DataStreamPool.Return(writer.NetworkStream);
     DataStreamPool.Return(writer.PacketStream);
 }
Exemple #3
0
 public Packet GetPacket(uint id, IDataSerializer packet)
 {
     return(GetPacket(id, DataStreamPool.Take(), packet));
 }
Exemple #4
0
        public PacketWriter TakeWriter()
        {
            var writer = new PacketWriter(DataStreamPool.Take(), DataStreamPool.Take());

            return(writer);
        }
Exemple #5
0
 public Packet GetPacket(uint id)
 {
     return(GetPacket(id, DataStreamPool.Take()));
 }