private void Close(object sender, System.Windows.Forms.FormClosedEventArgs e) { Console.WriteLine("Closing"); if (isServer) { if (server != null) { server.t.Abort(); } } else { string name = gui.data[(int)MMTextFieldSelected.UserName]; string pass = gui.data[(int)MMTextFieldSelected.Password]; PlayerPacket p = new PlayerPacket(ClientSocketHandler.clientSocket.LocalEndPoint as IPEndPoint, name, pass, PlayerStatus.Disconnecting, client.isSelfAlive, false); ClientSocketHandler.Send(p); } Exit(); }
public ClientController(string _userName = null) { clientSocket = new ClientSocketHandler(this); userName = _userName; }