Example #1
0
        private static void Process_FFAON(Player client, string[] command)
        {
            if (client.Account.Permission < PlayerPermission.GM)
            {
                return;
            }
            if (command.Length < 2)
            {
                client.SendMessage("Error: Format should be /ffa start/send/end/status");
                return;
            }
            string p   = command[1];
            string s   = "start";
            string se  = "send";
            string e   = "end";
            string chk = "status";

            if (p == s)
            {
                client.SendMessage("You have started the FFA tournment wait for people to sign up!");
                FreeForAll.StartEvent();
            }
            if (p == se)
            {
                client.SendMessage("You have sent the players to pk map");
                FreeForAll.Send();
            }
            if (p == chk)
            {
                FreeForAll.CheckAlive();
            }
            if (p == e)
            {
                client.SendMessage("Ended Event and player are teleported to TwinCity");
                FreeForAll.EndEvent();
            }
        }
Example #2
0
        protected override bool OnProcess()
        {
            var curr = Common.Clock;

            if (curr >= _nextTrigger)
            {
                _nextTrigger += THREAD_SPEED;

                var offset = (curr - _nextTrigger) / Common.MS_PER_SECOND;
                if (Math.Abs(offset) > TIMER_OFFSET_LIMIT)
                {
                    _nextTrigger = curr + THREAD_SPEED;
                }

                //Run managers
                PlayerManager.PlayerManager_Tick();

                MapManager.MapManager_Tick();

                GuildWar.GuildWar_Tick();
                PlayerManager.PlayerManager_Tick();

                /*if (DateTime.UtcNow.Second == 10 || DateTime.UtcNow.Second == 40)
                 * {
                 *
                 *  foreach (var user in PlayerManager.Players.Values)
                 *  {
                 *
                 *
                 *
                 *      if (user != null)
                 *      {
                 *
                 *
                 *          user.Save();
                 *          Console.WriteLine("Quartarly Save! {0} accounts saved", PlayerManager.Players.Count);
                 *
                 *      }
                 *  }
                 *
                 *
                 * }*/
                if (DateTime.UtcNow.Second == 00 && (DateTime.UtcNow.Minute == 15 || DateTime.UtcNow.Minute == 30 || DateTime.UtcNow.Minute == 45 || DateTime.UtcNow.Minute == 60))
                {
                    foreach (var user in PlayerManager.Players.Values)
                    {
                        if (user != null)
                        {
                            user.Save();
                            Console.WriteLine("Quartarly Save! {0} accounts saved", PlayerManager.Players.Count);
                        }
                    }
                }


                if (DateTime.UtcNow.Minute == 30 && DateTime.UtcNow.Second == 00)
                {
                    FreeForAll.StartEvent();
                }
                else if (DateTime.UtcNow.Minute == 32 && DateTime.UtcNow.Second == 00)
                {
                    foreach (var user in PlayerManager.Players.Values)
                    {
                        user.SendMessage("1 Min until event start. You can sign up at the Events Manager at Twin City!");
                    }
                    FreeForAll.Send();
                }
                else if (DateTime.UtcNow.Minute == 33 && DateTime.UtcNow.Second == 00)
                {
                    foreach (var user in PlayerManager.Players.Values)
                    {
                        user.SendMessage("3 Mins left... ");
                    }
                }
                else if (DateTime.UtcNow.Minute == 36 && DateTime.UtcNow.Second == 00)
                {
                    foreach (var user in PlayerManager.Players.Values)
                    {
                        user.SendMessage("Event has ended thank you for participation!");
                    }

                    FreeForAll.EndEvent();
                }
            }

            return(true);
        }