Updated HC Badge Achievement so it no longer requires payday to be enabled.

This commit is contained in:
Harmonic 2021-02-10 19:03:52 +00:00
parent ac83132b75
commit 3c18b060cc
2 changed files with 56 additions and 46 deletions

View File

@ -85,9 +85,11 @@ public class SubscriptionHabboClub extends Subscription {
}
if ((Emulator.getIntUnixTimestamp() - habbo.getHabboStats().hcMessageLastModified) < 60) {
Emulator.getThreading().run(() -> { habbo.getClient().sendResponse(new UserClubComposer(habbo)); habbo.getClient().sendResponse(new UserPermissionsComposer(habbo)); }, (Emulator.getIntUnixTimestamp() - habbo.getHabboStats().hcMessageLastModified));
}
else {
Emulator.getThreading().run(() -> {
habbo.getClient().sendResponse(new UserClubComposer(habbo));
habbo.getClient().sendResponse(new UserPermissionsComposer(habbo));
}, (Emulator.getIntUnixTimestamp() - habbo.getHabboStats().hcMessageLastModified));
} else {
habbo.getClient().sendResponse(new UserClubComposer(habbo, SubscriptionHabboClub.HABBO_CLUB, UserClubComposer.RESPONSE_TYPE_NORMAL));
habbo.getClient().sendResponse(new UserPermissionsComposer(habbo));
}
@ -172,6 +174,7 @@ public class SubscriptionHabboClub extends Subscription {
/**
* Calculate's a users upcoming HC Pay day rewards
*
* @param habbo User to calculate for
* @return ClubCenterDataComposer
*/
@ -272,8 +275,7 @@ public class SubscriptionHabboClub extends Subscription {
}
stats.lastHCPayday = timestampNow;
Emulator.getThreading().run(stats);
}
catch (Exception e) {
} catch (Exception e) {
SubscriptionManager.LOGGER.error("Exception processing HC payday for user #" + set.getInt("user_id"), e);
}
}
@ -297,8 +299,7 @@ public class SubscriptionHabboClub extends Subscription {
stm2.execute();
}
}
catch (SQLException e) {
} catch (SQLException e) {
SubscriptionManager.LOGGER.error("Caught SQL exception", e);
}
isExecuting = false;
@ -306,6 +307,7 @@ public class SubscriptionHabboClub extends Subscription {
/**
* Called when a user logs in. Checks for any unclaimed HC Pay day rewards and issues rewards.
*
* @param habbo User to process
*/
public static void processUnclaimed(Habbo habbo) {
@ -334,19 +336,25 @@ public class SubscriptionHabboClub extends Subscription {
stm2.execute();
}
}
}
catch (Exception e) {
} catch (Exception e) {
SubscriptionManager.LOGGER.error("Exception processing HC payday for user #" + set.getInt("user_id"), e);
}
}
}
}
catch (SQLException e) {
} catch (SQLException e) {
SubscriptionManager.LOGGER.error("Caught SQL exception", e);
}
}
/**
*
* Seperated these because Beny shouldn't have tied them to Payday.
*/
public static void processClubBadge(Habbo habbo) {
progressAchievement(habbo.getHabboInfo());
}
/**
* Issues rewards to user.
* @param habbo User to reward to

View File

@ -205,6 +205,8 @@ public class SecureLoginEvent extends MessageHandler {
SubscriptionHabboClub.processUnclaimed(habbo);
}
SubscriptionHabboClub.processClubBadge(habbo);
Messenger.checkFriendSizeProgress(habbo);
if (!habbo.getHabboStats().hasGottenDefaultSavedSearches) {