Exemplo n.º 1
0
 public bool LoadFromDatabase()
 {
     using (PlayerBussiness db = new PlayerBussiness())
     {
         PlayerInfo detail = db.GetUserSingleByUserID(m_character.ID);
         if (detail == null)
         {
             Out.SendKitoff(LanguageMgr.GetTranslation("UserLoginHandler.Forbid"));
             Client.Disconnect();
             return false;
         }
         else
         {
             m_character = detail;
         }
         ChargeToUser();
         int[] sole = new int[] { 0, 1, 2 };
         Out.SendUpdateInventorySlot(FightBag, sole);
         UpdateItemForUser(1);
         UpdateVIPForUser();
         //AddGP(0);
         UpdateWeapon(m_mainBag.GetItemAt(6));
         UpdateSecondWeapon(m_mainBag.GetItemAt(15));
         m_pvepermissions = string.IsNullOrEmpty(detail.PvePermission) ? InitPvePermission() : m_converter.GetBytes(detail.PvePermission);
         _friends = new Dictionary<int, int>();
         _friends = db.GetFriendsIDAll(m_character.ID);
         m_character.State = 1;
         db.UpdatePlayer(m_character);
         //  db.UpdateVIPInfo(m_character);
         return true;
     }
 }