public static void Test(IdentificationFailureReasonEnum reason, AccountUC account) { switch (reason) { case IdentificationFailureReasonEnum.WRONG_CREDENTIALS: account.Log(new ErrorTextInformation("Echec de connexion : mauvais identifiants."), 0); break; case IdentificationFailureReasonEnum.BANNED: account.Log(new ErrorTextInformation("Echec de connexion : compte banni."), 0); break; case IdentificationFailureReasonEnum.KICKED: account.Log(new ErrorTextInformation("Echec de connexion : compte banni temporairement."), 0); break; case IdentificationFailureReasonEnum.IN_MAINTENANCE: account.Log(new ErrorTextInformation("Echec de connexion : serveur en maintenance."), 0); account.TryReconnect(15); break; default: account.Log(new ErrorTextInformation("Echec de connexion : erreur inconnue."), 0); break; } }
public static void IdentificationFailedMessageTreatment(Message message, byte[] packetDatas, AccountUC account) { IdentificationFailedMessage identificationFailedMessage = (IdentificationFailedMessage)message; account.Log(new ErrorTextInformation("Echec de l'identification."), 0); using (BigEndianReader reader = new BigEndianReader(packetDatas)) { identificationFailedMessage.Deserialize(reader); } IdentificationFailureReasonEnum.Test(identificationFailedMessage.reason, account); account.SocketManager.DisconnectFromGUI(); }
public static void SendIdentificationFailedMessage(AuthClient client, IdentificationFailureReasonEnum reason) { client.Send(new IdentificationFailedMessage((sbyte)reason)); }
public static Task HandleIdentificationFailedMessage(Account account, IdentificationFailedMessage message) => Task.Run(() => { IdentificationFailureReasonEnum reason = (IdentificationFailureReasonEnum)message.Reason; account.Logger.LogError("IdentificationFrame", LanguageManager.Translate("86", reason)); });