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

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

            Owner.SendToScreen(packet, true, false);
        }
Beispiel #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);
            }
        }