private static void Main(string[] args) { Console.Title = "Envium client"; ClientName = "Draiget"; ServerPassword = ""; _clientState = new ClientState(); _socket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp); _socket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, true); _socket.Bind(new IPEndPoint(IPAddress.Any, 0)); Networking.Initialize(); _clientState.Initialize(_socket); IntervalPerTick = GetTickInterval(); new Thread(NetTick) { IsBackground = true }.Start(); new Thread(GameTick) { IsBackground = true }.Start(); Console.WriteLine(">> Ready for commands."); var read = string.Empty; while ((read = Console.ReadLine()) != "exit") { if (read != null && read.StartsWith("connect")) { _clientState.Connect(read.Substring(8)); continue; } if (read != null && read.StartsWith("disconnect")) { _clientState.Disconnect(true); continue; } Console.WriteLine("Unknown command \"{0}\".", read); } }