Ejemplo n.º 1
0
 void _transport_PacketReceived(Stormancer.Core.Packet obj)
 {
     if (_pluginCtx.PacketReceived != null)
     {
         _pluginCtx.PacketReceived(obj);
     }
     _dispatcher.DispatchPacket(obj);
 }
Ejemplo n.º 2
0
        private void Transport_PacketReceived(Stormancer.Core.Packet obj)
        {
            //if (_pluginCtx.PacketReceived != null)
            //{
            //    _pluginCtx.PacketReceived(obj);
            //}

            _dispatcher.DispatchPacket(obj);
        }
Ejemplo n.º 3
0
        private void OnMessageReceived(RakNet.Packet packet)
        {
            var connection = GetConnection(packet.guid);
            var buffer     = new byte[packet.data.Length];

            packet.data.CopyTo(buffer, 0);
            _peer.DeallocatePacket(packet);
            var p = new Stormancer.Core.Packet(
                connection,
                new MemoryStream(buffer));

            _logger.Trace("transports.raknet", "message with id {0} arrived", buffer[0]);

            this.PacketReceived(p);
        }
        private void OnMessageReceived(RakNet.Packet packet)
        {
            //var messageId = packet.data[0];
            var connection = GetConnection(packet.guid);
            var stream     = new MemoryStream((int)packet.length);

            //var buffer = new byte[packet.data.Length];
            stream.Write(packet.data, 0, (int)packet.length);
            stream.Seek(0, SeekOrigin.Begin);
            _peer.DeallocatePacket(packet);
            //logger.Trace("message arrived: [{0}]", string.Join(", ", buffer.Select(b => b.ToString()).ToArray()));

            var p = new Stormancer.Core.Packet(
                connection,
                stream);


            this.PacketReceived(p);
        }
Ejemplo n.º 5
0
        private void OnMessageReceived(RakNet.Packet packet)
        {
            var messageId  = packet.data[0];
            var connection = GetConnection(packet.guid);
            var stream     = new MemoryStream((int)packet.length);

            //var buffer = new byte[packet.data.Length];
            stream.Write(packet.data, 0, (int)packet.length);
            stream.Seek(0, SeekOrigin.Begin);
            logger.Log(Stormancer.Diagnostics.LogLevel.Trace, "transport", "message received  at " + DateTime.Now + "." + DateTime.Now.Millisecond + ": " + string.Join(";", packet.data.Select(b => b.ToString()).ToArray()));
            _peer.DeallocatePacket(packet);
            //logger.Trace("message arrived: [{0}]", string.Join(", ", buffer.Select(b => b.ToString()).ToArray()));

            var p = new Stormancer.Core.Packet(
                connection,
                stream);


            this.PacketReceived(p);
        }
Ejemplo n.º 6
0
        private void OnMessageReceived(RakNet.Packet packet)
        {
            //var messageId = packet.data[0];
            var connection = GetConnection(packet.guid);
            var stream = new MemoryStream((int)packet.length);
            //var buffer = new byte[packet.data.Length];
            stream.Write(packet.data, 0, (int)packet.length);
            stream.Seek(0, SeekOrigin.Begin);
            _peer.DeallocatePacket(packet);
            //logger.Trace("message arrived: [{0}]", string.Join(", ", buffer.Select(b => b.ToString()).ToArray()));

            var p = new Stormancer.Core.Packet(
                               connection,
                               stream);


            this.PacketReceived(p);
        }
        private void OnMessageReceived(RakNet.Packet packet)
        {
            var connection = GetConnection(packet.guid);
            var buffer = new byte[packet.data.Length];
            packet.data.CopyTo(buffer, 0);
            _peer.DeallocatePacket(packet);
            //logger.Trace("message arrived: [{0}]", string.Join(", ", buffer.Select(b => b.ToString()).ToArray()));

            var p = new Stormancer.Core.Packet(
                               connection,
                               new MemoryStream(buffer));


            this.PacketReceived(p);
        }
Ejemplo n.º 8
0
        private void OnMessageReceived(RakNet.Packet packet)
        {
            var messageId = packet.data[0];
            var connection = GetConnection(packet.guid);
            var stream = new MemoryStream((int)packet.length);
            //var buffer = new byte[packet.data.Length];
            stream.Write(packet.data, 0, (int)packet.length);
            stream.Seek(0, SeekOrigin.Begin);
            logger.Log(Stormancer.Diagnostics.LogLevel.Trace, "transport", "message received  at " + DateTime.Now + "." + DateTime.Now.Millisecond + ": " + string.Join(";", packet.data.Select(b=>b.ToString()).ToArray()));
            _peer.DeallocatePacket(packet);
            //logger.Trace("message arrived: [{0}]", string.Join(", ", buffer.Select(b => b.ToString()).ToArray()));

            var p = new Stormancer.Core.Packet(
                               connection,
                               stream);


            this.PacketReceived(p);
        }