public GwentClient(TcpClient NewClient, GwentServer server) { this.Id = Guid.NewGuid().ToString(); this.GwentServer = server; this.Client = NewClient; this.ClientStream = NewClient.GetStream(); this.Health = 2; this.Scope = 0; }
public void Dispose() { if (ClientStream != null) { ClientStream.Close(); } if (Client != null) { Client.Close(); GwentServer = null; } }
static void Main(string[] args) { try { GwentServer server = new GwentServer(); Thread ServerThread = new Thread(new ThreadStart(server.WaitForConnection)); ServerThread.Start(); } catch (Exception ex) { Console.WriteLine(ex.Message); } }