public void SetBank(BankSave save)
 {
     mBankSave = save;
     if (mBankSave != null && bank == null)
     {
         bank = new Bank.Bank();
         bank.ParseInfo(mBankSave.bankInfo);
         log.InfoFormat("bank loaded max count = {0} [red]", bank.maxSlots);
         SendBankUpdate();
     }
 }
示例#2
0
        public BankSave LoadBank(string inlogin)
        {
            string login = inlogin.ToLower();

            var query = Query <BankSave> .EQ(b => b.login, login);

            var bank = banks.FindOne(query);

            if (bank != null)
            {
                return(bank);
            }
            else
            {
                Bank.Bank bankObj = new SelectCharacter.Bank.Bank();
                BankSave  save    = new BankSave {
                    bankInfo = bankObj.GetInfo(),
                    login    = login
                };
                banks.Save(save);
                return(save);
            }
        }