/// <summary> /// Check for bans and already logged in Accounts, else continue the journey /// </summary> /// <param name="client"></param> private static void AuthChallengeRequestCallback(IAuthClient client) { if (!client.IsConnected) { // Client disconnected in the meantime return; } if (BanMgr.IsBanned(client.ClientAddress)) { OnLoginError(client, AccountStatus.AccountBanned); } //else if (client.Server.IsAccountLoggedIn(client.AccountName)) //{ // OnLoginError(client, AccountStatus.AccountInUse); //} else { var acctQuery = new Action(() => { var acc = AccountMgr.GetAccount(client.AccountName); QueryAccountCallback(client, acc); }); AuthenticationServer.IOQueue.AddMessage(acctQuery); } }
private static void AuthChallengeRequestCallback(IRealmClient client) { if (!client.IsConnected) { // Client disconnected in the meantime return; } if (BanMgr.IsBanned(client.ClientAddress)) { OnLoginError(client, AccountStatus.CloseClient); } else { var acctQuery = new Action(() => { var acc = AccountMgr.GetAccount(client.AccountName); //if(acc != null && DateTime.Now - acc.LastLogin < new TimeSpan(0,0,0,30)) // return; if (acc == null) { if (RealmServerConfiguration.AutocreateAccounts) { QueryAccountCallback(client, null); } else { OnLoginError(client, AccountStatus.WrongLoginOrPass); } } else { if (acc.Password != client.Password) { if (client.ClientAddress != null) { Log.Create(Log.Types.AccountOperations, LogSourceType.Account, (uint)acc.AccountId) .AddAttribute("operation", 1, "login_wrong_pass") .AddAttribute("name", 0, acc.Name) .AddAttribute("ip", 0, client.ClientAddress.ToString()) .Write(); } OnLoginError(client, AccountStatus.WrongLoginOrPass); } else { QueryAccountCallback(client, acc); } } }); RealmServer.IOQueue.AddMessage(acctQuery); } }
private static void AuthChallengeRequestCallback(IRealmClient client) { if (!client.IsConnected) { return; } if (BanMgr.IsBanned(client.ClientAddress)) { AuthenticationHandler.OnLoginError(client, AccountStatus.CloseClient); } else { ServerApp <WCell.RealmServer.RealmServer> .IOQueue.AddMessage((Action)(() => { Account account = AccountMgr.GetAccount(client.AccountName); if (account == null) { if (RealmServerConfiguration.AutocreateAccounts) { AuthenticationHandler.QueryAccountCallback(client, (Account)null); } else { AuthenticationHandler.OnLoginError(client, AccountStatus.WrongLoginOrPass); } } else if (account.Password != client.Password) { if (client.ClientAddress != null) { Log.Create(Log.Types.AccountOperations, LogSourceType.Account, (uint)account.AccountId) .AddAttribute("operation", 1.0, "login_wrong_pass") .AddAttribute("name", 0.0, account.Name) .AddAttribute("ip", 0.0, client.ClientAddress.ToString()).Write(); } AuthenticationHandler.OnLoginError(client, AccountStatus.WrongLoginOrPass); } else { AuthenticationHandler.QueryAccountCallback(client, account); } })); } }