Remove openPageAsync and clean up BonusData on close

This commit is contained in:
Spencer 2018-01-07 08:47:47 -05:00 committed by Alexander Meech
parent 7a431350a1
commit e7b67ae7d6

View File

@ -48,18 +48,13 @@ public class SupportShop extends ShopBase<CustomerSupport>
loadPowerPlay(caller, target.getAccountId(), (ppcS) -> loadPowerPlay(caller, target.getAccountId(), (ppcS) ->
loadPetClient(caller, target, (petS) -> loadPetClient(caller, target, (petS) ->
loadBonusData(caller, target.getAccountId(), (bonusS) -> loadBonusData(caller, target.getAccountId(), (bonusS) ->
openPageAsync(caller, new SupportHomePage(getPlugin(), this, caller, target)) openPageForPlayer(caller, new SupportHomePage(getPlugin(), this, caller, target))
) )
) )
) )
); );
} }
public void openPageAsync(Player player, SupportPage page)
{
UtilServer.runAsync(() -> UtilServer.runSync(()-> super.openPageForPlayer(player, page)));
}
public void loadBonusLog(Player caller, int accountId, Consumer<Boolean> callback) public void loadBonusLog(Player caller, int accountId, Consumer<Boolean> callback)
{ {
getPlugin().getRepository().loadBonusLog(accountId, resultSet -> getPlugin().getRepository().loadBonusLog(accountId, resultSet ->
@ -152,6 +147,7 @@ public class SupportShop extends ShopBase<CustomerSupport>
_bonusLog.remove(player); _bonusLog.remove(player);
_powerPlayData.remove(player); _powerPlayData.remove(player);
_petClients.remove(player); _petClients.remove(player);
_bonusData.remove(player);
} }
@Override @Override