Esempio n. 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Device"/> class.
        /// </summary>
        /// <param name="Socket">The socket.</param>
        internal Device(Socket Socket)
        {
            this.Socket = Socket;

            this.Crypto = new Rjindael();
            this.Random = new XorShift(Resources.Random.Next());
        }
Esempio n. 2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Device"/> class.
        /// </summary>
        /// <param name="Socket">The socket.</param>
        internal Device(Socket Socket)
        {
            this.Socket = Socket;

            this.Crypto = new Rjindael("88778f76fwe67r5f78wer678r9we7" + "nonce");
            this.Random = new XorShift(Resources.Random.Next());
        }
Esempio n. 3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Device"/> class.
        /// </summary>
        /// <param name="Socket">The socket.</param>
        internal Device(Socket Socket)
        {
            this.Socket = Socket;

            this.Crypto = new Rjindael("asfddsfsd874397f7d98wq090qd80qw" + "nonce");
            this.Random = new XorShift(Resources.Random.Next());
        }
        /// <summary>
        /// Processes this instance.
        /// </summary>
        internal override void Process()
        {
            RC4Encrypter ReceiveEncrypter = (RC4Encrypter)this.Device.ReceiveEncrypter;
            RC4Encrypter SendEncrypter    = (RC4Encrypter)this.Device.SendEncrypter;

            string Nonce = Rjindael.ScrambleNonce((uint)this.Seed, this.Nonce);

            ReceiveEncrypter.Init(Factory.RC4Key + Nonce);
            SendEncrypter.Init(Factory.RC4Key + Nonce);
        }
Esempio n. 5
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Device"/> class.
        /// </summary>
        internal Device()
        {
            this.Socket          = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
            this.Crypto          = new Rjindael();
            this.Token           = new Token(new SocketAsyncEventArgs(), this);
            this.Player          = new Player();
            this.Gateway         = new Gateway(this);
            this.ReceivedPlayers = new List <Player>();

            this.KeepAlive();
        }
Esempio n. 6
0
        /// <summary>
        /// Reconnects this instance.
        /// </summary>
        internal void Reconnect()
        {
            if (this.UseRC4)
            {
                this.RC4 = new Rjindael();
            }

            this.Buffer = new byte[512];
            this.Socket.Dispose();
            this.Socket = null;
            this.Socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
            this.Socket.Bind(this.EndPoint);
            this.Socket.Connect(this.ServerIP, 9339);
        }
Esempio n. 7
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Client"/> class.
        /// </summary>
        internal Client()
        {
            this.Socket   = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
            this.EndPoint = new IPEndPoint(IPAddress.Any, 0);
            this.RC4      = new Rjindael();
            this.Buffer   = new byte[512];

            this.Version    = new int[3];
            this.Version[0] = 2;
            this.Version[1] = 0;
            this.Version[2] = 57;

            this.Socket.Bind(this.EndPoint);
            this.Socket.Connect(this.ServerIP, 9339);

            while (!this.Found)
            {
                this.Send();
                this.Receive();
                this.Reconnect();
            }

            this.Socket.Close(5);
        }
Esempio n. 8
0
 /// <summary>
 /// Initializes a new instance of the <see cref="EnDecrypt"/> class.
 /// </summary>
 public EnDecrypt()
 {
     this.CRjindael = new Rjindael();
     this.SRjindael = new Rjindael();
 }
Esempio n. 9
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Device"/> class.
 /// </summary>
 internal Device()
 {
     this.Crypto = new Rjindael();
     this.Token  = new Token(new SocketAsyncEventArgs(), this);
 }
Esempio n. 10
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Device"/> class.
 /// </summary>
 /// <param name="Socket">The socket.</param>
 /// <param name="Token">The token.</param>
 internal Device(Socket Socket, Token Token)
 {
     this.Socket = Socket;
     this.Token  = Token;
     this.Crypto = new Rjindael();
 }
Esempio n. 11
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Device"/> class.
 /// </summary>
 /// <param name="_Socket">The socket.</param>
 internal Device(Socket Socket)
 {
     this.Socket = Socket;
     this.Crypto = new Rjindael();
 }
Esempio n. 12
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Device"/> class.
 /// </summary>
 /// <param name="Socket">The socket.</param>
 internal Device(Socket Socket)
 {
     this.Socket   = Socket;
     this.RC4      = new Rjindael("fhsd6f86f67rt8fw78fw789we78r9789wer6re" + "nonce");
     this.GameMode = new GameMode(this);
 }