Пример #1
0
 public static void OldPlayerJoined(ClientInfo _cInfo, EntityPlayer _player)
 {
     try
     {
         string id = _cInfo.CrossplatformId.CombinedString;
         if (Hardcore.IsEnabled && PersistentContainer.Instance.Players[id] != null)
         {
             if (Hardcore.Optional)
             {
                 if (PersistentContainer.Instance.Players[id].HardcoreEnabled)
                 {
                     Hardcore.Check(_cInfo, _player);
                 }
             }
             else if (!PersistentContainer.Instance.Players[id].HardcoreEnabled)
             {
                 string[] hardcoreStats = { _cInfo.playerName, "0", "0" };
                 PersistentContainer.Instance.Players[id].HardcoreStats   = hardcoreStats;
                 PersistentContainer.Instance.Players[id].HardcoreEnabled = true;
                 PersistentContainer.DataChange = true;
                 Hardcore.Check(_cInfo, _player);
             }
         }
         if (LoginNotice.IsEnabled && LoginNotice.Dict1.ContainsKey(_cInfo.PlatformId.CombinedString) || LoginNotice.Dict1.ContainsKey(id))
         {
             LoginNotice.PlayerNotice(_cInfo);
         }
         if (Motd.IsEnabled)
         {
             Motd.Send(_cInfo);
         }
         if (Bloodmoon.IsEnabled)
         {
             Bloodmoon.Exec(_cInfo);
         }
         if (Shutdown.IsEnabled && Shutdown.Alert_On_Login)
         {
             Shutdown.NextShutdown(_cInfo);
         }
         if (ExitCommand.IsEnabled)
         {
             ExitCommand.AlertPlayer(_cInfo);
         }
         if (Poll.IsEnabled && PersistentContainer.Instance.PollOpen && !PersistentContainer.Instance.PollVote.ContainsKey(id))
         {
             Poll.Message(_cInfo);
         }
         if (ClanManager.IsEnabled && PersistentContainer.Instance.Players[id] != null)
         {
             Dictionary <string, string> clanRequests = PersistentContainer.Instance.Players[id].ClanRequestToJoin;
             if (clanRequests != null && clanRequests.Count > 0)
             {
                 ChatHook.ChatMessage(_cInfo, Config.Chat_Response_Color + "New clan requests from:[-]", -1, Config.Server_Response_Name, EChatType.Whisper, null);
                 foreach (var request in clanRequests)
                 {
                     ChatHook.ChatMessage(_cInfo, Config.Chat_Response_Color + request.Value + "[-]", -1, Config.Server_Response_Name, EChatType.Whisper, null);
                 }
             }
         }
         if (PersistentContainer.Instance.Players[id] != null)
         {
             if (PersistentContainer.Instance.Players[id].EventSpawn)
             {
                 PersistentContainer.Instance.Players[id].EventSpawn = false;
                 PersistentContainer.DataChange = true;
             }
             if (Wallet.IsEnabled && PersistentContainer.Instance.Players[id].PlayerWallet > 0)
             {
                 Wallet.AddCurrency(id, PersistentContainer.Instance.Players[id].PlayerWallet);
                 PersistentContainer.Instance.Players[id].PlayerWallet = 0;
                 PersistentContainer.DataChange = true;
             }
             if (PersistentContainer.Instance.Players[id].JailRelease)
             {
                 PersistentContainer.Instance.Players[id].JailRelease = false;
                 PersistentContainer.DataChange = true;
                 Vector3[] _pos = GameManager.Instance.World.GetRandomSpawnPointPositions(1);
                 _cInfo.SendPackage(NetPackageManager.GetPackage <NetPackageTeleportPlayer>().Setup(new Vector3(_pos[0].x, _pos[0].y + 1, _pos[0].z), null, false));
                 Phrases.Dict.TryGetValue("Jail2", out string phrase);
                 ChatHook.ChatMessage(_cInfo, Config.Chat_Response_Color + phrase + "[-]", -1, Config.Server_Response_Name, EChatType.Whisper, null);
             }
         }
         if (AutoPartyInvite.IsEnabled)
         {
             AutoPartyInvite.Exec(_cInfo, _player);
         }
         if (Event.Open && Event.Teams.ContainsKey(id) && PersistentContainer.Instance.Players[id] != null && PersistentContainer.Instance.Players[id].EventSpawn)
         {
             Event.Spawn(_cInfo);
         }
     }
     catch (Exception e)
     {
         Log.Out(string.Format("[SERVERTOOLS] Error in API.OldPlayerJoined: {0}", e.Message));
     }
 }
Пример #2
0
 public static void Load()
 {
     PatchTools.ApplyPatches();
     if (!Timers.IsRunning)
     {
         Timers.TimerStart();
     }
     if (!LoadTriggers.IsRunning)
     {
         LoadTriggers.Load();
     }
     if (Poll.IsEnabled && PersistentContainer.Instance.PollOpen)
     {
         Poll.CheckTime();
     }
     if (!ClanManager.IsEnabled)
     {
         ClanManager.Clans.Clear();
         ClanManager.ClanMember.Clear();
     }
     if (!InfoTicker.IsEnabled && InfoTicker.IsRunning)
     {
         InfoTicker.Unload();
     }
     if (InfoTicker.IsEnabled && !InfoTicker.IsRunning)
     {
         InfoTicker.Load();
     }
     if (Gimme.IsRunning && !Gimme.IsEnabled)
     {
         Gimme.Unload();
     }
     if (!Gimme.IsRunning && Gimme.IsEnabled)
     {
         Gimme.Load();
     }
     if (Badwords.IsRunning && !Badwords.IsEnabled)
     {
         Badwords.Unload();
     }
     if (!Badwords.IsRunning && Badwords.IsEnabled)
     {
         Badwords.Load();
     }
     if (!LoginNotice.IsRunning && LoginNotice.IsEnabled)
     {
         LoginNotice.Load();
     }
     if (LoginNotice.IsRunning && !LoginNotice.IsEnabled)
     {
         LoginNotice.Unload();
     }
     if (!Zones.IsRunning && Zones.IsEnabled)
     {
         Zones.Load();
     }
     if (Zones.IsRunning && !Zones.IsEnabled)
     {
         Zones.Unload();
     }
     if (!VoteReward.IsRunning && VoteReward.IsEnabled)
     {
         VoteReward.Load();
     }
     if (VoteReward.IsRunning && !VoteReward.IsEnabled)
     {
         VoteReward.Unload();
     }
     if (!Watchlist.IsRunning && Watchlist.IsEnabled)
     {
         Watchlist.Load();
     }
     if (Watchlist.IsRunning && !Watchlist.IsEnabled)
     {
         Watchlist.Unload();
     }
     if (!ReservedSlots.IsRunning && ReservedSlots.IsEnabled)
     {
         ReservedSlots.Load();
     }
     if (ReservedSlots.IsRunning && !ReservedSlots.IsEnabled)
     {
         ReservedSlots.Unload();
     }
     if (!StartingItems.IsRunning && StartingItems.IsEnabled)
     {
         StartingItems.Load();
     }
     if (StartingItems.IsRunning && !StartingItems.IsEnabled)
     {
         StartingItems.Unload();
     }
     if (!Travel.IsRunning && Travel.IsEnabled)
     {
         Travel.Load();
     }
     if (Travel.IsRunning && !Travel.IsEnabled)
     {
         Travel.Unload();
     }
     if (!Shop.IsRunning && Shop.IsEnabled)
     {
         Shop.Load();
     }
     if (Shop.IsRunning && !Shop.IsEnabled)
     {
         Shop.Unload();
     }
     if (!Motd.IsRunning && Motd.IsEnabled)
     {
         Motd.Load();
     }
     if (Motd.IsRunning && !Motd.IsEnabled)
     {
         Motd.Unload();
     }
     if (InvalidItems.IsRunning && !InvalidItems.IsEnabled)
     {
         InvalidItems.Unload();
     }
     if (!InvalidItems.IsRunning && InvalidItems.IsEnabled)
     {
         InvalidItems.Load();
     }
     if (HighPingKicker.IsRunning && !HighPingKicker.IsEnabled)
     {
         HighPingKicker.Unload();
     }
     if (!HighPingKicker.IsRunning && HighPingKicker.IsEnabled)
     {
         HighPingKicker.Load();
     }
     if (CredentialCheck.IsRunning && !CredentialCheck.IsEnabled)
     {
         CredentialCheck.Unload();
     }
     if (!CredentialCheck.IsRunning && CredentialCheck.IsEnabled)
     {
         CredentialCheck.Load();
     }
     if (CustomCommands.IsRunning && !CustomCommands.IsEnabled)
     {
         CustomCommands.Unload();
     }
     if (!CustomCommands.IsRunning && CustomCommands.IsEnabled)
     {
         CustomCommands.Load();
     }
     if (DupeLog.IsRunning && !DupeLog.IsEnabled)
     {
         DupeLog.Unload();
     }
     if (!DupeLog.IsRunning && DupeLog.IsEnabled)
     {
         DupeLog.Load();
     }
     if (ChatColorPrefix.IsRunning && !ChatColorPrefix.IsEnabled)
     {
         ChatColorPrefix.Unload();
     }
     if (!ChatColorPrefix.IsRunning && ChatColorPrefix.IsEnabled)
     {
         ChatColorPrefix.Load();
     }
     if (KillNotice.IsRunning && !KillNotice.IsEnabled)
     {
         KillNotice.Unload();
     }
     if (!KillNotice.IsRunning && KillNotice.IsEnabled)
     {
         KillNotice.Load();
     }
     if (Prayer.IsRunning && !Prayer.IsEnabled)
     {
         Prayer.Unload();
     }
     if (!Prayer.IsRunning && Prayer.IsEnabled)
     {
         Prayer.Load();
     }
     if (BloodmoonWarrior.IsRunning && !BloodmoonWarrior.IsEnabled)
     {
         BloodmoonWarrior.Unload();
     }
     if (!BloodmoonWarrior.IsRunning && BloodmoonWarrior.IsEnabled)
     {
         BloodmoonWarrior.Load();
     }
     if (ProtectedSpaces.IsRunning && !ProtectedSpaces.IsEnabled)
     {
         ProtectedSpaces.Unload();
     }
     if (!ProtectedSpaces.IsRunning && ProtectedSpaces.IsEnabled)
     {
         ProtectedSpaces.Load();
     }
     if (Packages.IsRunning && !Packages.IsEnabled)
     {
         Packages.Unload();
     }
     if (!Packages.IsRunning && Packages.IsEnabled)
     {
         Packages.Load();
     }
     if (ClanManager.IsEnabled)
     {
         ClanManager.ClanList();
     }
     if (Auction.IsEnabled)
     {
         Auction.AuctionList();
     }
     if (Mute.IsEnabled)
     {
         Mute.ClientMuteList();
         Mute.MuteList();
     }
     if (Jail.IsEnabled)
     {
         Jail.JailList();
     }
     //always load the website last
     if (WebsiteServer.IsEnabled && !WebsiteServer.DirFound)
     {
         WebsiteServer.CheckDir();
     }
     if (WebsiteServer.IsRunning && !WebsiteServer.IsEnabled)
     {
         WebsiteServer.Unload();
     }
     if (!WebsiteServer.IsRunning && WebsiteServer.IsEnabled && WebsiteServer.DirFound)
     {
         WebsiteServer.Load();
     }
 }
Пример #3
0
 public static void OldPlayerJoined(ClientInfo _cInfo)
 {
     if (Hardcore.IsEnabled)
     {
         if (GameManager.Instance.World.Players.dict.ContainsKey(_cInfo.entityId))
         {
             EntityPlayer _player = GameManager.Instance.World.Players.dict[_cInfo.entityId];
             if (_player != null)
             {
                 if (Hardcore.Optional)
                 {
                     if (PersistentContainer.Instance.Players[_cInfo.playerId].HardcoreEnabled)
                     {
                         Hardcore.Check(_cInfo, _player);
                     }
                 }
                 else if (!PersistentContainer.Instance.Players[_cInfo.playerId].HardcoreEnabled)
                 {
                     string[] _hardcoreStats = { _cInfo.playerName, XUiM_Player.GetDeaths(_player).ToString(), "0" };
                     PersistentContainer.Instance.Players[_cInfo.playerId].HardcoreStats   = _hardcoreStats;
                     PersistentContainer.Instance.Players[_cInfo.playerId].HardcoreEnabled = true;
                     Hardcore.Check(_cInfo, _player);
                 }
             }
         }
     }
     if (LoginNotice.IsEnabled && LoginNotice.dict.ContainsKey(_cInfo.playerId))
     {
         LoginNotice.PlayerNotice(_cInfo);
     }
     if (Motd.IsEnabled)
     {
         Motd.Send(_cInfo);
     }
     if (Bloodmoon.IsEnabled)
     {
         Bloodmoon.Exec(_cInfo);
     }
     if (Shutdown.IsEnabled && Shutdown.Alert_On_Login)
     {
         Shutdown.NextShutdown(_cInfo);
     }
     if (BattleLogger.IsEnabled)
     {
         BattleLogger.AlertPlayer(_cInfo);
     }
     if (Poll.IsEnabled && PersistentContainer.Instance.PollOpen && !PersistentContainer.Instance.PollVote.ContainsKey(_cInfo.playerId))
     {
         Poll.Message(_cInfo);
     }
     if (ClanManager.IsEnabled)
     {
         Dictionary <string, string> _clanRequests = PersistentContainer.Instance.Players[_cInfo.playerId].ClanRequestToJoin;
         if (_clanRequests != null && _clanRequests.Count > 0)
         {
             ChatHook.ChatMessage(_cInfo, LoadConfig.Chat_Response_Color + "New clan requests from:[-]", -1, LoadConfig.Server_Response_Name, EChatType.Whisper, null);
             foreach (var _request in _clanRequests)
             {
                 ChatHook.ChatMessage(_cInfo, LoadConfig.Chat_Response_Color + _request.Value + "[-]", -1, LoadConfig.Server_Response_Name, EChatType.Whisper, null);
             }
         }
     }
     if (Event.Open && Event.Teams.ContainsKey(_cInfo.playerId) && PersistentContainer.Instance.Players[_cInfo.playerId].EventSpawn)
     {
         Event.Spawn(_cInfo);
     }
     else if (PersistentContainer.Instance.Players[_cInfo.playerId].EventSpawn)
     {
         PersistentContainer.Instance.Players[_cInfo.playerId].EventSpawn = false;
         PersistentContainer.Instance.Save();
     }
 }