Update CUST-1 menu for support staff request

This commit is contained in:
AlexTheCoder 2017-07-01 15:37:56 -04:00 committed by cnr
parent d61e067b86
commit 79644e706c
3 changed files with 98 additions and 38 deletions

View File

@ -72,6 +72,7 @@ public class CustomerSupport extends MiniPlugin implements ResultSetCallable
_allowWeatherChange = false;
addCommand(new checkCommand(this));
addCommand(new checkBonusCommand(this));
addCommand(new checkOwnsPackageCommand(this));
addCommand(new ListPPCCommand(this, _powerPlayRepo));
}
@ -108,7 +109,7 @@ public class CustomerSupport extends MiniPlugin implements ResultSetCallable
caller.sendMessage(F.main(getName(), "Usage : /check defek7"));
}
public void showPlayerInfo(Player caller, CoreClient client)
public void showPlayerInfo(Player caller, CoreClient client, boolean bonuses)
{
String playerName = client.getName();
Donor donor = _donationManager.Get(client.getUniqueId());
@ -130,8 +131,11 @@ public class CustomerSupport extends MiniPlugin implements ResultSetCallable
StringBuilder basic = new StringBuilder(C.cBlue + "Name: " + C.cYellow + playerName);
basic.append(" ");
basic.append(C.cBlue + "Rank: " + C.cYellow + (client.GetRank() == null ? C.cRed + "Error rank null!" : (client.GetRank().Name.isEmpty() ? "Regular" : client.GetRank().Name)));
basic.append(" ");
basic.append(C.cBlue + "Gems: " + C.cYellow + donor.getBalance(GlobalCurrency.GEM));
if (!bonuses)
{
basic.append(" ");
basic.append(C.cBlue + "Gems: " + C.cYellow + donor.getBalance(GlobalCurrency.GEM));
}
caller.sendMessage(basic.toString());
int enjinCoinsReceived = 0;
@ -410,45 +414,54 @@ public class CustomerSupport extends MiniPlugin implements ResultSetCallable
}
}
StringBuilder shards = new StringBuilder(C.cBlue + "Enjin Shard Total Received: " + C.cYellow + enjinCoinsReceived);
shards.append(" ");
shards.append(C.cBlue + "Shards: " + C.cYellow + donor.getBalance(GlobalCurrency.TREASURE_SHARD));
caller.sendMessage(shards.toString());
// Strutt20 asked me to remove some stuff from the menu
caller.sendMessage(C.cBlue + "Old Chests Received: " + C.cYellow + oldChestsReceived + " " + C.cBlue + "Ancient Chests Received: " + C.cYellow + ancientChestsReceived);
caller.sendMessage(C.cBlue + "Mythical Chests Received: " + C.cYellow + mythicalChestsReceived + " " + C.cBlue + "Illuminated Chests Received: " + C.cYellow + illuminatedChestsReceived);
caller.sendMessage(C.cBlue + "Omega Chests Received: " + C.cYellow + omegaChestsReceived);
caller.sendMessage(C.cBlue + "Haunted Chests Received: " + C.cYellow + hauntedChestsReceived + " " + C.cBlue + "Haunted Chests Opened: " + C.cYellow + hauntedChestsOpened);
caller.sendMessage(C.cBlue + "Trick or Treat Chests Received: " + C.cYellow + trickOrTreatChestsReceived + " " + C.cBlue + "Thankful Chests Received: " + C.cYellow + thankfulChestsReceived);
caller.sendMessage(C.cBlue + "Gingerbread Chests Received: " + C.cYellow + gingerbreadChestsReceived + " " + C.cBlue + "Minestrike Chests Received: " + C.cYellow + minestrikeChestsReceived);
caller.sendMessage(C.cBlue + "Love Chests Received: " + C.cYellow + loveChestsReceived);
caller.sendMessage(C.cBlue + "St Patrick's Chests Received: " + C.cYellow + stPatricksChestReceived);
caller.sendMessage(C.cBlue + "Spring Chests Received: " + C.cYellow + springChestsReceived);
caller.sendMessage(C.cBlue + "Freedom Chests Received: " + C.cYellow + freedomChestsReceived);
caller.sendMessage(C.cBlue + "Game Amplifiers Received: " + C.cYellow + boostersReceived);
caller.sendMessage(C.cBlue + "Rune Amplifiers (20 min/60 min) Received: " + C.cYellow + runeAmplifier20 + "/" + runeAmplifier60);
caller.sendMessage(C.cBlue + "Clans Dye Boxes Received: " + C.cYellow + clansDyeBoxesReceived + " " + C.cBlue + "Clans Builder Boxes Received: " + C.cYellow + clansBuilderBoxesReceived);
caller.sendMessage(C.cBlue + "Clan Banner Usage: " + getLockedFreedomStr(client.getUniqueId(), "Clan Banner Usage") + " " + C.cBlue + "Clan Banner Editor: " + getLockedFreedomStr(client.getUniqueId(), "Clan Banner Editor"));
YearMonth yearMonth = YearMonth.now();
caller.sendMessage(C.cBlue + "Power Play Subscription (" + yearMonth.getMonth().getDisplayName(TextStyle.FULL, Locale.US) + ") " + (powerPlayData.isSubscribed() ? C.cGreen + "Active" : C.cRed + "Inactive"));
if (powerPlayData.isSubscribed())
if (!bonuses)
{
caller.sendMessage(C.cBlue + "Power Play Chest/Amplifiers (" + yearMonth.getMonth().getDisplayName(TextStyle.FULL, Locale.US) + ") " + (powerPlayData.getUnclaimedMonths().contains(YearMonth.now()) ? C.cGreen + "Unclaimed" : C.cRed + "Claimed"));
LocalDate nextClaimDate = powerPlayData.getNextClaimDate().get(); // Guaranteed by isSubscribed()
caller.sendMessage(C.cBlue + "Power Play Next Claim Date " + C.cYellow + nextClaimDate.getMonth().getDisplayName(TextStyle.FULL, Locale.US) + " " + nextClaimDate.getDayOfMonth());
}
caller.sendMessage(C.cBlue + "Monthly Bonus Log (Last 6 entries):");
if (_accountBonusLog.containsKey(client.getAccountId()))
{
for (String logEntry : _accountBonusLog.get(client.getAccountId()))
StringBuilder shards = new StringBuilder(C.cBlue + "Enjin Shard Total Received: " + C.cYellow + enjinCoinsReceived);
shards.append(" ");
shards.append(C.cBlue + "Shards: " + C.cYellow + donor.getBalance(GlobalCurrency.TREASURE_SHARD));
caller.sendMessage(shards.toString());
// Strutt20 asked me to remove some stuff from the menu
caller.sendMessage(C.cBlue + "Old Chests Received: " + C.cYellow + oldChestsReceived + " " + C.cBlue + "Ancient Chests Received: " + C.cYellow + ancientChestsReceived);
caller.sendMessage(C.cBlue + "Mythical Chests Received: " + C.cYellow + mythicalChestsReceived + " " + C.cBlue + "Illuminated Chests Received: " + C.cYellow + illuminatedChestsReceived);
caller.sendMessage(C.cBlue + "Omega Chests Received: " + C.cYellow + omegaChestsReceived);
caller.sendMessage(C.cBlue + "Haunted Chests Received: " + C.cYellow + hauntedChestsReceived + " " + C.cBlue + "Haunted Chests Opened: " + C.cYellow + hauntedChestsOpened);
caller.sendMessage(C.cBlue + "Trick or Treat Chests Received: " + C.cYellow + trickOrTreatChestsReceived + " " + C.cBlue + "Thankful Chests Received: " + C.cYellow + thankfulChestsReceived);
caller.sendMessage(C.cBlue + "Gingerbread Chests Received: " + C.cYellow + gingerbreadChestsReceived + " " + C.cBlue + "Minestrike Chests Received: " + C.cYellow + minestrikeChestsReceived);
caller.sendMessage(C.cBlue + "Love Chests Received: " + C.cYellow + loveChestsReceived);
caller.sendMessage(C.cBlue + "St Patrick's Chests Received: " + C.cYellow + stPatricksChestReceived);
caller.sendMessage(C.cBlue + "Spring Chests Received: " + C.cYellow + springChestsReceived);
caller.sendMessage(C.cBlue + "Freedom Chests Received: " + C.cYellow + freedomChestsReceived);
caller.sendMessage(C.cBlue + "Game Amplifiers Received: " + C.cYellow + boostersReceived);
caller.sendMessage(C.cBlue + "Rune Amplifiers (20 min/60 min) Received: " + C.cYellow + runeAmplifier20 + "/" + runeAmplifier60);
caller.sendMessage(C.cBlue + "Clans Dye Boxes Received: " + C.cYellow + clansDyeBoxesReceived + " " + C.cBlue + "Clans Builder Boxes Received: " + C.cYellow + clansBuilderBoxesReceived);
caller.sendMessage(C.cBlue + "Clan Banner Usage: " + getLockedFreedomStr(client.getUniqueId(), "Clan Banner Usage") + " " + C.cBlue + "Clan Banner Editor: " + getLockedFreedomStr(client.getUniqueId(), "Clan Banner Editor"));
YearMonth yearMonth = YearMonth.now();
caller.sendMessage(C.cBlue + "Power Play Subscription (" + yearMonth.getMonth().getDisplayName(TextStyle.FULL, Locale.US) + ") " + (powerPlayData.isSubscribed() ? C.cGreen + "Active" : C.cRed + "Inactive"));
if (powerPlayData.isSubscribed())
{
caller.sendMessage(C.cYellow + logEntry);
}
caller.sendMessage(C.cBlue + "Power Play Chest/Amplifiers (" + yearMonth.getMonth().getDisplayName(TextStyle.FULL, Locale.US) + ") " + (powerPlayData.getUnclaimedMonths().contains(YearMonth.now()) ? C.cGreen + "Unclaimed" : C.cRed + "Claimed"));
LocalDate nextClaimDate = powerPlayData.getNextClaimDate().get(); // Guaranteed by isSubscribed()
caller.sendMessage(C.cBlue + "Power Play Next Claim Date " + C.cYellow + nextClaimDate.getMonth().getDisplayName(TextStyle.FULL, Locale.US) + " " + nextClaimDate.getDayOfMonth());
}
}
else
{
caller.sendMessage(C.cBlue + "Monthly Bonus Log (Last 6 entries):");
if (_accountBonusLog.containsKey(client.getAccountId()))
{
for (String logEntry : _accountBonusLog.get(client.getAccountId()))
{
caller.sendMessage(C.cYellow + logEntry);
}
}
}
caller.sendMessage(C.cDGreen + C.Strike + "=============================================");
_salesPackageManager.displaySalesPackages(caller, playerName);
if (!bonuses)
{
_salesPackageManager.displaySalesPackages(caller, playerName);
}
_accountBonusLog.remove(client.getAccountId());
}
});

View File

@ -0,0 +1,47 @@
package mineplex.staffServer.customerSupport;
import org.bukkit.entity.Player;
import mineplex.core.command.CommandBase;
import mineplex.core.common.Rank;
import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilPlayer;
public class checkBonusCommand extends CommandBase<CustomerSupport>
{
public checkBonusCommand(CustomerSupport plugin)
{
super(plugin, Rank.MODERATOR, "checkbonus");
}
@Override
public void Execute(final Player caller, String[] args)
{
if (args == null || args.length != 1)
{
caller.sendMessage(F.main(Plugin.getName(), "Usage : /checkbonus defek7"));
}
else
{
String playerName = args[0];
_commandCenter.GetClientManager().checkPlayerName(caller, playerName, name ->
{
if (name != null)
{
_commandCenter.GetClientManager().loadClientByName(name, client ->
{
if (client != null)
{
Plugin.showPlayerInfo(caller, client, true);
}
else
{
UtilPlayer.message(caller, F.main(Plugin.getName(), "Could not load data for " + name));
}
});
}
});
}
}
}

View File

@ -33,7 +33,7 @@ public class checkCommand extends CommandBase<CustomerSupport>
{
if (client != null)
{
Plugin.showPlayerInfo(caller, client);
Plugin.showPlayerInfo(caller, client, false);
}
else
{