Fix Metal Man distribution

This commit is contained in:
Shaun Bennett 2016-11-17 16:18:51 -05:00
parent 10911c9a9c
commit f6a694b4fc

View File

@ -39,8 +39,6 @@ public class PowerPlayClubRepository implements Listener {
// giving a player his/her rewards.
private final Map<UUID, PowerPlayData> _cachedPlayerData = new HashMap<>();
private final Set<UUID> _yearlySubscriptions = new HashSet<>();
private final CoreClientManager _clientManager;
private final DonationManager _donationManager;
@ -86,10 +84,6 @@ public class PowerPlayClubRepository implements Listener {
LocalDate date = resultSet.getDate("startDate").toLocalDate();
PowerPlayData.SubscriptionDuration duration = PowerPlayData.SubscriptionDuration.valueOf(resultSet.getString("duration").toUpperCase());
subscriptions.add(new PowerPlayData.Subscription(date, duration));
if (duration.equals(PowerPlayData.SubscriptionDuration.YEAR))
{
_yearlySubscriptions.add(uuid);
}
}
// Now that we have the claims from the first processor and subscriptions from this one, combine them
@ -115,7 +109,10 @@ public class PowerPlayClubRepository implements Listener {
.forEach(_donationManager.Get(player)::AddUnknownSalesPackagesOwned);
// Gives Metal Man for anyone subscribed
_donationManager.Get(player).AddUnknownSalesPackagesOwned("Metal Man Morph");
if (cached.getUsableCosmeticMonths().size() > 0)
{
_donationManager.Get(player).AddUnknownSalesPackagesOwned("Metal Man Morph");
}
}
@EventHandler
@ -123,7 +120,6 @@ public class PowerPlayClubRepository implements Listener {
{
_stageOneDataClaims.remove(event.getPlayer().getUniqueId()); // Just in case.
_cachedPlayerData.remove(event.getPlayer().getUniqueId());
_yearlySubscriptions.remove(event.getPlayer().getUniqueId());
}
public CompletableFuture<Void> addSubscription(int accountId, LocalDate date, String duration)