Merge branch 'rand-fixes' into 'ms4-unstable'

Code cleanup

See merge request morningstar/Arcturus-Community!559
This commit is contained in:
Harmonic 2022-05-01 23:26:50 +00:00
commit 668b5427b4
524 changed files with 2476 additions and 2519 deletions

View File

@ -31,16 +31,20 @@ import java.util.regex.Pattern;
public final class Emulator {
public static final int MAJOR = 4;
public static final int MINOR = 0;
public static final int BUILD = 0;
public static final String PREVIEW = "Developer Preview";
public static final String version = "Arcturus Morningstar" + " " + MAJOR + "." + MINOR + "." + BUILD + " " + PREVIEW;
public static String build = "";
public static boolean isReady = false;
public static boolean isShuttingDown = false;
public static boolean stopped = false;
public static boolean debugging = false;
private static final Logger LOGGER = LoggerFactory.getLogger(Emulator.class);
private static final String OS_NAME = (System.getProperty("os.name") != null ? System.getProperty("os.name") : "Unknown");
private static final String CLASS_PATH = (System.getProperty("java.class.path") != null ? System.getProperty("java.class.path") : "Unknown");
public final static int MAJOR = 4;
public final static int MINOR = 0;
public final static int BUILD = 0;
public final static String PREVIEW = "Developer Preview";
public static final String version = "Arcturus Morningstar" + " " + MAJOR + "." + MINOR + "." + BUILD + " " + PREVIEW;
private static final String logo =
"\n" +
"███╗ ███╗ ██████╗ ██████╗ ███╗ ██╗██╗███╗ ██╗ ██████╗ ███████╗████████╗ █████╗ ██████╗ \n" +
@ -52,11 +56,6 @@ public final class Emulator {
public static String build = "";
public static boolean isReady = false;
public static boolean isShuttingDown = false;
public static boolean stopped = false;
public static boolean debugging = false;
private static int timeStarted = 0;
private static Runtime runtime;
private static ConfigurationManager config;
@ -217,12 +216,11 @@ public final class Emulator {
MessageDigest md = MessageDigest.getInstance("MD5");// MD5
FileInputStream fis = new FileInputStream(filepath);
byte[] dataBytes = new byte[1024];
int nread = 0;
int nread;
while ((nread = fis.read(dataBytes)) != -1)
md.update(dataBytes, 0, nread);
byte[] mdbytes = md.digest();
for (int i = 0; i < mdbytes.length; i++)
sb.append(Integer.toString((mdbytes[i] & 0xff) + 0x100, 16).substring(1));
for (byte mdbyte : mdbytes) sb.append(Integer.toString((mdbyte & 0xff) + 0x100, 16).substring(1));
} catch (Exception e) {
build = "4.0 Developer Preview Branch";
return;
@ -241,50 +239,50 @@ public final class Emulator {
try {
if (Emulator.getPluginManager() != null)
Emulator.getPluginManager().fireEvent(new EmulatorStartShutdownEvent());
} catch (Exception e) {
} catch (Exception ignored) {
}
try {
if (Emulator.cameraClient != null)
Emulator.cameraClient.disconnect();
} catch (Exception e) {
} catch (Exception ignored) {
}
try {
if (Emulator.rconServer != null)
Emulator.rconServer.stop();
} catch (Exception e) {
} catch (Exception ignored) {
}
try {
if (Emulator.gameEnvironment != null)
Emulator.gameEnvironment.dispose();
} catch (Exception e) {
} catch (Exception ignored) {
}
try {
if (Emulator.getPluginManager() != null)
Emulator.getPluginManager().fireEvent(new EmulatorStoppedEvent());
} catch (Exception e) {
} catch (Exception ignored) {
}
try {
if (Emulator.pluginManager != null)
Emulator.pluginManager.dispose();
} catch (Exception e) {
} catch (Exception ignored) {
}
try {
if (Emulator.config != null) {
Emulator.config.saveToDatabase();
}
} catch (Exception e) {
} catch (Exception ignored) {
}
try {
if (Emulator.gameServer != null)
Emulator.gameServer.stop();
} catch (Exception e) {
} catch (Exception ignored) {
}
LOGGER.info("Stopped Arcturus Morningstar {}", version);
@ -298,7 +296,7 @@ public final class Emulator {
if (Emulator.threading != null)
Emulator.threading.shutDown();
} catch (Exception e) {
} catch (Exception ignored) {
}
}
@ -362,7 +360,7 @@ public final class Emulator {
return badgeImager;
}
public static CameraClient getCameraClient() {
public static synchronized CameraClient getCameraClient() {
return cameraClient;
}
@ -386,17 +384,14 @@ public final class Emulator {
int totalSeconds = 0;
Matcher m = Pattern.compile("(([0-9]*) (second|minute|hour|day|week|month|year))").matcher(timeString);
Map<String,Integer> map = new HashMap<String,Integer>() {
{
put("second", 1);
put("minute", 60);
put("hour", 3600);
put("day", 86400);
put("week", 604800);
put("month", 2628000);
put("year", 31536000);
}
};
Map<String,Integer> map = new HashMap<String,Integer>();
map.put("second", 1);
map.put("minute", 60);
map.put("hour", 3600);
map.put("day", 86400);
map.put("week", 604800);
map.put("month", 2628000);
map.put("year", 31536000);
while (m.find()) {
try {
@ -417,17 +412,14 @@ public final class Emulator {
c.setTime(date);
Matcher m = Pattern.compile("(([0-9]*) (second|minute|hour|day|week|month|year))").matcher(timeString);
Map<String, Integer> map = new HashMap<String, Integer>() {
{
put("second", Calendar.SECOND);
put("minute", Calendar.MINUTE);
put("hour", Calendar.HOUR);
put("day", Calendar.DAY_OF_MONTH);
put("week", Calendar.WEEK_OF_MONTH);
put("month", Calendar.MONTH);
put("year", Calendar.YEAR);
}
};
Map<String, Integer> map = new HashMap<String, Integer>();
map.put("second", Calendar.SECOND);
map.put("minute", Calendar.MINUTE);
map.put("hour", Calendar.HOUR);
map.put("day", Calendar.DAY_OF_MONTH);
map.put("week", Calendar.WEEK_OF_MONTH);
map.put("month", Calendar.MONTH);
map.put("year", Calendar.YEAR);
while (m.find()) {
try {
@ -444,6 +436,8 @@ public final class Emulator {
private static String dateToUnixTimestamp(Date date) {
String res = "";
Date aux = stringToDate("1970-01-01 00:00:00");
if(aux == null) return null;
Timestamp aux1 = dateToTimeStamp(aux);
Timestamp aux2 = dateToTimeStamp(date);
long difference = aux2.getTime() - aux1.getTime();

View File

@ -20,7 +20,7 @@ public class RoomUserPetComposer extends MessageComposer {
@Override
protected ServerMessage composeInternal() {
this.response.init(Outgoing.UsersComposer);
this.response.init(Outgoing.usersComposer);
this.response.appendInt(1);
this.response.appendInt(this.habbo.getHabboInfo().getId());
this.response.appendString(this.habbo.getHabboInfo().getUsername());

View File

@ -31,6 +31,6 @@ public class Scheduler implements Runnable {
if (this.disposed)
return;
Emulator.getThreading().run(this, this.interval * 1000);
Emulator.getThreading().run(this, this.interval * 1000L);
}
}

View File

@ -23,7 +23,7 @@ public class TextsManager {
LOGGER.info("Texts Manager -> Loaded! (" + (System.currentTimeMillis() - millis) + " MS)");
} catch (Exception e) {
e.printStackTrace();
LOGGER.error("Caught exception", e);
}
}

View File

@ -4,7 +4,7 @@ import com.eu.habbo.Emulator;
import com.eu.habbo.core.*;
import com.eu.habbo.habbohotel.achievements.AchievementManager;
import com.eu.habbo.habbohotel.bots.BotManager;
import com.eu.habbo.habbohotel.campaign.calendar.CalendarManager;
import com.eu.habbo.habbohotel.campaign.CalendarManager;
import com.eu.habbo.habbohotel.catalog.CatalogManager;
import com.eu.habbo.habbohotel.commands.CommandHandler;
import com.eu.habbo.habbohotel.crafting.CraftingManager;

View File

@ -47,7 +47,7 @@ public class Bot implements Runnable {
private int bubble;
private String type;
private final String type;
private int effect;

View File

@ -12,7 +12,7 @@ import java.text.SimpleDateFormat;
import java.util.Date;
public class VisitorBot extends Bot {
private static SimpleDateFormat DATE_FORMAT;
public static SimpleDateFormat DATE_FORMAT;
private boolean showedLog = false;
private THashSet<ModToolRoomVisit> visits = new THashSet<>(3);

View File

@ -1,10 +1,9 @@
package com.eu.habbo.habbohotel.campaign.calendar;
package com.eu.habbo.habbohotel.campaign;
import gnu.trove.map.hash.THashMap;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Timestamp;
import java.util.Map;
public class CalendarCampaign {
@ -12,26 +11,26 @@ public class CalendarCampaign {
private final String name;
private final String image;
private Map<Integer , CalendarRewardObject> rewards = new THashMap<>();
private final Integer start_timestamp;
private final int total_days;
private final boolean lock_expired;
private final Integer startTimestamp;
private final int totalDays;
private final boolean lockExpired;
public CalendarCampaign(ResultSet set) throws SQLException {
this.id = set.getInt("id");
this.name = set.getString("name");
this.image = set.getString("image");
this.start_timestamp = set.getInt("start_timestamp");
this.total_days = set.getInt("total_days");
this.lock_expired = set.getInt("lock_expired") == 1;
this.startTimestamp = set.getInt("start_timestamp");
this.totalDays = set.getInt("total_days");
this.lockExpired = set.getInt("lock_expired") == 1;
}
public CalendarCampaign(int id, String name, String image, Integer start_timestamp, int total_days, boolean lock_expired) {
public CalendarCampaign(int id, String name, String image, Integer startTimestamp, int totalDays, boolean lockExpired) {
this.id = id;
this.name = name;
this.image = image;
this.start_timestamp = start_timestamp;
this.total_days = total_days;
this.lock_expired = lock_expired;
this.startTimestamp = startTimestamp;
this.totalDays = totalDays;
this.lockExpired = lockExpired;
}
public int getId() {
@ -47,12 +46,12 @@ public class CalendarCampaign {
}
public Integer getStartTimestamp() {
return this.start_timestamp;
return this.startTimestamp;
}
public int getTotalDays() { return this.total_days; }
public int getTotalDays() { return this.totalDays; }
public boolean getLockExpired() { return this.lock_expired; }
public boolean getLockExpired() { return this.lockExpired; }
public Map<Integer, CalendarRewardObject> getRewards() { return rewards; }

View File

@ -1,4 +1,4 @@
package com.eu.habbo.habbohotel.campaign.calendar;
package com.eu.habbo.habbohotel.campaign;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.users.Habbo;
@ -9,16 +9,15 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.sql.*;
import java.util.*;
import java.time.temporal.ChronoUnit;
import java.util.Date;
import static java.time.temporal.ChronoUnit.DAYS;
import java.util.*;
public class CalendarManager {
private static final Logger LOGGER = LoggerFactory.getLogger(CalendarCampaign.class);
private static final Logger LOGGER = LoggerFactory.getLogger(CalendarManager.class);
final private static Map<Integer, CalendarCampaign> calendarCampaigns = new THashMap<>();
private static final Map<Integer, CalendarCampaign> calendarCampaigns = new THashMap<>();
public static double HC_MODIFIER;
public CalendarManager() {
@ -27,7 +26,7 @@ public class CalendarManager {
LOGGER.info("Calendar Manager -> Loaded! ({} MS)", (System.currentTimeMillis() - millis));
}
public void dispose(){
public void dispose() {
calendarCampaigns.clear();
}
@ -48,7 +47,7 @@ public class CalendarManager {
try (ResultSet set = statement.executeQuery()) {
while (set.next()) {
CalendarCampaign campaign = calendarCampaigns.get(set.getInt("campaign_id"));
if(campaign != null){
if (campaign != null) {
campaign.addReward(new CalendarRewardObject(set));
}
}
@ -58,7 +57,7 @@ public class CalendarManager {
return false;
}
HC_MODIFIER = Emulator.getConfig().getDouble("hotel.calendar.pixels.hc_modifier", 2.0);
CalendarManager.HC_MODIFIER = Emulator.getConfig().getDouble("hotel.calendar.pixels.hc_modifier", 2.0);
return true;
}
@ -107,46 +106,38 @@ public class CalendarManager {
public CalendarCampaign getCalendarCampaign(String campaignName) {
return calendarCampaigns.values().stream().filter(cc -> Objects.equals(cc.getName(), campaignName)).findFirst().orElse(null);
}
public Map<Integer, CalendarCampaign> getCalendarCampaigns() {
return calendarCampaigns;
}
public void claimCalendarReward(Habbo habbo, String campaignName, int day, boolean force) {
CalendarCampaign campaign = calendarCampaigns.values().stream().filter(cc -> Objects.equals(cc.getName(), campaignName)).findFirst().orElse(null);
if(campaign == null) return;
if (habbo.getHabboStats().calendarRewardsClaimed.stream().noneMatch(claimed -> claimed.getCampaignId() == campaign.getId() && claimed.getDay() == day)) {
if (campaign == null || campaign.getRewards().isEmpty() || (habbo.getHabboStats().calendarRewardsClaimed.stream().anyMatch(claimed -> claimed.getCampaignId() == campaign.getId() && claimed.getDay() == day)))
return;
Set<Integer> keys = campaign.getRewards().keySet();
Map<Integer, Integer> rewards = new THashMap<>();
if(keys.isEmpty()) return;
keys.forEach(key -> rewards.put(rewards.size() + 1, key));
int rand = Emulator.getRandom().nextInt(rewards.size() - 1 + 1) + 1;
int random = rewards.get(rand);
CalendarRewardObject object = campaign.getRewards().get(random);
if (object == null) return;
int daysBetween = (int) DAYS.between(new Timestamp(campaign.getStartTimestamp() * 1000L).toInstant(), new Date().toInstant());
if(daysBetween >= 0 && daysBetween <= campaign.getTotalDays()) {
int diff = (daysBetween - day);
if ((((diff <= 2 || !campaign.getLockExpired()) && diff >= 0) || (force && habbo.hasPermission("acc_calendar_force")))) {
List<CalendarRewardObject> rewards = new ArrayList<>(campaign.getRewards().values());
CalendarRewardObject object = rewards.get(Emulator.getRandom().nextInt(rewards.size() - 1 + 1));
if (Emulator.getPluginManager().fireEvent(new UserClaimRewardEvent(habbo, campaign, day, object, force)).isCancelled()) {
return;
}
if (object == null) return;
long daysBetween = ChronoUnit.DAYS.between(new Timestamp(campaign.getStartTimestamp() * 1000L).toInstant(), new Date().toInstant());
if (((daysBetween >= 0 && daysBetween <= campaign.getTotalDays()) && (((daysBetween - day <= 2 || !campaign.getLockExpired()) && daysBetween - day >= 0)) || (force && habbo.hasPermission("acc_calendar_force")))) {
if (Emulator.getPluginManager().fireEvent(new UserClaimRewardEvent(habbo, campaign, day, object, force)).isCancelled()) {
return;
}
habbo.getHabboStats().calendarRewardsClaimed.add(new CalendarRewardClaimed(habbo.getHabboInfo().getId(), campaign.getId(), day, object.getId(), new Timestamp(System.currentTimeMillis())));
habbo.getClient().sendResponse(new CampaignCalendarDoorOpenedMessageComposer(true, object, habbo));
object.give(habbo);
habbo.getHabboStats().calendarRewardsClaimed.add(new CalendarRewardClaimed(habbo.getHabboInfo().getId(), campaign.getId(), day, object.getId(), new Timestamp(System.currentTimeMillis())));
habbo.getClient().sendResponse(new CampaignCalendarDoorOpenedMessageComposer(true, object, habbo));
object.give(habbo);
try (Connection connection = Emulator.getDatabase().getDataSource().getConnection(); PreparedStatement statement = connection.prepareStatement("INSERT INTO calendar_rewards_claimed (user_id, campaign_id, day, reward_id, timestamp) VALUES (?, ?, ?, ?, ?)")) {
statement.setInt(1, habbo.getHabboInfo().getId());
statement.setInt(2, campaign.getId());
statement.setInt(3, day);
statement.setInt(4, object.getId());
statement.setInt(5, Emulator.getIntUnixTimestamp());
statement.execute();
} catch (SQLException e) {
LOGGER.error("Caught SQL exception", e);
}
}
try (Connection connection = Emulator.getDatabase().getDataSource().getConnection(); PreparedStatement statement = connection.prepareStatement("INSERT INTO calendar_rewards_claimed (user_id, campaign_id, day, reward_id, timestamp) VALUES (?, ?, ?, ?, ?)")) {
statement.setInt(1, habbo.getHabboInfo().getId());
statement.setInt(2, campaign.getId());
statement.setInt(3, day);
statement.setInt(4, object.getId());
statement.setInt(5, Emulator.getIntUnixTimestamp());
statement.execute();
} catch (SQLException e) {
LOGGER.error("Caught SQL exception", e);
}
}
}

View File

@ -1,4 +1,4 @@
package com.eu.habbo.habbohotel.campaign.calendar;
package com.eu.habbo.habbohotel.campaign;
import java.sql.ResultSet;
import java.sql.SQLException;

View File

@ -1,4 +1,4 @@
package com.eu.habbo.habbohotel.campaign.calendar;
package com.eu.habbo.habbohotel.campaign;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.items.Item;

View File

@ -50,139 +50,7 @@ public class CatalogManager {
private static final Logger LOGGER = LoggerFactory.getLogger(CatalogManager.class);
public static final THashMap<String, Class<? extends CatalogPage>> pageDefinitions = new THashMap<String, Class<? extends CatalogPage>>(CatalogPageLayouts.values().length) {
{
for (CatalogPageLayouts layout : CatalogPageLayouts.values()) {
switch (layout) {
case frontpage:
this.put(layout.name().toLowerCase(), FrontpageLayout.class);
break;
case badge_display:
this.put(layout.name().toLowerCase(), BadgeDisplayLayout.class);
break;
case spaces_new:
this.put(layout.name().toLowerCase(), SpacesLayout.class);
break;
case trophies:
this.put(layout.name().toLowerCase(), TrophiesLayout.class);
break;
case bots:
this.put(layout.name().toLowerCase(), BotsLayout.class);
break;
case club_buy:
this.put(layout.name().toLowerCase(), ClubBuyLayout.class);
break;
case club_gift:
this.put(layout.name().toLowerCase(), ClubGiftsLayout.class);
break;
case sold_ltd_items:
this.put(layout.name().toLowerCase(), SoldLTDItemsLayout.class);
break;
case single_bundle:
this.put(layout.name().toLowerCase(), SingleBundle.class);
break;
case roomads:
this.put(layout.name().toLowerCase(), RoomAdsLayout.class);
break;
case recycler:
if (Emulator.getConfig().getBoolean("hotel.ecotron.enabled"))
this.put(layout.name().toLowerCase(), RecyclerLayout.class);
break;
case recycler_info:
if (Emulator.getConfig().getBoolean("hotel.ecotron.enabled"))
this.put(layout.name().toLowerCase(), RecyclerInfoLayout.class);
case recycler_prizes:
if (Emulator.getConfig().getBoolean("hotel.ecotron.enabled"))
this.put(layout.name().toLowerCase(), RecyclerPrizesLayout.class);
break;
case marketplace:
if (Emulator.getConfig().getBoolean("hotel.marketplace.enabled"))
this.put(layout.name().toLowerCase(), MarketplaceLayout.class);
break;
case marketplace_own_items:
if (Emulator.getConfig().getBoolean("hotel.marketplace.enabled"))
this.put(layout.name().toLowerCase(), MarketplaceOwnItems.class);
break;
case info_duckets:
this.put(layout.name().toLowerCase(), InfoDucketsLayout.class);
break;
case info_pets:
this.put(layout.name().toLowerCase(), InfoPetsLayout.class);
break;
case info_rentables:
this.put(layout.name().toLowerCase(), InfoRentablesLayout.class);
break;
case info_loyalty:
this.put(layout.name().toLowerCase(), InfoLoyaltyLayout.class);
break;
case loyalty_vip_buy:
this.put(layout.name().toLowerCase(), LoyaltyVipBuyLayout.class);
break;
case guilds:
this.put(layout.name().toLowerCase(), GuildFrontpageLayout.class);
break;
case guild_furni:
this.put(layout.name().toLowerCase(), GuildFurnitureLayout.class);
break;
case guild_forum:
this.put(layout.name().toLowerCase(), GuildForumLayout.class);
break;
case pets:
this.put(layout.name().toLowerCase(), PetsLayout.class);
break;
case pets2:
this.put(layout.name().toLowerCase(), Pets2Layout.class);
break;
case pets3:
this.put(layout.name().toLowerCase(), Pets3Layout.class);
break;
case soundmachine:
this.put(layout.name().toLowerCase(), TraxLayout.class);
break;
case default_3x3_color_grouping:
this.put(layout.name().toLowerCase(), ColorGroupingLayout.class);
break;
case recent_purchases:
this.put(layout.name().toLowerCase(), RecentPurchasesLayout.class);
break;
case room_bundle:
this.put(layout.name().toLowerCase(), RoomBundleLayout.class);
break;
case petcustomization:
this.put(layout.name().toLowerCase(), PetCustomizationLayout.class);
break;
case vip_buy:
this.put(layout.name().toLowerCase(), VipBuyLayout.class);
break;
case frontpage_featured:
this.put(layout.name().toLowerCase(), FrontPageFeaturedLayout.class);
break;
case builders_club_addons:
this.put(layout.name().toLowerCase(), BuildersClubAddonsLayout.class);
break;
case builders_club_frontpage:
this.put(layout.name().toLowerCase(), BuildersClubFrontPageLayout.class);
break;
case builders_club_loyalty:
this.put(layout.name().toLowerCase(), BuildersClubLoyaltyLayout.class);
break;
case monkey:
this.put(layout.name().toLowerCase(), InfoMonkeyLayout.class);
break;
case niko:
this.put(layout.name().toLowerCase(), InfoNikoLayout.class);
break;
case mad_money:
this.put(layout.name().toLowerCase(), MadMoneyLayout.class);
break;
case default_3x3:
default:
this.put("default_3x3", Default_3x3Layout.class);
break;
}
}
}
};
public static final THashMap<String, Class<? extends CatalogPage>> pageDefinitions = new THashMap<>();
public static int catalogItemAmount;
public static int PURCHASE_COOLDOWN = 1;
public static boolean SORT_USING_ORDERNUM = false;
@ -214,7 +82,6 @@ public class CatalogManager {
this.offerDefs = new TIntIntHashMap();
this.vouchers = new ArrayList<>();
this.limitedNumbers = new THashMap<>();
this.initialize();
this.ecotronItem = Emulator.getGameEnvironment().getItemManager().getItem("ecotron_box");
@ -225,7 +92,7 @@ public class CatalogManager {
public synchronized void initialize() {
Emulator.getPluginManager().fireEvent(new EmulatorLoadCatalogManagerEvent());
this.loadPageDefinitions();
this.loadLimitedNumbers();
this.loadCatalogPages();
this.loadCatalogFeaturedPages();
@ -238,6 +105,139 @@ public class CatalogManager {
this.loadGiftWrappers();
}
private synchronized void loadPageDefinitions() {
for (CatalogPageLayouts layout : CatalogPageLayouts.values()) {
switch (layout) {
case frontpage:
pageDefinitions.put(layout.name().toLowerCase(), FrontpageLayout.class);
break;
case badge_display:
pageDefinitions.put(layout.name().toLowerCase(), BadgeDisplayLayout.class);
break;
case spaces_new:
pageDefinitions.put(layout.name().toLowerCase(), SpacesLayout.class);
break;
case trophies:
pageDefinitions.put(layout.name().toLowerCase(), TrophiesLayout.class);
break;
case bots:
pageDefinitions.put(layout.name().toLowerCase(), BotsLayout.class);
break;
case club_buy:
pageDefinitions.put(layout.name().toLowerCase(), ClubBuyLayout.class);
break;
case club_gift:
pageDefinitions.put(layout.name().toLowerCase(), ClubGiftsLayout.class);
break;
case sold_ltd_items:
pageDefinitions.put(layout.name().toLowerCase(), SoldLTDItemsLayout.class);
break;
case single_bundle:
pageDefinitions.put(layout.name().toLowerCase(), SingleBundle.class);
break;
case roomads:
pageDefinitions.put(layout.name().toLowerCase(), RoomAdsLayout.class);
break;
case recycler:
if (Emulator.getConfig().getBoolean("hotel.ecotron.enabled"))
pageDefinitions.put(layout.name().toLowerCase(), RecyclerLayout.class);
break;
case recycler_info:
if (Emulator.getConfig().getBoolean("hotel.ecotron.enabled"))
pageDefinitions.put(layout.name().toLowerCase(), RecyclerInfoLayout.class);
break;
case recycler_prizes:
if (Emulator.getConfig().getBoolean("hotel.ecotron.enabled"))
pageDefinitions.put(layout.name().toLowerCase(), RecyclerPrizesLayout.class);
break;
case marketplace:
if (Emulator.getConfig().getBoolean("hotel.marketplace.enabled"))
pageDefinitions.put(layout.name().toLowerCase(), MarketplaceLayout.class);
break;
case marketplace_own_items:
if (Emulator.getConfig().getBoolean("hotel.marketplace.enabled"))
pageDefinitions.put(layout.name().toLowerCase(), MarketplaceOwnItems.class);
break;
case info_duckets:
pageDefinitions.put(layout.name().toLowerCase(), InfoDucketsLayout.class);
break;
case info_pets:
pageDefinitions.put(layout.name().toLowerCase(), InfoPetsLayout.class);
break;
case info_rentables:
pageDefinitions.put(layout.name().toLowerCase(), InfoRentablesLayout.class);
break;
case info_loyalty:
pageDefinitions.put(layout.name().toLowerCase(), InfoLoyaltyLayout.class);
break;
case loyalty_vip_buy:
pageDefinitions.put(layout.name().toLowerCase(), LoyaltyVipBuyLayout.class);
break;
case guilds:
pageDefinitions.put(layout.name().toLowerCase(), GuildFrontpageLayout.class);
break;
case guild_furni:
pageDefinitions.put(layout.name().toLowerCase(), GuildFurnitureLayout.class);
break;
case guild_forum:
pageDefinitions.put(layout.name().toLowerCase(), GuildForumLayout.class);
break;
case pets:
pageDefinitions.put(layout.name().toLowerCase(), PetsLayout.class);
break;
case pets2:
pageDefinitions.put(layout.name().toLowerCase(), Pets2Layout.class);
break;
case pets3:
pageDefinitions.put(layout.name().toLowerCase(), Pets3Layout.class);
break;
case soundmachine:
pageDefinitions.put(layout.name().toLowerCase(), TraxLayout.class);
break;
case default_3x3_color_grouping:
pageDefinitions.put(layout.name().toLowerCase(), ColorGroupingLayout.class);
break;
case recent_purchases:
pageDefinitions.put(layout.name().toLowerCase(), RecentPurchasesLayout.class);
break;
case room_bundle:
pageDefinitions.put(layout.name().toLowerCase(), RoomBundleLayout.class);
break;
case petcustomization:
pageDefinitions.put(layout.name().toLowerCase(), PetCustomizationLayout.class);
break;
case vip_buy:
pageDefinitions.put(layout.name().toLowerCase(), VipBuyLayout.class);
break;
case frontpage_featured:
pageDefinitions.put(layout.name().toLowerCase(), FrontPageFeaturedLayout.class);
break;
case builders_club_addons:
pageDefinitions.put(layout.name().toLowerCase(), BuildersClubAddonsLayout.class);
break;
case builders_club_frontpage:
pageDefinitions.put(layout.name().toLowerCase(), BuildersClubFrontPageLayout.class);
break;
case builders_club_loyalty:
pageDefinitions.put(layout.name().toLowerCase(), BuildersClubLoyaltyLayout.class);
break;
case monkey:
pageDefinitions.put(layout.name().toLowerCase(), InfoMonkeyLayout.class);
break;
case niko:
pageDefinitions.put(layout.name().toLowerCase(), InfoNikoLayout.class);
break;
case mad_money:
pageDefinitions.put(layout.name().toLowerCase(), MadMoneyLayout.class);
break;
case default_3x3:
default:
pageDefinitions.put("default_3x3", Default_3x3Layout.class);
break;
}
}
}
private synchronized void loadLimitedNumbers() {
this.limitedNumbers.clear();

View File

@ -92,7 +92,7 @@ public class ClubOffer implements ISerialize {
message.appendInt(this.pointsType);
message.appendBoolean(this.vip);
long seconds = this.days * 86400;
long seconds = this.days * 86400L;
long secondsTotal = seconds;
@ -103,7 +103,7 @@ public class ClubOffer implements ISerialize {
seconds -= totalMonths * (86400 * 31);
int totalDays = (int) Math.floor((int) seconds / 86400.0);
seconds -= totalDays * 86400;
seconds -= totalDays * 86400L;
message.appendInt((int) secondsTotal / 86400 / 31);
message.appendInt((int) seconds);

View File

@ -1,7 +1,7 @@
package com.eu.habbo.habbohotel.commands;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.campaign.calendar.CalendarCampaign;
import com.eu.habbo.habbohotel.campaign.CalendarCampaign;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.messages.outgoing.events.calendar.CampaignCalendarDataMessageComposer;
import com.eu.habbo.messages.outgoing.habboway.nux.InClientLinkMessageComposer;

View File

@ -16,37 +16,35 @@ public class PullCommand extends Command {
@Override
public boolean handle(GameClient gameClient, String[] params) throws Exception {
if (params.length == 2) {
Habbo habbo = gameClient.getHabbo().getHabboInfo().getCurrentRoom().getHabbo(params[1]);
if (params.length != 2) return true;
Habbo habbo = gameClient.getHabbo().getHabboInfo().getCurrentRoom().getHabbo(params[1]);
if (habbo == null) {
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_pull.not_found").replace("%user%", params[1]), RoomChatMessageBubbles.ALERT);
return true;
} else if (habbo == gameClient.getHabbo()) {
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_pull.pull_self"), RoomChatMessageBubbles.ALERT);
return true;
} else {
int distanceX = habbo.getRoomUnit().getX() - gameClient.getHabbo().getRoomUnit().getX();
int distanceY = habbo.getRoomUnit().getY() - gameClient.getHabbo().getRoomUnit().getY();
if (distanceX < -2 || distanceX > 2 || distanceY < -2 || distanceY > 2) {
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_pull.cant_reach").replace("%user%", params[1]), RoomChatMessageBubbles.ALERT);
return true;
} else {
RoomTile tile = gameClient.getHabbo().getHabboInfo().getCurrentRoom().getLayout().getTileInFront(gameClient.getHabbo().getRoomUnit().getCurrentLocation(), gameClient.getHabbo().getRoomUnit().getBodyRotation().getValue());
if (tile != null && tile.isWalkable()) {
if (gameClient.getHabbo().getHabboInfo().getCurrentRoom().getLayout().getDoorTile() == tile) {
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_pull.invalid").replace("%username%", params[1]));
return true;
}
habbo.getRoomUnit().setGoalLocation(tile);
gameClient.getHabbo().getHabboInfo().getCurrentRoom().sendComposer(new ChatMessageComposer(new RoomChatMessage(Emulator.getTexts().getValue("commands.succes.cmd_pull.pull").replace("%user%", params[1]).replace("%gender_name%", (gameClient.getHabbo().getHabboInfo().getGender().equals(HabboGender.M) ? Emulator.getTexts().getValue("gender.him") : Emulator.getTexts().getValue("gender.her"))), gameClient.getHabbo(), gameClient.getHabbo(), RoomChatMessageBubbles.NORMAL)).compose());
}
}
}
if (habbo == null) {
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_pull.not_found").replace("%user%", params[1]), RoomChatMessageBubbles.ALERT);
return true;
}
if (habbo == gameClient.getHabbo()) {
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_pull.pull_self"), RoomChatMessageBubbles.ALERT);
return true;
}
int distanceX = habbo.getRoomUnit().getX() - gameClient.getHabbo().getRoomUnit().getX();
int distanceY = habbo.getRoomUnit().getY() - gameClient.getHabbo().getRoomUnit().getY();
if (distanceX < -2 || distanceX > 2 || distanceY < -2 || distanceY > 2) {
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_pull.cant_reach").replace("%user%", params[1]), RoomChatMessageBubbles.ALERT);
return true;
}
RoomTile tile = gameClient.getHabbo().getHabboInfo().getCurrentRoom().getLayout().getTileInFront(gameClient.getHabbo().getRoomUnit().getCurrentLocation(), gameClient.getHabbo().getRoomUnit().getBodyRotation().getValue());
if (tile != null && tile.isWalkable()) {
if (gameClient.getHabbo().getHabboInfo().getCurrentRoom().getLayout().getDoorTile() == tile) {
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_pull.invalid").replace("%username%", params[1]));
return true;
}
habbo.getRoomUnit().setGoalLocation(tile);
gameClient.getHabbo().getHabboInfo().getCurrentRoom().sendComposer(new ChatMessageComposer(new RoomChatMessage(Emulator.getTexts().getValue("commands.succes.cmd_pull.pull").replace("%user%", params[1]).replace("%gender_name%", (gameClient.getHabbo().getHabboInfo().getGender().equals(HabboGender.M) ? Emulator.getTexts().getValue("gender.him") : Emulator.getTexts().getValue("gender.her"))), gameClient.getHabbo(), gameClient.getHabbo(), RoomChatMessageBubbles.NORMAL)).compose());
}
return true;
}

View File

@ -16,39 +16,38 @@ public class PushCommand extends Command {
@Override
public boolean handle(GameClient gameClient, String[] params) throws Exception {
if (params.length == 2) {
Habbo habbo = gameClient.getHabbo().getHabboInfo().getCurrentRoom().getHabbo(params[1]);
if (params.length != 2) return true;
if (habbo == null) {
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_push.not_found").replace("%user%", params[1]), RoomChatMessageBubbles.ALERT);
return true;
} else if (habbo == gameClient.getHabbo()) {
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_push.push_self"), RoomChatMessageBubbles.ALERT);
return true;
} else {
RoomTile tFront = gameClient.getHabbo().getHabboInfo().getCurrentRoom().getLayout().getTileInFront(gameClient.getHabbo().getRoomUnit().getCurrentLocation(), gameClient.getHabbo().getRoomUnit().getBodyRotation().getValue());
Habbo habbo = gameClient.getHabbo().getHabboInfo().getCurrentRoom().getHabbo(params[1]);
if (tFront != null && tFront.isWalkable()) {
if (tFront.x == habbo.getRoomUnit().getX() && tFront.y == habbo.getRoomUnit().getY()) {
RoomTile tFrontTarget = gameClient.getHabbo().getHabboInfo().getCurrentRoom().getLayout().getTileInFront(habbo.getRoomUnit().getCurrentLocation(), gameClient.getHabbo().getRoomUnit().getBodyRotation().getValue());
if (tFrontTarget != null && tFrontTarget.isWalkable()) {
if (gameClient.getHabbo().getHabboInfo().getCurrentRoom().getLayout().getDoorTile() == tFrontTarget) {
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_push.invalid").replace("%username%", params[1]));
return true;
}
habbo.getRoomUnit().setGoalLocation(tFrontTarget);
gameClient.getHabbo().getHabboInfo().getCurrentRoom().sendComposer(new ChatMessageComposer(new RoomChatMessage(Emulator.getTexts().getValue("commands.succes.cmd_push.push").replace("%user%", params[1]).replace("%gender_name%", (gameClient.getHabbo().getHabboInfo().getGender().equals(HabboGender.M) ? Emulator.getTexts().getValue("gender.him") : Emulator.getTexts().getValue("gender.her"))), gameClient.getHabbo(), gameClient.getHabbo(), RoomChatMessageBubbles.NORMAL)).compose());
}
} else {
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_push.cant_reach").replace("%user%", params[1]), RoomChatMessageBubbles.ALERT);
return true;
}
}
}
if (habbo == null) {
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_push.not_found").replace("%user%", params[1]), RoomChatMessageBubbles.ALERT);
return true;
}
if (habbo == gameClient.getHabbo()) {
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_push.push_self"), RoomChatMessageBubbles.ALERT);
return true;
}
RoomTile tFront = gameClient.getHabbo().getHabboInfo().getCurrentRoom().getLayout().getTileInFront(gameClient.getHabbo().getRoomUnit().getCurrentLocation(), gameClient.getHabbo().getRoomUnit().getBodyRotation().getValue());
if (tFront != null && tFront.isWalkable() && tFront.x == habbo.getRoomUnit().getX() && tFront.y == habbo.getRoomUnit().getY()) {
RoomTile tFrontTarget = gameClient.getHabbo().getHabboInfo().getCurrentRoom().getLayout().getTileInFront(habbo.getRoomUnit().getCurrentLocation(), gameClient.getHabbo().getRoomUnit().getBodyRotation().getValue());
if (tFrontTarget != null && tFrontTarget.isWalkable()) {
if (gameClient.getHabbo().getHabboInfo().getCurrentRoom().getLayout().getDoorTile() == tFrontTarget) {
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_push.invalid").replace("%username%", params[1]));
return true;
}
habbo.getRoomUnit().setGoalLocation(tFrontTarget);
gameClient.getHabbo().getHabboInfo().getCurrentRoom().sendComposer(new ChatMessageComposer(new RoomChatMessage(Emulator.getTexts().getValue("commands.succes.cmd_push.push").replace("%user%", params[1]).replace("%gender_name%", (gameClient.getHabbo().getHabboInfo().getGender().equals(HabboGender.M) ? Emulator.getTexts().getValue("gender.him") : Emulator.getTexts().getValue("gender.her"))), gameClient.getHabbo(), gameClient.getHabbo(), RoomChatMessageBubbles.NORMAL)).compose());
}
} else {
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_push.cant_reach").replace("%user%", params[1]), RoomChatMessageBubbles.ALERT);
return true;
}
return true;
}
}

View File

@ -25,7 +25,7 @@ public class ShutdownCommand extends Command {
} else {
if (params.length == 2) {
try {
minutes = Integer.valueOf(params[1]);
minutes = Integer.parseInt(params[1]);
} catch (Exception e) {
reason = new StringBuilder(params[1]);
}
@ -44,7 +44,7 @@ public class ShutdownCommand extends Command {
}
RoomTrade.TRADING_ENABLED = false;
ShutdownEmulator.timestamp = Emulator.getIntUnixTimestamp() + (60 * minutes);
Emulator.getThreading().run(new ShutdownEmulator(message), minutes * 60 * 1000);
Emulator.getThreading().run(new ShutdownEmulator(message), (long) minutes * 60 * 1000);
return true;
}
}

View File

@ -14,12 +14,11 @@ public class SoftKickCommand extends Command {
@Override
public boolean handle(GameClient gameClient, String[] params) throws Exception {
if (params.length == 2) {
final String username = params[1];
final Habbo habbo = gameClient.getHabbo().getHabboInfo().getCurrentRoom().getHabbo(username);
if (params.length != 2) return true;
final Habbo habbo = gameClient.getHabbo().getHabboInfo().getCurrentRoom().getHabbo(params[1]);
if (habbo == null) {
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.keys.cmd_softkick_error").replace("%user%", username), RoomChatMessageBubbles.ALERT);
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.keys.cmd_softkick_error").replace("%user%", params[1]), RoomChatMessageBubbles.ALERT);
return true;
}
@ -30,12 +29,9 @@ public class SoftKickCommand extends Command {
final Room room = gameClient.getHabbo().getHabboInfo().getCurrentRoom();
if (room != null) {
if (!(habbo.hasPermission(Permission.ACC_UNKICKABLE) || habbo.hasPermission(Permission.ACC_SUPPORTTOOL) || room.isOwner(habbo))) {
if (room != null && (!(habbo.hasPermission(Permission.ACC_UNKICKABLE) || habbo.hasPermission(Permission.ACC_SUPPORTTOOL) || room.isOwner(habbo)))) {
room.kickHabbo(habbo, false);
}
}
}
return true;
return true;
}
}

View File

@ -255,7 +255,7 @@ public class FreezeGame extends Game {
scoreboard.setExtradata("0");
}
int oldScore = Integer.valueOf(scoreboard.getExtradata());
int oldScore = Integer.parseInt(scoreboard.getExtradata());
if (oldScore == totalScore)
continue;

View File

@ -38,7 +38,7 @@ public class FreezeGamePlayer extends GamePlayer {
}
@Override
public void addScore(int amount) {
public synchronized void addScore(int amount) {
super.addScore(amount);
if (amount > 0) {
@ -122,10 +122,7 @@ public class FreezeGamePlayer extends GamePlayer {
}
public boolean canGetFrozen() {
if (this.isFrozen() || this.isProtected())
return false;
return true;
return !this.isFrozen() && !this.isProtected();
}
public void addProtection() {

View File

@ -22,7 +22,7 @@ public class GuardianTicket {
private final Habbo reporter;
private final Habbo reported;
private final Date date;
private ArrayList<ModToolChatLog> chatLogs;
private final ArrayList<ModToolChatLog> chatLogs;
private GuardianVoteType verdict;
private int timeLeft = 120;
private int resendCount = 0;
@ -45,7 +45,7 @@ public class GuardianTicket {
this.votes.put(guardian, new GuardianVote(this.guardianCount, guardian));
Emulator.getThreading().run(new GuardianNotAccepted(this, guardian), Emulator.getConfig().getInt("guardians.accept.timer") * 1000);
Emulator.getThreading().run(new GuardianNotAccepted(this, guardian), Emulator.getConfig().getInt("guardians.accept.timer") * 1000L);
}

View File

@ -29,6 +29,11 @@ public class GuardianVote implements Comparable<GuardianVote> {
return false;
}
@Override
public int hashCode() {
return this.id;
}
public void ignore() {
this.ignore = true;
}

View File

@ -185,7 +185,7 @@ public class GuildManager {
}
public void joinGuild(Guild guild, GameClient client, int userId, boolean acceptRequest) {
public boolean joinGuild(Guild guild, GameClient client, int userId, boolean acceptRequest) {
boolean error = false;
try (Connection connection = Emulator.getDatabase().getDataSource().getConnection()) {
try (PreparedStatement statement = connection.prepareStatement("SELECT COUNT(id) as total FROM guilds_members WHERE user_id = ?")) {
@ -282,6 +282,8 @@ public class GuildManager {
} catch (SQLException e) {
LOGGER.error("Caught SQL exception", e);
}
return !error;
}

View File

@ -3,9 +3,9 @@ package com.eu.habbo.habbohotel.guilds;
import java.sql.ResultSet;
import java.sql.SQLException;
public class GuildMember implements Comparable {
private int userId;
private String username;
public class GuildMember implements Comparable<GuildMember> {
private final int userId;
private final String username;
private String look;
private int joinDate;
private GuildRank rank;
@ -59,8 +59,22 @@ public class GuildMember implements Comparable {
}
@Override
public int compareTo(Object o) {
return 0;
public int compareTo(GuildMember o) {
return this.userId - o.userId;
}
@Override
public boolean equals(Object o) {
if (o instanceof GuildMember) {
return ((GuildMember) o).userId == this.userId && ((GuildMember) o).joinDate == this.joinDate && ((GuildMember) o).rank == this.rank;
}
return false;
}
@Override
public int hashCode() {
return this.userId;
}
public GuildMembershipStatus getMembershipStatus() {

View File

@ -123,13 +123,13 @@ public class ForumThread implements Runnable, ISerialize {
THashSet<ForumThread> threads = null;
if (guildThreadsCache.containsKey(guildId)) {
guildThreadsCache.get(guildId);
threads = guildThreadsCache.get(guildId);
}
if (threads != null)
return threads;
threads = new THashSet<ForumThread>();
threads = new THashSet<>();
guildThreadsCache.put(guildId, threads);
@ -141,8 +141,8 @@ public class ForumThread implements Runnable, ISerialize {
"WHERE `id` IN (" +
"SELECT MAX(id) " +
"FROM `guilds_forums_comments` B " +
"GROUP BY `thread_id` " +
"ORDER BY B.`id` ASC " +
"GROUP BY `thread_id` AND B.`id` " +
"ORDER BY B.`id` " +
") " +
"ORDER BY `id` DESC " +
") B ON A.`id` = B.`thread_id` " +
@ -154,9 +154,7 @@ public class ForumThread implements Runnable, ISerialize {
try (ResultSet set = statement.executeQuery()) {
while (set.next()) {
ForumThread thread = new ForumThread(set);
synchronized (threads) {
threads.add(thread);
}
cacheThread(thread);
}
}
@ -182,8 +180,8 @@ public class ForumThread implements Runnable, ISerialize {
"WHERE `id` IN (" +
"SELECT MAX(id) " +
"FROM `guilds_forums_comments` B " +
"GROUP BY `thread_id` " +
"ORDER BY B.`id` ASC " +
"GROUP BY `thread_id` AND b.`id`" +
"ORDER BY B.`id` " +
") " +
"ORDER BY `id` DESC " +
") B ON A.`id` = B.`thread_id` " +
@ -219,10 +217,7 @@ public class ForumThread implements Runnable, ISerialize {
guildThreadsCache.put(thread.guildId, guildThreads);
}
}
synchronized (guildThreads) {
guildThreads.add(thread);
}
}
public static void clearCache() {

View File

@ -15,7 +15,10 @@ import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.URL;
import java.sql.*;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.time.Duration;
import java.util.ArrayList;
import java.util.concurrent.ExecutorService;
@ -118,19 +121,20 @@ public class YoutubeManager {
youtubeDataLoaderPool.shutdown();
try {
youtubeDataLoaderPool.awaitTermination(60, TimeUnit.SECONDS);
if(!youtubeDataLoaderPool.awaitTermination(60, TimeUnit.SECONDS))
LOGGER.error("Youtube Manager -> Failed, timeout elapsed before termination!");
} catch (InterruptedException e) {
e.printStackTrace();
LOGGER.error("Caught Exception", e);
Thread.currentThread().interrupt();
} finally {
LOGGER.info("YouTube Manager -> Loaded! (" + (System.currentTimeMillis() - millis) + " MS)");
}
LOGGER.info("YouTube Manager -> Loaded! (" + (System.currentTimeMillis() - millis) + " MS)");
});
}
public YoutubePlaylist getPlaylistDataById(String playlistId) throws IOException {
if (this.playlistCache.containsKey(playlistId)) return this.playlistCache.get(playlistId);
if(apiKey.isEmpty()) return null;
if (apiKey.isEmpty()) return null;
YoutubePlaylist playlist;
URL playlistInfo = new URL("https://youtube.googleapis.com/youtube/v3/playlists?part=snippet&id=" + playlistId + "&maxResults=1&key=" + apiKey);
HttpsURLConnection playlistCon = (HttpsURLConnection) playlistInfo.openConnection();

View File

@ -10,8 +10,8 @@ import com.eu.habbo.habbohotel.users.Habbo;
import com.eu.habbo.habbohotel.users.HabboInfo;
import com.eu.habbo.habbohotel.users.HabboItem;
import com.eu.habbo.habbohotel.users.HabboManager;
import com.eu.habbo.messages.outgoing.rooms.items.RemoveFloorItemComposer;
import com.eu.habbo.messages.outgoing.rooms.items.ObjectsMessageComposer;
import com.eu.habbo.messages.outgoing.rooms.items.RemoveFloorItemComposer;
import gnu.trove.TCollections;
import gnu.trove.map.TIntObjectMap;
import gnu.trove.map.hash.THashMap;
@ -24,37 +24,29 @@ import java.util.ArrayList;
import java.util.Arrays;
public class InteractionBuildArea extends InteractionCustomValues {
public static THashMap<String, String> defaultValues = new THashMap<String, String>() {
{
this.put("tilesLeft", "0");
}
protected static final THashMap<String, String> defaultValues = new THashMap<String, String>();
{
this.put("tilesRight", "0");
}
{
this.put("tilesFront", "0");
}
{
this.put("tilesBack", "0");
}
{
this.put("builders", "");
}
};
private THashSet<RoomTile> tiles;
private final THashSet<RoomTile> tiles;
public InteractionBuildArea(ResultSet set, Item baseItem) throws SQLException {
super(set, baseItem, defaultValues);
defaultValues.put("tilesLeft", "0");
defaultValues.put("tilesRight", "0");
defaultValues.put("tilesFront", "0");
defaultValues.put("tilesBack", "0");
defaultValues.put("builders", "");
tiles = new THashSet<>();
}
public InteractionBuildArea(int id, int userId, Item item, String extradata, int limitedStack, int limitedSells) {
super(id, userId, item, extradata, limitedStack, limitedSells, defaultValues);
defaultValues.put("tilesLeft", "0");
defaultValues.put("tilesRight", "0");
defaultValues.put("tilesFront", "0");
defaultValues.put("tilesBack", "0");
defaultValues.put("builders", "");
tiles = new THashSet<>();
}
@ -137,7 +129,7 @@ public class InteractionBuildArea extends InteractionCustomValues {
if (!canBuild.isEmpty()) {
for (RoomTile tile : oldTiles) {
THashSet<HabboItem> tileItems = room.getItemsAt(tile);
if(newTiles.contains(tile)) continue;
if (newTiles.contains(tile)) continue;
for (HabboItem tileItem : tileItems) {
if (canBuild.contains(tileItem.getUserId()) && tileItem != this) {
room.pickUpItem(tileItem, null);
@ -223,13 +215,13 @@ public class InteractionBuildArea extends InteractionCustomValues {
// show the effect
Item effectItem = Emulator.getGameEnvironment().getItemManager().getItem("mutearea_sign2");
if(effectItem != null) {
if (effectItem != null) {
TIntObjectMap<String> ownerNames = TCollections.synchronizedMap(new TIntObjectHashMap<>(0));
ownerNames.put(-1, "System");
THashSet<HabboItem> items = new THashSet<>();
int id = 0;
for(RoomTile tile : this.tiles) {
for (RoomTile tile : this.tiles) {
id--;
HabboItem item = new InteractionDefault(id, -1, effectItem, "1", 0, 0);
item.setX(tile.x);
@ -240,14 +232,14 @@ public class InteractionBuildArea extends InteractionCustomValues {
client.sendResponse(new ObjectsMessageComposer(ownerNames, items));
Emulator.getThreading().run(() -> {
for(HabboItem item : items) {
for (HabboItem item : items) {
client.sendResponse(new RemoveFloorItemComposer(item, true));
}
}, 3000);
}
}
public boolean isBuilder(String Username){
public boolean isBuilder(String Username) {
return Arrays.asList(this.values.get("builders").split(";")).contains(Username);
}
}

View File

@ -22,7 +22,8 @@ public class InteractionTrap extends InteractionDefault {
@Override
public void onWalkOn(RoomUnit roomUnit, Room room, Object[] objects) throws Exception {
if (!this.getExtradata().equals("0")) {
if (this.getExtradata().equals("0") || roomUnit == null || room.getHabbo(roomUnit) == null) return;
Habbo habbo = room.getHabbo(roomUnit);
int effect = habbo.getClient().getHabbo().getRoomUnit().getEffectId();
roomUnit.stopWalking();
@ -33,11 +34,9 @@ public class InteractionTrap extends InteractionDefault {
delay = 3000;
}
if (roomUnit != null) {
if (this.getBaseItem().getEffectF() > 0 || this.getBaseItem().getEffectM() > 0) {
if (roomUnit.getRoomUnitType().equals(RoomUnitType.USER)) {
if (habbo != null) {
if (habbo.getHabboInfo().getGender().equals(HabboGender.M) && this.getBaseItem().getEffectM() > 0 && habbo.getRoomUnit().getEffectId() != this.getBaseItem().getEffectM()) {
room.giveEffect(habbo, this.getBaseItem().getEffectM(), -1);
return;
@ -55,11 +54,9 @@ public class InteractionTrap extends InteractionDefault {
roomUnit.setCanWalk(true);
room.giveEffect(roomUnit, effect, -1);
}, delay);
}
}
}
}
}
}
@Override

View File

@ -1,6 +1,5 @@
package com.eu.habbo.habbohotel.items.interactions;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.items.Item;
import com.eu.habbo.habbohotel.rooms.Room;
@ -18,7 +17,7 @@ public class InteractionVoteCounter extends HabboItem {
private boolean frozen;
private int votes;
private List<Integer> votedUsers;
private final List<Integer> votedUsers;
public InteractionVoteCounter(ResultSet set, Item baseItem) throws SQLException {
super(set, baseItem);
@ -69,7 +68,7 @@ public class InteractionVoteCounter extends HabboItem {
@Override
public void onClick(GameClient client, Room room, Object[] objects) throws Exception {
if (!((client != null && room != null && room.hasRights(client.getHabbo())) || (objects.length >= 2 && objects[1] instanceof WiredEffectType)))
if (room == null || !((client != null && room.hasRights(client.getHabbo())) || (objects.length >= 2 && objects[1] instanceof WiredEffectType)))
return;
this.frozen = !this.frozen;

View File

@ -75,6 +75,7 @@ public class InteractionWater extends InteractionDefault {
public void onWalkOn(RoomUnit roomUnit, Room room, Object[] objects) throws Exception {
super.onWalkOn(roomUnit, room, objects);
if(roomUnit == null) return;
roomUnit.isSwimming = true;
Pet pet = room.getPet(roomUnit);

View File

@ -36,7 +36,7 @@ public class InteractionWiredHighscore extends HabboItem {
try {
String name = this.getBaseItem().getName().split("_")[1].toUpperCase().split("\\*")[0];
int ctype = Integer.valueOf(this.getBaseItem().getName().split("\\*")[1]) - 1;
int ctype = Integer.parseInt(this.getBaseItem().getName().split("\\*")[1]) - 1;
this.scoreType = WiredHighscoreScoreType.valueOf(name);
this.clearType = WiredHighscoreClearType.values()[ctype];
} catch (Exception e) {
@ -54,7 +54,7 @@ public class InteractionWiredHighscore extends HabboItem {
try {
String name = this.getBaseItem().getName().split("_")[1].toUpperCase().split("\\*")[0];
int ctype = Integer.valueOf(this.getBaseItem().getName().split("\\*")[1]) - 1;
int ctype = Integer.parseInt(this.getBaseItem().getName().split("\\*")[1]) - 1;
this.scoreType = WiredHighscoreScoreType.valueOf(name);
this.clearType = WiredHighscoreClearType.values()[ctype];
} catch (Exception e) {
@ -81,7 +81,7 @@ public class InteractionWiredHighscore extends HabboItem {
@Override
public void onClick(GameClient client, Room room, Object[] objects) throws Exception {
if (!((client != null && room != null && room.hasRights(client.getHabbo())) || (objects.length >= 2 && objects[1] instanceof WiredEffectType)))
if (room == null || !((client != null && room.hasRights(client.getHabbo())) || (objects.length >= 2 && objects[1] instanceof WiredEffectType)))
return;
if (this.getExtradata() == null || this.getExtradata().isEmpty() || this.getExtradata().length() == 0) {
@ -89,7 +89,7 @@ public class InteractionWiredHighscore extends HabboItem {
}
try {
int state = Integer.valueOf(this.getExtradata());
int state = Integer.parseInt(this.getExtradata());
this.setExtradata(Math.abs(state - 1) + "");
room.updateItem(this);
} catch (Exception e) {

View File

@ -63,8 +63,7 @@ public class InteractionBattleBanzaiPuck extends InteractionPushable {
@Override
public int getNextRollDelay(int currentStep, int totalSteps) {
int t = 2500;
return (totalSteps == 1) ? 500 : 100 * ((t = t / t - 1) * t * t * t * t + 1) + (currentStep * 100);
return (totalSteps == 1) ? 500 : 100 + (currentStep * 100);
}
@Override

View File

@ -167,7 +167,7 @@ public class InteractionFootball extends InteractionPushable {
BigDecimal topItemHeight = BigDecimal.valueOf(topItem.getZ() + topItem.getBaseItem().getHeight());
BigDecimal ballHeight = BigDecimal.valueOf(this.getZ());
if (topItemHeight.subtract(ballHeight).compareTo(new BigDecimal(1.65)) > 0) {
if (topItemHeight.subtract(ballHeight).compareTo(BigDecimal.valueOf(1.65)) > 0) {
return false;
}

View File

@ -71,7 +71,7 @@ public class InteractionPetToy extends InteractionDefault {
pet.getRoomUnit().clearStatus();
new PetClearPosture(pet, RoomUnitStatus.PLAY, null, true).run();
pet.packetUpdate = true;
}, 2500 + (Emulator.getRandom().nextInt(20) * 500));
}, ((long)(Emulator.getRandom().nextInt(20) * 500) + 2500));
this.setExtradata("1");
room.updateItemState(this);
}

View File

@ -1,14 +1,10 @@
package com.eu.habbo.habbohotel.items.interactions.pets;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.bots.Bot;
import com.eu.habbo.habbohotel.items.Item;
import com.eu.habbo.habbohotel.items.interactions.InteractionDefault;
import com.eu.habbo.habbohotel.pets.Pet;
import com.eu.habbo.habbohotel.pets.PetTasks;
import com.eu.habbo.habbohotel.rooms.*;
import com.eu.habbo.habbohotel.users.Habbo;
import com.eu.habbo.habbohotel.users.HabboItem;
import com.eu.habbo.threading.runnables.PetClearPosture;
import java.sql.ResultSet;
@ -69,7 +65,7 @@ public class InteractionPetTree extends InteractionDefault {
}
pet.getRoomUnit().setCanWalk(true);
pet.packetUpdate = true;
}, 2500 + (Emulator.getRandom().nextInt(20) * 500));
}, (long) 2500 + (Emulator.getRandom().nextInt(20) * 500));
} else {
pet.getRoomUnit().setRotation(RoomUserRotation.values()[this.getRotation()]);
pet.getRoomUnit().clearStatus();

View File

@ -51,7 +51,7 @@ public class InteractionTotemLegs extends InteractionDefault {
public void onClick(GameClient client, Room room, Object[] objects) throws Exception {
super.onClick(client, room, objects);
if (!((client != null && room != null && room.hasRights(client.getHabbo())) || (objects.length >= 2 && objects[1] instanceof WiredEffectType)))
if (room == null || !((client != null && room.hasRights(client.getHabbo())) || (objects.length >= 2 && objects[1] instanceof WiredEffectType)))
return;
updateHead(room, room.getLayout().getTile(this.getX(), this.getY()));

View File

@ -56,7 +56,7 @@ public class WiredEffectBotTeleport extends InteractionWiredEffect {
roomUnit.getRoom().unIdle(roomUnit.getRoom().getHabbo(roomUnit));
room.sendComposer(new AvatarEffectMessageComposer(roomUnit, 4).compose());
Emulator.getThreading().run(new SendRoomUnitEffectComposer(room, roomUnit), WiredHandler.TELEPORT_DELAY + 1000);
Emulator.getThreading().run(new SendRoomUnitEffectComposer(room, roomUnit), (long) WiredHandler.TELEPORT_DELAY + 1000);
if (tile == roomUnit.getCurrentLocation()) {
return;
@ -218,14 +218,14 @@ public class WiredEffectBotTeleport extends InteractionWiredEffect {
String[] wiredDataSplit = set.getString("wired_data").split("\t");
if (wiredDataSplit.length >= 2) {
this.setDelay(Integer.valueOf(wiredDataSplit[0]));
this.setDelay(Integer.parseInt(wiredDataSplit[0]));
String[] data = wiredDataSplit[1].split(";");
if (data.length > 1) {
this.botName = data[0];
for (int i = 1; i < data.length; i++) {
HabboItem item = room.getHabboItem(Integer.valueOf(data[i]));
HabboItem item = room.getHabboItem(Integer.parseInt(data[i]));
if (item != null)
this.items.add(item);

View File

@ -57,7 +57,7 @@ public class WiredEffectTeleport extends InteractionWiredEffect {
roomUnit.getRoom().unIdle(roomUnit.getRoom().getHabbo(roomUnit));
room.sendComposer(new AvatarEffectMessageComposer(roomUnit, 4).compose());
Emulator.getThreading().run(new SendRoomUnitEffectComposer(room, roomUnit), WiredHandler.TELEPORT_DELAY + 1000);
Emulator.getThreading().run(new SendRoomUnitEffectComposer(room, roomUnit), (long) WiredHandler.TELEPORT_DELAY + 1000);
if (tile == roomUnit.getCurrentLocation()) {
return;
@ -111,14 +111,11 @@ public class WiredEffectTeleport extends InteractionWiredEffect {
message.appendInt(this.getDelay());
if (this.requiresTriggeringUser()) {
List<Integer> invalidTriggers = new ArrayList<>();
room.getRoomSpecialTypes().getTriggers(this.getX(), this.getY()).forEach(new TObjectProcedure<InteractionWiredTrigger>() {
@Override
public boolean execute(InteractionWiredTrigger object) {
if (!object.isTriggeredByRoomUnit()) {
invalidTriggers.add(object.getId());
}
return true;
room.getRoomSpecialTypes().getTriggers(this.getX(), this.getY()).forEach(object -> {
if (!object.isTriggeredByRoomUnit()) {
invalidTriggers.add(object.getId());
}
return true;
});
message.appendInt(invalidTriggers.size());
for (Integer i : invalidTriggers) {

View File

@ -15,6 +15,7 @@ import gnu.trove.map.hash.TIntIntHashMap;
import gnu.trove.map.hash.TIntObjectHashMap;
import gnu.trove.procedure.TIntObjectProcedure;
import gnu.trove.set.hash.THashSet;
import org.apache.commons.lang3.EnumUtils;
import org.apache.commons.math3.distribution.NormalDistribution;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -142,7 +143,7 @@ public class PetManager {
}
public static NormalDistribution getNormalDistributionForBreeding(int levelOne, int levelTwo) {
return getNormalDistributionForBreeding((levelOne + levelTwo) / 2);
return getNormalDistributionForBreeding( (levelOne + levelTwo) / 2.0);
}
public static NormalDistribution getNormalDistributionForBreeding(double avgLevel) {
@ -236,7 +237,7 @@ public class PetManager {
while (set.next()) {
if (set.getInt("pet_id") >= 0) {
if (this.petData.containsKey(set.getInt("pet_id"))) {
PetVocalsType petVocalsType = PetVocalsType.valueOf(set.getString("type").toUpperCase());
PetVocalsType petVocalsType = EnumUtils.getEnum(PetVocalsType.class, set.getString("type").toUpperCase());;
if (petVocalsType != null) {
this.petData.get(set.getInt("pet_id")).petVocals.get(petVocalsType).add(new PetVocal(set.getString("message")));
@ -315,7 +316,7 @@ public class PetManager {
}
try {
int petId = Integer.valueOf(petName.split("t")[1]);
int petId = Integer.parseInt(petName.split("t")[1]);
return this.petRaces.get(petId);
} catch (Exception e) {
LOGGER.error("Caught exception", e);
@ -333,18 +334,15 @@ public class PetManager {
TIntObjectHashMap<ArrayList<PetBreedingReward>> offspringList = this.breedingReward.get(pet.getPetData().getType());
offspringList.forEachEntry(new TIntObjectProcedure<ArrayList<PetBreedingReward>>() {
@Override
public boolean execute(int i, ArrayList<PetBreedingReward> petBreedingRewards) {
for (PetBreedingReward reward : petBreedingRewards) {
if (reward.breed == pet.getRace()) {
rarityLevel[0] = i;
return false;
}
offspringList.forEachEntry((i, petBreedingRewards) -> {
for (PetBreedingReward reward : petBreedingRewards) {
if (reward.breed == pet.getRace()) {
rarityLevel[0] = i;
return false;
}
return true;
}
return true;
});
return 4 - rarityLevel[0];
@ -399,17 +397,17 @@ public class PetManager {
}
public Pet createPet(Item item, String name, String race, String color, GameClient client) {
int type = Integer.valueOf(item.getName().toLowerCase().replace("a0 pet", ""));
int type = Integer.parseInt(item.getName().toLowerCase().replace("a0 pet", ""));
if (this.petData.containsKey(type)) {
Pet pet;
if (type == 15)
pet = new HorsePet(type, Integer.valueOf(race), color, name, client.getHabbo().getHabboInfo().getId());
pet = new HorsePet(type, Integer.parseInt(race), color, name, client.getHabbo().getHabboInfo().getId());
else if (type == 16)
pet = this.createMonsterplant(null, client.getHabbo(), false, null, 0);
else
pet = new Pet(type,
Integer.valueOf(race),
Integer.parseInt(race),
color,
name,
client.getHabbo().getHabboInfo().getId()

View File

@ -36,6 +36,6 @@ public class ActionDown extends PetAction {
return true;
}
return true;
return false;
}
}

View File

@ -20,7 +20,7 @@ public class ActionJump extends PetAction {
@Override
public boolean apply(Pet pet, Habbo habbo, String[] data) {
if(pet.findPetItem(PetTasks.JUMP, InteractionPetTrampoline.class)) return true;
if(pet.findPetItem(PetTasks.JUMP, InteractionPetTrampoline.class)) return false;
pet.clearPosture();
pet.setTask(PetTasks.JUMP);

View File

@ -33,13 +33,13 @@ import com.eu.habbo.habbohotel.wired.WiredTriggerType;
import com.eu.habbo.messages.ISerialize;
import com.eu.habbo.messages.ServerMessage;
import com.eu.habbo.messages.outgoing.MessageComposer;
import com.eu.habbo.messages.outgoing.generic.alerts.HabboBroadcastMessageComposer;
import com.eu.habbo.messages.outgoing.generic.alerts.GenericErrorComposer;
import com.eu.habbo.messages.outgoing.generic.alerts.HabboBroadcastMessageComposer;
import com.eu.habbo.messages.outgoing.guilds.HabboGroupDetailsMessageComposer;
import com.eu.habbo.messages.outgoing.hotelview.CloseConnectionMessageComposer;
import com.eu.habbo.messages.outgoing.inventory.UnseenItemsComposer;
import com.eu.habbo.messages.outgoing.inventory.PetAddedToInventoryComposer;
import com.eu.habbo.messages.outgoing.inventory.FurniListInvalidateComposer;
import com.eu.habbo.messages.outgoing.inventory.PetAddedToInventoryComposer;
import com.eu.habbo.messages.outgoing.inventory.UnseenItemsComposer;
import com.eu.habbo.messages.outgoing.polls.infobus.QuestionAnsweredComposer;
import com.eu.habbo.messages.outgoing.polls.infobus.QuestionComposer;
import com.eu.habbo.messages.outgoing.rooms.*;
@ -2589,7 +2589,7 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
} else if (item instanceof InteractionSnowboardSlope) {
this.roomSpecialTypes.removeUndefined(item);
} else if (item instanceof InteractionBuildArea) {
this.roomSpecialTypes.removeUndefined(item);
this.roomSpecialTypes.removeUndefined(item);
}
}
}
@ -4168,7 +4168,7 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
}
public void giveEffect(RoomUnit roomUnit, int effectId, int duration) {
if (roomUnit == null) return;
if (roomUnit == null || roomUnit.getRoom() == null) return;
Habbo habbo = roomUnit.getRoom().getHabbo(roomUnit);
@ -4567,8 +4567,8 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
THashSet<RoomTile> occupiedTiles = this.layout.getTilesAt(tile, item.getBaseItem().getWidth(), item.getBaseItem().getLength(), rotation);
for (RoomTile t : occupiedTiles) {
if(t.state == RoomTileState.INVALID) return FurnitureMovementError.INVALID_MOVE;
if(!Emulator.getConfig().getBoolean("wired.place.under", false) || (Emulator.getConfig().getBoolean("wired.place.under", false) && !item.isWalkable() && !item.getBaseItem().allowSit() && !item.getBaseItem().allowLay())) {
if (t.state == RoomTileState.INVALID) return FurnitureMovementError.INVALID_MOVE;
if (!Emulator.getConfig().getBoolean("wired.place.under", false) || (Emulator.getConfig().getBoolean("wired.place.under", false) && !item.isWalkable() && !item.getBaseItem().allowSit() && !item.getBaseItem().allowLay())) {
if (checkForUnits && this.hasHabbosAt(t.x, t.y)) return FurnitureMovementError.TILE_HAS_HABBOS;
if (checkForUnits && this.hasBotsAt(t.x, t.y)) return FurnitureMovementError.TILE_HAS_BOTS;
if (checkForUnits && this.hasPetsAt(t.x, t.y)) return FurnitureMovementError.TILE_HAS_PETS;
@ -4718,10 +4718,12 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
if (oldLocation != tile) {
for (RoomTile t : occupiedTiles) {
HabboItem tileTopItem = this.getTopItemAt(t.x, t.y);
if ((!magicTile && ((tileTopItem != null && tileTopItem != item ? (t.state.equals(RoomTileState.INVALID) || !t.getAllowStack() || !tileTopItem.getBaseItem().allowStack() || (tileTopItem.getBaseItem().getInteractionType().getType() == InteractionWater.class && item.getBaseItem().getInteractionType().getType() == InteractionWater.class || item.getBaseItem().getInteractionType().getType() != InteractionWaterItem.class)) : this.calculateTileState(t, item).equals(RoomTileState.INVALID))) || stackHelper.isPresent() && item.getBaseItem().getInteractionType().getType() == InteractionWater.class))
if (!magicTile && (tileTopItem != null && tileTopItem != item ? (t.state.equals(RoomTileState.INVALID) || !t.getAllowStack() || !tileTopItem.getBaseItem().allowStack() ||
(tileTopItem.getBaseItem().getInteractionType().getType() == InteractionWater.class && (item.getBaseItem().getInteractionType().getType() != InteractionWaterItem.class || item.getBaseItem().getInteractionType().getType() == InteractionWater.class))) : this.calculateTileState(t, item).equals(RoomTileState.INVALID)) || stackHelper.isPresent() && item.getBaseItem().getInteractionType().getType() == InteractionWater.class) {
return FurnitureMovementError.CANT_STACK;
}
if(!Emulator.getConfig().getBoolean("wired.place.under", false) || (Emulator.getConfig().getBoolean("wired.place.under", false) && !item.isWalkable() && !item.getBaseItem().allowSit())) {
if (!Emulator.getConfig().getBoolean("wired.place.under", false) || (Emulator.getConfig().getBoolean("wired.place.under", false) && !item.isWalkable() && !item.getBaseItem().allowSit())) {
if (checkForUnits) {
if (!magicTile && this.hasHabbosAt(t.x, t.y)) return FurnitureMovementError.TILE_HAS_HABBOS;
if (!magicTile && this.hasBotsAt(t.x, t.y)) return FurnitureMovementError.TILE_HAS_BOTS;
@ -4782,8 +4784,9 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
}
}
if(height > MAXIMUM_FURNI_HEIGHT) return FurnitureMovementError.CANT_STACK;
if(height < this.getLayout().getHeightAtSquare(tile.x, tile.y)) return FurnitureMovementError.CANT_STACK; //prevent furni going under the floor
if (height > MAXIMUM_FURNI_HEIGHT) return FurnitureMovementError.CANT_STACK;
if (height < this.getLayout().getHeightAtSquare(tile.x, tile.y))
return FurnitureMovementError.CANT_STACK; //prevent furni going under the floor
if (Emulator.getPluginManager().isRegistered(FurnitureBuildheightEvent.class, true)) {
FurnitureBuildheightEvent event = Emulator.getPluginManager().fireEvent(new FurnitureBuildheightEvent(item, actor, 0.00, height));
@ -4792,8 +4795,9 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
}
}
if(height > MAXIMUM_FURNI_HEIGHT) return FurnitureMovementError.CANT_STACK;
if(height < this.getLayout().getHeightAtSquare(tile.x, tile.y)) return FurnitureMovementError.CANT_STACK; //prevent furni going under the floor
if (height > MAXIMUM_FURNI_HEIGHT) return FurnitureMovementError.CANT_STACK;
if (height < this.getLayout().getHeightAtSquare(tile.x, tile.y))
return FurnitureMovementError.CANT_STACK; //prevent furni going under the floor
item.setX(tile.x);
item.setY(tile.y);

View File

@ -39,7 +39,7 @@ public class RoomChatMessage implements Runnable, ISerialize, DatabaseLoggable {
private byte emotion;
public RoomChatMessage(MessageHandler message) {
if (message.packet.getMessageId() == Incoming.WhisperEvent) {
if (message.packet.getMessageId() == Incoming.whisperEvent) {
String data = message.packet.readString();
this.targetHabbo = message.client.getHabbo().getHabboInfo().getCurrentRoom().getHabbo(data.split(" ")[0]);
this.message = data.substring(data.split(" ")[0].length() + 1);

View File

@ -952,7 +952,7 @@ public class RoomManager {
habbo.getRoomUnit().isKicked = false;
if (room.getOwnerId() != habbo.getHabboInfo().getId()) {
AchievementManager.progressAchievement(room.getOwnerId(), Emulator.getGameEnvironment().getAchievementManager().getAchievement("RoomDecoHosting"), (int) Math.floor((Emulator.getIntUnixTimestamp() - habbo.getHabboStats().roomEnterTimestamp) / 60000));
AchievementManager.progressAchievement(room.getOwnerId(), Emulator.getGameEnvironment().getAchievementManager().getAchievement("RoomDecoHosting"), (int) Math.floor((Emulator.getIntUnixTimestamp() - habbo.getHabboStats().roomEnterTimestamp) / 60000.0));
}
habbo.getMessenger().connectionChanged(habbo, habbo.isOnline(), false);
@ -1220,7 +1220,7 @@ public class RoomManager {
public ArrayList<Room> getRoomsVisited(Habbo habbo, boolean includeSelf, int limit) {
ArrayList<Room> rooms = new ArrayList<>();
try (Connection connection = Emulator.getDatabase().getDataSource().getConnection(); PreparedStatement statement = connection.prepareStatement("SELECT rooms.* FROM room_enter_log INNER JOIN rooms ON room_enter_log.room_id = rooms.id WHERE user_id = ? AND timestamp >= ? AND rooms.owner_id != ? GROUP BY rooms.id ORDER BY timestamp DESC LIMIT " + limit)) {
try (Connection connection = Emulator.getDatabase().getDataSource().getConnection(); PreparedStatement statement = connection.prepareStatement("SELECT rooms.* FROM room_enter_log INNER JOIN rooms ON room_enter_log.room_id = rooms.id WHERE user_id = ? AND timestamp >= ? AND rooms.owner_id != ? GROUP BY rooms.id AND timestamp ORDER BY timestamp DESC LIMIT " + limit)) {
statement.setInt(1, habbo.getHabboInfo().getId());
statement.setInt(2, Emulator.getIntUnixTimestamp() - 259200);
statement.setInt(3, (includeSelf ? 0 : habbo.getHabboInfo().getId()));
@ -1289,7 +1289,7 @@ public class RoomManager {
Collections.sort(rooms);
return rooms.subList(0, (rooms.size() > limit ? limit : rooms.size()));
return rooms.subList(0, (Math.min(rooms.size(), limit)));
}
public ArrayList<Room> getRoomsWithRights(Habbo habbo) {

View File

@ -630,11 +630,7 @@ public class RoomSpecialTypes {
}
public InteractionFreezeExitTile getFreezeExitTile() {
for (InteractionFreezeExitTile t : this.freezeExitTile.values()) {
return t;
}
return null;
return this.freezeExitTile.values().stream().findFirst().orElse(null);
}
public InteractionFreezeExitTile getRandomFreezeExitTile() {

View File

@ -115,8 +115,8 @@ public class RoomTile {
}
public double distance(RoomTile roomTile) {
double x = this.x - roomTile.x;
double y = this.y - roomTile.y;
double x = (double) this.x - roomTile.x;
double y = (double) this.y - roomTile.y;
return Math.sqrt(x * x + y * y);
}
@ -186,7 +186,7 @@ public class RoomTile {
public List<RoomUnit> getUnits() {
synchronized (this.units) {
return new ArrayList<RoomUnit>(this.units);
return new ArrayList<>(this.units);
}
}

View File

@ -422,7 +422,7 @@ public class RoomUnit {
}
}
public boolean isInRoom() {
public synchronized boolean isInRoom() {
return this.inRoom;
}
@ -430,7 +430,7 @@ public class RoomUnit {
this.inRoom = inRoom;
}
public RoomUnitType getRoomUnitType() {
public synchronized RoomUnitType getRoomUnitType() {
return this.roomUnitType;
}
@ -459,7 +459,7 @@ public class RoomUnit {
this.headRotation = headRotation;
}
public DanceType getDanceType() {
public synchronized DanceType getDanceType() {
return this.danceType;
}

View File

@ -11,12 +11,12 @@ import com.eu.habbo.habbohotel.users.Habbo;
import com.eu.habbo.habbohotel.users.HabboItem;
import com.eu.habbo.messages.ServerMessage;
import com.eu.habbo.messages.outgoing.generic.alerts.NotificationDialogMessageComposer;
import com.eu.habbo.messages.outgoing.inventory.UnseenItemsComposer;
import com.eu.habbo.messages.outgoing.inventory.FurniListInvalidateComposer;
import com.eu.habbo.messages.outgoing.inventory.FurniListRemoveComposer;
import com.eu.habbo.messages.outgoing.rooms.items.jukebox.UserSongDisksInventoryMessageComposer;
import com.eu.habbo.messages.outgoing.rooms.items.jukebox.NowPlayingMessageComposer;
import com.eu.habbo.messages.outgoing.inventory.UnseenItemsComposer;
import com.eu.habbo.messages.outgoing.rooms.items.jukebox.JukeboxSongDisksMessageComposer;
import com.eu.habbo.messages.outgoing.rooms.items.jukebox.NowPlayingMessageComposer;
import com.eu.habbo.messages.outgoing.rooms.items.jukebox.UserSongDisksInventoryMessageComposer;
import gnu.trove.map.hash.THashMap;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -55,13 +55,11 @@ public class TraxManager implements Disposable {
if (this.jukeBox == null) {
//Check again if there's a jukebox on room but has not been saved on DB before
for (HabboItem item : room.getRoomSpecialTypes().getItemsOfType(InteractionJukeBox.class))
{
for (HabboItem item : room.getRoomSpecialTypes().getItemsOfType(InteractionJukeBox.class)) {
this.jukeBox = (InteractionJukeBox) item;
}
if(this.jukeBox != null)
{
if (this.jukeBox != null) {
this.loadPlaylist();
this.songsLimit = this.getSongsLimit(this.jukeBox);
}
@ -77,7 +75,7 @@ public class TraxManager implements Disposable {
try (ResultSet set = statement.executeQuery()) {
if (set.next()) {
HabboItem jukebox = Emulator.getGameEnvironment().getItemManager().loadHabboItem(set.getInt("trax_item_id"));
if(jukebox != null) {
if (jukebox != null) {
if (!(jukebox instanceof InteractionJukeBox)) {
return null;
} else {
@ -94,7 +92,7 @@ public class TraxManager implements Disposable {
}
public void loadPlaylist() {
if(this.jukeBox == null) return;
if (this.jukeBox == null) return;
this.songs.clear();
@ -103,8 +101,8 @@ public class TraxManager implements Disposable {
try (ResultSet set = statement.executeQuery()) {
while (set.next()) {
HabboItem musicDisc = Emulator.getGameEnvironment().getItemManager().loadHabboItem(set.getInt("item_id"));
if(musicDisc != null) {
if (!(musicDisc instanceof InteractionMusicDisc) || musicDisc.getRoomId() != -1) {
if (musicDisc != null) {
if (!(musicDisc instanceof InteractionMusicDisc) || musicDisc.getRoomId() != -1) {
deleteSongFromPlaylist(this.jukeBox.getId(), musicDisc.getId());
} else {
SoundTrack track = Emulator.getGameEnvironment().getItemManager().getSoundTrack(((InteractionMusicDisc) musicDisc).getSongId());
@ -123,9 +121,8 @@ public class TraxManager implements Disposable {
}
}
public static void deleteSongFromPlaylist(int jukebox_id, int song_id)
{
try (Connection connection = Emulator.getDatabase().getDataSource().getConnection(); PreparedStatement statement = connection.prepareStatement("DELETE FROM trax_playlist WHERE trax_item_id = ? AND item_id = ? LIMIT 1")) {
public static void deleteSongFromPlaylist(int jukebox_id, int song_id) {
try (Connection connection = Emulator.getDatabase().getDataSource().getConnection(); PreparedStatement statement = connection.prepareStatement("DELETE FROM trax_playlist WHERE trax_item_id = ? AND item_id = ? LIMIT 1")) {
statement.setInt(1, jukebox_id);
statement.setInt(2, song_id);
statement.execute();
@ -135,15 +132,13 @@ public class TraxManager implements Disposable {
}
public void addTraxOnRoom(InteractionJukeBox jukeBox) {
if(this.jukeBox != null) return;
if (this.jukeBox != null) return;
try (Connection connection = Emulator.getDatabase().getDataSource().getConnection(); PreparedStatement statement_1 = connection.prepareStatement("INSERT INTO room_trax (room_id, trax_item_id) VALUES (?, ?)"))
{
try (Connection connection = Emulator.getDatabase().getDataSource().getConnection(); PreparedStatement statement_1 = connection.prepareStatement("INSERT INTO room_trax (room_id, trax_item_id) VALUES (?, ?)")) {
statement_1.setInt(1, this.room.getId());
statement_1.setInt(2, jukeBox.getId());
statement_1.execute();
}
catch (SQLException e) {
} catch (SQLException e) {
LOGGER.error("Caught SQL exception", e);
return;
}
@ -154,14 +149,12 @@ public class TraxManager implements Disposable {
}
public void removeTraxOnRoom(InteractionJukeBox jukeBox) {
if(this.jukeBox.getId() != jukeBox.getId()) return;
if (this.jukeBox.getId() != jukeBox.getId()) return;
try (Connection connection = Emulator.getDatabase().getDataSource().getConnection(); PreparedStatement statement_1 = connection.prepareStatement("DELETE FROM room_trax WHERE room_id = ?"))
{
try (Connection connection = Emulator.getDatabase().getDataSource().getConnection(); PreparedStatement statement_1 = connection.prepareStatement("DELETE FROM room_trax WHERE room_id = ?")) {
statement_1.setInt(1, this.room.getId());
statement_1.execute();
}
catch (SQLException e) {
} catch (SQLException e) {
LOGGER.error("Caught SQL exception", e);
return;
}
@ -208,9 +201,10 @@ public class TraxManager implements Disposable {
this.starter = starter;
this.cycleStartedTimestamp = Emulator.getIntUnixTimestamp();
}
}
this.room.sendComposer(new NowPlayingMessageComposer(Emulator.getGameEnvironment().getItemManager().getSoundTrack(this.currentlyPlaying.getSongId()), this.playingIndex, 0).compose());
this.room.sendComposer(new NowPlayingMessageComposer(Emulator.getGameEnvironment().getItemManager().getSoundTrack(this.currentlyPlaying.getSongId()), this.playingIndex, 0).compose());
}
} else {
this.stop();
}
@ -242,10 +236,9 @@ public class TraxManager implements Disposable {
}
public void addSong(InteractionMusicDisc musicDisc, Habbo habbo) {
if(this.jukeBox == null) return;
if (this.jukeBox == null) return;
if(this.songsLimit < this.songs.size() + 1)
{
if (this.songsLimit < this.songs.size() + 1) {
THashMap<String, String> codes = new THashMap<>();
ServerMessage msg = new NotificationDialogMessageComposer("${playlist.editor.alert.playlist.full.title}", "${playlist.editor.alert.playlist.full}").compose();
habbo.getClient().sendResponse(msg);
@ -254,8 +247,7 @@ public class TraxManager implements Disposable {
SoundTrack track = Emulator.getGameEnvironment().getItemManager().getSoundTrack(musicDisc.getSongId());
if (track != null)
{
if (track != null) {
this.totalLength += track.getLength();
this.songs.add(musicDisc);
@ -282,7 +274,7 @@ public class TraxManager implements Disposable {
}
public void removeSong(int itemId) {
if(this.songs.isEmpty()) return;
if (this.songs.isEmpty()) return;
InteractionMusicDisc musicDisc = this.getSong(itemId);
@ -318,8 +310,7 @@ public class TraxManager implements Disposable {
this.sendUpdatedSongList();
}
public static void removeAllSongs(InteractionJukeBox jukebox)
{
public static void removeAllSongs(InteractionJukeBox jukebox) {
try (Connection connection = Emulator.getDatabase().getDataSource().getConnection(); PreparedStatement statement = connection.prepareStatement("SELECT * FROM trax_playlist WHERE trax_item_id = ?")) {
statement.setInt(1, jukebox.getId());
try (ResultSet set = statement.executeQuery()) {
@ -327,7 +318,7 @@ public class TraxManager implements Disposable {
HabboItem musicDisc = Emulator.getGameEnvironment().getItemManager().loadHabboItem(set.getInt("item_id"));
deleteSongFromPlaylist(jukebox.getId(), set.getInt("item_id"));
if(musicDisc != null) {
if (musicDisc != null) {
if (musicDisc instanceof InteractionMusicDisc && musicDisc.getRoomId() == -1) {
musicDisc.setRoomId(0);
musicDisc.needsUpdate(true);

View File

@ -451,6 +451,7 @@ public class HabboInfo implements Runnable {
roomUnit.setZ(riding.getRoomUnit().getZ());
roomUnit.setPreviousLocationZ(riding.getRoomUnit().getZ());
roomUnit.stopWalking();
if (room != null)
room.sendComposer(new UserUpdateComposer(roomUnit).compose());
List<RoomTile> availableTiles = isRemoving ? new ArrayList<>() : this.getCurrentRoom().getLayout().getWalkableTilesAround(roomUnit.getCurrentLocation());

View File

@ -1,7 +1,7 @@
package com.eu.habbo.habbohotel.users;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.campaign.calendar.CalendarRewardClaimed;
import com.eu.habbo.habbohotel.campaign.CalendarRewardClaimed;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.achievements.Achievement;
import com.eu.habbo.habbohotel.achievements.AchievementManager;
@ -421,12 +421,7 @@ public class HabboStats implements Runnable {
}
public boolean hasGuild(int guildId) {
for (int i : this.guilds) {
if (i == guildId)
return true;
}
return false;
return this.guilds.contains(guildId);
}
public int getAchievementScore() {

View File

@ -7,6 +7,7 @@ import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;
import javax.xml.XMLConstants;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
@ -36,6 +37,8 @@ public class Figuredata {
*/
public void parseXML(String uri) throws Exception, ParserConfigurationException, IOException, SAXException {
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
factory.setFeature("http://xml.org/sax/features/external-general-entities", false);
factory.setFeature("http://xml.org/sax/features/external-parameter-entities", false);
factory.setValidating(false);
factory.setIgnoringElementContentWhitespace(true);
DocumentBuilder builder = factory.newDocumentBuilder();
@ -45,7 +48,10 @@ public class Figuredata {
if(!rootElement.getTagName().equalsIgnoreCase("figuredata") || document.getElementsByTagName("colors") == null || document.getElementsByTagName("sets") == null) {
StringWriter writer = new StringWriter();
TransformerFactory.newInstance().newTransformer().transform(new DOMSource(document), new StreamResult(writer));
TransformerFactory transformerFactory = javax.xml.transform.TransformerFactory.newInstance();
transformerFactory.setAttribute(XMLConstants.ACCESS_EXTERNAL_DTD, "");
transformerFactory.setAttribute(XMLConstants.ACCESS_EXTERNAL_STYLESHEET, "");
transformerFactory.newTransformer().transform(new DOMSource(document), new StreamResult(writer));
String documentString = writer.getBuffer().toString();
throw new Exception("The passed file is not in figuredata format. Received " + documentString.substring(0, Math.min(documentString.length(), 200)));
}

View File

@ -72,7 +72,7 @@ public class WiredHandler {
return false;
long millis = System.currentTimeMillis();
THashSet<InteractionWiredEffect> effectsToExecute = new THashSet<InteractionWiredEffect>();
THashSet<InteractionWiredEffect> effectsToExecute = new THashSet<>();
List<RoomTile> triggeredTiles = new ArrayList<>();
for (InteractionWiredTrigger trigger : triggers) {
@ -81,7 +81,7 @@ public class WiredHandler {
if (triggeredTiles.contains(tile))
continue;
THashSet<InteractionWiredEffect> tEffectsToExecute = new THashSet<InteractionWiredEffect>();
THashSet<InteractionWiredEffect> tEffectsToExecute = new THashSet<>();
if (handle(trigger, roomUnit, room, stuff, tEffectsToExecute)) {
effectsToExecute.addAll(tEffectsToExecute);
@ -244,7 +244,7 @@ public class WiredHandler {
effect.activateBox(room, roomUnit, millis);
}
}, effect.getDelay() * 500);
}, effect.getDelay() * 500L);
}
}
@ -327,23 +327,23 @@ public class WiredHandler {
return;
if (rewardReceived.type.equalsIgnoreCase("credits")) {
int credits = Integer.valueOf(rewardReceived.value);
int credits = Integer.parseInt(rewardReceived.value);
habbo.giveCredits(credits);
} else if (rewardReceived.type.equalsIgnoreCase("pixels")) {
int pixels = Integer.valueOf(rewardReceived.value);
int pixels = Integer.parseInt(rewardReceived.value);
habbo.givePixels(pixels);
} else if (rewardReceived.type.startsWith("points")) {
int points = Integer.valueOf(rewardReceived.value);
int points = Integer.parseInt(rewardReceived.value);
int type = 5;
try {
type = Integer.valueOf(rewardReceived.type.replace("points", ""));
} catch (Exception e) {
type = Integer.parseInt(rewardReceived.type.replace("points", ""));
} catch (Exception ignored) {
}
habbo.givePoints(type, points);
} else if (rewardReceived.type.equalsIgnoreCase("furni")) {
Item baseItem = Emulator.getGameEnvironment().getItemManager().getItem(Integer.valueOf(rewardReceived.value));
Item baseItem = Emulator.getGameEnvironment().getItemManager().getItem(Integer.parseInt(rewardReceived.value));
if (baseItem != null) {
HabboItem item = Emulator.getGameEnvironment().getItemManager().createItem(habbo.getHabboInfo().getId(), baseItem, 0, 0, "");
@ -356,9 +356,9 @@ public class WiredHandler {
}
}
} else if (rewardReceived.type.equalsIgnoreCase("respect")) {
habbo.getHabboStats().respectPointsReceived += Integer.valueOf(rewardReceived.value);
habbo.getHabboStats().respectPointsReceived += Integer.parseInt(rewardReceived.value);
} else if (rewardReceived.type.equalsIgnoreCase("cata")) {
CatalogItem item = Emulator.getGameEnvironment().getCatalogManager().getCatalogItem(Integer.valueOf(rewardReceived.value));
CatalogItem item = Emulator.getGameEnvironment().getCatalogManager().getCatalogItem(Integer.parseInt(rewardReceived.value));
if (item != null) {
Emulator.getGameEnvironment().getCatalogManager().purchaseItem(null, item, habbo, 1, "", true);

View File

@ -9,6 +9,8 @@ import com.eu.habbo.messages.incoming.achievements.GetAchievementsEvent;
import com.eu.habbo.messages.incoming.ambassadors.AmbassadorAlertEvent;
import com.eu.habbo.messages.incoming.ambassadors.FollowFriendEvent;
import com.eu.habbo.messages.incoming.camera.*;
import com.eu.habbo.messages.incoming.campaign.OpenCampaignCalendarDoorAsStaffEvent;
import com.eu.habbo.messages.incoming.campaign.OpenCampaignCalendarDoorEvent;
import com.eu.habbo.messages.incoming.catalog.*;
import com.eu.habbo.messages.incoming.catalog.marketplace.*;
import com.eu.habbo.messages.incoming.catalog.recycler.PresentOpenEvent;
@ -16,8 +18,6 @@ import com.eu.habbo.messages.incoming.catalog.recycler.RecycleItemsEvent;
import com.eu.habbo.messages.incoming.catalog.recycler.GetRecyclerStatusEvent;
import com.eu.habbo.messages.incoming.catalog.recycler.GetRecyclerPrizesEvent;
import com.eu.habbo.messages.incoming.crafting.*;
import com.eu.habbo.messages.incoming.events.calendar.OpenCampaignCalendarDoorEvent;
import com.eu.habbo.messages.incoming.events.calendar.OpenCampaignCalendarDoorAsStaffEvent;
import com.eu.habbo.messages.incoming.floorplaneditor.GetOccupiedTilesEvent;
import com.eu.habbo.messages.incoming.floorplaneditor.GetRoomEntryTileEvent;
import com.eu.habbo.messages.incoming.floorplaneditor.UpdateFloorPropertiesEvent;
@ -130,7 +130,7 @@ public class PacketManager {
for (String s : Emulator.getConfig().getValue("debug.show.headers").split(";")) {
try {
logList.add(Integer.valueOf(s));
} catch (NumberFormatException e) {
} catch (NumberFormatException ignored) {
}
}
@ -223,425 +223,425 @@ public class PacketManager {
}
private void registerAmbassadors() throws Exception {
this.registerHandler(Incoming.AmbassadorAlertEvent, AmbassadorAlertEvent.class);
this.registerHandler(Incoming.FollowFriendEvent, FollowFriendEvent.class);
this.registerHandler(Incoming.ambassadorAlertEvent, AmbassadorAlertEvent.class);
this.registerHandler(Incoming.followFriendEvent, FollowFriendEvent.class);
}
private void registerCatalog() throws Exception {
this.registerHandler(Incoming.GetRecyclerPrizesEvent, GetRecyclerPrizesEvent.class);
this.registerHandler(Incoming.GetBundleDiscountRulesetEvent, GetBundleDiscountRulesetEvent.class);
this.registerHandler(Incoming.GetGiftWrappingConfigurationEvent, GetGiftWrappingConfigurationEvent.class);
this.registerHandler(Incoming.GetMarketplaceConfigurationEvent, GetMarketplaceConfigurationEvent.class);
this.registerHandler(Incoming.GetCatalogIndexEvent, GetCatalogIndexEvent.class);
this.registerHandler(Incoming.BuildersClubQueryFurniCountEvent, BuildersClubQueryFurniCountEvent.class);
this.registerHandler(Incoming.GetCatalogPageEvent, GetCatalogPageEvent.class);
this.registerHandler(Incoming.PurchaseFromCatalogAsGiftEvent, PurchaseFromCatalogAsGiftEvent.class);
this.registerHandler(Incoming.PurchaseFromCatalogEvent, PurchaseFromCatalogEvent.class);
this.registerHandler(Incoming.RedeemVoucherEvent, RedeemVoucherEvent.class);
this.registerHandler(Incoming.GetRecyclerStatusEvent, GetRecyclerStatusEvent.class);
this.registerHandler(Incoming.RecycleItemsEvent, RecycleItemsEvent.class);
this.registerHandler(Incoming.PresentOpenEvent, PresentOpenEvent.class);
this.registerHandler(Incoming.GetMarketplaceOwnOffersEvent, GetMarketplaceOwnOffersEvent.class);
this.registerHandler(Incoming.CancelMarketplaceOfferEvent, CancelMarketplaceOfferEvent.class);
this.registerHandler(Incoming.GetMarketplaceOffersEvent, GetMarketplaceOffersEvent.class);
this.registerHandler(Incoming.GetMarketplaceItemStatsEvent, GetMarketplaceItemStatsEvent.class);
this.registerHandler(Incoming.BuyMarketplaceOfferEvent, BuyMarketplaceOfferEvent.class);
this.registerHandler(Incoming.GetMarketplaceCanMakeOfferEvent, GetMarketplaceCanMakeOfferEvent.class);
this.registerHandler(Incoming.MakeOfferEvent, MakeOfferEvent.class);
this.registerHandler(Incoming.RedeemMarketplaceOfferCreditsEvent, RedeemMarketplaceOfferCreditsEvent.class);
this.registerHandler(Incoming.GetSellablePetPalettesEvent, GetSellablePetPalettesEvent.class);
this.registerHandler(Incoming.ApproveNameEvent, ApproveNameEvent.class);
this.registerHandler(Incoming.GetClubOffersEvent, GetClubOffersEvent.class);
this.registerHandler(Incoming.GetClubGiftInfo, GetClubGiftInfo.class);
this.registerHandler(Incoming.GetProductOfferEvent, GetProductOfferEvent.class);
this.registerHandler(Incoming.PurchaseTargetedOfferEvent, PurchaseTargetedOfferEvent.class);
this.registerHandler(Incoming.SetTargetedOfferStateEvent, SetTargetedOfferStateEvent.class);
this.registerHandler(Incoming.SelectClubGiftEvent, SelectClubGiftEvent.class);
this.registerHandler(Incoming.ScrGetKickbackInfoEvent, ScrGetKickbackInfoEvent.class);
this.registerHandler(Incoming.BuildersClubPlaceWallItemEvent, BuildersClubPlaceWallItemEvent.class);
this.registerHandler(Incoming.PurchaseVipMembershipExtensionEvent, PurchaseVipMembershipExtensionEvent.class);
this.registerHandler(Incoming.getRecyclerPrizesEvent, GetRecyclerPrizesEvent.class);
this.registerHandler(Incoming.getBundleDiscountRulesetEvent, GetBundleDiscountRulesetEvent.class);
this.registerHandler(Incoming.getGiftWrappingConfigurationEvent, GetGiftWrappingConfigurationEvent.class);
this.registerHandler(Incoming.getMarketplaceConfigurationEvent, GetMarketplaceConfigurationEvent.class);
this.registerHandler(Incoming.getCatalogIndexEvent, GetCatalogIndexEvent.class);
this.registerHandler(Incoming.buildersClubQueryFurniCountEvent, BuildersClubQueryFurniCountEvent.class);
this.registerHandler(Incoming.getCatalogPageEvent, GetCatalogPageEvent.class);
this.registerHandler(Incoming.purchaseFromCatalogAsGiftEvent, PurchaseFromCatalogAsGiftEvent.class);
this.registerHandler(Incoming.purchaseFromCatalogEvent, PurchaseFromCatalogEvent.class);
this.registerHandler(Incoming.redeemVoucherEvent, RedeemVoucherEvent.class);
this.registerHandler(Incoming.getRecyclerStatusEvent, GetRecyclerStatusEvent.class);
this.registerHandler(Incoming.recycleItemsEvent, RecycleItemsEvent.class);
this.registerHandler(Incoming.presentOpenEvent, PresentOpenEvent.class);
this.registerHandler(Incoming.getMarketplaceOwnOffersEvent, GetMarketplaceOwnOffersEvent.class);
this.registerHandler(Incoming.cancelMarketplaceOfferEvent, CancelMarketplaceOfferEvent.class);
this.registerHandler(Incoming.getMarketplaceOffersEvent, GetMarketplaceOffersEvent.class);
this.registerHandler(Incoming.getMarketplaceItemStatsEvent, GetMarketplaceItemStatsEvent.class);
this.registerHandler(Incoming.buyMarketplaceOfferEvent, BuyMarketplaceOfferEvent.class);
this.registerHandler(Incoming.getMarketplaceCanMakeOfferEvent, GetMarketplaceCanMakeOfferEvent.class);
this.registerHandler(Incoming.makeOfferEvent, MakeOfferEvent.class);
this.registerHandler(Incoming.redeemMarketplaceOfferCreditsEvent, RedeemMarketplaceOfferCreditsEvent.class);
this.registerHandler(Incoming.getSellablePetPalettesEvent, GetSellablePetPalettesEvent.class);
this.registerHandler(Incoming.approveNameEvent, ApproveNameEvent.class);
this.registerHandler(Incoming.getClubOffersEvent, GetClubOffersEvent.class);
this.registerHandler(Incoming.getClubGiftInfo, GetClubGiftInfo.class);
this.registerHandler(Incoming.getProductOfferEvent, GetProductOfferEvent.class);
this.registerHandler(Incoming.purchaseTargetedOfferEvent, PurchaseTargetedOfferEvent.class);
this.registerHandler(Incoming.setTargetedOfferStateEvent, SetTargetedOfferStateEvent.class);
this.registerHandler(Incoming.selectClubGiftEvent, SelectClubGiftEvent.class);
this.registerHandler(Incoming.scrGetKickbackInfoEvent, ScrGetKickbackInfoEvent.class);
this.registerHandler(Incoming.buildersClubPlaceWallItemEvent, BuildersClubPlaceWallItemEvent.class);
this.registerHandler(Incoming.purchaseVipMembershipExtensionEvent, PurchaseVipMembershipExtensionEvent.class);
}
private void registerEvent() throws Exception {
this.registerHandler(Incoming.OpenCampaignCalendarDoorAsStaffEvent, OpenCampaignCalendarDoorAsStaffEvent.class);
this.registerHandler(Incoming.OpenCampaignCalendarDoorEvent, OpenCampaignCalendarDoorEvent.class);
this.registerHandler(Incoming.openCampaignCalendarDoorAsStaffEvent, OpenCampaignCalendarDoorAsStaffEvent.class);
this.registerHandler(Incoming.openCampaignCalendarDoorEvent, OpenCampaignCalendarDoorEvent.class);
}
private void registerHandshake() throws Exception {
this.registerHandler(Incoming.ClientHelloEvent, ClientHelloEvent.class);
this.registerHandler(Incoming.InitDiffieHandshakeEvent, InitDiffieHandshakeEvent.class);
this.registerHandler(Incoming.CompleteDiffieHandshakeEvent, CompleteDiffieHandshakeEvent.class);
this.registerHandler(Incoming.SSOTicketEvent, SSOTicketEvent.class);
this.registerHandler(Incoming.UniqueIDEvent, UniqueIDEvent.class);
this.registerHandler(Incoming.GetIgnoredUsersEvent, GetIgnoredUsersEvent.class);
this.registerHandler(Incoming.LatencyPingRequestEvent, LatencyPingRequestEvent.class);
this.registerHandler(Incoming.clientHelloEvent, ClientHelloEvent.class);
this.registerHandler(Incoming.initDiffieHandshakeEvent, InitDiffieHandshakeEvent.class);
this.registerHandler(Incoming.completeDiffieHandshakeEvent, CompleteDiffieHandshakeEvent.class);
this.registerHandler(Incoming.sSOTicketEvent, SSOTicketEvent.class);
this.registerHandler(Incoming.uniqueIDEvent, UniqueIDEvent.class);
this.registerHandler(Incoming.getIgnoredUsersEvent, GetIgnoredUsersEvent.class);
this.registerHandler(Incoming.latencyPingRequestEvent, LatencyPingRequestEvent.class);
}
private void registerFriends() throws Exception {
this.registerHandler(Incoming.GetMOTDEvent, GetMOTDEvent.class);
this.registerHandler(Incoming.SetRelationshipStatusEvent, SetRelationshipStatusEvent.class);
this.registerHandler(Incoming.RemoveFriendEvent, RemoveFriendEvent.class);
this.registerHandler(Incoming.HabboSearchEvent, HabboSearchEvent.class);
this.registerHandler(Incoming.RequestFriendEvent, RequestFriendEvent.class);
this.registerHandler(Incoming.AcceptFriendEvent, AcceptFriendEvent.class);
this.registerHandler(Incoming.DeclineFriendEvent, DeclineFriendEvent.class);
this.registerHandler(Incoming.SendMsgEvent, SendMsgEvent.class);
this.registerHandler(Incoming.GetFriendRequestsEvent, GetFriendRequestsEvent.class);
this.registerHandler(Incoming.VisitUserEvent, VisitUserEvent.class);
this.registerHandler(Incoming.MessengerInitEvent, MessengerInitEvent.class);
this.registerHandler(Incoming.FindNewFriendsEvent, FindNewFriendsEvent.class);
this.registerHandler(Incoming.SendRoomInviteEvent, SendRoomInviteEvent.class);
this.registerHandler(Incoming.getMOTDEvent, GetMOTDEvent.class);
this.registerHandler(Incoming.setRelationshipStatusEvent, SetRelationshipStatusEvent.class);
this.registerHandler(Incoming.removeFriendEvent, RemoveFriendEvent.class);
this.registerHandler(Incoming.habboSearchEvent, HabboSearchEvent.class);
this.registerHandler(Incoming.requestFriendEvent, RequestFriendEvent.class);
this.registerHandler(Incoming.acceptFriendEvent, AcceptFriendEvent.class);
this.registerHandler(Incoming.declineFriendEvent, DeclineFriendEvent.class);
this.registerHandler(Incoming.sendMsgEvent, SendMsgEvent.class);
this.registerHandler(Incoming.getFriendRequestsEvent, GetFriendRequestsEvent.class);
this.registerHandler(Incoming.visitUserEvent, VisitUserEvent.class);
this.registerHandler(Incoming.messengerInitEvent, MessengerInitEvent.class);
this.registerHandler(Incoming.findNewFriendsEvent, FindNewFriendsEvent.class);
this.registerHandler(Incoming.sendRoomInviteEvent, SendRoomInviteEvent.class);
}
private void registerUsers() throws Exception {
this.registerHandler(Incoming.InfoRetrieveEvent, InfoRetrieveEvent.class);
this.registerHandler(Incoming.GetCreditsInfoEvent, GetCreditsInfoEvent.class);
this.registerHandler(Incoming.ScrGetUserInfoEvent, ScrGetUserInfoEvent.class);
this.registerHandler(Incoming.GetSoundSettingsEvent, GetSoundSettingsEvent.class);
this.registerHandler(Incoming.GetTalentTrackLevelEvent, GetTalentTrackLevelEvent.class);
this.registerHandler(Incoming.GetExtendedProfileEvent, GetExtendedProfileEvent.class);
this.registerHandler(Incoming.GetRelationshipStatusInfoEvent, GetRelationshipStatusInfoEvent.class);
this.registerHandler(Incoming.GetWardrobeEvent, GetWardrobeEvent.class);
this.registerHandler(Incoming.SaveWardrobeOutfitEvent, SaveWardrobeOutfitEvent.class);
this.registerHandler(Incoming.ChangeMottoEvent, ChangeMottoEvent.class);
this.registerHandler(Incoming.UpdateFigureDataEvent, UpdateFigureDataEvent.class);
this.registerHandler(Incoming.SetActivatedBadgesEvent, SetActivatedBadgesEvent.class);
this.registerHandler(Incoming.GetSelectedBadgesEvent, GetSelectedBadgesEvent.class);
this.registerHandler(Incoming.SetSoundSettingsEvent, SetSoundSettingsEvent.class);
this.registerHandler(Incoming.SetRoomCameraPreferencesEvent, SetRoomCameraPreferencesEvent.class);
this.registerHandler(Incoming.SetIgnoreRoomInvitesEvent, SetIgnoreRoomInvitesEvent.class);
this.registerHandler(Incoming.SetChatPreferencesEvent, SetChatPreferencesEvent.class);
this.registerHandler(Incoming.AvatarEffectActivatedEvent, AvatarEffectActivatedEvent.class);
this.registerHandler(Incoming.AvatarEffectSelectedEvent, AvatarEffectSelectedEvent.class);
this.registerHandler(Incoming.EventLogEvent, EventLogEvent.class);
this.registerHandler(Incoming.NewUserExperienceScriptProceedEvent, NewUserExperienceScriptProceedEvent.class);
this.registerHandler(Incoming.NewUserExperienceGetGiftsEvent, NewUserExperienceGetGiftsEvent.class);
this.registerHandler(Incoming.CheckUserNameEvent, CheckUserNameEvent.class);
this.registerHandler(Incoming.ChangeUserNameEvent, ChangeUserNameEvent.class);
this.registerHandler(Incoming.SetChatStylePreferenceEvent, SetChatStylePreferenceEvent.class);
this.registerHandler(Incoming.UpdateUIFlagsEvent, UpdateUIFlagsEvent.class);
this.registerHandler(Incoming.infoRetrieveEvent, InfoRetrieveEvent.class);
this.registerHandler(Incoming.getCreditsInfoEvent, GetCreditsInfoEvent.class);
this.registerHandler(Incoming.scrGetUserInfoEvent, ScrGetUserInfoEvent.class);
this.registerHandler(Incoming.getSoundSettingsEvent, GetSoundSettingsEvent.class);
this.registerHandler(Incoming.getTalentTrackLevelEvent, GetTalentTrackLevelEvent.class);
this.registerHandler(Incoming.getExtendedProfileEvent, GetExtendedProfileEvent.class);
this.registerHandler(Incoming.getRelationshipStatusInfoEvent, GetRelationshipStatusInfoEvent.class);
this.registerHandler(Incoming.getWardrobeEvent, GetWardrobeEvent.class);
this.registerHandler(Incoming.saveWardrobeOutfitEvent, SaveWardrobeOutfitEvent.class);
this.registerHandler(Incoming.changeMottoEvent, ChangeMottoEvent.class);
this.registerHandler(Incoming.updateFigureDataEvent, UpdateFigureDataEvent.class);
this.registerHandler(Incoming.setActivatedBadgesEvent, SetActivatedBadgesEvent.class);
this.registerHandler(Incoming.getSelectedBadgesEvent, GetSelectedBadgesEvent.class);
this.registerHandler(Incoming.setSoundSettingsEvent, SetSoundSettingsEvent.class);
this.registerHandler(Incoming.setRoomCameraPreferencesEvent, SetRoomCameraPreferencesEvent.class);
this.registerHandler(Incoming.setIgnoreRoomInvitesEvent, SetIgnoreRoomInvitesEvent.class);
this.registerHandler(Incoming.setChatPreferencesEvent, SetChatPreferencesEvent.class);
this.registerHandler(Incoming.avatarEffectActivatedEvent, AvatarEffectActivatedEvent.class);
this.registerHandler(Incoming.avatarEffectSelectedEvent, AvatarEffectSelectedEvent.class);
this.registerHandler(Incoming.eventLogEvent, EventLogEvent.class);
this.registerHandler(Incoming.newUserExperienceScriptProceedEvent, NewUserExperienceScriptProceedEvent.class);
this.registerHandler(Incoming.newUserExperienceGetGiftsEvent, NewUserExperienceGetGiftsEvent.class);
this.registerHandler(Incoming.checkUserNameEvent, CheckUserNameEvent.class);
this.registerHandler(Incoming.changeUserNameEvent, ChangeUserNameEvent.class);
this.registerHandler(Incoming.setChatStylePreferenceEvent, SetChatStylePreferenceEvent.class);
this.registerHandler(Incoming.updateUIFlagsEvent, UpdateUIFlagsEvent.class);
}
private void registerNavigator() throws Exception {
this.registerHandler(Incoming.GetUserFlatCatsEvent, GetUserFlatCatsEvent.class);
this.registerHandler(Incoming.PopularRoomsSearchEvent, PopularRoomsSearchEvent.class);
this.registerHandler(Incoming.RoomsWithHighestScoreSearchEvent, RoomsWithHighestScoreSearchEvent.class);
this.registerHandler(Incoming.MyRoomsSearchEvent, MyRoomsSearchEvent.class);
this.registerHandler(Incoming.CanCreateRoomEvent, CanCreateRoomEvent.class);
this.registerHandler(Incoming.GetUnreadForumsCountEvent, GetUnreadForumsCountEvent.class);
this.registerHandler(Incoming.CreateFlatEvent, CreateFlatEvent.class);
this.registerHandler(Incoming.GetPopularRoomTagsEvent, GetPopularRoomTagsEvent.class);
this.registerHandler(Incoming.SearchRoomsByTagEvent, SearchRoomsByTagEvent.class);
this.registerHandler(Incoming.RoomTextSearchEvent, RoomTextSearchEvent.class);
this.registerHandler(Incoming.RoomsWhereMyFriendsAreSearchEvent, RoomsWhereMyFriendsAreSearchEvent.class);
this.registerHandler(Incoming.MyFriendsRoomsSearchEvent, MyFriendsRoomsSearchEvent.class);
this.registerHandler(Incoming.MyRoomRightsSearchEvent, MyRoomRightsSearchEvent.class);
this.registerHandler(Incoming.MyGuildBasesSearchEvent, MyGuildBasesSearchEvent.class);
this.registerHandler(Incoming.MyFavouriteRoomsSearchEvent, MyFavouriteRoomsSearchEvent.class);
this.registerHandler(Incoming.MyRoomHistorySearchEvent, MyRoomHistorySearchEvent.class);
this.registerHandler(Incoming.NewNavigatorInitEvent, NewNavigatorInitEvent.class);
this.registerHandler(Incoming.NewNavigatorSearchEvent, NewNavigatorSearchEvent.class);
this.registerHandler(Incoming.ForwardToSomeRoomEvent, ForwardToSomeRoomEvent.class);
this.registerHandler(Incoming.GetUserEventCatsEvent, GetUserEventCatsEvent.class);
this.registerHandler(Incoming.SetNewNavigatorWindowPreferencesEvent, SetNewNavigatorWindowPreferencesEvent.class);
this.registerHandler(Incoming.DeleteRoomEvent, DeleteRoomEvent.class);
this.registerHandler(Incoming.NavigatorSetSearchCodeViewModeEvent, NavigatorSetSearchCodeViewModeEvent.class);
this.registerHandler(Incoming.NavigatorAddCollapsedCategoryEvent, NavigatorAddCollapsedCategoryEvent.class);
this.registerHandler(Incoming.NavigatorRemoveCollapsedCategoryEvent, NavigatorRemoveCollapsedCategoryEvent.class);
this.registerHandler(Incoming.NavigatorAddSavedSearchEvent, NavigatorAddSavedSearchEvent.class);
this.registerHandler(Incoming.NavigatorDeleteSavedSearchEvent, NavigatorDeleteSavedSearchEvent.class);
this.registerHandler(Incoming.getUserFlatCatsEvent, GetUserFlatCatsEvent.class);
this.registerHandler(Incoming.popularRoomsSearchEvent, PopularRoomsSearchEvent.class);
this.registerHandler(Incoming.roomsWithHighestScoreSearchEvent, RoomsWithHighestScoreSearchEvent.class);
this.registerHandler(Incoming.myRoomsSearchEvent, MyRoomsSearchEvent.class);
this.registerHandler(Incoming.canCreateRoomEvent, CanCreateRoomEvent.class);
this.registerHandler(Incoming.getUnreadForumsCountEvent, GetUnreadForumsCountEvent.class);
this.registerHandler(Incoming.createFlatEvent, CreateFlatEvent.class);
this.registerHandler(Incoming.getPopularRoomTagsEvent, GetPopularRoomTagsEvent.class);
this.registerHandler(Incoming.searchRoomsByTagEvent, SearchRoomsByTagEvent.class);
this.registerHandler(Incoming.roomTextSearchEvent, RoomTextSearchEvent.class);
this.registerHandler(Incoming.roomsWhereMyFriendsAreSearchEvent, RoomsWhereMyFriendsAreSearchEvent.class);
this.registerHandler(Incoming.myFriendsRoomsSearchEvent, MyFriendsRoomsSearchEvent.class);
this.registerHandler(Incoming.myRoomRightsSearchEvent, MyRoomRightsSearchEvent.class);
this.registerHandler(Incoming.myGuildBasesSearchEvent, MyGuildBasesSearchEvent.class);
this.registerHandler(Incoming.myFavouriteRoomsSearchEvent, MyFavouriteRoomsSearchEvent.class);
this.registerHandler(Incoming.myRoomHistorySearchEvent, MyRoomHistorySearchEvent.class);
this.registerHandler(Incoming.newNavigatorInitEvent, NewNavigatorInitEvent.class);
this.registerHandler(Incoming.newNavigatorSearchEvent, NewNavigatorSearchEvent.class);
this.registerHandler(Incoming.forwardToSomeRoomEvent, ForwardToSomeRoomEvent.class);
this.registerHandler(Incoming.getUserEventCatsEvent, GetUserEventCatsEvent.class);
this.registerHandler(Incoming.setNewNavigatorWindowPreferencesEvent, SetNewNavigatorWindowPreferencesEvent.class);
this.registerHandler(Incoming.deleteRoomEvent, DeleteRoomEvent.class);
this.registerHandler(Incoming.navigatorSetSearchCodeViewModeEvent, NavigatorSetSearchCodeViewModeEvent.class);
this.registerHandler(Incoming.navigatorAddCollapsedCategoryEvent, NavigatorAddCollapsedCategoryEvent.class);
this.registerHandler(Incoming.navigatorRemoveCollapsedCategoryEvent, NavigatorRemoveCollapsedCategoryEvent.class);
this.registerHandler(Incoming.navigatorAddSavedSearchEvent, NavigatorAddSavedSearchEvent.class);
this.registerHandler(Incoming.navigatorDeleteSavedSearchEvent, NavigatorDeleteSavedSearchEvent.class);
}
private void registerHotelview() throws Exception {
this.registerHandler(Incoming.QuitEvent, QuitEvent.class);
this.registerHandler(Incoming.GetBonusRareInfoEvent, GetBonusRareInfoEvent.class);
this.registerHandler(Incoming.GetPromoArticlesEvent, GetPromoArticlesEvent.class);
this.registerHandler(Incoming.GetCurrentTimingCodeEvent, GetCurrentTimingCodeEvent.class);
this.registerHandler(Incoming.HotelViewRequestBadgeRewardEvent, HotelViewRequestBadgeRewardEvent.class);
this.registerHandler(Incoming.HotelViewClaimBadgeRewardEvent, HotelViewClaimBadgeRewardEvent.class);
this.registerHandler(Incoming.GetLimitedOfferAppearingNextEvent, GetLimitedOfferAppearingNextEvent.class);
this.registerHandler(Incoming.HotelViewRequestSecondsUntilEvent, HotelViewRequestSecondsUntilEvent.class);
this.registerHandler(Incoming.quitEvent, QuitEvent.class);
this.registerHandler(Incoming.getBonusRareInfoEvent, GetBonusRareInfoEvent.class);
this.registerHandler(Incoming.getPromoArticlesEvent, GetPromoArticlesEvent.class);
this.registerHandler(Incoming.getCurrentTimingCodeEvent, GetCurrentTimingCodeEvent.class);
this.registerHandler(Incoming.hotelViewRequestBadgeRewardEvent, HotelViewRequestBadgeRewardEvent.class);
this.registerHandler(Incoming.hotelViewClaimBadgeRewardEvent, HotelViewClaimBadgeRewardEvent.class);
this.registerHandler(Incoming.getLimitedOfferAppearingNextEvent, GetLimitedOfferAppearingNextEvent.class);
this.registerHandler(Incoming.hotelViewRequestSecondsUntilEvent, HotelViewRequestSecondsUntilEvent.class);
}
private void registerInventory() throws Exception {
this.registerHandler(Incoming.GetBadgesEvent, GetBadgesEvent.class);
this.registerHandler(Incoming.GetBotInventoryEvent, GetBotInventoryEvent.class);
this.registerHandler(Incoming.RequestFurniInventoryEvent, RequestFurniInventoryWhenNotInRoomEvent.class);
this.registerHandler(Incoming.RequestFurniInventoryWhenNotInRoomEvent, RequestFurniInventoryWhenNotInRoomEvent.class);
this.registerHandler(Incoming.GetPetInventoryEvent, GetPetInventoryEvent.class);
this.registerHandler(Incoming.getBadgesEvent, GetBadgesEvent.class);
this.registerHandler(Incoming.getBotInventoryEvent, GetBotInventoryEvent.class);
this.registerHandler(Incoming.requestFurniInventoryEvent, RequestFurniInventoryWhenNotInRoomEvent.class);
this.registerHandler(Incoming.requestFurniInventoryWhenNotInRoomEvent, RequestFurniInventoryWhenNotInRoomEvent.class);
this.registerHandler(Incoming.getPetInventoryEvent, GetPetInventoryEvent.class);
}
void registerRooms() throws Exception {
this.registerHandler(Incoming.OpenFlatConnectionEvent, OpenFlatConnectionEvent.class);
this.registerHandler(Incoming.GetFurnitureAliasesEvent, GetRoomEntryDataEvent.class);// should this be seperate event classes?
this.registerHandler(Incoming.GetRoomEntryDataEvent, GetRoomEntryDataEvent.class);// should this be seperate event classes?
this.registerHandler(Incoming.RateFlatEvent, RateFlatEvent.class);
this.registerHandler(Incoming.GetGuestRoomEvent, GetGuestRoomEvent.class);
this.registerHandler(Incoming.SaveRoomSettingsEvent, SaveRoomSettingsEvent.class);
this.registerHandler(Incoming.PlaceObjectEvent, PlaceObjectEvent.class);
this.registerHandler(Incoming.MoveObjectEvent, MoveObjectEvent.class);
this.registerHandler(Incoming.MoveWallItemEvent, MoveWallItemEvent.class);
this.registerHandler(Incoming.PickupObjectEvent, PickupObjectEvent.class);
this.registerHandler(Incoming.RequestRoomPropertySet, RequestRoomPropertySet.class);
this.registerHandler(Incoming.StartTypingEvent, StartTypingEvent.class);
this.registerHandler(Incoming.CancelTypingEvent, CancelTypingEvent.class);
this.registerHandler(Incoming.UseFurnitureEvent, UseFurnitureEvent.class);
this.registerHandler(Incoming.UseWallItemEvent, UseWallItemEvent.class);
this.registerHandler(Incoming.SetRoomBackgroundColorDataEvent, SetRoomBackgroundColorDataEvent.class);
this.registerHandler(Incoming.SetMannequinNameEvent, SetMannequinNameEvent.class);
this.registerHandler(Incoming.SetMannequinFigureEvent, SetMannequinFigureEvent.class);
this.registerHandler(Incoming.SetClothingChangeDataEvent, SetClothingChangeDataEvent.class);
this.registerHandler(Incoming.SetObjectDataEvent, SetObjectDataEvent.class);
this.registerHandler(Incoming.GetRoomSettingsEvent, GetRoomSettingsEvent.class);
this.registerHandler(Incoming.RoomDimmerGetPresetsEvent, RoomDimmerGetPresetsEvent.class);
this.registerHandler(Incoming.RoomDimmerChangeStateEvent, RoomDimmerChangeStateEvent.class);
this.registerHandler(Incoming.DropCarryItemEvent, DropCarryItemEvent.class);
this.registerHandler(Incoming.LookToEvent, LookToEvent.class);
this.registerHandler(Incoming.ChatEvent, ChatEvent.class);
this.registerHandler(Incoming.ShoutEvent, ShoutEvent.class);
this.registerHandler(Incoming.WhisperEvent, WhisperEvent.class);
this.registerHandler(Incoming.AvatarExpressionEvent, AvatarExpressionEvent.class);
this.registerHandler(Incoming.ChangePostureEvent, ChangePostureEvent.class);
this.registerHandler(Incoming.DanceEvent, DanceEvent.class);
this.registerHandler(Incoming.SignEvent, SignEvent.class);
this.registerHandler(Incoming.MoveAvatarEvent, MoveAvatarEvent.class);
this.registerHandler(Incoming.RespectUserEvent, RespectUserEvent.class);
this.registerHandler(Incoming.AssignRightsEvent, AssignRightsEvent.class);
this.registerHandler(Incoming.RemoveOwnRoomRightsRoomEvent, RemoveOwnRoomRightsRoomEvent.class);
this.registerHandler(Incoming.GetFlatControllersEvent, GetFlatControllersEvent.class);
this.registerHandler(Incoming.RemoveAllRightsEvent, RemoveAllRightsEvent.class);
this.registerHandler(Incoming.RemoveRightsEvent, RemoveRightsEvent.class);
this.registerHandler(Incoming.PlaceBotEvent, PlaceBotEvent.class);
this.registerHandler(Incoming.RemoveBotFromFlatEvent, RemoveBotFromFlatEvent.class);
this.registerHandler(Incoming.CommandBotEvent, CommandBotEvent.class);
this.registerHandler(Incoming.GetBotCommandConfigurationDataEvent, GetBotCommandConfigurationDataEvent.class);
this.registerHandler(Incoming.ThrowDiceEvent, ThrowDiceEvent.class);
this.registerHandler(Incoming.DiceOffEvent, DiceOffEvent.class);
this.registerHandler(Incoming.SpinWheelOfFortuneEvent, SpinWheelOfFortuneEvent.class);
this.registerHandler(Incoming.CreditFurniRedeemEvent, CreditFurniRedeemEvent.class);
this.registerHandler(Incoming.PlacePetEvent, PlacePetEvent.class);
this.registerHandler(Incoming.RoomUserKickEvent, RoomUserKickEvent.class);
this.registerHandler(Incoming.SetCustomStackingHeightEvent, SetCustomStackingHeightEvent.class);
this.registerHandler(Incoming.EnterOneWayDoorEvent, EnterOneWayDoorEvent.class);
this.registerHandler(Incoming.LetUserInEvent, LetUserInEvent.class);
this.registerHandler(Incoming.CustomizeAvatarWithFurniEvent, CustomizeAvatarWithFurniEvent.class);
this.registerHandler(Incoming.PlacePostItEvent, PlacePostItEvent.class);
this.registerHandler(Incoming.GetItemDataEvent, GetItemDataEvent.class);
this.registerHandler(Incoming.SetItemDataEvent, SetItemDataEvent.class);
this.registerHandler(Incoming.RemoveItemEvent, RemoveItemEvent.class);
this.registerHandler(Incoming.RoomDimmerSavePresetEvent, RoomDimmerSavePresetEvent.class);
this.registerHandler(Incoming.RentableSpaceRentEvent, RentableSpaceRentEvent.class);
this.registerHandler(Incoming.RentableSpaceCancelRentEvent, RentableSpaceCancelRentEvent.class);
this.registerHandler(Incoming.UpdateHomeRoomEvent, UpdateHomeRoomEvent.class);
this.registerHandler(Incoming.PassCarryItemEvent, PassCarryItemEvent.class);
this.registerHandler(Incoming.MuteAllInRoomEvent, MuteAllInRoomEvent.class);
this.registerHandler(Incoming.GetCustomRoomFilterEvent, GetCustomRoomFilterEvent.class);
this.registerHandler(Incoming.UpdateRoomFilterEvent, UpdateRoomFilterEvent.class);
this.registerHandler(Incoming.SubmitRoomToCompetitionEvent, SubmitRoomToCompetitionEvent.class);
this.registerHandler(Incoming.GetBannedUsersFromRoomEvent, GetBannedUsersFromRoomEvent.class);
this.registerHandler(Incoming.GetOfficialSongIdEvent, GetOfficialSongIdEvent.class);
this.registerHandler(Incoming.GetSongInfoEvent, GetSongInfoEvent.class);
this.registerHandler(Incoming.AddJukeboxDiskEvent, AddJukeboxDiskEvent.class);
this.registerHandler(Incoming.RemoveJukeboxDiskEvent, RemoveJukeboxDiskEvent.class);
this.registerHandler(Incoming.GetNowPlayingEvent, GetNowPlayingEvent.class);
this.registerHandler(Incoming.JukeBoxEventOne, JukeBoxEventOne.class); // this doesnt even exist in the swf src for this prod.
this.registerHandler(Incoming.GetJukeboxPlayListEvent, GetJukeboxPlayListEvent.class);
this.registerHandler(Incoming.AddSpamWallPostItEvent, AddSpamWallPostItEvent.class);
this.registerHandler(Incoming.GetRoomAdPurchaseInfoEvent, GetRoomAdPurchaseInfoEvent.class);
this.registerHandler(Incoming.PurchaseRoomAdEvent, PurchaseRoomAdEvent.class);
this.registerHandler(Incoming.EditEventEvent, EditEventEvent.class);
this.registerHandler(Incoming.IgnoreUserEvent, IgnoreUserEvent.class);
this.registerHandler(Incoming.UnignoreUserEvent, UnignoreUserEvent.class);
this.registerHandler(Incoming.RoomUserMuteEvent, RoomUserMuteEvent.class);
this.registerHandler(Incoming.BanUserWithDurationEvent, BanUserWithDurationEvent.class);
this.registerHandler(Incoming.UnbanUserFromRoomEvent, UnbanUserFromRoomEvent.class);
this.registerHandler(Incoming.GetUserTagsEvent, GetUserTagsEvent.class);
this.registerHandler(Incoming.GetYoutubeDisplayStatusEvent, GetYoutubeDisplayStatusEvent.class);
this.registerHandler(Incoming.ControlYoutubeDisplayPlaybackEvent, ControlYoutubeDisplayPlaybackEvent.class);
this.registerHandler(Incoming.SetYoutubeDisplayPlaylistEvent, SetYoutubeDisplayPlaylistEvent.class);
this.registerHandler(Incoming.AddFavouriteRoomEvent, AddFavouriteRoomEvent.class);
this.registerHandler(Incoming.FriendFurniConfirmLockEvent, FriendFurniConfirmLockEvent.class);
this.registerHandler(Incoming.DeleteFavouriteRoomEvent, DeleteFavouriteRoomEvent.class);
this.registerHandler(Incoming.SetRandomStateEvent, SetRandomStateEvent.class);
this.registerHandler(Incoming.openFlatConnectionEvent, OpenFlatConnectionEvent.class);
this.registerHandler(Incoming.getFurnitureAliasesEvent, GetRoomEntryDataEvent.class);// should this be seperate event classes?
this.registerHandler(Incoming.getRoomEntryDataEvent, GetRoomEntryDataEvent.class);// should this be seperate event classes?
this.registerHandler(Incoming.rateFlatEvent, RateFlatEvent.class);
this.registerHandler(Incoming.getGuestRoomEvent, GetGuestRoomEvent.class);
this.registerHandler(Incoming.saveRoomSettingsEvent, SaveRoomSettingsEvent.class);
this.registerHandler(Incoming.placeObjectEvent, PlaceObjectEvent.class);
this.registerHandler(Incoming.moveObjectEvent, MoveObjectEvent.class);
this.registerHandler(Incoming.moveWallItemEvent, MoveWallItemEvent.class);
this.registerHandler(Incoming.pickupObjectEvent, PickupObjectEvent.class);
this.registerHandler(Incoming.requestRoomPropertySet, RequestRoomPropertySet.class);
this.registerHandler(Incoming.startTypingEvent, StartTypingEvent.class);
this.registerHandler(Incoming.cancelTypingEvent, CancelTypingEvent.class);
this.registerHandler(Incoming.useFurnitureEvent, UseFurnitureEvent.class);
this.registerHandler(Incoming.useWallItemEvent, UseWallItemEvent.class);
this.registerHandler(Incoming.setRoomBackgroundColorDataEvent, SetRoomBackgroundColorDataEvent.class);
this.registerHandler(Incoming.setMannequinNameEvent, SetMannequinNameEvent.class);
this.registerHandler(Incoming.setMannequinFigureEvent, SetMannequinFigureEvent.class);
this.registerHandler(Incoming.setClothingChangeDataEvent, SetClothingChangeDataEvent.class);
this.registerHandler(Incoming.setObjectDataEvent, SetObjectDataEvent.class);
this.registerHandler(Incoming.getRoomSettingsEvent, GetRoomSettingsEvent.class);
this.registerHandler(Incoming.roomDimmerGetPresetsEvent, RoomDimmerGetPresetsEvent.class);
this.registerHandler(Incoming.roomDimmerChangeStateEvent, RoomDimmerChangeStateEvent.class);
this.registerHandler(Incoming.dropCarryItemEvent, DropCarryItemEvent.class);
this.registerHandler(Incoming.lookToEvent, LookToEvent.class);
this.registerHandler(Incoming.chatEvent, ChatEvent.class);
this.registerHandler(Incoming.shoutEvent, ShoutEvent.class);
this.registerHandler(Incoming.whisperEvent, WhisperEvent.class);
this.registerHandler(Incoming.avatarExpressionEvent, AvatarExpressionEvent.class);
this.registerHandler(Incoming.changePostureEvent, ChangePostureEvent.class);
this.registerHandler(Incoming.danceEvent, DanceEvent.class);
this.registerHandler(Incoming.signEvent, SignEvent.class);
this.registerHandler(Incoming.moveAvatarEvent, MoveAvatarEvent.class);
this.registerHandler(Incoming.respectUserEvent, RespectUserEvent.class);
this.registerHandler(Incoming.assignRightsEvent, AssignRightsEvent.class);
this.registerHandler(Incoming.removeOwnRoomRightsRoomEvent, RemoveOwnRoomRightsRoomEvent.class);
this.registerHandler(Incoming.getFlatControllersEvent, GetFlatControllersEvent.class);
this.registerHandler(Incoming.removeAllRightsEvent, RemoveAllRightsEvent.class);
this.registerHandler(Incoming.removeRightsEvent, RemoveRightsEvent.class);
this.registerHandler(Incoming.placeBotEvent, PlaceBotEvent.class);
this.registerHandler(Incoming.removeBotFromFlatEvent, RemoveBotFromFlatEvent.class);
this.registerHandler(Incoming.commandBotEvent, CommandBotEvent.class);
this.registerHandler(Incoming.getBotCommandConfigurationDataEvent, GetBotCommandConfigurationDataEvent.class);
this.registerHandler(Incoming.throwDiceEvent, ThrowDiceEvent.class);
this.registerHandler(Incoming.diceOffEvent, DiceOffEvent.class);
this.registerHandler(Incoming.spinWheelOfFortuneEvent, SpinWheelOfFortuneEvent.class);
this.registerHandler(Incoming.creditFurniRedeemEvent, CreditFurniRedeemEvent.class);
this.registerHandler(Incoming.placePetEvent, PlacePetEvent.class);
this.registerHandler(Incoming.roomUserKickEvent, RoomUserKickEvent.class);
this.registerHandler(Incoming.setCustomStackingHeightEvent, SetCustomStackingHeightEvent.class);
this.registerHandler(Incoming.enterOneWayDoorEvent, EnterOneWayDoorEvent.class);
this.registerHandler(Incoming.letUserInEvent, LetUserInEvent.class);
this.registerHandler(Incoming.customizeAvatarWithFurniEvent, CustomizeAvatarWithFurniEvent.class);
this.registerHandler(Incoming.placePostItEvent, PlacePostItEvent.class);
this.registerHandler(Incoming.getItemDataEvent, GetItemDataEvent.class);
this.registerHandler(Incoming.setItemDataEvent, SetItemDataEvent.class);
this.registerHandler(Incoming.removeItemEvent, RemoveItemEvent.class);
this.registerHandler(Incoming.roomDimmerSavePresetEvent, RoomDimmerSavePresetEvent.class);
this.registerHandler(Incoming.rentableSpaceRentEvent, RentableSpaceRentEvent.class);
this.registerHandler(Incoming.rentableSpaceCancelRentEvent, RentableSpaceCancelRentEvent.class);
this.registerHandler(Incoming.updateHomeRoomEvent, UpdateHomeRoomEvent.class);
this.registerHandler(Incoming.passCarryItemEvent, PassCarryItemEvent.class);
this.registerHandler(Incoming.muteAllInRoomEvent, MuteAllInRoomEvent.class);
this.registerHandler(Incoming.getCustomRoomFilterEvent, GetCustomRoomFilterEvent.class);
this.registerHandler(Incoming.updateRoomFilterEvent, UpdateRoomFilterEvent.class);
this.registerHandler(Incoming.submitRoomToCompetitionEvent, SubmitRoomToCompetitionEvent.class);
this.registerHandler(Incoming.getBannedUsersFromRoomEvent, GetBannedUsersFromRoomEvent.class);
this.registerHandler(Incoming.getOfficialSongIdEvent, GetOfficialSongIdEvent.class);
this.registerHandler(Incoming.getSongInfoEvent, GetSongInfoEvent.class);
this.registerHandler(Incoming.addJukeboxDiskEvent, AddJukeboxDiskEvent.class);
this.registerHandler(Incoming.removeJukeboxDiskEvent, RemoveJukeboxDiskEvent.class);
this.registerHandler(Incoming.getNowPlayingEvent, GetNowPlayingEvent.class);
this.registerHandler(Incoming.jukeBoxEventOne, JukeBoxEventOne.class); // this doesnt even exist in the swf src for this prod.
this.registerHandler(Incoming.getJukeboxPlayListEvent, GetJukeboxPlayListEvent.class);
this.registerHandler(Incoming.addSpamWallPostItEvent, AddSpamWallPostItEvent.class);
this.registerHandler(Incoming.getRoomAdPurchaseInfoEvent, GetRoomAdPurchaseInfoEvent.class);
this.registerHandler(Incoming.purchaseRoomAdEvent, PurchaseRoomAdEvent.class);
this.registerHandler(Incoming.editEventEvent, EditEventEvent.class);
this.registerHandler(Incoming.ignoreUserEvent, IgnoreUserEvent.class);
this.registerHandler(Incoming.unignoreUserEvent, UnignoreUserEvent.class);
this.registerHandler(Incoming.roomUserMuteEvent, RoomUserMuteEvent.class);
this.registerHandler(Incoming.banUserWithDurationEvent, BanUserWithDurationEvent.class);
this.registerHandler(Incoming.unbanUserFromRoomEvent, UnbanUserFromRoomEvent.class);
this.registerHandler(Incoming.getUserTagsEvent, GetUserTagsEvent.class);
this.registerHandler(Incoming.getYoutubeDisplayStatusEvent, GetYoutubeDisplayStatusEvent.class);
this.registerHandler(Incoming.controlYoutubeDisplayPlaybackEvent, ControlYoutubeDisplayPlaybackEvent.class);
this.registerHandler(Incoming.setYoutubeDisplayPlaylistEvent, SetYoutubeDisplayPlaylistEvent.class);
this.registerHandler(Incoming.addFavouriteRoomEvent, AddFavouriteRoomEvent.class);
this.registerHandler(Incoming.friendFurniConfirmLockEvent, FriendFurniConfirmLockEvent.class);
this.registerHandler(Incoming.deleteFavouriteRoomEvent, DeleteFavouriteRoomEvent.class);
this.registerHandler(Incoming.setRandomStateEvent, SetRandomStateEvent.class);
}
void registerPolls() throws Exception {
this.registerHandler(Incoming.PollRejectEvent, PollRejectEvent.class);
this.registerHandler(Incoming.PollStartEvent, PollStartEvent.class);
this.registerHandler(Incoming.AnswerPollEvent, AnswerPollEvent.class);
this.registerHandler(Incoming.pollRejectEvent, PollRejectEvent.class);
this.registerHandler(Incoming.pollStartEvent, PollStartEvent.class);
this.registerHandler(Incoming.answerPollEvent, AnswerPollEvent.class);
}
void registerModTool() throws Exception {
this.registerHandler(Incoming.GetModeratorRoomInfoEvent, GetModeratorRoomInfoEvent.class);
this.registerHandler(Incoming.GetRoomChatlogEvent, GetRoomChatlogEvent.class);
this.registerHandler(Incoming.GetModeratorUserInfoEvent, GetModeratorUserInfoEvent.class);
this.registerHandler(Incoming.PickIssuesEvent, PickIssuesEvent.class);
this.registerHandler(Incoming.CloseIssuesEvent, CloseIssuesEvent.class);
this.registerHandler(Incoming.ReleaseIssuesEvent, ReleaseIssuesEvent.class);
this.registerHandler(Incoming.ModMessageEvent, ModMessageEvent.class);
this.registerHandler(Incoming.ModToolWarnEvent, ModToolWarnEvent.class);
this.registerHandler(Incoming.ModKickEvent, ModKickEvent.class);
this.registerHandler(Incoming.ModeratorActionEvent, ModeratorActionEvent.class);
this.registerHandler(Incoming.ModerateRoomEvent, ModerateRoomEvent.class);
this.registerHandler(Incoming.GetRoomVisitsEvent, GetRoomVisitsEvent.class);
this.registerHandler(Incoming.GetCfhChatlogEvent, GetCfhChatlogEvent.class);
this.registerHandler(Incoming.ModToolRequestRoomUserChatlogEvent, ModToolRequestRoomUserChatlogEvent.class);
this.registerHandler(Incoming.GetUserChatlogEvent, GetUserChatlogEvent.class);
this.registerHandler(Incoming.ModAlertEvent, ModAlertEvent.class);
this.registerHandler(Incoming.ModMuteEvent, ModMuteEvent.class);
this.registerHandler(Incoming.ModBanEvent, ModBanEvent.class);
this.registerHandler(Incoming.ModTradingLockEvent, ModTradingLockEvent.class);
this.registerHandler(Incoming.ModToolSanctionEvent, ModToolSanctionEvent.class);
this.registerHandler(Incoming.CloseIssueDefaultActionEvent, CloseIssueDefaultActionEvent.class);
this.registerHandler(Incoming.getModeratorRoomInfoEvent, GetModeratorRoomInfoEvent.class);
this.registerHandler(Incoming.getRoomChatlogEvent, GetRoomChatlogEvent.class);
this.registerHandler(Incoming.getModeratorUserInfoEvent, GetModeratorUserInfoEvent.class);
this.registerHandler(Incoming.pickIssuesEvent, PickIssuesEvent.class);
this.registerHandler(Incoming.closeIssuesEvent, CloseIssuesEvent.class);
this.registerHandler(Incoming.releaseIssuesEvent, ReleaseIssuesEvent.class);
this.registerHandler(Incoming.modMessageEvent, ModMessageEvent.class);
this.registerHandler(Incoming.modToolWarnEvent, ModToolWarnEvent.class);
this.registerHandler(Incoming.modKickEvent, ModKickEvent.class);
this.registerHandler(Incoming.moderatorActionEvent, ModeratorActionEvent.class);
this.registerHandler(Incoming.moderateRoomEvent, ModerateRoomEvent.class);
this.registerHandler(Incoming.getRoomVisitsEvent, GetRoomVisitsEvent.class);
this.registerHandler(Incoming.getCfhChatlogEvent, GetCfhChatlogEvent.class);
this.registerHandler(Incoming.modToolRequestRoomUserChatlogEvent, ModToolRequestRoomUserChatlogEvent.class);
this.registerHandler(Incoming.getUserChatlogEvent, GetUserChatlogEvent.class);
this.registerHandler(Incoming.modAlertEvent, ModAlertEvent.class);
this.registerHandler(Incoming.modMuteEvent, ModMuteEvent.class);
this.registerHandler(Incoming.modBanEvent, ModBanEvent.class);
this.registerHandler(Incoming.modTradingLockEvent, ModTradingLockEvent.class);
this.registerHandler(Incoming.modToolSanctionEvent, ModToolSanctionEvent.class);
this.registerHandler(Incoming.closeIssueDefaultActionEvent, CloseIssueDefaultActionEvent.class);
this.registerHandler(Incoming.GetPendingCallsForHelpEvent, GetPendingCallsForHelpEvent.class);
this.registerHandler(Incoming.GetGuideReportingStatusEvent, GetGuideReportingStatusEvent.class);
this.registerHandler(Incoming.ChatReviewSessionCreateEvent, ChatReviewSessionCreateEvent.class);
this.registerHandler(Incoming.CallForHelpEvent, CallForHelpEvent.class);
this.registerHandler(Incoming.CallForHelpFromIMEvent, CallForHelpFromIMEvent.class);
this.registerHandler(Incoming.CallForHelpFromForumThreadEvent, CallForHelpFromForumThreadEvent.class);
this.registerHandler(Incoming.CallForHelpFromForumMessageEvent, CallForHelpFromForumMessageEvent.class);
this.registerHandler(Incoming.CallForHelpFromPhotoEvent, CallForHelpFromPhotoEvent.class);
this.registerHandler(Incoming.getPendingCallsForHelpEvent, GetPendingCallsForHelpEvent.class);
this.registerHandler(Incoming.getGuideReportingStatusEvent, GetGuideReportingStatusEvent.class);
this.registerHandler(Incoming.chatReviewSessionCreateEvent, ChatReviewSessionCreateEvent.class);
this.registerHandler(Incoming.callForHelpEvent, CallForHelpEvent.class);
this.registerHandler(Incoming.callForHelpFromIMEvent, CallForHelpFromIMEvent.class);
this.registerHandler(Incoming.callForHelpFromForumThreadEvent, CallForHelpFromForumThreadEvent.class);
this.registerHandler(Incoming.callForHelpFromForumMessageEvent, CallForHelpFromForumMessageEvent.class);
this.registerHandler(Incoming.callForHelpFromPhotoEvent, CallForHelpFromPhotoEvent.class);
}
void registerTrading() throws Exception {
this.registerHandler(Incoming.OpenTradingEvent, OpenTradingEvent.class);
this.registerHandler(Incoming.AddItemToTradeEvent, AddItemToTradeEvent.class);
this.registerHandler(Incoming.AddItemsToTradeEvent, AddItemsToTradeEvent.class);
this.registerHandler(Incoming.RemoveItemFromTradeEvent, RemoveItemFromTradeEvent.class);
this.registerHandler(Incoming.AcceptTradingEvent, AcceptTradingEvent.class);
this.registerHandler(Incoming.UnacceptTradingEvent, UnacceptTradingEvent.class);
this.registerHandler(Incoming.ConfirmAcceptTradingEvent, ConfirmAcceptTradingEvent.class);
this.registerHandler(Incoming.CloseTradingEvent, CloseTradingEvent.class);
this.registerHandler(Incoming.ConfirmDeclineTradingEvent, ConfirmDeclineTradingEvent.class);
this.registerHandler(Incoming.openTradingEvent, OpenTradingEvent.class);
this.registerHandler(Incoming.addItemToTradeEvent, AddItemToTradeEvent.class);
this.registerHandler(Incoming.addItemsToTradeEvent, AddItemsToTradeEvent.class);
this.registerHandler(Incoming.removeItemFromTradeEvent, RemoveItemFromTradeEvent.class);
this.registerHandler(Incoming.acceptTradingEvent, AcceptTradingEvent.class);
this.registerHandler(Incoming.unacceptTradingEvent, UnacceptTradingEvent.class);
this.registerHandler(Incoming.confirmAcceptTradingEvent, ConfirmAcceptTradingEvent.class);
this.registerHandler(Incoming.closeTradingEvent, CloseTradingEvent.class);
this.registerHandler(Incoming.confirmDeclineTradingEvent, ConfirmDeclineTradingEvent.class);
}
void registerGuilds() throws Exception {
this.registerHandler(Incoming.GetGuildCreationInfoEvent, GetGuildCreationInfoEvent.class);
this.registerHandler(Incoming.GetGuildEditorDataEvent, GetGuildEditorDataEvent.class);
this.registerHandler(Incoming.CreateGuildEvent, CreateGuildEvent.class);
this.registerHandler(Incoming.GetHabboGroupDetailsEvent, GetHabboGroupDetailsEvent.class);
this.registerHandler(Incoming.GetGuildEditInfoEvent, GetGuildEditInfoEvent.class);
this.registerHandler(Incoming.GetGuildMembersEvent, GetGuildMembersEvent.class);
this.registerHandler(Incoming.JoinHabboGroupEvent, JoinHabboGroupEvent.class);
this.registerHandler(Incoming.UpdateGuildIdentityEvent, UpdateGuildIdentityEvent.class);
this.registerHandler(Incoming.UpdateGuildBadgeEvent, UpdateGuildBadgeEvent.class);
this.registerHandler(Incoming.UpdateGuildColorsEvent, UpdateGuildColorsEvent.class);
this.registerHandler(Incoming.RemoveAdminRightsFromMemberEvent, RemoveAdminRightsFromMemberEvent.class);
this.registerHandler(Incoming.KickMemberEvent, KickMemberEvent.class);
this.registerHandler(Incoming.UpdateGuildSettingsEvent, UpdateGuildSettingsEvent.class);
this.registerHandler(Incoming.ApproveMembershipRequestEvent, ApproveMembershipRequestEvent.class);
this.registerHandler(Incoming.RejectMembershipRequestEvent, RejectMembershipRequestEvent.class);
this.registerHandler(Incoming.AddAdminRightsToMemberEvent, AddAdminRightsToMemberEvent.class);
this.registerHandler(Incoming.SelectFavouriteHabboGroupEvent, SelectFavouriteHabboGroupEvent.class);
this.registerHandler(Incoming.GetGuildMembershipsEvent, GetGuildMembershipsEvent.class);
this.registerHandler(Incoming.GetGuildFurniContextMenuInfoEvent, GetGuildFurniContextMenuInfoEvent.class);
this.registerHandler(Incoming.GetMemberGuildItemCountEvent, GetMemberGuildItemCountEvent.class);
this.registerHandler(Incoming.DeselectFavouriteHabboGroupEvent, DeselectFavouriteHabboGroupEvent.class);
this.registerHandler(Incoming.DeactivateGuildEvent, DeactivateGuildEvent.class);
this.registerHandler(Incoming.GetForumsListEvent, GetForumsListEvent.class);
this.registerHandler(Incoming.GetThreadsEvent, GetThreadsEvent.class);
this.registerHandler(Incoming.GetForumStatsEvent, GetForumStatsEvent.class);
this.registerHandler(Incoming.PostMessageEvent, PostMessageEvent.class);
this.registerHandler(Incoming.UpdateForumSettingsEvent, UpdateForumSettingsEvent.class);
this.registerHandler(Incoming.GetMessagesEvent, GetMessagesEvent.class);
this.registerHandler(Incoming.ModerateMessageEvent, ModerateMessageEvent.class);
this.registerHandler(Incoming.ModerateThreadEvent, ModerateThreadEvent.class);
this.registerHandler(Incoming.UpdateThreadEvent, UpdateThreadEvent.class);
this.registerHandler(Incoming.GetHabboGroupBadgesEvent, GetHabboGroupBadgesEvent.class);
this.registerHandler(Incoming.getGuildCreationInfoEvent, GetGuildCreationInfoEvent.class);
this.registerHandler(Incoming.getGuildEditorDataEvent, GetGuildEditorDataEvent.class);
this.registerHandler(Incoming.createGuildEvent, CreateGuildEvent.class);
this.registerHandler(Incoming.getHabboGroupDetailsEvent, GetHabboGroupDetailsEvent.class);
this.registerHandler(Incoming.getGuildEditInfoEvent, GetGuildEditInfoEvent.class);
this.registerHandler(Incoming.getGuildMembersEvent, GetGuildMembersEvent.class);
this.registerHandler(Incoming.joinHabboGroupEvent, JoinHabboGroupEvent.class);
this.registerHandler(Incoming.updateGuildIdentityEvent, UpdateGuildIdentityEvent.class);
this.registerHandler(Incoming.updateGuildBadgeEvent, UpdateGuildBadgeEvent.class);
this.registerHandler(Incoming.updateGuildColorsEvent, UpdateGuildColorsEvent.class);
this.registerHandler(Incoming.removeAdminRightsFromMemberEvent, RemoveAdminRightsFromMemberEvent.class);
this.registerHandler(Incoming.kickMemberEvent, KickMemberEvent.class);
this.registerHandler(Incoming.updateGuildSettingsEvent, UpdateGuildSettingsEvent.class);
this.registerHandler(Incoming.approveMembershipRequestEvent, ApproveMembershipRequestEvent.class);
this.registerHandler(Incoming.rejectMembershipRequestEvent, RejectMembershipRequestEvent.class);
this.registerHandler(Incoming.addAdminRightsToMemberEvent, AddAdminRightsToMemberEvent.class);
this.registerHandler(Incoming.selectFavouriteHabboGroupEvent, SelectFavouriteHabboGroupEvent.class);
this.registerHandler(Incoming.getGuildMembershipsEvent, GetGuildMembershipsEvent.class);
this.registerHandler(Incoming.getGuildFurniContextMenuInfoEvent, GetGuildFurniContextMenuInfoEvent.class);
this.registerHandler(Incoming.getMemberGuildItemCountEvent, GetMemberGuildItemCountEvent.class);
this.registerHandler(Incoming.deselectFavouriteHabboGroupEvent, DeselectFavouriteHabboGroupEvent.class);
this.registerHandler(Incoming.deactivateGuildEvent, DeactivateGuildEvent.class);
this.registerHandler(Incoming.getForumsListEvent, GetForumsListEvent.class);
this.registerHandler(Incoming.getThreadsEvent, GetThreadsEvent.class);
this.registerHandler(Incoming.getForumStatsEvent, GetForumStatsEvent.class);
this.registerHandler(Incoming.postMessageEvent, PostMessageEvent.class);
this.registerHandler(Incoming.updateForumSettingsEvent, UpdateForumSettingsEvent.class);
this.registerHandler(Incoming.getMessagesEvent, GetMessagesEvent.class);
this.registerHandler(Incoming.moderateMessageEvent, ModerateMessageEvent.class);
this.registerHandler(Incoming.moderateThreadEvent, ModerateThreadEvent.class);
this.registerHandler(Incoming.updateThreadEvent, UpdateThreadEvent.class);
this.registerHandler(Incoming.getHabboGroupBadgesEvent, GetHabboGroupBadgesEvent.class);
// this.registerHandler(Incoming.GuildForumDataEvent, GuildForumModerateMessageEvent.class);
// this.registerHandler(Incoming.GuildForumDataEvent, GuildForumModerateThreadEvent.class);
// this.registerHandler(Incoming.GuildForumDataEvent, GuildForumPostThreadEvent.class);
// this.registerHandler(Incoming.GuildForumDataEvent, GuildForumThreadsEvent.class);
// this.registerHandler(Incoming.GuildForumDataEvent, GuildForumThreadsMessagesEvent.class);
// this.registerHandler(Incoming.GuildForumDataEvent, GuildForumUpdateSettingsEvent.class);
// this.registerHandler(Incoming.guildForumDataEvent, GuildForumModerateMessageEvent.class);
// this.registerHandler(Incoming.guildForumDataEvent, GuildForumModerateThreadEvent.class);
// this.registerHandler(Incoming.guildForumDataEvent, GuildForumPostThreadEvent.class);
// this.registerHandler(Incoming.guildForumDataEvent, GuildForumThreadsEvent.class);
// this.registerHandler(Incoming.guildForumDataEvent, GuildForumThreadsMessagesEvent.class);
// this.registerHandler(Incoming.guildForumDataEvent, GuildForumUpdateSettingsEvent.class);
}
void registerPets() throws Exception {
this.registerHandler(Incoming.GetPetInfoEvent, GetPetInfoEvent.class);
this.registerHandler(Incoming.RemovePetFromFlatEvent, RemovePetFromFlatEvent.class);
this.registerHandler(Incoming.RespectPetEvent, RespectPetEvent.class);
this.registerHandler(Incoming.GetPetCommandsEvent, GetPetCommandsEvent.class);
this.registerHandler(Incoming.CustomizePetWithFurniEvent, CustomizePetWithFurniEvent.class);
this.registerHandler(Incoming.TogglePetRidingPermissionEvent, TogglePetRidingPermissionEvent.class);
this.registerHandler(Incoming.MountPetEvent, MountPetEvent.class);
this.registerHandler(Incoming.RemoveSaddleFromPetEvent, RemoveSaddleFromPetEvent.class);
this.registerHandler(Incoming.TogglePetBreedingPermissionEvent, TogglePetBreedingPermissionEvent.class);
this.registerHandler(Incoming.CompostPlantEvent, CompostPlantEvent.class);
this.registerHandler(Incoming.BreedPetsEvent, BreedPetsEvent.class);
this.registerHandler(Incoming.MovePetEvent, MovePetEvent.class);
this.registerHandler(Incoming.OpenPetPackageEvent, OpenPetPackageEvent.class);
this.registerHandler(Incoming.CancelPetBreedingEvent, CancelPetBreedingEvent.class);
this.registerHandler(Incoming.ConfirmPetBreedingEvent, ConfirmPetBreedingEvent.class);
this.registerHandler(Incoming.getPetInfoEvent, GetPetInfoEvent.class);
this.registerHandler(Incoming.removePetFromFlatEvent, RemovePetFromFlatEvent.class);
this.registerHandler(Incoming.respectPetEvent, RespectPetEvent.class);
this.registerHandler(Incoming.getPetCommandsEvent, GetPetCommandsEvent.class);
this.registerHandler(Incoming.customizePetWithFurniEvent, CustomizePetWithFurniEvent.class);
this.registerHandler(Incoming.togglePetRidingPermissionEvent, TogglePetRidingPermissionEvent.class);
this.registerHandler(Incoming.mountPetEvent, MountPetEvent.class);
this.registerHandler(Incoming.removeSaddleFromPetEvent, RemoveSaddleFromPetEvent.class);
this.registerHandler(Incoming.togglePetBreedingPermissionEvent, TogglePetBreedingPermissionEvent.class);
this.registerHandler(Incoming.compostPlantEvent, CompostPlantEvent.class);
this.registerHandler(Incoming.breedPetsEvent, BreedPetsEvent.class);
this.registerHandler(Incoming.movePetEvent, MovePetEvent.class);
this.registerHandler(Incoming.openPetPackageEvent, OpenPetPackageEvent.class);
this.registerHandler(Incoming.cancelPetBreedingEvent, CancelPetBreedingEvent.class);
this.registerHandler(Incoming.confirmPetBreedingEvent, ConfirmPetBreedingEvent.class);
}
void registerWired() throws Exception {
this.registerHandler(Incoming.UpdateTriggerEvent, UpdateTriggerEvent.class);
this.registerHandler(Incoming.UpdateActionEvent, UpdateActionEvent.class);
this.registerHandler(Incoming.UpdateConditionEvent, UpdateConditionEvent.class);
this.registerHandler(Incoming.ApplySnapshotEvent, ApplySnapshotEvent.class);
this.registerHandler(Incoming.updateTriggerEvent, UpdateTriggerEvent.class);
this.registerHandler(Incoming.updateActionEvent, UpdateActionEvent.class);
this.registerHandler(Incoming.updateConditionEvent, UpdateConditionEvent.class);
this.registerHandler(Incoming.applySnapshotEvent, ApplySnapshotEvent.class);
}
void registerUnknown() throws Exception {
this.registerHandler(Incoming.GetResolutionAchievementsEvent, GetResolutionAchievementsEvent.class);
this.registerHandler(Incoming.GetTalentTrackEvent, GetTalentTrackEvent.class);
this.registerHandler(Incoming.GetBadgePointLimitsEvent, GetBadgePointLimitsEvent.class);
this.registerHandler(Incoming.GetCfhStatusEvent, GetCfhStatusEvent.class);
this.registerHandler(Incoming.getResolutionAchievementsEvent, GetResolutionAchievementsEvent.class);
this.registerHandler(Incoming.getTalentTrackEvent, GetTalentTrackEvent.class);
this.registerHandler(Incoming.getBadgePointLimitsEvent, GetBadgePointLimitsEvent.class);
this.registerHandler(Incoming.getCfhStatusEvent, GetCfhStatusEvent.class);
}
void registerFloorPlanEditor() throws Exception {
this.registerHandler(Incoming.UpdateFloorPropertiesEvent, UpdateFloorPropertiesEvent.class);
this.registerHandler(Incoming.GetOccupiedTilesEvent, GetOccupiedTilesEvent.class);
this.registerHandler(Incoming.GetRoomEntryTileEvent, GetRoomEntryTileEvent.class);
this.registerHandler(Incoming.updateFloorPropertiesEvent, UpdateFloorPropertiesEvent.class);
this.registerHandler(Incoming.getOccupiedTilesEvent, GetOccupiedTilesEvent.class);
this.registerHandler(Incoming.getRoomEntryTileEvent, GetRoomEntryTileEvent.class);
}
void registerAchievements() throws Exception {
this.registerHandler(Incoming.GetAchievementsEvent, GetAchievementsEvent.class);
this.registerHandler(Incoming.RequestAchievementConfigurationEvent, RequestAchievementConfigurationEvent.class);
this.registerHandler(Incoming.getAchievementsEvent, GetAchievementsEvent.class);
this.registerHandler(Incoming.requestAchievementConfigurationEvent, RequestAchievementConfigurationEvent.class);
}
void registerGuides() throws Exception {
this.registerHandler(Incoming.GuideSessionOnDutyUpdateEvent, GuideSessionOnDutyUpdateEvent.class);
this.registerHandler(Incoming.GuideSessionCreateEvent, GuideSessionCreateEvent.class);
this.registerHandler(Incoming.GuideSessionIsTypingEvent, GuideSessionIsTypingEvent.class);
this.registerHandler(Incoming.GuideSessionReportEvent, GuideSessionReportEvent.class);
this.registerHandler(Incoming.GuideSessionFeedbackEvent, GuideSessionFeedbackEvent.class);
this.registerHandler(Incoming.GuideSessionMessageEvent, GuideSessionMessageEvent.class);
this.registerHandler(Incoming.GuideSessionRequesterCancelsEvent, GuideSessionRequesterCancelsEvent.class);
this.registerHandler(Incoming.GuideSessionGuideDecidesEvent, GuideSessionGuideDecidesEvent.class);
this.registerHandler(Incoming.GuideSessionInviteRequesterEvent, GuideSessionInviteRequesterEvent.class);
this.registerHandler(Incoming.GuideSessionGetRequesterRoomEvent, GuideSessionGetRequesterRoomEvent.class);
this.registerHandler(Incoming.GuideSessionResolvedEvent, GuideSessionResolvedEvent.class);
this.registerHandler(Incoming.guideSessionOnDutyUpdateEvent, GuideSessionOnDutyUpdateEvent.class);
this.registerHandler(Incoming.guideSessionCreateEvent, GuideSessionCreateEvent.class);
this.registerHandler(Incoming.guideSessionIsTypingEvent, GuideSessionIsTypingEvent.class);
this.registerHandler(Incoming.guideSessionReportEvent, GuideSessionReportEvent.class);
this.registerHandler(Incoming.guideSessionFeedbackEvent, GuideSessionFeedbackEvent.class);
this.registerHandler(Incoming.guideSessionMessageEvent, GuideSessionMessageEvent.class);
this.registerHandler(Incoming.guideSessionRequesterCancelsEvent, GuideSessionRequesterCancelsEvent.class);
this.registerHandler(Incoming.guideSessionGuideDecidesEvent, GuideSessionGuideDecidesEvent.class);
this.registerHandler(Incoming.guideSessionInviteRequesterEvent, GuideSessionInviteRequesterEvent.class);
this.registerHandler(Incoming.guideSessionGetRequesterRoomEvent, GuideSessionGetRequesterRoomEvent.class);
this.registerHandler(Incoming.guideSessionResolvedEvent, GuideSessionResolvedEvent.class);
this.registerHandler(Incoming.ChatReviewGuideDetachedEvent, ChatReviewGuideDetachedEvent.class);
this.registerHandler(Incoming.ChatReviewGuideDecidesOnOfferEvent, ChatReviewGuideDecidesOnOfferEvent.class);
this.registerHandler(Incoming.ChatReviewGuideVoteEvent, ChatReviewGuideVoteEvent.class);
this.registerHandler(Incoming.chatReviewGuideDetachedEvent, ChatReviewGuideDetachedEvent.class);
this.registerHandler(Incoming.chatReviewGuideDecidesOnOfferEvent, ChatReviewGuideDecidesOnOfferEvent.class);
this.registerHandler(Incoming.chatReviewGuideVoteEvent, ChatReviewGuideVoteEvent.class);
}
void registerCrafting() throws Exception {
this.registerHandler(Incoming.GetCraftingRecipeEvent, GetCraftingRecipeEvent.class);
this.registerHandler(Incoming.GetCraftableProductsEvent, GetCraftableProductsEvent.class);
this.registerHandler(Incoming.CraftEvent, CraftEvent.class);
this.registerHandler(Incoming.CraftSecretEvent, CraftSecretEvent.class);
this.registerHandler(Incoming.GetCraftingRecipesAvailableEvent, GetCraftingRecipesAvailableEvent.class);
this.registerHandler(Incoming.getCraftingRecipeEvent, GetCraftingRecipeEvent.class);
this.registerHandler(Incoming.getCraftableProductsEvent, GetCraftableProductsEvent.class);
this.registerHandler(Incoming.craftEvent, CraftEvent.class);
this.registerHandler(Incoming.craftSecretEvent, CraftSecretEvent.class);
this.registerHandler(Incoming.getCraftingRecipesAvailableEvent, GetCraftingRecipesAvailableEvent.class);
}
void registerCamera() throws Exception {
this.registerHandler(Incoming.RenderRoomEvent, RenderRoomEvent.class);
this.registerHandler(Incoming.RequestCameraConfigurationEvent, RequestCameraConfigurationEvent.class);
this.registerHandler(Incoming.PurchasePhotoEvent, PurchasePhotoEvent.class);
this.registerHandler(Incoming.RenderRoomThumbnailEvent, RenderRoomThumbnailEvent.class);
this.registerHandler(Incoming.PublishPhotoEvent, PublishPhotoEvent.class);
this.registerHandler(Incoming.renderRoomEvent, RenderRoomEvent.class);
this.registerHandler(Incoming.requestCameraConfigurationEvent, RequestCameraConfigurationEvent.class);
this.registerHandler(Incoming.purchasePhotoEvent, PurchasePhotoEvent.class);
this.registerHandler(Incoming.renderRoomThumbnailEvent, RenderRoomThumbnailEvent.class);
this.registerHandler(Incoming.publishPhotoEvent, PublishPhotoEvent.class);
}
void registerGameCenter() throws Exception {
this.registerHandler(Incoming.GetGameListEvent, GetGameListEvent.class);
this.registerHandler(Incoming.GetGameStatusEvent, GetGameStatusEvent.class);
this.registerHandler(Incoming.JoinQueueEvent, JoinQueueEvent.class);
this.registerHandler(Incoming.GetWeeklyGameRewardWinnersEvent, GetWeeklyGameRewardWinnersEvent.class);
this.registerHandler(Incoming.GameUnloadedEvent, GameUnloadedEvent.class);
this.registerHandler(Incoming.GetWeeklyGameRewardEvent, GetWeeklyGameRewardEvent.class);
this.registerHandler(Incoming.Game2GetAccountGameStatusEvent, Game2GetAccountGameStatusEvent.class);
this.registerHandler(Incoming.getGameListEvent, GetGameListEvent.class);
this.registerHandler(Incoming.getGameStatusEvent, GetGameStatusEvent.class);
this.registerHandler(Incoming.joinQueueEvent, JoinQueueEvent.class);
this.registerHandler(Incoming.getWeeklyGameRewardWinnersEvent, GetWeeklyGameRewardWinnersEvent.class);
this.registerHandler(Incoming.gameUnloadedEvent, GameUnloadedEvent.class);
this.registerHandler(Incoming.getWeeklyGameRewardEvent, GetWeeklyGameRewardEvent.class);
this.registerHandler(Incoming.game2GetAccountGameStatusEvent, Game2GetAccountGameStatusEvent.class);
}
}

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,4 @@
package com.eu.habbo.messages.incoming.events.calendar;
package com.eu.habbo.messages.incoming.campaign;
import com.eu.habbo.Emulator;
import com.eu.habbo.messages.incoming.MessageHandler;
@ -9,6 +9,7 @@ public class OpenCampaignCalendarDoorAsStaffEvent extends MessageHandler {
String campaignName = this.packet.readString();
int day = this.packet.readInt();
Emulator.getGameEnvironment().getCalendarManager().claimCalendarReward(this.client.getHabbo(), campaignName, day, false);
Emulator.getGameEnvironment().getCalendarManager().claimCalendarReward(this.client.getHabbo(), campaignName, day, true);
}
}

View File

@ -1,4 +1,4 @@
package com.eu.habbo.messages.incoming.events.calendar;
package com.eu.habbo.messages.incoming.campaign;
import com.eu.habbo.Emulator;
import com.eu.habbo.messages.incoming.MessageHandler;
@ -9,6 +9,6 @@ public class OpenCampaignCalendarDoorEvent extends MessageHandler {
String campaignName = this.packet.readString();
int day = this.packet.readInt();
Emulator.getGameEnvironment().getCalendarManager().claimCalendarReward(this.client.getHabbo(), campaignName, day, true);
Emulator.getGameEnvironment().getCalendarManager().claimCalendarReward(this.client.getHabbo(), campaignName, day, false);
}
}

View File

@ -83,7 +83,7 @@ public class RequestFriendEvent extends MessageHandler {
}
if(targetHabbo.isOnline()) {
targetHabbo.getClient().sendResponse(new NewFriendRequestComposer(this.client.getHabbo()));
targetHabbo.getClient().sendResponse(new NewFriendRequestComposer(this.client.getHabbo().getHabboInfo()));
}
Messenger.makeFriendRequest(this.client.getHabbo().getHabboInfo().getId(), targetId);

View File

@ -5,12 +5,13 @@ import com.eu.habbo.habbohotel.guilds.Guild;
import com.eu.habbo.habbohotel.guilds.GuildMember;
import com.eu.habbo.habbohotel.guilds.GuildRank;
import com.eu.habbo.habbohotel.permissions.Permission;
import com.eu.habbo.habbohotel.rooms.Room;
import com.eu.habbo.habbohotel.users.Habbo;
import com.eu.habbo.habbohotel.users.HabboInfo;
import com.eu.habbo.habbohotel.users.HabboManager;
import com.eu.habbo.messages.incoming.MessageHandler;
import com.eu.habbo.messages.outgoing.guilds.GuildMemberMgmtFailedMessageComposer;
import com.eu.habbo.messages.outgoing.guilds.HabboGroupDetailsMessageComposer;
import com.eu.habbo.messages.outgoing.guilds.GuildMembershipRejectedMessageComposer;
import com.eu.habbo.messages.outgoing.guilds.HabboGroupDetailsMessageComposer;
import com.eu.habbo.plugin.events.guilds.GuildAcceptedMembershipEvent;
public class ApproveMembershipRequestEvent extends MessageHandler {
@ -20,44 +21,44 @@ public class ApproveMembershipRequestEvent extends MessageHandler {
int userId = this.packet.readInt();
Guild guild = Emulator.getGameEnvironment().getGuildManager().getGuild(guildId);
Habbo habbo = Emulator.getGameEnvironment().getHabboManager().getHabbo(userId);
HabboInfo userInfo;
if (guild == null) return;
GuildMember groupMember = Emulator.getGameEnvironment().getGuildManager().getGuildMember(guild, this.client.getHabbo());
if (guild != null) {
GuildMember groupMember = Emulator.getGameEnvironment().getGuildManager().getGuildMember(guild, this.client.getHabbo());
if (userId == this.client.getHabbo().getHabboInfo().getId() || guild.getOwnerId() == this.client.getHabbo().getHabboInfo().getId() || groupMember.getRank().equals(GuildRank.ADMIN) || groupMember.getRank().equals(GuildRank.OWNER) || this.client.getHabbo().hasPermission(Permission.ACC_GUILD_ADMIN)) {
if (habbo.getHabboStats().hasGuild(guild.getId())) {
if (habbo != null) {
this.client.sendResponse(new GuildMemberMgmtFailedMessageComposer(guild.getId(), GuildMemberMgmtFailedMessageComposer.ALREADY_ACCEPTED));
return;
} else {
//Check the user has requested
GuildMember member = Emulator.getGameEnvironment().getGuildManager().getGuildMember(guild, habbo);
if (member == null || member.getRank().type != GuildRank.REQUESTED.type) {
this.client.sendResponse(new GuildMemberMgmtFailedMessageComposer(guild.getId(), GuildMemberMgmtFailedMessageComposer.NO_LONGER_MEMBER));
return;
} else {
GuildAcceptedMembershipEvent event = new GuildAcceptedMembershipEvent(guild, userId, habbo);
Emulator.getPluginManager().fireEvent(event);
if (!event.isCancelled()) {
habbo.getHabboStats().addGuild(guild.getId());
Emulator.getGameEnvironment().getGuildManager().joinGuild(guild, this.client, habbo.getHabboInfo().getId(), true);
guild.decreaseRequestCount();
guild.increaseMemberCount();
this.client.sendResponse(new GuildMembershipRejectedMessageComposer(guild));
Room room = habbo.getHabboInfo().getCurrentRoom();
if (room != null) {
if (room.getGuildId() == guildId) {
habbo.getClient().sendResponse(new HabboGroupDetailsMessageComposer(guild, habbo.getClient(), false, Emulator.getGameEnvironment().getGuildManager().getGuildMember(guildId, userId)));
room.refreshRightsForHabbo(habbo);
}
}
}
}
}
} else {
Emulator.getGameEnvironment().getGuildManager().joinGuild(guild, this.client, userId, true);
}
}
Habbo habbo = Emulator.getGameEnvironment().getHabboManager().getHabbo(userId);
if (habbo == null) userInfo = HabboManager.getOfflineHabboInfo(userId);
else userInfo = habbo.getHabboInfo();
if (userInfo == null || groupMember == null || userId == this.client.getHabbo().getHabboInfo().getId() || (!this.client.getHabbo().hasPermission(Permission.ACC_GUILD_ADMIN) && guild.getOwnerId() != this.client.getHabbo().getHabboInfo().getId() && !groupMember.getRank().equals(GuildRank.ADMIN) && !groupMember.getRank().equals(GuildRank.OWNER)))
return;
if (!userInfo.getHabboStats().hasGuild(guild.getId())) {
this.client.sendResponse(new GuildMemberMgmtFailedMessageComposer(guild.getId(), GuildMemberMgmtFailedMessageComposer.ALREADY_ACCEPTED));
return;
}
if (!Emulator.getGameEnvironment().getGuildManager().joinGuild(guild, this.client, userId, true)) return;
GuildMember member = Emulator.getGameEnvironment().getGuildManager().getGuildMember(guild.getId(), userId);
if (member == null || member.getRank().type != GuildRank.REQUESTED.type) {
this.client.sendResponse(new GuildMemberMgmtFailedMessageComposer(guild.getId(), GuildMemberMgmtFailedMessageComposer.NO_LONGER_MEMBER));
return;
}
GuildAcceptedMembershipEvent event = new GuildAcceptedMembershipEvent(guild, userId, userInfo);
Emulator.getPluginManager().fireEvent(event);
if (event.isCancelled()) return;
userInfo.getHabboStats().addGuild(guild.getId());
boolean joinGuild = Emulator.getGameEnvironment().getGuildManager().joinGuild(guild, this.client, userId, true);
if (!joinGuild)
guild.decreaseRequestCount();
guild.increaseMemberCount();
this.client.sendResponse(new GuildMembershipRejectedMessageComposer(guild, userId));
if (habbo != null && userInfo.isOnline() && userInfo.getCurrentRoom() != null && userInfo.getCurrentRoom().getGuildId() == guildId) {
habbo.getClient().sendResponse(new HabboGroupDetailsMessageComposer(guild, habbo.getClient(), false, Emulator.getGameEnvironment().getGuildManager().getGuildMember(guildId, userId)));
userInfo.getCurrentRoom().refreshRightsForHabbo(habbo);
}
}
}

View File

@ -17,17 +17,17 @@ public class GetMemberGuildItemCountEvent extends MessageHandler {
Guild guild = Emulator.getGameEnvironment().getGuildManager().getGuild(guildId);
if (guild != null) {
GuildMember member = Emulator.getGameEnvironment().getGuildManager().getGuildMember(guild, this.client.getHabbo());
if (userId == this.client.getHabbo().getHabboInfo().getId() || guild.getOwnerId() == this.client.getHabbo().getHabboInfo().getId() || (member != null && member.getRank().equals(GuildRank.OWNER) || member.getRank().equals(GuildRank.ADMIN)) || this.client.getHabbo().hasPermission(Permission.ACC_GUILD_ADMIN)) {
Room room = Emulator.getGameEnvironment().getRoomManager().loadRoom(guild.getRoomId());
int count = 0;
if (room != null) {
count = room.getUserFurniCount(userId);
}
this.client.sendResponse(new GuildMemberFurniCountInHQMessageComposer(userId, count));
if (guild == null) return;
GuildMember member = Emulator.getGameEnvironment().getGuildManager().getGuildMember(guild, this.client.getHabbo());
if (userId == this.client.getHabbo().getHabboInfo().getId() || guild.getOwnerId() == this.client.getHabbo().getHabboInfo().getId() || (member != null && (member.getRank().equals(GuildRank.OWNER) || member.getRank().equals(GuildRank.ADMIN))) || this.client.getHabbo().hasPermission(Permission.ACC_GUILD_ADMIN)) {
Room room = Emulator.getGameEnvironment().getRoomManager().loadRoom(guild.getRoomId());
int count = 0;
if (room != null) {
count = room.getUserFurniCount(userId);
}
this.client.sendResponse(new GuildMemberFurniCountInHQMessageComposer(userId, count));
}
}
}

View File

@ -35,7 +35,7 @@ public class KickMemberEvent extends MessageHandler {
guild.decreaseMemberCount();
if (userId != this.client.getHabbo().getHabboInfo().getId()) {
this.client.sendResponse(new GuildMembershipRejectedMessageComposer(guild));
this.client.sendResponse(new GuildMembershipRejectedMessageComposer(guild, userId));
}
Room room = Emulator.getGameEnvironment().getRoomManager().loadRoom(guild.getRoomId());

View File

@ -27,7 +27,7 @@ public class RejectMembershipRequestEvent extends MessageHandler {
guild.decreaseRequestCount();
Emulator.getGameEnvironment().getGuildManager().removeMember(guild, userId);
this.client.sendResponse(new GuildMembersComposer(guild, Emulator.getGameEnvironment().getGuildManager().getGuildMembers(guild, 0, 0, ""), this.client.getHabbo(), 0, 0, "", true, Emulator.getGameEnvironment().getGuildManager().getGuildMembersCount(guild, 0, 0, "")));
this.client.sendResponse(new GuildMembershipRejectedMessageComposer(guild));
this.client.sendResponse(new GuildMembershipRejectedMessageComposer(guild, userId));
Habbo habbo = Emulator.getGameEnvironment().getHabboManager().getHabbo(userId);
Emulator.getPluginManager().fireEvent(new GuildDeclinedMembershipEvent(guild, userId, habbo, this.client.getHabbo()));

View File

@ -2,7 +2,7 @@ package com.eu.habbo.messages.incoming.handshake;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.achievements.AchievementManager;
import com.eu.habbo.habbohotel.campaign.calendar.CalendarCampaign;
import com.eu.habbo.habbohotel.campaign.CalendarCampaign;
import com.eu.habbo.habbohotel.catalog.TargetOffer;
import com.eu.habbo.habbohotel.messenger.Messenger;
import com.eu.habbo.habbohotel.modtool.ModToolSanctionItem;
@ -25,10 +25,7 @@ import com.eu.habbo.messages.outgoing.generic.alerts.HabboBroadcastMessageCompos
import com.eu.habbo.messages.outgoing.generic.alerts.MOTDNotificationComposer;
import com.eu.habbo.messages.outgoing.habboway.nux.NoobnessLevelMessageComposer;
import com.eu.habbo.messages.outgoing.habboway.nux.InClientLinkMessageComposer;
import com.eu.habbo.messages.outgoing.handshake.EnableNotificationsComposer;
import com.eu.habbo.messages.outgoing.handshake.AuthenticationOKMessageComposer;
import com.eu.habbo.messages.outgoing.handshake.AvailabilityStatusMessageComposer;
import com.eu.habbo.messages.outgoing.handshake.PingMessageComposer;
import com.eu.habbo.messages.outgoing.handshake.*;
import com.eu.habbo.messages.outgoing.inventory.BadgePointLimitsComposer;
import com.eu.habbo.messages.outgoing.inventory.AvatarEffectsMessageComposer;
import com.eu.habbo.messages.outgoing.modtool.CfhTopicsInitComposer;

View File

@ -24,8 +24,6 @@ public class GetCurrentTimingCodeEvent extends MessageHandler {
} else {
this.client.sendResponse(new CurrentTimingCodeMessageComposer(data, s));
}
break;
}
//this.client.sendResponse(new HotelViewDataComposer("2013-05-08 13:0", "gamesmaker"));

View File

@ -66,9 +66,9 @@ public class CallForHelpEvent extends MessageHandler {
Emulator.getGameEnvironment().getModToolManager().addTicket(issue);
Emulator.getGameEnvironment().getModToolManager().updateTicketToMods(issue);
this.client.sendResponse(new CallForHelpResultMessageComposer(CallForHelpResultMessageComposer.REPORT_RECEIVED, cfhTopic.reply));
if (cfhTopic != null) {
this.client.sendResponse(new CallForHelpResultMessageComposer(CallForHelpResultMessageComposer.REPORT_RECEIVED, cfhTopic.reply));
if (cfhTopic.action != CfhActionType.MODS) {
Emulator.getThreading().run(() -> {
if (issue.state == ModToolTicketState.OPEN) {
@ -81,7 +81,7 @@ public class CallForHelpEvent extends MessageHandler {
CallForHelpEvent.this.client.sendResponse(new IssueCloseNotificationMessageComposer(cfhTopic.reply).compose());
Emulator.getGameEnvironment().getModToolManager().closeTicketAsHandled(issue, null);
}
}, 30 * 1000);
}, (long) 30 * 1000);
}
}
}
@ -111,7 +111,7 @@ public class CallForHelpEvent extends MessageHandler {
CallForHelpEvent.this.client.sendResponse(new IssueCloseNotificationMessageComposer(cfhTopic.reply).compose());
Emulator.getGameEnvironment().getModToolManager().closeTicketAsHandled(issue, null);
}
}, 30 * 1000);
}, (long) 30 * 1000);
}
}

View File

@ -35,15 +35,15 @@ public class CallForHelpFromIMEvent extends MessageHandler {
info = HabboManager.getOfflineHabboInfo(userId);
}
if (info != null) {
for (int i = 0; i < count; i++) {
int chatUserId = this.packet.readInt();
String username = this.packet.readInt() == info.getId() ? info.getUsername() : this.client.getHabbo().getHabboInfo().getUsername();
if (info == null) return;
for (int i = 0; i < count; i++) {
int chatUserId = this.packet.readInt();
String username = this.packet.readInt() == info.getId() ? info.getUsername() : this.client.getHabbo().getHabboInfo().getUsername();
chatLogs.add(new ModToolChatLog(0, chatUserId, username, this.packet.readString()));
}
chatLogs.add(new ModToolChatLog(0, chatUserId, username, this.packet.readString()));
}
ModToolIssue issue = new ModToolIssue(this.client.getHabbo().getHabboInfo().getId(), this.client.getHabbo().getHabboInfo().getUsername(), userId, info.getUsername(), 0, message, ModToolTicketType.IM);
issue.category = category;
issue.chatLogs = chatLogs;

View File

@ -18,33 +18,31 @@ public class ModAlertEvent extends MessageHandler {
String message = this.packet.readString();
int cfhTopic = this.packet.readInt();
if (this.client.getHabbo().hasPermission(Permission.ACC_SUPPORTTOOL)) {
Habbo habbo = Emulator.getGameEnvironment().getHabboManager().getHabbo(userId);
if (!this.client.getHabbo().hasPermission(Permission.ACC_SUPPORTTOOL)) return;
Habbo habbo = Emulator.getGameEnvironment().getHabboManager().getHabbo(userId);
if (habbo != null) {
ModToolSanctions modToolSanctions = Emulator.getGameEnvironment().getModToolSanctions();
if (Emulator.getConfig().getBoolean("hotel.sanctions.enabled")) {
THashMap<Integer, ArrayList<ModToolSanctionItem>> modToolSanctionItemsHashMap = Emulator.getGameEnvironment().getModToolSanctions().getSanctions(habbo.getHabboInfo().getId());
ArrayList<ModToolSanctionItem> modToolSanctionItems = modToolSanctionItemsHashMap.get(habbo.getHabboInfo().getId());
if (modToolSanctionItems != null && !modToolSanctionItems.isEmpty()) {
ModToolSanctionItem item = modToolSanctionItems.get(modToolSanctionItems.size() - 1);
if (item != null && item.probationTimestamp > 0 && item.probationTimestamp >= Emulator.getIntUnixTimestamp()) {
modToolSanctions.run(userId, this.client.getHabbo(), item.sanctionLevel, cfhTopic, message, 0, false, 0);
} else {
modToolSanctions.run(userId, this.client.getHabbo(), item.sanctionLevel, cfhTopic, message, 0, false, 0);
}
} else {
modToolSanctions.run(userId, this.client.getHabbo(), 0, cfhTopic, message, 0, false, 0);
}
} else {
habbo.alert(message);
}
} else {
this.client.sendResponse(new IssueCloseNotificationMessageComposer(Emulator.getTexts().getValue("generic.user.not_found").replace("%user%", Emulator.getConfig().getValue("hotel.player.name"))));
}
if (habbo == null) {
this.client.sendResponse(new IssueCloseNotificationMessageComposer(Emulator.getTexts().getValue("generic.user.not_found").replace("%user%", Emulator.getConfig().getValue("hotel.player.name"))));
return;
}
ModToolSanctions modToolSanctions = Emulator.getGameEnvironment().getModToolSanctions();
if (!Emulator.getConfig().getBoolean("hotel.sanctions.enabled")) {
habbo.alert(message);
return;
}
THashMap<Integer, ArrayList<ModToolSanctionItem>> modToolSanctionItemsHashMap = Emulator.getGameEnvironment().getModToolSanctions().getSanctions(habbo.getHabboInfo().getId());
ArrayList<ModToolSanctionItem> modToolSanctionItems = modToolSanctionItemsHashMap.get(habbo.getHabboInfo().getId());
if (modToolSanctionItems == null || modToolSanctionItems.isEmpty()) {
modToolSanctions.run(userId, this.client.getHabbo(), 0, cfhTopic, message, 0, false, 0);
return;
}
ModToolSanctionItem item = modToolSanctionItems.get(modToolSanctionItems.size() - 1);
if (item == null) return;
modToolSanctions.run(userId, this.client.getHabbo(), item.sanctionLevel, cfhTopic, message, 0, false, 0);
}
}

View File

@ -46,30 +46,28 @@ public class ModBanEvent extends MessageHandler {
case BAN_AVATAR_ONLY_100_YEARS:
duration = Emulator.getIntUnixTimestamp();
}
if (this.client.getHabbo().hasPermission(Permission.ACC_SUPPORTTOOL)) {
ModToolSanctions modToolSanctions = Emulator.getGameEnvironment().getModToolSanctions();
if (Emulator.getConfig().getBoolean("hotel.sanctions.enabled")) {
THashMap<Integer, ArrayList<ModToolSanctionItem>> modToolSanctionItemsHashMap = Emulator.getGameEnvironment().getModToolSanctions().getSanctions(userId);
ArrayList<ModToolSanctionItem> modToolSanctionItems = modToolSanctionItemsHashMap.get(userId);
if (modToolSanctionItems != null && !modToolSanctionItemsHashMap.isEmpty()) {
ModToolSanctionItem item = modToolSanctionItems.get(modToolSanctionItems.size() - 1);
if (item.probationTimestamp > 0 && item.probationTimestamp >= Emulator.getIntUnixTimestamp()) {
modToolSanctions.run(userId, this.client.getHabbo(), item.sanctionLevel, cfhTopic, message, 0, false, 0);
} else {
modToolSanctions.run(userId, this.client.getHabbo(), item.sanctionLevel, cfhTopic, message, 0, false, 0);
}
} else {
modToolSanctions.run(userId, this.client.getHabbo(), 0, cfhTopic, message, 0, false, 0);
}
} else {
Emulator.getGameEnvironment().getModToolManager().ban(userId, this.client.getHabbo(), message, duration, ModToolBanType.ACCOUNT, cfhTopic);
}
} else {
if (!this.client.getHabbo().hasPermission(Permission.ACC_SUPPORTTOOL)) {
ScripterManager.scripterDetected(this.client, Emulator.getTexts().getValue("scripter.warning.modtools.ban").replace("%username%", this.client.getHabbo().getHabboInfo().getUsername()));
return;
}
if (!Emulator.getConfig().getBoolean("hotel.sanctions.enabled")) {
Emulator.getGameEnvironment().getModToolManager().ban(userId, this.client.getHabbo(), message, duration, ModToolBanType.ACCOUNT, cfhTopic);
return;
}
ModToolSanctions modToolSanctions = Emulator.getGameEnvironment().getModToolSanctions();
THashMap<Integer, ArrayList<ModToolSanctionItem>> modToolSanctionItemsHashMap = Emulator.getGameEnvironment().getModToolSanctions().getSanctions(userId);
ArrayList<ModToolSanctionItem> modToolSanctionItems = modToolSanctionItemsHashMap.get(userId);
if (modToolSanctionItemsHashMap.isEmpty()) {
modToolSanctions.run(userId, this.client.getHabbo(), 0, cfhTopic, message, 0, false, 0);
return;
}
ModToolSanctionItem item = modToolSanctionItems.get(modToolSanctionItems.size() - 1);
if (item == null) return;
modToolSanctions.run(userId, this.client.getHabbo(), item.sanctionLevel, cfhTopic, message, 0, false, 0);
}
}

View File

@ -20,43 +20,37 @@ public class ModMuteEvent extends MessageHandler {
String message = this.packet.readString();
int cfhTopic = this.packet.readInt();
if (this.client.getHabbo().hasPermission(Permission.ACC_SUPPORTTOOL)) {
Habbo habbo = Emulator.getGameEnvironment().getHabboManager().getHabbo(userId);
if (!this.client.getHabbo().hasPermission(Permission.ACC_SUPPORTTOOL)) return;
if (habbo != null) {
ModToolSanctions modToolSanctions = Emulator.getGameEnvironment().getModToolSanctions();
Habbo habbo = Emulator.getGameEnvironment().getHabboManager().getHabbo(userId);
if (habbo == null) {
this.client.sendResponse(new IssueCloseNotificationMessageComposer(Emulator.getTexts().getValue("generic.user.not_found").replace("%user%", Emulator.getConfig().getValue("hotel.player.name"))));
return;
}
if (Emulator.getConfig().getBoolean("hotel.sanctions.enabled")) {
THashMap<Integer, ArrayList<ModToolSanctionItem>> modToolSanctionItemsHashMap = Emulator.getGameEnvironment().getModToolSanctions().getSanctions(habbo.getHabboInfo().getId());
ArrayList<ModToolSanctionItem> modToolSanctionItems = modToolSanctionItemsHashMap.get(habbo.getHabboInfo().getId());
ModToolSanctions modToolSanctions = Emulator.getGameEnvironment().getModToolSanctions();
if (modToolSanctionItems != null && !modToolSanctionItemsHashMap.isEmpty()) {
ModToolSanctionItem item = modToolSanctionItems.get(modToolSanctionItems.size() - 1);
if (!Emulator.getConfig().getBoolean("hotel.sanctions.enabled")) {
habbo.mute(60 * 60, false);
habbo.alert(message);
this.client.getHabbo().whisper(Emulator.getTexts().getValue("commands.succes.cmd_mute.muted").replace("%user%", habbo.getHabboInfo().getUsername()));
return;
}
if (item.probationTimestamp > 0 && item.probationTimestamp >= Emulator.getIntUnixTimestamp()) {
ModToolSanctionLevelItem modToolSanctionLevelItem = modToolSanctions.getSanctionLevelItem(item.sanctionLevel);
THashMap<Integer, ArrayList<ModToolSanctionItem>> modToolSanctionItemsHashMap = Emulator.getGameEnvironment().getModToolSanctions().getSanctions(habbo.getHabboInfo().getId());
ArrayList<ModToolSanctionItem> modToolSanctionItems = modToolSanctionItemsHashMap.get(habbo.getHabboInfo().getId());
if (modToolSanctionItems == null || modToolSanctionItemsHashMap.isEmpty()) {
modToolSanctions.run(userId, this.client.getHabbo(), 0, cfhTopic, message, 0, false, 0);
return;
}
int muteDurationTimestamp = Math.toIntExact(new Date( System.currentTimeMillis() + (modToolSanctionLevelItem.sanctionHourLength * 60 * 60)).getTime() / 1000);
ModToolSanctionItem item = modToolSanctionItems.get(modToolSanctionItems.size() - 1);
if (item == null) return;
modToolSanctions.run(userId, this.client.getHabbo(), item.sanctionLevel, cfhTopic, message, 0, true, muteDurationTimestamp);
} else {
ModToolSanctionLevelItem modToolSanctionLevelItem = modToolSanctions.getSanctionLevelItem(item.sanctionLevel);
int muteDurationTimestamp = Math.toIntExact(new Date( System.currentTimeMillis() + (modToolSanctionLevelItem.sanctionHourLength * 60 * 60)).getTime() / 1000);
modToolSanctions.run(userId, this.client.getHabbo(), item.sanctionLevel, cfhTopic, message, 0, true, muteDurationTimestamp);
}
} else {
modToolSanctions.run(userId, this.client.getHabbo(), 0, cfhTopic, message, 0, false, 0);
}
} else {
habbo.mute(60 * 60, false);
habbo.alert(message);
this.client.getHabbo().whisper(Emulator.getTexts().getValue("commands.succes.cmd_mute.muted").replace("%user%", habbo.getHabboInfo().getUsername()));
}
} else {
this.client.sendResponse(new IssueCloseNotificationMessageComposer(Emulator.getTexts().getValue("generic.user.not_found").replace("%user%", Emulator.getConfig().getValue("hotel.player.name"))));
}
if (item.probationTimestamp >= Emulator.getIntUnixTimestamp()) {
ModToolSanctionLevelItem modToolSanctionLevelItem = modToolSanctions.getSanctionLevelItem(item.sanctionLevel);
int muteDurationTimestamp = Math.toIntExact(new Date(System.currentTimeMillis() + ((long) modToolSanctionLevelItem.sanctionHourLength * 60 * 60)).getTime() / 1000);
modToolSanctions.run(userId, this.client.getHabbo(), item.sanctionLevel, cfhTopic, message, 0, true, muteDurationTimestamp);
}
}
}

View File

@ -31,12 +31,8 @@ public class ModTradingLockEvent extends MessageHandler {
if (modToolSanctionItems != null && !modToolSanctionItems.isEmpty()) {
ModToolSanctionItem item = modToolSanctionItems.get(modToolSanctionItems.size() - 1);
modToolSanctions.run(userId, this.client.getHabbo(), item.sanctionLevel, cfhTopic, message, duration, false, 0);
if (item.probationTimestamp > 0 && item.probationTimestamp >= Emulator.getIntUnixTimestamp()) {
modToolSanctions.run(userId, this.client.getHabbo(), item.sanctionLevel, cfhTopic, message, duration, false, 0);
} else {
modToolSanctions.run(userId, this.client.getHabbo(), item.sanctionLevel, cfhTopic, message, duration, false, 0);
}
} else {
modToolSanctions.run(userId, this.client.getHabbo(), 0, cfhTopic, message, duration, false, 0);
}

View File

@ -34,7 +34,7 @@ public class SetCustomStackingHeightEvent extends MessageHandler {
}
}
} else {
stackerHeight = Math.min(Math.max(stackerHeight, itemTile.z * 100), Room.MAXIMUM_FURNI_HEIGHT * 100);
stackerHeight = Math.min(Math.max(stackerHeight, itemTile.z * 100.0), Room.MAXIMUM_FURNI_HEIGHT * 100);
}
double height = 0;

View File

@ -18,7 +18,7 @@ public class ControlYoutubeDisplayPlaybackEvent extends MessageHandler {
PAUSE(2),
RESUME(3);
private int state;
private final int state;
YoutubeState(int state) {
this.state = state;
@ -80,7 +80,7 @@ public class ControlYoutubeDisplayPlaybackEvent extends MessageHandler {
case RESUME:
tv.playing = true;
tv.startedWatchingAt = Emulator.getIntUnixTimestamp();
tv.autoAdvance = Emulator.getThreading().run(new YoutubeAdvanceVideo(tv), (tv.currentVideo.getDuration() - tv.offset) * 1000);
tv.autoAdvance = Emulator.getThreading().run(new YoutubeAdvanceVideo(tv), (tv.currentVideo.getDuration() - tv.offset) * 1000L);
room.sendComposer(new YoutubeControlVideoMessageComposer(tv.getId(), 1).compose());
break;
case PREVIOUS:
@ -99,7 +99,7 @@ public class ControlYoutubeDisplayPlaybackEvent extends MessageHandler {
room.sendComposer(new YoutubeDisplayVideoMessageComposer(tv.getId(), tv.currentVideo, true, 0).compose());
tv.cancelAdvancement();
tv.autoAdvance = Emulator.getThreading().run(new YoutubeAdvanceVideo(tv), tv.currentVideo.getDuration() * 1000);
tv.autoAdvance = Emulator.getThreading().run(new YoutubeAdvanceVideo(tv), tv.currentVideo.getDuration() * 1000L);
tv.startedWatchingAt = Emulator.getIntUnixTimestamp();
tv.offset = 0;
tv.playing = true;

View File

@ -32,7 +32,7 @@ public class SetYoutubeDisplayPlaylistEvent extends MessageHandler {
HabboItem item = this.client.getHabbo().getHabboInfo().getCurrentRoom().getHabboItem(itemId);
if (item == null || !(item instanceof InteractionYoutubeTV)) return;
if (!(item instanceof InteractionYoutubeTV)) return;
Optional<YoutubeManager.YoutubePlaylist> playlist = Emulator.getGameEnvironment().getItemManager().getYoutubeManager().getPlaylistsForItemId(item.getBaseItem().getId()).stream().filter(p -> p.getId().equals(playlistId)).findAny();
@ -47,7 +47,7 @@ public class SetYoutubeDisplayPlaylistEvent extends MessageHandler {
room.updateItem(item);
room.sendComposer(new YoutubeDisplayVideoMessageComposer(itemId, video, true, 0).compose());
((InteractionYoutubeTV) item).autoAdvance = Emulator.getThreading().run(new YoutubeAdvanceVideo((InteractionYoutubeTV) item), video.getDuration() * 1000);
((InteractionYoutubeTV) item).autoAdvance = Emulator.getThreading().run(new YoutubeAdvanceVideo((InteractionYoutubeTV) item), video.getDuration() * 1000L);
item.needsUpdate(true);
}

View File

@ -157,8 +157,9 @@ public class MoveAvatarEvent extends MessageHandler {
}
}
}
} catch (Exception e) {
} catch (InterruptedException e) {
LOGGER.error("Caught exception", e);
Thread.currentThread().interrupt();
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -19,7 +19,7 @@ public class AchievementComposer extends MessageComposer {
@Override
protected ServerMessage composeInternal() {
this.response.init(Outgoing.AchievementComposer);
this.response.init(Outgoing.achievementComposer);
int achievementProgress;
AchievementLevel currentLevel;

View File

@ -18,7 +18,7 @@ public class AchievementUnlockedComposer extends MessageComposer {
@Override
protected ServerMessage composeInternal() {
this.response.init(Outgoing.HabboAchievementNotificationMessageComposer);
this.response.init(Outgoing.habboAchievementNotificationMessageComposer);
AchievementLevel level = this.achievement.getLevelForProgress(this.habbo.getHabboStats().getAchievementProgress(this.achievement));
this.response.appendInt(this.achievement.id);

View File

@ -22,7 +22,7 @@ public class AchievementsComposer extends MessageComposer {
@Override
protected ServerMessage composeInternal() {
this.response.init(Outgoing.AchievementsComposer);
this.response.init(Outgoing.achievementsComposer);
try {
this.response.appendInt(Emulator.getGameEnvironment().getAchievementManager().getAchievements().size());

View File

@ -18,7 +18,7 @@ public class TalentLevelUpComposer extends MessageComposer {
@Override
protected ServerMessage composeInternal() {
this.response.init(Outgoing.TalentLevelUpComposer);
this.response.init(Outgoing.talentLevelUpComposer);
this.response.appendString(this.talentTrackType.name());
this.response.appendInt(this.talentTrackLevel.level);

View File

@ -24,7 +24,7 @@ public class TalentTrackMessageComposer extends MessageComposer {
@Override
protected ServerMessage composeInternal() {
this.response.init(Outgoing.TalentTrackMessageComposer);
this.response.init(Outgoing.talentTrackMessageComposer);
this.response.appendString(this.type.name().toLowerCase());
LinkedHashMap<Integer, TalentTrackLevel> talentTrackLevels = Emulator.getGameEnvironment().getAchievementManager().getTalenTrackLevels(this.type);

View File

@ -17,7 +17,7 @@ public class CameraPriceComposer extends MessageComposer {
@Override
protected ServerMessage composeInternal() {
this.response.init(Outgoing.InitCameraMessageComposer);
this.response.init(Outgoing.initCameraMessageComposer);
this.response.appendInt(this.credits);
this.response.appendInt(this.points);
this.response.appendInt(this.pointsType);

View File

@ -17,7 +17,7 @@ public class CameraPublishStatusMessageComposer extends MessageComposer {
@Override
protected ServerMessage composeInternal() {
this.response.init(Outgoing.CameraPublishStatusMessageComposer);
this.response.init(Outgoing.cameraPublishStatusMessageComposer);
this.response.appendBoolean(this.isOk);
this.response.appendInt(this.cooldownSeconds);

View File

@ -7,7 +7,7 @@ import com.eu.habbo.messages.outgoing.Outgoing;
public class CameraPurchaseOKMessageComposer extends MessageComposer {
@Override
protected ServerMessage composeInternal() {
this.response.init(Outgoing.CameraPurchaseOKMessageComposer);
this.response.init(Outgoing.cameraPurchaseOKMessageComposer);
return this.response;
}
}

View File

@ -13,7 +13,7 @@ public class CameraStorageUrlMessageComposer extends MessageComposer {
@Override
protected ServerMessage composeInternal() {
this.response.init(Outgoing.CameraStorageUrlMessageComposer);
this.response.init(Outgoing.cameraStorageUrlMessageComposer);
this.response.appendString(this.URL);
return this.response;
}

View File

@ -15,7 +15,7 @@ public class CompetitionStatusMessageComposer extends MessageComposer {
@Override
protected ServerMessage composeInternal() {
this.response.init(Outgoing.CompetitionStatusMessageComposer);
this.response.init(Outgoing.competitionStatusMessageComposer);
this.response.appendBoolean(this.unknownBoolean);
this.response.appendString(this.unknownString);
return this.response;

View File

@ -7,7 +7,7 @@ import com.eu.habbo.messages.outgoing.Outgoing;
public class ThumbnailStatusMessageComposer extends MessageComposer {
@Override
protected ServerMessage composeInternal() {
this.response.init(Outgoing.ThumbnailStatusMessageComposer);
this.response.init(Outgoing.thumbnailStatusMessageComposer);
return this.response;
}
}

View File

@ -21,7 +21,7 @@ public class ApproveNameMessageComposer extends MessageComposer {
@Override
protected ServerMessage composeInternal() {
this.response.init(Outgoing.ApproveNameMessageComposer);
this.response.init(Outgoing.approveNameMessageComposer);
this.response.appendInt(this.type);
this.response.appendString(this.value);
return this.response;

View File

@ -13,7 +13,7 @@ public class BuildersClubFurniCountMessageComposer extends MessageComposer {
@Override
protected ServerMessage composeInternal() {
this.response.init(Outgoing.BuildersClubFurniCountMessageComposer);
this.response.init(Outgoing.buildersClubFurniCountMessageComposer);
this.response.appendInt(this.mode);
return this.response;
}

View File

@ -13,7 +13,7 @@ public class BundleDiscountRulesetMessageComposer extends MessageComposer {
@Override
protected ServerMessage composeInternal() {
this.response.init(Outgoing.BundleDiscountRulesetMessageComposer);
this.response.init(Outgoing.bundleDiscountRulesetMessageComposer);
this.response.appendInt(MAXIMUM_ALLOWED_ITEMS);
this.response.appendInt(DISCOUNT_BATCH_SIZE);

View File

@ -32,7 +32,7 @@ public class CatalogPageMessageComposer extends MessageComposer {
@Override
protected ServerMessage composeInternal() {
this.response.init(Outgoing.CatalogPageMessageComposer);
this.response.init(Outgoing.catalogPageMessageComposer);
this.response.appendInt(this.page.getId());
this.response.appendString(this.mode);
this.page.serialize(this.response);

View File

@ -30,7 +30,7 @@ public class CatalogPagesListComposer extends MessageComposer {
try {
List<CatalogPage> pages = Emulator.getGameEnvironment().getCatalogManager().getCatalogPages(-1, this.habbo);
this.response.init(Outgoing.CatalogPagesListComposer);
this.response.init(Outgoing.catalogPagesListComposer);
this.response.appendBoolean(true);
this.response.appendInt(0);

View File

@ -7,7 +7,7 @@ import com.eu.habbo.messages.outgoing.Outgoing;
public class CatalogPublishedMessageComposer extends MessageComposer {
@Override
protected ServerMessage composeInternal() {
this.response.init(Outgoing.CatalogPublishedMessageComposer);
this.response.init(Outgoing.catalogPublishedMessageComposer);
this.response.appendBoolean(false);
return this.response;
}

View File

@ -26,7 +26,7 @@ public class ClubGiftInfoComposer extends MessageComposer {
@Override
protected ServerMessage composeInternal() {
this.response.init(Outgoing.ClubGiftInfoComposer);
this.response.init(Outgoing.clubGiftInfoComposer);
this.response.appendInt(this.daysTillNextGift); //Days Until Next Gift
this.response.appendInt(this.availableGifts); //Gift Selectable

View File

@ -7,7 +7,7 @@ import com.eu.habbo.messages.outgoing.Outgoing;
public class GiftReceiverNotFoundComposer extends MessageComposer {
@Override
protected ServerMessage composeInternal() {
this.response.init(Outgoing.GiftReceiverNotFoundComposer);
this.response.init(Outgoing.giftReceiverNotFoundComposer);
return this.response;
}
}

View File

@ -15,7 +15,7 @@ public class GiftWrappingConfigurationComposer extends MessageComposer {
@Override
protected ServerMessage composeInternal() {
this.response.init(Outgoing.GiftWrappingConfigurationComposer);
this.response.init(Outgoing.giftWrappingConfigurationComposer);
this.response.appendBoolean(true);
this.response.appendInt(Emulator.getConfig().getInt("hotel.gifts.special.price", 2));

View File

@ -20,7 +20,7 @@ public class HabboClubOffersMessageComposer extends MessageComposer {
@Override
protected ServerMessage composeInternal() {
this.response.init(Outgoing.HabboClubOffersMessageComposer);
this.response.init(Outgoing.habboClubOffersMessageComposer);
List<ClubOffer> offers = Emulator.getGameEnvironment().getCatalogManager().getClubOffers();
this.response.appendInt(offers.size());

View File

@ -7,7 +7,7 @@ import com.eu.habbo.messages.outgoing.Outgoing;
public class LimitedEditionSoldOutComposer extends MessageComposer {
@Override
protected ServerMessage composeInternal() {
this.response.init(Outgoing.LimitedEditionSoldOutComposer);
this.response.init(Outgoing.limitedEditionSoldOutComposer);
return this.response;
}
}

View File

@ -17,7 +17,7 @@ public class NotEnoughBalanceMessageComposer extends MessageComposer {
@Override
protected ServerMessage composeInternal() {
this.response.init(Outgoing.NotEnoughBalanceMessageComposer);
this.response.init(Outgoing.notEnoughBalanceMessageComposer);
this.response.appendBoolean(this.isCredits);
this.response.appendBoolean(this.isPixels);
this.response.appendInt(this.pointsType);

View File

@ -16,7 +16,7 @@ public class PetReceivedMessageComposer extends MessageComposer {
@Override
protected ServerMessage composeInternal() {
this.response.init(Outgoing.PetReceivedMessageComposer);
this.response.init(Outgoing.petReceivedMessageComposer);
this.response.appendBoolean(this.gift);
this.pet.serialize(this.response);
return this.response;

View File

@ -14,7 +14,7 @@ public class ProductOfferComposer extends MessageComposer {
@Override
protected ServerMessage composeInternal() {
this.response.init(Outgoing.ProductOfferComposer);
this.response.init(Outgoing.productOfferComposer);
this.item.serialize(this.response);
return this.response;
}

View File

@ -16,7 +16,7 @@ public class PurchaseErrorMessageComposer extends MessageComposer {
@Override
protected ServerMessage composeInternal() {
this.response.init(Outgoing.PurchaseErrorMessageComposer);
this.response.init(Outgoing.purchaseErrorMessageComposer);
this.response.appendInt(this.error);
return this.response;
}

Some files were not shown because too many files have changed in this diff Show More