diff --git a/MoreHomes/Commands/DestroyHomeCommand.cs b/MoreHomes/Commands/DestroyHomeCommand.cs index 5af351b..ef36a0e 100644 --- a/MoreHomes/Commands/DestroyHomeCommand.cs +++ b/MoreHomes/Commands/DestroyHomeCommand.cs @@ -2,7 +2,6 @@ using Rocket.Unturned.Player; using System.Collections.Generic; using System.Linq; -using Rocket.Unturned.Chat; using RestoreMonarchy.MoreHomes.Models; using RestoreMonarchy.MoreHomes.Helpers; @@ -10,30 +9,30 @@ namespace RestoreMonarchy.MoreHomes.Commands { public class DestroyHomeCommand : IRocketCommand { - private MoreHomesPlugin pluginInstance => MoreHomesPlugin.Instance; + private MoreHomesPlugin pluginInstance => MoreHomesPlugin.Instance; public void Execute(IRocketPlayer caller, string[] command) { UnturnedPlayer player = (UnturnedPlayer)caller; string homeName = command.ElementAtOrDefault(0); - + if (string.IsNullOrEmpty(homeName)) { - UnturnedChat.Say(caller, pluginInstance.Translate("DestroyHomeFormat"), pluginInstance.MessageColor); + pluginInstance.SendMessageToPlayer(caller, "DestroyHomeFormat"); return; } PlayerHome home = HomesHelper.GetPlayerHome(player.CSteamID, homeName); if (home == null) { - UnturnedChat.Say(caller, pluginInstance.Translate("HomeNotFound", home.Name), pluginInstance.MessageColor); + pluginInstance.SendMessageToPlayer(caller, "HomeNotFound", homeName); return; } HomesHelper.RemoveHome(player.CSteamID, home); home.Destroy(); - UnturnedChat.Say(caller, pluginInstance.Translate("DestroyHomeSuccess", home.Name), pluginInstance.MessageColor); + pluginInstance.SendMessageToPlayer(caller, "DestroyHomeSuccess", home.Name); } public AllowedCaller AllowedCaller => AllowedCaller.Player; @@ -48,4 +47,4 @@ public void Execute(IRocketPlayer caller, string[] command) public List Permissions => new List(); } -} +} \ No newline at end of file diff --git a/MoreHomes/Commands/HomeCommand.cs b/MoreHomes/Commands/HomeCommand.cs index af969ce..fe7979a 100644 --- a/MoreHomes/Commands/HomeCommand.cs +++ b/MoreHomes/Commands/HomeCommand.cs @@ -2,7 +2,6 @@ using Rocket.API; using System.Collections.Generic; using System.Linq; -using Rocket.Unturned.Chat; using Rocket.Core.Utils; using Rocket.Unturned.Player; using SDG.Unturned; @@ -11,7 +10,6 @@ using System; using RestoreMonarchy.MoreHomes.Helpers; using UnityEngine; -using System.Threading; namespace RestoreMonarchy.MoreHomes.Commands { @@ -26,17 +24,18 @@ public void Execute(IRocketPlayer caller, string[] command) if (home == null) { - UnturnedChat.Say(caller, pluginInstance.Translate("NoHome"), pluginInstance.MessageColor); + pluginInstance.SendMessageToPlayer(caller, "NoHome"); return; } if (!ValidateTeleportation(player, home)) + { return; + } if (pluginInstance.PlayerCooldowns.TryGetValue(caller.Id, out DateTime cooldownExpire) && cooldownExpire > DateTime.Now) { - UnturnedChat.Say(caller, pluginInstance.Translate("HomeCooldown", System.Math.Round((cooldownExpire - DateTime.Now).TotalSeconds)), - pluginInstance.MessageColor); + pluginInstance.SendMessageToPlayer(caller, "HomeCooldown", Math.Round((cooldownExpire - DateTime.Now).TotalSeconds)); return; } @@ -46,7 +45,7 @@ public void Execute(IRocketPlayer caller, string[] command) if (delay > 0) { - UnturnedChat.Say(caller, pluginInstance.Translate("HomeDelayWarn", delay), pluginInstance.MessageColor); + pluginInstance.SendMessageToPlayer(caller, "HomeDelayWarn", delay); } bool shouldCancel = false; @@ -56,9 +55,9 @@ public void Execute(IRocketPlayer caller, string[] command) pluginInstance.MovementDetector.AddPlayer(player.Player, () => { shouldCancel = true; - UnturnedChat.Say(player, pluginInstance.Translate("HomeCanceledYouMoved"), pluginInstance.MessageColor); + pluginInstance.SendMessageToPlayer(player, "HomeCanceledYouMoved"); }); - } + } TaskDispatcher.QueueOnMainThread(() => { @@ -80,11 +79,11 @@ public void Execute(IRocketPlayer caller, string[] command) if (!player.Player.teleportToLocation(home.LivePosition + new Vector3(0f, pluginInstance.Configuration.Instance.TeleportHeight, 0f), player.Rotation)) { - UnturnedChat.Say(caller, pluginInstance.Translate("HomeTeleportationFailed", home.Name), pluginInstance.MessageColor); + pluginInstance.SendMessageToPlayer(caller, "HomeTeleportationFailed", home.Name); pluginInstance.PlayerCooldowns.Remove(caller.Id); return; } - UnturnedChat.Say(caller, pluginInstance.Translate("HomeSuccess", home.Name), pluginInstance.MessageColor); + pluginInstance.SendMessageToPlayer(caller, "HomeSuccess", home.Name); }, delay); } @@ -93,13 +92,13 @@ private bool ValidateTeleportation(UnturnedPlayer player, PlayerHome home) if (home.InteractableBed == null || !home.InteractableBed.isActiveAndEnabled || home.InteractableBed.owner != player.CSteamID) { HomesHelper.RemoveHome(player.CSteamID, home); - UnturnedChat.Say(player, pluginInstance.Translate("BedDestroyed"), pluginInstance.MessageColor); + pluginInstance.SendMessageToPlayer(player, "BedDestroyed"); return false; } if (player.Stance == EPlayerStance.DRIVING) { - UnturnedChat.Say(player, pluginInstance.Translate("WhileDriving"), pluginInstance.MessageColor); + pluginInstance.SendMessageToPlayer(player, "WhileDriving"); return false; } @@ -116,18 +115,18 @@ private bool ValitedateRaidAndCombat(UnturnedPlayer player) TeleportationPlugin teleportation = pluginInstance.TeleportationPlugin as TeleportationPlugin; if (teleportation.IsPlayerInCombat(player.CSteamID)) { - UnturnedChat.Say(player, pluginInstance.Translate("WhileCombat"), pluginInstance.MessageColor); + pluginInstance.SendMessageToPlayer(player, "WhileCombat"); return false; } if (teleportation.IsPlayerInRaid(player.CSteamID)) { - UnturnedChat.Say(player, pluginInstance.Translate("WhileRaid"), pluginInstance.MessageColor); + pluginInstance.SendMessageToPlayer(player, "WhileRaid"); return false; } return true; } - + public AllowedCaller AllowedCaller => AllowedCaller.Player; public string Name => "home"; @@ -140,4 +139,4 @@ private bool ValitedateRaidAndCombat(UnturnedPlayer player) public List Permissions => new List(); } -} +} \ No newline at end of file diff --git a/MoreHomes/Commands/HomesCommand.cs b/MoreHomes/Commands/HomesCommand.cs index bd01636..ff0d724 100644 --- a/MoreHomes/Commands/HomesCommand.cs +++ b/MoreHomes/Commands/HomesCommand.cs @@ -1,7 +1,6 @@ using RestoreMonarchy.MoreHomes.Helpers; using RestoreMonarchy.MoreHomes.Models; using Rocket.API; -using Rocket.Unturned.Chat; using Rocket.Unturned.Player; using System.Collections.Generic; using System.Text; @@ -14,24 +13,24 @@ public class HomesCommand : IRocketCommand public void Execute(IRocketPlayer caller, string[] command) { UnturnedPlayer player = (UnturnedPlayer)caller; - + PlayerData playerData = HomesHelper.GetOrCreatePlayer(player.CSteamID); if (playerData.Homes.Count == 0) { - UnturnedChat.Say(caller, pluginInstance.Translate("NoHomes"), pluginInstance.MessageColor); + pluginInstance.SendMessageToPlayer(caller, "NoHomes"); return; } StringBuilder sb = new StringBuilder(pluginInstance.Translate("HomeList", playerData.Homes.Count, VipHelper.GetPlayerMaxHomes(player.Id))); - + foreach (PlayerHome home in playerData.Homes) { sb.Append($"{home.Name}, "); } string msg = sb.ToString().TrimEnd(',', ' '); - UnturnedChat.Say(caller, msg, pluginInstance.MessageColor); + pluginInstance.SendMessageToPlayer(caller, msg); } public AllowedCaller AllowedCaller => AllowedCaller.Player; @@ -44,6 +43,6 @@ public void Execute(IRocketPlayer caller, string[] command) public List Aliases => new List(); - public List Permissions => new List(); + public List Permissions => new List(); } -} +} \ No newline at end of file diff --git a/MoreHomes/Commands/RenameHomeCommand.cs b/MoreHomes/Commands/RenameHomeCommand.cs index 8b4a12c..16e51c4 100644 --- a/MoreHomes/Commands/RenameHomeCommand.cs +++ b/MoreHomes/Commands/RenameHomeCommand.cs @@ -1,5 +1,4 @@ using Rocket.API; -using Rocket.Unturned.Chat; using Rocket.Unturned.Player; using System.Collections.Generic; using RestoreMonarchy.MoreHomes.Helpers; @@ -15,25 +14,25 @@ public void Execute(IRocketPlayer caller, string[] command) UnturnedPlayer player = (UnturnedPlayer)caller; if (command.Length < 2) { - UnturnedChat.Say(caller, pluginInstance.Translate("RenameHomeFormat")); + pluginInstance.SendMessageToPlayer(caller, "RenameHomeFormat"); return; } var home = HomesHelper.GetPlayerHome(player.CSteamID, command[0]); if (home == null) { - UnturnedChat.Say(player, pluginInstance.Translate("HomeNotFound", command[0]), pluginInstance.MessageColor); + pluginInstance.SendMessageToPlayer(player, "HomeNotFound", command[0]); return; } if (HomesHelper.GetPlayerHome(player.CSteamID, command[1]) != null) { - UnturnedChat.Say(player, pluginInstance.Translate("RenameHomeFail", command[1]), pluginInstance.MessageColor); + pluginInstance.SendMessageToPlayer(player, "RenameHomeFail", command[1]); return; } home.Name = command[1]; - UnturnedChat.Say(player, pluginInstance.Translate("RenameHomeSuccess", command[0], command[1]), pluginInstance.MessageColor); + pluginInstance.SendMessageToPlayer(player, "RenameHomeSuccess", command[0], command[1]); } public AllowedCaller AllowedCaller => AllowedCaller.Player; @@ -48,4 +47,4 @@ public void Execute(IRocketPlayer caller, string[] command) public List Permissions => new List(); } -} +} \ No newline at end of file diff --git a/MoreHomes/Commands/RestoreHomesCommand.cs b/MoreHomes/Commands/RestoreHomesCommand.cs index 880f05b..327fa7f 100644 --- a/MoreHomes/Commands/RestoreHomesCommand.cs +++ b/MoreHomes/Commands/RestoreHomesCommand.cs @@ -21,15 +21,15 @@ public void Execute(IRocketPlayer caller, string[] command) InteractableBed interactableBed = drop.interactable as InteractableBed; if (interactableBed != null && interactableBed.isClaimed) { - var player = HomesHelper.GetOrCreatePlayer(interactableBed.owner); - var playerHome = new PlayerHome(player.GetUniqueHomeName(), interactableBed); + PlayerData player = HomesHelper.GetOrCreatePlayer(interactableBed.owner); + PlayerHome playerHome = new PlayerHome(player.GetUniqueHomeName(), interactableBed); player.Homes.Add(playerHome); num++; } } } pluginInstance.DataService.SaveData(); - UnturnedChat.Say(caller, pluginInstance.Translate("RestoreHomesSuccess", num), pluginInstance.MessageColor); + pluginInstance.SendMessageToPlayer(caller, "RestoreHomesSuccess", num.ToString("N0")); } public AllowedCaller AllowedCaller => AllowedCaller.Console; diff --git a/MoreHomes/MoreHomes.csproj b/MoreHomes/MoreHomes.csproj index bc6b87e..3087bce 100644 --- a/MoreHomes/MoreHomes.csproj +++ b/MoreHomes/MoreHomes.csproj @@ -4,54 +4,19 @@ net48 latest RestoreMonarchy.MoreHomes - 1.9.0 + 1.10.0 + - - ..\lib\Assembly-CSharp.dll - False - - - ..\lib\com.rlabrecque.steamworks.net.dll - False - - - ..\lib\Newtonsoft.Json.dll - False - - - ..\lib\Rocket.API.dll - False - - - ..\lib\Rocket.Core.dll - False - - - ..\lib\Rocket.Unturned.dll - False - - - ..\lib\SDG.NetTransport.dll - False - ..\lib\Teleportation.dll False - - ..\lib\UnityEngine.dll - False - - - ..\lib\UnityEngine.CoreModule.dll - False - \ No newline at end of file diff --git a/MoreHomes/MoreHomesConfiguration.cs b/MoreHomes/MoreHomesConfiguration.cs index c198f5b..55bcaf1 100644 --- a/MoreHomes/MoreHomesConfiguration.cs +++ b/MoreHomes/MoreHomesConfiguration.cs @@ -6,7 +6,8 @@ namespace RestoreMonarchy.MoreHomes { public class MoreHomesConfiguration : IRocketPluginConfiguration { - public string MessageColor { get; set; } + public string MessageColor { get; set; } + public string MessageIconUrl { get; set; } = "https://i.imgur.com/9TF5aB1.png"; public int DefaultHomeCooldown { get; set; } public int DefaultHomeDelay { get; set; } public int DefaultMaxHomes { get; set; } @@ -20,6 +21,7 @@ public class MoreHomesConfiguration : IRocketPluginConfiguration public void LoadDefaults() { MessageColor = "yellow"; + MessageIconUrl = "https://i.imgur.com/9TF5aB1.png"; DefaultHomeCooldown = 20; DefaultHomeDelay = 10; DefaultMaxHomes = 2; diff --git a/MoreHomes/MoreHomesPlugin.cs b/MoreHomes/MoreHomesPlugin.cs index 1e36e26..c310305 100644 --- a/MoreHomes/MoreHomesPlugin.cs +++ b/MoreHomes/MoreHomesPlugin.cs @@ -6,8 +6,11 @@ using Rocket.Core; using Rocket.Core.Plugins; using Rocket.Unturned.Chat; +using Rocket.Unturned.Player; +using SDG.Unturned; using System; using System.Collections.Generic; +using System.Linq; using UnityEngine; using Logger = Rocket.Core.Logging.Logger; @@ -45,8 +48,10 @@ protected override void Load() R.Plugins.OnPluginsLoaded += OnPluginsLoaded; - Logger.Log($"{Name} {Assembly.GetName().Version} has been loaded!", ConsoleColor.Yellow); - Logger.Log("Brought to you by RestoreMonarchy.com", ConsoleColor.Yellow); + InvokeRepeating(nameof(RemoveExpiredCooldowns), 300, 300); + + Logger.Log($"{Name} {Assembly.GetName().Version.ToString(3)} has been loaded!", ConsoleColor.Yellow); + Logger.Log("Check out more Unturned plugins at restoremonarchy.com"); } protected override void Unload() @@ -55,12 +60,26 @@ protected override void Unload() HarmonyInstance = null; Destroy(DataService); + Destroy(MovementDetector); R.Plugins.OnPluginsLoaded -= OnPluginsLoaded; + CancelInvoke(nameof(RemoveExpiredCooldowns)); + Logger.Log($"{Name} has been unloaded!", ConsoleColor.Yellow); } + private void RemoveExpiredCooldowns() + { + foreach (KeyValuePair cooldown in PlayerCooldowns.ToList()) + { + if (cooldown.Value < DateTime.Now) + { + PlayerCooldowns.Remove(cooldown.Key); + } + } + } + private void OnPluginsLoaded() { IRocketPlugin plugin = R.Plugins.GetPlugin("Teleportation"); @@ -70,32 +89,45 @@ private void OnPluginsLoaded() } } - public override TranslationList DefaultTranslations => new TranslationList(){ - - { "HomeCooldown", "You have to wait {0} seconds to use home again" }, - { "HomeDelayWarn", "You will be teleported to your home in {0} seconds" }, - { "MaxHomesWarn", "You cannot have more homes" }, - { "BedDestroyed", "Your home got destroyed or unclaimed! Teleportation canceled" }, - { "WhileDriving", "You cannot teleport while driving" }, - { "NoHome", "You don't have any home to teleport or name doesn't match any" }, - { "HomeSuccess", "Successfully teleported You to your {0} home!" }, - { "HomeList", "Your homes [{0}/{1}]: " }, - { "NoHomes", "You don't have any home" }, - { "DestroyHomeFormat", "Format: /destroyhome " }, - { "HomeNotFound", "No home match {0} name" }, - { "DestroyHomeSuccess", "Successfully destroyed your home {0}!" }, - { "RenameHomeFormat", "Format: /renamehome " }, - { "HomeAlreadyExists", "You already have a home named {0}" }, - { "RenameHomeSuccess", "Successfully renamed home {0} to {1}!" }, - { "WhileRaid", "You can't teleport while in raiding" }, - { "WhileCombat", "You can't teleport while in combat" }, - { "RestoreHomesSuccess", "Successfully restored {0} homes!" }, - { "RemoveHome", "Your {0} home got removed!" }, - { "RenameHomeSuccess", "Successfully renamed home {0} to {1}!" }, - { "HomeClaimed", "Your new claimed home name is {0}" }, - { "HomeTeleportationFailed", "Failed to teleport you to {0} home" }, - { "HomeDestroyed", "Your home {0} got destroyed or you salvaged it!" }, - { "HomeCanceledYouMoved", "Your home teleportation was canceled because you moved" } - }; + public override TranslationList DefaultTranslations => new TranslationList() + { + { "HomeCooldown", "Please wait [[b]]{0}[[/b]] seconds before using home again" }, + { "HomeDelayWarn", "You will be teleported to your home [[b]]{0}[[/b]] in seconds" }, + { "MaxHomesWarn", "You have reached the maximum number of beds" }, + { "BedDestroyed", "Home unavailable: bed destroyed or unclaimed. Teleportation canceled" }, + { "WhileDriving", "You can't teleport while driving" }, + { "NoHome", "No matching home found for teleportation" }, + { "HomeSuccess", "You were teleported to [[b]]{0}[[/b]] home" }, + { "HomeList", "Your homes [[b]][{0}/{1}][[/b]]: " }, + { "NoHomes", "You don't have any claimed beds" }, + { "DestroyHomeFormat", "Usage: /destroyhome [[name]]" }, + { "HomeNotFound", "No home found with the name [[b]]{0}[[/b]]" }, + { "DestroyHomeSuccess", "Home [[b]]{0}[[/b]] has been removed" }, + { "RenameHomeFormat", "Usage: /renamehome [[current name]] [[new name]]" }, + { "HomeAlreadyExists", "You already have home with the name [[b]]{0}[[/b]]" }, + { "RenameHomeSuccess", "Home renamed from [[b]]{0}[[/b]] to [[b]]{1}[[/b]]" }, + { "WhileRaid", "You can't teleport while in raiding mode" }, + { "WhileCombat", "You can't teleport while in combat mode" }, + { "RestoreHomesSuccess", "[[b]]{0}[[/b]] homes have been restored" }, + { "RemoveHome", "Your [[b]]{0}[[/b]] home has been removed" }, + { "HomeClaimed", "New home claimed with the name [[b]]{0}[[/b]]" }, + { "HomeTeleportationFailed", "Failed to teleport to [[b]]{0}[[/b]] home" }, + { "HomeDestroyed", "Your [[b]]{0}[[/b]] home was destroyed" }, + { "HomeCanceledYouMoved", "Home teleportation canceled because you moved" } + }; + + internal void SendMessageToPlayer(IRocketPlayer player, string translationKey, params object[] placeholder) + { + string msg = Translate(translationKey, placeholder); + msg = msg.Replace("[[", "<").Replace("]]", ">"); + if (player is ConsolePlayer) + { + Logger.Log(msg); + return; + } + + UnturnedPlayer unturnedPlayer = (UnturnedPlayer)player; + ChatManager.serverSendMessage(msg, MessageColor, null, unturnedPlayer.SteamPlayer(), EChatMode.SAY, Configuration.Instance.MessageIconUrl, true); + } } } diff --git a/MoreHomes/Patches/BarricadeManager_destroyBarricade_Patch.cs b/MoreHomes/Patches/BarricadeManager_destroyBarricade_Patch.cs index c4dfd9e..e69575a 100644 --- a/MoreHomes/Patches/BarricadeManager_destroyBarricade_Patch.cs +++ b/MoreHomes/Patches/BarricadeManager_destroyBarricade_Patch.cs @@ -1,6 +1,7 @@ using HarmonyLib; using RestoreMonarchy.MoreHomes.Helpers; using Rocket.Unturned.Chat; +using Rocket.Unturned.Player; using SDG.Unturned; using Steamworks; using UnityEngine; @@ -36,10 +37,11 @@ static void destroyBarricade_Prefix(BarricadeDrop barricade, byte x, byte y, ush if (home != null) { HomesHelper.RemoveHome(interactableBed.owner, home); - if (PlayerTool.getPlayer(interactableBed.owner) != null) + Player player = PlayerTool.getPlayer(interactableBed.owner); + if (player != null) { - UnturnedChat.Say(interactableBed.owner, MoreHomesPlugin.Instance.Translate("HomeDestroyed", home.Name), - MoreHomesPlugin.Instance.MessageColor); + UnturnedPlayer unturnedPlayer = UnturnedPlayer.FromPlayer(player); + MoreHomesPlugin.Instance.SendMessageToPlayer(unturnedPlayer, "HomeDestroyed", home.Name); } } } diff --git a/MoreHomes/Patches/InteractableBed_ReceiveClaimRequest_Patch.cs b/MoreHomes/Patches/InteractableBed_ReceiveClaimRequest_Patch.cs index fed5552..a3a46d2 100644 --- a/MoreHomes/Patches/InteractableBed_ReceiveClaimRequest_Patch.cs +++ b/MoreHomes/Patches/InteractableBed_ReceiveClaimRequest_Patch.cs @@ -5,6 +5,7 @@ using RestoreMonarchy.MoreHomes.Helpers; using RestoreMonarchy.MoreHomes.Models; using Rocket.Unturned.Chat; +using Rocket.Unturned.Player; namespace RestoreMonarchy.MoreHomes.Patches { @@ -50,7 +51,8 @@ static bool ReceiveClaimRequest_Prefix(InteractableBed __instance, in ServerInvo } else { - var playerData = HomesHelper.GetOrCreatePlayer(steamID); + UnturnedPlayer unturnedPlayer = UnturnedPlayer.FromPlayer(player); + PlayerData playerData = HomesHelper.GetOrCreatePlayer(steamID); int maxHomes = VipHelper.GetPlayerMaxHomes(steamID.ToString()); if (maxHomes == 1 && playerData.Homes.Count == 1) { @@ -62,14 +64,14 @@ static bool ReceiveClaimRequest_Prefix(InteractableBed __instance, in ServerInvo } else if (maxHomes <= playerData.Homes.Count) { - UnturnedChat.Say(steamID, MoreHomesPlugin.Instance.Translate("MaxHomesWarn"), MoreHomesPlugin.Instance.MessageColor); + MoreHomesPlugin.Instance.SendMessageToPlayer(unturnedPlayer, "MaxHomesWarn"); return false; } - PlayerHome playerHome = new PlayerHome(playerData.GetUniqueHomeName(), __instance); + PlayerHome playerHome = new(playerData.GetUniqueHomeName(), __instance); playerData.Homes.Add(playerHome); playerHome.Claim(player); - UnturnedChat.Say(steamID, MoreHomesPlugin.Instance.Translate("HomeClaimed", playerHome.Name), MoreHomesPlugin.Instance.MessageColor); + MoreHomesPlugin.Instance.SendMessageToPlayer(unturnedPlayer, "HomeClaimed", playerHome.Name); } } diff --git a/MoreHomes/Services/DataService.cs b/MoreHomes/Services/DataService.cs index 5504bbe..f7d019e 100644 --- a/MoreHomes/Services/DataService.cs +++ b/MoreHomes/Services/DataService.cs @@ -92,7 +92,9 @@ public void ReloadData(int i = 0) foreach (var drop in region.drops) { if (drop.interactable as InteractableBed != null) + { interactableBeds.Add(drop.interactable as InteractableBed); + } } } @@ -102,7 +104,8 @@ public void ReloadData(int i = 0) { foreach (var interactableBed in interactableBeds) { - if (interactableBed.transform.position.x == home.Position.X && interactableBed.transform.position.y == home.Position.Y + if (interactableBed.transform.position.x == home.Position.X + && interactableBed.transform.position.y == home.Position.Y && interactableBed.transform.position.z == home.Position.Z) { home.InteractableBed = interactableBed; @@ -120,13 +123,14 @@ public void SaveData() { foreach (var home in player.Homes) { - if (home == null || home.InteractableBed == null) + if (home == null || home.InteractableBed == null) + { continue; + } home.Position = new ConvertablePosition(home.LivePosition); } } PlayersDataStorage.Save(PlayersData); - Logger.Log($"{PlayersData.Count} player homes data has been saved!"); } } } diff --git a/lib/Assembly-CSharp.dll b/lib/Assembly-CSharp.dll deleted file mode 100644 index 969e0ea..0000000 Binary files a/lib/Assembly-CSharp.dll and /dev/null differ diff --git a/lib/Newtonsoft.Json.dll b/lib/Newtonsoft.Json.dll deleted file mode 100644 index 1c1d83f..0000000 Binary files a/lib/Newtonsoft.Json.dll and /dev/null differ diff --git a/lib/Rocket.API.dll b/lib/Rocket.API.dll deleted file mode 100644 index 1712e4a..0000000 Binary files a/lib/Rocket.API.dll and /dev/null differ diff --git a/lib/Rocket.Core.dll b/lib/Rocket.Core.dll deleted file mode 100644 index bd58a1e..0000000 Binary files a/lib/Rocket.Core.dll and /dev/null differ diff --git a/lib/Rocket.Unturned.dll b/lib/Rocket.Unturned.dll deleted file mode 100644 index 1c5cb3d..0000000 Binary files a/lib/Rocket.Unturned.dll and /dev/null differ diff --git a/lib/SDG.NetTransport.dll b/lib/SDG.NetTransport.dll deleted file mode 100644 index 82a4147..0000000 Binary files a/lib/SDG.NetTransport.dll and /dev/null differ diff --git a/lib/UnityEngine.CoreModule.dll b/lib/UnityEngine.CoreModule.dll deleted file mode 100644 index aad4286..0000000 Binary files a/lib/UnityEngine.CoreModule.dll and /dev/null differ diff --git a/lib/UnityEngine.PhysicsModule.dll b/lib/UnityEngine.PhysicsModule.dll deleted file mode 100644 index 4377f64..0000000 Binary files a/lib/UnityEngine.PhysicsModule.dll and /dev/null differ diff --git a/lib/UnityEngine.dll b/lib/UnityEngine.dll deleted file mode 100644 index e05f51d..0000000 Binary files a/lib/UnityEngine.dll and /dev/null differ diff --git a/lib/com.rlabrecque.steamworks.net.dll b/lib/com.rlabrecque.steamworks.net.dll deleted file mode 100644 index b1ec9fa..0000000 Binary files a/lib/com.rlabrecque.steamworks.net.dll and /dev/null differ