mirror of
https://git.krews.org/morningstar/Arcturus-Community.git
synced 2024-11-23 15:20:52 +01:00
Merge branch 'rand-fixes' into 'ms4-unstable'
Code cleanup See merge request morningstar/Arcturus-Community!559
This commit is contained in:
commit
668b5427b4
@ -31,16 +31,20 @@ import java.util.regex.Pattern;
|
|||||||
|
|
||||||
public final class Emulator {
|
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 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 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");
|
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 =
|
private static final String logo =
|
||||||
"\n" +
|
"\n" +
|
||||||
"███╗ ███╗ ██████╗ ██████╗ ███╗ ██╗██╗███╗ ██╗ ██████╗ ███████╗████████╗ █████╗ ██████╗ \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 int timeStarted = 0;
|
||||||
private static Runtime runtime;
|
private static Runtime runtime;
|
||||||
private static ConfigurationManager config;
|
private static ConfigurationManager config;
|
||||||
@ -217,12 +216,11 @@ public final class Emulator {
|
|||||||
MessageDigest md = MessageDigest.getInstance("MD5");// MD5
|
MessageDigest md = MessageDigest.getInstance("MD5");// MD5
|
||||||
FileInputStream fis = new FileInputStream(filepath);
|
FileInputStream fis = new FileInputStream(filepath);
|
||||||
byte[] dataBytes = new byte[1024];
|
byte[] dataBytes = new byte[1024];
|
||||||
int nread = 0;
|
int nread;
|
||||||
while ((nread = fis.read(dataBytes)) != -1)
|
while ((nread = fis.read(dataBytes)) != -1)
|
||||||
md.update(dataBytes, 0, nread);
|
md.update(dataBytes, 0, nread);
|
||||||
byte[] mdbytes = md.digest();
|
byte[] mdbytes = md.digest();
|
||||||
for (int i = 0; i < mdbytes.length; i++)
|
for (byte mdbyte : mdbytes) sb.append(Integer.toString((mdbyte & 0xff) + 0x100, 16).substring(1));
|
||||||
sb.append(Integer.toString((mdbytes[i] & 0xff) + 0x100, 16).substring(1));
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
build = "4.0 Developer Preview Branch";
|
build = "4.0 Developer Preview Branch";
|
||||||
return;
|
return;
|
||||||
@ -241,50 +239,50 @@ public final class Emulator {
|
|||||||
try {
|
try {
|
||||||
if (Emulator.getPluginManager() != null)
|
if (Emulator.getPluginManager() != null)
|
||||||
Emulator.getPluginManager().fireEvent(new EmulatorStartShutdownEvent());
|
Emulator.getPluginManager().fireEvent(new EmulatorStartShutdownEvent());
|
||||||
} catch (Exception e) {
|
} catch (Exception ignored) {
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (Emulator.cameraClient != null)
|
if (Emulator.cameraClient != null)
|
||||||
Emulator.cameraClient.disconnect();
|
Emulator.cameraClient.disconnect();
|
||||||
} catch (Exception e) {
|
} catch (Exception ignored) {
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (Emulator.rconServer != null)
|
if (Emulator.rconServer != null)
|
||||||
Emulator.rconServer.stop();
|
Emulator.rconServer.stop();
|
||||||
} catch (Exception e) {
|
} catch (Exception ignored) {
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (Emulator.gameEnvironment != null)
|
if (Emulator.gameEnvironment != null)
|
||||||
Emulator.gameEnvironment.dispose();
|
Emulator.gameEnvironment.dispose();
|
||||||
} catch (Exception e) {
|
} catch (Exception ignored) {
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (Emulator.getPluginManager() != null)
|
if (Emulator.getPluginManager() != null)
|
||||||
Emulator.getPluginManager().fireEvent(new EmulatorStoppedEvent());
|
Emulator.getPluginManager().fireEvent(new EmulatorStoppedEvent());
|
||||||
} catch (Exception e) {
|
} catch (Exception ignored) {
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (Emulator.pluginManager != null)
|
if (Emulator.pluginManager != null)
|
||||||
Emulator.pluginManager.dispose();
|
Emulator.pluginManager.dispose();
|
||||||
} catch (Exception e) {
|
} catch (Exception ignored) {
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (Emulator.config != null) {
|
if (Emulator.config != null) {
|
||||||
Emulator.config.saveToDatabase();
|
Emulator.config.saveToDatabase();
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception ignored) {
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (Emulator.gameServer != null)
|
if (Emulator.gameServer != null)
|
||||||
Emulator.gameServer.stop();
|
Emulator.gameServer.stop();
|
||||||
} catch (Exception e) {
|
} catch (Exception ignored) {
|
||||||
}
|
}
|
||||||
|
|
||||||
LOGGER.info("Stopped Arcturus Morningstar {}", version);
|
LOGGER.info("Stopped Arcturus Morningstar {}", version);
|
||||||
@ -298,7 +296,7 @@ public final class Emulator {
|
|||||||
if (Emulator.threading != null)
|
if (Emulator.threading != null)
|
||||||
|
|
||||||
Emulator.threading.shutDown();
|
Emulator.threading.shutDown();
|
||||||
} catch (Exception e) {
|
} catch (Exception ignored) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -362,7 +360,7 @@ public final class Emulator {
|
|||||||
return badgeImager;
|
return badgeImager;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static CameraClient getCameraClient() {
|
public static synchronized CameraClient getCameraClient() {
|
||||||
return cameraClient;
|
return cameraClient;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -386,17 +384,14 @@ public final class Emulator {
|
|||||||
int totalSeconds = 0;
|
int totalSeconds = 0;
|
||||||
|
|
||||||
Matcher m = Pattern.compile("(([0-9]*) (second|minute|hour|day|week|month|year))").matcher(timeString);
|
Matcher m = Pattern.compile("(([0-9]*) (second|minute|hour|day|week|month|year))").matcher(timeString);
|
||||||
Map<String,Integer> map = new HashMap<String,Integer>() {
|
Map<String,Integer> map = new HashMap<String,Integer>();
|
||||||
{
|
map.put("second", 1);
|
||||||
put("second", 1);
|
map.put("minute", 60);
|
||||||
put("minute", 60);
|
map.put("hour", 3600);
|
||||||
put("hour", 3600);
|
map.put("day", 86400);
|
||||||
put("day", 86400);
|
map.put("week", 604800);
|
||||||
put("week", 604800);
|
map.put("month", 2628000);
|
||||||
put("month", 2628000);
|
map.put("year", 31536000);
|
||||||
put("year", 31536000);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
while (m.find()) {
|
while (m.find()) {
|
||||||
try {
|
try {
|
||||||
@ -417,17 +412,14 @@ public final class Emulator {
|
|||||||
c.setTime(date);
|
c.setTime(date);
|
||||||
|
|
||||||
Matcher m = Pattern.compile("(([0-9]*) (second|minute|hour|day|week|month|year))").matcher(timeString);
|
Matcher m = Pattern.compile("(([0-9]*) (second|minute|hour|day|week|month|year))").matcher(timeString);
|
||||||
Map<String, Integer> map = new HashMap<String, Integer>() {
|
Map<String, Integer> map = new HashMap<String, Integer>();
|
||||||
{
|
map.put("second", Calendar.SECOND);
|
||||||
put("second", Calendar.SECOND);
|
map.put("minute", Calendar.MINUTE);
|
||||||
put("minute", Calendar.MINUTE);
|
map.put("hour", Calendar.HOUR);
|
||||||
put("hour", Calendar.HOUR);
|
map.put("day", Calendar.DAY_OF_MONTH);
|
||||||
put("day", Calendar.DAY_OF_MONTH);
|
map.put("week", Calendar.WEEK_OF_MONTH);
|
||||||
put("week", Calendar.WEEK_OF_MONTH);
|
map.put("month", Calendar.MONTH);
|
||||||
put("month", Calendar.MONTH);
|
map.put("year", Calendar.YEAR);
|
||||||
put("year", Calendar.YEAR);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
while (m.find()) {
|
while (m.find()) {
|
||||||
try {
|
try {
|
||||||
@ -444,6 +436,8 @@ public final class Emulator {
|
|||||||
private static String dateToUnixTimestamp(Date date) {
|
private static String dateToUnixTimestamp(Date date) {
|
||||||
String res = "";
|
String res = "";
|
||||||
Date aux = stringToDate("1970-01-01 00:00:00");
|
Date aux = stringToDate("1970-01-01 00:00:00");
|
||||||
|
if(aux == null) return null;
|
||||||
|
|
||||||
Timestamp aux1 = dateToTimeStamp(aux);
|
Timestamp aux1 = dateToTimeStamp(aux);
|
||||||
Timestamp aux2 = dateToTimeStamp(date);
|
Timestamp aux2 = dateToTimeStamp(date);
|
||||||
long difference = aux2.getTime() - aux1.getTime();
|
long difference = aux2.getTime() - aux1.getTime();
|
||||||
|
@ -20,7 +20,7 @@ public class RoomUserPetComposer extends MessageComposer {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected ServerMessage composeInternal() {
|
protected ServerMessage composeInternal() {
|
||||||
this.response.init(Outgoing.UsersComposer);
|
this.response.init(Outgoing.usersComposer);
|
||||||
this.response.appendInt(1);
|
this.response.appendInt(1);
|
||||||
this.response.appendInt(this.habbo.getHabboInfo().getId());
|
this.response.appendInt(this.habbo.getHabboInfo().getId());
|
||||||
this.response.appendString(this.habbo.getHabboInfo().getUsername());
|
this.response.appendString(this.habbo.getHabboInfo().getUsername());
|
||||||
|
@ -31,6 +31,6 @@ public class Scheduler implements Runnable {
|
|||||||
if (this.disposed)
|
if (this.disposed)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Emulator.getThreading().run(this, this.interval * 1000);
|
Emulator.getThreading().run(this, this.interval * 1000L);
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -23,7 +23,7 @@ public class TextsManager {
|
|||||||
|
|
||||||
LOGGER.info("Texts Manager -> Loaded! (" + (System.currentTimeMillis() - millis) + " MS)");
|
LOGGER.info("Texts Manager -> Loaded! (" + (System.currentTimeMillis() - millis) + " MS)");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
LOGGER.error("Caught exception", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@ import com.eu.habbo.Emulator;
|
|||||||
import com.eu.habbo.core.*;
|
import com.eu.habbo.core.*;
|
||||||
import com.eu.habbo.habbohotel.achievements.AchievementManager;
|
import com.eu.habbo.habbohotel.achievements.AchievementManager;
|
||||||
import com.eu.habbo.habbohotel.bots.BotManager;
|
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.catalog.CatalogManager;
|
||||||
import com.eu.habbo.habbohotel.commands.CommandHandler;
|
import com.eu.habbo.habbohotel.commands.CommandHandler;
|
||||||
import com.eu.habbo.habbohotel.crafting.CraftingManager;
|
import com.eu.habbo.habbohotel.crafting.CraftingManager;
|
||||||
|
@ -47,7 +47,7 @@ public class Bot implements Runnable {
|
|||||||
private int bubble;
|
private int bubble;
|
||||||
|
|
||||||
|
|
||||||
private String type;
|
private final String type;
|
||||||
|
|
||||||
|
|
||||||
private int effect;
|
private int effect;
|
||||||
|
@ -12,7 +12,7 @@ import java.text.SimpleDateFormat;
|
|||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
public class VisitorBot extends Bot {
|
public class VisitorBot extends Bot {
|
||||||
private static SimpleDateFormat DATE_FORMAT;
|
public static SimpleDateFormat DATE_FORMAT;
|
||||||
private boolean showedLog = false;
|
private boolean showedLog = false;
|
||||||
private THashSet<ModToolRoomVisit> visits = new THashSet<>(3);
|
private THashSet<ModToolRoomVisit> visits = new THashSet<>(3);
|
||||||
|
|
||||||
|
@ -1,10 +1,9 @@
|
|||||||
package com.eu.habbo.habbohotel.campaign.calendar;
|
package com.eu.habbo.habbohotel.campaign;
|
||||||
|
|
||||||
import gnu.trove.map.hash.THashMap;
|
import gnu.trove.map.hash.THashMap;
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
import java.sql.Timestamp;
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
public class CalendarCampaign {
|
public class CalendarCampaign {
|
||||||
@ -12,26 +11,26 @@ public class CalendarCampaign {
|
|||||||
private final String name;
|
private final String name;
|
||||||
private final String image;
|
private final String image;
|
||||||
private Map<Integer , CalendarRewardObject> rewards = new THashMap<>();
|
private Map<Integer , CalendarRewardObject> rewards = new THashMap<>();
|
||||||
private final Integer start_timestamp;
|
private final Integer startTimestamp;
|
||||||
private final int total_days;
|
private final int totalDays;
|
||||||
private final boolean lock_expired;
|
private final boolean lockExpired;
|
||||||
|
|
||||||
public CalendarCampaign(ResultSet set) throws SQLException {
|
public CalendarCampaign(ResultSet set) throws SQLException {
|
||||||
this.id = set.getInt("id");
|
this.id = set.getInt("id");
|
||||||
this.name = set.getString("name");
|
this.name = set.getString("name");
|
||||||
this.image = set.getString("image");
|
this.image = set.getString("image");
|
||||||
this.start_timestamp = set.getInt("start_timestamp");
|
this.startTimestamp = set.getInt("start_timestamp");
|
||||||
this.total_days = set.getInt("total_days");
|
this.totalDays = set.getInt("total_days");
|
||||||
this.lock_expired = set.getInt("lock_expired") == 1;
|
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.id = id;
|
||||||
this.name = name;
|
this.name = name;
|
||||||
this.image = image;
|
this.image = image;
|
||||||
this.start_timestamp = start_timestamp;
|
this.startTimestamp = startTimestamp;
|
||||||
this.total_days = total_days;
|
this.totalDays = totalDays;
|
||||||
this.lock_expired = lock_expired;
|
this.lockExpired = lockExpired;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getId() {
|
public int getId() {
|
||||||
@ -47,12 +46,12 @@ public class CalendarCampaign {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public Integer getStartTimestamp() {
|
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; }
|
public Map<Integer, CalendarRewardObject> getRewards() { return rewards; }
|
||||||
|
|
@ -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.Emulator;
|
||||||
import com.eu.habbo.habbohotel.users.Habbo;
|
import com.eu.habbo.habbohotel.users.Habbo;
|
||||||
@ -9,16 +9,15 @@ import org.slf4j.Logger;
|
|||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import java.sql.*;
|
import java.sql.*;
|
||||||
import java.util.*;
|
import java.time.temporal.ChronoUnit;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.*;
|
||||||
import static java.time.temporal.ChronoUnit.DAYS;
|
|
||||||
|
|
||||||
|
|
||||||
public class CalendarManager {
|
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 static double HC_MODIFIER;
|
||||||
|
|
||||||
public CalendarManager() {
|
public CalendarManager() {
|
||||||
@ -58,7 +57,7 @@ public class CalendarManager {
|
|||||||
return false;
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
@ -107,35 +106,29 @@ public class CalendarManager {
|
|||||||
public CalendarCampaign getCalendarCampaign(String campaignName) {
|
public CalendarCampaign getCalendarCampaign(String campaignName) {
|
||||||
return calendarCampaigns.values().stream().filter(cc -> Objects.equals(cc.getName(), campaignName)).findFirst().orElse(null);
|
return calendarCampaigns.values().stream().filter(cc -> Objects.equals(cc.getName(), campaignName)).findFirst().orElse(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Map<Integer, CalendarCampaign> getCalendarCampaigns() {
|
public Map<Integer, CalendarCampaign> getCalendarCampaigns() {
|
||||||
return calendarCampaigns;
|
return calendarCampaigns;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void claimCalendarReward(Habbo habbo, String campaignName, int day, boolean force) {
|
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);
|
CalendarCampaign campaign = calendarCampaigns.values().stream().filter(cc -> Objects.equals(cc.getName(), campaignName)).findFirst().orElse(null);
|
||||||
if(campaign == null) return;
|
if (campaign == null || campaign.getRewards().isEmpty() || (habbo.getHabboStats().calendarRewardsClaimed.stream().anyMatch(claimed -> claimed.getCampaignId() == campaign.getId() && claimed.getDay() == day)))
|
||||||
if (habbo.getHabboStats().calendarRewardsClaimed.stream().noneMatch(claimed -> claimed.getCampaignId() == campaign.getId() && claimed.getDay() == day)) {
|
return;
|
||||||
|
|
||||||
|
List<CalendarRewardObject> rewards = new ArrayList<>(campaign.getRewards().values());
|
||||||
|
CalendarRewardObject object = rewards.get(Emulator.getRandom().nextInt(rewards.size() - 1 + 1));
|
||||||
|
|
||||||
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;
|
if (object == null) return;
|
||||||
int daysBetween = (int) DAYS.between(new Timestamp(campaign.getStartTimestamp() * 1000L).toInstant(), new Date().toInstant());
|
long daysBetween = ChronoUnit.DAYS.between(new Timestamp(campaign.getStartTimestamp() * 1000L).toInstant(), new Date().toInstant());
|
||||||
if(daysBetween >= 0 && daysBetween <= campaign.getTotalDays()) {
|
if (((daysBetween >= 0 && daysBetween <= campaign.getTotalDays()) && (((daysBetween - day <= 2 || !campaign.getLockExpired()) && daysBetween - day >= 0)) || (force && habbo.hasPermission("acc_calendar_force")))) {
|
||||||
int diff = (daysBetween - day);
|
|
||||||
if ((((diff <= 2 || !campaign.getLockExpired()) && diff >= 0) || (force && habbo.hasPermission("acc_calendar_force")))) {
|
|
||||||
|
|
||||||
if (Emulator.getPluginManager().fireEvent(new UserClaimRewardEvent(habbo, campaign, day, object, force)).isCancelled()) {
|
if (Emulator.getPluginManager().fireEvent(new UserClaimRewardEvent(habbo, campaign, day, object, force)).isCancelled()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
habbo.getHabboStats().calendarRewardsClaimed.add(new CalendarRewardClaimed(habbo.getHabboInfo().getId(), campaign.getId(), day, object.getId(), new Timestamp(System.currentTimeMillis())));
|
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));
|
habbo.getClient().sendResponse(new CampaignCalendarDoorOpenedMessageComposer(true, object, habbo));
|
||||||
object.give(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 (?, ?, ?, ?, ?)")) {
|
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(1, habbo.getHabboInfo().getId());
|
||||||
statement.setInt(2, campaign.getId());
|
statement.setInt(2, campaign.getId());
|
||||||
@ -149,6 +142,4 @@ public class CalendarManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
package com.eu.habbo.habbohotel.campaign.calendar;
|
package com.eu.habbo.habbohotel.campaign;
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
@ -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.Emulator;
|
||||||
import com.eu.habbo.habbohotel.items.Item;
|
import com.eu.habbo.habbohotel.items.Item;
|
@ -50,139 +50,7 @@ public class CatalogManager {
|
|||||||
|
|
||||||
private static final Logger LOGGER = LoggerFactory.getLogger(CatalogManager.class);
|
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) {
|
public static final THashMap<String, Class<? extends CatalogPage>> pageDefinitions = new THashMap<>();
|
||||||
{
|
|
||||||
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 int catalogItemAmount;
|
public static int catalogItemAmount;
|
||||||
public static int PURCHASE_COOLDOWN = 1;
|
public static int PURCHASE_COOLDOWN = 1;
|
||||||
public static boolean SORT_USING_ORDERNUM = false;
|
public static boolean SORT_USING_ORDERNUM = false;
|
||||||
@ -214,7 +82,6 @@ public class CatalogManager {
|
|||||||
this.offerDefs = new TIntIntHashMap();
|
this.offerDefs = new TIntIntHashMap();
|
||||||
this.vouchers = new ArrayList<>();
|
this.vouchers = new ArrayList<>();
|
||||||
this.limitedNumbers = new THashMap<>();
|
this.limitedNumbers = new THashMap<>();
|
||||||
|
|
||||||
this.initialize();
|
this.initialize();
|
||||||
|
|
||||||
this.ecotronItem = Emulator.getGameEnvironment().getItemManager().getItem("ecotron_box");
|
this.ecotronItem = Emulator.getGameEnvironment().getItemManager().getItem("ecotron_box");
|
||||||
@ -225,7 +92,7 @@ public class CatalogManager {
|
|||||||
|
|
||||||
public synchronized void initialize() {
|
public synchronized void initialize() {
|
||||||
Emulator.getPluginManager().fireEvent(new EmulatorLoadCatalogManagerEvent());
|
Emulator.getPluginManager().fireEvent(new EmulatorLoadCatalogManagerEvent());
|
||||||
|
this.loadPageDefinitions();
|
||||||
this.loadLimitedNumbers();
|
this.loadLimitedNumbers();
|
||||||
this.loadCatalogPages();
|
this.loadCatalogPages();
|
||||||
this.loadCatalogFeaturedPages();
|
this.loadCatalogFeaturedPages();
|
||||||
@ -238,6 +105,139 @@ public class CatalogManager {
|
|||||||
this.loadGiftWrappers();
|
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() {
|
private synchronized void loadLimitedNumbers() {
|
||||||
this.limitedNumbers.clear();
|
this.limitedNumbers.clear();
|
||||||
|
|
||||||
|
@ -92,7 +92,7 @@ public class ClubOffer implements ISerialize {
|
|||||||
message.appendInt(this.pointsType);
|
message.appendInt(this.pointsType);
|
||||||
message.appendBoolean(this.vip);
|
message.appendBoolean(this.vip);
|
||||||
|
|
||||||
long seconds = this.days * 86400;
|
long seconds = this.days * 86400L;
|
||||||
|
|
||||||
long secondsTotal = seconds;
|
long secondsTotal = seconds;
|
||||||
|
|
||||||
@ -103,7 +103,7 @@ public class ClubOffer implements ISerialize {
|
|||||||
seconds -= totalMonths * (86400 * 31);
|
seconds -= totalMonths * (86400 * 31);
|
||||||
|
|
||||||
int totalDays = (int) Math.floor((int) seconds / 86400.0);
|
int totalDays = (int) Math.floor((int) seconds / 86400.0);
|
||||||
seconds -= totalDays * 86400;
|
seconds -= totalDays * 86400L;
|
||||||
|
|
||||||
message.appendInt((int) secondsTotal / 86400 / 31);
|
message.appendInt((int) secondsTotal / 86400 / 31);
|
||||||
message.appendInt((int) seconds);
|
message.appendInt((int) seconds);
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package com.eu.habbo.habbohotel.commands;
|
package com.eu.habbo.habbohotel.commands;
|
||||||
|
|
||||||
import com.eu.habbo.Emulator;
|
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.habbohotel.gameclients.GameClient;
|
||||||
import com.eu.habbo.messages.outgoing.events.calendar.CampaignCalendarDataMessageComposer;
|
import com.eu.habbo.messages.outgoing.events.calendar.CampaignCalendarDataMessageComposer;
|
||||||
import com.eu.habbo.messages.outgoing.habboway.nux.InClientLinkMessageComposer;
|
import com.eu.habbo.messages.outgoing.habboway.nux.InClientLinkMessageComposer;
|
||||||
|
@ -16,23 +16,24 @@ public class PullCommand extends Command {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean handle(GameClient gameClient, String[] params) throws Exception {
|
public boolean handle(GameClient gameClient, String[] params) throws Exception {
|
||||||
if (params.length == 2) {
|
if (params.length != 2) return true;
|
||||||
Habbo habbo = gameClient.getHabbo().getHabboInfo().getCurrentRoom().getHabbo(params[1]);
|
Habbo habbo = gameClient.getHabbo().getHabboInfo().getCurrentRoom().getHabbo(params[1]);
|
||||||
|
|
||||||
if (habbo == null) {
|
if (habbo == null) {
|
||||||
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_pull.not_found").replace("%user%", params[1]), RoomChatMessageBubbles.ALERT);
|
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_pull.not_found").replace("%user%", params[1]), RoomChatMessageBubbles.ALERT);
|
||||||
return true;
|
return true;
|
||||||
} else if (habbo == gameClient.getHabbo()) {
|
}
|
||||||
|
if (habbo == gameClient.getHabbo()) {
|
||||||
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_pull.pull_self"), RoomChatMessageBubbles.ALERT);
|
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_pull.pull_self"), RoomChatMessageBubbles.ALERT);
|
||||||
return true;
|
return true;
|
||||||
} else {
|
}
|
||||||
int distanceX = habbo.getRoomUnit().getX() - gameClient.getHabbo().getRoomUnit().getX();
|
int distanceX = habbo.getRoomUnit().getX() - gameClient.getHabbo().getRoomUnit().getX();
|
||||||
int distanceY = habbo.getRoomUnit().getY() - gameClient.getHabbo().getRoomUnit().getY();
|
int distanceY = habbo.getRoomUnit().getY() - gameClient.getHabbo().getRoomUnit().getY();
|
||||||
|
|
||||||
if (distanceX < -2 || distanceX > 2 || distanceY < -2 || distanceY > 2) {
|
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);
|
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_pull.cant_reach").replace("%user%", params[1]), RoomChatMessageBubbles.ALERT);
|
||||||
return true;
|
return true;
|
||||||
} else {
|
}
|
||||||
RoomTile tile = gameClient.getHabbo().getHabboInfo().getCurrentRoom().getLayout().getTileInFront(gameClient.getHabbo().getRoomUnit().getCurrentLocation(), gameClient.getHabbo().getRoomUnit().getBodyRotation().getValue());
|
RoomTile tile = gameClient.getHabbo().getHabboInfo().getCurrentRoom().getLayout().getTileInFront(gameClient.getHabbo().getRoomUnit().getCurrentLocation(), gameClient.getHabbo().getRoomUnit().getBodyRotation().getValue());
|
||||||
|
|
||||||
if (tile != null && tile.isWalkable()) {
|
if (tile != null && tile.isWalkable()) {
|
||||||
@ -43,10 +44,7 @@ public class PullCommand extends Command {
|
|||||||
habbo.getRoomUnit().setGoalLocation(tile);
|
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());
|
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -16,20 +16,22 @@ public class PushCommand extends Command {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean handle(GameClient gameClient, String[] params) throws Exception {
|
public boolean handle(GameClient gameClient, String[] params) throws Exception {
|
||||||
if (params.length == 2) {
|
if (params.length != 2) return true;
|
||||||
|
|
||||||
Habbo habbo = gameClient.getHabbo().getHabboInfo().getCurrentRoom().getHabbo(params[1]);
|
Habbo habbo = gameClient.getHabbo().getHabboInfo().getCurrentRoom().getHabbo(params[1]);
|
||||||
|
|
||||||
if (habbo == null) {
|
if (habbo == null) {
|
||||||
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_push.not_found").replace("%user%", params[1]), RoomChatMessageBubbles.ALERT);
|
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_push.not_found").replace("%user%", params[1]), RoomChatMessageBubbles.ALERT);
|
||||||
return true;
|
return true;
|
||||||
} else if (habbo == gameClient.getHabbo()) {
|
}
|
||||||
|
|
||||||
|
if (habbo == gameClient.getHabbo()) {
|
||||||
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_push.push_self"), RoomChatMessageBubbles.ALERT);
|
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_push.push_self"), RoomChatMessageBubbles.ALERT);
|
||||||
return true;
|
return true;
|
||||||
} else {
|
}
|
||||||
RoomTile tFront = gameClient.getHabbo().getHabboInfo().getCurrentRoom().getLayout().getTileInFront(gameClient.getHabbo().getRoomUnit().getCurrentLocation(), gameClient.getHabbo().getRoomUnit().getBodyRotation().getValue());
|
RoomTile tFront = gameClient.getHabbo().getHabboInfo().getCurrentRoom().getLayout().getTileInFront(gameClient.getHabbo().getRoomUnit().getCurrentLocation(), gameClient.getHabbo().getRoomUnit().getBodyRotation().getValue());
|
||||||
|
|
||||||
if (tFront != null && tFront.isWalkable()) {
|
if (tFront != null && tFront.isWalkable() && tFront.x == habbo.getRoomUnit().getX() && tFront.y == habbo.getRoomUnit().getY()) {
|
||||||
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());
|
RoomTile tFrontTarget = gameClient.getHabbo().getHabboInfo().getCurrentRoom().getLayout().getTileInFront(habbo.getRoomUnit().getCurrentLocation(), gameClient.getHabbo().getRoomUnit().getBodyRotation().getValue());
|
||||||
|
|
||||||
if (tFrontTarget != null && tFrontTarget.isWalkable()) {
|
if (tFrontTarget != null && tFrontTarget.isWalkable()) {
|
||||||
@ -44,10 +46,7 @@ public class PushCommand extends Command {
|
|||||||
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_push.cant_reach").replace("%user%", params[1]), RoomChatMessageBubbles.ALERT);
|
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_push.cant_reach").replace("%user%", params[1]), RoomChatMessageBubbles.ALERT);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -25,7 +25,7 @@ public class ShutdownCommand extends Command {
|
|||||||
} else {
|
} else {
|
||||||
if (params.length == 2) {
|
if (params.length == 2) {
|
||||||
try {
|
try {
|
||||||
minutes = Integer.valueOf(params[1]);
|
minutes = Integer.parseInt(params[1]);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
reason = new StringBuilder(params[1]);
|
reason = new StringBuilder(params[1]);
|
||||||
}
|
}
|
||||||
@ -44,7 +44,7 @@ public class ShutdownCommand extends Command {
|
|||||||
}
|
}
|
||||||
RoomTrade.TRADING_ENABLED = false;
|
RoomTrade.TRADING_ENABLED = false;
|
||||||
ShutdownEmulator.timestamp = Emulator.getIntUnixTimestamp() + (60 * minutes);
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -14,12 +14,11 @@ public class SoftKickCommand extends Command {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean handle(GameClient gameClient, String[] params) throws Exception {
|
public boolean handle(GameClient gameClient, String[] params) throws Exception {
|
||||||
if (params.length == 2) {
|
if (params.length != 2) return true;
|
||||||
final String username = params[1];
|
final Habbo habbo = gameClient.getHabbo().getHabboInfo().getCurrentRoom().getHabbo(params[1]);
|
||||||
final Habbo habbo = gameClient.getHabbo().getHabboInfo().getCurrentRoom().getHabbo(username);
|
|
||||||
|
|
||||||
if (habbo == null) {
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -30,12 +29,9 @@ public class SoftKickCommand extends Command {
|
|||||||
|
|
||||||
final Room room = gameClient.getHabbo().getHabboInfo().getCurrentRoom();
|
final Room room = gameClient.getHabbo().getHabboInfo().getCurrentRoom();
|
||||||
|
|
||||||
if (room != null) {
|
if (room != null && (!(habbo.hasPermission(Permission.ACC_UNKICKABLE) || habbo.hasPermission(Permission.ACC_SUPPORTTOOL) || room.isOwner(habbo)))) {
|
||||||
if (!(habbo.hasPermission(Permission.ACC_UNKICKABLE) || habbo.hasPermission(Permission.ACC_SUPPORTTOOL) || room.isOwner(habbo))) {
|
|
||||||
room.kickHabbo(habbo, false);
|
room.kickHabbo(habbo, false);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -255,7 +255,7 @@ public class FreezeGame extends Game {
|
|||||||
scoreboard.setExtradata("0");
|
scoreboard.setExtradata("0");
|
||||||
}
|
}
|
||||||
|
|
||||||
int oldScore = Integer.valueOf(scoreboard.getExtradata());
|
int oldScore = Integer.parseInt(scoreboard.getExtradata());
|
||||||
|
|
||||||
if (oldScore == totalScore)
|
if (oldScore == totalScore)
|
||||||
continue;
|
continue;
|
||||||
|
@ -38,7 +38,7 @@ public class FreezeGamePlayer extends GamePlayer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addScore(int amount) {
|
public synchronized void addScore(int amount) {
|
||||||
super.addScore(amount);
|
super.addScore(amount);
|
||||||
|
|
||||||
if (amount > 0) {
|
if (amount > 0) {
|
||||||
@ -122,10 +122,7 @@ public class FreezeGamePlayer extends GamePlayer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean canGetFrozen() {
|
public boolean canGetFrozen() {
|
||||||
if (this.isFrozen() || this.isProtected())
|
return !this.isFrozen() && !this.isProtected();
|
||||||
return false;
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addProtection() {
|
public void addProtection() {
|
||||||
|
@ -22,7 +22,7 @@ public class GuardianTicket {
|
|||||||
private final Habbo reporter;
|
private final Habbo reporter;
|
||||||
private final Habbo reported;
|
private final Habbo reported;
|
||||||
private final Date date;
|
private final Date date;
|
||||||
private ArrayList<ModToolChatLog> chatLogs;
|
private final ArrayList<ModToolChatLog> chatLogs;
|
||||||
private GuardianVoteType verdict;
|
private GuardianVoteType verdict;
|
||||||
private int timeLeft = 120;
|
private int timeLeft = 120;
|
||||||
private int resendCount = 0;
|
private int resendCount = 0;
|
||||||
@ -45,7 +45,7 @@ public class GuardianTicket {
|
|||||||
|
|
||||||
this.votes.put(guardian, new GuardianVote(this.guardianCount, guardian));
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -29,6 +29,11 @@ public class GuardianVote implements Comparable<GuardianVote> {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
return this.id;
|
||||||
|
}
|
||||||
|
|
||||||
public void ignore() {
|
public void ignore() {
|
||||||
this.ignore = true;
|
this.ignore = true;
|
||||||
}
|
}
|
||||||
|
@ -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;
|
boolean error = false;
|
||||||
try (Connection connection = Emulator.getDatabase().getDataSource().getConnection()) {
|
try (Connection connection = Emulator.getDatabase().getDataSource().getConnection()) {
|
||||||
try (PreparedStatement statement = connection.prepareStatement("SELECT COUNT(id) as total FROM guilds_members WHERE user_id = ?")) {
|
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) {
|
} catch (SQLException e) {
|
||||||
LOGGER.error("Caught SQL exception", e);
|
LOGGER.error("Caught SQL exception", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return !error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -3,9 +3,9 @@ package com.eu.habbo.habbohotel.guilds;
|
|||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
|
|
||||||
public class GuildMember implements Comparable {
|
public class GuildMember implements Comparable<GuildMember> {
|
||||||
private int userId;
|
private final int userId;
|
||||||
private String username;
|
private final String username;
|
||||||
private String look;
|
private String look;
|
||||||
private int joinDate;
|
private int joinDate;
|
||||||
private GuildRank rank;
|
private GuildRank rank;
|
||||||
@ -59,8 +59,22 @@ public class GuildMember implements Comparable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int compareTo(Object o) {
|
public int compareTo(GuildMember o) {
|
||||||
return 0;
|
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() {
|
public GuildMembershipStatus getMembershipStatus() {
|
||||||
|
@ -123,13 +123,13 @@ public class ForumThread implements Runnable, ISerialize {
|
|||||||
THashSet<ForumThread> threads = null;
|
THashSet<ForumThread> threads = null;
|
||||||
|
|
||||||
if (guildThreadsCache.containsKey(guildId)) {
|
if (guildThreadsCache.containsKey(guildId)) {
|
||||||
guildThreadsCache.get(guildId);
|
threads = guildThreadsCache.get(guildId);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (threads != null)
|
if (threads != null)
|
||||||
return threads;
|
return threads;
|
||||||
|
|
||||||
threads = new THashSet<ForumThread>();
|
threads = new THashSet<>();
|
||||||
|
|
||||||
guildThreadsCache.put(guildId, threads);
|
guildThreadsCache.put(guildId, threads);
|
||||||
|
|
||||||
@ -141,8 +141,8 @@ public class ForumThread implements Runnable, ISerialize {
|
|||||||
"WHERE `id` IN (" +
|
"WHERE `id` IN (" +
|
||||||
"SELECT MAX(id) " +
|
"SELECT MAX(id) " +
|
||||||
"FROM `guilds_forums_comments` B " +
|
"FROM `guilds_forums_comments` B " +
|
||||||
"GROUP BY `thread_id` " +
|
"GROUP BY `thread_id` AND B.`id` " +
|
||||||
"ORDER BY B.`id` ASC " +
|
"ORDER BY B.`id` " +
|
||||||
") " +
|
") " +
|
||||||
"ORDER BY `id` DESC " +
|
"ORDER BY `id` DESC " +
|
||||||
") B ON A.`id` = B.`thread_id` " +
|
") B ON A.`id` = B.`thread_id` " +
|
||||||
@ -154,9 +154,7 @@ public class ForumThread implements Runnable, ISerialize {
|
|||||||
try (ResultSet set = statement.executeQuery()) {
|
try (ResultSet set = statement.executeQuery()) {
|
||||||
while (set.next()) {
|
while (set.next()) {
|
||||||
ForumThread thread = new ForumThread(set);
|
ForumThread thread = new ForumThread(set);
|
||||||
synchronized (threads) {
|
|
||||||
threads.add(thread);
|
threads.add(thread);
|
||||||
}
|
|
||||||
cacheThread(thread);
|
cacheThread(thread);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -182,8 +180,8 @@ public class ForumThread implements Runnable, ISerialize {
|
|||||||
"WHERE `id` IN (" +
|
"WHERE `id` IN (" +
|
||||||
"SELECT MAX(id) " +
|
"SELECT MAX(id) " +
|
||||||
"FROM `guilds_forums_comments` B " +
|
"FROM `guilds_forums_comments` B " +
|
||||||
"GROUP BY `thread_id` " +
|
"GROUP BY `thread_id` AND b.`id`" +
|
||||||
"ORDER BY B.`id` ASC " +
|
"ORDER BY B.`id` " +
|
||||||
") " +
|
") " +
|
||||||
"ORDER BY `id` DESC " +
|
"ORDER BY `id` DESC " +
|
||||||
") B ON A.`id` = B.`thread_id` " +
|
") B ON A.`id` = B.`thread_id` " +
|
||||||
@ -219,11 +217,8 @@ public class ForumThread implements Runnable, ISerialize {
|
|||||||
guildThreadsCache.put(thread.guildId, guildThreads);
|
guildThreadsCache.put(thread.guildId, guildThreads);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
synchronized (guildThreads) {
|
|
||||||
guildThreads.add(thread);
|
guildThreads.add(thread);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
public static void clearCache() {
|
public static void clearCache() {
|
||||||
for (THashSet<ForumThread> threads : guildThreadsCache.values()) {
|
for (THashSet<ForumThread> threads : guildThreadsCache.values()) {
|
||||||
|
@ -15,7 +15,10 @@ import java.io.IOException;
|
|||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.io.InputStreamReader;
|
import java.io.InputStreamReader;
|
||||||
import java.net.URL;
|
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.time.Duration;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.concurrent.ExecutorService;
|
import java.util.concurrent.ExecutorService;
|
||||||
@ -118,19 +121,20 @@ public class YoutubeManager {
|
|||||||
|
|
||||||
youtubeDataLoaderPool.shutdown();
|
youtubeDataLoaderPool.shutdown();
|
||||||
try {
|
try {
|
||||||
youtubeDataLoaderPool.awaitTermination(60, TimeUnit.SECONDS);
|
if(!youtubeDataLoaderPool.awaitTermination(60, TimeUnit.SECONDS))
|
||||||
|
LOGGER.error("Youtube Manager -> Failed, timeout elapsed before termination!");
|
||||||
} catch (InterruptedException e) {
|
} 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 {
|
public YoutubePlaylist getPlaylistDataById(String playlistId) throws IOException {
|
||||||
if (this.playlistCache.containsKey(playlistId)) return this.playlistCache.get(playlistId);
|
if (this.playlistCache.containsKey(playlistId)) return this.playlistCache.get(playlistId);
|
||||||
if (apiKey.isEmpty()) return null;
|
if (apiKey.isEmpty()) return null;
|
||||||
|
|
||||||
YoutubePlaylist playlist;
|
YoutubePlaylist playlist;
|
||||||
URL playlistInfo = new URL("https://youtube.googleapis.com/youtube/v3/playlists?part=snippet&id=" + playlistId + "&maxResults=1&key=" + apiKey);
|
URL playlistInfo = new URL("https://youtube.googleapis.com/youtube/v3/playlists?part=snippet&id=" + playlistId + "&maxResults=1&key=" + apiKey);
|
||||||
HttpsURLConnection playlistCon = (HttpsURLConnection) playlistInfo.openConnection();
|
HttpsURLConnection playlistCon = (HttpsURLConnection) playlistInfo.openConnection();
|
||||||
|
@ -10,8 +10,8 @@ import com.eu.habbo.habbohotel.users.Habbo;
|
|||||||
import com.eu.habbo.habbohotel.users.HabboInfo;
|
import com.eu.habbo.habbohotel.users.HabboInfo;
|
||||||
import com.eu.habbo.habbohotel.users.HabboItem;
|
import com.eu.habbo.habbohotel.users.HabboItem;
|
||||||
import com.eu.habbo.habbohotel.users.HabboManager;
|
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.ObjectsMessageComposer;
|
||||||
|
import com.eu.habbo.messages.outgoing.rooms.items.RemoveFloorItemComposer;
|
||||||
import gnu.trove.TCollections;
|
import gnu.trove.TCollections;
|
||||||
import gnu.trove.map.TIntObjectMap;
|
import gnu.trove.map.TIntObjectMap;
|
||||||
import gnu.trove.map.hash.THashMap;
|
import gnu.trove.map.hash.THashMap;
|
||||||
@ -24,37 +24,29 @@ import java.util.ArrayList;
|
|||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
|
||||||
public class InteractionBuildArea extends InteractionCustomValues {
|
public class InteractionBuildArea extends InteractionCustomValues {
|
||||||
public static THashMap<String, String> defaultValues = new THashMap<String, String>() {
|
protected static final THashMap<String, String> defaultValues = new THashMap<String, String>();
|
||||||
{
|
|
||||||
this.put("tilesLeft", "0");
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
private final THashSet<RoomTile> tiles;
|
||||||
this.put("tilesRight", "0");
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
|
||||||
this.put("tilesFront", "0");
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
|
||||||
this.put("tilesBack", "0");
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
|
||||||
this.put("builders", "");
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
private THashSet<RoomTile> tiles;
|
|
||||||
|
|
||||||
public InteractionBuildArea(ResultSet set, Item baseItem) throws SQLException {
|
public InteractionBuildArea(ResultSet set, Item baseItem) throws SQLException {
|
||||||
super(set, baseItem, defaultValues);
|
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<>();
|
tiles = new THashSet<>();
|
||||||
}
|
}
|
||||||
|
|
||||||
public InteractionBuildArea(int id, int userId, Item item, String extradata, int limitedStack, int limitedSells) {
|
public InteractionBuildArea(int id, int userId, Item item, String extradata, int limitedStack, int limitedSells) {
|
||||||
super(id, userId, item, extradata, limitedStack, limitedSells, defaultValues);
|
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<>();
|
tiles = new THashSet<>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -22,7 +22,8 @@ public class InteractionTrap extends InteractionDefault {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onWalkOn(RoomUnit roomUnit, Room room, Object[] objects) throws Exception {
|
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);
|
Habbo habbo = room.getHabbo(roomUnit);
|
||||||
int effect = habbo.getClient().getHabbo().getRoomUnit().getEffectId();
|
int effect = habbo.getClient().getHabbo().getRoomUnit().getEffectId();
|
||||||
roomUnit.stopWalking();
|
roomUnit.stopWalking();
|
||||||
@ -33,11 +34,9 @@ public class InteractionTrap extends InteractionDefault {
|
|||||||
delay = 3000;
|
delay = 3000;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (roomUnit != null) {
|
|
||||||
if (this.getBaseItem().getEffectF() > 0 || this.getBaseItem().getEffectM() > 0) {
|
if (this.getBaseItem().getEffectF() > 0 || this.getBaseItem().getEffectM() > 0) {
|
||||||
if (roomUnit.getRoomUnitType().equals(RoomUnitType.USER)) {
|
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()) {
|
if (habbo.getHabboInfo().getGender().equals(HabboGender.M) && this.getBaseItem().getEffectM() > 0 && habbo.getRoomUnit().getEffectId() != this.getBaseItem().getEffectM()) {
|
||||||
room.giveEffect(habbo, this.getBaseItem().getEffectM(), -1);
|
room.giveEffect(habbo, this.getBaseItem().getEffectM(), -1);
|
||||||
return;
|
return;
|
||||||
@ -55,9 +54,7 @@ public class InteractionTrap extends InteractionDefault {
|
|||||||
roomUnit.setCanWalk(true);
|
roomUnit.setCanWalk(true);
|
||||||
room.giveEffect(roomUnit, effect, -1);
|
room.giveEffect(roomUnit, effect, -1);
|
||||||
}, delay);
|
}, delay);
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
package com.eu.habbo.habbohotel.items.interactions;
|
package com.eu.habbo.habbohotel.items.interactions;
|
||||||
|
|
||||||
import com.eu.habbo.Emulator;
|
|
||||||
import com.eu.habbo.habbohotel.gameclients.GameClient;
|
import com.eu.habbo.habbohotel.gameclients.GameClient;
|
||||||
import com.eu.habbo.habbohotel.items.Item;
|
import com.eu.habbo.habbohotel.items.Item;
|
||||||
import com.eu.habbo.habbohotel.rooms.Room;
|
import com.eu.habbo.habbohotel.rooms.Room;
|
||||||
@ -18,7 +17,7 @@ public class InteractionVoteCounter extends HabboItem {
|
|||||||
|
|
||||||
private boolean frozen;
|
private boolean frozen;
|
||||||
private int votes;
|
private int votes;
|
||||||
private List<Integer> votedUsers;
|
private final List<Integer> votedUsers;
|
||||||
|
|
||||||
public InteractionVoteCounter(ResultSet set, Item baseItem) throws SQLException {
|
public InteractionVoteCounter(ResultSet set, Item baseItem) throws SQLException {
|
||||||
super(set, baseItem);
|
super(set, baseItem);
|
||||||
@ -69,7 +68,7 @@ public class InteractionVoteCounter extends HabboItem {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onClick(GameClient client, Room room, Object[] objects) throws Exception {
|
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;
|
return;
|
||||||
|
|
||||||
this.frozen = !this.frozen;
|
this.frozen = !this.frozen;
|
||||||
|
@ -75,6 +75,7 @@ public class InteractionWater extends InteractionDefault {
|
|||||||
public void onWalkOn(RoomUnit roomUnit, Room room, Object[] objects) throws Exception {
|
public void onWalkOn(RoomUnit roomUnit, Room room, Object[] objects) throws Exception {
|
||||||
super.onWalkOn(roomUnit, room, objects);
|
super.onWalkOn(roomUnit, room, objects);
|
||||||
|
|
||||||
|
if(roomUnit == null) return;
|
||||||
roomUnit.isSwimming = true;
|
roomUnit.isSwimming = true;
|
||||||
|
|
||||||
Pet pet = room.getPet(roomUnit);
|
Pet pet = room.getPet(roomUnit);
|
||||||
|
@ -36,7 +36,7 @@ public class InteractionWiredHighscore extends HabboItem {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
String name = this.getBaseItem().getName().split("_")[1].toUpperCase().split("\\*")[0];
|
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.scoreType = WiredHighscoreScoreType.valueOf(name);
|
||||||
this.clearType = WiredHighscoreClearType.values()[ctype];
|
this.clearType = WiredHighscoreClearType.values()[ctype];
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
@ -54,7 +54,7 @@ public class InteractionWiredHighscore extends HabboItem {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
String name = this.getBaseItem().getName().split("_")[1].toUpperCase().split("\\*")[0];
|
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.scoreType = WiredHighscoreScoreType.valueOf(name);
|
||||||
this.clearType = WiredHighscoreClearType.values()[ctype];
|
this.clearType = WiredHighscoreClearType.values()[ctype];
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
@ -81,7 +81,7 @@ public class InteractionWiredHighscore extends HabboItem {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onClick(GameClient client, Room room, Object[] objects) throws Exception {
|
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;
|
return;
|
||||||
|
|
||||||
if (this.getExtradata() == null || this.getExtradata().isEmpty() || this.getExtradata().length() == 0) {
|
if (this.getExtradata() == null || this.getExtradata().isEmpty() || this.getExtradata().length() == 0) {
|
||||||
@ -89,7 +89,7 @@ public class InteractionWiredHighscore extends HabboItem {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
int state = Integer.valueOf(this.getExtradata());
|
int state = Integer.parseInt(this.getExtradata());
|
||||||
this.setExtradata(Math.abs(state - 1) + "");
|
this.setExtradata(Math.abs(state - 1) + "");
|
||||||
room.updateItem(this);
|
room.updateItem(this);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
@ -63,8 +63,7 @@ public class InteractionBattleBanzaiPuck extends InteractionPushable {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getNextRollDelay(int currentStep, int totalSteps) {
|
public int getNextRollDelay(int currentStep, int totalSteps) {
|
||||||
int t = 2500;
|
return (totalSteps == 1) ? 500 : 100 + (currentStep * 100);
|
||||||
return (totalSteps == 1) ? 500 : 100 * ((t = t / t - 1) * t * t * t * t + 1) + (currentStep * 100);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -167,7 +167,7 @@ public class InteractionFootball extends InteractionPushable {
|
|||||||
BigDecimal topItemHeight = BigDecimal.valueOf(topItem.getZ() + topItem.getBaseItem().getHeight());
|
BigDecimal topItemHeight = BigDecimal.valueOf(topItem.getZ() + topItem.getBaseItem().getHeight());
|
||||||
BigDecimal ballHeight = BigDecimal.valueOf(this.getZ());
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -71,7 +71,7 @@ public class InteractionPetToy extends InteractionDefault {
|
|||||||
pet.getRoomUnit().clearStatus();
|
pet.getRoomUnit().clearStatus();
|
||||||
new PetClearPosture(pet, RoomUnitStatus.PLAY, null, true).run();
|
new PetClearPosture(pet, RoomUnitStatus.PLAY, null, true).run();
|
||||||
pet.packetUpdate = true;
|
pet.packetUpdate = true;
|
||||||
}, 2500 + (Emulator.getRandom().nextInt(20) * 500));
|
}, ((long)(Emulator.getRandom().nextInt(20) * 500) + 2500));
|
||||||
this.setExtradata("1");
|
this.setExtradata("1");
|
||||||
room.updateItemState(this);
|
room.updateItemState(this);
|
||||||
}
|
}
|
||||||
|
@ -1,14 +1,10 @@
|
|||||||
package com.eu.habbo.habbohotel.items.interactions.pets;
|
package com.eu.habbo.habbohotel.items.interactions.pets;
|
||||||
|
|
||||||
import com.eu.habbo.Emulator;
|
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.Item;
|
||||||
import com.eu.habbo.habbohotel.items.interactions.InteractionDefault;
|
import com.eu.habbo.habbohotel.items.interactions.InteractionDefault;
|
||||||
import com.eu.habbo.habbohotel.pets.Pet;
|
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.rooms.*;
|
||||||
import com.eu.habbo.habbohotel.users.Habbo;
|
|
||||||
import com.eu.habbo.habbohotel.users.HabboItem;
|
|
||||||
import com.eu.habbo.threading.runnables.PetClearPosture;
|
import com.eu.habbo.threading.runnables.PetClearPosture;
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
@ -69,7 +65,7 @@ public class InteractionPetTree extends InteractionDefault {
|
|||||||
}
|
}
|
||||||
pet.getRoomUnit().setCanWalk(true);
|
pet.getRoomUnit().setCanWalk(true);
|
||||||
pet.packetUpdate = true;
|
pet.packetUpdate = true;
|
||||||
}, 2500 + (Emulator.getRandom().nextInt(20) * 500));
|
}, (long) 2500 + (Emulator.getRandom().nextInt(20) * 500));
|
||||||
} else {
|
} else {
|
||||||
pet.getRoomUnit().setRotation(RoomUserRotation.values()[this.getRotation()]);
|
pet.getRoomUnit().setRotation(RoomUserRotation.values()[this.getRotation()]);
|
||||||
pet.getRoomUnit().clearStatus();
|
pet.getRoomUnit().clearStatus();
|
||||||
|
@ -51,7 +51,7 @@ public class InteractionTotemLegs extends InteractionDefault {
|
|||||||
public void onClick(GameClient client, Room room, Object[] objects) throws Exception {
|
public void onClick(GameClient client, Room room, Object[] objects) throws Exception {
|
||||||
super.onClick(client, room, objects);
|
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;
|
return;
|
||||||
|
|
||||||
updateHead(room, room.getLayout().getTile(this.getX(), this.getY()));
|
updateHead(room, room.getLayout().getTile(this.getX(), this.getY()));
|
||||||
|
@ -56,7 +56,7 @@ public class WiredEffectBotTeleport extends InteractionWiredEffect {
|
|||||||
|
|
||||||
roomUnit.getRoom().unIdle(roomUnit.getRoom().getHabbo(roomUnit));
|
roomUnit.getRoom().unIdle(roomUnit.getRoom().getHabbo(roomUnit));
|
||||||
room.sendComposer(new AvatarEffectMessageComposer(roomUnit, 4).compose());
|
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()) {
|
if (tile == roomUnit.getCurrentLocation()) {
|
||||||
return;
|
return;
|
||||||
@ -218,14 +218,14 @@ public class WiredEffectBotTeleport extends InteractionWiredEffect {
|
|||||||
String[] wiredDataSplit = set.getString("wired_data").split("\t");
|
String[] wiredDataSplit = set.getString("wired_data").split("\t");
|
||||||
|
|
||||||
if (wiredDataSplit.length >= 2) {
|
if (wiredDataSplit.length >= 2) {
|
||||||
this.setDelay(Integer.valueOf(wiredDataSplit[0]));
|
this.setDelay(Integer.parseInt(wiredDataSplit[0]));
|
||||||
String[] data = wiredDataSplit[1].split(";");
|
String[] data = wiredDataSplit[1].split(";");
|
||||||
|
|
||||||
if (data.length > 1) {
|
if (data.length > 1) {
|
||||||
this.botName = data[0];
|
this.botName = data[0];
|
||||||
|
|
||||||
for (int i = 1; i < data.length; i++) {
|
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)
|
if (item != null)
|
||||||
this.items.add(item);
|
this.items.add(item);
|
||||||
|
@ -57,7 +57,7 @@ public class WiredEffectTeleport extends InteractionWiredEffect {
|
|||||||
|
|
||||||
roomUnit.getRoom().unIdle(roomUnit.getRoom().getHabbo(roomUnit));
|
roomUnit.getRoom().unIdle(roomUnit.getRoom().getHabbo(roomUnit));
|
||||||
room.sendComposer(new AvatarEffectMessageComposer(roomUnit, 4).compose());
|
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()) {
|
if (tile == roomUnit.getCurrentLocation()) {
|
||||||
return;
|
return;
|
||||||
@ -111,14 +111,11 @@ public class WiredEffectTeleport extends InteractionWiredEffect {
|
|||||||
message.appendInt(this.getDelay());
|
message.appendInt(this.getDelay());
|
||||||
if (this.requiresTriggeringUser()) {
|
if (this.requiresTriggeringUser()) {
|
||||||
List<Integer> invalidTriggers = new ArrayList<>();
|
List<Integer> invalidTriggers = new ArrayList<>();
|
||||||
room.getRoomSpecialTypes().getTriggers(this.getX(), this.getY()).forEach(new TObjectProcedure<InteractionWiredTrigger>() {
|
room.getRoomSpecialTypes().getTriggers(this.getX(), this.getY()).forEach(object -> {
|
||||||
@Override
|
|
||||||
public boolean execute(InteractionWiredTrigger object) {
|
|
||||||
if (!object.isTriggeredByRoomUnit()) {
|
if (!object.isTriggeredByRoomUnit()) {
|
||||||
invalidTriggers.add(object.getId());
|
invalidTriggers.add(object.getId());
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
|
||||||
});
|
});
|
||||||
message.appendInt(invalidTriggers.size());
|
message.appendInt(invalidTriggers.size());
|
||||||
for (Integer i : invalidTriggers) {
|
for (Integer i : invalidTriggers) {
|
||||||
|
@ -15,6 +15,7 @@ import gnu.trove.map.hash.TIntIntHashMap;
|
|||||||
import gnu.trove.map.hash.TIntObjectHashMap;
|
import gnu.trove.map.hash.TIntObjectHashMap;
|
||||||
import gnu.trove.procedure.TIntObjectProcedure;
|
import gnu.trove.procedure.TIntObjectProcedure;
|
||||||
import gnu.trove.set.hash.THashSet;
|
import gnu.trove.set.hash.THashSet;
|
||||||
|
import org.apache.commons.lang3.EnumUtils;
|
||||||
import org.apache.commons.math3.distribution.NormalDistribution;
|
import org.apache.commons.math3.distribution.NormalDistribution;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
@ -142,7 +143,7 @@ public class PetManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static NormalDistribution getNormalDistributionForBreeding(int levelOne, int levelTwo) {
|
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) {
|
public static NormalDistribution getNormalDistributionForBreeding(double avgLevel) {
|
||||||
@ -236,7 +237,7 @@ public class PetManager {
|
|||||||
while (set.next()) {
|
while (set.next()) {
|
||||||
if (set.getInt("pet_id") >= 0) {
|
if (set.getInt("pet_id") >= 0) {
|
||||||
if (this.petData.containsKey(set.getInt("pet_id"))) {
|
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) {
|
if (petVocalsType != null) {
|
||||||
this.petData.get(set.getInt("pet_id")).petVocals.get(petVocalsType).add(new PetVocal(set.getString("message")));
|
this.petData.get(set.getInt("pet_id")).petVocals.get(petVocalsType).add(new PetVocal(set.getString("message")));
|
||||||
@ -315,7 +316,7 @@ public class PetManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
int petId = Integer.valueOf(petName.split("t")[1]);
|
int petId = Integer.parseInt(petName.split("t")[1]);
|
||||||
return this.petRaces.get(petId);
|
return this.petRaces.get(petId);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
LOGGER.error("Caught exception", e);
|
LOGGER.error("Caught exception", e);
|
||||||
@ -333,9 +334,7 @@ public class PetManager {
|
|||||||
|
|
||||||
TIntObjectHashMap<ArrayList<PetBreedingReward>> offspringList = this.breedingReward.get(pet.getPetData().getType());
|
TIntObjectHashMap<ArrayList<PetBreedingReward>> offspringList = this.breedingReward.get(pet.getPetData().getType());
|
||||||
|
|
||||||
offspringList.forEachEntry(new TIntObjectProcedure<ArrayList<PetBreedingReward>>() {
|
offspringList.forEachEntry((i, petBreedingRewards) -> {
|
||||||
@Override
|
|
||||||
public boolean execute(int i, ArrayList<PetBreedingReward> petBreedingRewards) {
|
|
||||||
for (PetBreedingReward reward : petBreedingRewards) {
|
for (PetBreedingReward reward : petBreedingRewards) {
|
||||||
if (reward.breed == pet.getRace()) {
|
if (reward.breed == pet.getRace()) {
|
||||||
rarityLevel[0] = i;
|
rarityLevel[0] = i;
|
||||||
@ -344,7 +343,6 @@ public class PetManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
return 4 - rarityLevel[0];
|
return 4 - rarityLevel[0];
|
||||||
@ -399,17 +397,17 @@ public class PetManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public Pet createPet(Item item, String name, String race, String color, GameClient client) {
|
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)) {
|
if (this.petData.containsKey(type)) {
|
||||||
Pet pet;
|
Pet pet;
|
||||||
if (type == 15)
|
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)
|
else if (type == 16)
|
||||||
pet = this.createMonsterplant(null, client.getHabbo(), false, null, 0);
|
pet = this.createMonsterplant(null, client.getHabbo(), false, null, 0);
|
||||||
else
|
else
|
||||||
pet = new Pet(type,
|
pet = new Pet(type,
|
||||||
Integer.valueOf(race),
|
Integer.parseInt(race),
|
||||||
color,
|
color,
|
||||||
name,
|
name,
|
||||||
client.getHabbo().getHabboInfo().getId()
|
client.getHabbo().getHabboInfo().getId()
|
||||||
|
@ -36,6 +36,6 @@ public class ActionDown extends PetAction {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -20,7 +20,7 @@ public class ActionJump extends PetAction {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Pet pet, Habbo habbo, String[] data) {
|
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.clearPosture();
|
||||||
pet.setTask(PetTasks.JUMP);
|
pet.setTask(PetTasks.JUMP);
|
||||||
|
@ -33,13 +33,13 @@ import com.eu.habbo.habbohotel.wired.WiredTriggerType;
|
|||||||
import com.eu.habbo.messages.ISerialize;
|
import com.eu.habbo.messages.ISerialize;
|
||||||
import com.eu.habbo.messages.ServerMessage;
|
import com.eu.habbo.messages.ServerMessage;
|
||||||
import com.eu.habbo.messages.outgoing.MessageComposer;
|
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.GenericErrorComposer;
|
||||||
|
import com.eu.habbo.messages.outgoing.generic.alerts.HabboBroadcastMessageComposer;
|
||||||
import com.eu.habbo.messages.outgoing.guilds.HabboGroupDetailsMessageComposer;
|
import com.eu.habbo.messages.outgoing.guilds.HabboGroupDetailsMessageComposer;
|
||||||
import com.eu.habbo.messages.outgoing.hotelview.CloseConnectionMessageComposer;
|
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.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.QuestionAnsweredComposer;
|
||||||
import com.eu.habbo.messages.outgoing.polls.infobus.QuestionComposer;
|
import com.eu.habbo.messages.outgoing.polls.infobus.QuestionComposer;
|
||||||
import com.eu.habbo.messages.outgoing.rooms.*;
|
import com.eu.habbo.messages.outgoing.rooms.*;
|
||||||
@ -4168,7 +4168,7 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void giveEffect(RoomUnit roomUnit, int effectId, int duration) {
|
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);
|
Habbo habbo = roomUnit.getRoom().getHabbo(roomUnit);
|
||||||
|
|
||||||
@ -4718,8 +4718,10 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
|
|||||||
if (oldLocation != tile) {
|
if (oldLocation != tile) {
|
||||||
for (RoomTile t : occupiedTiles) {
|
for (RoomTile t : occupiedTiles) {
|
||||||
HabboItem tileTopItem = this.getTopItemAt(t.x, t.y);
|
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;
|
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 (checkForUnits) {
|
||||||
@ -4783,7 +4785,8 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (height > MAXIMUM_FURNI_HEIGHT) return FurnitureMovementError.CANT_STACK;
|
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 < this.getLayout().getHeightAtSquare(tile.x, tile.y))
|
||||||
|
return FurnitureMovementError.CANT_STACK; //prevent furni going under the floor
|
||||||
|
|
||||||
if (Emulator.getPluginManager().isRegistered(FurnitureBuildheightEvent.class, true)) {
|
if (Emulator.getPluginManager().isRegistered(FurnitureBuildheightEvent.class, true)) {
|
||||||
FurnitureBuildheightEvent event = Emulator.getPluginManager().fireEvent(new FurnitureBuildheightEvent(item, actor, 0.00, height));
|
FurnitureBuildheightEvent event = Emulator.getPluginManager().fireEvent(new FurnitureBuildheightEvent(item, actor, 0.00, height));
|
||||||
@ -4793,7 +4796,8 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (height > MAXIMUM_FURNI_HEIGHT) return FurnitureMovementError.CANT_STACK;
|
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 < this.getLayout().getHeightAtSquare(tile.x, tile.y))
|
||||||
|
return FurnitureMovementError.CANT_STACK; //prevent furni going under the floor
|
||||||
|
|
||||||
item.setX(tile.x);
|
item.setX(tile.x);
|
||||||
item.setY(tile.y);
|
item.setY(tile.y);
|
||||||
|
@ -39,7 +39,7 @@ public class RoomChatMessage implements Runnable, ISerialize, DatabaseLoggable {
|
|||||||
private byte emotion;
|
private byte emotion;
|
||||||
|
|
||||||
public RoomChatMessage(MessageHandler message) {
|
public RoomChatMessage(MessageHandler message) {
|
||||||
if (message.packet.getMessageId() == Incoming.WhisperEvent) {
|
if (message.packet.getMessageId() == Incoming.whisperEvent) {
|
||||||
String data = message.packet.readString();
|
String data = message.packet.readString();
|
||||||
this.targetHabbo = message.client.getHabbo().getHabboInfo().getCurrentRoom().getHabbo(data.split(" ")[0]);
|
this.targetHabbo = message.client.getHabbo().getHabboInfo().getCurrentRoom().getHabbo(data.split(" ")[0]);
|
||||||
this.message = data.substring(data.split(" ")[0].length() + 1);
|
this.message = data.substring(data.split(" ")[0].length() + 1);
|
||||||
|
@ -952,7 +952,7 @@ public class RoomManager {
|
|||||||
habbo.getRoomUnit().isKicked = false;
|
habbo.getRoomUnit().isKicked = false;
|
||||||
|
|
||||||
if (room.getOwnerId() != habbo.getHabboInfo().getId()) {
|
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);
|
habbo.getMessenger().connectionChanged(habbo, habbo.isOnline(), false);
|
||||||
@ -1220,7 +1220,7 @@ public class RoomManager {
|
|||||||
public ArrayList<Room> getRoomsVisited(Habbo habbo, boolean includeSelf, int limit) {
|
public ArrayList<Room> getRoomsVisited(Habbo habbo, boolean includeSelf, int limit) {
|
||||||
ArrayList<Room> rooms = new ArrayList<>();
|
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(1, habbo.getHabboInfo().getId());
|
||||||
statement.setInt(2, Emulator.getIntUnixTimestamp() - 259200);
|
statement.setInt(2, Emulator.getIntUnixTimestamp() - 259200);
|
||||||
statement.setInt(3, (includeSelf ? 0 : habbo.getHabboInfo().getId()));
|
statement.setInt(3, (includeSelf ? 0 : habbo.getHabboInfo().getId()));
|
||||||
@ -1289,7 +1289,7 @@ public class RoomManager {
|
|||||||
|
|
||||||
Collections.sort(rooms);
|
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) {
|
public ArrayList<Room> getRoomsWithRights(Habbo habbo) {
|
||||||
|
@ -630,11 +630,7 @@ public class RoomSpecialTypes {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public InteractionFreezeExitTile getFreezeExitTile() {
|
public InteractionFreezeExitTile getFreezeExitTile() {
|
||||||
for (InteractionFreezeExitTile t : this.freezeExitTile.values()) {
|
return this.freezeExitTile.values().stream().findFirst().orElse(null);
|
||||||
return t;
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public InteractionFreezeExitTile getRandomFreezeExitTile() {
|
public InteractionFreezeExitTile getRandomFreezeExitTile() {
|
||||||
|
@ -115,8 +115,8 @@ public class RoomTile {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public double distance(RoomTile roomTile) {
|
public double distance(RoomTile roomTile) {
|
||||||
double x = this.x - roomTile.x;
|
double x = (double) this.x - roomTile.x;
|
||||||
double y = this.y - roomTile.y;
|
double y = (double) this.y - roomTile.y;
|
||||||
return Math.sqrt(x * x + y * y);
|
return Math.sqrt(x * x + y * y);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -186,7 +186,7 @@ public class RoomTile {
|
|||||||
|
|
||||||
public List<RoomUnit> getUnits() {
|
public List<RoomUnit> getUnits() {
|
||||||
synchronized (this.units) {
|
synchronized (this.units) {
|
||||||
return new ArrayList<RoomUnit>(this.units);
|
return new ArrayList<>(this.units);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -422,7 +422,7 @@ public class RoomUnit {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isInRoom() {
|
public synchronized boolean isInRoom() {
|
||||||
return this.inRoom;
|
return this.inRoom;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -430,7 +430,7 @@ public class RoomUnit {
|
|||||||
this.inRoom = inRoom;
|
this.inRoom = inRoom;
|
||||||
}
|
}
|
||||||
|
|
||||||
public RoomUnitType getRoomUnitType() {
|
public synchronized RoomUnitType getRoomUnitType() {
|
||||||
return this.roomUnitType;
|
return this.roomUnitType;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -459,7 +459,7 @@ public class RoomUnit {
|
|||||||
this.headRotation = headRotation;
|
this.headRotation = headRotation;
|
||||||
}
|
}
|
||||||
|
|
||||||
public DanceType getDanceType() {
|
public synchronized DanceType getDanceType() {
|
||||||
return this.danceType;
|
return this.danceType;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -11,12 +11,12 @@ import com.eu.habbo.habbohotel.users.Habbo;
|
|||||||
import com.eu.habbo.habbohotel.users.HabboItem;
|
import com.eu.habbo.habbohotel.users.HabboItem;
|
||||||
import com.eu.habbo.messages.ServerMessage;
|
import com.eu.habbo.messages.ServerMessage;
|
||||||
import com.eu.habbo.messages.outgoing.generic.alerts.NotificationDialogMessageComposer;
|
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.FurniListInvalidateComposer;
|
||||||
import com.eu.habbo.messages.outgoing.inventory.FurniListRemoveComposer;
|
import com.eu.habbo.messages.outgoing.inventory.FurniListRemoveComposer;
|
||||||
import com.eu.habbo.messages.outgoing.rooms.items.jukebox.UserSongDisksInventoryMessageComposer;
|
import com.eu.habbo.messages.outgoing.inventory.UnseenItemsComposer;
|
||||||
import com.eu.habbo.messages.outgoing.rooms.items.jukebox.NowPlayingMessageComposer;
|
|
||||||
import com.eu.habbo.messages.outgoing.rooms.items.jukebox.JukeboxSongDisksMessageComposer;
|
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 gnu.trove.map.hash.THashMap;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
@ -55,13 +55,11 @@ public class TraxManager implements Disposable {
|
|||||||
|
|
||||||
if (this.jukeBox == null) {
|
if (this.jukeBox == null) {
|
||||||
//Check again if there's a jukebox on room but has not been saved on DB before
|
//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;
|
this.jukeBox = (InteractionJukeBox) item;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(this.jukeBox != null)
|
if (this.jukeBox != null) {
|
||||||
{
|
|
||||||
this.loadPlaylist();
|
this.loadPlaylist();
|
||||||
this.songsLimit = this.getSongsLimit(this.jukeBox);
|
this.songsLimit = this.getSongsLimit(this.jukeBox);
|
||||||
}
|
}
|
||||||
@ -123,8 +121,7 @@ public class TraxManager implements Disposable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void deleteSongFromPlaylist(int jukebox_id, int song_id)
|
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")) {
|
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(1, jukebox_id);
|
||||||
statement.setInt(2, song_id);
|
statement.setInt(2, song_id);
|
||||||
@ -137,13 +134,11 @@ public class TraxManager implements Disposable {
|
|||||||
public void addTraxOnRoom(InteractionJukeBox jukeBox) {
|
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(1, this.room.getId());
|
||||||
statement_1.setInt(2, jukeBox.getId());
|
statement_1.setInt(2, jukeBox.getId());
|
||||||
statement_1.execute();
|
statement_1.execute();
|
||||||
}
|
} catch (SQLException e) {
|
||||||
catch (SQLException e) {
|
|
||||||
LOGGER.error("Caught SQL exception", e);
|
LOGGER.error("Caught SQL exception", e);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -156,12 +151,10 @@ public class TraxManager implements Disposable {
|
|||||||
public void removeTraxOnRoom(InteractionJukeBox jukeBox) {
|
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.setInt(1, this.room.getId());
|
||||||
statement_1.execute();
|
statement_1.execute();
|
||||||
}
|
} catch (SQLException e) {
|
||||||
catch (SQLException e) {
|
|
||||||
LOGGER.error("Caught SQL exception", e);
|
LOGGER.error("Caught SQL exception", e);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -208,9 +201,10 @@ public class TraxManager implements Disposable {
|
|||||||
this.starter = starter;
|
this.starter = starter;
|
||||||
this.cycleStartedTimestamp = Emulator.getIntUnixTimestamp();
|
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 {
|
} else {
|
||||||
this.stop();
|
this.stop();
|
||||||
}
|
}
|
||||||
@ -244,8 +238,7 @@ public class TraxManager implements Disposable {
|
|||||||
public void addSong(InteractionMusicDisc musicDisc, Habbo habbo) {
|
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<>();
|
THashMap<String, String> codes = new THashMap<>();
|
||||||
ServerMessage msg = new NotificationDialogMessageComposer("${playlist.editor.alert.playlist.full.title}", "${playlist.editor.alert.playlist.full}").compose();
|
ServerMessage msg = new NotificationDialogMessageComposer("${playlist.editor.alert.playlist.full.title}", "${playlist.editor.alert.playlist.full}").compose();
|
||||||
habbo.getClient().sendResponse(msg);
|
habbo.getClient().sendResponse(msg);
|
||||||
@ -254,8 +247,7 @@ public class TraxManager implements Disposable {
|
|||||||
|
|
||||||
SoundTrack track = Emulator.getGameEnvironment().getItemManager().getSoundTrack(musicDisc.getSongId());
|
SoundTrack track = Emulator.getGameEnvironment().getItemManager().getSoundTrack(musicDisc.getSongId());
|
||||||
|
|
||||||
if (track != null)
|
if (track != null) {
|
||||||
{
|
|
||||||
this.totalLength += track.getLength();
|
this.totalLength += track.getLength();
|
||||||
this.songs.add(musicDisc);
|
this.songs.add(musicDisc);
|
||||||
|
|
||||||
@ -318,8 +310,7 @@ public class TraxManager implements Disposable {
|
|||||||
this.sendUpdatedSongList();
|
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 = ?")) {
|
try (Connection connection = Emulator.getDatabase().getDataSource().getConnection(); PreparedStatement statement = connection.prepareStatement("SELECT * FROM trax_playlist WHERE trax_item_id = ?")) {
|
||||||
statement.setInt(1, jukebox.getId());
|
statement.setInt(1, jukebox.getId());
|
||||||
try (ResultSet set = statement.executeQuery()) {
|
try (ResultSet set = statement.executeQuery()) {
|
||||||
|
@ -451,6 +451,7 @@ public class HabboInfo implements Runnable {
|
|||||||
roomUnit.setZ(riding.getRoomUnit().getZ());
|
roomUnit.setZ(riding.getRoomUnit().getZ());
|
||||||
roomUnit.setPreviousLocationZ(riding.getRoomUnit().getZ());
|
roomUnit.setPreviousLocationZ(riding.getRoomUnit().getZ());
|
||||||
roomUnit.stopWalking();
|
roomUnit.stopWalking();
|
||||||
|
if (room != null)
|
||||||
room.sendComposer(new UserUpdateComposer(roomUnit).compose());
|
room.sendComposer(new UserUpdateComposer(roomUnit).compose());
|
||||||
List<RoomTile> availableTiles = isRemoving ? new ArrayList<>() : this.getCurrentRoom().getLayout().getWalkableTilesAround(roomUnit.getCurrentLocation());
|
List<RoomTile> availableTiles = isRemoving ? new ArrayList<>() : this.getCurrentRoom().getLayout().getWalkableTilesAround(roomUnit.getCurrentLocation());
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package com.eu.habbo.habbohotel.users;
|
package com.eu.habbo.habbohotel.users;
|
||||||
|
|
||||||
import com.eu.habbo.Emulator;
|
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.gameclients.GameClient;
|
||||||
import com.eu.habbo.habbohotel.achievements.Achievement;
|
import com.eu.habbo.habbohotel.achievements.Achievement;
|
||||||
import com.eu.habbo.habbohotel.achievements.AchievementManager;
|
import com.eu.habbo.habbohotel.achievements.AchievementManager;
|
||||||
@ -421,12 +421,7 @@ public class HabboStats implements Runnable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean hasGuild(int guildId) {
|
public boolean hasGuild(int guildId) {
|
||||||
for (int i : this.guilds) {
|
return this.guilds.contains(guildId);
|
||||||
if (i == guildId)
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getAchievementScore() {
|
public int getAchievementScore() {
|
||||||
|
@ -7,6 +7,7 @@ import org.w3c.dom.Node;
|
|||||||
import org.w3c.dom.NodeList;
|
import org.w3c.dom.NodeList;
|
||||||
import org.xml.sax.SAXException;
|
import org.xml.sax.SAXException;
|
||||||
|
|
||||||
|
import javax.xml.XMLConstants;
|
||||||
import javax.xml.parsers.DocumentBuilder;
|
import javax.xml.parsers.DocumentBuilder;
|
||||||
import javax.xml.parsers.DocumentBuilderFactory;
|
import javax.xml.parsers.DocumentBuilderFactory;
|
||||||
import javax.xml.parsers.ParserConfigurationException;
|
import javax.xml.parsers.ParserConfigurationException;
|
||||||
@ -36,6 +37,8 @@ public class Figuredata {
|
|||||||
*/
|
*/
|
||||||
public void parseXML(String uri) throws Exception, ParserConfigurationException, IOException, SAXException {
|
public void parseXML(String uri) throws Exception, ParserConfigurationException, IOException, SAXException {
|
||||||
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
|
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.setValidating(false);
|
||||||
factory.setIgnoringElementContentWhitespace(true);
|
factory.setIgnoringElementContentWhitespace(true);
|
||||||
DocumentBuilder builder = factory.newDocumentBuilder();
|
DocumentBuilder builder = factory.newDocumentBuilder();
|
||||||
@ -45,7 +48,10 @@ public class Figuredata {
|
|||||||
|
|
||||||
if(!rootElement.getTagName().equalsIgnoreCase("figuredata") || document.getElementsByTagName("colors") == null || document.getElementsByTagName("sets") == null) {
|
if(!rootElement.getTagName().equalsIgnoreCase("figuredata") || document.getElementsByTagName("colors") == null || document.getElementsByTagName("sets") == null) {
|
||||||
StringWriter writer = new StringWriter();
|
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();
|
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)));
|
throw new Exception("The passed file is not in figuredata format. Received " + documentString.substring(0, Math.min(documentString.length(), 200)));
|
||||||
}
|
}
|
||||||
|
@ -72,7 +72,7 @@ public class WiredHandler {
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
long millis = System.currentTimeMillis();
|
long millis = System.currentTimeMillis();
|
||||||
THashSet<InteractionWiredEffect> effectsToExecute = new THashSet<InteractionWiredEffect>();
|
THashSet<InteractionWiredEffect> effectsToExecute = new THashSet<>();
|
||||||
|
|
||||||
List<RoomTile> triggeredTiles = new ArrayList<>();
|
List<RoomTile> triggeredTiles = new ArrayList<>();
|
||||||
for (InteractionWiredTrigger trigger : triggers) {
|
for (InteractionWiredTrigger trigger : triggers) {
|
||||||
@ -81,7 +81,7 @@ public class WiredHandler {
|
|||||||
if (triggeredTiles.contains(tile))
|
if (triggeredTiles.contains(tile))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
THashSet<InteractionWiredEffect> tEffectsToExecute = new THashSet<InteractionWiredEffect>();
|
THashSet<InteractionWiredEffect> tEffectsToExecute = new THashSet<>();
|
||||||
|
|
||||||
if (handle(trigger, roomUnit, room, stuff, tEffectsToExecute)) {
|
if (handle(trigger, roomUnit, room, stuff, tEffectsToExecute)) {
|
||||||
effectsToExecute.addAll(tEffectsToExecute);
|
effectsToExecute.addAll(tEffectsToExecute);
|
||||||
@ -244,7 +244,7 @@ public class WiredHandler {
|
|||||||
|
|
||||||
effect.activateBox(room, roomUnit, millis);
|
effect.activateBox(room, roomUnit, millis);
|
||||||
}
|
}
|
||||||
}, effect.getDelay() * 500);
|
}, effect.getDelay() * 500L);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -327,23 +327,23 @@ public class WiredHandler {
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
if (rewardReceived.type.equalsIgnoreCase("credits")) {
|
if (rewardReceived.type.equalsIgnoreCase("credits")) {
|
||||||
int credits = Integer.valueOf(rewardReceived.value);
|
int credits = Integer.parseInt(rewardReceived.value);
|
||||||
habbo.giveCredits(credits);
|
habbo.giveCredits(credits);
|
||||||
} else if (rewardReceived.type.equalsIgnoreCase("pixels")) {
|
} else if (rewardReceived.type.equalsIgnoreCase("pixels")) {
|
||||||
int pixels = Integer.valueOf(rewardReceived.value);
|
int pixels = Integer.parseInt(rewardReceived.value);
|
||||||
habbo.givePixels(pixels);
|
habbo.givePixels(pixels);
|
||||||
} else if (rewardReceived.type.startsWith("points")) {
|
} else if (rewardReceived.type.startsWith("points")) {
|
||||||
int points = Integer.valueOf(rewardReceived.value);
|
int points = Integer.parseInt(rewardReceived.value);
|
||||||
int type = 5;
|
int type = 5;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
type = Integer.valueOf(rewardReceived.type.replace("points", ""));
|
type = Integer.parseInt(rewardReceived.type.replace("points", ""));
|
||||||
} catch (Exception e) {
|
} catch (Exception ignored) {
|
||||||
}
|
}
|
||||||
|
|
||||||
habbo.givePoints(type, points);
|
habbo.givePoints(type, points);
|
||||||
} else if (rewardReceived.type.equalsIgnoreCase("furni")) {
|
} 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) {
|
if (baseItem != null) {
|
||||||
HabboItem item = Emulator.getGameEnvironment().getItemManager().createItem(habbo.getHabboInfo().getId(), baseItem, 0, 0, "");
|
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")) {
|
} 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")) {
|
} 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) {
|
if (item != null) {
|
||||||
Emulator.getGameEnvironment().getCatalogManager().purchaseItem(null, item, habbo, 1, "", true);
|
Emulator.getGameEnvironment().getCatalogManager().purchaseItem(null, item, habbo, 1, "", true);
|
||||||
|
@ -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.AmbassadorAlertEvent;
|
||||||
import com.eu.habbo.messages.incoming.ambassadors.FollowFriendEvent;
|
import com.eu.habbo.messages.incoming.ambassadors.FollowFriendEvent;
|
||||||
import com.eu.habbo.messages.incoming.camera.*;
|
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.*;
|
||||||
import com.eu.habbo.messages.incoming.catalog.marketplace.*;
|
import com.eu.habbo.messages.incoming.catalog.marketplace.*;
|
||||||
import com.eu.habbo.messages.incoming.catalog.recycler.PresentOpenEvent;
|
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.GetRecyclerStatusEvent;
|
||||||
import com.eu.habbo.messages.incoming.catalog.recycler.GetRecyclerPrizesEvent;
|
import com.eu.habbo.messages.incoming.catalog.recycler.GetRecyclerPrizesEvent;
|
||||||
import com.eu.habbo.messages.incoming.crafting.*;
|
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.GetOccupiedTilesEvent;
|
||||||
import com.eu.habbo.messages.incoming.floorplaneditor.GetRoomEntryTileEvent;
|
import com.eu.habbo.messages.incoming.floorplaneditor.GetRoomEntryTileEvent;
|
||||||
import com.eu.habbo.messages.incoming.floorplaneditor.UpdateFloorPropertiesEvent;
|
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(";")) {
|
for (String s : Emulator.getConfig().getValue("debug.show.headers").split(";")) {
|
||||||
try {
|
try {
|
||||||
logList.add(Integer.valueOf(s));
|
logList.add(Integer.valueOf(s));
|
||||||
} catch (NumberFormatException e) {
|
} catch (NumberFormatException ignored) {
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -223,425 +223,425 @@ public class PacketManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void registerAmbassadors() throws Exception {
|
private void registerAmbassadors() throws Exception {
|
||||||
this.registerHandler(Incoming.AmbassadorAlertEvent, AmbassadorAlertEvent.class);
|
this.registerHandler(Incoming.ambassadorAlertEvent, AmbassadorAlertEvent.class);
|
||||||
this.registerHandler(Incoming.FollowFriendEvent, FollowFriendEvent.class);
|
this.registerHandler(Incoming.followFriendEvent, FollowFriendEvent.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void registerCatalog() throws Exception {
|
private void registerCatalog() throws Exception {
|
||||||
this.registerHandler(Incoming.GetRecyclerPrizesEvent, GetRecyclerPrizesEvent.class);
|
this.registerHandler(Incoming.getRecyclerPrizesEvent, GetRecyclerPrizesEvent.class);
|
||||||
this.registerHandler(Incoming.GetBundleDiscountRulesetEvent, GetBundleDiscountRulesetEvent.class);
|
this.registerHandler(Incoming.getBundleDiscountRulesetEvent, GetBundleDiscountRulesetEvent.class);
|
||||||
this.registerHandler(Incoming.GetGiftWrappingConfigurationEvent, GetGiftWrappingConfigurationEvent.class);
|
this.registerHandler(Incoming.getGiftWrappingConfigurationEvent, GetGiftWrappingConfigurationEvent.class);
|
||||||
this.registerHandler(Incoming.GetMarketplaceConfigurationEvent, GetMarketplaceConfigurationEvent.class);
|
this.registerHandler(Incoming.getMarketplaceConfigurationEvent, GetMarketplaceConfigurationEvent.class);
|
||||||
this.registerHandler(Incoming.GetCatalogIndexEvent, GetCatalogIndexEvent.class);
|
this.registerHandler(Incoming.getCatalogIndexEvent, GetCatalogIndexEvent.class);
|
||||||
this.registerHandler(Incoming.BuildersClubQueryFurniCountEvent, BuildersClubQueryFurniCountEvent.class);
|
this.registerHandler(Incoming.buildersClubQueryFurniCountEvent, BuildersClubQueryFurniCountEvent.class);
|
||||||
this.registerHandler(Incoming.GetCatalogPageEvent, GetCatalogPageEvent.class);
|
this.registerHandler(Incoming.getCatalogPageEvent, GetCatalogPageEvent.class);
|
||||||
this.registerHandler(Incoming.PurchaseFromCatalogAsGiftEvent, PurchaseFromCatalogAsGiftEvent.class);
|
this.registerHandler(Incoming.purchaseFromCatalogAsGiftEvent, PurchaseFromCatalogAsGiftEvent.class);
|
||||||
this.registerHandler(Incoming.PurchaseFromCatalogEvent, PurchaseFromCatalogEvent.class);
|
this.registerHandler(Incoming.purchaseFromCatalogEvent, PurchaseFromCatalogEvent.class);
|
||||||
this.registerHandler(Incoming.RedeemVoucherEvent, RedeemVoucherEvent.class);
|
this.registerHandler(Incoming.redeemVoucherEvent, RedeemVoucherEvent.class);
|
||||||
this.registerHandler(Incoming.GetRecyclerStatusEvent, GetRecyclerStatusEvent.class);
|
this.registerHandler(Incoming.getRecyclerStatusEvent, GetRecyclerStatusEvent.class);
|
||||||
this.registerHandler(Incoming.RecycleItemsEvent, RecycleItemsEvent.class);
|
this.registerHandler(Incoming.recycleItemsEvent, RecycleItemsEvent.class);
|
||||||
this.registerHandler(Incoming.PresentOpenEvent, PresentOpenEvent.class);
|
this.registerHandler(Incoming.presentOpenEvent, PresentOpenEvent.class);
|
||||||
this.registerHandler(Incoming.GetMarketplaceOwnOffersEvent, GetMarketplaceOwnOffersEvent.class);
|
this.registerHandler(Incoming.getMarketplaceOwnOffersEvent, GetMarketplaceOwnOffersEvent.class);
|
||||||
this.registerHandler(Incoming.CancelMarketplaceOfferEvent, CancelMarketplaceOfferEvent.class);
|
this.registerHandler(Incoming.cancelMarketplaceOfferEvent, CancelMarketplaceOfferEvent.class);
|
||||||
this.registerHandler(Incoming.GetMarketplaceOffersEvent, GetMarketplaceOffersEvent.class);
|
this.registerHandler(Incoming.getMarketplaceOffersEvent, GetMarketplaceOffersEvent.class);
|
||||||
this.registerHandler(Incoming.GetMarketplaceItemStatsEvent, GetMarketplaceItemStatsEvent.class);
|
this.registerHandler(Incoming.getMarketplaceItemStatsEvent, GetMarketplaceItemStatsEvent.class);
|
||||||
this.registerHandler(Incoming.BuyMarketplaceOfferEvent, BuyMarketplaceOfferEvent.class);
|
this.registerHandler(Incoming.buyMarketplaceOfferEvent, BuyMarketplaceOfferEvent.class);
|
||||||
this.registerHandler(Incoming.GetMarketplaceCanMakeOfferEvent, GetMarketplaceCanMakeOfferEvent.class);
|
this.registerHandler(Incoming.getMarketplaceCanMakeOfferEvent, GetMarketplaceCanMakeOfferEvent.class);
|
||||||
this.registerHandler(Incoming.MakeOfferEvent, MakeOfferEvent.class);
|
this.registerHandler(Incoming.makeOfferEvent, MakeOfferEvent.class);
|
||||||
this.registerHandler(Incoming.RedeemMarketplaceOfferCreditsEvent, RedeemMarketplaceOfferCreditsEvent.class);
|
this.registerHandler(Incoming.redeemMarketplaceOfferCreditsEvent, RedeemMarketplaceOfferCreditsEvent.class);
|
||||||
this.registerHandler(Incoming.GetSellablePetPalettesEvent, GetSellablePetPalettesEvent.class);
|
this.registerHandler(Incoming.getSellablePetPalettesEvent, GetSellablePetPalettesEvent.class);
|
||||||
this.registerHandler(Incoming.ApproveNameEvent, ApproveNameEvent.class);
|
this.registerHandler(Incoming.approveNameEvent, ApproveNameEvent.class);
|
||||||
this.registerHandler(Incoming.GetClubOffersEvent, GetClubOffersEvent.class);
|
this.registerHandler(Incoming.getClubOffersEvent, GetClubOffersEvent.class);
|
||||||
this.registerHandler(Incoming.GetClubGiftInfo, GetClubGiftInfo.class);
|
this.registerHandler(Incoming.getClubGiftInfo, GetClubGiftInfo.class);
|
||||||
this.registerHandler(Incoming.GetProductOfferEvent, GetProductOfferEvent.class);
|
this.registerHandler(Incoming.getProductOfferEvent, GetProductOfferEvent.class);
|
||||||
this.registerHandler(Incoming.PurchaseTargetedOfferEvent, PurchaseTargetedOfferEvent.class);
|
this.registerHandler(Incoming.purchaseTargetedOfferEvent, PurchaseTargetedOfferEvent.class);
|
||||||
this.registerHandler(Incoming.SetTargetedOfferStateEvent, SetTargetedOfferStateEvent.class);
|
this.registerHandler(Incoming.setTargetedOfferStateEvent, SetTargetedOfferStateEvent.class);
|
||||||
this.registerHandler(Incoming.SelectClubGiftEvent, SelectClubGiftEvent.class);
|
this.registerHandler(Incoming.selectClubGiftEvent, SelectClubGiftEvent.class);
|
||||||
this.registerHandler(Incoming.ScrGetKickbackInfoEvent, ScrGetKickbackInfoEvent.class);
|
this.registerHandler(Incoming.scrGetKickbackInfoEvent, ScrGetKickbackInfoEvent.class);
|
||||||
this.registerHandler(Incoming.BuildersClubPlaceWallItemEvent, BuildersClubPlaceWallItemEvent.class);
|
this.registerHandler(Incoming.buildersClubPlaceWallItemEvent, BuildersClubPlaceWallItemEvent.class);
|
||||||
this.registerHandler(Incoming.PurchaseVipMembershipExtensionEvent, PurchaseVipMembershipExtensionEvent.class);
|
this.registerHandler(Incoming.purchaseVipMembershipExtensionEvent, PurchaseVipMembershipExtensionEvent.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void registerEvent() throws Exception {
|
private void registerEvent() throws Exception {
|
||||||
this.registerHandler(Incoming.OpenCampaignCalendarDoorAsStaffEvent, OpenCampaignCalendarDoorAsStaffEvent.class);
|
this.registerHandler(Incoming.openCampaignCalendarDoorAsStaffEvent, OpenCampaignCalendarDoorAsStaffEvent.class);
|
||||||
this.registerHandler(Incoming.OpenCampaignCalendarDoorEvent, OpenCampaignCalendarDoorEvent.class);
|
this.registerHandler(Incoming.openCampaignCalendarDoorEvent, OpenCampaignCalendarDoorEvent.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void registerHandshake() throws Exception {
|
private void registerHandshake() throws Exception {
|
||||||
this.registerHandler(Incoming.ClientHelloEvent, ClientHelloEvent.class);
|
this.registerHandler(Incoming.clientHelloEvent, ClientHelloEvent.class);
|
||||||
this.registerHandler(Incoming.InitDiffieHandshakeEvent, InitDiffieHandshakeEvent.class);
|
this.registerHandler(Incoming.initDiffieHandshakeEvent, InitDiffieHandshakeEvent.class);
|
||||||
this.registerHandler(Incoming.CompleteDiffieHandshakeEvent, CompleteDiffieHandshakeEvent.class);
|
this.registerHandler(Incoming.completeDiffieHandshakeEvent, CompleteDiffieHandshakeEvent.class);
|
||||||
this.registerHandler(Incoming.SSOTicketEvent, SSOTicketEvent.class);
|
this.registerHandler(Incoming.sSOTicketEvent, SSOTicketEvent.class);
|
||||||
this.registerHandler(Incoming.UniqueIDEvent, UniqueIDEvent.class);
|
this.registerHandler(Incoming.uniqueIDEvent, UniqueIDEvent.class);
|
||||||
this.registerHandler(Incoming.GetIgnoredUsersEvent, GetIgnoredUsersEvent.class);
|
this.registerHandler(Incoming.getIgnoredUsersEvent, GetIgnoredUsersEvent.class);
|
||||||
this.registerHandler(Incoming.LatencyPingRequestEvent, LatencyPingRequestEvent.class);
|
this.registerHandler(Incoming.latencyPingRequestEvent, LatencyPingRequestEvent.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void registerFriends() throws Exception {
|
private void registerFriends() throws Exception {
|
||||||
this.registerHandler(Incoming.GetMOTDEvent, GetMOTDEvent.class);
|
this.registerHandler(Incoming.getMOTDEvent, GetMOTDEvent.class);
|
||||||
this.registerHandler(Incoming.SetRelationshipStatusEvent, SetRelationshipStatusEvent.class);
|
this.registerHandler(Incoming.setRelationshipStatusEvent, SetRelationshipStatusEvent.class);
|
||||||
this.registerHandler(Incoming.RemoveFriendEvent, RemoveFriendEvent.class);
|
this.registerHandler(Incoming.removeFriendEvent, RemoveFriendEvent.class);
|
||||||
this.registerHandler(Incoming.HabboSearchEvent, HabboSearchEvent.class);
|
this.registerHandler(Incoming.habboSearchEvent, HabboSearchEvent.class);
|
||||||
this.registerHandler(Incoming.RequestFriendEvent, RequestFriendEvent.class);
|
this.registerHandler(Incoming.requestFriendEvent, RequestFriendEvent.class);
|
||||||
this.registerHandler(Incoming.AcceptFriendEvent, AcceptFriendEvent.class);
|
this.registerHandler(Incoming.acceptFriendEvent, AcceptFriendEvent.class);
|
||||||
this.registerHandler(Incoming.DeclineFriendEvent, DeclineFriendEvent.class);
|
this.registerHandler(Incoming.declineFriendEvent, DeclineFriendEvent.class);
|
||||||
this.registerHandler(Incoming.SendMsgEvent, SendMsgEvent.class);
|
this.registerHandler(Incoming.sendMsgEvent, SendMsgEvent.class);
|
||||||
this.registerHandler(Incoming.GetFriendRequestsEvent, GetFriendRequestsEvent.class);
|
this.registerHandler(Incoming.getFriendRequestsEvent, GetFriendRequestsEvent.class);
|
||||||
this.registerHandler(Incoming.VisitUserEvent, VisitUserEvent.class);
|
this.registerHandler(Incoming.visitUserEvent, VisitUserEvent.class);
|
||||||
this.registerHandler(Incoming.MessengerInitEvent, MessengerInitEvent.class);
|
this.registerHandler(Incoming.messengerInitEvent, MessengerInitEvent.class);
|
||||||
this.registerHandler(Incoming.FindNewFriendsEvent, FindNewFriendsEvent.class);
|
this.registerHandler(Incoming.findNewFriendsEvent, FindNewFriendsEvent.class);
|
||||||
this.registerHandler(Incoming.SendRoomInviteEvent, SendRoomInviteEvent.class);
|
this.registerHandler(Incoming.sendRoomInviteEvent, SendRoomInviteEvent.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void registerUsers() throws Exception {
|
private void registerUsers() throws Exception {
|
||||||
this.registerHandler(Incoming.InfoRetrieveEvent, InfoRetrieveEvent.class);
|
this.registerHandler(Incoming.infoRetrieveEvent, InfoRetrieveEvent.class);
|
||||||
this.registerHandler(Incoming.GetCreditsInfoEvent, GetCreditsInfoEvent.class);
|
this.registerHandler(Incoming.getCreditsInfoEvent, GetCreditsInfoEvent.class);
|
||||||
this.registerHandler(Incoming.ScrGetUserInfoEvent, ScrGetUserInfoEvent.class);
|
this.registerHandler(Incoming.scrGetUserInfoEvent, ScrGetUserInfoEvent.class);
|
||||||
this.registerHandler(Incoming.GetSoundSettingsEvent, GetSoundSettingsEvent.class);
|
this.registerHandler(Incoming.getSoundSettingsEvent, GetSoundSettingsEvent.class);
|
||||||
this.registerHandler(Incoming.GetTalentTrackLevelEvent, GetTalentTrackLevelEvent.class);
|
this.registerHandler(Incoming.getTalentTrackLevelEvent, GetTalentTrackLevelEvent.class);
|
||||||
this.registerHandler(Incoming.GetExtendedProfileEvent, GetExtendedProfileEvent.class);
|
this.registerHandler(Incoming.getExtendedProfileEvent, GetExtendedProfileEvent.class);
|
||||||
this.registerHandler(Incoming.GetRelationshipStatusInfoEvent, GetRelationshipStatusInfoEvent.class);
|
this.registerHandler(Incoming.getRelationshipStatusInfoEvent, GetRelationshipStatusInfoEvent.class);
|
||||||
this.registerHandler(Incoming.GetWardrobeEvent, GetWardrobeEvent.class);
|
this.registerHandler(Incoming.getWardrobeEvent, GetWardrobeEvent.class);
|
||||||
this.registerHandler(Incoming.SaveWardrobeOutfitEvent, SaveWardrobeOutfitEvent.class);
|
this.registerHandler(Incoming.saveWardrobeOutfitEvent, SaveWardrobeOutfitEvent.class);
|
||||||
this.registerHandler(Incoming.ChangeMottoEvent, ChangeMottoEvent.class);
|
this.registerHandler(Incoming.changeMottoEvent, ChangeMottoEvent.class);
|
||||||
this.registerHandler(Incoming.UpdateFigureDataEvent, UpdateFigureDataEvent.class);
|
this.registerHandler(Incoming.updateFigureDataEvent, UpdateFigureDataEvent.class);
|
||||||
this.registerHandler(Incoming.SetActivatedBadgesEvent, SetActivatedBadgesEvent.class);
|
this.registerHandler(Incoming.setActivatedBadgesEvent, SetActivatedBadgesEvent.class);
|
||||||
this.registerHandler(Incoming.GetSelectedBadgesEvent, GetSelectedBadgesEvent.class);
|
this.registerHandler(Incoming.getSelectedBadgesEvent, GetSelectedBadgesEvent.class);
|
||||||
this.registerHandler(Incoming.SetSoundSettingsEvent, SetSoundSettingsEvent.class);
|
this.registerHandler(Incoming.setSoundSettingsEvent, SetSoundSettingsEvent.class);
|
||||||
this.registerHandler(Incoming.SetRoomCameraPreferencesEvent, SetRoomCameraPreferencesEvent.class);
|
this.registerHandler(Incoming.setRoomCameraPreferencesEvent, SetRoomCameraPreferencesEvent.class);
|
||||||
this.registerHandler(Incoming.SetIgnoreRoomInvitesEvent, SetIgnoreRoomInvitesEvent.class);
|
this.registerHandler(Incoming.setIgnoreRoomInvitesEvent, SetIgnoreRoomInvitesEvent.class);
|
||||||
this.registerHandler(Incoming.SetChatPreferencesEvent, SetChatPreferencesEvent.class);
|
this.registerHandler(Incoming.setChatPreferencesEvent, SetChatPreferencesEvent.class);
|
||||||
this.registerHandler(Incoming.AvatarEffectActivatedEvent, AvatarEffectActivatedEvent.class);
|
this.registerHandler(Incoming.avatarEffectActivatedEvent, AvatarEffectActivatedEvent.class);
|
||||||
this.registerHandler(Incoming.AvatarEffectSelectedEvent, AvatarEffectSelectedEvent.class);
|
this.registerHandler(Incoming.avatarEffectSelectedEvent, AvatarEffectSelectedEvent.class);
|
||||||
this.registerHandler(Incoming.EventLogEvent, EventLogEvent.class);
|
this.registerHandler(Incoming.eventLogEvent, EventLogEvent.class);
|
||||||
this.registerHandler(Incoming.NewUserExperienceScriptProceedEvent, NewUserExperienceScriptProceedEvent.class);
|
this.registerHandler(Incoming.newUserExperienceScriptProceedEvent, NewUserExperienceScriptProceedEvent.class);
|
||||||
this.registerHandler(Incoming.NewUserExperienceGetGiftsEvent, NewUserExperienceGetGiftsEvent.class);
|
this.registerHandler(Incoming.newUserExperienceGetGiftsEvent, NewUserExperienceGetGiftsEvent.class);
|
||||||
this.registerHandler(Incoming.CheckUserNameEvent, CheckUserNameEvent.class);
|
this.registerHandler(Incoming.checkUserNameEvent, CheckUserNameEvent.class);
|
||||||
this.registerHandler(Incoming.ChangeUserNameEvent, ChangeUserNameEvent.class);
|
this.registerHandler(Incoming.changeUserNameEvent, ChangeUserNameEvent.class);
|
||||||
this.registerHandler(Incoming.SetChatStylePreferenceEvent, SetChatStylePreferenceEvent.class);
|
this.registerHandler(Incoming.setChatStylePreferenceEvent, SetChatStylePreferenceEvent.class);
|
||||||
this.registerHandler(Incoming.UpdateUIFlagsEvent, UpdateUIFlagsEvent.class);
|
this.registerHandler(Incoming.updateUIFlagsEvent, UpdateUIFlagsEvent.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void registerNavigator() throws Exception {
|
private void registerNavigator() throws Exception {
|
||||||
this.registerHandler(Incoming.GetUserFlatCatsEvent, GetUserFlatCatsEvent.class);
|
this.registerHandler(Incoming.getUserFlatCatsEvent, GetUserFlatCatsEvent.class);
|
||||||
this.registerHandler(Incoming.PopularRoomsSearchEvent, PopularRoomsSearchEvent.class);
|
this.registerHandler(Incoming.popularRoomsSearchEvent, PopularRoomsSearchEvent.class);
|
||||||
this.registerHandler(Incoming.RoomsWithHighestScoreSearchEvent, RoomsWithHighestScoreSearchEvent.class);
|
this.registerHandler(Incoming.roomsWithHighestScoreSearchEvent, RoomsWithHighestScoreSearchEvent.class);
|
||||||
this.registerHandler(Incoming.MyRoomsSearchEvent, MyRoomsSearchEvent.class);
|
this.registerHandler(Incoming.myRoomsSearchEvent, MyRoomsSearchEvent.class);
|
||||||
this.registerHandler(Incoming.CanCreateRoomEvent, CanCreateRoomEvent.class);
|
this.registerHandler(Incoming.canCreateRoomEvent, CanCreateRoomEvent.class);
|
||||||
this.registerHandler(Incoming.GetUnreadForumsCountEvent, GetUnreadForumsCountEvent.class);
|
this.registerHandler(Incoming.getUnreadForumsCountEvent, GetUnreadForumsCountEvent.class);
|
||||||
this.registerHandler(Incoming.CreateFlatEvent, CreateFlatEvent.class);
|
this.registerHandler(Incoming.createFlatEvent, CreateFlatEvent.class);
|
||||||
this.registerHandler(Incoming.GetPopularRoomTagsEvent, GetPopularRoomTagsEvent.class);
|
this.registerHandler(Incoming.getPopularRoomTagsEvent, GetPopularRoomTagsEvent.class);
|
||||||
this.registerHandler(Incoming.SearchRoomsByTagEvent, SearchRoomsByTagEvent.class);
|
this.registerHandler(Incoming.searchRoomsByTagEvent, SearchRoomsByTagEvent.class);
|
||||||
this.registerHandler(Incoming.RoomTextSearchEvent, RoomTextSearchEvent.class);
|
this.registerHandler(Incoming.roomTextSearchEvent, RoomTextSearchEvent.class);
|
||||||
this.registerHandler(Incoming.RoomsWhereMyFriendsAreSearchEvent, RoomsWhereMyFriendsAreSearchEvent.class);
|
this.registerHandler(Incoming.roomsWhereMyFriendsAreSearchEvent, RoomsWhereMyFriendsAreSearchEvent.class);
|
||||||
this.registerHandler(Incoming.MyFriendsRoomsSearchEvent, MyFriendsRoomsSearchEvent.class);
|
this.registerHandler(Incoming.myFriendsRoomsSearchEvent, MyFriendsRoomsSearchEvent.class);
|
||||||
this.registerHandler(Incoming.MyRoomRightsSearchEvent, MyRoomRightsSearchEvent.class);
|
this.registerHandler(Incoming.myRoomRightsSearchEvent, MyRoomRightsSearchEvent.class);
|
||||||
this.registerHandler(Incoming.MyGuildBasesSearchEvent, MyGuildBasesSearchEvent.class);
|
this.registerHandler(Incoming.myGuildBasesSearchEvent, MyGuildBasesSearchEvent.class);
|
||||||
this.registerHandler(Incoming.MyFavouriteRoomsSearchEvent, MyFavouriteRoomsSearchEvent.class);
|
this.registerHandler(Incoming.myFavouriteRoomsSearchEvent, MyFavouriteRoomsSearchEvent.class);
|
||||||
this.registerHandler(Incoming.MyRoomHistorySearchEvent, MyRoomHistorySearchEvent.class);
|
this.registerHandler(Incoming.myRoomHistorySearchEvent, MyRoomHistorySearchEvent.class);
|
||||||
this.registerHandler(Incoming.NewNavigatorInitEvent, NewNavigatorInitEvent.class);
|
this.registerHandler(Incoming.newNavigatorInitEvent, NewNavigatorInitEvent.class);
|
||||||
this.registerHandler(Incoming.NewNavigatorSearchEvent, NewNavigatorSearchEvent.class);
|
this.registerHandler(Incoming.newNavigatorSearchEvent, NewNavigatorSearchEvent.class);
|
||||||
this.registerHandler(Incoming.ForwardToSomeRoomEvent, ForwardToSomeRoomEvent.class);
|
this.registerHandler(Incoming.forwardToSomeRoomEvent, ForwardToSomeRoomEvent.class);
|
||||||
this.registerHandler(Incoming.GetUserEventCatsEvent, GetUserEventCatsEvent.class);
|
this.registerHandler(Incoming.getUserEventCatsEvent, GetUserEventCatsEvent.class);
|
||||||
this.registerHandler(Incoming.SetNewNavigatorWindowPreferencesEvent, SetNewNavigatorWindowPreferencesEvent.class);
|
this.registerHandler(Incoming.setNewNavigatorWindowPreferencesEvent, SetNewNavigatorWindowPreferencesEvent.class);
|
||||||
this.registerHandler(Incoming.DeleteRoomEvent, DeleteRoomEvent.class);
|
this.registerHandler(Incoming.deleteRoomEvent, DeleteRoomEvent.class);
|
||||||
this.registerHandler(Incoming.NavigatorSetSearchCodeViewModeEvent, NavigatorSetSearchCodeViewModeEvent.class);
|
this.registerHandler(Incoming.navigatorSetSearchCodeViewModeEvent, NavigatorSetSearchCodeViewModeEvent.class);
|
||||||
this.registerHandler(Incoming.NavigatorAddCollapsedCategoryEvent, NavigatorAddCollapsedCategoryEvent.class);
|
this.registerHandler(Incoming.navigatorAddCollapsedCategoryEvent, NavigatorAddCollapsedCategoryEvent.class);
|
||||||
this.registerHandler(Incoming.NavigatorRemoveCollapsedCategoryEvent, NavigatorRemoveCollapsedCategoryEvent.class);
|
this.registerHandler(Incoming.navigatorRemoveCollapsedCategoryEvent, NavigatorRemoveCollapsedCategoryEvent.class);
|
||||||
this.registerHandler(Incoming.NavigatorAddSavedSearchEvent, NavigatorAddSavedSearchEvent.class);
|
this.registerHandler(Incoming.navigatorAddSavedSearchEvent, NavigatorAddSavedSearchEvent.class);
|
||||||
this.registerHandler(Incoming.NavigatorDeleteSavedSearchEvent, NavigatorDeleteSavedSearchEvent.class);
|
this.registerHandler(Incoming.navigatorDeleteSavedSearchEvent, NavigatorDeleteSavedSearchEvent.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void registerHotelview() throws Exception {
|
private void registerHotelview() throws Exception {
|
||||||
this.registerHandler(Incoming.QuitEvent, QuitEvent.class);
|
this.registerHandler(Incoming.quitEvent, QuitEvent.class);
|
||||||
this.registerHandler(Incoming.GetBonusRareInfoEvent, GetBonusRareInfoEvent.class);
|
this.registerHandler(Incoming.getBonusRareInfoEvent, GetBonusRareInfoEvent.class);
|
||||||
this.registerHandler(Incoming.GetPromoArticlesEvent, GetPromoArticlesEvent.class);
|
this.registerHandler(Incoming.getPromoArticlesEvent, GetPromoArticlesEvent.class);
|
||||||
this.registerHandler(Incoming.GetCurrentTimingCodeEvent, GetCurrentTimingCodeEvent.class);
|
this.registerHandler(Incoming.getCurrentTimingCodeEvent, GetCurrentTimingCodeEvent.class);
|
||||||
this.registerHandler(Incoming.HotelViewRequestBadgeRewardEvent, HotelViewRequestBadgeRewardEvent.class);
|
this.registerHandler(Incoming.hotelViewRequestBadgeRewardEvent, HotelViewRequestBadgeRewardEvent.class);
|
||||||
this.registerHandler(Incoming.HotelViewClaimBadgeRewardEvent, HotelViewClaimBadgeRewardEvent.class);
|
this.registerHandler(Incoming.hotelViewClaimBadgeRewardEvent, HotelViewClaimBadgeRewardEvent.class);
|
||||||
this.registerHandler(Incoming.GetLimitedOfferAppearingNextEvent, GetLimitedOfferAppearingNextEvent.class);
|
this.registerHandler(Incoming.getLimitedOfferAppearingNextEvent, GetLimitedOfferAppearingNextEvent.class);
|
||||||
this.registerHandler(Incoming.HotelViewRequestSecondsUntilEvent, HotelViewRequestSecondsUntilEvent.class);
|
this.registerHandler(Incoming.hotelViewRequestSecondsUntilEvent, HotelViewRequestSecondsUntilEvent.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void registerInventory() throws Exception {
|
private void registerInventory() throws Exception {
|
||||||
this.registerHandler(Incoming.GetBadgesEvent, GetBadgesEvent.class);
|
this.registerHandler(Incoming.getBadgesEvent, GetBadgesEvent.class);
|
||||||
this.registerHandler(Incoming.GetBotInventoryEvent, GetBotInventoryEvent.class);
|
this.registerHandler(Incoming.getBotInventoryEvent, GetBotInventoryEvent.class);
|
||||||
this.registerHandler(Incoming.RequestFurniInventoryEvent, RequestFurniInventoryWhenNotInRoomEvent.class);
|
this.registerHandler(Incoming.requestFurniInventoryEvent, RequestFurniInventoryWhenNotInRoomEvent.class);
|
||||||
this.registerHandler(Incoming.RequestFurniInventoryWhenNotInRoomEvent, RequestFurniInventoryWhenNotInRoomEvent.class);
|
this.registerHandler(Incoming.requestFurniInventoryWhenNotInRoomEvent, RequestFurniInventoryWhenNotInRoomEvent.class);
|
||||||
this.registerHandler(Incoming.GetPetInventoryEvent, GetPetInventoryEvent.class);
|
this.registerHandler(Incoming.getPetInventoryEvent, GetPetInventoryEvent.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
void registerRooms() throws Exception {
|
void registerRooms() throws Exception {
|
||||||
this.registerHandler(Incoming.OpenFlatConnectionEvent, OpenFlatConnectionEvent.class);
|
this.registerHandler(Incoming.openFlatConnectionEvent, OpenFlatConnectionEvent.class);
|
||||||
this.registerHandler(Incoming.GetFurnitureAliasesEvent, GetRoomEntryDataEvent.class);// should this be seperate event classes?
|
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.getRoomEntryDataEvent, GetRoomEntryDataEvent.class);// should this be seperate event classes?
|
||||||
this.registerHandler(Incoming.RateFlatEvent, RateFlatEvent.class);
|
this.registerHandler(Incoming.rateFlatEvent, RateFlatEvent.class);
|
||||||
this.registerHandler(Incoming.GetGuestRoomEvent, GetGuestRoomEvent.class);
|
this.registerHandler(Incoming.getGuestRoomEvent, GetGuestRoomEvent.class);
|
||||||
this.registerHandler(Incoming.SaveRoomSettingsEvent, SaveRoomSettingsEvent.class);
|
this.registerHandler(Incoming.saveRoomSettingsEvent, SaveRoomSettingsEvent.class);
|
||||||
this.registerHandler(Incoming.PlaceObjectEvent, PlaceObjectEvent.class);
|
this.registerHandler(Incoming.placeObjectEvent, PlaceObjectEvent.class);
|
||||||
this.registerHandler(Incoming.MoveObjectEvent, MoveObjectEvent.class);
|
this.registerHandler(Incoming.moveObjectEvent, MoveObjectEvent.class);
|
||||||
this.registerHandler(Incoming.MoveWallItemEvent, MoveWallItemEvent.class);
|
this.registerHandler(Incoming.moveWallItemEvent, MoveWallItemEvent.class);
|
||||||
this.registerHandler(Incoming.PickupObjectEvent, PickupObjectEvent.class);
|
this.registerHandler(Incoming.pickupObjectEvent, PickupObjectEvent.class);
|
||||||
this.registerHandler(Incoming.RequestRoomPropertySet, RequestRoomPropertySet.class);
|
this.registerHandler(Incoming.requestRoomPropertySet, RequestRoomPropertySet.class);
|
||||||
this.registerHandler(Incoming.StartTypingEvent, StartTypingEvent.class);
|
this.registerHandler(Incoming.startTypingEvent, StartTypingEvent.class);
|
||||||
this.registerHandler(Incoming.CancelTypingEvent, CancelTypingEvent.class);
|
this.registerHandler(Incoming.cancelTypingEvent, CancelTypingEvent.class);
|
||||||
this.registerHandler(Incoming.UseFurnitureEvent, UseFurnitureEvent.class);
|
this.registerHandler(Incoming.useFurnitureEvent, UseFurnitureEvent.class);
|
||||||
this.registerHandler(Incoming.UseWallItemEvent, UseWallItemEvent.class);
|
this.registerHandler(Incoming.useWallItemEvent, UseWallItemEvent.class);
|
||||||
this.registerHandler(Incoming.SetRoomBackgroundColorDataEvent, SetRoomBackgroundColorDataEvent.class);
|
this.registerHandler(Incoming.setRoomBackgroundColorDataEvent, SetRoomBackgroundColorDataEvent.class);
|
||||||
this.registerHandler(Incoming.SetMannequinNameEvent, SetMannequinNameEvent.class);
|
this.registerHandler(Incoming.setMannequinNameEvent, SetMannequinNameEvent.class);
|
||||||
this.registerHandler(Incoming.SetMannequinFigureEvent, SetMannequinFigureEvent.class);
|
this.registerHandler(Incoming.setMannequinFigureEvent, SetMannequinFigureEvent.class);
|
||||||
this.registerHandler(Incoming.SetClothingChangeDataEvent, SetClothingChangeDataEvent.class);
|
this.registerHandler(Incoming.setClothingChangeDataEvent, SetClothingChangeDataEvent.class);
|
||||||
this.registerHandler(Incoming.SetObjectDataEvent, SetObjectDataEvent.class);
|
this.registerHandler(Incoming.setObjectDataEvent, SetObjectDataEvent.class);
|
||||||
this.registerHandler(Incoming.GetRoomSettingsEvent, GetRoomSettingsEvent.class);
|
this.registerHandler(Incoming.getRoomSettingsEvent, GetRoomSettingsEvent.class);
|
||||||
this.registerHandler(Incoming.RoomDimmerGetPresetsEvent, RoomDimmerGetPresetsEvent.class);
|
this.registerHandler(Incoming.roomDimmerGetPresetsEvent, RoomDimmerGetPresetsEvent.class);
|
||||||
this.registerHandler(Incoming.RoomDimmerChangeStateEvent, RoomDimmerChangeStateEvent.class);
|
this.registerHandler(Incoming.roomDimmerChangeStateEvent, RoomDimmerChangeStateEvent.class);
|
||||||
this.registerHandler(Incoming.DropCarryItemEvent, DropCarryItemEvent.class);
|
this.registerHandler(Incoming.dropCarryItemEvent, DropCarryItemEvent.class);
|
||||||
this.registerHandler(Incoming.LookToEvent, LookToEvent.class);
|
this.registerHandler(Incoming.lookToEvent, LookToEvent.class);
|
||||||
this.registerHandler(Incoming.ChatEvent, ChatEvent.class);
|
this.registerHandler(Incoming.chatEvent, ChatEvent.class);
|
||||||
this.registerHandler(Incoming.ShoutEvent, ShoutEvent.class);
|
this.registerHandler(Incoming.shoutEvent, ShoutEvent.class);
|
||||||
this.registerHandler(Incoming.WhisperEvent, WhisperEvent.class);
|
this.registerHandler(Incoming.whisperEvent, WhisperEvent.class);
|
||||||
this.registerHandler(Incoming.AvatarExpressionEvent, AvatarExpressionEvent.class);
|
this.registerHandler(Incoming.avatarExpressionEvent, AvatarExpressionEvent.class);
|
||||||
this.registerHandler(Incoming.ChangePostureEvent, ChangePostureEvent.class);
|
this.registerHandler(Incoming.changePostureEvent, ChangePostureEvent.class);
|
||||||
this.registerHandler(Incoming.DanceEvent, DanceEvent.class);
|
this.registerHandler(Incoming.danceEvent, DanceEvent.class);
|
||||||
this.registerHandler(Incoming.SignEvent, SignEvent.class);
|
this.registerHandler(Incoming.signEvent, SignEvent.class);
|
||||||
this.registerHandler(Incoming.MoveAvatarEvent, MoveAvatarEvent.class);
|
this.registerHandler(Incoming.moveAvatarEvent, MoveAvatarEvent.class);
|
||||||
this.registerHandler(Incoming.RespectUserEvent, RespectUserEvent.class);
|
this.registerHandler(Incoming.respectUserEvent, RespectUserEvent.class);
|
||||||
this.registerHandler(Incoming.AssignRightsEvent, AssignRightsEvent.class);
|
this.registerHandler(Incoming.assignRightsEvent, AssignRightsEvent.class);
|
||||||
this.registerHandler(Incoming.RemoveOwnRoomRightsRoomEvent, RemoveOwnRoomRightsRoomEvent.class);
|
this.registerHandler(Incoming.removeOwnRoomRightsRoomEvent, RemoveOwnRoomRightsRoomEvent.class);
|
||||||
this.registerHandler(Incoming.GetFlatControllersEvent, GetFlatControllersEvent.class);
|
this.registerHandler(Incoming.getFlatControllersEvent, GetFlatControllersEvent.class);
|
||||||
this.registerHandler(Incoming.RemoveAllRightsEvent, RemoveAllRightsEvent.class);
|
this.registerHandler(Incoming.removeAllRightsEvent, RemoveAllRightsEvent.class);
|
||||||
this.registerHandler(Incoming.RemoveRightsEvent, RemoveRightsEvent.class);
|
this.registerHandler(Incoming.removeRightsEvent, RemoveRightsEvent.class);
|
||||||
this.registerHandler(Incoming.PlaceBotEvent, PlaceBotEvent.class);
|
this.registerHandler(Incoming.placeBotEvent, PlaceBotEvent.class);
|
||||||
this.registerHandler(Incoming.RemoveBotFromFlatEvent, RemoveBotFromFlatEvent.class);
|
this.registerHandler(Incoming.removeBotFromFlatEvent, RemoveBotFromFlatEvent.class);
|
||||||
this.registerHandler(Incoming.CommandBotEvent, CommandBotEvent.class);
|
this.registerHandler(Incoming.commandBotEvent, CommandBotEvent.class);
|
||||||
this.registerHandler(Incoming.GetBotCommandConfigurationDataEvent, GetBotCommandConfigurationDataEvent.class);
|
this.registerHandler(Incoming.getBotCommandConfigurationDataEvent, GetBotCommandConfigurationDataEvent.class);
|
||||||
this.registerHandler(Incoming.ThrowDiceEvent, ThrowDiceEvent.class);
|
this.registerHandler(Incoming.throwDiceEvent, ThrowDiceEvent.class);
|
||||||
this.registerHandler(Incoming.DiceOffEvent, DiceOffEvent.class);
|
this.registerHandler(Incoming.diceOffEvent, DiceOffEvent.class);
|
||||||
this.registerHandler(Incoming.SpinWheelOfFortuneEvent, SpinWheelOfFortuneEvent.class);
|
this.registerHandler(Incoming.spinWheelOfFortuneEvent, SpinWheelOfFortuneEvent.class);
|
||||||
this.registerHandler(Incoming.CreditFurniRedeemEvent, CreditFurniRedeemEvent.class);
|
this.registerHandler(Incoming.creditFurniRedeemEvent, CreditFurniRedeemEvent.class);
|
||||||
this.registerHandler(Incoming.PlacePetEvent, PlacePetEvent.class);
|
this.registerHandler(Incoming.placePetEvent, PlacePetEvent.class);
|
||||||
this.registerHandler(Incoming.RoomUserKickEvent, RoomUserKickEvent.class);
|
this.registerHandler(Incoming.roomUserKickEvent, RoomUserKickEvent.class);
|
||||||
this.registerHandler(Incoming.SetCustomStackingHeightEvent, SetCustomStackingHeightEvent.class);
|
this.registerHandler(Incoming.setCustomStackingHeightEvent, SetCustomStackingHeightEvent.class);
|
||||||
this.registerHandler(Incoming.EnterOneWayDoorEvent, EnterOneWayDoorEvent.class);
|
this.registerHandler(Incoming.enterOneWayDoorEvent, EnterOneWayDoorEvent.class);
|
||||||
this.registerHandler(Incoming.LetUserInEvent, LetUserInEvent.class);
|
this.registerHandler(Incoming.letUserInEvent, LetUserInEvent.class);
|
||||||
this.registerHandler(Incoming.CustomizeAvatarWithFurniEvent, CustomizeAvatarWithFurniEvent.class);
|
this.registerHandler(Incoming.customizeAvatarWithFurniEvent, CustomizeAvatarWithFurniEvent.class);
|
||||||
this.registerHandler(Incoming.PlacePostItEvent, PlacePostItEvent.class);
|
this.registerHandler(Incoming.placePostItEvent, PlacePostItEvent.class);
|
||||||
this.registerHandler(Incoming.GetItemDataEvent, GetItemDataEvent.class);
|
this.registerHandler(Incoming.getItemDataEvent, GetItemDataEvent.class);
|
||||||
this.registerHandler(Incoming.SetItemDataEvent, SetItemDataEvent.class);
|
this.registerHandler(Incoming.setItemDataEvent, SetItemDataEvent.class);
|
||||||
this.registerHandler(Incoming.RemoveItemEvent, RemoveItemEvent.class);
|
this.registerHandler(Incoming.removeItemEvent, RemoveItemEvent.class);
|
||||||
this.registerHandler(Incoming.RoomDimmerSavePresetEvent, RoomDimmerSavePresetEvent.class);
|
this.registerHandler(Incoming.roomDimmerSavePresetEvent, RoomDimmerSavePresetEvent.class);
|
||||||
this.registerHandler(Incoming.RentableSpaceRentEvent, RentableSpaceRentEvent.class);
|
this.registerHandler(Incoming.rentableSpaceRentEvent, RentableSpaceRentEvent.class);
|
||||||
this.registerHandler(Incoming.RentableSpaceCancelRentEvent, RentableSpaceCancelRentEvent.class);
|
this.registerHandler(Incoming.rentableSpaceCancelRentEvent, RentableSpaceCancelRentEvent.class);
|
||||||
this.registerHandler(Incoming.UpdateHomeRoomEvent, UpdateHomeRoomEvent.class);
|
this.registerHandler(Incoming.updateHomeRoomEvent, UpdateHomeRoomEvent.class);
|
||||||
this.registerHandler(Incoming.PassCarryItemEvent, PassCarryItemEvent.class);
|
this.registerHandler(Incoming.passCarryItemEvent, PassCarryItemEvent.class);
|
||||||
this.registerHandler(Incoming.MuteAllInRoomEvent, MuteAllInRoomEvent.class);
|
this.registerHandler(Incoming.muteAllInRoomEvent, MuteAllInRoomEvent.class);
|
||||||
this.registerHandler(Incoming.GetCustomRoomFilterEvent, GetCustomRoomFilterEvent.class);
|
this.registerHandler(Incoming.getCustomRoomFilterEvent, GetCustomRoomFilterEvent.class);
|
||||||
this.registerHandler(Incoming.UpdateRoomFilterEvent, UpdateRoomFilterEvent.class);
|
this.registerHandler(Incoming.updateRoomFilterEvent, UpdateRoomFilterEvent.class);
|
||||||
this.registerHandler(Incoming.SubmitRoomToCompetitionEvent, SubmitRoomToCompetitionEvent.class);
|
this.registerHandler(Incoming.submitRoomToCompetitionEvent, SubmitRoomToCompetitionEvent.class);
|
||||||
this.registerHandler(Incoming.GetBannedUsersFromRoomEvent, GetBannedUsersFromRoomEvent.class);
|
this.registerHandler(Incoming.getBannedUsersFromRoomEvent, GetBannedUsersFromRoomEvent.class);
|
||||||
this.registerHandler(Incoming.GetOfficialSongIdEvent, GetOfficialSongIdEvent.class);
|
this.registerHandler(Incoming.getOfficialSongIdEvent, GetOfficialSongIdEvent.class);
|
||||||
this.registerHandler(Incoming.GetSongInfoEvent, GetSongInfoEvent.class);
|
this.registerHandler(Incoming.getSongInfoEvent, GetSongInfoEvent.class);
|
||||||
this.registerHandler(Incoming.AddJukeboxDiskEvent, AddJukeboxDiskEvent.class);
|
this.registerHandler(Incoming.addJukeboxDiskEvent, AddJukeboxDiskEvent.class);
|
||||||
this.registerHandler(Incoming.RemoveJukeboxDiskEvent, RemoveJukeboxDiskEvent.class);
|
this.registerHandler(Incoming.removeJukeboxDiskEvent, RemoveJukeboxDiskEvent.class);
|
||||||
this.registerHandler(Incoming.GetNowPlayingEvent, GetNowPlayingEvent.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.jukeBoxEventOne, JukeBoxEventOne.class); // this doesnt even exist in the swf src for this prod.
|
||||||
this.registerHandler(Incoming.GetJukeboxPlayListEvent, GetJukeboxPlayListEvent.class);
|
this.registerHandler(Incoming.getJukeboxPlayListEvent, GetJukeboxPlayListEvent.class);
|
||||||
this.registerHandler(Incoming.AddSpamWallPostItEvent, AddSpamWallPostItEvent.class);
|
this.registerHandler(Incoming.addSpamWallPostItEvent, AddSpamWallPostItEvent.class);
|
||||||
this.registerHandler(Incoming.GetRoomAdPurchaseInfoEvent, GetRoomAdPurchaseInfoEvent.class);
|
this.registerHandler(Incoming.getRoomAdPurchaseInfoEvent, GetRoomAdPurchaseInfoEvent.class);
|
||||||
this.registerHandler(Incoming.PurchaseRoomAdEvent, PurchaseRoomAdEvent.class);
|
this.registerHandler(Incoming.purchaseRoomAdEvent, PurchaseRoomAdEvent.class);
|
||||||
this.registerHandler(Incoming.EditEventEvent, EditEventEvent.class);
|
this.registerHandler(Incoming.editEventEvent, EditEventEvent.class);
|
||||||
this.registerHandler(Incoming.IgnoreUserEvent, IgnoreUserEvent.class);
|
this.registerHandler(Incoming.ignoreUserEvent, IgnoreUserEvent.class);
|
||||||
this.registerHandler(Incoming.UnignoreUserEvent, UnignoreUserEvent.class);
|
this.registerHandler(Incoming.unignoreUserEvent, UnignoreUserEvent.class);
|
||||||
this.registerHandler(Incoming.RoomUserMuteEvent, RoomUserMuteEvent.class);
|
this.registerHandler(Incoming.roomUserMuteEvent, RoomUserMuteEvent.class);
|
||||||
this.registerHandler(Incoming.BanUserWithDurationEvent, BanUserWithDurationEvent.class);
|
this.registerHandler(Incoming.banUserWithDurationEvent, BanUserWithDurationEvent.class);
|
||||||
this.registerHandler(Incoming.UnbanUserFromRoomEvent, UnbanUserFromRoomEvent.class);
|
this.registerHandler(Incoming.unbanUserFromRoomEvent, UnbanUserFromRoomEvent.class);
|
||||||
this.registerHandler(Incoming.GetUserTagsEvent, GetUserTagsEvent.class);
|
this.registerHandler(Incoming.getUserTagsEvent, GetUserTagsEvent.class);
|
||||||
this.registerHandler(Incoming.GetYoutubeDisplayStatusEvent, GetYoutubeDisplayStatusEvent.class);
|
this.registerHandler(Incoming.getYoutubeDisplayStatusEvent, GetYoutubeDisplayStatusEvent.class);
|
||||||
this.registerHandler(Incoming.ControlYoutubeDisplayPlaybackEvent, ControlYoutubeDisplayPlaybackEvent.class);
|
this.registerHandler(Incoming.controlYoutubeDisplayPlaybackEvent, ControlYoutubeDisplayPlaybackEvent.class);
|
||||||
this.registerHandler(Incoming.SetYoutubeDisplayPlaylistEvent, SetYoutubeDisplayPlaylistEvent.class);
|
this.registerHandler(Incoming.setYoutubeDisplayPlaylistEvent, SetYoutubeDisplayPlaylistEvent.class);
|
||||||
this.registerHandler(Incoming.AddFavouriteRoomEvent, AddFavouriteRoomEvent.class);
|
this.registerHandler(Incoming.addFavouriteRoomEvent, AddFavouriteRoomEvent.class);
|
||||||
this.registerHandler(Incoming.FriendFurniConfirmLockEvent, FriendFurniConfirmLockEvent.class);
|
this.registerHandler(Incoming.friendFurniConfirmLockEvent, FriendFurniConfirmLockEvent.class);
|
||||||
this.registerHandler(Incoming.DeleteFavouriteRoomEvent, DeleteFavouriteRoomEvent.class);
|
this.registerHandler(Incoming.deleteFavouriteRoomEvent, DeleteFavouriteRoomEvent.class);
|
||||||
this.registerHandler(Incoming.SetRandomStateEvent, SetRandomStateEvent.class);
|
this.registerHandler(Incoming.setRandomStateEvent, SetRandomStateEvent.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
void registerPolls() throws Exception {
|
void registerPolls() throws Exception {
|
||||||
this.registerHandler(Incoming.PollRejectEvent, PollRejectEvent.class);
|
this.registerHandler(Incoming.pollRejectEvent, PollRejectEvent.class);
|
||||||
this.registerHandler(Incoming.PollStartEvent, PollStartEvent.class);
|
this.registerHandler(Incoming.pollStartEvent, PollStartEvent.class);
|
||||||
this.registerHandler(Incoming.AnswerPollEvent, AnswerPollEvent.class);
|
this.registerHandler(Incoming.answerPollEvent, AnswerPollEvent.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
void registerModTool() throws Exception {
|
void registerModTool() throws Exception {
|
||||||
this.registerHandler(Incoming.GetModeratorRoomInfoEvent, GetModeratorRoomInfoEvent.class);
|
this.registerHandler(Incoming.getModeratorRoomInfoEvent, GetModeratorRoomInfoEvent.class);
|
||||||
this.registerHandler(Incoming.GetRoomChatlogEvent, GetRoomChatlogEvent.class);
|
this.registerHandler(Incoming.getRoomChatlogEvent, GetRoomChatlogEvent.class);
|
||||||
this.registerHandler(Incoming.GetModeratorUserInfoEvent, GetModeratorUserInfoEvent.class);
|
this.registerHandler(Incoming.getModeratorUserInfoEvent, GetModeratorUserInfoEvent.class);
|
||||||
this.registerHandler(Incoming.PickIssuesEvent, PickIssuesEvent.class);
|
this.registerHandler(Incoming.pickIssuesEvent, PickIssuesEvent.class);
|
||||||
this.registerHandler(Incoming.CloseIssuesEvent, CloseIssuesEvent.class);
|
this.registerHandler(Incoming.closeIssuesEvent, CloseIssuesEvent.class);
|
||||||
this.registerHandler(Incoming.ReleaseIssuesEvent, ReleaseIssuesEvent.class);
|
this.registerHandler(Incoming.releaseIssuesEvent, ReleaseIssuesEvent.class);
|
||||||
this.registerHandler(Incoming.ModMessageEvent, ModMessageEvent.class);
|
this.registerHandler(Incoming.modMessageEvent, ModMessageEvent.class);
|
||||||
this.registerHandler(Incoming.ModToolWarnEvent, ModToolWarnEvent.class);
|
this.registerHandler(Incoming.modToolWarnEvent, ModToolWarnEvent.class);
|
||||||
this.registerHandler(Incoming.ModKickEvent, ModKickEvent.class);
|
this.registerHandler(Incoming.modKickEvent, ModKickEvent.class);
|
||||||
this.registerHandler(Incoming.ModeratorActionEvent, ModeratorActionEvent.class);
|
this.registerHandler(Incoming.moderatorActionEvent, ModeratorActionEvent.class);
|
||||||
this.registerHandler(Incoming.ModerateRoomEvent, ModerateRoomEvent.class);
|
this.registerHandler(Incoming.moderateRoomEvent, ModerateRoomEvent.class);
|
||||||
this.registerHandler(Incoming.GetRoomVisitsEvent, GetRoomVisitsEvent.class);
|
this.registerHandler(Incoming.getRoomVisitsEvent, GetRoomVisitsEvent.class);
|
||||||
this.registerHandler(Incoming.GetCfhChatlogEvent, GetCfhChatlogEvent.class);
|
this.registerHandler(Incoming.getCfhChatlogEvent, GetCfhChatlogEvent.class);
|
||||||
this.registerHandler(Incoming.ModToolRequestRoomUserChatlogEvent, ModToolRequestRoomUserChatlogEvent.class);
|
this.registerHandler(Incoming.modToolRequestRoomUserChatlogEvent, ModToolRequestRoomUserChatlogEvent.class);
|
||||||
this.registerHandler(Incoming.GetUserChatlogEvent, GetUserChatlogEvent.class);
|
this.registerHandler(Incoming.getUserChatlogEvent, GetUserChatlogEvent.class);
|
||||||
this.registerHandler(Incoming.ModAlertEvent, ModAlertEvent.class);
|
this.registerHandler(Incoming.modAlertEvent, ModAlertEvent.class);
|
||||||
this.registerHandler(Incoming.ModMuteEvent, ModMuteEvent.class);
|
this.registerHandler(Incoming.modMuteEvent, ModMuteEvent.class);
|
||||||
this.registerHandler(Incoming.ModBanEvent, ModBanEvent.class);
|
this.registerHandler(Incoming.modBanEvent, ModBanEvent.class);
|
||||||
this.registerHandler(Incoming.ModTradingLockEvent, ModTradingLockEvent.class);
|
this.registerHandler(Incoming.modTradingLockEvent, ModTradingLockEvent.class);
|
||||||
this.registerHandler(Incoming.ModToolSanctionEvent, ModToolSanctionEvent.class);
|
this.registerHandler(Incoming.modToolSanctionEvent, ModToolSanctionEvent.class);
|
||||||
this.registerHandler(Incoming.CloseIssueDefaultActionEvent, CloseIssueDefaultActionEvent.class);
|
this.registerHandler(Incoming.closeIssueDefaultActionEvent, CloseIssueDefaultActionEvent.class);
|
||||||
|
|
||||||
this.registerHandler(Incoming.GetPendingCallsForHelpEvent, GetPendingCallsForHelpEvent.class);
|
this.registerHandler(Incoming.getPendingCallsForHelpEvent, GetPendingCallsForHelpEvent.class);
|
||||||
this.registerHandler(Incoming.GetGuideReportingStatusEvent, GetGuideReportingStatusEvent.class);
|
this.registerHandler(Incoming.getGuideReportingStatusEvent, GetGuideReportingStatusEvent.class);
|
||||||
this.registerHandler(Incoming.ChatReviewSessionCreateEvent, ChatReviewSessionCreateEvent.class);
|
this.registerHandler(Incoming.chatReviewSessionCreateEvent, ChatReviewSessionCreateEvent.class);
|
||||||
this.registerHandler(Incoming.CallForHelpEvent, CallForHelpEvent.class);
|
this.registerHandler(Incoming.callForHelpEvent, CallForHelpEvent.class);
|
||||||
this.registerHandler(Incoming.CallForHelpFromIMEvent, CallForHelpFromIMEvent.class);
|
this.registerHandler(Incoming.callForHelpFromIMEvent, CallForHelpFromIMEvent.class);
|
||||||
this.registerHandler(Incoming.CallForHelpFromForumThreadEvent, CallForHelpFromForumThreadEvent.class);
|
this.registerHandler(Incoming.callForHelpFromForumThreadEvent, CallForHelpFromForumThreadEvent.class);
|
||||||
this.registerHandler(Incoming.CallForHelpFromForumMessageEvent, CallForHelpFromForumMessageEvent.class);
|
this.registerHandler(Incoming.callForHelpFromForumMessageEvent, CallForHelpFromForumMessageEvent.class);
|
||||||
this.registerHandler(Incoming.CallForHelpFromPhotoEvent, CallForHelpFromPhotoEvent.class);
|
this.registerHandler(Incoming.callForHelpFromPhotoEvent, CallForHelpFromPhotoEvent.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
void registerTrading() throws Exception {
|
void registerTrading() throws Exception {
|
||||||
this.registerHandler(Incoming.OpenTradingEvent, OpenTradingEvent.class);
|
this.registerHandler(Incoming.openTradingEvent, OpenTradingEvent.class);
|
||||||
this.registerHandler(Incoming.AddItemToTradeEvent, AddItemToTradeEvent.class);
|
this.registerHandler(Incoming.addItemToTradeEvent, AddItemToTradeEvent.class);
|
||||||
this.registerHandler(Incoming.AddItemsToTradeEvent, AddItemsToTradeEvent.class);
|
this.registerHandler(Incoming.addItemsToTradeEvent, AddItemsToTradeEvent.class);
|
||||||
this.registerHandler(Incoming.RemoveItemFromTradeEvent, RemoveItemFromTradeEvent.class);
|
this.registerHandler(Incoming.removeItemFromTradeEvent, RemoveItemFromTradeEvent.class);
|
||||||
this.registerHandler(Incoming.AcceptTradingEvent, AcceptTradingEvent.class);
|
this.registerHandler(Incoming.acceptTradingEvent, AcceptTradingEvent.class);
|
||||||
this.registerHandler(Incoming.UnacceptTradingEvent, UnacceptTradingEvent.class);
|
this.registerHandler(Incoming.unacceptTradingEvent, UnacceptTradingEvent.class);
|
||||||
this.registerHandler(Incoming.ConfirmAcceptTradingEvent, ConfirmAcceptTradingEvent.class);
|
this.registerHandler(Incoming.confirmAcceptTradingEvent, ConfirmAcceptTradingEvent.class);
|
||||||
this.registerHandler(Incoming.CloseTradingEvent, CloseTradingEvent.class);
|
this.registerHandler(Incoming.closeTradingEvent, CloseTradingEvent.class);
|
||||||
this.registerHandler(Incoming.ConfirmDeclineTradingEvent, ConfirmDeclineTradingEvent.class);
|
this.registerHandler(Incoming.confirmDeclineTradingEvent, ConfirmDeclineTradingEvent.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
void registerGuilds() throws Exception {
|
void registerGuilds() throws Exception {
|
||||||
this.registerHandler(Incoming.GetGuildCreationInfoEvent, GetGuildCreationInfoEvent.class);
|
this.registerHandler(Incoming.getGuildCreationInfoEvent, GetGuildCreationInfoEvent.class);
|
||||||
this.registerHandler(Incoming.GetGuildEditorDataEvent, GetGuildEditorDataEvent.class);
|
this.registerHandler(Incoming.getGuildEditorDataEvent, GetGuildEditorDataEvent.class);
|
||||||
this.registerHandler(Incoming.CreateGuildEvent, CreateGuildEvent.class);
|
this.registerHandler(Incoming.createGuildEvent, CreateGuildEvent.class);
|
||||||
this.registerHandler(Incoming.GetHabboGroupDetailsEvent, GetHabboGroupDetailsEvent.class);
|
this.registerHandler(Incoming.getHabboGroupDetailsEvent, GetHabboGroupDetailsEvent.class);
|
||||||
this.registerHandler(Incoming.GetGuildEditInfoEvent, GetGuildEditInfoEvent.class);
|
this.registerHandler(Incoming.getGuildEditInfoEvent, GetGuildEditInfoEvent.class);
|
||||||
this.registerHandler(Incoming.GetGuildMembersEvent, GetGuildMembersEvent.class);
|
this.registerHandler(Incoming.getGuildMembersEvent, GetGuildMembersEvent.class);
|
||||||
this.registerHandler(Incoming.JoinHabboGroupEvent, JoinHabboGroupEvent.class);
|
this.registerHandler(Incoming.joinHabboGroupEvent, JoinHabboGroupEvent.class);
|
||||||
this.registerHandler(Incoming.UpdateGuildIdentityEvent, UpdateGuildIdentityEvent.class);
|
this.registerHandler(Incoming.updateGuildIdentityEvent, UpdateGuildIdentityEvent.class);
|
||||||
this.registerHandler(Incoming.UpdateGuildBadgeEvent, UpdateGuildBadgeEvent.class);
|
this.registerHandler(Incoming.updateGuildBadgeEvent, UpdateGuildBadgeEvent.class);
|
||||||
this.registerHandler(Incoming.UpdateGuildColorsEvent, UpdateGuildColorsEvent.class);
|
this.registerHandler(Incoming.updateGuildColorsEvent, UpdateGuildColorsEvent.class);
|
||||||
this.registerHandler(Incoming.RemoveAdminRightsFromMemberEvent, RemoveAdminRightsFromMemberEvent.class);
|
this.registerHandler(Incoming.removeAdminRightsFromMemberEvent, RemoveAdminRightsFromMemberEvent.class);
|
||||||
this.registerHandler(Incoming.KickMemberEvent, KickMemberEvent.class);
|
this.registerHandler(Incoming.kickMemberEvent, KickMemberEvent.class);
|
||||||
this.registerHandler(Incoming.UpdateGuildSettingsEvent, UpdateGuildSettingsEvent.class);
|
this.registerHandler(Incoming.updateGuildSettingsEvent, UpdateGuildSettingsEvent.class);
|
||||||
this.registerHandler(Incoming.ApproveMembershipRequestEvent, ApproveMembershipRequestEvent.class);
|
this.registerHandler(Incoming.approveMembershipRequestEvent, ApproveMembershipRequestEvent.class);
|
||||||
this.registerHandler(Incoming.RejectMembershipRequestEvent, RejectMembershipRequestEvent.class);
|
this.registerHandler(Incoming.rejectMembershipRequestEvent, RejectMembershipRequestEvent.class);
|
||||||
this.registerHandler(Incoming.AddAdminRightsToMemberEvent, AddAdminRightsToMemberEvent.class);
|
this.registerHandler(Incoming.addAdminRightsToMemberEvent, AddAdminRightsToMemberEvent.class);
|
||||||
this.registerHandler(Incoming.SelectFavouriteHabboGroupEvent, SelectFavouriteHabboGroupEvent.class);
|
this.registerHandler(Incoming.selectFavouriteHabboGroupEvent, SelectFavouriteHabboGroupEvent.class);
|
||||||
this.registerHandler(Incoming.GetGuildMembershipsEvent, GetGuildMembershipsEvent.class);
|
this.registerHandler(Incoming.getGuildMembershipsEvent, GetGuildMembershipsEvent.class);
|
||||||
this.registerHandler(Incoming.GetGuildFurniContextMenuInfoEvent, GetGuildFurniContextMenuInfoEvent.class);
|
this.registerHandler(Incoming.getGuildFurniContextMenuInfoEvent, GetGuildFurniContextMenuInfoEvent.class);
|
||||||
this.registerHandler(Incoming.GetMemberGuildItemCountEvent, GetMemberGuildItemCountEvent.class);
|
this.registerHandler(Incoming.getMemberGuildItemCountEvent, GetMemberGuildItemCountEvent.class);
|
||||||
this.registerHandler(Incoming.DeselectFavouriteHabboGroupEvent, DeselectFavouriteHabboGroupEvent.class);
|
this.registerHandler(Incoming.deselectFavouriteHabboGroupEvent, DeselectFavouriteHabboGroupEvent.class);
|
||||||
this.registerHandler(Incoming.DeactivateGuildEvent, DeactivateGuildEvent.class);
|
this.registerHandler(Incoming.deactivateGuildEvent, DeactivateGuildEvent.class);
|
||||||
this.registerHandler(Incoming.GetForumsListEvent, GetForumsListEvent.class);
|
this.registerHandler(Incoming.getForumsListEvent, GetForumsListEvent.class);
|
||||||
this.registerHandler(Incoming.GetThreadsEvent, GetThreadsEvent.class);
|
this.registerHandler(Incoming.getThreadsEvent, GetThreadsEvent.class);
|
||||||
this.registerHandler(Incoming.GetForumStatsEvent, GetForumStatsEvent.class);
|
this.registerHandler(Incoming.getForumStatsEvent, GetForumStatsEvent.class);
|
||||||
this.registerHandler(Incoming.PostMessageEvent, PostMessageEvent.class);
|
this.registerHandler(Incoming.postMessageEvent, PostMessageEvent.class);
|
||||||
this.registerHandler(Incoming.UpdateForumSettingsEvent, UpdateForumSettingsEvent.class);
|
this.registerHandler(Incoming.updateForumSettingsEvent, UpdateForumSettingsEvent.class);
|
||||||
this.registerHandler(Incoming.GetMessagesEvent, GetMessagesEvent.class);
|
this.registerHandler(Incoming.getMessagesEvent, GetMessagesEvent.class);
|
||||||
this.registerHandler(Incoming.ModerateMessageEvent, ModerateMessageEvent.class);
|
this.registerHandler(Incoming.moderateMessageEvent, ModerateMessageEvent.class);
|
||||||
this.registerHandler(Incoming.ModerateThreadEvent, ModerateThreadEvent.class);
|
this.registerHandler(Incoming.moderateThreadEvent, ModerateThreadEvent.class);
|
||||||
this.registerHandler(Incoming.UpdateThreadEvent, UpdateThreadEvent.class);
|
this.registerHandler(Incoming.updateThreadEvent, UpdateThreadEvent.class);
|
||||||
this.registerHandler(Incoming.GetHabboGroupBadgesEvent, GetHabboGroupBadgesEvent.class);
|
this.registerHandler(Incoming.getHabboGroupBadgesEvent, GetHabboGroupBadgesEvent.class);
|
||||||
|
|
||||||
// this.registerHandler(Incoming.GuildForumDataEvent, GuildForumModerateMessageEvent.class);
|
// this.registerHandler(Incoming.guildForumDataEvent, GuildForumModerateMessageEvent.class);
|
||||||
// this.registerHandler(Incoming.GuildForumDataEvent, GuildForumModerateThreadEvent.class);
|
// this.registerHandler(Incoming.guildForumDataEvent, GuildForumModerateThreadEvent.class);
|
||||||
// this.registerHandler(Incoming.GuildForumDataEvent, GuildForumPostThreadEvent.class);
|
// this.registerHandler(Incoming.guildForumDataEvent, GuildForumPostThreadEvent.class);
|
||||||
// this.registerHandler(Incoming.GuildForumDataEvent, GuildForumThreadsEvent.class);
|
// this.registerHandler(Incoming.guildForumDataEvent, GuildForumThreadsEvent.class);
|
||||||
// this.registerHandler(Incoming.GuildForumDataEvent, GuildForumThreadsMessagesEvent.class);
|
// this.registerHandler(Incoming.guildForumDataEvent, GuildForumThreadsMessagesEvent.class);
|
||||||
// this.registerHandler(Incoming.GuildForumDataEvent, GuildForumUpdateSettingsEvent.class);
|
// this.registerHandler(Incoming.guildForumDataEvent, GuildForumUpdateSettingsEvent.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
void registerPets() throws Exception {
|
void registerPets() throws Exception {
|
||||||
this.registerHandler(Incoming.GetPetInfoEvent, GetPetInfoEvent.class);
|
this.registerHandler(Incoming.getPetInfoEvent, GetPetInfoEvent.class);
|
||||||
this.registerHandler(Incoming.RemovePetFromFlatEvent, RemovePetFromFlatEvent.class);
|
this.registerHandler(Incoming.removePetFromFlatEvent, RemovePetFromFlatEvent.class);
|
||||||
this.registerHandler(Incoming.RespectPetEvent, RespectPetEvent.class);
|
this.registerHandler(Incoming.respectPetEvent, RespectPetEvent.class);
|
||||||
this.registerHandler(Incoming.GetPetCommandsEvent, GetPetCommandsEvent.class);
|
this.registerHandler(Incoming.getPetCommandsEvent, GetPetCommandsEvent.class);
|
||||||
this.registerHandler(Incoming.CustomizePetWithFurniEvent, CustomizePetWithFurniEvent.class);
|
this.registerHandler(Incoming.customizePetWithFurniEvent, CustomizePetWithFurniEvent.class);
|
||||||
this.registerHandler(Incoming.TogglePetRidingPermissionEvent, TogglePetRidingPermissionEvent.class);
|
this.registerHandler(Incoming.togglePetRidingPermissionEvent, TogglePetRidingPermissionEvent.class);
|
||||||
this.registerHandler(Incoming.MountPetEvent, MountPetEvent.class);
|
this.registerHandler(Incoming.mountPetEvent, MountPetEvent.class);
|
||||||
this.registerHandler(Incoming.RemoveSaddleFromPetEvent, RemoveSaddleFromPetEvent.class);
|
this.registerHandler(Incoming.removeSaddleFromPetEvent, RemoveSaddleFromPetEvent.class);
|
||||||
this.registerHandler(Incoming.TogglePetBreedingPermissionEvent, TogglePetBreedingPermissionEvent.class);
|
this.registerHandler(Incoming.togglePetBreedingPermissionEvent, TogglePetBreedingPermissionEvent.class);
|
||||||
this.registerHandler(Incoming.CompostPlantEvent, CompostPlantEvent.class);
|
this.registerHandler(Incoming.compostPlantEvent, CompostPlantEvent.class);
|
||||||
this.registerHandler(Incoming.BreedPetsEvent, BreedPetsEvent.class);
|
this.registerHandler(Incoming.breedPetsEvent, BreedPetsEvent.class);
|
||||||
this.registerHandler(Incoming.MovePetEvent, MovePetEvent.class);
|
this.registerHandler(Incoming.movePetEvent, MovePetEvent.class);
|
||||||
this.registerHandler(Incoming.OpenPetPackageEvent, OpenPetPackageEvent.class);
|
this.registerHandler(Incoming.openPetPackageEvent, OpenPetPackageEvent.class);
|
||||||
this.registerHandler(Incoming.CancelPetBreedingEvent, CancelPetBreedingEvent.class);
|
this.registerHandler(Incoming.cancelPetBreedingEvent, CancelPetBreedingEvent.class);
|
||||||
this.registerHandler(Incoming.ConfirmPetBreedingEvent, ConfirmPetBreedingEvent.class);
|
this.registerHandler(Incoming.confirmPetBreedingEvent, ConfirmPetBreedingEvent.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
void registerWired() throws Exception {
|
void registerWired() throws Exception {
|
||||||
this.registerHandler(Incoming.UpdateTriggerEvent, UpdateTriggerEvent.class);
|
this.registerHandler(Incoming.updateTriggerEvent, UpdateTriggerEvent.class);
|
||||||
this.registerHandler(Incoming.UpdateActionEvent, UpdateActionEvent.class);
|
this.registerHandler(Incoming.updateActionEvent, UpdateActionEvent.class);
|
||||||
this.registerHandler(Incoming.UpdateConditionEvent, UpdateConditionEvent.class);
|
this.registerHandler(Incoming.updateConditionEvent, UpdateConditionEvent.class);
|
||||||
this.registerHandler(Incoming.ApplySnapshotEvent, ApplySnapshotEvent.class);
|
this.registerHandler(Incoming.applySnapshotEvent, ApplySnapshotEvent.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
void registerUnknown() throws Exception {
|
void registerUnknown() throws Exception {
|
||||||
this.registerHandler(Incoming.GetResolutionAchievementsEvent, GetResolutionAchievementsEvent.class);
|
this.registerHandler(Incoming.getResolutionAchievementsEvent, GetResolutionAchievementsEvent.class);
|
||||||
this.registerHandler(Incoming.GetTalentTrackEvent, GetTalentTrackEvent.class);
|
this.registerHandler(Incoming.getTalentTrackEvent, GetTalentTrackEvent.class);
|
||||||
this.registerHandler(Incoming.GetBadgePointLimitsEvent, GetBadgePointLimitsEvent.class);
|
this.registerHandler(Incoming.getBadgePointLimitsEvent, GetBadgePointLimitsEvent.class);
|
||||||
this.registerHandler(Incoming.GetCfhStatusEvent, GetCfhStatusEvent.class);
|
this.registerHandler(Incoming.getCfhStatusEvent, GetCfhStatusEvent.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
void registerFloorPlanEditor() throws Exception {
|
void registerFloorPlanEditor() throws Exception {
|
||||||
this.registerHandler(Incoming.UpdateFloorPropertiesEvent, UpdateFloorPropertiesEvent.class);
|
this.registerHandler(Incoming.updateFloorPropertiesEvent, UpdateFloorPropertiesEvent.class);
|
||||||
this.registerHandler(Incoming.GetOccupiedTilesEvent, GetOccupiedTilesEvent.class);
|
this.registerHandler(Incoming.getOccupiedTilesEvent, GetOccupiedTilesEvent.class);
|
||||||
this.registerHandler(Incoming.GetRoomEntryTileEvent, GetRoomEntryTileEvent.class);
|
this.registerHandler(Incoming.getRoomEntryTileEvent, GetRoomEntryTileEvent.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
void registerAchievements() throws Exception {
|
void registerAchievements() throws Exception {
|
||||||
this.registerHandler(Incoming.GetAchievementsEvent, GetAchievementsEvent.class);
|
this.registerHandler(Incoming.getAchievementsEvent, GetAchievementsEvent.class);
|
||||||
this.registerHandler(Incoming.RequestAchievementConfigurationEvent, RequestAchievementConfigurationEvent.class);
|
this.registerHandler(Incoming.requestAchievementConfigurationEvent, RequestAchievementConfigurationEvent.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
void registerGuides() throws Exception {
|
void registerGuides() throws Exception {
|
||||||
this.registerHandler(Incoming.GuideSessionOnDutyUpdateEvent, GuideSessionOnDutyUpdateEvent.class);
|
this.registerHandler(Incoming.guideSessionOnDutyUpdateEvent, GuideSessionOnDutyUpdateEvent.class);
|
||||||
this.registerHandler(Incoming.GuideSessionCreateEvent, GuideSessionCreateEvent.class);
|
this.registerHandler(Incoming.guideSessionCreateEvent, GuideSessionCreateEvent.class);
|
||||||
this.registerHandler(Incoming.GuideSessionIsTypingEvent, GuideSessionIsTypingEvent.class);
|
this.registerHandler(Incoming.guideSessionIsTypingEvent, GuideSessionIsTypingEvent.class);
|
||||||
this.registerHandler(Incoming.GuideSessionReportEvent, GuideSessionReportEvent.class);
|
this.registerHandler(Incoming.guideSessionReportEvent, GuideSessionReportEvent.class);
|
||||||
this.registerHandler(Incoming.GuideSessionFeedbackEvent, GuideSessionFeedbackEvent.class);
|
this.registerHandler(Incoming.guideSessionFeedbackEvent, GuideSessionFeedbackEvent.class);
|
||||||
this.registerHandler(Incoming.GuideSessionMessageEvent, GuideSessionMessageEvent.class);
|
this.registerHandler(Incoming.guideSessionMessageEvent, GuideSessionMessageEvent.class);
|
||||||
this.registerHandler(Incoming.GuideSessionRequesterCancelsEvent, GuideSessionRequesterCancelsEvent.class);
|
this.registerHandler(Incoming.guideSessionRequesterCancelsEvent, GuideSessionRequesterCancelsEvent.class);
|
||||||
this.registerHandler(Incoming.GuideSessionGuideDecidesEvent, GuideSessionGuideDecidesEvent.class);
|
this.registerHandler(Incoming.guideSessionGuideDecidesEvent, GuideSessionGuideDecidesEvent.class);
|
||||||
this.registerHandler(Incoming.GuideSessionInviteRequesterEvent, GuideSessionInviteRequesterEvent.class);
|
this.registerHandler(Incoming.guideSessionInviteRequesterEvent, GuideSessionInviteRequesterEvent.class);
|
||||||
this.registerHandler(Incoming.GuideSessionGetRequesterRoomEvent, GuideSessionGetRequesterRoomEvent.class);
|
this.registerHandler(Incoming.guideSessionGetRequesterRoomEvent, GuideSessionGetRequesterRoomEvent.class);
|
||||||
this.registerHandler(Incoming.GuideSessionResolvedEvent, GuideSessionResolvedEvent.class);
|
this.registerHandler(Incoming.guideSessionResolvedEvent, GuideSessionResolvedEvent.class);
|
||||||
|
|
||||||
this.registerHandler(Incoming.ChatReviewGuideDetachedEvent, ChatReviewGuideDetachedEvent.class);
|
this.registerHandler(Incoming.chatReviewGuideDetachedEvent, ChatReviewGuideDetachedEvent.class);
|
||||||
this.registerHandler(Incoming.ChatReviewGuideDecidesOnOfferEvent, ChatReviewGuideDecidesOnOfferEvent.class);
|
this.registerHandler(Incoming.chatReviewGuideDecidesOnOfferEvent, ChatReviewGuideDecidesOnOfferEvent.class);
|
||||||
this.registerHandler(Incoming.ChatReviewGuideVoteEvent, ChatReviewGuideVoteEvent.class);
|
this.registerHandler(Incoming.chatReviewGuideVoteEvent, ChatReviewGuideVoteEvent.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
void registerCrafting() throws Exception {
|
void registerCrafting() throws Exception {
|
||||||
this.registerHandler(Incoming.GetCraftingRecipeEvent, GetCraftingRecipeEvent.class);
|
this.registerHandler(Incoming.getCraftingRecipeEvent, GetCraftingRecipeEvent.class);
|
||||||
this.registerHandler(Incoming.GetCraftableProductsEvent, GetCraftableProductsEvent.class);
|
this.registerHandler(Incoming.getCraftableProductsEvent, GetCraftableProductsEvent.class);
|
||||||
this.registerHandler(Incoming.CraftEvent, CraftEvent.class);
|
this.registerHandler(Incoming.craftEvent, CraftEvent.class);
|
||||||
this.registerHandler(Incoming.CraftSecretEvent, CraftSecretEvent.class);
|
this.registerHandler(Incoming.craftSecretEvent, CraftSecretEvent.class);
|
||||||
this.registerHandler(Incoming.GetCraftingRecipesAvailableEvent, GetCraftingRecipesAvailableEvent.class);
|
this.registerHandler(Incoming.getCraftingRecipesAvailableEvent, GetCraftingRecipesAvailableEvent.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
void registerCamera() throws Exception {
|
void registerCamera() throws Exception {
|
||||||
this.registerHandler(Incoming.RenderRoomEvent, RenderRoomEvent.class);
|
this.registerHandler(Incoming.renderRoomEvent, RenderRoomEvent.class);
|
||||||
this.registerHandler(Incoming.RequestCameraConfigurationEvent, RequestCameraConfigurationEvent.class);
|
this.registerHandler(Incoming.requestCameraConfigurationEvent, RequestCameraConfigurationEvent.class);
|
||||||
this.registerHandler(Incoming.PurchasePhotoEvent, PurchasePhotoEvent.class);
|
this.registerHandler(Incoming.purchasePhotoEvent, PurchasePhotoEvent.class);
|
||||||
this.registerHandler(Incoming.RenderRoomThumbnailEvent, RenderRoomThumbnailEvent.class);
|
this.registerHandler(Incoming.renderRoomThumbnailEvent, RenderRoomThumbnailEvent.class);
|
||||||
this.registerHandler(Incoming.PublishPhotoEvent, PublishPhotoEvent.class);
|
this.registerHandler(Incoming.publishPhotoEvent, PublishPhotoEvent.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
void registerGameCenter() throws Exception {
|
void registerGameCenter() throws Exception {
|
||||||
this.registerHandler(Incoming.GetGameListEvent, GetGameListEvent.class);
|
this.registerHandler(Incoming.getGameListEvent, GetGameListEvent.class);
|
||||||
this.registerHandler(Incoming.GetGameStatusEvent, GetGameStatusEvent.class);
|
this.registerHandler(Incoming.getGameStatusEvent, GetGameStatusEvent.class);
|
||||||
this.registerHandler(Incoming.JoinQueueEvent, JoinQueueEvent.class);
|
this.registerHandler(Incoming.joinQueueEvent, JoinQueueEvent.class);
|
||||||
this.registerHandler(Incoming.GetWeeklyGameRewardWinnersEvent, GetWeeklyGameRewardWinnersEvent.class);
|
this.registerHandler(Incoming.getWeeklyGameRewardWinnersEvent, GetWeeklyGameRewardWinnersEvent.class);
|
||||||
this.registerHandler(Incoming.GameUnloadedEvent, GameUnloadedEvent.class);
|
this.registerHandler(Incoming.gameUnloadedEvent, GameUnloadedEvent.class);
|
||||||
this.registerHandler(Incoming.GetWeeklyGameRewardEvent, GetWeeklyGameRewardEvent.class);
|
this.registerHandler(Incoming.getWeeklyGameRewardEvent, GetWeeklyGameRewardEvent.class);
|
||||||
this.registerHandler(Incoming.Game2GetAccountGameStatusEvent, Game2GetAccountGameStatusEvent.class);
|
this.registerHandler(Incoming.game2GetAccountGameStatusEvent, Game2GetAccountGameStatusEvent.class);
|
||||||
}
|
}
|
||||||
}
|
}
|
File diff suppressed because it is too large
Load Diff
@ -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.Emulator;
|
||||||
import com.eu.habbo.messages.incoming.MessageHandler;
|
import com.eu.habbo.messages.incoming.MessageHandler;
|
||||||
@ -9,6 +9,7 @@ public class OpenCampaignCalendarDoorAsStaffEvent extends MessageHandler {
|
|||||||
String campaignName = this.packet.readString();
|
String campaignName = this.packet.readString();
|
||||||
int day = this.packet.readInt();
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -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.Emulator;
|
||||||
import com.eu.habbo.messages.incoming.MessageHandler;
|
import com.eu.habbo.messages.incoming.MessageHandler;
|
||||||
@ -9,6 +9,6 @@ public class OpenCampaignCalendarDoorEvent extends MessageHandler {
|
|||||||
String campaignName = this.packet.readString();
|
String campaignName = this.packet.readString();
|
||||||
int day = this.packet.readInt();
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -83,7 +83,7 @@ public class RequestFriendEvent extends MessageHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(targetHabbo.isOnline()) {
|
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);
|
Messenger.makeFriendRequest(this.client.getHabbo().getHabboInfo().getId(), targetId);
|
||||||
|
@ -5,12 +5,13 @@ import com.eu.habbo.habbohotel.guilds.Guild;
|
|||||||
import com.eu.habbo.habbohotel.guilds.GuildMember;
|
import com.eu.habbo.habbohotel.guilds.GuildMember;
|
||||||
import com.eu.habbo.habbohotel.guilds.GuildRank;
|
import com.eu.habbo.habbohotel.guilds.GuildRank;
|
||||||
import com.eu.habbo.habbohotel.permissions.Permission;
|
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.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.incoming.MessageHandler;
|
||||||
import com.eu.habbo.messages.outgoing.guilds.GuildMemberMgmtFailedMessageComposer;
|
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.GuildMembershipRejectedMessageComposer;
|
||||||
|
import com.eu.habbo.messages.outgoing.guilds.HabboGroupDetailsMessageComposer;
|
||||||
import com.eu.habbo.plugin.events.guilds.GuildAcceptedMembershipEvent;
|
import com.eu.habbo.plugin.events.guilds.GuildAcceptedMembershipEvent;
|
||||||
|
|
||||||
public class ApproveMembershipRequestEvent extends MessageHandler {
|
public class ApproveMembershipRequestEvent extends MessageHandler {
|
||||||
@ -20,44 +21,44 @@ public class ApproveMembershipRequestEvent extends MessageHandler {
|
|||||||
int userId = this.packet.readInt();
|
int userId = this.packet.readInt();
|
||||||
|
|
||||||
Guild guild = Emulator.getGameEnvironment().getGuildManager().getGuild(guildId);
|
Guild guild = Emulator.getGameEnvironment().getGuildManager().getGuild(guildId);
|
||||||
Habbo habbo = Emulator.getGameEnvironment().getHabboManager().getHabbo(userId);
|
HabboInfo userInfo;
|
||||||
|
if (guild == null) return;
|
||||||
if (guild != null) {
|
|
||||||
GuildMember groupMember = Emulator.getGameEnvironment().getGuildManager().getGuildMember(guild, this.client.getHabbo());
|
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())) {
|
Habbo habbo = Emulator.getGameEnvironment().getHabboManager().getHabbo(userId);
|
||||||
if (habbo != null) {
|
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));
|
this.client.sendResponse(new GuildMemberMgmtFailedMessageComposer(guild.getId(), GuildMemberMgmtFailedMessageComposer.ALREADY_ACCEPTED));
|
||||||
return;
|
return;
|
||||||
} else {
|
}
|
||||||
//Check the user has requested
|
|
||||||
GuildMember member = Emulator.getGameEnvironment().getGuildManager().getGuildMember(guild, habbo);
|
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) {
|
if (member == null || member.getRank().type != GuildRank.REQUESTED.type) {
|
||||||
this.client.sendResponse(new GuildMemberMgmtFailedMessageComposer(guild.getId(), GuildMemberMgmtFailedMessageComposer.NO_LONGER_MEMBER));
|
this.client.sendResponse(new GuildMemberMgmtFailedMessageComposer(guild.getId(), GuildMemberMgmtFailedMessageComposer.NO_LONGER_MEMBER));
|
||||||
return;
|
return;
|
||||||
} else {
|
}
|
||||||
GuildAcceptedMembershipEvent event = new GuildAcceptedMembershipEvent(guild, userId, habbo);
|
GuildAcceptedMembershipEvent event = new GuildAcceptedMembershipEvent(guild, userId, userInfo);
|
||||||
Emulator.getPluginManager().fireEvent(event);
|
Emulator.getPluginManager().fireEvent(event);
|
||||||
if (!event.isCancelled()) {
|
if (event.isCancelled()) return;
|
||||||
habbo.getHabboStats().addGuild(guild.getId());
|
|
||||||
Emulator.getGameEnvironment().getGuildManager().joinGuild(guild, this.client, habbo.getHabboInfo().getId(), true);
|
userInfo.getHabboStats().addGuild(guild.getId());
|
||||||
|
boolean joinGuild = Emulator.getGameEnvironment().getGuildManager().joinGuild(guild, this.client, userId, true);
|
||||||
|
if (!joinGuild)
|
||||||
guild.decreaseRequestCount();
|
guild.decreaseRequestCount();
|
||||||
guild.increaseMemberCount();
|
guild.increaseMemberCount();
|
||||||
this.client.sendResponse(new GuildMembershipRejectedMessageComposer(guild));
|
this.client.sendResponse(new GuildMembershipRejectedMessageComposer(guild, userId));
|
||||||
Room room = habbo.getHabboInfo().getCurrentRoom();
|
|
||||||
if (room != null) {
|
if (habbo != null && userInfo.isOnline() && userInfo.getCurrentRoom() != null && userInfo.getCurrentRoom().getGuildId() == guildId) {
|
||||||
if (room.getGuildId() == guildId) {
|
|
||||||
habbo.getClient().sendResponse(new HabboGroupDetailsMessageComposer(guild, habbo.getClient(), false, Emulator.getGameEnvironment().getGuildManager().getGuildMember(guildId, userId)));
|
habbo.getClient().sendResponse(new HabboGroupDetailsMessageComposer(guild, habbo.getClient(), false, Emulator.getGameEnvironment().getGuildManager().getGuildMember(guildId, userId)));
|
||||||
room.refreshRightsForHabbo(habbo);
|
userInfo.getCurrentRoom().refreshRightsForHabbo(habbo);
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
Emulator.getGameEnvironment().getGuildManager().joinGuild(guild, this.client, userId, true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -17,9 +17,9 @@ public class GetMemberGuildItemCountEvent extends MessageHandler {
|
|||||||
|
|
||||||
Guild guild = Emulator.getGameEnvironment().getGuildManager().getGuild(guildId);
|
Guild guild = Emulator.getGameEnvironment().getGuildManager().getGuild(guildId);
|
||||||
|
|
||||||
if (guild != null) {
|
if (guild == null) return;
|
||||||
GuildMember member = Emulator.getGameEnvironment().getGuildManager().getGuildMember(guild, this.client.getHabbo());
|
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)) {
|
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());
|
Room room = Emulator.getGameEnvironment().getRoomManager().loadRoom(guild.getRoomId());
|
||||||
int count = 0;
|
int count = 0;
|
||||||
if (room != null) {
|
if (room != null) {
|
||||||
@ -27,7 +27,7 @@ public class GetMemberGuildItemCountEvent extends MessageHandler {
|
|||||||
}
|
}
|
||||||
this.client.sendResponse(new GuildMemberFurniCountInHQMessageComposer(userId, count));
|
this.client.sendResponse(new GuildMemberFurniCountInHQMessageComposer(userId, count));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -35,7 +35,7 @@ public class KickMemberEvent extends MessageHandler {
|
|||||||
guild.decreaseMemberCount();
|
guild.decreaseMemberCount();
|
||||||
|
|
||||||
if (userId != this.client.getHabbo().getHabboInfo().getId()) {
|
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());
|
Room room = Emulator.getGameEnvironment().getRoomManager().loadRoom(guild.getRoomId());
|
||||||
|
@ -27,7 +27,7 @@ public class RejectMembershipRequestEvent extends MessageHandler {
|
|||||||
guild.decreaseRequestCount();
|
guild.decreaseRequestCount();
|
||||||
Emulator.getGameEnvironment().getGuildManager().removeMember(guild, userId);
|
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 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);
|
Habbo habbo = Emulator.getGameEnvironment().getHabboManager().getHabbo(userId);
|
||||||
Emulator.getPluginManager().fireEvent(new GuildDeclinedMembershipEvent(guild, userId, habbo, this.client.getHabbo()));
|
Emulator.getPluginManager().fireEvent(new GuildDeclinedMembershipEvent(guild, userId, habbo, this.client.getHabbo()));
|
||||||
|
@ -2,7 +2,7 @@ package com.eu.habbo.messages.incoming.handshake;
|
|||||||
|
|
||||||
import com.eu.habbo.Emulator;
|
import com.eu.habbo.Emulator;
|
||||||
import com.eu.habbo.habbohotel.achievements.AchievementManager;
|
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.catalog.TargetOffer;
|
||||||
import com.eu.habbo.habbohotel.messenger.Messenger;
|
import com.eu.habbo.habbohotel.messenger.Messenger;
|
||||||
import com.eu.habbo.habbohotel.modtool.ModToolSanctionItem;
|
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.generic.alerts.MOTDNotificationComposer;
|
||||||
import com.eu.habbo.messages.outgoing.habboway.nux.NoobnessLevelMessageComposer;
|
import com.eu.habbo.messages.outgoing.habboway.nux.NoobnessLevelMessageComposer;
|
||||||
import com.eu.habbo.messages.outgoing.habboway.nux.InClientLinkMessageComposer;
|
import com.eu.habbo.messages.outgoing.habboway.nux.InClientLinkMessageComposer;
|
||||||
import com.eu.habbo.messages.outgoing.handshake.EnableNotificationsComposer;
|
import com.eu.habbo.messages.outgoing.handshake.*;
|
||||||
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.inventory.BadgePointLimitsComposer;
|
import com.eu.habbo.messages.outgoing.inventory.BadgePointLimitsComposer;
|
||||||
import com.eu.habbo.messages.outgoing.inventory.AvatarEffectsMessageComposer;
|
import com.eu.habbo.messages.outgoing.inventory.AvatarEffectsMessageComposer;
|
||||||
import com.eu.habbo.messages.outgoing.modtool.CfhTopicsInitComposer;
|
import com.eu.habbo.messages.outgoing.modtool.CfhTopicsInitComposer;
|
||||||
|
@ -24,8 +24,6 @@ public class GetCurrentTimingCodeEvent extends MessageHandler {
|
|||||||
} else {
|
} else {
|
||||||
this.client.sendResponse(new CurrentTimingCodeMessageComposer(data, s));
|
this.client.sendResponse(new CurrentTimingCodeMessageComposer(data, s));
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//this.client.sendResponse(new HotelViewDataComposer("2013-05-08 13:0", "gamesmaker"));
|
//this.client.sendResponse(new HotelViewDataComposer("2013-05-08 13:0", "gamesmaker"));
|
||||||
|
@ -66,9 +66,9 @@ public class CallForHelpEvent extends MessageHandler {
|
|||||||
|
|
||||||
Emulator.getGameEnvironment().getModToolManager().addTicket(issue);
|
Emulator.getGameEnvironment().getModToolManager().addTicket(issue);
|
||||||
Emulator.getGameEnvironment().getModToolManager().updateTicketToMods(issue);
|
Emulator.getGameEnvironment().getModToolManager().updateTicketToMods(issue);
|
||||||
this.client.sendResponse(new CallForHelpResultMessageComposer(CallForHelpResultMessageComposer.REPORT_RECEIVED, cfhTopic.reply));
|
|
||||||
|
|
||||||
if (cfhTopic != null) {
|
if (cfhTopic != null) {
|
||||||
|
this.client.sendResponse(new CallForHelpResultMessageComposer(CallForHelpResultMessageComposer.REPORT_RECEIVED, cfhTopic.reply));
|
||||||
if (cfhTopic.action != CfhActionType.MODS) {
|
if (cfhTopic.action != CfhActionType.MODS) {
|
||||||
Emulator.getThreading().run(() -> {
|
Emulator.getThreading().run(() -> {
|
||||||
if (issue.state == ModToolTicketState.OPEN) {
|
if (issue.state == ModToolTicketState.OPEN) {
|
||||||
@ -81,7 +81,7 @@ public class CallForHelpEvent extends MessageHandler {
|
|||||||
CallForHelpEvent.this.client.sendResponse(new IssueCloseNotificationMessageComposer(cfhTopic.reply).compose());
|
CallForHelpEvent.this.client.sendResponse(new IssueCloseNotificationMessageComposer(cfhTopic.reply).compose());
|
||||||
Emulator.getGameEnvironment().getModToolManager().closeTicketAsHandled(issue, null);
|
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());
|
CallForHelpEvent.this.client.sendResponse(new IssueCloseNotificationMessageComposer(cfhTopic.reply).compose());
|
||||||
Emulator.getGameEnvironment().getModToolManager().closeTicketAsHandled(issue, null);
|
Emulator.getGameEnvironment().getModToolManager().closeTicketAsHandled(issue, null);
|
||||||
}
|
}
|
||||||
}, 30 * 1000);
|
}, (long) 30 * 1000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -35,14 +35,14 @@ public class CallForHelpFromIMEvent extends MessageHandler {
|
|||||||
info = HabboManager.getOfflineHabboInfo(userId);
|
info = HabboManager.getOfflineHabboInfo(userId);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (info != null) {
|
if (info == null) return;
|
||||||
for (int i = 0; i < count; i++) {
|
for (int i = 0; i < count; i++) {
|
||||||
int chatUserId = this.packet.readInt();
|
int chatUserId = this.packet.readInt();
|
||||||
String username = this.packet.readInt() == info.getId() ? info.getUsername() : this.client.getHabbo().getHabboInfo().getUsername();
|
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);
|
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.category = category;
|
||||||
|
@ -18,33 +18,31 @@ public class ModAlertEvent extends MessageHandler {
|
|||||||
String message = this.packet.readString();
|
String message = this.packet.readString();
|
||||||
int cfhTopic = this.packet.readInt();
|
int cfhTopic = this.packet.readInt();
|
||||||
|
|
||||||
if (this.client.getHabbo().hasPermission(Permission.ACC_SUPPORTTOOL)) {
|
if (!this.client.getHabbo().hasPermission(Permission.ACC_SUPPORTTOOL)) return;
|
||||||
Habbo habbo = Emulator.getGameEnvironment().getHabboManager().getHabbo(userId);
|
Habbo habbo = Emulator.getGameEnvironment().getHabboManager().getHabbo(userId);
|
||||||
|
|
||||||
if (habbo != null) {
|
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();
|
ModToolSanctions modToolSanctions = Emulator.getGameEnvironment().getModToolSanctions();
|
||||||
|
|
||||||
if (Emulator.getConfig().getBoolean("hotel.sanctions.enabled")) {
|
if (!Emulator.getConfig().getBoolean("hotel.sanctions.enabled")) {
|
||||||
|
habbo.alert(message);
|
||||||
|
return;
|
||||||
|
}
|
||||||
THashMap<Integer, ArrayList<ModToolSanctionItem>> modToolSanctionItemsHashMap = Emulator.getGameEnvironment().getModToolSanctions().getSanctions(habbo.getHabboInfo().getId());
|
THashMap<Integer, ArrayList<ModToolSanctionItem>> modToolSanctionItemsHashMap = Emulator.getGameEnvironment().getModToolSanctions().getSanctions(habbo.getHabboInfo().getId());
|
||||||
ArrayList<ModToolSanctionItem> modToolSanctionItems = modToolSanctionItemsHashMap.get(habbo.getHabboInfo().getId());
|
ArrayList<ModToolSanctionItem> modToolSanctionItems = modToolSanctionItemsHashMap.get(habbo.getHabboInfo().getId());
|
||||||
|
|
||||||
if (modToolSanctionItems != null && !modToolSanctionItems.isEmpty()) {
|
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);
|
modToolSanctions.run(userId, this.client.getHabbo(), 0, cfhTopic, message, 0, false, 0);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
habbo.alert(message);
|
ModToolSanctionItem item = modToolSanctionItems.get(modToolSanctionItems.size() - 1);
|
||||||
}
|
if (item == null) return;
|
||||||
} else {
|
modToolSanctions.run(userId, this.client.getHabbo(), item.sanctionLevel, cfhTopic, message, 0, false, 0);
|
||||||
this.client.sendResponse(new IssueCloseNotificationMessageComposer(Emulator.getTexts().getValue("generic.user.not_found").replace("%user%", Emulator.getConfig().getValue("hotel.player.name"))));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -46,30 +46,28 @@ public class ModBanEvent extends MessageHandler {
|
|||||||
case BAN_AVATAR_ONLY_100_YEARS:
|
case BAN_AVATAR_ONLY_100_YEARS:
|
||||||
duration = Emulator.getIntUnixTimestamp();
|
duration = Emulator.getIntUnixTimestamp();
|
||||||
}
|
}
|
||||||
if (this.client.getHabbo().hasPermission(Permission.ACC_SUPPORTTOOL)) {
|
if (!this.client.getHabbo().hasPermission(Permission.ACC_SUPPORTTOOL)) {
|
||||||
ModToolSanctions modToolSanctions = Emulator.getGameEnvironment().getModToolSanctions();
|
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")) {
|
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);
|
THashMap<Integer, ArrayList<ModToolSanctionItem>> modToolSanctionItemsHashMap = Emulator.getGameEnvironment().getModToolSanctions().getSanctions(userId);
|
||||||
ArrayList<ModToolSanctionItem> modToolSanctionItems = modToolSanctionItemsHashMap.get(userId);
|
ArrayList<ModToolSanctionItem> modToolSanctionItems = modToolSanctionItemsHashMap.get(userId);
|
||||||
|
|
||||||
if (modToolSanctionItems != null && !modToolSanctionItemsHashMap.isEmpty()) {
|
if (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);
|
modToolSanctions.run(userId, this.client.getHabbo(), 0, cfhTopic, message, 0, false, 0);
|
||||||
}
|
return;
|
||||||
} else {
|
|
||||||
Emulator.getGameEnvironment().getModToolManager().ban(userId, this.client.getHabbo(), message, duration, ModToolBanType.ACCOUNT, cfhTopic);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
ModToolSanctionItem item = modToolSanctionItems.get(modToolSanctionItems.size() - 1);
|
||||||
ScripterManager.scripterDetected(this.client, Emulator.getTexts().getValue("scripter.warning.modtools.ban").replace("%username%", this.client.getHabbo().getHabboInfo().getUsername()));
|
if (item == null) return;
|
||||||
}
|
modToolSanctions.run(userId, this.client.getHabbo(), item.sanctionLevel, cfhTopic, message, 0, false, 0);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -20,43 +20,37 @@ public class ModMuteEvent extends MessageHandler {
|
|||||||
String message = this.packet.readString();
|
String message = this.packet.readString();
|
||||||
int cfhTopic = this.packet.readInt();
|
int cfhTopic = this.packet.readInt();
|
||||||
|
|
||||||
if (this.client.getHabbo().hasPermission(Permission.ACC_SUPPORTTOOL)) {
|
if (!this.client.getHabbo().hasPermission(Permission.ACC_SUPPORTTOOL)) return;
|
||||||
Habbo habbo = Emulator.getGameEnvironment().getHabboManager().getHabbo(userId);
|
|
||||||
|
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 (habbo != null) {
|
|
||||||
ModToolSanctions modToolSanctions = Emulator.getGameEnvironment().getModToolSanctions();
|
ModToolSanctions modToolSanctions = Emulator.getGameEnvironment().getModToolSanctions();
|
||||||
|
|
||||||
if (Emulator.getConfig().getBoolean("hotel.sanctions.enabled")) {
|
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 && !modToolSanctionItemsHashMap.isEmpty()) {
|
|
||||||
ModToolSanctionItem item = modToolSanctionItems.get(modToolSanctionItems.size() - 1);
|
|
||||||
|
|
||||||
if (item.probationTimestamp > 0 && item.probationTimestamp >= Emulator.getIntUnixTimestamp()) {
|
|
||||||
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 {
|
|
||||||
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.mute(60 * 60, false);
|
||||||
habbo.alert(message);
|
habbo.alert(message);
|
||||||
this.client.getHabbo().whisper(Emulator.getTexts().getValue("commands.succes.cmd_mute.muted").replace("%user%", habbo.getHabboInfo().getUsername()));
|
this.client.getHabbo().whisper(Emulator.getTexts().getValue("commands.succes.cmd_mute.muted").replace("%user%", habbo.getHabboInfo().getUsername()));
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
this.client.sendResponse(new IssueCloseNotificationMessageComposer(Emulator.getTexts().getValue("generic.user.not_found").replace("%user%", Emulator.getConfig().getValue("hotel.player.name"))));
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
ModToolSanctionItem item = modToolSanctionItems.get(modToolSanctionItems.size() - 1);
|
||||||
|
if (item == null) return;
|
||||||
|
|
||||||
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -31,12 +31,8 @@ public class ModTradingLockEvent extends MessageHandler {
|
|||||||
|
|
||||||
if (modToolSanctionItems != null && !modToolSanctionItems.isEmpty()) {
|
if (modToolSanctionItems != null && !modToolSanctionItems.isEmpty()) {
|
||||||
ModToolSanctionItem item = modToolSanctionItems.get(modToolSanctionItems.size() - 1);
|
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 {
|
} else {
|
||||||
modToolSanctions.run(userId, this.client.getHabbo(), 0, cfhTopic, message, duration, false, 0);
|
modToolSanctions.run(userId, this.client.getHabbo(), 0, cfhTopic, message, duration, false, 0);
|
||||||
}
|
}
|
||||||
|
@ -34,7 +34,7 @@ public class SetCustomStackingHeightEvent extends MessageHandler {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} 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;
|
double height = 0;
|
||||||
|
@ -18,7 +18,7 @@ public class ControlYoutubeDisplayPlaybackEvent extends MessageHandler {
|
|||||||
PAUSE(2),
|
PAUSE(2),
|
||||||
RESUME(3);
|
RESUME(3);
|
||||||
|
|
||||||
private int state;
|
private final int state;
|
||||||
|
|
||||||
YoutubeState(int state) {
|
YoutubeState(int state) {
|
||||||
this.state = state;
|
this.state = state;
|
||||||
@ -80,7 +80,7 @@ public class ControlYoutubeDisplayPlaybackEvent extends MessageHandler {
|
|||||||
case RESUME:
|
case RESUME:
|
||||||
tv.playing = true;
|
tv.playing = true;
|
||||||
tv.startedWatchingAt = Emulator.getIntUnixTimestamp();
|
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());
|
room.sendComposer(new YoutubeControlVideoMessageComposer(tv.getId(), 1).compose());
|
||||||
break;
|
break;
|
||||||
case PREVIOUS:
|
case PREVIOUS:
|
||||||
@ -99,7 +99,7 @@ public class ControlYoutubeDisplayPlaybackEvent extends MessageHandler {
|
|||||||
room.sendComposer(new YoutubeDisplayVideoMessageComposer(tv.getId(), tv.currentVideo, true, 0).compose());
|
room.sendComposer(new YoutubeDisplayVideoMessageComposer(tv.getId(), tv.currentVideo, true, 0).compose());
|
||||||
|
|
||||||
tv.cancelAdvancement();
|
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.startedWatchingAt = Emulator.getIntUnixTimestamp();
|
||||||
tv.offset = 0;
|
tv.offset = 0;
|
||||||
tv.playing = true;
|
tv.playing = true;
|
||||||
|
@ -32,7 +32,7 @@ public class SetYoutubeDisplayPlaylistEvent extends MessageHandler {
|
|||||||
|
|
||||||
HabboItem item = this.client.getHabbo().getHabboInfo().getCurrentRoom().getHabboItem(itemId);
|
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();
|
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.updateItem(item);
|
||||||
room.sendComposer(new YoutubeDisplayVideoMessageComposer(itemId, video, true, 0).compose());
|
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);
|
item.needsUpdate(true);
|
||||||
}
|
}
|
||||||
|
@ -157,8 +157,9 @@ public class MoveAvatarEvent extends MessageHandler {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (InterruptedException e) {
|
||||||
LOGGER.error("Caught exception", e);
|
LOGGER.error("Caught exception", e);
|
||||||
|
Thread.currentThread().interrupt();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -19,7 +19,7 @@ public class AchievementComposer extends MessageComposer {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected ServerMessage composeInternal() {
|
protected ServerMessage composeInternal() {
|
||||||
this.response.init(Outgoing.AchievementComposer);
|
this.response.init(Outgoing.achievementComposer);
|
||||||
|
|
||||||
int achievementProgress;
|
int achievementProgress;
|
||||||
AchievementLevel currentLevel;
|
AchievementLevel currentLevel;
|
||||||
|
@ -18,7 +18,7 @@ public class AchievementUnlockedComposer extends MessageComposer {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected ServerMessage composeInternal() {
|
protected ServerMessage composeInternal() {
|
||||||
this.response.init(Outgoing.HabboAchievementNotificationMessageComposer);
|
this.response.init(Outgoing.habboAchievementNotificationMessageComposer);
|
||||||
|
|
||||||
AchievementLevel level = this.achievement.getLevelForProgress(this.habbo.getHabboStats().getAchievementProgress(this.achievement));
|
AchievementLevel level = this.achievement.getLevelForProgress(this.habbo.getHabboStats().getAchievementProgress(this.achievement));
|
||||||
this.response.appendInt(this.achievement.id);
|
this.response.appendInt(this.achievement.id);
|
||||||
|
@ -22,7 +22,7 @@ public class AchievementsComposer extends MessageComposer {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected ServerMessage composeInternal() {
|
protected ServerMessage composeInternal() {
|
||||||
this.response.init(Outgoing.AchievementsComposer);
|
this.response.init(Outgoing.achievementsComposer);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
this.response.appendInt(Emulator.getGameEnvironment().getAchievementManager().getAchievements().size());
|
this.response.appendInt(Emulator.getGameEnvironment().getAchievementManager().getAchievements().size());
|
||||||
|
@ -18,7 +18,7 @@ public class TalentLevelUpComposer extends MessageComposer {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected ServerMessage composeInternal() {
|
protected ServerMessage composeInternal() {
|
||||||
this.response.init(Outgoing.TalentLevelUpComposer);
|
this.response.init(Outgoing.talentLevelUpComposer);
|
||||||
this.response.appendString(this.talentTrackType.name());
|
this.response.appendString(this.talentTrackType.name());
|
||||||
this.response.appendInt(this.talentTrackLevel.level);
|
this.response.appendInt(this.talentTrackLevel.level);
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@ public class TalentTrackMessageComposer extends MessageComposer {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected ServerMessage composeInternal() {
|
protected ServerMessage composeInternal() {
|
||||||
this.response.init(Outgoing.TalentTrackMessageComposer);
|
this.response.init(Outgoing.talentTrackMessageComposer);
|
||||||
this.response.appendString(this.type.name().toLowerCase());
|
this.response.appendString(this.type.name().toLowerCase());
|
||||||
|
|
||||||
LinkedHashMap<Integer, TalentTrackLevel> talentTrackLevels = Emulator.getGameEnvironment().getAchievementManager().getTalenTrackLevels(this.type);
|
LinkedHashMap<Integer, TalentTrackLevel> talentTrackLevels = Emulator.getGameEnvironment().getAchievementManager().getTalenTrackLevels(this.type);
|
||||||
|
@ -17,7 +17,7 @@ public class CameraPriceComposer extends MessageComposer {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected ServerMessage composeInternal() {
|
protected ServerMessage composeInternal() {
|
||||||
this.response.init(Outgoing.InitCameraMessageComposer);
|
this.response.init(Outgoing.initCameraMessageComposer);
|
||||||
this.response.appendInt(this.credits);
|
this.response.appendInt(this.credits);
|
||||||
this.response.appendInt(this.points);
|
this.response.appendInt(this.points);
|
||||||
this.response.appendInt(this.pointsType);
|
this.response.appendInt(this.pointsType);
|
||||||
|
@ -17,7 +17,7 @@ public class CameraPublishStatusMessageComposer extends MessageComposer {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected ServerMessage composeInternal() {
|
protected ServerMessage composeInternal() {
|
||||||
this.response.init(Outgoing.CameraPublishStatusMessageComposer);
|
this.response.init(Outgoing.cameraPublishStatusMessageComposer);
|
||||||
|
|
||||||
this.response.appendBoolean(this.isOk);
|
this.response.appendBoolean(this.isOk);
|
||||||
this.response.appendInt(this.cooldownSeconds);
|
this.response.appendInt(this.cooldownSeconds);
|
||||||
|
@ -7,7 +7,7 @@ import com.eu.habbo.messages.outgoing.Outgoing;
|
|||||||
public class CameraPurchaseOKMessageComposer extends MessageComposer {
|
public class CameraPurchaseOKMessageComposer extends MessageComposer {
|
||||||
@Override
|
@Override
|
||||||
protected ServerMessage composeInternal() {
|
protected ServerMessage composeInternal() {
|
||||||
this.response.init(Outgoing.CameraPurchaseOKMessageComposer);
|
this.response.init(Outgoing.cameraPurchaseOKMessageComposer);
|
||||||
return this.response;
|
return this.response;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -13,7 +13,7 @@ public class CameraStorageUrlMessageComposer extends MessageComposer {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected ServerMessage composeInternal() {
|
protected ServerMessage composeInternal() {
|
||||||
this.response.init(Outgoing.CameraStorageUrlMessageComposer);
|
this.response.init(Outgoing.cameraStorageUrlMessageComposer);
|
||||||
this.response.appendString(this.URL);
|
this.response.appendString(this.URL);
|
||||||
return this.response;
|
return this.response;
|
||||||
}
|
}
|
||||||
|
@ -15,7 +15,7 @@ public class CompetitionStatusMessageComposer extends MessageComposer {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected ServerMessage composeInternal() {
|
protected ServerMessage composeInternal() {
|
||||||
this.response.init(Outgoing.CompetitionStatusMessageComposer);
|
this.response.init(Outgoing.competitionStatusMessageComposer);
|
||||||
this.response.appendBoolean(this.unknownBoolean);
|
this.response.appendBoolean(this.unknownBoolean);
|
||||||
this.response.appendString(this.unknownString);
|
this.response.appendString(this.unknownString);
|
||||||
return this.response;
|
return this.response;
|
||||||
|
@ -7,7 +7,7 @@ import com.eu.habbo.messages.outgoing.Outgoing;
|
|||||||
public class ThumbnailStatusMessageComposer extends MessageComposer {
|
public class ThumbnailStatusMessageComposer extends MessageComposer {
|
||||||
@Override
|
@Override
|
||||||
protected ServerMessage composeInternal() {
|
protected ServerMessage composeInternal() {
|
||||||
this.response.init(Outgoing.ThumbnailStatusMessageComposer);
|
this.response.init(Outgoing.thumbnailStatusMessageComposer);
|
||||||
return this.response;
|
return this.response;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -21,7 +21,7 @@ public class ApproveNameMessageComposer extends MessageComposer {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected ServerMessage composeInternal() {
|
protected ServerMessage composeInternal() {
|
||||||
this.response.init(Outgoing.ApproveNameMessageComposer);
|
this.response.init(Outgoing.approveNameMessageComposer);
|
||||||
this.response.appendInt(this.type);
|
this.response.appendInt(this.type);
|
||||||
this.response.appendString(this.value);
|
this.response.appendString(this.value);
|
||||||
return this.response;
|
return this.response;
|
||||||
|
@ -13,7 +13,7 @@ public class BuildersClubFurniCountMessageComposer extends MessageComposer {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected ServerMessage composeInternal() {
|
protected ServerMessage composeInternal() {
|
||||||
this.response.init(Outgoing.BuildersClubFurniCountMessageComposer);
|
this.response.init(Outgoing.buildersClubFurniCountMessageComposer);
|
||||||
this.response.appendInt(this.mode);
|
this.response.appendInt(this.mode);
|
||||||
return this.response;
|
return this.response;
|
||||||
}
|
}
|
||||||
|
@ -13,7 +13,7 @@ public class BundleDiscountRulesetMessageComposer extends MessageComposer {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected ServerMessage composeInternal() {
|
protected ServerMessage composeInternal() {
|
||||||
this.response.init(Outgoing.BundleDiscountRulesetMessageComposer);
|
this.response.init(Outgoing.bundleDiscountRulesetMessageComposer);
|
||||||
|
|
||||||
this.response.appendInt(MAXIMUM_ALLOWED_ITEMS);
|
this.response.appendInt(MAXIMUM_ALLOWED_ITEMS);
|
||||||
this.response.appendInt(DISCOUNT_BATCH_SIZE);
|
this.response.appendInt(DISCOUNT_BATCH_SIZE);
|
||||||
|
@ -32,7 +32,7 @@ public class CatalogPageMessageComposer extends MessageComposer {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected ServerMessage composeInternal() {
|
protected ServerMessage composeInternal() {
|
||||||
this.response.init(Outgoing.CatalogPageMessageComposer);
|
this.response.init(Outgoing.catalogPageMessageComposer);
|
||||||
this.response.appendInt(this.page.getId());
|
this.response.appendInt(this.page.getId());
|
||||||
this.response.appendString(this.mode);
|
this.response.appendString(this.mode);
|
||||||
this.page.serialize(this.response);
|
this.page.serialize(this.response);
|
||||||
|
@ -30,7 +30,7 @@ public class CatalogPagesListComposer extends MessageComposer {
|
|||||||
try {
|
try {
|
||||||
List<CatalogPage> pages = Emulator.getGameEnvironment().getCatalogManager().getCatalogPages(-1, this.habbo);
|
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.appendBoolean(true);
|
||||||
this.response.appendInt(0);
|
this.response.appendInt(0);
|
||||||
|
@ -7,7 +7,7 @@ import com.eu.habbo.messages.outgoing.Outgoing;
|
|||||||
public class CatalogPublishedMessageComposer extends MessageComposer {
|
public class CatalogPublishedMessageComposer extends MessageComposer {
|
||||||
@Override
|
@Override
|
||||||
protected ServerMessage composeInternal() {
|
protected ServerMessage composeInternal() {
|
||||||
this.response.init(Outgoing.CatalogPublishedMessageComposer);
|
this.response.init(Outgoing.catalogPublishedMessageComposer);
|
||||||
this.response.appendBoolean(false);
|
this.response.appendBoolean(false);
|
||||||
return this.response;
|
return this.response;
|
||||||
}
|
}
|
||||||
|
@ -26,7 +26,7 @@ public class ClubGiftInfoComposer extends MessageComposer {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected ServerMessage composeInternal() {
|
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.daysTillNextGift); //Days Until Next Gift
|
||||||
this.response.appendInt(this.availableGifts); //Gift Selectable
|
this.response.appendInt(this.availableGifts); //Gift Selectable
|
||||||
|
@ -7,7 +7,7 @@ import com.eu.habbo.messages.outgoing.Outgoing;
|
|||||||
public class GiftReceiverNotFoundComposer extends MessageComposer {
|
public class GiftReceiverNotFoundComposer extends MessageComposer {
|
||||||
@Override
|
@Override
|
||||||
protected ServerMessage composeInternal() {
|
protected ServerMessage composeInternal() {
|
||||||
this.response.init(Outgoing.GiftReceiverNotFoundComposer);
|
this.response.init(Outgoing.giftReceiverNotFoundComposer);
|
||||||
return this.response;
|
return this.response;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -15,7 +15,7 @@ public class GiftWrappingConfigurationComposer extends MessageComposer {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected ServerMessage composeInternal() {
|
protected ServerMessage composeInternal() {
|
||||||
this.response.init(Outgoing.GiftWrappingConfigurationComposer);
|
this.response.init(Outgoing.giftWrappingConfigurationComposer);
|
||||||
this.response.appendBoolean(true);
|
this.response.appendBoolean(true);
|
||||||
this.response.appendInt(Emulator.getConfig().getInt("hotel.gifts.special.price", 2));
|
this.response.appendInt(Emulator.getConfig().getInt("hotel.gifts.special.price", 2));
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@ public class HabboClubOffersMessageComposer extends MessageComposer {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected ServerMessage composeInternal() {
|
protected ServerMessage composeInternal() {
|
||||||
this.response.init(Outgoing.HabboClubOffersMessageComposer);
|
this.response.init(Outgoing.habboClubOffersMessageComposer);
|
||||||
|
|
||||||
List<ClubOffer> offers = Emulator.getGameEnvironment().getCatalogManager().getClubOffers();
|
List<ClubOffer> offers = Emulator.getGameEnvironment().getCatalogManager().getClubOffers();
|
||||||
this.response.appendInt(offers.size());
|
this.response.appendInt(offers.size());
|
||||||
|
@ -7,7 +7,7 @@ import com.eu.habbo.messages.outgoing.Outgoing;
|
|||||||
public class LimitedEditionSoldOutComposer extends MessageComposer {
|
public class LimitedEditionSoldOutComposer extends MessageComposer {
|
||||||
@Override
|
@Override
|
||||||
protected ServerMessage composeInternal() {
|
protected ServerMessage composeInternal() {
|
||||||
this.response.init(Outgoing.LimitedEditionSoldOutComposer);
|
this.response.init(Outgoing.limitedEditionSoldOutComposer);
|
||||||
return this.response;
|
return this.response;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -17,7 +17,7 @@ public class NotEnoughBalanceMessageComposer extends MessageComposer {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected ServerMessage composeInternal() {
|
protected ServerMessage composeInternal() {
|
||||||
this.response.init(Outgoing.NotEnoughBalanceMessageComposer);
|
this.response.init(Outgoing.notEnoughBalanceMessageComposer);
|
||||||
this.response.appendBoolean(this.isCredits);
|
this.response.appendBoolean(this.isCredits);
|
||||||
this.response.appendBoolean(this.isPixels);
|
this.response.appendBoolean(this.isPixels);
|
||||||
this.response.appendInt(this.pointsType);
|
this.response.appendInt(this.pointsType);
|
||||||
|
@ -16,7 +16,7 @@ public class PetReceivedMessageComposer extends MessageComposer {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected ServerMessage composeInternal() {
|
protected ServerMessage composeInternal() {
|
||||||
this.response.init(Outgoing.PetReceivedMessageComposer);
|
this.response.init(Outgoing.petReceivedMessageComposer);
|
||||||
this.response.appendBoolean(this.gift);
|
this.response.appendBoolean(this.gift);
|
||||||
this.pet.serialize(this.response);
|
this.pet.serialize(this.response);
|
||||||
return this.response;
|
return this.response;
|
||||||
|
@ -14,7 +14,7 @@ public class ProductOfferComposer extends MessageComposer {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected ServerMessage composeInternal() {
|
protected ServerMessage composeInternal() {
|
||||||
this.response.init(Outgoing.ProductOfferComposer);
|
this.response.init(Outgoing.productOfferComposer);
|
||||||
this.item.serialize(this.response);
|
this.item.serialize(this.response);
|
||||||
return this.response;
|
return this.response;
|
||||||
}
|
}
|
||||||
|
@ -16,7 +16,7 @@ public class PurchaseErrorMessageComposer extends MessageComposer {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected ServerMessage composeInternal() {
|
protected ServerMessage composeInternal() {
|
||||||
this.response.init(Outgoing.PurchaseErrorMessageComposer);
|
this.response.init(Outgoing.purchaseErrorMessageComposer);
|
||||||
this.response.appendInt(this.error);
|
this.response.appendInt(this.error);
|
||||||
return this.response;
|
return this.response;
|
||||||
}
|
}
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user