private void OnLoginRequested(object o, LoginSendEventArgs e) { if (e.Connected) { //Send a command containing the login information (Field 0 = Server PW, Field 1 = User nickname). e.ServerConnection.SendUnreliableCommand(0, GenesisConsts.OPCODE_LOGINDETAILS, new string[] { txtServerPW.Text, txtNickName.Text }); spState.Text = "Sending login details..."; } else { //Server could not process our connection at this time (possibly full?) spState.Text = "Connection rejected - " + e.Reason; } }
/// <summary> /// Server has asked for our login details. /// </summary> private void m_UDP_OnLoginRequested(object o, LoginSendEventArgs e) { this.Invoke(new GenesisCore.SendLoginHandler(OnLoginRequested), new object[] { o, e }); }