protected void Connect() { try { isClosing = false; this.connection = new TcpClient(); this.recvCrypto = new RC4(new byte[] { 0x72, 0xc5, 0x58, 0x3c, 0xaf, 0xb6, 0x81, 0x89, 0x95, 0xcb, 0xd7, 0x4b, 0x80 }); this.sendCrypto = new RC4(new byte[] { 0x31, 0x1f, 0x80, 0x69, 0x14, 0x51, 0xc7, 0x1b, 0x09, 0xa1, 0x3a, 0x2a, 0x6e }); Console.WriteLine(new string('-', Console.WindowWidth) + "{3}Connecting to {0}: \n\r{4}IPAddress: {1}\n\r{5}Port: {2}\n\r" + new string('-', Console.WindowWidth), host.ServerName, host.IPAddress, host.Port, new string(' ', (Console.WindowWidth / 2) - (("Connecting to ".Length + host.ServerName.Length + 1) / 2)), new string(' ', (Console.WindowWidth / 2) - (("IPAddress: ".Length + host.IPAddress.ToString().Length) / 2)), new string(' ', (Console.WindowWidth / 2) - (("Port: ".Length + host.Port.ToString().Length) / 2))); RotMGClient.tick.Restart(); this.connection.Connect(host.IPAddress, host.Port); Console.WriteLine("Connected to {0}", host.ServerName); this.receiveThread = new Thread(new ThreadStart(ReceiveLoop)); this.receiveThread.Start(); } catch (Exception ex) { Console.WriteLine(ex); } }
internal RotMGConnection(Server host) { this.connection = new TcpClient(); this.host = host; this.recvCrypto = new RC4(new byte[] { 0x72, 0xc5, 0x58, 0x3c, 0xaf, 0xb6, 0x81, 0x89, 0x95, 0xcb, 0xd7, 0x4b, 0x80 }); this.sendCrypto = new RC4(new byte[] { 0x31, 0x1f, 0x80, 0x69, 0x14, 0x51, 0xc7, 0x1b, 0x09, 0xa1, 0x3a, 0x2a, 0x6e }); }