Example #1
0
        public void Update(int dt)
        {
            switch (this._notificationsAboutStart)
            {
            case 1:
                if (DateTime.Now > this.StartTime.Subtract(new TimeSpan(0, 5, 0)))
                {
                    --this._notificationsAboutStart;
                    WCell.RealmServer.Global.World.BroadcastMsg("War Manager",
                                                                string.Format("{1} in {0} starts in 5 mins.", (object)this.Town, (object)this.WarType),
                                                                Color.Firebrick);
                    Asda2BattlegroundHandler.SendMessageServerAboutWarStartsResponse((byte)5);
                    break;
                }

                break;

            case 2:
                if (DateTime.Now > this.StartTime.Subtract(new TimeSpan(0, 15, 0)))
                {
                    --this._notificationsAboutStart;
                    WCell.RealmServer.Global.World.BroadcastMsg("War Manager",
                                                                string.Format("{1} in {0} starts in 15 mins.", (object)this.Town, (object)this.WarType),
                                                                Color.Firebrick);
                    Asda2BattlegroundHandler.SendMessageServerAboutWarStartsResponse((byte)15);
                    break;
                }

                break;

            case 3:
                if (DateTime.Now > this.StartTime.Subtract(new TimeSpan(0, 30, 0)))
                {
                    --this._notificationsAboutStart;
                    WCell.RealmServer.Global.World.BroadcastMsg("War Manager",
                                                                string.Format("{1} in {0} starts in 30 mins.", (object)this.Town, (object)this.WarType),
                                                                Color.Firebrick);
                    Asda2BattlegroundHandler.SendMessageServerAboutWarStartsResponse((byte)30);
                    break;
                }

                break;
            }

            if (DateTime.Now > this.EndTime && this.IsRunning)
            {
                this.Stop();
            }
            else
            {
                if (!(DateTime.Now > this.StartTime) || !(DateTime.Now < this.EndTime))
                {
                    return;
                }
                this.Start();
            }
        }
Example #2
0
        public void Update(int dt)
        {
            switch (_notificationsAboutStart)
            {
            case 3:
                if (DateTime.Now > StartTime.Subtract(new TimeSpan(0, 30, 0)))
                {
                    _notificationsAboutStart--;
                    World.BroadcastMsg("ÍÑÈ ÇáÝÑÞ", string.Format("{1} in {0} íÈÏà ÈÚÏ 30 ÏÞíÞÉ", Town, WarType),
                                       Color.Firebrick);
                    Asda2BattlegroundHandler.SendMessageServerAboutWarStartsResponse(30);
                }
                break;

            case 2:
                if (DateTime.Now > StartTime.Subtract(new TimeSpan(0, 15, 0)))
                {
                    _notificationsAboutStart--;
                    World.BroadcastMsg("ÍÑÈ ÇáÝÑÞ", string.Format("{1} in {0} íÈÏà ÈÚÏ 15 ÏÞíÞÉ", Town, WarType),
                                       Color.Firebrick);
                    Asda2BattlegroundHandler.SendMessageServerAboutWarStartsResponse(15);
                }
                break;

            case 1:
                if (DateTime.Now > StartTime.Subtract(new TimeSpan(0, 5, 0)))
                {
                    _notificationsAboutStart--;
                    World.BroadcastMsg("ÍÑÈ ÇáÝÑÞ", string.Format("{1} in {0} íÈÏà ÈÚÏ 5 ÏÞÇÆÞ", Town, WarType),
                                       Color.Firebrick);
                    Asda2BattlegroundHandler.SendMessageServerAboutWarStartsResponse(5);
                }
                break;

            default:
                break;
            }
            if (DateTime.Now > EndTime && IsRunning)
            {
                Stop();
            }
            else if (DateTime.Now > StartTime && DateTime.Now < EndTime)
            {
                Start();
            }
        }