mirror of
https://git.krews.org/morningstar/Arcturus-Community.git
synced 2024-11-27 08:50:51 +01:00
Fix CalendarCommand
This commit is contained in:
parent
963d892934
commit
d7e059326e
@ -22,14 +22,19 @@ public class CalendarCommand extends Command {
|
|||||||
if (Emulator.getConfig().getBoolean("hotel.calendar.enabled")) {
|
if (Emulator.getConfig().getBoolean("hotel.calendar.enabled")) {
|
||||||
String campaignName = Emulator.getConfig().getValue("hotel.calendar.default");
|
String campaignName = Emulator.getConfig().getValue("hotel.calendar.default");
|
||||||
|
|
||||||
if(params.length > 1 && gameClient.getHabbo().hasPermission("cmd_calendar_staff")) {
|
if (params.length > 1 && gameClient.getHabbo().hasPermission("cmd_calendar_staff")) {
|
||||||
campaignName = params[1];
|
campaignName = params[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
CalendarCampaign campaign = Emulator.getGameEnvironment().getCalendarManager().getCalendarCampaign(campaignName);
|
CalendarCampaign campaign = Emulator.getGameEnvironment().getCalendarManager().getCalendarCampaign(campaignName);
|
||||||
if(campaign == null) return false;
|
|
||||||
int daysBetween = (int) DAYS.between(new Timestamp(campaign.getStartTimestamp() * 1000L).toInstant(), new Date().toInstant());
|
if (campaign == null) return false;
|
||||||
if(daysBetween >= 0) {
|
|
||||||
|
int daysBetween = (int) DAYS.between(new Timestamp(campaign.getStartTimestamp() * 1000L).toInstant(), new Date().toInstant());
|
||||||
|
|
||||||
|
if (daysBetween >= 0) {
|
||||||
gameClient.sendResponse(new AdventCalendarDataComposer(campaign.getName(), campaign.getImage(), campaign.getTotalDays(), daysBetween, gameClient.getHabbo().getHabboStats().calendarRewardsClaimed, campaign.getLockExpired()));
|
gameClient.sendResponse(new AdventCalendarDataComposer(campaign.getName(), campaign.getImage(), campaign.getTotalDays(), daysBetween, gameClient.getHabbo().getHabboStats().calendarRewardsClaimed, campaign.getLockExpired()));
|
||||||
|
gameClient.sendResponse(new NuxAlertComposer("openView/calendar"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user