//a generic object that can be used as a locking mechanism. // static readonly object theLock = new object(); public ServerGUI() { InitializeComponent(); string strHostName = System.Net.Dns.GetHostName(); IPHostEntry ipEntry = System.Net.Dns.GetHostEntry(strHostName); IPAddress[] addr = ipEntry.AddressList; lblAddress.Text = "Server IP address is " + addr[addr.Length - 2].ToString(); serverCore = new GameServer(this); output("Server ready to accept connections!"); }
/*Constructor is just for initialization. This does not give the client state, * only a user name and the network connection to the client computer. */ public GameClient(string name, TcpClient ClientSocket, GameServer netInt) { client = ClientSocket; server = netInt; userName = name; curTable = null; networkStream = null; connected = true; msgSent = new List<string>(); }