private void btnConnect_Click(object sender, EventArgs e) { btnConnect.Enabled = false; ymfasClient.Connect(txtConnectIP.Text); splashState = MainSplashState.Connecting; ticksConnecting = 0; }
private void btnHost_Click(object sender, EventArgs e) { //Host a game // create a client and a server for the game lobby to use ymfasServer = new YmfasServer(txtName.Text); ymfasClient = new YmfasClient(txtName.Text); ymfasClient.Update(); ymfasClient.Connect(IPAddress.Loopback); //Enter lobby GameLobby = new frmGameLobby(ymfasClient, ymfasServer); GameLobby.ShowDialog(); // if we actually started a game if (GameLobby.DialogResult == DialogResult.OK) { ymfasClient = GameLobby.Client; ymfasServer = GameLobby.Server; this.DialogResult = DialogResult.OK; this.Close(); } }