From 409e2c6141552b0d427960350f04a52218f38018 Mon Sep 17 00:00:00 2001 From: Jonathan Williams Date: Thu, 28 Aug 2014 14:01:37 -0700 Subject: [PATCH] Tweaked menus for quick game, Cosmetic menu. Removed debug for Hub Output a little debug info in LobbyBalancer Added duplicate check to ServerMonitor updated Customer SUpport server to have changeable password, added logging of command executors, added lifetime perks for hero/ultra --- .../bungee/lobbyBalancer/LobbyBalancer.java | 3 + .../mineplex/core/cosmetic/ui/page/Menu.java | 4 +- .../Mineplex.Hub/src/mineplex/hub/Hub.java | 2 - .../hub/server/ui/ServerGameMenu.java | 7 +- .../mineplex/hub/server/ui/ServerNpcPage.java | 2 +- .../src/mineplex/serverdata/ServerGroup.java | 20 +- .../mineplex/servermonitor/ServerMonitor.java | 28 +- .../customerSupport/CustomerSupport.java | 20 +- .../password/ChangePasswordCommand.java | 23 + .../staffServer/password/Password.java | 14 +- .../staffServer/password/PasswordCommand.java | 1 + .../salespackage/command/CoinCommand.java | 2 +- .../command/LifetimeHeroCommand.java | 33 ++ .../command/LifetimeUltraCommand.java | 33 ++ .../salespackage/command/Sales.java | 2 + .../salespackages/LifetimeHero.java | 5 +- .../salespackages/LifetimeUltra.java | 5 +- .../Models/AccountAdministrator.cs | 90 ++++ .../LOC.Website.Web.Publish.xml | 448 +++++++++--------- 19 files changed, 477 insertions(+), 265 deletions(-) create mode 100644 Plugins/Mineplex.StaffServer/src/mineplex/staffServer/password/ChangePasswordCommand.java create mode 100644 Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/command/LifetimeHeroCommand.java create mode 100644 Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/command/LifetimeUltraCommand.java diff --git a/Plugins/Mineplex.Bungee.Mineplexer/src/mineplex/bungee/lobbyBalancer/LobbyBalancer.java b/Plugins/Mineplex.Bungee.Mineplexer/src/mineplex/bungee/lobbyBalancer/LobbyBalancer.java index 976e2052f..b0468daf8 100644 --- a/Plugins/Mineplex.Bungee.Mineplexer/src/mineplex/bungee/lobbyBalancer/LobbyBalancer.java +++ b/Plugins/Mineplex.Bungee.Mineplexer/src/mineplex/bungee/lobbyBalancer/LobbyBalancer.java @@ -80,7 +80,10 @@ public class LobbyBalancer implements Listener, Runnable } if (_bestServerIndex < _sortedLobbies.size()) + { event.setTarget(_plugin.getProxy().getServerInfo(_sortedLobbies.get(_bestServerIndex).getName())); + System.out.println("Sending " + event.getPlayer().getName() + " to " + _sortedLobbies.get(_bestServerIndex).getName() + "(" + _sortedLobbies.get(_bestServerIndex).getPublicAddress() + ")"); + } _playersSentToBestServer++; } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/Menu.java b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/Menu.java index 301278497..0771f34f4 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/Menu.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/Menu.java @@ -1,12 +1,14 @@ package mineplex.core.cosmetic.ui.page; import org.bukkit.Bukkit; +import org.bukkit.ChatColor; import org.bukkit.Material; import org.bukkit.entity.Player; import mineplex.core.account.CoreClientManager; import mineplex.core.common.CurrencyType; import mineplex.core.common.util.C; +import mineplex.core.common.util.F; import mineplex.core.cosmetic.CosmeticManager; import mineplex.core.cosmetic.event.ActivateGemBoosterEvent; import mineplex.core.cosmetic.ui.CosmeticShop; @@ -49,7 +51,7 @@ public class Menu extends ShopPageBase else { */ - AddItem(13, new ShopItem(Material.CHEST, C.cGold + treasureChestCount + " Treasure Chests (COMING SOON!)", 1, false)); + AddItem(13, new ShopItem(Material.CHEST, C.cGold + treasureChestCount + " Treasure Chests (COMING SOON!)" + ChatColor.RESET, 1, false)); //} final GemBooster gemBoosterItem = new GemBooster(Shop.getBoosterEnabled(), Plugin.getInventoryManager().Get(Player).getItemCount("Gem Booster")); diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/Hub.java b/Plugins/Mineplex.Hub/src/mineplex/hub/Hub.java index 7251dc428..34dc35492 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/Hub.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/Hub.java @@ -132,8 +132,6 @@ public class Hub extends JavaPlugin implements IRelation //Updates getServer().getScheduler().scheduleSyncRepeatingTask(this, new Updater(this), 1, 1); - - MinecraftServer.getServer().getPropertyManager().setProperty("debug", true); } @Override diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerGameMenu.java b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerGameMenu.java index 4e4680c77..25068829a 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerGameMenu.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerGameMenu.java @@ -54,7 +54,7 @@ public class ServerGameMenu extends ShopPageBase ChatColor.RESET + "death with the other teams.", })); - this.setItem(3, ItemStackFactory.Instance.CreateStack(Material.IRON_SWORD.getId(), (byte)0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Survival Games " + C.cGray + "Last Man Standing", new String[] + this.setItem(3, ItemStackFactory.Instance.CreateStack(Material.DIAMOND_SWORD.getId(), (byte)0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Survival Games " + C.cGray + "Last Man Standing", new String[] { ChatColor.RESET + "", ChatColor.RESET + "Search for chests to find loot and ", @@ -150,10 +150,9 @@ public class ServerGameMenu extends ShopPageBase ChatColor.RESET + "Dragon Escape", ChatColor.RESET + "Milk the Cow", ChatColor.RESET + "Super Paintball", - ChatColor.RESET + "Turf Forts", + ChatColor.RESET + "Turf Wars", ChatColor.RESET + "Death Tag", - ChatColor.RESET + "Bacon Brawl", - ChatColor.RESET + "Squid Sauce" + ChatColor.RESET + "Bacon Brawl" })); _minigameCycle.add(ItemStackFactory.Instance.CreateStack(122, (byte)0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Arcade " + C.cGray + "Mixed Games", new String [] diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerNpcPage.java b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerNpcPage.java index 832e84af7..d9f6a9fa7 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerNpcPage.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerNpcPage.java @@ -305,7 +305,7 @@ public class ServerNpcPage extends ShopPageBase im { int slots = Plugin.GetRequiredSlots(player, serverInfo.ServerType); - if ((serverInfo.Name.contains("BETA") && !Client.GetRank().Has(Rank.ULTRA)) || (serverInfo.MaxPlayers - serverInfo.CurrentPlayers < slots && !(DonationManager.Get(Player.getName()).OwnsUnknownPackage(serverInfo.ServerType + " ULTRA") || Client.GetRank().Has(Rank.ULTRA)))) + if (serverInfo.MaxPlayers - serverInfo.CurrentPlayers < slots && !(DonationManager.Get(Player.getName()).OwnsUnknownPackage(serverInfo.ServerType + " ULTRA") || Client.GetRank().Has(Rank.ULTRA))) { PlayDenySound(player); return; diff --git a/Plugins/Mineplex.ServerData/src/mineplex/serverdata/ServerGroup.java b/Plugins/Mineplex.ServerData/src/mineplex/serverdata/ServerGroup.java index 00976ecda..a07e52ba4 100644 --- a/Plugins/Mineplex.ServerData/src/mineplex/serverdata/ServerGroup.java +++ b/Plugins/Mineplex.ServerData/src/mineplex/serverdata/ServerGroup.java @@ -84,7 +84,8 @@ public class ServerGroup public boolean getAddNoCheat() { return _addNoCheat; } // The set of active MinecraftServers that belong to this server group - private Set servers; + private Set _servers; + public Set getServers() { return _servers; } /** * Class constructor @@ -124,7 +125,7 @@ public class ServerGroup */ public int getServerCount() { - return servers.size(); + return _servers.size(); } /** @@ -135,7 +136,7 @@ public class ServerGroup { int joinable = 0; - for (MinecraftServer server : servers) + for (MinecraftServer server : _servers) { if (server.isJoinable()) { @@ -154,7 +155,7 @@ public class ServerGroup { int playerCount = 0; - for (MinecraftServer server : servers) + for (MinecraftServer server : _servers) { playerCount += server.getPlayerCount(); } @@ -170,7 +171,7 @@ public class ServerGroup { int maxPlayerCount = 0; - for (MinecraftServer server : servers) + for (MinecraftServer server : _servers) { maxPlayerCount += server.getMaxPlayerCount(); } @@ -186,7 +187,7 @@ public class ServerGroup { Collection emptyServers = new HashSet(); - for (MinecraftServer server : servers) + for (MinecraftServer server : _servers) { if (server.isEmpty()) { @@ -203,14 +204,14 @@ public class ServerGroup */ private void fetchServers(Region region) { - this.servers = new HashSet(); + this._servers = new HashSet(); ServerRepository repository = ServerManager.getServerRepository(region); for (MinecraftServer server : repository.getServerStatuses()) { if (_name.equalsIgnoreCase(server.getGroup())) { - servers.add(server); + _servers.add(server); } } } @@ -226,7 +227,7 @@ public class ServerGroup { boolean uniqueId = true; - for (MinecraftServer server : servers) + for (MinecraftServer server : _servers) { String serverName = server.getName(); try @@ -255,5 +256,4 @@ public class ServerGroup } } } - } diff --git a/Plugins/Mineplex.ServerMonitor/src/mineplex/servermonitor/ServerMonitor.java b/Plugins/Mineplex.ServerMonitor/src/mineplex/servermonitor/ServerMonitor.java index 308538ef0..29bd07db9 100644 --- a/Plugins/Mineplex.ServerMonitor/src/mineplex/servermonitor/ServerMonitor.java +++ b/Plugins/Mineplex.ServerMonitor/src/mineplex/servermonitor/ServerMonitor.java @@ -18,6 +18,7 @@ import java.util.Map.Entry; import java.util.logging.FileHandler; import java.util.logging.Logger; +import mineplex.core.common.util.NautHashMap; import mineplex.serverdata.DedicatedServer; import mineplex.serverdata.DedicatedServerSorter; import mineplex.serverdata.MinecraftServer; @@ -105,21 +106,26 @@ public class ServerMonitor iterator.remove(); } - // TODO: Check with Jonathan to see if we still need this duplication server code - /*for (GroupStatusData groupStatus : groupStatusList.values()) + for (ServerGroup groupStatus : serverGroups) { - for (ServerStatusData serverToKill : groupStatus.KillServers) - { - System.out.println("----DUPLICATE SERVER----> " + serverToKill.Address + ", " + serverToKill.Name); - killServer(serverToKill); - } + NautHashMap _serverMap = new NautHashMap(); - for (ServerStatusData serverToKill : groupStatus.Servers.values()) + for (Iterator serverIterator = groupStatus.getServers().iterator(); serverIterator.hasNext();) { - if (serverTracker.containsKey(serverToKill.Name)) - serverTracker.remove(serverToKill.Name); + MinecraftServer server = serverIterator.next(); + int serverNum = Integer.parseInt(server.getName().split("-")[1]); + + if (_serverMap.containsKey(serverNum)) + { + killServer(server.getName(), server.getPublicAddress(), "[KILLED] [DUPLICATE] " + server.getName() + ":" + server.getPublicAddress(), true); + serverIterator.remove(); + } + else + { + _serverMap.put(serverNum, server); + } } - }*/ + } HashSet onlineServers = new HashSet(); diff --git a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/customerSupport/CustomerSupport.java b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/customerSupport/CustomerSupport.java index b04ef8736..c4cea7af3 100644 --- a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/customerSupport/CustomerSupport.java +++ b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/customerSupport/CustomerSupport.java @@ -3,10 +3,11 @@ package mineplex.staffServer.customerSupport; import java.text.SimpleDateFormat; import java.util.HashSet; +import org.bukkit.GameMode; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; +import org.bukkit.event.block.BlockBreakEvent; import org.bukkit.event.entity.EntityDamageEvent; -import org.bukkit.event.entity.EntityDeathEvent; import org.bukkit.event.entity.FoodLevelChangeEvent; import org.bukkit.event.entity.EntityDamageEvent.DamageCause; import org.bukkit.event.player.AsyncPlayerChatEvent; @@ -17,13 +18,9 @@ import org.bukkit.plugin.java.JavaPlugin; import mineplex.core.MiniPlugin; import mineplex.core.account.CoreClient; import mineplex.core.account.CoreClientManager; -import mineplex.core.common.Rank; import mineplex.core.common.util.C; import mineplex.core.common.util.F; import mineplex.core.common.util.NautHashMap; -import mineplex.core.common.util.UtilMath; -import mineplex.core.common.util.UtilPlayer; -import mineplex.core.common.util.UtilServer; import mineplex.core.donation.DonationManager; import mineplex.core.donation.Donor; import mineplex.core.donation.repository.token.CoinTransactionToken; @@ -99,8 +96,10 @@ public class CustomerSupport extends MiniPlugin for (CoinTransactionToken transaction : donor.getCoinTransactions()) { - if (transaction.Source.equalsIgnoreCase("purchase")) - caller.sendMessage(C.cYellow + _date.format(transaction.Date) + C.cGray + " - " + C.cYellow + transaction.Amount + " Coins"); + if (transaction.Source.equalsIgnoreCase("Poll") || transaction.Source.equalsIgnoreCase("Coin Party Bomb Pickup") || transaction.Source.contains("Reward")) + continue; + + caller.sendMessage(C.cYellow + _date.format(transaction.Date) + C.cGray + " - " + C.cYellow + transaction.Amount + " Coins - Applied via " + transaction.Source); } for (TransactionToken transaction : donor.getTransactions()) @@ -112,6 +111,13 @@ public class CustomerSupport extends MiniPlugin _salesPackageManager.displaySalesPackages(caller, playerName); caller.sendMessage(C.cDGreen + C.Strike + "============================================="); } + + @EventHandler + public void blockBreak(BlockBreakEvent event) + { + if (event.getPlayer().getGameMode() != GameMode.CREATIVE) + event.setCancelled(true); + } @EventHandler public void removeMapping(PlayerQuitEvent event) diff --git a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/password/ChangePasswordCommand.java b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/password/ChangePasswordCommand.java new file mode 100644 index 000000000..055b1ff0f --- /dev/null +++ b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/password/ChangePasswordCommand.java @@ -0,0 +1,23 @@ +package mineplex.staffServer.password; + +import org.bukkit.entity.Player; + +import mineplex.core.command.CommandBase; +import mineplex.core.common.Rank; + +public class ChangePasswordCommand extends CommandBase +{ + public ChangePasswordCommand(Password plugin) + { + super(plugin, Rank.ADMIN, "changepassword"); + } + + @Override + public void Execute(Player caller, String[] args) + { + if (args != null && args.length == 1) + { + Plugin.changePassword(caller, args[0]); + } + } +} diff --git a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/password/Password.java b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/password/Password.java index 7cd6a7c09..8836fdb8f 100644 --- a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/password/Password.java +++ b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/password/Password.java @@ -9,10 +9,13 @@ import org.bukkit.plugin.java.JavaPlugin; import mineplex.core.MiniPlugin; import mineplex.core.common.util.F; +import mineplex.core.recharge.Recharge; public class Password extends MiniPlugin { private HashSet _accepted = new HashSet(); + + private String _password = "ClothStarRust"; public Password(JavaPlugin plugin) { @@ -23,6 +26,7 @@ public class Password extends MiniPlugin public void AddCommands() { AddCommand(new PasswordCommand(this)); + AddCommand(new ChangePasswordCommand(this)); } @EventHandler @@ -35,17 +39,23 @@ public class Password extends MiniPlugin public void run() { if (!_accepted.contains(event.getPlayer())) - event.getPlayer().kickPlayer("You don't know the password little twerp."); + event.getPlayer().kickPlayer("You don't know the password!"); } }, 200L); } public void checkPassword(Player caller, String attempt) { - if (attempt.equals("ClothStarRust")) + if (attempt.equals(_password)) { _accepted.add(caller); caller.sendMessage(F.main(GetName(), "I guess you get to stay.")); } } + + public void changePassword(Player caller, String password) + { + _password = password; + caller.sendMessage(F.main(GetName(), "Password changed to " + _password)); + } } diff --git a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/password/PasswordCommand.java b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/password/PasswordCommand.java index eedca6380..908e15d48 100644 --- a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/password/PasswordCommand.java +++ b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/password/PasswordCommand.java @@ -17,6 +17,7 @@ public class PasswordCommand extends CommandBase { if (args != null && args.length == 1) { + resetCommandCharge(caller); Plugin.checkPassword(caller, args[0]); } } diff --git a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/command/CoinCommand.java b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/command/CoinCommand.java index b447b164b..977bfa9eb 100644 --- a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/command/CoinCommand.java +++ b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/command/CoinCommand.java @@ -23,7 +23,7 @@ public class CoinCommand extends CommandBase String playerName = args[0]; int amount = Integer.parseInt(args[1]); - Plugin.getDonationManager().RewardCoins(null, "purchase", playerName, amount); + Plugin.getDonationManager().RewardCoins(null, caller.getName(), playerName, amount); caller.sendMessage(F.main(Plugin.GetName(), "Added " + amount + " coins to " + playerName + "'s account!")); } } diff --git a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/command/LifetimeHeroCommand.java b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/command/LifetimeHeroCommand.java new file mode 100644 index 000000000..9bf6a28ab --- /dev/null +++ b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/command/LifetimeHeroCommand.java @@ -0,0 +1,33 @@ +package mineplex.staffServer.salespackage.command; + +import org.bukkit.Bukkit; +import org.bukkit.entity.Player; +import org.bukkit.event.player.PlayerCommandPreprocessEvent; + +import mineplex.core.command.CommandBase; +import mineplex.core.common.Rank; +import mineplex.staffServer.salespackage.SalesPackageManager; + +public class LifetimeHeroCommand extends CommandBase +{ + public LifetimeHeroCommand(SalesPackageManager plugin) + { + super(plugin, Rank.MODERATOR, "lifetimehero"); + } + + @Override + public void Execute(Player caller, String[] args) + { + resetCommandCharge(caller); + PlayerCommandPreprocessEvent event = new PlayerCommandPreprocessEvent(caller, "/sales rank " + args[0] + " HERO true"); + Bukkit.getServer().getPluginManager().callEvent(event); + + resetCommandCharge(caller); + event = new PlayerCommandPreprocessEvent(caller, "/sales coin " + args[0] + " 40000"); + Bukkit.getServer().getPluginManager().callEvent(event); + + resetCommandCharge(caller); + event = new PlayerCommandPreprocessEvent(caller, "/sales booster " + args[0] + " 120"); + Bukkit.getServer().getPluginManager().callEvent(event); + } +} diff --git a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/command/LifetimeUltraCommand.java b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/command/LifetimeUltraCommand.java new file mode 100644 index 000000000..970221cfe --- /dev/null +++ b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/command/LifetimeUltraCommand.java @@ -0,0 +1,33 @@ +package mineplex.staffServer.salespackage.command; + +import org.bukkit.Bukkit; +import org.bukkit.entity.Player; +import org.bukkit.event.player.PlayerCommandPreprocessEvent; + +import mineplex.core.command.CommandBase; +import mineplex.core.common.Rank; +import mineplex.staffServer.salespackage.SalesPackageManager; + +public class LifetimeUltraCommand extends CommandBase +{ + public LifetimeUltraCommand(SalesPackageManager plugin) + { + super(plugin, Rank.MODERATOR, "lifetimeultra"); + } + + @Override + public void Execute(Player caller, String[] args) + { + resetCommandCharge(caller); + PlayerCommandPreprocessEvent event = new PlayerCommandPreprocessEvent(caller, "/sales rank " + args[0] + " ULTRA true"); + Bukkit.getServer().getPluginManager().callEvent(event); + + resetCommandCharge(caller); + event = new PlayerCommandPreprocessEvent(caller, "/sales coin " + args[0] + " 20000"); + Bukkit.getServer().getPluginManager().callEvent(event); + + resetCommandCharge(caller); + event = new PlayerCommandPreprocessEvent(caller, "/sales booster " + args[0] + " 60"); + Bukkit.getServer().getPluginManager().callEvent(event); + } +} diff --git a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/command/Sales.java b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/command/Sales.java index 7103aecbb..b5edb5362 100644 --- a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/command/Sales.java +++ b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/command/Sales.java @@ -17,6 +17,8 @@ public class Sales extends MultiCommandBase AddCommand(new BoosterCommand(plugin)); AddCommand(new UltraCommand(plugin)); AddCommand(new HeroCommand(plugin)); + AddCommand(new LifetimeUltraCommand(plugin)); + AddCommand(new LifetimeHeroCommand(plugin)); } @Override diff --git a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/salespackages/LifetimeHero.java b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/salespackages/LifetimeHero.java index 610eb524b..11be30d2d 100644 --- a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/salespackages/LifetimeHero.java +++ b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/salespackages/LifetimeHero.java @@ -13,7 +13,10 @@ public class LifetimeHero extends SalesPackageBase public void displayToAgent(Player agent, String playerName) { - addButton(agent, "/sales rank " + playerName + " HERO true", " Lifetime Hero Rank."); + addButton(agent, "/sales coin " + playerName + " 40000", " 40,000 Coins"); + addButton(agent, "/sales booster " + playerName + " 120", " 120 Gem Boosters"); + addButton(agent, "/sales rank " + playerName + " HERO true", " Lifetime Hero (Also, unlocks kits)."); + addButton(agent, "Apply All", "/sales lifetimehero " + playerName, " Apply all above."); agent.sendMessage(" "); addBackButton(agent, playerName); } diff --git a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/salespackages/LifetimeUltra.java b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/salespackages/LifetimeUltra.java index b00b44ca9..991c1551e 100644 --- a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/salespackages/LifetimeUltra.java +++ b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/salespackages/LifetimeUltra.java @@ -13,7 +13,10 @@ public class LifetimeUltra extends SalesPackageBase public void displayToAgent(Player agent, String playerName) { - addButton(agent, "/sales rank " + playerName + " ULTRA true", " Lifetime Ultra Rank."); + addButton(agent, "/sales coin " + playerName + " 20000", " 20,000 Coins"); + addButton(agent, "/sales booster " + playerName + " 60", " 60 Gem Boosters"); + addButton(agent, "/sales rank " + playerName + " ULTRA true", " Lifetime Ultra (Also, unlocks kits)."); + addButton(agent, "Apply All", "/sales lifetimeultra " + playerName, " Apply all above."); agent.sendMessage(" "); addBackButton(agent, playerName); } diff --git a/Website/LOC.Website.Common/Models/AccountAdministrator.cs b/Website/LOC.Website.Common/Models/AccountAdministrator.cs index 34bf7c40f..851a817f0 100644 --- a/Website/LOC.Website.Common/Models/AccountAdministrator.cs +++ b/Website/LOC.Website.Common/Models/AccountAdministrator.cs @@ -556,6 +556,77 @@ account.RankExpire = DateTime.Now.AddMonths(1); account.RankPerm = token.Perm; + if ((rank.Name == "HERO" || rank.Name == "ULTRA") && token.Perm == true) + { + repository.Attach(account); + repository.Edit(account); + + addAccountTransaction(repository, account, "Bacon Brawl Bebe Piggles", 0, 0); + addAccountTransaction(repository, account, "Bacon Brawl `Pig`", 0, 0); + addAccountTransaction(repository, account, "A Barbarians Life Barbarian Archer", 0, 0); + addAccountTransaction(repository, account, "A Barbarians Life Bomber", 0, 0); + addAccountTransaction(repository, account, "The Bridges Archer", 0, 0); + addAccountTransaction(repository, account, "The Bridges Bomber", 0, 0); + addAccountTransaction(repository, account, "The Bridges Brawler", 0, 0); + addAccountTransaction(repository, account, "The Bridges Miner", 0, 0); + addAccountTransaction(repository, account, "Castle Siege Castle Assassin", 0, 0); + addAccountTransaction(repository, account, "Castle Siege Castle Brawler", 0, 0); + addAccountTransaction(repository, account, "Castle Siege Castle Knight", 0, 0); + addAccountTransaction(repository, account, "Castle Siege Undead Archer", 0, 0); + addAccountTransaction(repository, account, "Castle Siege Undead Zombie", 0, 0); + addAccountTransaction(repository, account, "Death Tag Runner Archer", 0, 0); + addAccountTransaction(repository, account, "Death Tag Runner Traitor", 0, 0); + addAccountTransaction(repository, account, "Dragon Escape Disruptor", 0, 0); + addAccountTransaction(repository, account, "Dragon Escape Warper", 0, 0); + addAccountTransaction(repository, account, "Dragons Marksman", 0, 0); + addAccountTransaction(repository, account, "Dragons Pyrotechnic", 0, 0); + addAccountTransaction(repository, account, "Block Hunt Instant Hider", 0, 0); + addAccountTransaction(repository, account, "Block Hunt Shocking Hider", 0, 0); + addAccountTransaction(repository, account, "Block Hunt Radar Hunter", 0, 0); + addAccountTransaction(repository, account, "Block Hunt TNT Hunter", 0, 0); + addAccountTransaction(repository, account, "Super Paintball Machine Gun", 0, 0); + addAccountTransaction(repository, account, "Super Paintball Shotgun", 0, 0); + addAccountTransaction(repository, account, "One in the Quiver Brawler", 0, 0); + addAccountTransaction(repository, account, "One in the Quiver Enchanter", 0, 0); + addAccountTransaction(repository, account, "Runner Archer", 0, 0); + addAccountTransaction(repository, account, "Runner Frosty", 0, 0); + addAccountTransaction(repository, account, "Sheep Quest Archer", 0, 0); + addAccountTransaction(repository, account, "Sheep Quest Brute", 0, 0); + addAccountTransaction(repository, account, "Super Smash Mobs Blaze", 0, 0); + addAccountTransaction(repository, account, "Super Smash Mobs Chicken", 0, 0); + addAccountTransaction(repository, account, "Super Smash Mobs Mad Cow", 0, 0); + addAccountTransaction(repository, account, "Super Smash Mobs Creeper", 0, 0); + addAccountTransaction(repository, account, "Super Smash Mobs Enderman", 0, 0); + addAccountTransaction(repository, account, "Super Smash Mobs Undead Knight", 0, 0); + addAccountTransaction(repository, account, "Super Smash Mobs Magma Cube", 0, 0); + addAccountTransaction(repository, account, "Super Smash Mobs Pig", 0, 0); + addAccountTransaction(repository, account, "Super Smash Mobs Skeletal Horse", 0, 0); + addAccountTransaction(repository, account, "Super Smash Mobs Sky Squid", 0, 0); + addAccountTransaction(repository, account, "Super Smash Mobs Snowman", 0, 0); + addAccountTransaction(repository, account, "Super Smash Mobs Witch", 0, 0); + addAccountTransaction(repository, account, "Super Smash Mobs Wither", 0, 0); + addAccountTransaction(repository, account, "Super Smash Mobs Wither Skeleton", 0, 0); + addAccountTransaction(repository, account, "Super Smash Mobs Wolf", 0, 0); + addAccountTransaction(repository, account, "Snake Super Snake", 0, 0); + addAccountTransaction(repository, account, "Snake Other Snake", 0, 0); + addAccountTransaction(repository, account, "Sneaky Assassins Ranged Assassin", 0, 0); + addAccountTransaction(repository, account, "Sneaky Assassins Revealer", 0, 0); + addAccountTransaction(repository, account, "Super Spleef Archer", 0, 0); + addAccountTransaction(repository, account, "Super Spleef Brawler", 0, 0); + addAccountTransaction(repository, account, "Squid Shooter Squid Blaster", 0, 0); + addAccountTransaction(repository, account, "Squid Shooter Squid Sniper", 0, 0); + addAccountTransaction(repository, account, "Survival Games Archer", 0, 0); + addAccountTransaction(repository, account, "Survival Games Assassin", 0, 0); + addAccountTransaction(repository, account, "Survival Games Beastmaster", 0, 0); + addAccountTransaction(repository, account, "Survival Games Bomber", 0, 0); + addAccountTransaction(repository, account, "Survival Games Brawler", 0, 0); + addAccountTransaction(repository, account, "Survival Games Necromancer", 0, 0); + addAccountTransaction(repository, account, "Turf Wars Infiltrator", 0, 0); + addAccountTransaction(repository, account, "Turf Wars Shredder", 0, 0); + addAccountTransaction(repository, account, "Zombie Survival Survivor Archer", 0, 0); + addAccountTransaction(repository, account, "Zombie Survival Survivor Rogue", 0, 0); + } + repository.CommitChanges(); return rank.Name.ToString(); @@ -710,5 +781,24 @@ return clientToken; } } + + private void addAccountTransaction(IRepository repository, Account account, string salesPackageName, int gems, int coins) + { + var accountTransaction = new AccountTransaction + { + Account = account, + SalesPackageName = salesPackageName, + Date = (long)TimeUtil.GetCurrentMilliseconds(), + Gems = gems, + Coins = coins + }; + + if (account.AccountTransactions == null) + account.AccountTransactions = new List { accountTransaction }; + else + { + account.AccountTransactions.Add(accountTransaction); + } + } } } \ No newline at end of file diff --git a/Website/LOC.Website.Web/LOC.Website.Web.Publish.xml b/Website/LOC.Website.Web/LOC.Website.Web.Publish.xml index bd2a0d731..8209eb247 100644 --- a/Website/LOC.Website.Web/LOC.Website.Web.Publish.xml +++ b/Website/LOC.Website.Web/LOC.Website.Web.Publish.xml @@ -1,12 +1,12 @@  + - @@ -17,16 +17,20 @@ - + + + - + + + @@ -40,25 +44,27 @@ + + + + - - - - + + @@ -69,33 +75,31 @@ - + + - - + - - - - + + - + @@ -103,42 +107,41 @@ + - + - - - + + - - + + - + + - - + - - + @@ -149,52 +152,47 @@ - + - - - - + - - - + + - - + - + - - + + @@ -202,73 +200,77 @@ - + - - + + - + - + - - - + + - + - + - + + - + - + + + - - + + - + - - + + - - + + - + + + @@ -281,15 +283,14 @@ - - + + - @@ -303,26 +304,26 @@ - - + - + + - + @@ -333,21 +334,21 @@ - - + - + + @@ -355,6 +356,8 @@ + + @@ -362,44 +365,41 @@ - + - + - - + - + - - - - - + + - + + @@ -414,27 +414,30 @@ - + + + + + + - - - + + - @@ -442,96 +445,95 @@ - + - - + - + - + - + - + - + - - + + - - + - - + - - + + - - + + - + - - - - - + + + + + - + + + @@ -542,24 +544,24 @@ - + - - + - + - + + @@ -569,24 +571,23 @@ - + - - + - + @@ -597,21 +598,20 @@ - - + + - - + @@ -619,19 +619,21 @@ + - - + + - - + + + @@ -645,28 +647,29 @@ + - + - + + - - + + - @@ -675,59 +678,58 @@ - + + + + + + - - - - - + + + - - - + - + - - + - - - + + - + - + @@ -735,66 +737,66 @@ - + - + - - - - + + + - + - + - - + - - + + - - + + - + - - - - - + + + + + - + + + @@ -805,24 +807,24 @@ - + - - + - + - + + @@ -832,14 +834,13 @@ - + - @@ -849,7 +850,7 @@ - + @@ -860,21 +861,20 @@ - - + + - - + @@ -882,6 +882,7 @@ + @@ -890,11 +891,12 @@ - - + + + @@ -908,28 +910,29 @@ + - + - + + - - + + - @@ -938,59 +941,58 @@ - + + + + + + - - - + - - - + - + - - + - - - + + - + - + @@ -998,58 +1000,56 @@ - + - + - - + + - - + - - + - - + + - - + + - + - - - - - + + + + + - + \ No newline at end of file