예제 #1
0
        public void Callback(object custom)
        {
            foreach (IStronghold stronghold in strongholdManager)
            {
                IMultiObjectLock multiObjecLock;
                if (stronghold.StrongholdState == StrongholdState.Occupied)
                {
                    multiObjecLock = locker.Lock(stronghold, stronghold.Tribe);
                    stronghold.Tribe.VictoryPoint += stronghold.VictoryPointRate;
                    dbManager.Save(stronghold.Tribe);
                }
                else
                {
                    multiObjecLock = locker.Lock(stronghold);
                }
                strongholdManager.UpdateGate(stronghold);
                dbManager.Save(stronghold);
                multiObjecLock.UnlockAll();
            }

            SetNextExecution();
            scheduler.Put(this);
        }