예제 #1
0
        public void Send(ProjectX_V3_Lib.Network.DataPacket packet)
        {
            if (Owner == null)
                return;

            Owner.Send(packet);
        }
예제 #2
0
        public void SendToScreen(ProjectX_V3_Lib.Network.DataPacket packet)
        {
            if (Owner == null)
                return;

            Owner.SendToScreen(packet, true, false);
        }
예제 #3
0
        public static bool HandleExchange(GameCrypto Crypto, ProjectX_V3_Lib.Network.SocketClient sClient, ProjectX_V3_Lib.Network.DataPacket Packet)
        {
            try
            {
                byte[] packet = Packet.Copy();

                ushort position = 7;
                uint PacketLen = BitConverter.ToUInt32(packet, position);
                position += 4;
                int JunkLen = BitConverter.ToInt32(packet, position);
                position += 4;
                position += (ushort)JunkLen;
                int Len = BitConverter.ToInt32(packet, position);
                position += 4;
                byte[] pubKey = new byte[Len];
                for (int x = 0; x < Len; x++)
                    pubKey[x] = packet[x + position];
                string PubKey = pubKey.GetString(); // System.Text.ASCIIEncoding.ASCII.GetString(pubKey);
                Crypto = Crypto.DHKeySequence.HandleClientKeyPacket(PubKey, Crypto);
                Crypto.Exchanged = true;
                return true;
            }
            catch
            {
                return false;
            }
        }
예제 #4
0
 /// <summary>
 /// Called whenever the server shuts down CORRECT!
 /// </summary>
 /// <param name="sig"></param>
 /// <returns></returns>
 private static bool Console_CloseEvent(ProjectX_V3_Lib.Native.Kernel32.CtrlType sig)
 {
     AllowConnections = false;
     try
     {
         Shutdown(true);
         return true;
     }
     catch (Exception e)
     {
         Console.WriteLine(e.ToString());
         return false;
     }
 }