protected internal override void Run() { _Client._Account = AuthService.GetInstance().AuthAccount(Name, Md5Pass); if (_Client._Account != null) { _Client._Account._Client = _Client; _Client._Account.LastAddress = IpAddress; _Client._Account.Setting = new AccountSetting(); MdbAccount.GetInstance().UpdateAccount(_Client._Account); _Client.SendPacket(new ResponseAuth()); } }
public AuthResponse AuthAccount(string login, string password, ref Account account) { AuthResponse result; account = MdbAccount.GetInstance().GetAccountByName(login); if (account != null) { if (account.Password == password) { result = AuthResponse.Success; } else { result = AuthResponse.WrongInfo; } } else { if (Configuration.Setting.AutoAccount) { account = new Account() { Name = login, Password = password, LastAddress = "0.0.0.0", DeletePasswd = "0000000000", }; MdbAccount.GetInstance().AddAccount(account); result = AuthResponse.Success; } else { result = AuthResponse.WrongInfo; } } return(result); }
public Account AuthAccount(string login, string password) { var account = MdbAccount.GetInstance().GetAccountByName(login); return((account != null) ? account : null); }