public CorporationHangarRentInfo GetCorporationHangarRentInfo()
        {
            var saveNeeded = false;

            if (!DynamicProperties.Contains(k.hangarPrice))
            {
                DynamicProperties.Update(k.hangarPrice, _corporationConfiguration.HangarPrice);
                saveNeeded = true;
            }

            if (!DynamicProperties.Contains(k.rentPeriod))
            {
                DynamicProperties.Update(k.rentPeriod, _corporationConfiguration.RentPeriod);
                saveNeeded = true;
            }

            if (saveNeeded)
            {
                this.Save();
            }

            return(new CorporationHangarRentInfo
            {
                price = DynamicProperties.GetOrAdd <int>(k.hangarPrice),
                period = TimeSpan.FromDays(DynamicProperties.GetOrAdd <int>(k.rentPeriod))
            });
        }
Beispiel #2
0
        public override void OnLoadFromDb()
        {
            if (DynamicProperties.Contains(k.depleted))
            {
                IsDepleted = DynamicProperties.GetOrAdd <int>(k.depleted) == 1;
            }
            else
            {
                DynamicProperties.Update(k.depleted, IsDepleted ? 1 : 0);
            }

            base.OnLoadFromDb();
        }
        public virtual void SetLogging(bool state, Character character, bool writeLog = false)
        {
            if (IsLogging() == state)
            {
                return;
            }

            DynamicProperties.Update(k.log, (state) ? 1 : 0);

            if (writeLog && character != Character.None)
            {
                ContainerLogger.AddLogEntry(character, state ? ContainerAccess.LogStart : ContainerAccess.LogStop);
            }
        }
Beispiel #4
0
        public void FullCoreRecharge()
        {
            var currentCore = DynamicProperties.GetOrAdd <double>(k.currentCore);

            var coreMaxValue = CoreMax;

            if (currentCore >= coreMaxValue)
            {
                return;
            }

            DynamicProperties.Update(k.currentCore, coreMaxValue);
            Core = CoreMax;
        }
Beispiel #5
0
        public override void OnUpdateToDb()
        {
            try
            {
                if (!IsRepackaged)
                {
                    DynamicProperties.Update(k.armor, Armor.Ratio(ArmorMax));
                    DynamicProperties.Update(k.currentCore, Core);
                }

                var zone = Zone;
                if (zone == null || States.Dead)
                {
                    return;
                }

                var character = Character;
                character.ZoneId       = zone.Id;
                character.ZonePosition = CurrentPosition;

                var p = DynamicProperties.GetProperty <int>(k.pvpRemaining);

                var pvpEffect = EffectHandler.GetEffectsByType(EffectType.effect_pvp).FirstOrDefault();
                if (pvpEffect == null)
                {
                    p.Clear();
                    return;
                }

                var effectTimer = pvpEffect.Timer;
                if (effectTimer != null)
                {
                    p.Value = (int)effectTimer.Remaining.TotalMilliseconds;
                }
            }
            finally
            {
                base.OnUpdateToDb();
            }
        }
 private void SaveToDb()
 {
     DynamicProperties.Update(k.currentEffect, (int)CurrentEffectType);
 }
Beispiel #7
0
 public void SetHangarAccess(Character character, CorporationRole corporationRole)
 {
     DynamicProperties.Update(k.hangarAccess, (int)corporationRole);
     AddLogEntry(character, ContainerAccess.SetAccess);
 }
Beispiel #8
0
 public override void OnInsertToDb()
 {
     DynamicProperties.Update(k.hangarAccess, (int)CorporationRole.HangarAccess_low);
 }
 public override void OnUpdateToDb()
 {
     DynamicProperties.Update(k.currentCore, Core);
     base.OnUpdateToDb();
 }
Beispiel #10
0
 private void SaveToDb()
 {
     DynamicProperties.Update(k.depleted, IsDepleted ? 1 : 0);
 }
Beispiel #11
0
 public void FullArmorRepair()
 {
     DynamicProperties.Update(k.armor, 1.0);
     Armor = ArmorMax;
 }