Пример #1
0
 public static void ProcessPlayer(ClientInfo _cInfo, EntityPlayer _player)
 {
     try
     {
         if (NewPlayer.IsEnabled)
         {
             NewPlayer.Exec(_cInfo);
         }
         if (Motd.IsEnabled)
         {
             Motd.Send(_cInfo);
         }
         if (Bloodmoon.IsEnabled)
         {
             Bloodmoon.Exec(_cInfo);
         }
         if (ExitCommand.IsEnabled)
         {
             ExitCommand.AlertPlayer(_cInfo);
         }
         if (Poll.IsEnabled && PersistentContainer.Instance.PollOpen && !PersistentContainer.Instance.PollVote.ContainsKey(_cInfo.playerId))
         {
             Poll.Message(_cInfo);
         }
         if (Hardcore.IsEnabled)
         {
             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);
             }
         }
         PersistentContainer.Instance.Players[_cInfo.playerId].OldPlayer = true;
         PersistentContainer.DataChange = true;
     }
     catch (Exception e)
     {
         Log.Out(string.Format("[SERVERTOOLS] Error in API.ProcessPlayer: {0}", e.Message));
     }
 }
Пример #2
0
 public static void ProcessPlayer(ClientInfo _cInfo, EntityPlayer _player)
 {
     try
     {
         string id = _cInfo.CrossplatformId.CombinedString;
         if (NewPlayer.IsEnabled)
         {
             NewPlayer.Exec(_cInfo);
         }
         if (Motd.IsEnabled)
         {
             Motd.Send(_cInfo);
         }
         if (Bloodmoon.IsEnabled)
         {
             Bloodmoon.Exec(_cInfo);
         }
         if (ExitCommand.IsEnabled)
         {
             ExitCommand.AlertPlayer(_cInfo);
         }
         if (Poll.IsEnabled && PersistentContainer.Instance.PollOpen && !PersistentContainer.Instance.PollVote.ContainsKey(id))
         {
             Poll.Message(_cInfo);
         }
         if (Hardcore.IsEnabled)
         {
             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);
             }
         }
     }
     catch (Exception e)
     {
         Log.Out(string.Format("[SERVERTOOLS] Error in API.ProcessPlayer: {0}", e.Message));
     }
 }
Пример #3
0
 private static void Init6(ClientInfo _cInfo, string _ip)
 {
     ExitCommand.ExitWithoutCommand(_cInfo, _ip);
 }
Пример #4
0
 private static void Init5(int _id)
 {
     ExitCommand.ExitWithCommand(_id);
 }
Пример #5
0
 public static void OldPlayerJoined(ClientInfo _cInfo, EntityPlayer _player)
 {
     if (Hardcore.IsEnabled)
     {
         if (GameManager.Instance.World.Players.dict.ContainsKey(_cInfo.entityId))
         {
             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 (ExitCommand.IsEnabled)
     {
         ExitCommand.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, 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 (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;
     }
 }
Пример #6
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));
     }
 }
Пример #7
0
 private static void Init6(object sender, ElapsedEventArgs e, ClientInfo _cInfo, string _ip)
 {
     ExitCommand.ExitWithoutCommand(_cInfo, _ip);
 }
Пример #8
0
 private static void Init5(object sender, ElapsedEventArgs e, int _id)
 {
     ExitCommand.ExitWithCommand(_id);
 }