Exemplo n.º 1
0
 public void Load()
 {
     Start();
     if (m_Character == null) {
         m_Character = GetComponent<PlayerCharacterObject>();
     }
     bool isNew = false;
     m_PetInfoCollection = PetDatabase.instance(nebulaObject.mmoWorld().application).LoadPets(m_Character.characterId, nebulaObject.resource as Res, out isNew);
     Reinitialize();
 }
Exemplo n.º 2
0
 public void SavePets(string characterID, PetCollection pets)
 {
     lock (sync) {
         s_Log.InfoFormat("save pets for character = {0}".Color(LogColor.red), characterID);
         var document = m_PetDocuments.FindOne(Query <PetDocument> .EQ(doc => doc.characterId, characterID));
         if (document == null)
         {
             document = new PetDocument {
                 characterId = characterID
             };
         }
         document.isNewDocument = false;
         document.Set(pets.GetSave());
         m_PetDocuments.Save(document);
     }
 }
Exemplo n.º 3
0
 public Player(string name)
 {
     this.Pets            = new PetCollection();
     this.PlayerInventory = new Inventory();
     this.Name            = name;
 }