public DummyFrature() { _Records = new List <GamePlayerRecord>(); _Accounts = new List <Account> { new Account { Id = Guid.NewGuid(), Password = "******", Name = "name", Competnces = Account.AllCompetnce() }, new Account { Id = Guid.NewGuid(), Password = "******", Name = "vgameadmini", Competnces = Account.AllCompetnce() }, new Account { Id = Guid.NewGuid(), Password = "******", Name = "user1", Competnces = Account.AllCompetnce() } }; }
public void TestAccountValid() { var account = new Account(); Assert.AreNotEqual(null, account.Competnces); Assert.AreNotEqual(null, account.Name); Assert.AreNotEqual(null, account.Id); Assert.AreNotEqual(null, account.Password); }
Value <ACCOUNT_REQUEST_RESULT> IAccountManager.Update(Account account) { if (_Accounts.RemoveAll(a => a.Id == account.Id) > 0) { _Accounts.Add(account); return(ACCOUNT_REQUEST_RESULT.OK); } return(ACCOUNT_REQUEST_RESULT.NOTFOUND); }
public async Task<ActionResult> AddHandle(Account account) { var model = Service.Create(HttpContext.Items["StorageId"]); account.Guid = Guid.NewGuid(); var result = await model.AccountManager.Create(account).ToTask(); model.Release(); return RedirectToAction("Index"); }
Value<ACCOUNT_REQUEST_RESULT> IAccountManager.Create(Account account) { var result = _Find(account.Name); if(result != null) { return ACCOUNT_REQUEST_RESULT.REPEAT; } _Database.Add(account, obj => obj.Id); return ACCOUNT_REQUEST_RESULT.OK; }
private void _Attach(Account account) { _Binder.Bind<IStorageCompetences>(this); if(account.HasCompetnce(Account.COMPETENCE.ACCOUNT_FINDER)) { _Binder.Bind<IAccountFinder>(_Storage); _Binder.Bind<IGameRecorder>(_Storage); } if(account.HasCompetnce(Account.COMPETENCE.ACCOUNT_MANAGER)) { _Binder.Bind<IAccountManager>(_Storage); } _Binder.Bind<ITradeNotes>(_Storage); _Binder.Bind<IFormulaFarmRecorder>(_Storage); _Binder.Bind<IFormulaPlayerRecorder>(_Storage); }
Value<ACCOUNT_REQUEST_RESULT> IAccountManager.Update(Account account) { if(_Accounts.RemoveAll(a => a.Id == account.Id) > 0) { _Accounts.Add(account); return ACCOUNT_REQUEST_RESULT.OK; } return ACCOUNT_REQUEST_RESULT.NOTFOUND; }
Value<ACCOUNT_REQUEST_RESULT> IAccountManager.Create(Account account) { _Accounts.Add(account); return ACCOUNT_REQUEST_RESULT.OK; }
private void _GetAccounts(Account[] obj) { _Accounts = obj; }
private void _VerifySuccess(Account account) { _VerifySuccessEvent(account.Guid); _Account = account; _ToRelease(account); }
public StroageAccess(ISoulBinder binder, Account account, IStorage storage) { _Binder = binder; _Account = account; _Storage = storage; }
private void _HandleGuest() { _Logger.Info().Message("_HandleGuest From DB Start.").Write(); var accounts = _Find("Guest"); _Logger.Info().Message("_HandleGuest From DB Finish.").Write(); if (accounts == null) { var account = new Account { Guid = Guid.NewGuid(), Name = "Guest", Password = "******", Competnces = new Flag<Account.COMPETENCE>(Account.COMPETENCE.FORMULA_QUERYER) }; _Database.Add(account, obj => obj.Id); } }
private void _HandleAdministrator() { _Logger.Info().Message("_HandleAdministrator From DB Start.").Write(); var accounts = _Find(_DefaultAdministratorName); _Logger.Info().Message("_HandleAdministrator From DB Finish.").Write(); if (accounts == null) { var account = new Account { Guid = Guid.NewGuid(), Name = _DefaultAdministratorName, Password = "******", Competnces = Account.AllCompetnce() }; _Database.Add(account, obj => obj.Id); _Database.Add(new TradeNotes { Owner = account.Guid }, obj => obj.Id); } }
Value<ACCOUNT_REQUEST_RESULT> IAccountManager.Update(Account account) { if(_Database.Update(account, a => a.Id)) { return ACCOUNT_REQUEST_RESULT.OK; } return ACCOUNT_REQUEST_RESULT.NOTFOUND; }
private void _ToRelease(Account account) { var stage = new StroageAccess(_Binder, account, _Storage); stage.OnDoneEvent += _ToVerify; _Machine.Push(stage); }
private FishHunter.Verify _CreateVerify() { _Account = null; var verify = new FishHunter.Verify(_Storage); return verify; }
private void _ToVerify() { _Account = null; var verify = new Verify(_ExpansionFeature.AccountFinder); var stage = new Storage.Verify(_Binder, verify); stage.DoneEvent += _VerifySuccess; _Machine.Push(stage); }
private void _VerifySuccess(Account account) { if(account.IsFormulaQueryer()) { _Account = account; _OnVerifySuccessEvent(_Account.Guid); _ToFishStage(); } else { _ToVerify(); } }
private Verify _CreateVerify() { _Account = null; var verify = new Verify(_AccountFinder); return verify; }
Value <ACCOUNT_REQUEST_RESULT> IAccountManager.Create(Account account) { _Accounts.Add(account); return(ACCOUNT_REQUEST_RESULT.OK); }
private void _VerifySuccess(Account account) { _VerifySuccessEvent(account.Guid); _Account = account; _ToQueryRecord(); }