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(); }
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); } }
public Player(string name) { this.Pets = new PetCollection(); this.PlayerInventory = new Inventory(); this.Name = name; }