Beispiel #1
0
        public void LoadOther()
        {
            Start();
            try {
                log.InfoFormat("mmoActor LoadOther() [dy]");
                var dbInventory = InventoryDatabase.instance(application).LoadInventory(mCharacter.characterId, resource as Res);
                Inventory.Replace(dbInventory);
                Inventory.ChangeMaxSlots(mShip.holdCapacity);

                bool stationIsNew = false;
                var  dbStation    = StationDatabase.instance(application).LoadStation(mCharacter.characterId, resource as Res, out stationIsNew);
                Station.SetInventory(dbStation.StationInventory);
                Station.SetPetSchemeAdded(dbStation.petSchemeAdded);

                if (false == Station.petSchemeAdded)
                {
                    AddPetSchemeToNewPlayer();
                    Station.SetPetSchemeAdded(true);
                }
                UpdateCharacterOnMaster();
                log.InfoFormat("player = {0} started at position = {1}", GetComponent <PlayerCharacterObject>().login, transform.position);
            } catch (Exception e) {
                log.InfoFormat(e.Message);
                log.ErrorFormat(e.StackTrace);
            }
        }
Beispiel #2
0
        public void SaveInventory()
        {
            var character = GetComponent <PlayerCharacterObject>();

            if (character == null)
            {
                return;
            }
            var app = nebulaObject.mmoWorld().application;

            InventoryDatabase.instance(app).SaveInventory(character.characterId, player.Inventory);
        }
Beispiel #3
0
        public void Save(bool forceSaveToDB)
        {
            if (mLoaded)
            {
                if (player == null)
                {
                    return;
                }
                var character = GetComponent <PlayerCharacterObject>();
                if (character == null)
                {
                    return;
                }

                try {
                    var app = nebulaObject.mmoWorld().application;
                    InventoryDatabase.instance(app).SaveInventory(character.characterId, player.Inventory);
                    StationDatabase.instance(app).SaveStation(character.characterId, player.Station);
                    CharacterDatabase.instance(app).SaveCharacter(character.characterId, player.GetPlayerCharacter());
                    ShipModelDatabase.instance(app).SaveShipModel(character.characterId, GetComponent <PlayerShip>().shipModel);
                    SkillDatabase.instance(app).SaveSkills(character.characterId, GetComponent <PlayerSkills>().GetSave());
                    WeaponDatabase.instance(app).SaveWeapon(character.characterId, player.GetComponent <ShipWeapon>().GetSave());
                    PassiveBonusesDatabase.instance(app).SavePassiveBonuses(character.characterId, player.GetComponent <PassiveBonusesComponent>().GetSave());
                    TimedEffectsDatabase.instance(app).SaveTimedEffects(character.characterId, player.GetComponent <PlayerTimedEffects>().GetInfo());
                    PetDatabase.instance(app).SavePets(character.characterId, player.GetComponent <PetManager>().pets);
                    ContractDatabase.instance(app).SaveContracts(character.characterId, player.GetComponent <ContractManager>().GetSave());
                    AchievmentDatabase.instance(app).SaveAchievment(character.characterId, player.GetComponent <AchievmentComponent>().GetSave());
                    QuestDatabase.instance(app).SaveQuests(character.characterId, player.GetComponent <QuestManager>().GetSave());
                    //QuestDatabase.instance(app).SaveQuests(character.characterId, player.GetComponent<QuestManager>().GetInfo());
                    //DialogDatabase.instance(app).SaveDialogs(character.characterId, player.GetComponent<DialogManager>().GetInfo());
                } catch (Exception exception) {
                    log.Error("handled exception at Player Loaded Object");
                    log.Error(exception.Message);
                    log.Error(exception.StackTrace);
                }
            }
        }