Inheritance: ConnectionEventArgs
Example #1
0
        protected virtual void OnDataSent(ConnectionDataEventArgs e)
        {
            var handler = DataSent;

            if (handler != null)
            {
                handler(this, e);
            }
        }
Example #2
0
        public void Parse(ConnectionDataEventArgs e)
        {
            incomingStream.AppendData(e.Data.ToArray());
            while (incomingStream.IsPacketAvailable())
            {
                var packet = incomingStream.PopPacket();

                try
                {
                    //   Logger.LogIncomingPacket(message);
                    Console.WriteLine(string.Format("Recv {0} - {1}:  {2}",
                        packet.Length, DateTime.Now.ToLocalTime().TimeOfDay.ToString().Remove(10, 4), packet.ToFormatedHexString()));
                    HandleIncoming(packet);
                }
                catch (NotImplementedException) { }
                catch (Exception ee)
                {
                    Console.WriteLine(string.Format("Unknown incoming Packet exception: {0}", ee.StackTrace));
                }
            }
            incomingStream.Flush();
        }
Example #3
0
        public void Parse(ConnectionDataEventArgs e)
        {
            incomingStream.AppendData(e.Data.ToArray());
            while (incomingStream.IsPacketAvailable())
            {
                var packet = incomingStream.PopPacket();

                try
                {
                    //   Logger.LogIncomingPacket(message);
                    Console.WriteLine(string.Format("Recv {0} - {1}:  {2}",
                                                    packet.Length, DateTime.Now.ToLocalTime().TimeOfDay.ToString().Remove(10, 4), packet.ToFormatedHexString()));
                    HandleIncoming(packet);
                }
                catch (NotImplementedException) { }
                catch (Exception ee)
                {
                    Console.WriteLine(string.Format("Unknown incoming Packet exception: {0}", ee.StackTrace));
                }
            }
            incomingStream.Flush();
        }
Example #4
0
 void GameServer_DataReceived(object sender, ConnectionDataEventArgs e)
 {
     var connection = (Connection)e.Connection;
     ((IOClient)connection.Client).Parse(e);
 }
Example #5
0
 protected virtual void OnDataSent(ConnectionDataEventArgs e)
 {
     var handler = DataSent;
     if (handler != null) handler(this, e);
 }
Example #6
0
        void GameServer_DataReceived(object sender, ConnectionDataEventArgs e)
        {
            var connection = (Connection)e.Connection;

            ((IOClient)connection.Client).Parse(e);
        }