revert timestamp commit by zGrav

This commit is contained in:
KrewsOrg 2020-05-09 17:31:09 +01:00
parent ba5358819d
commit ea27e419bb
3 changed files with 4 additions and 12 deletions

View File

@ -6,7 +6,6 @@ import com.eu.habbo.habbohotel.bots.Bot;
import com.eu.habbo.habbohotel.catalog.layouts.*;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.guilds.Guild;
import com.eu.habbo.habbohotel.guilds.GuildManager;
import com.eu.habbo.habbohotel.items.FurnitureType;
import com.eu.habbo.habbohotel.items.Item;
import com.eu.habbo.habbohotel.items.SoundTrack;
@ -43,7 +42,6 @@ import gnu.trove.set.hash.THashSet;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.lang.reflect.InvocationTargetException;
import java.sql.*;
import java.util.*;
import java.util.stream.Collectors;
@ -1127,8 +1125,6 @@ public class CatalogManager {
habbo.getClient().sendResponse(new AlertPurchaseFailedComposer(AlertPurchaseFailedComposer.SERVER_ERROR));
}
} finally {
habbo.getHabboStats().lastPurchaseTimestamp = Emulator.getIntUnixTimestamp();
habbo.getHabboStats().run();
habbo.getHabboStats().isPurchasingFurniture = false;
}
}

View File

@ -83,8 +83,8 @@ public class HabboStats implements Runnable {
public int forumPostsCount;
public THashMap<Integer, List<Integer>> ltdPurchaseLog = new THashMap<>(0);
public long lastTradeTimestamp = Emulator.getIntUnixTimestamp();
public int lastPurchaseTimestamp;
public long lastGiftTimestamp = Emulator.getIntUnixTimestamp();
public long lastPurchaseTimestamp = Emulator.getIntUnixTimestamp();
public int uiFlags;
public boolean hasGottenDefaultSavedSearches;
private HabboInfo habboInfo;
@ -140,7 +140,6 @@ public class HabboStats implements Runnable {
this.forumPostsCount = set.getInt("forums_post_count");
this.uiFlags = set.getInt("ui_flags");
this.hasGottenDefaultSavedSearches = set.getInt("has_gotten_default_saved_searches") == 1;
this.lastPurchaseTimestamp = set.getInt("last_purchase_timestamp");
this.nuxReward = this.nux;
@ -301,7 +300,7 @@ public class HabboStats implements Runnable {
@Override
public void run() {
try (Connection connection = Emulator.getDatabase().getDataSource().getConnection()) {
try (PreparedStatement statement = connection.prepareStatement("UPDATE users_settings SET achievement_score = ?, respects_received = ?, respects_given = ?, daily_respect_points = ?, block_following = ?, block_friendrequests = ?, online_time = online_time + ?, guild_id = ?, daily_pet_respect_points = ?, club_expire_timestamp = ?, login_streak = ?, rent_space_id = ?, rent_space_endtime = ?, volume_system = ?, volume_furni = ?, volume_trax = ?, block_roominvites = ?, old_chat = ?, block_camera_follow = ?, chat_color = ?, hof_points = ?, block_alerts = ?, talent_track_citizenship_level = ?, talent_track_helpers_level = ?, ignore_bots = ?, ignore_pets = ?, nux = ?, mute_end_timestamp = ?, allow_name_change = ?, perk_trade = ?, can_trade = ?, `forums_post_count` = ?, ui_flags = ?, has_gotten_default_saved_searches = ?, last_purchase_timestamp = ? WHERE user_id = ? LIMIT 1")) {
try (PreparedStatement statement = connection.prepareStatement("UPDATE users_settings SET achievement_score = ?, respects_received = ?, respects_given = ?, daily_respect_points = ?, block_following = ?, block_friendrequests = ?, online_time = online_time + ?, guild_id = ?, daily_pet_respect_points = ?, club_expire_timestamp = ?, login_streak = ?, rent_space_id = ?, rent_space_endtime = ?, volume_system = ?, volume_furni = ?, volume_trax = ?, block_roominvites = ?, old_chat = ?, block_camera_follow = ?, chat_color = ?, hof_points = ?, block_alerts = ?, talent_track_citizenship_level = ?, talent_track_helpers_level = ?, ignore_bots = ?, ignore_pets = ?, nux = ?, mute_end_timestamp = ?, allow_name_change = ?, perk_trade = ?, can_trade = ?, `forums_post_count` = ?, ui_flags = ?, has_gotten_default_saved_searches = ? WHERE user_id = ? LIMIT 1")) {
statement.setInt(1, this.achievementScore);
statement.setInt(2, this.respectPointsReceived);
statement.setInt(3, this.respectPointsGiven);
@ -336,9 +335,7 @@ public class HabboStats implements Runnable {
statement.setInt(32, this.forumPostsCount);
statement.setInt(33, this.uiFlags);
statement.setInt(34, this.hasGottenDefaultSavedSearches ? 1 : 0);
statement.setInt(35, this.lastPurchaseTimestamp);
statement.setInt(36, this.habboInfo.getId());
statement.setInt(35, this.habboInfo.getId());
statement.executeUpdate();
}

View File

@ -178,8 +178,7 @@ public class CatalogBuyItemEvent extends MessageHandler {
this.client.sendResponse(new PurchaseOKComposer(null));
this.client.sendResponse(new InventoryRefreshComposer());
this.client.getHabbo().getHabboStats().lastPurchaseTimestamp = Emulator.getIntUnixTimestamp();
this.client.getHabbo().getHabboStats().run();
}
return;