diff --git a/.gitignore b/.gitignore index 7964536..5af0f1e 100644 --- a/.gitignore +++ b/.gitignore @@ -15,6 +15,9 @@ build/ bld/ [Bb]in/ [Oo]bj/ +.vs +bin/ +obj/ # Roslyn cache directories *.ide/ diff --git a/CommandApay.cs b/CommandApay.cs index fd31327..b691d4a 100644 --- a/CommandApay.cs +++ b/CommandApay.cs @@ -1,103 +1,77 @@ -using System; -using System.Collections.Generic; - +using System.Collections.Generic; +using fr34kyn01535.Uconomy; using Rocket.API; -using Rocket.Unturned; using Rocket.Unturned.Chat; -using Rocket.Unturned.Commands; using Rocket.Unturned.Player; -using fr34kyn01535.Uconomy; -using SDG.Unturned; using Steamworks; -namespace Uconomy_Essentials +namespace ZaupUconomyEssentials { public class CommandApay : IRocketCommand { + public AllowedCaller AllowedCaller => AllowedCaller.Player; + + public string Name => "apay"; + + public string Help => "Allows an allowed person to pay someone else not using their own currency."; + + public string Syntax => " "; + + public List Aliases => new List(); + + public List Permissions => new List(); - public AllowedCaller AllowedCaller - { - get - { - return AllowedCaller.Player; - } - } - public string Name - { - get - { - return "apay"; - } - } - public string Help - { - get - { - return "Allows an allowed person to pay someone else not using their own currency."; - } - } - public string Syntax - { - get - { - return " "; - } - } - public List Aliases - { - get { return new List(); } - } - public List Permissions - { - get { return new List(); } - } public void Execute(IRocketPlayer caller, string[] msg) { - UnturnedPlayer playerid = (UnturnedPlayer)caller; + var playerid = (UnturnedPlayer) caller; string message; if (msg.Length == 0) { - message = Uconomy_Essentials.Instance.Translate("apay_usage_msg", new object[] {}); + message = UconomyEssentials.Instance.Translate("apay_usage_msg"); // We are going to print how to use UnturnedChat.Say(playerid, message); return; } + if (msg.Length != 2) { - message = Uconomy_Essentials.Instance.Translate("apay_usage_msg", new object[] { }); + message = UconomyEssentials.Instance.Translate("apay_usage_msg"); // Print how to use UnturnedChat.Say(playerid, message); return; } - UnturnedPlayer rp = UnturnedPlayer.FromName(msg[0]); + + var rp = UnturnedPlayer.FromName(msg[0]); if (rp == null) { - ulong id; - ulong.TryParse(msg[0], out id); - if (!((CSteamID)id).IsValid()) + ulong.TryParse(msg[0], out var id); + if (!((CSteamID) id).IsValid()) { - message = Uconomy_Essentials.Instance.Translate("not_valid_player_msg", new object[] {msg[0]}); + message = UconomyEssentials.Instance.Translate("not_valid_player_msg", msg[0]); UnturnedChat.Say(playerid, message); return; } - else - { - rp = UnturnedPlayer.FromCSteamID((CSteamID)id); - } - + + rp = UnturnedPlayer.FromCSteamID((CSteamID) id); } - uint amt; - uint.TryParse(msg[1], out amt); + + uint.TryParse(msg[1], out var amt); if (amt <= 0) { - message = Uconomy_Essentials.Instance.Translate("not_valid_amount", new object[] { msg[1] }); + message = UconomyEssentials.Instance.Translate("not_valid_amount", msg[1]); UnturnedChat.Say(playerid, message); return; } - decimal newbal = Uconomy.Instance.Database.IncreaseBalance(rp.CSteamID.ToString(), amt); - UnturnedChat.Say(rp.CSteamID, Uconomy_Essentials.Instance.Translate("apaid_msg", new object[] {playerid.CharacterName, amt, Uconomy.Instance.Configuration.Instance.MoneyName, newbal, Uconomy.Instance.Configuration.Instance.MoneyName})); - UnturnedChat.Say(playerid, Uconomy_Essentials.Instance.Translate("apay_msg", new object[] {rp.CharacterName, amt, Uconomy.Instance.Configuration.Instance.MoneyName})); - Uconomy_Essentials.HandleEvent(rp, amt, "paid"); + + var newbal = Uconomy.Instance.Database.IncreaseBalance(rp.CSteamID.ToString(), amt); + UnturnedChat.Say(rp.CSteamID, + UconomyEssentials.Instance.Translate("apaid_msg", playerid.CharacterName, amt, + Uconomy.Instance.Configuration.Instance.MoneyName, newbal, + Uconomy.Instance.Configuration.Instance.MoneyName)); + UnturnedChat.Say(playerid, + UconomyEssentials.Instance.Translate("apay_msg", rp.CharacterName, amt, + Uconomy.Instance.Configuration.Instance.MoneyName)); + UconomyEssentials.HandleEvent(rp, amt, "paid"); } } -} +} \ No newline at end of file diff --git a/CommandExchange.cs b/CommandExchange.cs index 56f707d..04233e2 100644 --- a/CommandExchange.cs +++ b/CommandExchange.cs @@ -1,134 +1,114 @@ -using System; -using System.Collections.Generic; - +using System.Collections.Generic; +using fr34kyn01535.Uconomy; using Rocket.API; -using Rocket.Unturned; using Rocket.Unturned.Chat; -using Rocket.Unturned.Commands; using Rocket.Unturned.Player; -using fr34kyn01535.Uconomy; using SDG.Unturned; -using Steamworks; -namespace Uconomy_Essentials +namespace ZaupUconomyEssentials { public class CommandExchange : IRocketCommand { + public AllowedCaller AllowedCaller => AllowedCaller.Player; + + public string Name => "exchange"; + + public string Help => "Exchanges experience for economy currency."; + + public string Syntax => " [money]"; + + public List Aliases => new List(); + + public List Permissions => new List(); - public AllowedCaller AllowedCaller - { - get - { - return AllowedCaller.Player; - } - } - public string Name - { - get - { - return "exchange"; - } - } - public string Help - { - get - { - return "Exchanges experience for economy currency."; - } - } - public string Syntax - { - get - { - return " [money]"; - } - } - public List Aliases - { - get { return new List(); } - } - public List Permissions - { - get { return new List(); } - } public void Execute(IRocketPlayer caller, string[] amt) { - UnturnedPlayer playerid = (UnturnedPlayer)caller; + var playerid = (UnturnedPlayer) caller; string message; if (amt.Length == 0) { - message = Uconomy_Essentials.Instance.Translate("exchange_usage_msg", new object[] { }); + message = UconomyEssentials.Instance.Translate("exchange_usage_msg"); UnturnedChat.Say(playerid, message); return; } + if (amt.Length > 2) { - message = Uconomy_Essentials.Instance.Translate("exchange_usage_msg", new object[] { }); + message = UconomyEssentials.Instance.Translate("exchange_usage_msg"); UnturnedChat.Say(playerid, message); return; } - if (!Uconomy_Essentials.Instance.Configuration.Instance.ExpExchange && amt.Length == 1) + + if (!UconomyEssentials.Instance.Configuration.Instance.ExpExchange && amt.Length == 1) { - message = Uconomy_Essentials.Instance.Translate("experience_exchange_not_available", new object[] { }); + message = UconomyEssentials.Instance.Translate("experience_exchange_not_available"); UnturnedChat.Say(playerid, message); return; } - if (!Uconomy_Essentials.Instance.Configuration.Instance.MoneyExchange && amt.Length == 2) + + if (!UconomyEssentials.Instance.Configuration.Instance.MoneyExchange && amt.Length == 2) { - message = Uconomy_Essentials.Instance.Translate("money_exchange_not_available", new object[] { }); + message = UconomyEssentials.Instance.Translate("money_exchange_not_available"); UnturnedChat.Say(playerid, message); return; } + // Get expereience balance first - uint exp = playerid.Experience; - uint examt = 0; - UInt32.TryParse(amt[0], out examt); + var exp = playerid.Experience; + uint.TryParse(amt[0], out var examt); if (examt <= 0) { - message = Uconomy_Essentials.Instance.Translate("exchange_zero_amount_error", new object[] { }); + message = UconomyEssentials.Instance.Translate("exchange_zero_amount_error"); UnturnedChat.Say(playerid, message); return; } + if (exp < examt && amt.Length == 1) { - message = Uconomy_Essentials.Instance.Translate("exchange_insufficient_experience", new object[] { examt.ToString() }); + message = UconomyEssentials.Instance.Translate("exchange_insufficient_experience", examt.ToString()); UnturnedChat.Say(playerid, message); return; } + // Get balance first - decimal bal = Uconomy.Instance.Database.GetBalance(playerid.CSteamID.ToString()); + var bal = Uconomy.Instance.Database.GetBalance(playerid.CSteamID.ToString()); if (amt.Length > 1 && bal < examt) { - message = Uconomy_Essentials.Instance.Translate("exchange_insufficient_money", new object[] { examt.ToString(), Uconomy.Instance.Configuration.Instance.MoneyName }); + message = UconomyEssentials.Instance.Translate("exchange_insufficient_money", examt.ToString(), + Uconomy.Instance.Configuration.Instance.MoneyName); UnturnedChat.Say(playerid, message); return; } + switch (amt.Length) { case 1: - decimal gain = (decimal)((float)examt * Uconomy_Essentials.Instance.Configuration.Instance.ExpExchangerate); + var gain = (decimal) (examt * + UconomyEssentials.Instance.Configuration.Instance.ExpExchangerate); // Just to make sure to avoid any errors - gain = Decimal.Round(gain, 2); - decimal newbal = Uconomy.Instance.Database.IncreaseBalance(playerid.CSteamID.ToString(), gain); - message = Uconomy_Essentials.Instance.Translate("new_balance_msg", new object[] { newbal.ToString(), Uconomy.Instance.Configuration.Instance.MoneyName }); + gain = decimal.Round(gain, 2); + var newbal = Uconomy.Instance.Database.IncreaseBalance(playerid.CSteamID.ToString(), gain); + message = UconomyEssentials.Instance.Translate("new_balance_msg", newbal, + Uconomy.Instance.Configuration.Instance.MoneyName); UnturnedChat.Say(playerid, message); playerid.Experience -= examt; - Uconomy_Essentials.HandleEvent(playerid, gain, "exchange", examt); + UconomyEssentials.HandleEvent(playerid, gain, "exchange", examt); break; case 2: - uint gainm = (uint)((float)examt * Uconomy_Essentials.Instance.Configuration.Instance.MoneyExchangerate); + var gainm = (uint) (examt * + UconomyEssentials.Instance.Configuration.Instance.MoneyExchangerate); // Just to make sure to avoid any errors - newbal = Uconomy.Instance.Database.IncreaseBalance(playerid.CSteamID.ToString(), (examt * -1.0m)); - message = Uconomy_Essentials.Instance.Translate("new_balance_msg", new object[] { newbal.ToString(), Uconomy.Instance.Configuration.Instance.MoneyName }); + newbal = Uconomy.Instance.Database.IncreaseBalance(playerid.CSteamID.ToString(), examt * -1.0m); + message = UconomyEssentials.Instance.Translate("new_balance_msg", newbal, + Uconomy.Instance.Configuration.Instance.MoneyName); UnturnedChat.Say(playerid, message); playerid.Experience += gainm; - Uconomy_Essentials.HandleEvent(playerid, gainm, "exchange", examt, "money"); + UconomyEssentials.HandleEvent(playerid, gainm, "exchange", examt, "money"); break; } - playerid.Player.SteamChannel.send("tellExperience", ESteamCall.OWNER, ESteamPacket.UPDATE_RELIABLE_BUFFER, new object[] - { - playerid.Experience - }); + + playerid.Player.channel.send("tellExperience", ESteamCall.OWNER, ESteamPacket.UPDATE_RELIABLE_BUFFER, + playerid.Experience); } } -} +} \ No newline at end of file diff --git a/Group.cs b/Group.cs index 359b2cc..0189510 100644 --- a/Group.cs +++ b/Group.cs @@ -1,52 +1,11 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Xml.Serialization; +using System.Xml.Serialization; -namespace Uconomy_Essentials +namespace ZaupUconomyEssentials { [XmlRoot("UconomyEConfiguration")] public class Group { - [XmlAttribute] - public string DisplayName { get; set;} - [XmlAttribute] - public decimal Salary { get; set; } + [XmlAttribute] public string DisplayName { get; set; } + [XmlAttribute] public decimal Salary { get; set; } } - - class GroupComparer : IEqualityComparer - { - public bool Equals(Group x, Group y) - { - - //Check whether the compared objects reference the same data. - if (Object.ReferenceEquals(x, y)) return true; - - //Check whether any of the compared objects is null. - if (Object.ReferenceEquals(x, null) || Object.ReferenceEquals(y, null)) - return false; - - //Check whether the products' properties are equal. - return x.DisplayName == y.DisplayName && x.Salary == y.Salary; - } - - // If Equals() returns true for a pair of objects - // then GetHashCode() must return the same value for these objects. - - public int GetHashCode(Group g) - { - //Check whether the object is null - if (Object.ReferenceEquals(g, null)) return 0; - - //Get hash code for the Name field if it is not null. - int hashGroupName = g.DisplayName == null ? 0 : g.DisplayName.GetHashCode(); - - //Get hash code for the Salary field. - int hashGroupSalary = g.Salary.GetHashCode(); - - //Calculate the hash code for the product. - return hashGroupName ^ hashGroupSalary; - } - - } -} +} \ No newline at end of file diff --git a/GroupComparer.cs b/GroupComparer.cs new file mode 100644 index 0000000..20c73b0 --- /dev/null +++ b/GroupComparer.cs @@ -0,0 +1,35 @@ +using System.Collections.Generic; + +namespace ZaupUconomyEssentials +{ + internal class GroupComparer : IEqualityComparer + { + public bool Equals(Group x, Group y) + { + //Check whether the compared objects reference the same data. + if (ReferenceEquals(x, y)) return true; + + //Check whether any of the compared objects is null. + if (ReferenceEquals(x, null) || ReferenceEquals(y, null)) + return false; + + //Check whether the products' properties are equal. + return x.DisplayName == y.DisplayName && x.Salary == y.Salary; + } + + // If Equals() returns true for a pair of objects + // then GetHashCode() must return the same value for these objects. + + public int GetHashCode(Group g) + { + //Get hash code for the Name field if it is not null. + var hashGroupName = g.DisplayName == null ? 0 : g.DisplayName.GetHashCode(); + + //Get hash code for the Salary field. + var hashGroupSalary = g.Salary.GetHashCode(); + + //Calculate the hash code for the product. + return hashGroupName ^ hashGroupSalary; + } + } +} \ No newline at end of file diff --git a/LICENSE b/LICENSE index a66d7fa..5c07943 100644 --- a/LICENSE +++ b/LICENSE @@ -1,40 +1,21 @@ -Unturned 3 is property of Smartly Dressed Games. -You are not allowed to change, mix or redistribute Unturned 3 -unless permission is explicitly given by Smartly Dressed Games. -Copyright (C) 2015 Smartly Dressed Games - - -The Rocket Wiki accesible at https://github.com/RocketFoundation/Rocket/wiki/ -is licensed under a Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0) License. -You are free to share and adapt it for any purpose as long as you give appropiate -credit and license any derivations under the same license as the original. -See http://creativecommons.org/licenses/by-sa/3.0/ for the human-readable summary -and http://creativecommons.org/licenses/by-sa/3.0/legalcode for the full license. - - -Rocket, as a modification to Unturned 3 is licensed under a -Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License. -You are free to share it as long as you give appropiate credit, don't use it -for commercial purposes and dont distribute modified versions. -See http://creativecommons.org/licenses/by-nc-nd/3.0/ for the human-readable summary -and http://creativecommons.org/licenses/by-nc-nd/3.0/legalcode for the full license. - -If you want to use Rocket for comercial purposes, please contact us at info@rocket.foundation - - -The RocketAPI is licensed under GPLv2. -All plugins are automatically sub licensed under the same license. -Copyright (C) 2015 Rocket Foundation - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . \ No newline at end of file +MIT License + +Copyright (c) 2019 Sven Mawby + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/Libraries/BouncyCastle.Crypto.dll b/Libraries/BouncyCastle.Crypto.dll new file mode 100644 index 0000000..7a8034b Binary files /dev/null and b/Libraries/BouncyCastle.Crypto.dll differ diff --git a/Libraries/Google.Protobuf.dll b/Libraries/Google.Protobuf.dll new file mode 100644 index 0000000..3683dc8 Binary files /dev/null and b/Libraries/Google.Protobuf.dll differ diff --git a/Libraries/I18N.West.dll b/Libraries/I18N.West.dll index bf7a5d6..af4ff63 100644 Binary files a/Libraries/I18N.West.dll and b/Libraries/I18N.West.dll differ diff --git a/Libraries/I18N.dll b/Libraries/I18N.dll index 21afd5d..a2627c2 100644 Binary files a/Libraries/I18N.dll and b/Libraries/I18N.dll differ diff --git a/Libraries/MySql.Data.dll b/Libraries/MySql.Data.dll index 5534f2b..54caaab 100644 Binary files a/Libraries/MySql.Data.dll and b/Libraries/MySql.Data.dll differ diff --git a/Libraries/Renci.SshNet.dll b/Libraries/Renci.SshNet.dll new file mode 100644 index 0000000..4e2d603 Binary files /dev/null and b/Libraries/Renci.SshNet.dll differ diff --git a/Libraries/System.Data.dll b/Libraries/System.Data.dll index f051b61..d38371d 100644 Binary files a/Libraries/System.Data.dll and b/Libraries/System.Data.dll differ diff --git a/Libraries/System.Management.dll b/Libraries/System.Management.dll index 0c04a72..454a7c8 100644 Binary files a/Libraries/System.Management.dll and b/Libraries/System.Management.dll differ diff --git a/Libraries/System.Transactions.dll b/Libraries/System.Transactions.dll index 0191347..c3b3e96 100644 Binary files a/Libraries/System.Transactions.dll and b/Libraries/System.Transactions.dll differ diff --git a/PlayerUE.cs b/PlayerUE.cs index 5604389..c10c1a3 100644 --- a/PlayerUE.cs +++ b/PlayerUE.cs @@ -1,151 +1,194 @@ using System; -using System.Collections.Generic; - -using Rocket.API; +using fr34kyn01535.Uconomy; using Rocket.Core; using Rocket.Core.Logging; -using Rocket.Core.Permissions; -using Rocket.Unturned; using Rocket.Unturned.Chat; using Rocket.Unturned.Events; using Rocket.Unturned.Player; using SDG.Unturned; -using UnityEngine; using Steamworks; -using fr34kyn01535.Uconomy; -using Rocket.API.Serialisation; -namespace Uconomy_Essentials +namespace ZaupUconomyEssentials { - public class PlayerUE : UnturnedPlayerComponent + public class PlayerUe : UnturnedPlayerComponent { - private DateTime lastpaid; - private UnturnedPlayerEvents rpe; + private DateTime _lastpaid; + private UnturnedPlayerEvents _rpe; protected void Start() { - this.rpe = base.gameObject.transform.GetComponent(); - this.lastpaid = DateTime.Now; - this.rpe.OnDeath += new UnturnedPlayerEvents.PlayerDeath(this.rpe_OnPlayerDeath); - this.rpe.OnUpdateStat += this.rpe_OnUpdateStat; + _rpe = gameObject.transform.GetComponent(); + _lastpaid = DateTime.Now; + _rpe.OnDeath += rpe_OnPlayerDeath; + _rpe.OnUpdateStat += rpe_OnUpdateStat; } - private void rpe_OnPlayerDeath(UnturnedPlayer player, EDeathCause cause, ELimb limb, CSteamID murderer) + + private static void rpe_OnPlayerDeath(UnturnedPlayer player, EDeathCause cause, ELimb limb, CSteamID murderer) { if (player == null) return; - if (murderer == null) return; - UnturnedPlayer killer = UnturnedPlayer.FromCSteamID(murderer); + if (murderer == CSteamID.Nil) return; + + var killer = UnturnedPlayer.FromCSteamID(murderer); if (killer == null) return; - if (Uconomy_Essentials.Instance.Configuration.Instance.PayHit) + + if (!UconomyEssentials.Instance.Configuration.Instance.PayHit) return; + + var u = Uconomy.Instance; + var bal = u.Database.GetBalance(player.CSteamID.ToString()); + + if (cause == EDeathCause.SUICIDE && UconomyEssentials.Instance.Configuration.Instance.LoseSuicide) { - Uconomy u = Uconomy.Instance; - decimal bal = u.Database.GetBalance(player.CSteamID.ToString()); - if (cause == EDeathCause.SUICIDE && Uconomy_Essentials.Instance.Configuration.Instance.LoseSuicide) - { - // We are going to remove currency for the suicide - decimal loss = (decimal)Uconomy_Essentials.Instance.Configuration.Instance.LoseSuicideAmt * -1.0m; - if (bal + loss < 0.0m) loss = bal * -1.0m; - decimal bal1 = u.Database.IncreaseBalance(player.CSteamID.ToString(), loss); - Uconomy_Essentials.HandleEvent(player, (loss * -1.0m), "loss"); - UnturnedChat.Say(player.CSteamID, Uconomy_Essentials.Instance.Translate("lose_suicide_msg", new object[] {Uconomy_Essentials.Instance.Configuration.Instance.LoseSuicideAmt, u.Configuration.Instance.MoneyName})); - if (bal1 != 0m) UnturnedChat.Say(player.CSteamID, Uconomy_Essentials.Instance.Translate("new_balance_msg", new object[] {bal1, u.Configuration.Instance.MoneyName})); - return; - } - else if (cause == EDeathCause.SUICIDE && !Uconomy_Essentials.Instance.Configuration.Instance.LoseSuicide) - { - // We do nothing if they suicide. - return; - } - if (Uconomy_Essentials.Instance.Configuration.Instance.LoseMoneyOnDeath) - { - decimal loss = (decimal)Uconomy_Essentials.Instance.Configuration.Instance.LoseMoneyOnDeathAmt * -1.0m; - if (bal + loss < 0.0m) loss = bal * -1.0m; - decimal lostbal = u.Database.IncreaseBalance(player.CSteamID.ToString(), loss); - Uconomy_Essentials.HandleEvent(player, (loss * -1.0m), "loss"); - UnturnedChat.Say(player.CSteamID, Uconomy_Essentials.Instance.Translate("lose_money_on_death_msg", new object[] {Uconomy_Essentials.Instance.Configuration.Instance.LoseMoneyOnDeathAmt.ToString(), u.Configuration.Instance.MoneyName})); - } - // Pay the other player for the kill - decimal balk = u.Database.IncreaseBalance(murderer.ToString(), (decimal)Uconomy_Essentials.Instance.Configuration.Instance.PayHitAmt); - Uconomy_Essentials.HandleEvent(player, (decimal)Uconomy_Essentials.Instance.Configuration.Instance.PayHitAmt, "paid"); - if (!Uconomy_Essentials.Instance.Configuration.Instance.SendPayHitMsg) return; // No message is to be sent, so job is done. - UnturnedChat.Say(murderer, Uconomy_Essentials.Instance.Translate("to_killer_msg", new object[] {Uconomy_Essentials.Instance.Configuration.Instance.PayHitAmt.ToString(), u.Configuration.Instance.MoneyName, player.CharacterName})); - if (bal != 0m) UnturnedChat.Say(murderer, Uconomy_Essentials.Instance.Translate("new_balance_msg", new object[] {balk.ToString(), u.Configuration.Instance.MoneyName})); + // We are going to remove currency for the suicide + var loss = (decimal) UconomyEssentials.Instance.Configuration.Instance.LoseSuicideAmt * -1.0m; + if (bal + loss < 0.0m) loss = bal * -1.0m; + var bal1 = u.Database.IncreaseBalance(player.CSteamID.ToString(), loss); + UconomyEssentials.HandleEvent(player, loss * -1.0m, "loss"); + UnturnedChat.Say(player.CSteamID, + UconomyEssentials.Instance.Translate("lose_suicide_msg", + UconomyEssentials.Instance.Configuration.Instance.LoseSuicideAmt, + u.Configuration.Instance.MoneyName)); + if (bal1 != 0m) + UnturnedChat.Say(player.CSteamID, + UconomyEssentials.Instance.Translate("new_balance_msg", bal1, + u.Configuration.Instance.MoneyName)); + return; + } + + // We do nothing if they suicide. + if (cause == EDeathCause.SUICIDE && + !UconomyEssentials.Instance.Configuration.Instance.LoseSuicide) + return; + + if (UconomyEssentials.Instance.Configuration.Instance.LoseMoneyOnDeath) + { + var loss = (decimal) UconomyEssentials.Instance.Configuration.Instance.LoseMoneyOnDeathAmt * -1.0m; + if (bal + loss < 0.0m) loss = bal * -1.0m; + u.Database.IncreaseBalance(player.CSteamID.ToString(), loss); + UconomyEssentials.HandleEvent(player, loss * -1.0m, "loss"); + UnturnedChat.Say(player.CSteamID, + UconomyEssentials.Instance.Translate("lose_money_on_death_msg", + UconomyEssentials.Instance.Configuration.Instance.LoseMoneyOnDeathAmt, + u.Configuration.Instance.MoneyName)); } + + // Pay the other player for the kill + var balk = u.Database.IncreaseBalance(murderer.ToString(), + (decimal) UconomyEssentials.Instance.Configuration.Instance.PayHitAmt); + UconomyEssentials.HandleEvent(player, + (decimal) UconomyEssentials.Instance.Configuration.Instance.PayHitAmt, "paid"); + if (!UconomyEssentials.Instance.Configuration.Instance.SendPayHitMsg) + return; // No message is to be sent, so job is done. + + UnturnedChat.Say(murderer, + UconomyEssentials.Instance.Translate("to_killer_msg", + UconomyEssentials.Instance.Configuration.Instance.PayHitAmt, u.Configuration.Instance.MoneyName, + player.CharacterName)); + if (bal != 0m) + UnturnedChat.Say(murderer, + UconomyEssentials.Instance.Translate("new_balance_msg", balk, u.Configuration.Instance.MoneyName)); } - private void rpe_OnUpdateStat(UnturnedPlayer player, EPlayerStat stat) + + private static void rpe_OnUpdateStat(UnturnedPlayer player, EPlayerStat stat) { if (player == null) return; - Uconomy u = Uconomy.Instance; - if (Uconomy_Essentials.Instance.Configuration.Instance.PayZombie && stat == EPlayerStat.KILLS_ZOMBIES_NORMAL) + + var u = Uconomy.Instance; + if (UconomyEssentials.Instance.Configuration.Instance.PayZombie && + stat == EPlayerStat.KILLS_ZOMBIES_NORMAL) { - decimal balzk = u.Database.IncreaseBalance(player.CSteamID.ToString(), (decimal)Uconomy_Essentials.Instance.Configuration.Instance.PayZombieAmt); - Uconomy_Essentials.HandleEvent(player, (decimal)Uconomy_Essentials.Instance.Configuration.Instance.PayZombieAmt, "paid"); - if (!Uconomy_Essentials.Instance.Configuration.Instance.SendPayZombieMsg) return; // No message is to be sent, so job is done. - UnturnedChat.Say(player.CSteamID, Uconomy_Essentials.Instance.Translate("zombie_kill_paid_msg", new object[] { Uconomy_Essentials.Instance.Configuration.Instance.PayZombieAmt.ToString(), u.Configuration.Instance.MoneyName, balzk.ToString(), u.Configuration.Instance.MoneyName })); + var balzk = u.Database.IncreaseBalance(player.CSteamID.ToString(), + (decimal) UconomyEssentials.Instance.Configuration.Instance.PayZombieAmt); + UconomyEssentials.HandleEvent(player, + (decimal) UconomyEssentials.Instance.Configuration.Instance.PayZombieAmt, "paid"); + if (!UconomyEssentials.Instance.Configuration.Instance.SendPayZombieMsg) + return; // No message is to be sent, so job is done. + + UnturnedChat.Say(player.CSteamID, + UconomyEssentials.Instance.Translate("zombie_kill_paid_msg", + UconomyEssentials.Instance.Configuration.Instance.PayZombieAmt, + u.Configuration.Instance.MoneyName, balzk, u.Configuration.Instance.MoneyName)); } - else if (Uconomy_Essentials.Instance.Configuration.Instance.PayMegaZombie && stat == EPlayerStat.KILLS_ZOMBIES_MEGA) + else if (UconomyEssentials.Instance.Configuration.Instance.PayMegaZombie && + stat == EPlayerStat.KILLS_ZOMBIES_MEGA) { - decimal balzk = u.Database.IncreaseBalance(player.CSteamID.ToString(), (decimal)Uconomy_Essentials.Instance.Configuration.Instance.PayMegaZombieAmt); - Uconomy_Essentials.HandleEvent(player, (decimal)Uconomy_Essentials.Instance.Configuration.Instance.PayMegaZombieAmt, "paid"); - if (!Uconomy_Essentials.Instance.Configuration.Instance.SendPayMegaZombieMsg) return; // No message is to be sent, so job is done. - UnturnedChat.Say(player.CSteamID, Uconomy_Essentials.Instance.Translate("mega_zombie_kill_paid_msg", new object[] { Uconomy_Essentials.Instance.Configuration.Instance.PayMegaZombieAmt.ToString(), u.Configuration.Instance.MoneyName, balzk.ToString(), u.Configuration.Instance.MoneyName })); + var balzk = u.Database.IncreaseBalance(player.CSteamID.ToString(), + (decimal) UconomyEssentials.Instance.Configuration.Instance.PayMegaZombieAmt); + UconomyEssentials.HandleEvent(player, + (decimal) UconomyEssentials.Instance.Configuration.Instance.PayMegaZombieAmt, "paid"); + if (!UconomyEssentials.Instance.Configuration.Instance.SendPayMegaZombieMsg) + return; // No message is to be sent, so job is done. + + UnturnedChat.Say(player.CSteamID, + UconomyEssentials.Instance.Translate("mega_zombie_kill_paid_msg", + UconomyEssentials.Instance.Configuration.Instance.PayMegaZombieAmt, + u.Configuration.Instance.MoneyName, balzk, u.Configuration.Instance.MoneyName)); } } + private void FixedUpdate() { - if (Uconomy_Essentials.Instance.Configuration.Instance.PayTime && (DateTime.Now - this.lastpaid).TotalSeconds >= Uconomy_Essentials.Instance.Configuration.Instance.PayTimeSeconds) + if (!UconomyEssentials.Instance.Configuration.Instance.PayTime || + !((DateTime.Now - _lastpaid).TotalSeconds >= + UconomyEssentials.Instance.Configuration.Instance.PayTimeSeconds)) return; + + _lastpaid = DateTime.Now; + UconomyEssentials.Instance.groups.TryGetValue("all", out var pay); + var paygroup = "Player"; + if (pay == 0.0m) { - this.lastpaid = DateTime.Now; - decimal pay = 0.0m; - Uconomy_Essentials.Instance.PayGroups.TryGetValue("all", out pay); - string paygroup = "Player"; - if (pay == 0.0m) + // We are checking for the different groups as All is not set. + if (Player.IsAdmin && UconomyEssentials.Instance.groups.ContainsKey("admin")) { - // We are checking for the different groups as All is not set. - if (this.Player.IsAdmin && Uconomy_Essentials.Instance.PayGroups.ContainsKey("admin")) + UconomyEssentials.Instance.groups.TryGetValue("admin", out pay); + paygroup = "admin"; + if (pay == 0.0m) { - Uconomy_Essentials.Instance.PayGroups.TryGetValue("admin", out pay); - paygroup = "admin"; - if (pay == 0.0m) - { - Logger.Log(Uconomy_Essentials.Instance.Translate("unable_to_pay_group_msg", new object[] {this.Player.CharacterName, "admin"})); - return; - } + Logger.Log(UconomyEssentials.Instance.Translate( + "unable_to_pay_group_msg", Player.CharacterName, "admin")); + return; + } + } + else + { + // They aren't admin so we'll just go through like groups like normal. + + var plgroups = R.Permissions.GetGroups(Player, true); + foreach (var s in plgroups) + { + Logger.Log(s.Id); + UconomyEssentials.Instance.groups.TryGetValue(s.Id, out var pay2); + Logger.Log(pay2.ToString()); + if (pay2 <= pay) continue; + + pay = pay2; + paygroup = s.Id; } - else + + if (pay == 0.0m) { - // They aren't admin so we'll just go through like groups like normal. - - List plgroups = R.Permissions.GetGroups(this.Player, true); - decimal pay2 = 0.0m; - foreach (RocketPermissionsGroup s in plgroups) - { - Logger.Log(s.Id); - Uconomy_Essentials.Instance.PayGroups.TryGetValue(s.Id, out pay2); - Logger.Log(pay2.ToString()); - if (pay2 > pay) - { - pay = pay2; - paygroup = s.Id; - } - } + // We assume they are default group. + UconomyEssentials.Instance.groups.TryGetValue("default", out pay); if (pay == 0.0m) { - // We assume they are default group. - Uconomy_Essentials.Instance.PayGroups.TryGetValue("default", out pay); - if (pay == 0.0m) - { - // There was an error. End it. - Logger.Log(Uconomy_Essentials.Instance.Translate("unable_to_pay_group_msg", new object[] {this.Player.CharacterName, ""})); - return; - } + // There was an error. End it. + Logger.Log( + UconomyEssentials.Instance.Translate("unable_to_pay_group_msg", Player.CharacterName, + "")); + return; } } } - decimal bal = Uconomy.Instance.Database.IncreaseBalance(this.Player.CSteamID.ToString(), pay); - Uconomy_Essentials.HandleEvent(this.Player, pay, "paid"); - UnturnedChat.Say(this.Player.CSteamID, Uconomy_Essentials.Instance.Translate("pay_time_msg", new object[] {pay, Uconomy.Instance.Configuration.Instance.MoneyName, paygroup})); - if (bal >= 0.0m) UnturnedChat.Say(this.Player.CSteamID, Uconomy_Essentials.Instance.Translate("new_balance_msg", new object[] { bal, Uconomy.Instance.Configuration.Instance.MoneyName })); } + + var bal = Uconomy.Instance.Database.IncreaseBalance(Player.CSteamID.ToString(), pay); + UconomyEssentials.HandleEvent(Player, pay, "paid"); + UnturnedChat.Say(Player.CSteamID, + UconomyEssentials.Instance.Translate("pay_time_msg", pay, + Uconomy.Instance.Configuration.Instance.MoneyName, paygroup)); + if (bal >= 0.0m) + UnturnedChat.Say(Player.CSteamID, + UconomyEssentials.Instance.Translate("new_balance_msg", bal, + Uconomy.Instance.Configuration.Instance.MoneyName)); } } -} +} \ No newline at end of file diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs index 19fcb85..7aa09b3 100644 --- a/Properties/AssemblyInfo.cs +++ b/Properties/AssemblyInfo.cs @@ -1,36 +1,15 @@ using System.Reflection; -using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. [assembly: AssemblyTitle("Uconomy_Essentials")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("Uconomy_Essentials")] -[assembly: AssemblyCopyright("Copyright © 2015")] +[assembly: AssemblyCopyright("Copyright © 2015 - 2019")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("1ebee473-5fb5-4cd2-a4d7-019ee26cb85d")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.3.0.1")] -[assembly: AssemblyFileVersion("1.3.0.1")] +[assembly: AssemblyFileVersion("1.3.0.1")] \ No newline at end of file diff --git a/README.md b/README.md index 609b3a6..04d5d41 100644 --- a/README.md +++ b/README.md @@ -6,4 +6,4 @@ Allow players to exchange their experience for currency. Give players currency every time they kill a player. Great for pvp servers! Take away currency if a player clicks suicide. -All of these options are configurable and can be turned on and off independently. \ No newline at end of file +All of these options are configurable and can be turned on and off independently. diff --git a/ZaupUconomyEConfiguration.cs b/UconomyEConfiguration.cs similarity index 79% rename from ZaupUconomyEConfiguration.cs rename to UconomyEConfiguration.cs index ec57f65..f676d00 100644 --- a/ZaupUconomyEConfiguration.cs +++ b/UconomyEConfiguration.cs @@ -1,9 +1,7 @@ -using System; -using System.Collections.Generic; - +using System.Collections.Generic; using Rocket.API; -namespace Uconomy_Essentials +namespace ZaupUconomyEssentials { public class UconomyEConfiguration : IRocketPluginConfiguration { @@ -32,11 +30,12 @@ public class UconomyEConfiguration : IRocketPluginConfiguration public void LoadDefaults() { PayTime = false; - PayGroups = new List() { - new Group{DisplayName = "all", Salary = 1.0m}, - new Group{DisplayName = "admin", Salary = 5.0m}, - new Group{DisplayName = "moderator", Salary = 4.0m}, - new Group{DisplayName = "guest", Salary = 1.0m} + PayGroups = new List + { + new Group {DisplayName = "all", Salary = 1.0m}, + new Group {DisplayName = "admin", Salary = 5.0m}, + new Group {DisplayName = "moderator", Salary = 4.0m}, + new Group {DisplayName = "guest", Salary = 1.0m} }; PayTimeSeconds = 900; PayHit = false; @@ -58,4 +57,4 @@ public void LoadDefaults() SendPayMegaZombieMsg = true; } } -} +} \ No newline at end of file diff --git a/UconomyEssentials.cs b/UconomyEssentials.cs new file mode 100644 index 0000000..d79e34e --- /dev/null +++ b/UconomyEssentials.cs @@ -0,0 +1,166 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using Rocket.API.Collections; +using Rocket.Core.Logging; +using Rocket.Core.Plugins; +using Rocket.Unturned.Player; + +namespace ZaupUconomyEssentials +{ + public class UconomyEssentials : RocketPlugin + { + public static UconomyEssentials Instance; + public Dictionary groups = new Dictionary(); + + protected override void Load() + { + Instance = this; + var nlgroup = Configuration.Instance.PayGroups.Distinct(new GroupComparer()).ToList(); + Configuration.Instance.PayGroups = nlgroup; + foreach (var g in Configuration.Instance.PayGroups) + try + { + groups.Add(g.DisplayName, g.Salary); + } + catch (Exception e) + { + Logger.LogException(e); + } + } + + protected override void Unload() + { + Instance.groups.Clear(); + } + + public delegate void PlayerPaidEvent(UnturnedPlayer player, decimal amount); + + public event PlayerPaidEvent OnPlayerPaid; + + public delegate void PlayerLossEvent(UnturnedPlayer player, decimal amount); + + public event PlayerLossEvent OnPlayerLoss; + + public delegate void PlayerExchangeEvent(UnturnedPlayer player, decimal currency, uint experience, string type); + + public event PlayerExchangeEvent OnPlayerExchange; + + public override TranslationList DefaultTranslations => + new TranslationList + { + { + "pay_time_msg", + "You have received {0} {1} in salary for being a {2}." + }, + { + "unable_to_pay_group_msg", + "Unable to pay {0} as no {1} group salary set." + }, + { + "to_killer_msg", + "You have received {0} {1} for killing {2}." + }, + { + "lose_suicide_msg", + "You have had {0} {1} deducted from your account for committing suicide." + }, + { + "new_balance_msg", + "Your new balance is {0} {1}." + }, + { + "lose_money_on_death_msg", + "You have lost {0} {1} for being killed." + }, + { + "apay_msg", + "You have paid {0} {1} {2}." + }, + { + "apaid_msg", + "{0} gave you {1} {2}. You now have {3} {4}." + }, + { + "experience_exchange_not_available", + "I'm sorry, experience exchange is not available. Ask your admin to enable it." + }, + { + "money_exchange_not_available", + "I'm sorry, money exchange is not available. Ask your admin to enable it." + }, + { + "exchange_zero_amount_error", + "You have to enter an amount of experience/money to exchange." + }, + { + "exchange_insufficient_experience", + "You don't have {0} exprience." + }, + { + "exchange_insufficent_money", + "You don't have {0} {1}." + }, + { + "apay_usage_msg", + "Usage: /apay " + }, + { + "exchange_usage_msg", + "Usage: /exchange [ money] (including money will exchange money to xp otherwise defaults xp to money)" + }, + { + "not_valid_player_msg", + "{0} is not a valid player name or steam id." + }, + { + "not_valid_amount", + "{0} is not a correct amount." + }, + { + "zombie_kill_paid_msg", + "You have been paid {0} {1} for killing a zombie. Your balance is now {2} {3}." + }, + { + "mega_zombie_kill_paid_msg", + "You have been paid {0} {1} for killing a mega zombie. Your balance is now {2} {3}." + } + }; + + public static void HandleEvent(UnturnedPlayer player, decimal amount, string eventtype, uint exp = 0, + string type = "experience") + { + if (eventtype == "exchange" && exp <= 0) + { + Logger.Log("OnPlayerExchange could not be fired as no experience was given."); + return; + } + + if (amount == 0.0m || player == null) + { + Logger.Log(eventtype + " was not fired as player or amount not given."); + return; + } + + switch (eventtype) + { + case "paid": + Instance.OnPlayerPaid?.Invoke(player, amount); + player.Player.gameObject.SendMessage("UEOnPlayerPaid", new object[] {player, amount}); + break; + case "loss": + Instance.OnPlayerLoss?.Invoke(player, amount); + player.Player.gameObject.SendMessage("UEOnPlayerLoss", new object[] {player, amount}); + break; + case "exchange": + Instance.OnPlayerExchange?.Invoke(player, amount, exp, type); + player.Player.gameObject.SendMessage("UEOnPlayerExchange", + new object[] {player, amount, exp, type}); + break; + default: + Logger.Log("Invalid type supplied to throw paid/loss/experience event."); + break; + } + } + } +} \ No newline at end of file diff --git a/ZaupUconomyEssentials.cs b/ZaupUconomyEssentials.cs deleted file mode 100644 index 4be6094..0000000 --- a/ZaupUconomyEssentials.cs +++ /dev/null @@ -1,171 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; - -using Rocket.API; -using Rocket.API.Collections; -using Rocket.Core.Logging; -using Rocket.Core.Plugins; -using Rocket.Unturned; -using Rocket.Unturned.Player; -using Rocket.Unturned.Plugins; -using SDG.Unturned; -using fr34kyn01535.Uconomy; - -namespace Uconomy_Essentials -{ - public class Uconomy_Essentials : RocketPlugin - { - public static Uconomy_Essentials Instance; - public Dictionary PayGroups = new Dictionary(); - - protected override void Load() { - Uconomy_Essentials.Instance = this; - List nlgroup = this.Configuration.Instance.PayGroups.Distinct( new GroupComparer()).ToList(); - this.Configuration.Instance.PayGroups = nlgroup; - foreach (Group g in this.Configuration.Instance.PayGroups) - { - try - { - this.PayGroups.Add(g.DisplayName, g.Salary); - } - catch (Exception e) - { - Logger.LogException(e); - //Logger.Log(g.DisplayName + " " + g.Salary.ToString()); - //Logger.Log("There was an exception: " + e); - } - - } - } - protected override void Unload() - { - Uconomy_Essentials.Instance.PayGroups.Clear(); - } - public delegate void PlayerPaidEvent(UnturnedPlayer player, decimal amount); - public event PlayerPaidEvent OnPlayerPaid; - public delegate void PlayerLossEvent(UnturnedPlayer player, decimal amount); - public event PlayerLossEvent OnPlayerLoss; - public delegate void PlayerExchangeEvent(UnturnedPlayer player, decimal currency, uint experience, string type); - public event PlayerExchangeEvent OnPlayerExchange; - public override TranslationList DefaultTranslations - { - get - { - return new TranslationList - { - { - "pay_time_msg", - "You have received {0} {1} in salary for being a {2}." - }, - { - "unable_to_pay_group_msg", - "Unable to pay {0} as no {1} group salary set." - }, - { - "to_killer_msg", - "You have received {0} {1} for killing {2}." - }, - { - "lose_suicide_msg", - "You have had {0} {1} deducted from your account for committing suicide." - }, - { - "new_balance_msg", - "Your new balance is {0} {1}." - }, - { - "lose_money_on_death_msg", - "You have lost {0} {1} for being killed." - }, - { - "apay_msg", - "You have paid {0} {1} {2}." - }, - { - "apaid_msg", - "{0} gave you {1} {2}. You now have {3} {4}." - }, - { - "experience_exchange_not_available", - "I'm sorry, experience exchange is not available. Ask your admin to enable it." - }, - { - "money_exchange_not_available", - "I'm sorry, money exchange is not available. Ask your admin to enable it." - }, - { - "exchange_zero_amount_error", - "You have to enter an amount of experience/money to exchange." - }, - { - "exchange_insufficient_experience", - "You don't have {0} exprience." - }, - { - "exchange_insufficent_money", - "You don't have {0} {1}." - }, - { - "apay_usage_msg", - "Usage: /apay " - }, - { - "exchange_usage_msg", - "Usage: /exchange [ money] (including money will exchange money to xp otherwise defaults xp to money)" - }, - { - "not_valid_player_msg", - "{0} is not a valid player name or steam id." - }, - { - "not_valid_amount", - "{0} is not a correct amount." - }, - { - "zombie_kill_paid_msg", - "You have been paid {0} {1} for killing a zombie. Your balance is now {2} {3}." - }, - { - "mega_zombie_kill_paid_msg", - "You have been paid {0} {1} for killing a mega zombie. Your balance is now {2} {3}." - } - }; - } - } - - public static void HandleEvent(UnturnedPlayer player, decimal amount, string eventtype, uint exp = 0, string type = "experience") - { - if (eventtype == "exchange" && exp <= 0) - { - Logger.Log("OnPlayerExchange could not be fired as no experience was given."); - return; - } - if (amount == 0.0m || player == null) { - Logger.Log(eventtype + " was not fired as player or amount not given."); - return; - } - switch (eventtype) - { - case "paid": - if (Uconomy_Essentials.Instance.OnPlayerPaid != null) - Uconomy_Essentials.Instance.OnPlayerPaid(player, amount); - player.Player.gameObject.SendMessage("UEOnPlayerPaid", new object[] { player, amount }); - break; - case "loss": - if (Uconomy_Essentials.Instance.OnPlayerLoss != null) - Uconomy_Essentials.Instance.OnPlayerLoss(player, amount); - player.Player.gameObject.SendMessage("UEOnPlayerLoss", new object[] { player, amount }); - break; - case "exchange": - if (Uconomy_Essentials.Instance.OnPlayerExchange != null) - Uconomy_Essentials.Instance.OnPlayerExchange(player, amount, exp, type); - player.Player.gameObject.SendMessage("UEOnPlayerExchange", new object[] { player, amount, exp, type }); - break; - default: - Logger.Log("Invalid type supplied to throw paid/loss/experience event."); - break; - } - } - } -} diff --git a/ZaupUconomyEssentials.csproj b/ZaupUconomyEssentials.csproj index bb56cc2..587a5c7 100644 --- a/ZaupUconomyEssentials.csproj +++ b/ZaupUconomyEssentials.csproj @@ -9,8 +9,9 @@ Properties ZaupUconomyEssentials ZaupUconomyEssentials - v4.5 + v4.6.1 512 + true @@ -30,16 +31,22 @@ 4 - - False + lib\Assembly-CSharp.dll False - - False + lib\Assembly-CSharp-firstpass.dll False + + Libraries\BouncyCastle.Crypto.dll + False + + + Libraries\Google.Protobuf.dll + False + Libraries\I18N.dll False @@ -48,54 +55,75 @@ Libraries\I18N.West.dll False - - False + Libraries\MySql.Data.dll - False + False - - False + + Libraries\Renci.SshNet.dll + False + + lib\Rocket.API.dll False - - False + lib\Rocket.Core.dll False - - False + lib\Rocket.Unturned.dll False + + Libraries\System.Management.dll + False + + + Libraries\System.Transactions.dll + False + - - + + Libraries\System.Data.dll + False + - - False + lib\Uconomy.dll False - + False lib\UnityEngine.dll False + + False + lib\UnityEngine.CoreModule.dll + False + + - + - + + + Always + + + Always + Always @@ -105,6 +133,9 @@ Always + + Always + Always @@ -114,6 +145,14 @@ Always + + + + + + + +