/// <summary> /// We cant modify connected client accounts. When the account goes offline, /// we re-enable the update button and status /// </summary> /// <param name="sender"></param> private void GpcmClient_OnDisconnect(object sender) { GpcmClient Client = (GpcmClient)sender; if (Client.PlayerId == AccountId) { // Since we are in a different thread, Invoke Invoke(new Action(() => { SatusLabel.Text = "Offline"; UpdateBtn.Enabled = true; DeleteBtn.Enabled = true; DisconnectBtn.Enabled = false; })); } }
/// <summary> /// We cant modify connected client accounts. When the account logs in, /// we disable the update buttonn and update the status /// </summary> /// <param name="sender"></param> private void GpcmClient_OnSuccessfulLogin(object sender) { GpcmClient Client = (GpcmClient)sender; if (Client.PlayerId == AccountId) { // Since we are in a different thread, Invoke Invoke(new Action(() => { SatusLabel.Text = "Online (IP: " + Client.RemoteEndPoint.Address.ToString() + ")"; UpdateBtn.Enabled = false; DeleteBtn.Enabled = false; DisconnectBtn.Enabled = true; })); } }
public PlayerStatusUpdate(GpcmClient client, LoginStatus status) { this.Client = client; this.Status = status; }