public static void FriendHome(ClientInfo _cInfo)
        {
            DateTime _dt;

            Invite.TryGetValue(_cInfo.entityId, out _dt);
            {
                TimeSpan varTime           = DateTime.Now - _dt;
                double   fractionalMinutes = varTime.TotalMinutes;
                int      _timepassed       = (int)fractionalMinutes;
                if (_timepassed <= 2)
                {
                    string _pos;
                    FriendPosition.TryGetValue(_cInfo.entityId, out _pos);
                    {
                        int      x, y, z;
                        string[] _cords = _pos.Split(',');
                        int.TryParse(_cords[0], out x);
                        int.TryParse(_cords[1], out y);
                        int.TryParse(_cords[2], out z);
                        Players.NoFlight.Add(_cInfo.entityId);
                        TeleportDelay.TeleportQue(_cInfo, x, y, z);
                        Invite.Remove(_cInfo.entityId);
                        FriendPosition.Remove(_cInfo.entityId);
                        _cInfo.SendPackage(new NetPackageGameMessage(EnumGameMessages.Chat, string.Format("{0}{1} sending you to your friend.[-]", Config.Chat_Response_Color, _cInfo.playerName), Config.Server_Response_Name, false, "ServerTools", false));
                    }
                }
                else
                {
                    Invite.Remove(_cInfo.entityId);
                    FriendPosition.Remove(_cInfo.entityId);
                    _cInfo.SendPackage(new NetPackageGameMessage(EnumGameMessages.Chat, string.Format("{0}{1} you have run out of time to accept your friends invitation.[-]", Config.Chat_Response_Color, _cInfo.playerName), Config.Server_Response_Name, false, "ServerTools", false));
                }
            }
        }
Example #2
0
 public static void Exec(ClientInfo _cInfo, string _playerName)
 {
     if (SetLobby.Lobby_Position != "0,0,0")
     {
         int x, y, z;
         if (Return)
         {
             EntityPlayer _player   = GameManager.Instance.World.Players.dict[_cInfo.entityId];
             Vector3      _position = _player.GetPosition();
             x = (int)_position.x;
             y = (int)_position.y;
             z = (int)_position.z;
             string _pposition = x + "," + y + "," + z;
             LobbyPlayers.Add(_cInfo.entityId);
             PersistentContainer.Instance.Players[_cInfo.playerId, true].LobbyReturn = _pposition;
             PersistentContainer.Instance.Save();
             string _phrase552;
             if (!Phrases.Dict.TryGetValue(552, out _phrase552))
             {
                 _phrase552 = "{PlayerName} you can go back by typing /return when you are ready to leave the lobby.";
             }
             _phrase552 = _phrase552.Replace("{PlayerName}", _playerName);
             _cInfo.SendPackage(new NetPackageGameMessage(EnumGameMessages.Chat, string.Format("{0}{1}[-]", Config.Chat_Response_Color, _phrase552), Config.Server_Response_Name, false, "ServerTools", false));
         }
         string[] _cords = SetLobby.Lobby_Position.Split(',');
         int.TryParse(_cords[0], out x);
         int.TryParse(_cords[1], out y);
         int.TryParse(_cords[2], out z);
         Players.NoFlight.Add(_cInfo.entityId);
         TeleportDelay.TeleportQue(_cInfo, x, y, z);
         string _phrase553;
         if (!Phrases.Dict.TryGetValue(553, out _phrase553))
         {
             _phrase553 = "{PlayerName} sending you to the lobby.";
         }
         _phrase553 = _phrase553.Replace("{PlayerName}", _playerName);
         _cInfo.SendPackage(new NetPackageGameMessage(EnumGameMessages.Chat, string.Format("{0}{1}[-]", Config.Chat_Response_Color, _phrase553), Config.Server_Response_Name, false, "ServerTools", false));
         int _oldCoins = PersistentContainer.Instance.Players[_cInfo.playerId, false].PlayerSpentCoins;
         PersistentContainer.Instance.Players[_cInfo.playerId, true].PlayerSpentCoins = _oldCoins - Command_Cost;
         PersistentContainer.Instance.Players[_cInfo.playerId, true].LastLobby        = DateTime.Now;
         PersistentContainer.Instance.Save();
     }
     else
     {
         string _phrase554;
         if (!Phrases.Dict.TryGetValue(554, out _phrase554))
         {
             _phrase554 = "{PlayerName} the lobby position is not set.";
         }
         _phrase554 = _phrase554.Replace("{PlayerName}", _playerName);
         _cInfo.SendPackage(new NetPackageGameMessage(EnumGameMessages.Chat, string.Format("{0}{1}[-]", Config.Chat_Response_Color, _phrase554), Config.Server_Response_Name, false, "ServerTools", false));
     }
 }
        private static void Home2(ClientInfo _cInfo, string _home2, bool _announce)
        {
            int x, y, z;

            string[] _cords = _home2.Split(',');
            int.TryParse(_cords[0], out x);
            int.TryParse(_cords[1], out y);
            int.TryParse(_cords[2], out z);
            Players.NoFlight.Add(_cInfo.entityId);
            TeleportDelay.TeleportQue(_cInfo, x, y, z);
            int _oldCoins = PersistentContainer.Instance.Players[_cInfo.playerId, false].PlayerSpentCoins;

            PersistentContainer.Instance.Players[_cInfo.playerId, true].PlayerSpentCoins = _oldCoins - Command_Cost;
            PersistentContainer.Instance.Players[_cInfo.playerId, true].LastSetHome      = DateTime.Now;
            PersistentContainer.Instance.Save();
        }
Example #4
0
        public static void Exec(ClientInfo _cInfo, EntityPlayer _player)
        {
            Players.NoFlight.Add(_cInfo.entityId);
            TeleportDelay.TeleportQue(_cInfo, (int)_player.position.x, -1, (int)_player.position.z);
            string _phrase922;

            if (!Phrases.Dict.TryGetValue(922, out _phrase922))
            {
                _phrase922 = "{PlayerName} sending you to the world surface. If you are still stuck, contact an administrator.";
            }
            _phrase922 = _phrase922.Replace("{PlayerName}", _cInfo.playerName);
            {
                _cInfo.SendPackage(new NetPackageGameMessage(EnumGameMessages.Chat, string.Format("{0}{1}[-]", Config.Chat_Response_Color, _phrase922), Config.Server_Response_Name, false, "ServerTools", false));
            }
            PersistentContainer.Instance.Players[_cInfo.playerId, true].LastStuck = DateTime.Now;
            PersistentContainer.Instance.Save();
        }
Example #5
0
        public static void SendBack(ClientInfo _cInfo, string _playerName)
        {
            Player p = PersistentContainer.Instance.Players[_cInfo.playerId, false];

            if (p != null)
            {
                if (p.LobbyReturn != null)
                {
                    EntityPlayer _player = GameManager.Instance.World.Players.dict[_cInfo.entityId];
                    int          x, y, z;
                    string[]     _cords = SetLobby.Lobby_Position.Split(',');
                    int.TryParse(_cords[0], out x);
                    int.TryParse(_cords[1], out y);
                    int.TryParse(_cords[2], out z);
                    if ((x - _player.position.x) * (x - _player.position.x) + (z - _player.position.z) * (z - _player.position.z) <= Lobby_Size * Lobby_Size)
                    {
                        string[] _returnCoords = p.LobbyReturn.Split(',');
                        int.TryParse(_returnCoords[0], out x);
                        int.TryParse(_returnCoords[1], out y);
                        int.TryParse(_returnCoords[2], out z);
                        Players.NoFlight.Add(_cInfo.entityId);
                        TeleportDelay.TeleportQue(_cInfo, x, y, z);
                        LobbyPlayers.Remove(_cInfo.entityId);
                        string _phrase555;
                        if (!Phrases.Dict.TryGetValue(555, out _phrase555))
                        {
                            _phrase555 = "{PlayerName} sending you back to your saved location.";
                        }
                        _phrase555 = _phrase555.Replace("{PlayerName}", _playerName);
                        _cInfo.SendPackage(new NetPackageGameMessage(EnumGameMessages.Chat, string.Format("{0}{1}[-]", Config.Chat_Response_Color, _phrase555), Config.Server_Response_Name, false, "ServerTools", false));
                    }
                    else
                    {
                        string _phrase556;
                        if (!Phrases.Dict.TryGetValue(556, out _phrase556))
                        {
                            _phrase556 = "{PlayerName} you are outside the lobby. Get inside it and try again.";
                        }
                        _phrase556 = _phrase556.Replace("{PlayerName}", _playerName);
                        _cInfo.SendPackage(new NetPackageGameMessage(EnumGameMessages.Chat, string.Format("{0}{1}[-]", Config.Chat_Response_Color, _phrase556), Config.Server_Response_Name, false, "ServerTools", false));
                    }
                }
            }
        }
        public static void TeleFriend(ClientInfo _cInfo, int _friendToTele)
        {
            ClientInfo _cInfo2 = ConnectionManager.Instance.GetClientInfoForEntityId(_friendToTele);

            if (_cInfo2 != null)
            {
                Players.NoFlight.Add(_cInfo2.entityId);
                EntityPlayer _player = GameManager.Instance.World.Players.dict[_cInfo.entityId];
                TeleportDelay.TeleportQue(_cInfo2, (int)_player.position.x, (int)_player.position.y, (int)_player.position.z);
                int _oldCoins = PersistentContainer.Instance.Players[_cInfo2.playerId, false].PlayerSpentCoins;
                PersistentContainer.Instance.Players[_cInfo2.playerId, true].PlayerSpentCoins = _oldCoins - Command_Cost;
                PersistentContainer.Instance.Players[_cInfo2.playerId, true].LastFriendTele   = DateTime.Now;
                PersistentContainer.Instance.Save();
                string _phrase631;
                if (!Phrases.Dict.TryGetValue(631, out _phrase631))
                {
                    _phrase631 = "Your request was accepted. Teleporting you to your friend.";
                }
                _cInfo2.SendPackage(new NetPackageGameMessage(EnumGameMessages.Chat, string.Format("{0}{1}[-]", Config.Chat_Response_Color, _phrase631), Config.Server_Response_Name, false, "ServerTools", false));
            }
        }
Example #7
0
        public static void Tele(ClientInfo _cInfo, bool _announce)
        {
            EntityPlayer _player = GameManager.Instance.World.Players.dict[_cInfo.entityId];

            Flag.Clear();
            int _playerX = (int)_player.position.x;
            int _playerY = (int)_player.position.y;
            int _playerZ = (int)_player.position.z;

            if (Box.Count > 0)
            {
                foreach (KeyValuePair <string, string[]> kvpCorners in Box)
                {
                    int      xMin, yMin, zMin;
                    string[] _xyzCorner1 = kvpCorners.Value[0].Split(',');
                    int.TryParse(_xyzCorner1[0], out xMin);
                    int.TryParse(_xyzCorner1[1], out yMin);
                    int.TryParse(_xyzCorner1[2], out zMin);
                    int      xMax, yMax, zMax;
                    string[] _xyzCorner2 = kvpCorners.Value[1].Split(',');
                    int.TryParse(_xyzCorner2[0], out xMax);
                    int.TryParse(_xyzCorner2[1], out yMax);
                    int.TryParse(_xyzCorner2[2], out zMax);
                    int      xDest, yDest, zDest;
                    string[] _xyzDestCords = kvpCorners.Value[2].Split(',');
                    int.TryParse(_xyzDestCords[0], out xDest);
                    int.TryParse(_xyzDestCords[1], out yDest);
                    int.TryParse(_xyzDestCords[2], out zDest);

                    if (xMin >= 0 & xMax >= 0)
                    {
                        if (xMin < xMax)
                        {
                            if (_playerX >= xMin)
                            {
                                _xMinCheck = 1;
                            }
                            else
                            {
                                _xMinCheck = 0;
                            }
                            if (_playerX <= xMax)
                            {
                                _xMaxCheck = 1;
                            }
                            else
                            {
                                _xMaxCheck = 0;
                            }
                        }
                        else
                        {
                            if (_playerX <= xMin)
                            {
                                _xMinCheck = 1;
                            }
                            else
                            {
                                _xMinCheck = 0;
                            }
                            if (_playerX >= xMax)
                            {
                                _xMaxCheck = 1;
                            }
                            else
                            {
                                _xMaxCheck = 0;
                            }
                        }
                    }
                    else if (xMin <= 0 & xMax <= 0)
                    {
                        if (xMin < xMax)
                        {
                            if (_playerX >= xMin)
                            {
                                _xMinCheck = 1;
                            }
                            else
                            {
                                _xMinCheck = 0;
                            }
                            if (_playerX <= xMax)
                            {
                                _xMaxCheck = 1;
                            }
                            else
                            {
                                _xMaxCheck = 0;
                            }
                        }
                        else
                        {
                            if (_playerX <= xMin)
                            {
                                _xMinCheck = 1;
                            }
                            else
                            {
                                _xMinCheck = 0;
                            }
                            if (_playerX >= xMax)
                            {
                                _xMaxCheck = 1;
                            }
                            else
                            {
                                _xMaxCheck = 0;
                            }
                        }
                    }
                    else if (xMin <= 0 & xMax >= 0)
                    {
                        if (_playerX >= xMin)
                        {
                            _xMinCheck = 1;
                        }
                        else
                        {
                            _xMinCheck = 0;
                        }
                        if (_playerX <= xMax)
                        {
                            _xMaxCheck = 1;
                        }
                        else
                        {
                            _xMaxCheck = 0;
                        }
                    }
                    else if (xMin >= 0 & xMax <= 0)
                    {
                        if (_playerX <= xMin)
                        {
                            _xMinCheck = 1;
                        }
                        else
                        {
                            _xMinCheck = 0;
                        }
                        if (_playerX >= xMax)
                        {
                            _xMaxCheck = 1;
                        }
                        else
                        {
                            _xMaxCheck = 0;
                        }
                    }

                    if (yMin >= 0 & yMax >= 0)
                    {
                        if (yMin < yMax)
                        {
                            if (_playerY >= yMin)
                            {
                                _yMinCheck = 1;
                            }
                            else
                            {
                                _yMinCheck = 0;
                            }
                            if (_playerY <= yMax)
                            {
                                _yMaxCheck = 1;
                            }
                            else
                            {
                                _yMaxCheck = 0;
                            }
                        }
                        else
                        {
                            if (_playerY <= yMin)
                            {
                                _yMinCheck = 1;
                            }
                            else
                            {
                                _yMinCheck = 0;
                            }
                            if (_playerY >= yMax)
                            {
                                _yMaxCheck = 1;
                            }
                            else
                            {
                                _yMaxCheck = 0;
                            }
                        }
                    }
                    else if (yMin <= 0 & yMax <= 0)
                    {
                        if (yMin < yMax)
                        {
                            if (_playerY >= yMin)
                            {
                                _yMinCheck = 1;
                            }
                            else
                            {
                                _yMinCheck = 0;
                            }
                            if (_playerY <= yMax)
                            {
                                _yMaxCheck = 1;
                            }
                            else
                            {
                                _yMaxCheck = 0;
                            }
                        }
                        else
                        {
                            if (_playerY <= yMin)
                            {
                                _yMinCheck = 1;
                            }
                            else
                            {
                                _yMinCheck = 0;
                            }
                            if (_playerY >= yMax)
                            {
                                _yMaxCheck = 1;
                            }
                            else
                            {
                                _yMaxCheck = 0;
                            }
                        }
                    }
                    else if (yMin <= 0 & yMax >= 0)
                    {
                        if (_playerY >= yMin)
                        {
                            _yMinCheck = 1;
                        }
                        else
                        {
                            _yMinCheck = 0;
                        }
                        if (_playerY <= yMax)
                        {
                            _yMaxCheck = 1;
                        }
                        else
                        {
                            _yMaxCheck = 0;
                        }
                    }
                    else if (yMin >= 0 & yMax <= 0)
                    {
                        if (_playerY <= yMin)
                        {
                            _yMinCheck = 1;
                        }
                        else
                        {
                            _yMinCheck = 0;
                        }
                        if (_playerY >= yMax)
                        {
                            _yMaxCheck = 1;
                        }
                        else
                        {
                            _yMaxCheck = 0;
                        }
                    }

                    if (zMin >= 0 & zMax >= 0)
                    {
                        if (zMin < zMax)
                        {
                            if (_playerZ >= zMin)
                            {
                                _zMinCheck = 1;
                            }
                            else
                            {
                                _zMinCheck = 0;
                            }
                            if (_playerZ <= zMax)
                            {
                                _zMaxCheck = 1;
                            }
                            else
                            {
                                _zMaxCheck = 0;
                            }
                        }
                        else
                        {
                            if (_playerZ <= zMin)
                            {
                                _zMinCheck = 1;
                            }
                            else
                            {
                                _zMinCheck = 0;
                            }
                            if (_playerZ >= zMax)
                            {
                                _zMaxCheck = 1;
                            }
                            else
                            {
                                _zMaxCheck = 0;
                            }
                        }
                    }
                    else if (zMin <= 0 & zMax <= 0)
                    {
                        if (zMin < zMax)
                        {
                            if (_playerZ >= zMin)
                            {
                                _zMinCheck = 1;
                            }
                            else
                            {
                                _zMinCheck = 0;
                            }
                            if (_playerZ <= zMax)
                            {
                                _zMaxCheck = 1;
                            }
                            else
                            {
                                _zMaxCheck = 0;
                            }
                        }
                        else
                        {
                            if (_playerZ <= zMin)
                            {
                                _zMinCheck = 1;
                            }
                            else
                            {
                                _zMinCheck = 0;
                            }
                            if (_playerZ >= zMax)
                            {
                                _zMaxCheck = 1;
                            }
                            else
                            {
                                _zMaxCheck = 0;
                            }
                        }
                    }
                    else if (zMin <= 0 & zMax >= 0)
                    {
                        if (_playerZ >= zMin)
                        {
                            _zMinCheck = 1;
                        }
                        else
                        {
                            _zMinCheck = 0;
                        }
                        if (_playerZ <= zMax)
                        {
                            _zMaxCheck = 1;
                        }
                        else
                        {
                            _zMaxCheck = 0;
                        }
                    }
                    else if (zMin >= 0 & zMax <= 0)
                    {
                        if (_playerY <= zMin)
                        {
                            _zMinCheck = 1;
                        }
                        else
                        {
                            _zMinCheck = 0;
                        }
                        if (_playerY >= zMax)
                        {
                            _zMaxCheck = 1;
                        }
                        else
                        {
                            _zMaxCheck = 0;
                        }
                    }
                    if (_xMinCheck == 1 & _yMinCheck == 1 & _zMinCheck == 1 & _xMaxCheck == 1 & _yMaxCheck == 1 & _zMaxCheck == 1)
                    {
                        Players.NoFlight.Add(_cInfo.entityId);
                        TeleportDelay.TeleportQue(_cInfo, xDest, yDest, zDest);
                        int _oldCoins = PersistentContainer.Instance.Players[_cInfo.playerId, false].PlayerSpentCoins;
                        PersistentContainer.Instance.Players[_cInfo.playerId, true].PlayerSpentCoins = _oldCoins - Command_Cost;
                        PersistentContainer.Instance.Players[_cInfo.playerId, true].LastTravel       = DateTime.Now;
                        PersistentContainer.Instance.Save();
                        string _phrase603;
                        if (!Phrases.Dict.TryGetValue(603, out _phrase603))
                        {
                            _phrase603 = "You have traveled to {Destination}.";
                        }
                        _phrase603 = _phrase603.Replace("{Destination}", kvpCorners.Key);
                        _cInfo.SendPackage(new NetPackageGameMessage(EnumGameMessages.Chat, string.Format("{0}{1}[-]", Config.Chat_Response_Color, _phrase603), Config.Server_Response_Name, false, "ServerTools", false));
                    }
                    else
                    {
                        Flag.Add(_cInfo.entityId + 1);
                        if (Flag.Count == Box.Count)
                        {
                            string _phrase604;
                            if (!Phrases.Dict.TryGetValue(604, out _phrase604))
                            {
                                _phrase604 = "You are not in a travel location.";
                            }
                            _cInfo.SendPackage(new NetPackageGameMessage(EnumGameMessages.Chat, string.Format("{0}{1}[-]", Config.Chat_Response_Color, _phrase604), Config.Server_Response_Name, false, "ServerTools", false));
                        }
                    }
                }
            }
        }
 private static void TeleportPlayer(ClientInfo _cInfo, bool _announce)
 {
     if (Players.DeathTime.ContainsKey(_cInfo.entityId))
     {
         DateTime _time;
         if (Players.DeathTime.TryGetValue(_cInfo.entityId, out _time))
         {
             TimeSpan varTime           = DateTime.Now - _time;
             double   fractionalMinutes = varTime.TotalMinutes;
             int      _timepassed       = (int)fractionalMinutes;
             if (ReservedSlots.IsEnabled && ReservedSlots.Reduced_Delay)
             {
                 if (ReservedSlots.Dict.ContainsKey(_cInfo.playerId))
                 {
                     DateTime _dt;
                     ReservedSlots.Dict.TryGetValue(_cInfo.playerId, out _dt);
                     if (DateTime.Now > _dt)
                     {
                         int _newTime = _timepassed / 2;
                         _timepassed = _newTime;
                     }
                 }
             }
             if (_timepassed < 2)
             {
                 string _value;
                 if (Players.LastDeathPos.TryGetValue(_cInfo.entityId, out _value))
                 {
                     Players.NoFlight.Add(_cInfo.entityId);
                     int      x, y, z;
                     string[] _cords = _value.Split(',');
                     int.TryParse(_cords[0], out x);
                     int.TryParse(_cords[1], out y);
                     int.TryParse(_cords[2], out z);
                     TeleportDelay.TeleportQue(_cInfo, x, y, z);
                     Players.LastDeathPos.Remove(_cInfo.entityId);
                     int _oldCoins = PersistentContainer.Instance.Players[_cInfo.playerId, false].PlayerSpentCoins;
                     PersistentContainer.Instance.Players[_cInfo.playerId, true].PlayerSpentCoins = _oldCoins - Command_Cost;
                     PersistentContainer.Instance.Players[_cInfo.playerId, true].LastDied         = DateTime.Now;
                     PersistentContainer.Instance.Save();
                     string _phrase736;
                     if (!Phrases.Dict.TryGetValue(736, out _phrase736))
                     {
                         _phrase736 = "{PlayerName} teleporting you to your last death position. You can use this again in {DelayBetweenUses} minutes.";
                     }
                     _phrase736 = _phrase736.Replace("{PlayerName}", _cInfo.playerName);
                     _phrase736 = _phrase736.Replace("{DelayBetweenUses}", Delay_Between_Uses.ToString());
                     if (_announce)
                     {
                         GameManager.Instance.GameMessageServer((ClientInfo)null, EnumGameMessages.Chat, string.Format("{0}{1}[-]", Config.Chat_Response_Color, _phrase736), Config.Server_Response_Name, false, "", false);
                     }
                     else
                     {
                         _cInfo.SendPackage(new NetPackageGameMessage(EnumGameMessages.Chat, string.Format("{0}{1}[-]", Config.Chat_Response_Color, _phrase736), Config.Server_Response_Name, false, "ServerTools", false));
                     }
                 }
             }
             else
             {
                 _cInfo.SendPackage(new NetPackageGameMessage(EnumGameMessages.Chat, string.Format("{0}{1} your last death occurred too long ago. Command unavailable.[-]", Config.Chat_Response_Color, _cInfo.playerName), Config.Server_Response_Name, false, "ServerTools", false));
             }
         }
     }
     else
     {
         _cInfo.SendPackage(new NetPackageGameMessage(EnumGameMessages.Chat, string.Format("{0}{1} you have no death position. Die first.[-]", Config.Chat_Response_Color, _cInfo.playerName), Config.Server_Response_Name, false, "ServerTools", false));
     }
 }
 public static void Init(object sender, ElapsedEventArgs e)
 {
     if (FlightCheck.IsEnabled)
     {
         if ((int)GameManager.Instance.fps.Counter > 5)
         {
             FlightCheck.AutoFlightCheck();
         }
     }
     if (HatchElevator.IsEnabled)
     {
         HatchElevator.AutoHatchCheck();
     }
     if (UndergroundCheck.IsEnabled)
     {
         if ((int)GameManager.Instance.fps.Counter > 5)
         {
             UndergroundCheck.AutoUndergroundCheck();
         }
     }
     if (Jail.IsEnabled)
     {
         Jail.StatusCheck();
     }
     if (Bounties.IsEnabled || Players.Kill_Notice || DeathSpot.IsEnabled || Zones.IsEnabled || Event.Open)
     {
         Players.Exec();
     }
     if (Jail.Jailed.Count > 0)
     {
         _jR++;
         if (_jR >= 60)
         {
             _jR = 0;
             Jail.Clear();
         }
     }
     else
     {
         _jR = 0;
     }
     if (WeatherVote.IsEnabled)
     {
         if (WeatherVote.VoteOpen)
         {
             _wV++;
             if (_wV >= 30)
             {
                 _wV = 0;
                 WeatherVote.VoteOpen = false;
                 WeatherVote.CallForVote2();
             }
         }
         if (!WeatherVote.VoteNew)
         {
             _wNV++;
             if (_wNV >= Weather_Vote_Delay * 60)
             {
                 _wNV = 0;
                 WeatherVote.VoteNew = true;
                 SdtdConsole.Instance.ExecuteSync("weather defaults", (ClientInfo)null);
             }
         }
     }
     else
     {
         _wV  = 0;
         _wNV = 0;
     }
     if (MutePlayer.Mutes.Count > 0)
     {
         _mC++;
         if (_mC >= 60)
         {
             _mC = 0;
             MutePlayer.Clear();
         }
     }
     else
     {
         _mC = 0;
     }
     if (RealWorldTime.IsEnabled)
     {
         _rWT++;
         if (_rWT >= Real_Time_Delay * 60)
         {
             _rWT = 0;
             RealWorldTime.Time();
         }
     }
     else
     {
         _rWT = 0;
     }
     if (Lottery.IsEnabled && Lottery.OpenLotto)
     {
         _l++;
         if (_l == 3300)
         {
             Lottery.Alert();
         }
         if (_l >= 3600)
         {
             _l = 0;
             Lottery.StartLotto();
         }
     }
     else
     {
         _l = 0;
     }
     if (RestartVote.IsEnabled)
     {
         if (RestartVote.VoteOpen)
         {
             _rV++;
             if (_rV >= 30)
             {
                 _rV = 0;
                 RestartVote.VoteNew = false;
                 RestartVote.CallForVote2();
             }
         }
         if (!RestartVote.VoteNew)
         {
             _rNV++;
             if (_rNV >= Restart_Vote_Delay * 60)
             {
                 _rNV = 0;
                 RestartVote.VoteNew = true;
             }
         }
     }
     else
     {
         _rV  = 0;
         _rNV = 0;
     }
     if (NightVote.IsEnabled)
     {
         if (NightVote.VoteOpen)
         {
             _nV++;
             if (_nV >= 30)
             {
                 _nV = 0;
                 NightVote.VoteCount();
             }
         }
     }
     else
     {
         _nV = 0;
     }
     if (Hordes.IsEnabled)
     {
         _h++;
         if (_h >= 1200)
         {
             _h = 0;
             Hordes.Exec();
         }
     }
     else
     {
         _h = 0;
     }
     if (EntityCleanup.BlockIsEnabled || EntityCleanup.FallingTreeEnabled || EntityCleanup.Underground)
     {
         _eC++;
         if (_eC >= 15)
         {
             _eC = 0;
             EntityCleanup.EntityCheck();
         }
     }
     else
     {
         _eC = 0;
     }
     if (Zones.IsEnabled)
     {
         _rE++;
         if (_rE >= 5)
         {
             _rE = 0;
             EntityCleanup.ZombieCheck();
         }
     }
     else
     {
         _rE = 0;
     }
     if (NightAlert.IsEnabled)
     {
         _nA++;
         if (_nA >= Night_Time_Delay * 60)
         {
             _nA = 0;
             NightAlert.Exec();
         }
     }
     else
     {
         _nA = 0;
     }
     if (Watchlist.IsEnabled)
     {
         _wL++;
         if (_wL >= Alert_Delay * 60)
         {
             _wL = 0;
             Watchlist.CheckWatchlist();
         }
     }
     else
     {
         _wL = 0;
     }
     if (PlayerStatCheck.IsEnabled)
     {
         _pSC++;
         if (_pSC >= 2)
         {
             _pSC = 0;
             PlayerStatCheck.PlayerStat();
         }
     }
     else
     {
         _pSC = 0;
     }
     if (ReservedSlots.IsEnabled)
     {
         _rS++;
         if (_rS >= 120)
         {
             _rS = 0;
             int _playerCount = ConnectionManager.Instance.ClientCount();
             if (_playerCount == API.MaxPlayers)
             {
                 ReservedSlots.OpenSlot();
             }
         }
     }
     else
     {
         _rS = 0;
     }
     if (Bloodmoon.IsEnabled & Bloodmoon.Auto_Enabled)
     {
         if (Auto_Show_Bloodmoon_Delay > 0)
         {
             _b++;
             if (_b >= Auto_Show_Bloodmoon_Delay * 60)
             {
                 _b = 0;
                 Bloodmoon.StatusCheck();
             }
         }
     }
     else
     {
         _b = 0;
     }
     if (PlayerLogs.IsEnabled & Player_Log_Interval > 0)
     {
         _pL++;
         if (_pL >= Player_Log_Interval)
         {
             _pL = 0;
             PlayerLogs.Exec();
         }
     }
     else
     {
         _pL = 0;
     }
     if (StopServer.stopServerCountingDown)
     {
         _sSCD++;
         if (_sSCD == 60)
         {
             _sSCD = 0;
             _sSC--;
         }
         if (_sSC == 0)
         {
             _sSCD = 0;
             StopServer.stopServerCountingDown = false;
             StopServer.Stop();
         }
         if (_sSC == 1 && _sSCD == 0)
         {
             StopServer.StartShutdown3();
         }
         if (_sSC > 1 && _sSCD == 0)
         {
             StopServer.StartShutdown2(_sSC);
         }
         if (StopServer.Kick_30_Seconds)
         {
             if (_sSC == 1 && _sSCD == 30)
             {
                 StopServer.Kick30();
             }
         }
         if (StopServer.Ten_Second_Countdown)
         {
             if (_sSC == 1 && _sSCD == 50)
             {
                 StopServer.StartShutdown4();
             }
             if (_sSC == 1 && _sSCD == 55)
             {
                 StopServer.StartShutdown5();
             }
             if (_sSC == 1 && _sSCD == 56)
             {
                 StopServer.StartShutdown6();
             }
             if (_sSC == 1 && _sSCD == 57)
             {
                 StopServer.StartShutdown7();
             }
             if (_sSC == 1 && _sSCD == 58)
             {
                 StopServer.StartShutdown8();
             }
             if (_sSC == 1 && _sSCD == 59)
             {
                 StopServer.StartShutdown9();
             }
         }
     }
     else
     {
         _sSCD = 0;
         _sSC  = 0;
     }
     if (AutoSaveWorld.IsEnabled & Delay_Between_World_Saves > 0)
     {
         _wSD++;
         if (_wSD >= Delay_Between_World_Saves * 60)
         {
             _wSD = 0;
             AutoSaveWorld.Save();
         }
     }
     else
     {
         _wSD = 0;
     }
     if (AutoShutdown.IsEnabled && !AutoShutdown.Bloodmoon && !StopServer.stopServerCountingDown)
     {
         _sD++;
         if (!Event.Open && _sD >= Shutdown_Delay * 60)
         {
             _sD = 0;
             AutoShutdown.CheckBloodmoon();
         }
     }
     else
     {
         _sD = 0;
     }
     if (AutoShutdown.Bloodmoon)
     {
         _aSB++;
         if (_aSB >= 1800)
         {
             _aSB = 0;
             AutoShutdown.CheckBloodmoon();
         }
     }
     else
     {
         _aSB = 0;
     }
     if (InfoTicker.IsEnabled)
     {
         _iT++;
         if (_iT >= Infoticker_Delay * 60)
         {
             _iT = 0;
             InfoTicker.StatusCheck();
         }
     }
     else
     {
         _iT = 0;
     }
     if (WorldRadius.IsEnabled)
     {
         _wR++;
         if (_wR >= 2)
         {
             _wR = 0;
             WorldRadius.Exec();
         }
     }
     else
     {
         _wR = 0;
     }
     if (VoteReward.IsEnabled && VoteReward.QueOpen)
     {
         _vR++;
         if (_vR >= 60)
         {
             _vR = 0;
             VoteReward.que.Clear();
             VoteReward.QueOpen    = false;
             VoteReward.RewardOpen = true;
         }
     }
     else
     {
         _vR = 0;
     }
     if (Event.Setup)
     {
         _eS++;
         if (_eS >= 900)
         {
             _eS         = 0;
             Event.Setup = false;
             Event.CheckOpen();
         }
     }
     else
     {
         _eS = 0;
     }
     if (Event.Invited)
     {
         _eI++;
         if (_eI >= 900)
         {
             _eI           = 0;
             Event.Invited = false;
             Event.CheckOpen2();
         }
     }
     else
     {
         _eI = 0;
     }
     if (Event.Open)
     {
         _eO++;
         if (_eO == _eventTime / 2)
         {
             Event.HalfTime();
         }
         if (_eO == _eventTime - 300)
         {
             Event.FiveMin();
         }
         if (_eO >= _eventTime)
         {
             _eO = 0;
             Event.EndEvent();
         }
     }
     else
     {
         _eO = 0;
     }
     if (RestartVote.Startup)
     {
         _rVS++;
         if (_rVS >= 1800)
         {
             RestartVote.Startup = false;
         }
     }
     if (TeleportDelay.TeleQue)
     {
         _tD++;
         if (_tD >= 3)
         {
             _tD = 0;
             TeleportDelay.Que();
         }
     }
     else
     {
         _tD = 0;
     }
 }