상속: ConnectionEventArgs
예제 #1
0
        protected virtual void OnDataSent(ConnectionDataEventArgs e)
        {
            var handler = DataSent;

            if (handler != null)
            {
                handler(this, e);
            }
        }
예제 #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();
        }
예제 #3
0
파일: IOClient.cs 프로젝트: vans163/LKEmu
        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();
        }
예제 #4
0
 void GameServer_DataReceived(object sender, ConnectionDataEventArgs e)
 {
     var connection = (Connection)e.Connection;
     ((IOClient)connection.Client).Parse(e);
 }
예제 #5
0
 protected virtual void OnDataSent(ConnectionDataEventArgs e)
 {
     var handler = DataSent;
     if (handler != null) handler(this, e);
 }
예제 #6
0
        void GameServer_DataReceived(object sender, ConnectionDataEventArgs e)
        {
            var connection = (Connection)e.Connection;

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