private void IEndLogin(ENetError result, uint flags, uint[] droid, Guid uuid) { fParent.LogInfo(String.Format("Login Complete [RESULT: {0}]", result.ToString().Substring(7))); fAcctUuid = uuid; switch (result) { case ENetError.kNetErrAccountBanned: MessageBox.Show(this, "Your account has been banned", "Banned", MessageBoxButtons.OK, MessageBoxIcon.Error); break; case ENetError.kNetErrAccountNotActivated: MessageBox.Show(this, "Your account is not activated", "Not Activated", MessageBoxButtons.OK, MessageBoxIcon.Error); break; case ENetError.kNetErrAccountNotFound: MessageBox.Show(this, "Your account was not found on the server.", "Account Not Found", MessageBoxButtons.OK, MessageBoxIcon.Error); break; case ENetError.kNetErrAuthenticationFailed: MessageBox.Show(this, "Your password is invalid. Please ensure CAPS LOCK is off.", "Invalid Password", MessageBoxButtons.OK, MessageBoxIcon.Error); break; case ENetError.kNetErrLoginDenied: MessageBox.Show(this, "The server is denying login attempts. Please try again later.", "Login Denied", MessageBoxButtons.OK, MessageBoxIcon.Information); break; case ENetError.kNetErrTooManyFailedLogins: MessageBox.Show(this, "You have failed to authenticate too many times. Please try again later.", "Login Denied", MessageBoxButtons.OK, MessageBoxIcon.Error); break; case ENetError.kNetSuccess: DialogResult = DialogResult.OK; Close(); break; default: MessageBox.Show(this, "Unhandled Error Code: " + result.ToString().Substring(4), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); break; } //Reenable button fLogin.Enabled = true; }
public static string GetErrorString(ENetError result) { switch (result) { case ENetError.kNetErrAccountAlreadyExists: return "Account Already Exists"; case ENetError.kNetErrAccountBanned: return "Account Banned"; case ENetError.kNetErrAccountNotActivated: return "Account Not Activated"; case ENetError.kNetErrAccountNotFound: return "Account Not Found"; case ENetError.kNetErrActivationCodeNotFound: return "Activation Code Not Found"; case ENetError.kNetErrAgeNotFound: return "Age not Found"; case ENetError.kNetErrAuthenticationFailed: return "Authentication Failed"; case ENetError.kNetErrAuthTokenTooOld: return "Authentication Token Too Old"; case ENetError.kNetErrBadServerData: return "Bad Server Data"; case ENetError.kNetErrCircularReference: return "Circular Reference"; case ENetError.kNetErrConnectFailed: return "Connection Failed"; case ENetError.kNetErrDisconnected: return "Disconnected"; case ENetError.kNetErrFileNotFound: return "File Not Found"; case ENetError.kNetErrGameTapConnectionFailed: return "Could Not Connect To GameTap"; case ENetError.kNetErrGTMissingParameter: return "Missing GameTap Paramater"; case ENetError.kNetErrGTServerError: return "GameTap Error"; case ENetError.kNetErrGTTooManyAuthOptions: return "Too Many GameTap Authentication Options"; case ENetError.kNetErrInternalError: return "Internal Error"; case ENetError.kNetErrInvalidParameter: return "Invalid Parameter"; case ENetError.kNetErrInviteNoMatchingPlayer: return "No Matching Player for Invitation"; case ENetError.kNetErrInviteTooManyHoods: return "Too Many Neighborhoods for Invitation"; case ENetError.kNetErrKeyAlreadyUsed: return "Key Already Used"; case ENetError.kNetErrKeyNotFound: return "Key Not Found"; case ENetError.kNetErrKickedByCCR: return "Kicked Off"; case ENetError.kNetErrLoggedInElsewhere: return "Logged in Elsewhere"; case ENetError.kNetErrLoginDenied: return "Login Denied"; case ENetError.kNetErrMaxPlayersOnAcct: return "Maxmium Number of Players on Account"; case ENetError.kNetErrMustUseGameTapClient: return "Must use GameTap Client"; case ENetError.kNetErrNameLookupFailed: return "Name Lookup Failed"; case ENetError.kNetErrNeedToPay: return "You Need to Pay"; case ENetError.kNetErrNotSupported: return "Not Supported"; case ENetError.kNetErrOldBuildId: return "Old Build"; case ENetError.kNetErrPlayerAlreadyExists: return "Player Already Exists"; case ENetError.kNetErrPlayerNameInvalid: return "Player Name Incorrect"; case ENetError.kNetErrPlayerNotFound: return "Player Not Found"; case ENetError.kNetErrRemoteShutdown: return "Remote Shutdown"; case ENetError.kNetErrScoreAlreadyExists: return "Score Already Exists"; case ENetError.kNetErrScoreNoDataFound: return "No Score Data Found"; case ENetError.kNetErrScoreNotEnoughPoints: return "Not Enough Points"; case ENetError.kNetErrScoreWrongType: return "Wrong Score Type"; case ENetError.kNetErrServerBusy: return "Server Busy"; case ENetError.kNetErrServiceForbidden: return "Service Forbidden"; case ENetError.kNetErrStateObjectNotFound: return "State Object Not Found"; case ENetError.kNetErrTimeout: return "Timeout"; case ENetError.kNetErrTimeoutOdbc: return "ODBC Timeout"; case ENetError.kNetErrTooManyFailedLogins: return "Too Many Failed Logins"; case ENetError.kNetErrVaultNodeAccessViolation: return "Vault Node Access Violation"; case ENetError.kNetErrVaultNodeNotFound: return "Vault Node Not Found"; case ENetError.kNetPending: return "Pending..."; case ENetError.kNetSuccess: return "Success!"; default: throw new ArgumentException("Unknown Result Code: " + result.ToString()); } }
private void IKickedByAuth(ENetError reason) { //Get the enum name of the reason string temp = reason.ToString().Substring(4); LogError(String.Format("KICKED OFF [REASON: {0}]", temp)); //Try to find a prettier reason, but fall back on the ugly one... string display = String.Format("UKNOWN REASON [{0}]", temp); switch (reason) { case ENetError.kNetErrDisconnected: display = "Something bad happened on the internet"; break; case ENetError.kNetErrKickedByCCR: display = "You were kicked by CCR"; break; case ENetError.kNetErrLoggedInElsewhere: display = "You logged in somewhere else"; break; case ENetError.kNetErrRemoteShutdown: display = "The servers went down"; break; } fNotifyIcon.ShowBalloonTip(30, "Disconnected", display, ToolTipIcon.Warning); IDisconnect(null, null); }
private void IAddUserNode(ENetError result, uint nodeID, uint parentID) { if (result != ENetError.kNetSuccess) { fParent.LogError("Failed to create a user node, so not adding it."); MessageBox.Show("Failed to create KI Mail\r\n" + result.ToString().Substring(4), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } // Ref the node. We'll add it to the list in a callback fParent.AuthCli.AddVaultNode(parentID, nodeID, fParent.fActivePlayer); }
protected override void OnAuthPlayerSet(uint transID, ENetError result) { base.OnAuthPlayerSet(transID, result); LogInfo(String.Format("Player Set [RESULT: {0}]", result.ToString().Substring(4))); switch (result) { case ENetError.kNetErrPlayerNotFound: IShowError("Selected player not found!"); break; case ENetError.kNetSuccess: fActivePlayer = IGetPlayer().fID; AuthCli.FetchVaultTree(fActivePlayer); break; default: IShowError("Unhandled Error Code: " + result.ToString().Substring(4)); break; } }