mirror of
https://git.krews.org/morningstar/Arcturus-Community.git
synced 2025-02-22 13:02:36 +01:00
Merge branch 'small-fixes' into 'dev'
Refactored string comparisons to use equalsIgnoreCase, replaced valueOf with... See merge request morningstar/Arcturus-Community!105
This commit is contained in:
commit
b05bbc78aa
@ -92,7 +92,7 @@ public class ConfigurationManager {
|
|||||||
String envValue = System.getenv(entry.getValue());
|
String envValue = System.getenv(entry.getValue());
|
||||||
|
|
||||||
if (envValue == null || envValue.length() == 0) {
|
if (envValue == null || envValue.length() == 0) {
|
||||||
LOGGER.info("Cannot find environment-value for variable `" + entry.getValue() + "`");
|
LOGGER.info("Cannot find environment-value for variable `{}`", entry.getValue());
|
||||||
} else {
|
} else {
|
||||||
this.properties.setProperty(entry.getKey(), envValue);
|
this.properties.setProperty(entry.getKey(), envValue);
|
||||||
}
|
}
|
||||||
@ -127,7 +127,7 @@ public class ConfigurationManager {
|
|||||||
LOGGER.error("Caught SQL exception", e);
|
LOGGER.error("Caught SQL exception", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
LOGGER.info("Configuration -> loaded! (" + (System.currentTimeMillis() - millis) + " MS)");
|
LOGGER.info("Configuration -> loaded! ({} MS)", System.currentTimeMillis() - millis);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void saveToDatabase() {
|
public void saveToDatabase() {
|
||||||
|
@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -21,7 +21,7 @@ public class TextsManager {
|
|||||||
try {
|
try {
|
||||||
this.reload();
|
this.reload();
|
||||||
|
|
||||||
LOGGER.info("Texts Manager -> Loaded! (" + (System.currentTimeMillis() - millis) + " MS)");
|
LOGGER.info("Texts Manager -> Loaded! ({} MS)", System.currentTimeMillis() - millis);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
@ -48,11 +48,11 @@ public abstract class ConsoleCommand {
|
|||||||
LOGGER.error("Caught exception", e);
|
LOGGER.error("Caught exception", e);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
LOGGER.info("Unknown Console Command " + message[0]);
|
LOGGER.info("Unknown Console Command {}", message[0]);
|
||||||
LOGGER.info("Commands Available (" + commands.size() + "): ");
|
LOGGER.info("Commands Available ({}): ", commands.size());
|
||||||
|
|
||||||
for (ConsoleCommand c : commands.values()) {
|
for (ConsoleCommand c : commands.values()) {
|
||||||
LOGGER.info(c.key + " - " + c.usage);
|
LOGGER.info("{} - {}", c.key, c.usage);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -18,25 +18,25 @@ public class ConsoleInfoCommand extends ConsoleCommand {
|
|||||||
public void handle(String[] args) throws Exception {
|
public void handle(String[] args) throws Exception {
|
||||||
int seconds = Emulator.getIntUnixTimestamp() - Emulator.getTimeStarted();
|
int seconds = Emulator.getIntUnixTimestamp() - Emulator.getTimeStarted();
|
||||||
int day = (int) TimeUnit.SECONDS.toDays(seconds);
|
int day = (int) TimeUnit.SECONDS.toDays(seconds);
|
||||||
long hours = TimeUnit.SECONDS.toHours(seconds) - (day * 24);
|
long hours = TimeUnit.SECONDS.toHours(seconds) - (day * 24L);
|
||||||
long minute = TimeUnit.SECONDS.toMinutes(seconds) - (TimeUnit.SECONDS.toHours(seconds) * 60);
|
long minute = TimeUnit.SECONDS.toMinutes(seconds) - (TimeUnit.SECONDS.toHours(seconds) * 60);
|
||||||
long second = TimeUnit.SECONDS.toSeconds(seconds) - (TimeUnit.SECONDS.toMinutes(seconds) * 60);
|
long second = TimeUnit.SECONDS.toSeconds(seconds) - (TimeUnit.SECONDS.toMinutes(seconds) * 60);
|
||||||
|
|
||||||
LOGGER.info("Emulator version: " + Emulator.version);
|
LOGGER.info("Emulator version: " + Emulator.version);
|
||||||
LOGGER.info("Emulator build: " + Emulator.build);
|
LOGGER.info("Emulator build: {}", Emulator.build);
|
||||||
|
|
||||||
LOGGER.info("");
|
LOGGER.info("");
|
||||||
|
|
||||||
LOGGER.info("Hotel Statistics");
|
LOGGER.info("Hotel Statistics");
|
||||||
LOGGER.info("- Users: " + Emulator.getGameEnvironment().getHabboManager().getOnlineCount());
|
LOGGER.info("- Users: {}", Emulator.getGameEnvironment().getHabboManager().getOnlineCount());
|
||||||
LOGGER.info("- Rooms: " + Emulator.getGameEnvironment().getRoomManager().getActiveRooms().size());
|
LOGGER.info("- Rooms: {}", Emulator.getGameEnvironment().getRoomManager().getActiveRooms().size());
|
||||||
LOGGER.info("- Shop: " + Emulator.getGameEnvironment().getCatalogManager().catalogPages.size() + " pages and " + CatalogManager.catalogItemAmount + " items.");
|
LOGGER.info("- Shop: {} pages and {} items.", Emulator.getGameEnvironment().getCatalogManager().catalogPages.size(), CatalogManager.catalogItemAmount);
|
||||||
LOGGER.info("- Furni: " + Emulator.getGameEnvironment().getItemManager().getItems().size() + " items.");
|
LOGGER.info("- Furni: {} items.", Emulator.getGameEnvironment().getItemManager().getItems().size());
|
||||||
LOGGER.info("");
|
LOGGER.info("");
|
||||||
LOGGER.info("Server Statistics");
|
LOGGER.info("Server Statistics");
|
||||||
LOGGER.info("- Uptime: " + day + (day > 1 ? " days, " : " day, ") + hours + (hours > 1 ? " hours, " : " hour, ") + minute + (minute > 1 ? " minutes, " : " minute, ") + second + (second > 1 ? " seconds!" : " second!"));
|
LOGGER.info("- Uptime: {}{}{}{}{}{}{}{}", day, day > 1 ? " days, " : " day, ", hours, hours > 1 ? " hours, " : " hour, ", minute, minute > 1 ? " minutes, " : " minute, ", second, second > 1 ? " seconds!" : " second!");
|
||||||
LOGGER.info("- RAM Usage: " + (Emulator.getRuntime().totalMemory() - Emulator.getRuntime().freeMemory()) / (1024 * 1024) + "/" + (Emulator.getRuntime().freeMemory()) / (1024 * 1024) + "MB");
|
LOGGER.info("- RAM Usage: {}/{}MB", (Emulator.getRuntime().totalMemory() - Emulator.getRuntime().freeMemory()) / (1024 * 1024), (Emulator.getRuntime().freeMemory()) / (1024 * 1024));
|
||||||
LOGGER.info("- CPU Cores: " + Emulator.getRuntime().availableProcessors());
|
LOGGER.info("- CPU Cores: {}", Emulator.getRuntime().availableProcessors());
|
||||||
LOGGER.info("- Total Memory: " + Emulator.getRuntime().maxMemory() / (1024 * 1024) + "MB");
|
LOGGER.info("- Total Memory: {}MB", Emulator.getRuntime().maxMemory() / (1024 * 1024));
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -288,7 +288,7 @@ public class AchievementManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
LOGGER.info("Achievement Manager -> Loaded! (" + (System.currentTimeMillis() - millis) + " MS)");
|
LOGGER.info("Achievement Manager -> Loaded! ({} MS)", System.currentTimeMillis() - millis);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Achievement getAchievement(String name) {
|
public Achievement getAchievement(String name) {
|
||||||
|
@ -34,23 +34,23 @@ public class TalentTrackLevel {
|
|||||||
if (achievements[i].isEmpty() || achievementLevels[i].isEmpty())
|
if (achievements[i].isEmpty() || achievementLevels[i].isEmpty())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
Achievement achievement = Emulator.getGameEnvironment().getAchievementManager().getAchievement(Integer.valueOf(achievements[i]));
|
Achievement achievement = Emulator.getGameEnvironment().getAchievementManager().getAchievement(Integer.parseInt(achievements[i]));
|
||||||
|
|
||||||
if (achievement != null) {
|
if (achievement != null) {
|
||||||
this.achievements.put(achievement, Integer.valueOf(achievementLevels[i]));
|
this.achievements.put(achievement, Integer.parseInt(achievementLevels[i]));
|
||||||
} else {
|
} else {
|
||||||
LOGGER.error("Could not find achievement with ID " + achievements[i] + " for talenttrack level " + this.level + " of type " + this.type);
|
LOGGER.error("Could not find achievement with ID {} for talenttrack level {} of type {}", achievements[i], this.level, this.type);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (String s : set.getString("reward_furni").split(",")) {
|
for (String s : set.getString("reward_furni").split(",")) {
|
||||||
Item item = Emulator.getGameEnvironment().getItemManager().getItem(Integer.valueOf(s));
|
Item item = Emulator.getGameEnvironment().getItemManager().getItem(Integer.parseInt(s));
|
||||||
|
|
||||||
if (item != null) {
|
if (item != null) {
|
||||||
this.items.add(item);
|
this.items.add(item);
|
||||||
} else {
|
} else {
|
||||||
LOGGER.error("Incorrect reward furni (ID: " + s + ") for talent track level " + this.level);
|
LOGGER.error("Incorrect reward furni (ID: {}) for talent track level {}", s, this.level);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@ public class BotManager {
|
|||||||
|
|
||||||
this.reload();
|
this.reload();
|
||||||
|
|
||||||
LOGGER.info("Bot Manager -> Loaded! (" + (System.currentTimeMillis() - millis) + " MS)");
|
LOGGER.info("Bot Manager -> Loaded! ({} MS)", System.currentTimeMillis() - millis);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void addBotDefinition(String type, Class<? extends Bot> botClazz) throws Exception {
|
public static void addBotDefinition(String type, Class<? extends Bot> botClazz) throws Exception {
|
||||||
@ -60,10 +60,10 @@ public class BotManager {
|
|||||||
m.setAccessible(true);
|
m.setAccessible(true);
|
||||||
m.invoke(null);
|
m.invoke(null);
|
||||||
} catch (NoSuchMethodException e) {
|
} catch (NoSuchMethodException e) {
|
||||||
LOGGER.info("Bot Manager -> Failed to execute initialise method upon bot type '" + set.getKey() + "'. No Such Method!");
|
LOGGER.info("Bot Manager -> Failed to execute initialise method upon bot type '{}'. No Such Method!", set.getKey());
|
||||||
return false;
|
return false;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
LOGGER.info("Bot Manager -> Failed to execute initialise method upon bot type '" + set.getKey() + "'. Error: " + e.getMessage());
|
LOGGER.info("Bot Manager -> Failed to execute initialise method upon bot type '{}'. Error: {}", set.getKey(), e.getMessage());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -209,7 +209,7 @@ public class BotManager {
|
|||||||
if (botClazz != null)
|
if (botClazz != null)
|
||||||
return botClazz.getDeclaredConstructor(ResultSet.class).newInstance(set);
|
return botClazz.getDeclaredConstructor(ResultSet.class).newInstance(set);
|
||||||
else
|
else
|
||||||
LOGGER.error("Unknown Bot Type: " + type);
|
LOGGER.error("Unknown Bot Type: {}", type);
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
LOGGER.error("Caught SQL exception", e);
|
LOGGER.error("Caught SQL exception", e);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
@ -237,9 +237,9 @@ public class BotManager {
|
|||||||
m.setAccessible(true);
|
m.setAccessible(true);
|
||||||
m.invoke(null);
|
m.invoke(null);
|
||||||
} catch (NoSuchMethodException e) {
|
} catch (NoSuchMethodException e) {
|
||||||
LOGGER.info("Bot Manager -> Failed to execute dispose method upon bot type '" + set.getKey() + "'. No Such Method!");
|
LOGGER.info("Bot Manager -> Failed to execute dispose method upon bot type '{}'. No Such Method!", set.getKey());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
LOGGER.info("Bot Manager -> Failed to execute dispose method upon bot type '" + set.getKey() + "'. Error: " + e.getMessage());
|
LOGGER.info("Bot Manager -> Failed to execute dispose method upon bot type '{}'. Error: {}", set.getKey(), e.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -218,7 +218,7 @@ public class CatalogItem implements ISerialize, Runnable, Comparable<CatalogItem
|
|||||||
|
|
||||||
identifier = Integer.parseInt(itemId);
|
identifier = Integer.parseInt(itemId);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
LOGGER.info("Invalid value (" + itemId + ") for items_base column for catalog_item id (" + this.id + "). Value must be integer or of the format of integer:amount;integer:amount");
|
LOGGER.info("Invalid value ({}) for items_base column for catalog_item id ({}). Value must be integer or of the format of integer:amount;integer:amount", itemId, this.id);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (identifier > 0) {
|
if (identifier > 0) {
|
||||||
@ -265,12 +265,12 @@ public class CatalogItem implements ISerialize, Runnable, Comparable<CatalogItem
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
LOGGER.debug("Failed to load " + this.itemId);
|
LOGGER.debug("Failed to load {}", this.itemId);
|
||||||
LOGGER.error("Caught exception", e);
|
LOGGER.error("Caught exception", e);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
Item item = Emulator.getGameEnvironment().getItemManager().getItem(Integer.valueOf(this.itemId));
|
Item item = Emulator.getGameEnvironment().getItemManager().getItem(Integer.parseInt(this.itemId));
|
||||||
|
|
||||||
if (item != null) {
|
if (item != null) {
|
||||||
this.allowGift = item.allowGift();
|
this.allowGift = item.allowGift();
|
||||||
|
@ -221,7 +221,7 @@ public class CatalogManager {
|
|||||||
|
|
||||||
this.ecotronItem = Emulator.getGameEnvironment().getItemManager().getItem("ecotron_box");
|
this.ecotronItem = Emulator.getGameEnvironment().getItemManager().getItem("ecotron_box");
|
||||||
|
|
||||||
LOGGER.info("Catalog Manager -> Loaded! (" + (System.currentTimeMillis() - millis) + " MS)");
|
LOGGER.info("Catalog Manager -> Loaded! ({} MS)", System.currentTimeMillis() - millis);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -280,7 +280,7 @@ public class CatalogManager {
|
|||||||
Class<? extends CatalogPage> pageClazz = pageDefinitions.get(set.getString("page_layout"));
|
Class<? extends CatalogPage> pageClazz = pageDefinitions.get(set.getString("page_layout"));
|
||||||
|
|
||||||
if (pageClazz == null) {
|
if (pageClazz == null) {
|
||||||
LOGGER.info("Unknown Page Layout: " + set.getString("page_layout"));
|
LOGGER.info("Unknown Page Layout: {}", set.getString("page_layout"));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -305,7 +305,7 @@ public class CatalogManager {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (object.parentId != -2) {
|
if (object.parentId != -2) {
|
||||||
LOGGER.info("Parent Page not found for " + object.getPageName() + " (ID: " + object.id + ", parent_id: " + object.parentId + ")");
|
LOGGER.info("Parent Page not found for {} (ID: {}, parent_id: {})", object.getPageName(), object.id, object.parentId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
@ -313,7 +313,7 @@ public class CatalogManager {
|
|||||||
|
|
||||||
this.catalogPages.putAll(pages);
|
this.catalogPages.putAll(pages);
|
||||||
|
|
||||||
LOGGER.info("Loaded " + this.catalogPages.size() + " Catalog Pages!");
|
LOGGER.info("Loaded {} Catalog Pages!", this.catalogPages.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -74,7 +74,7 @@ public abstract class CatalogPage implements Comparable<CatalogPage>, ISerialize
|
|||||||
this.included.add(Integer.valueOf(id));
|
this.included.add(Integer.valueOf(id));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
LOGGER.error("Caught exception", e);
|
LOGGER.error("Caught exception", e);
|
||||||
LOGGER.error("Failed to parse includes column value of (" + id + ") for catalog page (" + this.id + ")");
|
LOGGER.error("Failed to parse includes column value of ({}) for catalog page ({})", id, this.id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -20,7 +20,7 @@ public class ClothItem {
|
|||||||
|
|
||||||
this.setId = new int[parts.length];
|
this.setId = new int[parts.length];
|
||||||
for (int i = 0; i < this.setId.length; i++) {
|
for (int i = 0; i < this.setId.length; i++) {
|
||||||
this.setId[i] = Integer.valueOf(parts[i]);
|
this.setId[i] = Integer.parseInt(parts[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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);
|
||||||
|
@ -48,7 +48,7 @@ public class RoomBundleLayout extends SingleBundle {
|
|||||||
if (this.room != null)
|
if (this.room != null)
|
||||||
this.room.preventUnloading = true;
|
this.room.preventUnloading = true;
|
||||||
} else {
|
} else {
|
||||||
LOGGER.error("No room id specified for room bundle " + this.getPageName() + "(" + this.getId() + ")");
|
LOGGER.error("No room id specified for room bundle {}({})", this.getPageName(), this.getId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -96,7 +96,7 @@ public class RoomBundleLayout extends SingleBundle {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!item[0].getExtradata().isEmpty()) {
|
if (!item[0].getExtradata().isEmpty()) {
|
||||||
items.put(Emulator.getGameEnvironment().getItemManager().getItem(Integer.valueOf(item[0].getExtradata())), 1);
|
items.put(Emulator.getGameEnvironment().getItemManager().getItem(Integer.parseInt(item[0].getExtradata())), 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
StringBuilder data = new StringBuilder();
|
StringBuilder data = new StringBuilder();
|
||||||
|
@ -36,8 +36,8 @@ public class MarketPlaceOffer implements Runnable {
|
|||||||
this.itemId = set.getInt("item_id");
|
this.itemId = set.getInt("item_id");
|
||||||
|
|
||||||
if (!set.getString("ltd_data").split(":")[1].equals("0")) {
|
if (!set.getString("ltd_data").split(":")[1].equals("0")) {
|
||||||
this.limitedStack = Integer.valueOf(set.getString("ltd_data").split(":")[0]);
|
this.limitedStack = Integer.parseInt(set.getString("ltd_data").split(":")[0]);
|
||||||
this.limitedNumber = Integer.valueOf(set.getString("ltd_data").split(":")[1]);
|
this.limitedNumber = Integer.parseInt(set.getString("ltd_data").split(":")[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!privateOffer) {
|
if (!privateOffer) {
|
||||||
|
@ -24,7 +24,7 @@ public class AboutCommand extends Command {
|
|||||||
|
|
||||||
int seconds = Emulator.getIntUnixTimestamp() - Emulator.getTimeStarted();
|
int seconds = Emulator.getIntUnixTimestamp() - Emulator.getTimeStarted();
|
||||||
int day = (int) TimeUnit.SECONDS.toDays(seconds);
|
int day = (int) TimeUnit.SECONDS.toDays(seconds);
|
||||||
long hours = TimeUnit.SECONDS.toHours(seconds) - (day * 24);
|
long hours = TimeUnit.SECONDS.toHours(seconds) - (day * 24L);
|
||||||
long minute = TimeUnit.SECONDS.toMinutes(seconds) - (TimeUnit.SECONDS.toHours(seconds) * 60);
|
long minute = TimeUnit.SECONDS.toMinutes(seconds) - (TimeUnit.SECONDS.toHours(seconds) * 60);
|
||||||
long second = TimeUnit.SECONDS.toSeconds(seconds) - (TimeUnit.SECONDS.toMinutes(seconds) * 60);
|
long second = TimeUnit.SECONDS.toSeconds(seconds) - (TimeUnit.SECONDS.toMinutes(seconds) * 60);
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@ public class BanCommand extends Command {
|
|||||||
|
|
||||||
int banTime;
|
int banTime;
|
||||||
try {
|
try {
|
||||||
banTime = Integer.valueOf(params[2]);
|
banTime = Integer.parseInt(params[2]);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_ban.invalid_time"), RoomChatMessageBubbles.ALERT);
|
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_ban.invalid_time"), RoomChatMessageBubbles.ALERT);
|
||||||
return true;
|
return true;
|
||||||
@ -39,7 +39,7 @@ public class BanCommand extends Command {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (params[1].toLowerCase().equals(gameClient.getHabbo().getHabboInfo().getUsername().toLowerCase())) {
|
if (params[1].equalsIgnoreCase(gameClient.getHabbo().getHabboInfo().getUsername())) {
|
||||||
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_ban.ban_self"), RoomChatMessageBubbles.ALERT);
|
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_ban.ban_self"), RoomChatMessageBubbles.ALERT);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -17,7 +17,7 @@ public class ChatTypeCommand extends Command {
|
|||||||
if (params.length >= 2) {
|
if (params.length >= 2) {
|
||||||
int chatColor;
|
int chatColor;
|
||||||
try {
|
try {
|
||||||
chatColor = Integer.valueOf(params[1]);
|
chatColor = Integer.parseInt(params[1]);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_chatcolor.numbers"), RoomChatMessageBubbles.ALERT);
|
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_chatcolor.numbers"), RoomChatMessageBubbles.ALERT);
|
||||||
return true;
|
return true;
|
||||||
@ -34,7 +34,7 @@ public class ChatTypeCommand extends Command {
|
|||||||
|
|
||||||
if (!gameClient.getHabbo().hasPermission(Permission.ACC_ANYCHATCOLOR)) {
|
if (!gameClient.getHabbo().hasPermission(Permission.ACC_ANYCHATCOLOR)) {
|
||||||
for (String s : Emulator.getConfig().getValue("commands.cmd_chatcolor.banned_numbers").split(";")) {
|
for (String s : Emulator.getConfig().getValue("commands.cmd_chatcolor.banned_numbers").split(";")) {
|
||||||
if (Integer.valueOf(s) == chatColor) {
|
if (Integer.parseInt(s) == chatColor) {
|
||||||
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_chatcolor.banned"), RoomChatMessageBubbles.ALERT);
|
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_chatcolor.banned"), RoomChatMessageBubbles.ALERT);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -39,7 +39,7 @@ public class CommandHandler {
|
|||||||
public CommandHandler() {
|
public CommandHandler() {
|
||||||
long millis = System.currentTimeMillis();
|
long millis = System.currentTimeMillis();
|
||||||
this.reloadCommands();
|
this.reloadCommands();
|
||||||
LOGGER.info("Command Handler -> Loaded! (" + (System.currentTimeMillis() - millis) + " MS)");
|
LOGGER.info("Command Handler -> Loaded! ({} MS)", System.currentTimeMillis() - millis);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void addCommand(Command command) {
|
public static void addCommand(Command command) {
|
||||||
@ -71,7 +71,7 @@ public class CommandHandler {
|
|||||||
if (parts.length >= 1) {
|
if (parts.length >= 1) {
|
||||||
for (Command command : commands.values()) {
|
for (Command command : commands.values()) {
|
||||||
for (String s : command.keys) {
|
for (String s : command.keys) {
|
||||||
if (s.toLowerCase().equals(parts[0].toLowerCase())) {
|
if (s.equalsIgnoreCase(parts[0])) {
|
||||||
boolean succes = false;
|
boolean succes = false;
|
||||||
if (command.permission == null || gameClient.getHabbo().hasPermission(command.permission, gameClient.getHabbo().getHabboInfo().getCurrentRoom() != null && (gameClient.getHabbo().getHabboInfo().getCurrentRoom().hasRights(gameClient.getHabbo())) || gameClient.getHabbo().hasPermission(Permission.ACC_PLACEFURNI) || (gameClient.getHabbo().getHabboInfo().getCurrentRoom() != null && gameClient.getHabbo().getHabboInfo().getCurrentRoom().getGuildId() > 0 && gameClient.getHabbo().getHabboInfo().getCurrentRoom().getGuildRightLevel(gameClient.getHabbo()).isEqualOrGreaterThan(RoomRightLevels.GUILD_RIGHTS)))) {
|
if (command.permission == null || gameClient.getHabbo().hasPermission(command.permission, gameClient.getHabbo().getHabboInfo().getCurrentRoom() != null && (gameClient.getHabbo().getHabboInfo().getCurrentRoom().hasRights(gameClient.getHabbo())) || gameClient.getHabbo().hasPermission(Permission.ACC_PLACEFURNI) || (gameClient.getHabbo().getHabboInfo().getCurrentRoom() != null && gameClient.getHabbo().getHabboInfo().getCurrentRoom().getGuildId() > 0 && gameClient.getHabbo().getHabboInfo().getCurrentRoom().getGuildRightLevel(gameClient.getHabbo()).isEqualOrGreaterThan(RoomRightLevels.GUILD_RIGHTS)))) {
|
||||||
try {
|
try {
|
||||||
|
@ -30,7 +30,7 @@ public class CoordsCommand extends Command {
|
|||||||
"Tile stack height: " + gameClient.getHabbo().getHabboInfo().getCurrentRoom().getLayout().getTile(gameClient.getHabbo().getRoomUnit().getX(), gameClient.getHabbo().getRoomUnit().getY()).getStackHeight());
|
"Tile stack height: " + gameClient.getHabbo().getHabboInfo().getCurrentRoom().getLayout().getTile(gameClient.getHabbo().getRoomUnit().getX(), gameClient.getHabbo().getRoomUnit().getY()).getStackHeight());
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
RoomTile tile = gameClient.getHabbo().getHabboInfo().getCurrentRoom().getLayout().getTile(Short.valueOf(params[1]), Short.valueOf(params[2]));
|
RoomTile tile = gameClient.getHabbo().getHabboInfo().getCurrentRoom().getLayout().getTile(Short.parseShort(params[1]), Short.parseShort(params[2]));
|
||||||
|
|
||||||
if (tile != null) {
|
if (tile != null) {
|
||||||
gameClient.getHabbo().alert(Emulator.getTexts().getValue("commands.generic.cmd_coords.title") + "\r\n" +
|
gameClient.getHabbo().alert(Emulator.getTexts().getValue("commands.generic.cmd_coords.title") + "\r\n" +
|
||||||
|
@ -17,7 +17,7 @@ public class DisconnectCommand extends Command {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (params[1].toLowerCase().equals(gameClient.getHabbo().getHabboInfo().getUsername().toLowerCase())) {
|
if (params[1].equalsIgnoreCase(gameClient.getHabbo().getHabboInfo().getUsername())) {
|
||||||
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_disconnect.disconnect_self"), RoomChatMessageBubbles.ALERT);
|
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_disconnect.disconnect_self"), RoomChatMessageBubbles.ALERT);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -25,7 +25,7 @@ public class GiftCommand extends Command {
|
|||||||
int itemId;
|
int itemId;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
itemId = Integer.valueOf(params[2]);
|
itemId = Integer.parseInt(params[2]);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_gift.not_a_number"), RoomChatMessageBubbles.ALERT);
|
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_gift.not_a_number"), RoomChatMessageBubbles.ALERT);
|
||||||
return true;
|
return true;
|
||||||
|
@ -28,7 +28,7 @@ public class GiveRankCommand extends Command {
|
|||||||
|
|
||||||
if (params.length == 3) {
|
if (params.length == 3) {
|
||||||
if (StringUtils.isNumeric(params[2])) {
|
if (StringUtils.isNumeric(params[2])) {
|
||||||
int rankId = Integer.valueOf(params[2]);
|
int rankId = Integer.parseInt(params[2]);
|
||||||
if (Emulator.getGameEnvironment().getPermissionsManager().rankExists(rankId))
|
if (Emulator.getGameEnvironment().getPermissionsManager().rankExists(rankId))
|
||||||
rank = Emulator.getGameEnvironment().getPermissionsManager().getRank(rankId);
|
rank = Emulator.getGameEnvironment().getPermissionsManager().getRank(rankId);
|
||||||
} else {
|
} else {
|
||||||
|
@ -18,7 +18,7 @@ public class MassCreditsCommand extends Command {
|
|||||||
int amount;
|
int amount;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
amount = Integer.valueOf(params[1]);
|
amount = Integer.parseInt(params[1]);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_masscredits.invalid_amount"), RoomChatMessageBubbles.ALERT);
|
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_masscredits.invalid_amount"), RoomChatMessageBubbles.ALERT);
|
||||||
return true;
|
return true;
|
||||||
|
@ -25,7 +25,7 @@ public class MassGiftCommand extends Command {
|
|||||||
int itemId;
|
int itemId;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
itemId = Integer.valueOf(params[1]);
|
itemId = Integer.parseInt(params[1]);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_gift.not_a_number"), RoomChatMessageBubbles.ALERT);
|
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_gift.not_a_number"), RoomChatMessageBubbles.ALERT);
|
||||||
return true;
|
return true;
|
||||||
|
@ -18,7 +18,7 @@ public class MassPixelsCommand extends Command {
|
|||||||
int amount;
|
int amount;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
amount = Integer.valueOf(params[1]);
|
amount = Integer.parseInt(params[1]);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_massduckets.invalid_amount"), RoomChatMessageBubbles.ALERT);
|
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_massduckets.invalid_amount"), RoomChatMessageBubbles.ALERT);
|
||||||
return true;
|
return true;
|
||||||
|
@ -19,7 +19,7 @@ public class MassPointsCommand extends Command {
|
|||||||
if (params.length == 3) {
|
if (params.length == 3) {
|
||||||
amountString = params[1];
|
amountString = params[1];
|
||||||
try {
|
try {
|
||||||
type = Integer.valueOf(params[2]);
|
type = Integer.parseInt(params[2]);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_masspoints.invalid_type").replace("%types%", Emulator.getConfig().getValue("seasonal.types").replace(";", ", ")), RoomChatMessageBubbles.ALERT);
|
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_masspoints.invalid_type").replace("%types%", Emulator.getConfig().getValue("seasonal.types").replace(";", ", ")), RoomChatMessageBubbles.ALERT);
|
||||||
return true;
|
return true;
|
||||||
@ -48,7 +48,7 @@ public class MassPointsCommand extends Command {
|
|||||||
int amount;
|
int amount;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
amount = Integer.valueOf(amountString);
|
amount = Integer.parseInt(amountString);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_masspoints.invalid_amount"), RoomChatMessageBubbles.ALERT);
|
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_masspoints.invalid_amount"), RoomChatMessageBubbles.ALERT);
|
||||||
return true;
|
return true;
|
||||||
|
@ -33,7 +33,7 @@ public class MuteCommand extends Command {
|
|||||||
|
|
||||||
if (params.length == 3) {
|
if (params.length == 3) {
|
||||||
try {
|
try {
|
||||||
duration = Integer.valueOf(params[2]);
|
duration = Integer.parseInt(params[2]);
|
||||||
|
|
||||||
if (duration <= 0)
|
if (duration <= 0)
|
||||||
throw new Exception("");
|
throw new Exception("");
|
||||||
|
@ -21,7 +21,7 @@ public class PointsCommand extends Command {
|
|||||||
|
|
||||||
if (params.length == 4) {
|
if (params.length == 4) {
|
||||||
try {
|
try {
|
||||||
type = Integer.valueOf(params[3]);
|
type = Integer.parseInt(params[3]);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_points.invalid_type").replace("%types%", Emulator.getConfig().getValue("seasonal.types").replace(";", ", ")), RoomChatMessageBubbles.ALERT);
|
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_points.invalid_type").replace("%types%", Emulator.getConfig().getValue("seasonal.types").replace(";", ", ")), RoomChatMessageBubbles.ALERT);
|
||||||
return true;
|
return true;
|
||||||
@ -31,7 +31,7 @@ public class PointsCommand extends Command {
|
|||||||
int amount;
|
int amount;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
amount = Integer.valueOf(params[2]);
|
amount = Integer.parseInt(params[2]);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_points.invalid_amount"), RoomChatMessageBubbles.ALERT);
|
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_points.invalid_amount"), RoomChatMessageBubbles.ALERT);
|
||||||
return true;
|
return true;
|
||||||
|
@ -47,7 +47,7 @@ public class PromoteTargetOfferCommand extends Command {
|
|||||||
} else {
|
} else {
|
||||||
int offerId = 0;
|
int offerId = 0;
|
||||||
try {
|
try {
|
||||||
offerId = Integer.valueOf(offerKey);
|
offerId = Integer.parseInt(offerKey);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -35,21 +35,21 @@ public class RedeemCommand extends Command {
|
|||||||
items.add(item);
|
items.add(item);
|
||||||
if ((item.getBaseItem().getName().startsWith("CF_") || item.getBaseItem().getName().startsWith("CFC_")) && !item.getBaseItem().getName().contains("_diamond_")) {
|
if ((item.getBaseItem().getName().startsWith("CF_") || item.getBaseItem().getName().startsWith("CFC_")) && !item.getBaseItem().getName().contains("_diamond_")) {
|
||||||
try {
|
try {
|
||||||
credits += Integer.valueOf(item.getBaseItem().getName().split("_")[1]);
|
credits += Integer.parseInt(item.getBaseItem().getName().split("_")[1]);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (item.getBaseItem().getName().startsWith("PF_")) {
|
} else if (item.getBaseItem().getName().startsWith("PF_")) {
|
||||||
try {
|
try {
|
||||||
pixels += Integer.valueOf(item.getBaseItem().getName().split("_")[1]);
|
pixels += Integer.parseInt(item.getBaseItem().getName().split("_")[1]);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
}
|
}
|
||||||
} else if (item.getBaseItem().getName().startsWith("DF_")) {
|
} else if (item.getBaseItem().getName().startsWith("DF_")) {
|
||||||
int pointsType;
|
int pointsType;
|
||||||
int pointsAmount;
|
int pointsAmount;
|
||||||
|
|
||||||
pointsType = Integer.valueOf(item.getBaseItem().getName().split("_")[1]);
|
pointsType = Integer.parseInt(item.getBaseItem().getName().split("_")[1]);
|
||||||
pointsAmount = Integer.valueOf(item.getBaseItem().getName().split("_")[2]);
|
pointsAmount = Integer.parseInt(item.getBaseItem().getName().split("_")[2]);
|
||||||
|
|
||||||
points.adjustOrPutValue(pointsType, pointsAmount, pointsAmount);
|
points.adjustOrPutValue(pointsType, pointsAmount, pointsAmount);
|
||||||
}
|
}
|
||||||
@ -58,7 +58,7 @@ public class RedeemCommand extends Command {
|
|||||||
int pointsAmount;
|
int pointsAmount;
|
||||||
|
|
||||||
pointsType = 5;
|
pointsType = 5;
|
||||||
pointsAmount = Integer.valueOf(item.getBaseItem().getName().split("_")[2]);
|
pointsAmount = Integer.parseInt(item.getBaseItem().getName().split("_")[2]);
|
||||||
|
|
||||||
points.adjustOrPutValue(pointsType, pointsAmount, pointsAmount);
|
points.adjustOrPutValue(pointsType, pointsAmount, pointsAmount);
|
||||||
}
|
}
|
||||||
|
@ -36,10 +36,10 @@ public class RoomBundleCommand extends Command {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
parentId = Integer.valueOf(params[1]);
|
parentId = Integer.parseInt(params[1]);
|
||||||
credits = Integer.valueOf(params[2]);
|
credits = Integer.parseInt(params[2]);
|
||||||
points = Integer.valueOf(params[3]);
|
points = Integer.parseInt(params[3]);
|
||||||
pointsType = Integer.valueOf(params[4]);
|
pointsType = Integer.parseInt(params[4]);
|
||||||
|
|
||||||
CatalogPage page = Emulator.getGameEnvironment().getCatalogManager().createCatalogPage("Room Bundle: " + gameClient.getHabbo().getHabboInfo().getCurrentRoom().getName(), "room_bundle_" + gameClient.getHabbo().getHabboInfo().getCurrentRoom().getId(), gameClient.getHabbo().getHabboInfo().getCurrentRoom().getId(), 0, CatalogPageLayouts.room_bundle, gameClient.getHabbo().getHabboInfo().getRank().getId(), parentId);
|
CatalogPage page = Emulator.getGameEnvironment().getCatalogManager().createCatalogPage("Room Bundle: " + gameClient.getHabbo().getHabboInfo().getCurrentRoom().getName(), "room_bundle_" + gameClient.getHabbo().getHabboInfo().getCurrentRoom().getId(), gameClient.getHabbo().getHabboInfo().getCurrentRoom().getId(), 0, CatalogPageLayouts.room_bundle, gameClient.getHabbo().getHabboInfo().getRank().getId(), parentId);
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@ public class RoomCreditsCommand extends Command {
|
|||||||
int amount;
|
int amount;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
amount = Integer.valueOf(params[1]);
|
amount = Integer.parseInt(params[1]);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_masscredits.invalid_amount"), RoomChatMessageBubbles.ALERT);
|
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_masscredits.invalid_amount"), RoomChatMessageBubbles.ALERT);
|
||||||
return true;
|
return true;
|
||||||
|
@ -18,7 +18,7 @@ public class RoomDanceCommand extends Command {
|
|||||||
int danceId;
|
int danceId;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
danceId = Integer.valueOf(params[1]);
|
danceId = Integer.parseInt(params[1]);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_danceall.invalid_dance"), RoomChatMessageBubbles.ALERT);
|
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_danceall.invalid_dance"), RoomChatMessageBubbles.ALERT);
|
||||||
return true;
|
return true;
|
||||||
|
@ -19,7 +19,7 @@ public class RoomEffectCommand extends Command {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
int effectId = Integer.valueOf(params[1]);
|
int effectId = Integer.parseInt(params[1]);
|
||||||
|
|
||||||
if (effectId >= 0) {
|
if (effectId >= 0) {
|
||||||
Room room = gameClient.getHabbo().getHabboInfo().getCurrentRoom();
|
Room room = gameClient.getHabbo().getHabboInfo().getCurrentRoom();
|
||||||
|
@ -20,7 +20,7 @@ public class RoomGiftCommand extends Command {
|
|||||||
int itemId;
|
int itemId;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
itemId = Integer.valueOf(params[1]);
|
itemId = Integer.parseInt(params[1]);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_gift.not_a_number"), RoomChatMessageBubbles.ALERT);
|
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_gift.not_a_number"), RoomChatMessageBubbles.ALERT);
|
||||||
return true;
|
return true;
|
||||||
|
@ -17,7 +17,7 @@ public class RoomItemCommand extends Command {
|
|||||||
|
|
||||||
if (params.length >= 2) {
|
if (params.length >= 2) {
|
||||||
try {
|
try {
|
||||||
itemId = Integer.valueOf(params[1]);
|
itemId = Integer.parseInt(params[1]);
|
||||||
|
|
||||||
if (itemId < 0) {
|
if (itemId < 0) {
|
||||||
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_roomitem.positive"), RoomChatMessageBubbles.ALERT);
|
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_roomitem.positive"), RoomChatMessageBubbles.ALERT);
|
||||||
|
@ -16,7 +16,7 @@ public class RoomPixelsCommand extends Command {
|
|||||||
int amount;
|
int amount;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
amount = Integer.valueOf(params[1]);
|
amount = Integer.parseInt(params[1]);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_massduckets.invalid_amount"), RoomChatMessageBubbles.ALERT);
|
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_massduckets.invalid_amount"), RoomChatMessageBubbles.ALERT);
|
||||||
return true;
|
return true;
|
||||||
|
@ -18,7 +18,7 @@ public class RoomPointsCommand extends Command {
|
|||||||
try {
|
try {
|
||||||
amountString = params[1];
|
amountString = params[1];
|
||||||
|
|
||||||
type = Integer.valueOf(params[2]);
|
type = Integer.parseInt(params[2]);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_masspoints.invalid_type").replace("%types%", Emulator.getConfig().getValue("seasonal.types").replace(";", ", ")), RoomChatMessageBubbles.ALERT);
|
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_masspoints.invalid_type").replace("%types%", Emulator.getConfig().getValue("seasonal.types").replace(";", ", ")), RoomChatMessageBubbles.ALERT);
|
||||||
return true;
|
return true;
|
||||||
@ -46,7 +46,7 @@ public class RoomPointsCommand extends Command {
|
|||||||
int amount;
|
int amount;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
amount = Integer.valueOf(amountString);
|
amount = Integer.parseInt(amountString);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_masspoints.invalid_amount"), RoomChatMessageBubbles.ALERT);
|
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_masspoints.invalid_amount"), RoomChatMessageBubbles.ALERT);
|
||||||
return true;
|
return true;
|
||||||
|
@ -14,7 +14,7 @@ public class SetMaxCommand extends Command {
|
|||||||
if (params.length >= 2) {
|
if (params.length >= 2) {
|
||||||
int max;
|
int max;
|
||||||
try {
|
try {
|
||||||
max = Integer.valueOf(params[1]);
|
max = Integer.parseInt(params[1]);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -15,7 +15,7 @@ public class SetPollCommand extends Command {
|
|||||||
if (gameClient.getHabbo().getHabboInfo().getCurrentRoom() != null) {
|
if (gameClient.getHabbo().getHabboInfo().getCurrentRoom() != null) {
|
||||||
int pollId = -1;
|
int pollId = -1;
|
||||||
try {
|
try {
|
||||||
pollId = Integer.valueOf(params[1]);
|
pollId = Integer.parseInt(params[1]);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -20,7 +20,7 @@ public class SetSpeedCommand extends Command {
|
|||||||
int newSpeed;
|
int newSpeed;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
newSpeed = Integer.valueOf(params[1]);
|
newSpeed = Integer.parseInt(params[1]);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_setspeed.invalid_amount"), RoomChatMessageBubbles.ALERT);
|
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_setspeed.invalid_amount"), RoomChatMessageBubbles.ALERT);
|
||||||
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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -20,7 +20,7 @@ public class StaffOnlineCommand extends Command {
|
|||||||
|
|
||||||
if (params.length >= 2) {
|
if (params.length >= 2) {
|
||||||
try {
|
try {
|
||||||
int i = Integer.valueOf(params[1]);
|
int i = Integer.parseInt(params[1]);
|
||||||
|
|
||||||
if (i < 1) {
|
if (i < 1) {
|
||||||
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_staffonline.positive_only"), RoomChatMessageBubbles.ALERT);
|
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_staffonline.positive_only"), RoomChatMessageBubbles.ALERT);
|
||||||
|
@ -15,7 +15,7 @@ public class TestCommand extends Command {
|
|||||||
if (gameClient.getHabbo() != null || !gameClient.getHabbo().hasPermission(Permission.ACC_SUPPORTTOOL) || !Emulator.debugging)
|
if (gameClient.getHabbo() != null || !gameClient.getHabbo().hasPermission(Permission.ACC_SUPPORTTOOL) || !Emulator.debugging)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
int header = Integer.valueOf(params[1]);
|
int header = Integer.parseInt(params[1]);
|
||||||
|
|
||||||
ServerMessage message = new ServerMessage(header);
|
ServerMessage message = new ServerMessage(header);
|
||||||
|
|
||||||
@ -35,7 +35,7 @@ public class TestCommand extends Command {
|
|||||||
} else if (data[0].equalsIgnoreCase("by")) {
|
} else if (data[0].equalsIgnoreCase("by")) {
|
||||||
message.appendByte(Integer.valueOf(data[1]));
|
message.appendByte(Integer.valueOf(data[1]));
|
||||||
} else if (data[0].equalsIgnoreCase("sh")) {
|
} else if (data[0].equalsIgnoreCase("sh")) {
|
||||||
message.appendShort(Integer.valueOf(data[1]));
|
message.appendShort(Integer.parseInt(data[1]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -40,7 +40,7 @@ public class TransformCommand extends Command {
|
|||||||
|
|
||||||
if (params.length >= 3) {
|
if (params.length >= 3) {
|
||||||
try {
|
try {
|
||||||
race = Integer.valueOf(params[2]);
|
race = Integer.parseInt(params[2]);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -56,7 +56,7 @@ public class CraftingManager {
|
|||||||
recipe.addIngredient(ingredientItem, set.getInt("crafting_recipes_ingredients.amount"));
|
recipe.addIngredient(ingredientItem, set.getInt("crafting_recipes_ingredients.amount"));
|
||||||
altar.addIngredient(ingredientItem);
|
altar.addIngredient(ingredientItem);
|
||||||
} else {
|
} else {
|
||||||
LOGGER.error("Unknown ingredient item " + set.getInt("crafting_recipes_ingredients.item_id"));
|
LOGGER.error("Unknown ingredient item {}", set.getInt("crafting_recipes_ingredients.item_id"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -375,7 +375,7 @@ public class BattleBanzaiGame 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;
|
||||||
|
@ -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;
|
||||||
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -38,7 +38,7 @@ public class GuildManager {
|
|||||||
this.loadGuildParts();
|
this.loadGuildParts();
|
||||||
this.loadGuildViews();
|
this.loadGuildViews();
|
||||||
|
|
||||||
LOGGER.info("Guild Manager -> Loaded! (" + (System.currentTimeMillis() - millis) + " MS)");
|
LOGGER.info("Guild Manager -> Loaded! ({} MS)", System.currentTimeMillis() - millis);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -45,12 +45,12 @@ public class CrackableReward {
|
|||||||
int chance = 100;
|
int chance = 100;
|
||||||
|
|
||||||
if (prize.contains(":") && prize.split(":").length == 2) {
|
if (prize.contains(":") && prize.split(":").length == 2) {
|
||||||
itemId = Integer.valueOf(prize.split(":")[0]);
|
itemId = Integer.parseInt(prize.split(":")[0]);
|
||||||
chance = Integer.valueOf(prize.split(":")[1]);
|
chance = Integer.parseInt(prize.split(":")[1]);
|
||||||
} else if (prize.contains(":")) {
|
} else if (prize.contains(":")) {
|
||||||
LOGGER.error("Invalid configuration of crackable prizes (item id: " + this.itemId + "). '" + prize + "' format should be itemId:chance.");
|
LOGGER.error("Invalid configuration of crackable prizes (item id: {}). '{}' format should be itemId:chance.", this.itemId, prize);
|
||||||
} else {
|
} else {
|
||||||
itemId = Integer.valueOf(prize.replace(":", ""));
|
itemId = Integer.parseInt(prize.replace(":", ""));
|
||||||
}
|
}
|
||||||
|
|
||||||
this.prizes.put(itemId, new AbstractMap.SimpleEntry<>(this.totalChance, this.totalChance + chance));
|
this.prizes.put(itemId, new AbstractMap.SimpleEntry<>(this.totalChance, this.totalChance + chance));
|
||||||
|
@ -55,7 +55,7 @@ public class Item implements ISerialize {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
int index = Integer.valueOf(item.getExtradata()) % (item.getBaseItem().getMultiHeights().length);
|
int index = Integer.parseInt(item.getExtradata()) % (item.getBaseItem().getMultiHeights().length);
|
||||||
return item.getBaseItem().getMultiHeights()[(item.getExtradata().isEmpty() ? 0 : index)];
|
return item.getBaseItem().getMultiHeights()[(item.getExtradata().isEmpty() ? 0 : index)];
|
||||||
} catch (NumberFormatException e) {
|
} catch (NumberFormatException e) {
|
||||||
|
|
||||||
@ -103,7 +103,7 @@ public class Item implements ISerialize {
|
|||||||
this.vendingItems = new TIntArrayList();
|
this.vendingItems = new TIntArrayList();
|
||||||
String[] vendingIds = set.getString("vending_ids").replace(";", ",").split(",");
|
String[] vendingIds = set.getString("vending_ids").replace(";", ",").split(",");
|
||||||
for (String s : vendingIds) {
|
for (String s : vendingIds) {
|
||||||
this.vendingItems.add(Integer.valueOf(s.replace(" ", "")));
|
this.vendingItems.add(Integer.parseInt(s.replace(" ", "")));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -106,7 +106,7 @@ public class ItemManager {
|
|||||||
this.highscoreManager.load();
|
this.highscoreManager.load();
|
||||||
this.loadNewUserGifts();
|
this.loadNewUserGifts();
|
||||||
|
|
||||||
LOGGER.info("Item Manager -> Loaded! (" + (System.currentTimeMillis() - millis) + " MS)");
|
LOGGER.info("Item Manager -> Loaded! ({} MS)", System.currentTimeMillis() - millis);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void loadItemInteractions() {
|
protected void loadItemInteractions() {
|
||||||
@ -557,7 +557,7 @@ public class ItemManager {
|
|||||||
try (PreparedStatement preparedStatement = connection.prepareStatement("INSERT INTO items_presents VALUES (?, ?)")) {
|
try (PreparedStatement preparedStatement = connection.prepareStatement("INSERT INTO items_presents VALUES (?, ?)")) {
|
||||||
while (set.next() && item == null) {
|
while (set.next() && item == null) {
|
||||||
preparedStatement.setInt(1, set.getInt(1));
|
preparedStatement.setInt(1, set.getInt(1));
|
||||||
preparedStatement.setInt(2, Integer.valueOf(itemId));
|
preparedStatement.setInt(2, Integer.parseInt(itemId));
|
||||||
preparedStatement.addBatch();
|
preparedStatement.addBatch();
|
||||||
item = new InteractionDefault(set.getInt(1), habbo.getHabboInfo().getId(), Emulator.getGameEnvironment().getCatalogManager().ecotronItem, extradata, 0, 0);
|
item = new InteractionDefault(set.getInt(1), habbo.getHabboInfo().getId(), Emulator.getGameEnvironment().getCatalogManager().ecotronItem, extradata, 0, 0);
|
||||||
}
|
}
|
||||||
@ -758,7 +758,7 @@ public class ItemManager {
|
|||||||
for (int i = this.items.size(); i-- > 0; ) {
|
for (int i = this.items.size(); i-- > 0; ) {
|
||||||
try {
|
try {
|
||||||
item.advance();
|
item.advance();
|
||||||
if (item.value().getName().toLowerCase().equals(itemName.toLowerCase())) {
|
if (item.value().getName().equalsIgnoreCase(itemName)) {
|
||||||
return item.value();
|
return item.value();
|
||||||
}
|
}
|
||||||
} catch (NoSuchElementException e) {
|
} catch (NoSuchElementException e) {
|
||||||
|
@ -25,7 +25,7 @@ public class RandomStateParams {
|
|||||||
this.delay = Integer.parseInt(keyValue[1]);
|
this.delay = Integer.parseInt(keyValue[1]);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
LOGGER.warn("RandomStateParams: unknown key: " + keyValue[0]);
|
LOGGER.warn("RandomStateParams: unknown key: {}", keyValue[0]);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -118,7 +118,7 @@ public class YoutubeManager {
|
|||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
LOGGER.info("YouTube Manager -> Loaded! (" + (System.currentTimeMillis() - millis) + " MS)");
|
LOGGER.info("YouTube Manager -> Loaded! ({} MS)", System.currentTimeMillis() - millis);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@ public class InteractionColorPlate extends InteractionDefault {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
state = Integer.valueOf(this.getExtradata());
|
state = Integer.parseInt(this.getExtradata());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
LOGGER.error("Caught exception", e);
|
LOGGER.error("Caught exception", e);
|
||||||
}
|
}
|
||||||
|
@ -40,7 +40,7 @@ public class InteractionCrackable extends HabboItem {
|
|||||||
|
|
||||||
serverMessage.appendInt(7 + (this.isLimited() ? 256 : 0));
|
serverMessage.appendInt(7 + (this.isLimited() ? 256 : 0));
|
||||||
|
|
||||||
serverMessage.appendString(Emulator.getGameEnvironment().getItemManager().calculateCrackState(Integer.valueOf(this.getExtradata()), Emulator.getGameEnvironment().getItemManager().getCrackableCount(this.getBaseItem().getId()), this.getBaseItem()) + "");
|
serverMessage.appendString(Emulator.getGameEnvironment().getItemManager().calculateCrackState(Integer.parseInt(this.getExtradata()), Emulator.getGameEnvironment().getItemManager().getCrackableCount(this.getBaseItem().getId()), this.getBaseItem()) + "");
|
||||||
serverMessage.appendInt(Integer.valueOf(this.getExtradata()));
|
serverMessage.appendInt(Integer.valueOf(this.getExtradata()));
|
||||||
serverMessage.appendInt(Emulator.getGameEnvironment().getItemManager().getCrackableCount(this.getBaseItem().getId()));
|
serverMessage.appendInt(Emulator.getGameEnvironment().getItemManager().getCrackableCount(this.getBaseItem().getId()));
|
||||||
|
|
||||||
|
@ -77,9 +77,9 @@ public class InteractionDefault extends HabboItem {
|
|||||||
int currentState = 0;
|
int currentState = 0;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
currentState = Integer.valueOf(this.getExtradata());
|
currentState = Integer.parseInt(this.getExtradata());
|
||||||
} catch (NumberFormatException e) {
|
} catch (NumberFormatException e) {
|
||||||
LOGGER.error("Incorrect extradata (" + this.getExtradata() + ") for item ID (" + this.getId() + ") of type (" + this.getBaseItem().getName() + ")");
|
LOGGER.error("Incorrect extradata ({}) for item ID ({}) of type ({})", this.getExtradata(), this.getId(), this.getBaseItem().getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
this.setExtradata("" + (currentState + 1) % this.getBaseItem().getStateCount());
|
this.setExtradata("" + (currentState + 1) % this.getBaseItem().getStateCount());
|
||||||
|
@ -25,7 +25,7 @@ public class InteractionEffectToggle extends InteractionDefault {
|
|||||||
|
|
||||||
if (client != null) {
|
if (client != null) {
|
||||||
if (room.hasRights(client.getHabbo())) {
|
if (room.hasRights(client.getHabbo())) {
|
||||||
if (Integer.valueOf(this.getExtradata()) < this.getBaseItem().getStateCount() - 1) {
|
if (Integer.parseInt(this.getExtradata()) < this.getBaseItem().getStateCount() - 1) {
|
||||||
if ((client.getHabbo().getHabboInfo().getGender() == HabboGender.M && client.getHabbo().getRoomUnit().getEffectId() == this.getBaseItem().getEffectM()) ||
|
if ((client.getHabbo().getHabboInfo().getGender() == HabboGender.M && client.getHabbo().getRoomUnit().getEffectId() == this.getBaseItem().getEffectM()) ||
|
||||||
(client.getHabbo().getHabboInfo().getGender() == HabboGender.F && client.getHabbo().getRoomUnit().getEffectId() == this.getBaseItem().getEffectF())) {
|
(client.getHabbo().getHabboInfo().getGender() == HabboGender.F && client.getHabbo().getRoomUnit().getEffectId() == this.getBaseItem().getEffectF())) {
|
||||||
super.onClick(client, room, objects);
|
super.onClick(client, room, objects);
|
||||||
|
@ -129,7 +129,7 @@ public class InteractionFireworks extends InteractionDefault {
|
|||||||
try {
|
try {
|
||||||
explodeDuration = Integer.parseInt(this.getBaseItem().getCustomParams());
|
explodeDuration = Integer.parseInt(this.getBaseItem().getCustomParams());
|
||||||
} catch (NumberFormatException e) {
|
} catch (NumberFormatException e) {
|
||||||
LOGGER.error("Incorrect customparams (" + this.getBaseItem().getCustomParams() + ") for base item ID (" + this.getBaseItem().getId() + ") of type (" + this.getBaseItem().getName() + ")");
|
LOGGER.error("Incorrect customparams ({}) for base item ID ({}) of type ({})", this.getBaseItem().getCustomParams(), this.getBaseItem().getId(), this.getBaseItem().getName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@ public class InteractionGift extends HabboItem {
|
|||||||
try {
|
try {
|
||||||
this.loadData();
|
this.loadData();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
LOGGER.warn("Incorrect extradata for gift with ID " + this.getId());
|
LOGGER.warn("Incorrect extradata for gift with ID {}", this.getId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -42,7 +42,7 @@ public class InteractionGift extends HabboItem {
|
|||||||
try {
|
try {
|
||||||
this.loadData();
|
this.loadData();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
LOGGER.warn("Incorrect extradata for gift with ID " + this.getId());
|
LOGGER.warn("Incorrect extradata for gift with ID {}", this.getId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -94,16 +94,16 @@ public class InteractionGift extends HabboItem {
|
|||||||
data = this.getExtradata().split("\t");
|
data = this.getExtradata().split("\t");
|
||||||
|
|
||||||
if (data != null && data.length >= 5) {
|
if (data != null && data.length >= 5) {
|
||||||
int count = Integer.valueOf(data[0]);
|
int count = Integer.parseInt(data[0]);
|
||||||
|
|
||||||
this.itemId = new int[count];
|
this.itemId = new int[count];
|
||||||
|
|
||||||
for (int i = 0; i < count; i++) {
|
for (int i = 0; i < count; i++) {
|
||||||
this.itemId[i] = Integer.valueOf(data[i + 1]);
|
this.itemId[i] = Integer.parseInt(data[i + 1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.colorId = Integer.valueOf(data[count + 1]);
|
this.colorId = Integer.parseInt(data[count + 1]);
|
||||||
this.ribbonId = Integer.valueOf(data[count + 2]);
|
this.ribbonId = Integer.parseInt(data[count + 2]);
|
||||||
this.showSender = data[count + 3].equalsIgnoreCase("1");
|
this.showSender = data[count + 3].equalsIgnoreCase("1");
|
||||||
this.message = data[count + 4];
|
this.message = data[count + 4];
|
||||||
|
|
||||||
|
@ -23,9 +23,9 @@ public class InteractionMusicDisc extends HabboItem {
|
|||||||
|
|
||||||
if (stuff.length >= 7 && !stuff[6].isEmpty()) {
|
if (stuff.length >= 7 && !stuff[6].isEmpty()) {
|
||||||
try {
|
try {
|
||||||
this.songId = Integer.valueOf(stuff[6]);
|
this.songId = Integer.parseInt(stuff[6]);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
LOGGER.error("Warning: Item " + this.getId() + " has an invalid song id set for its music disk!");
|
LOGGER.error("Warning: Item {} has an invalid song id set for its music disk!", this.getId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -37,9 +37,9 @@ public class InteractionMusicDisc extends HabboItem {
|
|||||||
|
|
||||||
if (stuff.length >= 7 && !stuff[6].isEmpty()) {
|
if (stuff.length >= 7 && !stuff[6].isEmpty()) {
|
||||||
try {
|
try {
|
||||||
this.songId = Integer.valueOf(stuff[6]);
|
this.songId = Integer.parseInt(stuff[6]);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
LOGGER.error("Warning: Item " + this.getId() + " has an invalid song id set for its music disk!");
|
LOGGER.error("Warning: Item {} has an invalid song id set for its music disk!", this.getId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -25,7 +25,7 @@ public class InteractionPyramid extends InteractionGate {
|
|||||||
|
|
||||||
if (room != null) {
|
if (room != null) {
|
||||||
if (room.getHabbosAt(this.getX(), this.getY()).isEmpty()) {
|
if (room.getHabbosAt(this.getX(), this.getY()).isEmpty()) {
|
||||||
int state = Integer.valueOf(this.getExtradata());
|
int state = Integer.parseInt(this.getExtradata());
|
||||||
state = Math.abs(state - 1);
|
state = Math.abs(state - 1);
|
||||||
|
|
||||||
this.setExtradata(state + "");
|
this.setExtradata(state + "");
|
||||||
|
@ -36,8 +36,8 @@ public class InteractionRentableSpace extends HabboItem {
|
|||||||
this.renterName = "Unknown";
|
this.renterName = "Unknown";
|
||||||
|
|
||||||
if (data.length == 2) {
|
if (data.length == 2) {
|
||||||
this.renterId = Integer.valueOf(data[0]);
|
this.renterId = Integer.parseInt(data[0]);
|
||||||
this.endTimestamp = Integer.valueOf(data[1]);
|
this.endTimestamp = Integer.parseInt(data[1]);
|
||||||
|
|
||||||
if (this.renterId > 0) {
|
if (this.renterId > 0) {
|
||||||
if (this.isRented()) {
|
if (this.isRented()) {
|
||||||
@ -233,8 +233,8 @@ public class InteractionRentableSpace extends HabboItem {
|
|||||||
String[] data = this.getBaseItem().getName().replace("hblooza_spacerent", "").split("x");
|
String[] data = this.getBaseItem().getName().replace("hblooza_spacerent", "").split("x");
|
||||||
|
|
||||||
if (data.length == 2) {
|
if (data.length == 2) {
|
||||||
int x = Integer.valueOf(data[0]);
|
int x = Integer.parseInt(data[0]);
|
||||||
int y = Integer.valueOf(data[1]);
|
int y = Integer.parseInt(data[1]);
|
||||||
|
|
||||||
return 10 * (x * y);
|
return 10 * (x * y);
|
||||||
}
|
}
|
||||||
|
@ -38,7 +38,7 @@ public class InteractionTileEffectProvider extends InteractionCustomValues {
|
|||||||
public void onWalkOn(RoomUnit roomUnit, final Room room, Object[] objects) throws Exception {
|
public void onWalkOn(RoomUnit roomUnit, final Room room, Object[] objects) throws Exception {
|
||||||
super.onWalkOn(roomUnit, room, objects);
|
super.onWalkOn(roomUnit, room, objects);
|
||||||
|
|
||||||
int effectId = Integer.valueOf(this.values.get("effectId"));
|
int effectId = Integer.parseInt(this.values.get("effectId"));
|
||||||
|
|
||||||
if (roomUnit.getEffectId() == effectId) {
|
if (roomUnit.getEffectId() == effectId) {
|
||||||
effectId = 0;
|
effectId = 0;
|
||||||
|
@ -26,7 +26,7 @@ public class InteractionVikingCotie extends InteractionDefault {
|
|||||||
|
|
||||||
if (client != null && client.getHabbo().getHabboInfo().getId() == this.getUserId()) {
|
if (client != null && client.getHabbo().getHabboInfo().getId() == this.getUserId()) {
|
||||||
if (client.getHabbo().getRoomUnit().getEffectId() == 172 || client.getHabbo().getRoomUnit().getEffectId() == 173) {
|
if (client.getHabbo().getRoomUnit().getEffectId() == 172 || client.getHabbo().getRoomUnit().getEffectId() == 173) {
|
||||||
int state = Integer.valueOf(this.getExtradata());
|
int state = Integer.parseInt(this.getExtradata());
|
||||||
|
|
||||||
if (state < 5) {
|
if (state < 5) {
|
||||||
state++;
|
state++;
|
||||||
|
@ -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) {
|
||||||
@ -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) {
|
||||||
|
@ -57,7 +57,7 @@ public class InteractionBattleBanzaiTile extends HabboItem {
|
|||||||
if (this.getExtradata().isEmpty())
|
if (this.getExtradata().isEmpty())
|
||||||
this.setExtradata("0");
|
this.setExtradata("0");
|
||||||
|
|
||||||
int state = Integer.valueOf(this.getExtradata());
|
int state = Integer.parseInt(this.getExtradata());
|
||||||
|
|
||||||
if (state % 3 == 2)
|
if (state % 3 == 2)
|
||||||
return;
|
return;
|
||||||
@ -88,7 +88,7 @@ public class InteractionBattleBanzaiTile extends HabboItem {
|
|||||||
if (this.getExtradata().isEmpty())
|
if (this.getExtradata().isEmpty())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return Integer.valueOf(this.getExtradata()) % 3 == 2;
|
return Integer.parseInt(this.getExtradata()) % 3 == 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -103,7 +103,7 @@ public class InteractionFreezeBlock extends HabboItem {
|
|||||||
|
|
||||||
int powerUp;
|
int powerUp;
|
||||||
try {
|
try {
|
||||||
powerUp = Integer.valueOf(this.getExtradata()) / 1000;
|
powerUp = Integer.parseInt(this.getExtradata()) / 1000;
|
||||||
} catch (NumberFormatException e) {
|
} catch (NumberFormatException e) {
|
||||||
powerUp = 0;
|
powerUp = 0;
|
||||||
}
|
}
|
||||||
|
@ -107,7 +107,7 @@ public class WiredEffectBotClothes extends InteractionWiredEffect {
|
|||||||
String[] data = wiredData.split(((char) 9) + "");
|
String[] data = wiredData.split(((char) 9) + "");
|
||||||
|
|
||||||
if (data.length >= 3) {
|
if (data.length >= 3) {
|
||||||
this.setDelay(Integer.valueOf(data[0]));
|
this.setDelay(Integer.parseInt(data[0]));
|
||||||
this.botName = data[1];
|
this.botName = data[1];
|
||||||
this.botLook = data[2];
|
this.botLook = data[2];
|
||||||
}
|
}
|
||||||
|
@ -138,7 +138,7 @@ public class WiredEffectBotFollowHabbo extends InteractionWiredEffect {
|
|||||||
String[] data = wiredData.split(((char) 9) + "");
|
String[] data = wiredData.split(((char) 9) + "");
|
||||||
|
|
||||||
if (data.length == 3) {
|
if (data.length == 3) {
|
||||||
this.setDelay(Integer.valueOf(data[0]));
|
this.setDelay(Integer.parseInt(data[0]));
|
||||||
this.mode = (data[1].equalsIgnoreCase("1") ? 1 : 0);
|
this.mode = (data[1].equalsIgnoreCase("1") ? 1 : 0);
|
||||||
this.botName = data[2];
|
this.botName = data[2];
|
||||||
}
|
}
|
||||||
|
@ -152,8 +152,8 @@ public class WiredEffectBotGiveHandItem extends InteractionWiredEffect {
|
|||||||
String[] data = wiredData.split(((char) 9) + "");
|
String[] data = wiredData.split(((char) 9) + "");
|
||||||
|
|
||||||
if (data.length == 3) {
|
if (data.length == 3) {
|
||||||
this.setDelay(Integer.valueOf(data[0]));
|
this.setDelay(Integer.parseInt(data[0]));
|
||||||
this.itemId = Integer.valueOf(data[1]);
|
this.itemId = Integer.parseInt(data[1]);
|
||||||
this.botName = data[2];
|
this.botName = data[2];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -143,7 +143,7 @@ public class WiredEffectBotTalk extends InteractionWiredEffect {
|
|||||||
String[] data = wiredData.split(((char) 9) + "");
|
String[] data = wiredData.split(((char) 9) + "");
|
||||||
|
|
||||||
if (data.length == 4) {
|
if (data.length == 4) {
|
||||||
this.setDelay(Integer.valueOf(data[0]));
|
this.setDelay(Integer.parseInt(data[0]));
|
||||||
this.mode = data[1].equalsIgnoreCase("1") ? 1 : 0;
|
this.mode = data[1].equalsIgnoreCase("1") ? 1 : 0;
|
||||||
this.botName = data[2];
|
this.botName = data[2];
|
||||||
this.message = data[3];
|
this.message = data[3];
|
||||||
|
@ -166,7 +166,7 @@ public class WiredEffectBotTalkToHabbo extends InteractionWiredEffect {
|
|||||||
String[] data = wiredData.split(((char) 9) + "");
|
String[] data = wiredData.split(((char) 9) + "");
|
||||||
|
|
||||||
if (data.length == 4) {
|
if (data.length == 4) {
|
||||||
this.setDelay(Integer.valueOf(data[0]));
|
this.setDelay(Integer.parseInt(data[0]));
|
||||||
this.mode = data[1].equalsIgnoreCase("1") ? 1 : 0;
|
this.mode = data[1].equalsIgnoreCase("1") ? 1 : 0;
|
||||||
this.botName = data[2];
|
this.botName = data[2];
|
||||||
this.message = data[3];
|
this.message = data[3];
|
||||||
|
@ -220,14 +220,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);
|
||||||
|
@ -171,14 +171,14 @@ public class WiredEffectBotWalkToFurni 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);
|
||||||
|
@ -21,7 +21,7 @@ public class WiredEffectGiveEffect extends WiredEffectWhisper {
|
|||||||
int effectId;
|
int effectId;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
effectId = Integer.valueOf(this.message);
|
effectId = Integer.parseInt(this.message);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -20,7 +20,7 @@ public class WiredEffectGiveHandItem extends WiredEffectWhisper {
|
|||||||
@Override
|
@Override
|
||||||
public boolean execute(RoomUnit roomUnit, Room room, Object[] stuff) {
|
public boolean execute(RoomUnit roomUnit, Room room, Object[] stuff) {
|
||||||
try {
|
try {
|
||||||
int itemId = Integer.valueOf(this.message);
|
int itemId = Integer.parseInt(this.message);
|
||||||
|
|
||||||
Habbo habbo = room.getHabbo(roomUnit);
|
Habbo habbo = room.getHabbo(roomUnit);
|
||||||
|
|
||||||
|
@ -117,10 +117,10 @@ public class WiredEffectGiveHotelviewHofPoints extends InteractionWiredEffect {
|
|||||||
this.amount = 0;
|
this.amount = 0;
|
||||||
|
|
||||||
if (wiredData.split("\t").length >= 2) {
|
if (wiredData.split("\t").length >= 2) {
|
||||||
super.setDelay(Integer.valueOf(wiredData.split("\t")[0]));
|
super.setDelay(Integer.parseInt(wiredData.split("\t")[0]));
|
||||||
|
|
||||||
try {
|
try {
|
||||||
this.amount = Integer.valueOf(this.getWiredData().split("\t")[1]);
|
this.amount = Integer.parseInt(this.getWiredData().split("\t")[1]);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -117,10 +117,10 @@ public class WiredEffectGiveRespect extends InteractionWiredEffect {
|
|||||||
this.respects = 0;
|
this.respects = 0;
|
||||||
|
|
||||||
if (data.length >= 2) {
|
if (data.length >= 2) {
|
||||||
super.setDelay(Integer.valueOf(data[0]));
|
super.setDelay(Integer.parseInt(data[0]));
|
||||||
|
|
||||||
try {
|
try {
|
||||||
this.respects = Integer.valueOf(data[1]);
|
this.respects = Integer.parseInt(data[1]);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -81,12 +81,12 @@ public class WiredEffectGiveReward extends InteractionWiredEffect {
|
|||||||
else {
|
else {
|
||||||
String[] data = wiredData.split(":");
|
String[] data = wiredData.split(":");
|
||||||
if (data.length > 0) {
|
if (data.length > 0) {
|
||||||
this.limit = Integer.valueOf(data[0]);
|
this.limit = Integer.parseInt(data[0]);
|
||||||
this.given = Integer.valueOf(data[1]);
|
this.given = Integer.parseInt(data[1]);
|
||||||
this.rewardTime = Integer.valueOf(data[2]);
|
this.rewardTime = Integer.parseInt(data[2]);
|
||||||
this.uniqueRewards = data[3].equals("1");
|
this.uniqueRewards = data[3].equals("1");
|
||||||
this.limitationInterval = Integer.valueOf(data[4]);
|
this.limitationInterval = Integer.parseInt(data[4]);
|
||||||
this.setDelay(Integer.valueOf(data[5]));
|
this.setDelay(Integer.parseInt(data[5]));
|
||||||
|
|
||||||
if (data.length > 6) {
|
if (data.length > 6) {
|
||||||
if (!data[6].equalsIgnoreCase("\t")) {
|
if (!data[6].equalsIgnoreCase("\t")) {
|
||||||
@ -197,7 +197,7 @@ public class WiredEffectGiveReward extends InteractionWiredEffect {
|
|||||||
|
|
||||||
if (d.length == 3) {
|
if (d.length == 3) {
|
||||||
if (!(d[1].contains(":") || d[1].contains(";"))) {
|
if (!(d[1].contains(":") || d[1].contains(";"))) {
|
||||||
this.rewardItems.add(new WiredGiveRewardItem(i, d[0].equalsIgnoreCase("0"), d[1], Integer.valueOf(d[2])));
|
this.rewardItems.add(new WiredGiveRewardItem(i, d[0].equalsIgnoreCase("0"), d[1], Integer.parseInt(d[2])));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -116,9 +116,9 @@ public class WiredEffectGiveScore extends InteractionWiredEffect {
|
|||||||
String[] data = wiredData.split(";");
|
String[] data = wiredData.split(";");
|
||||||
|
|
||||||
if (data.length == 3) {
|
if (data.length == 3) {
|
||||||
this.score = Integer.valueOf(data[0]);
|
this.score = Integer.parseInt(data[0]);
|
||||||
this.count = Integer.valueOf(data[1]);
|
this.count = Integer.parseInt(data[1]);
|
||||||
this.setDelay(Integer.valueOf(data[2]));
|
this.setDelay(Integer.parseInt(data[2]));
|
||||||
}
|
}
|
||||||
|
|
||||||
this.needsUpdate(true);
|
this.needsUpdate(true);
|
||||||
|
@ -79,10 +79,10 @@ public class WiredEffectGiveScoreToTeam extends InteractionWiredEffect {
|
|||||||
String[] data = set.getString("wired_data").split(";");
|
String[] data = set.getString("wired_data").split(";");
|
||||||
|
|
||||||
if (data.length == 4) {
|
if (data.length == 4) {
|
||||||
this.points = Integer.valueOf(data[0]);
|
this.points = Integer.parseInt(data[0]);
|
||||||
this.count = Integer.valueOf(data[1]);
|
this.count = Integer.parseInt(data[1]);
|
||||||
this.teamColor = GameTeamColors.values()[Integer.valueOf(data[2])];
|
this.teamColor = GameTeamColors.values()[Integer.parseInt(data[2])];
|
||||||
this.setDelay(Integer.valueOf(data[3]));
|
this.setDelay(Integer.parseInt(data[3]));
|
||||||
}
|
}
|
||||||
|
|
||||||
this.needsUpdate(true);
|
this.needsUpdate(true);
|
||||||
|
@ -78,10 +78,10 @@ public class WiredEffectJoinTeam extends InteractionWiredEffect {
|
|||||||
String[] data = set.getString("wired_data").split("\t");
|
String[] data = set.getString("wired_data").split("\t");
|
||||||
|
|
||||||
if (data.length >= 1) {
|
if (data.length >= 1) {
|
||||||
this.setDelay(Integer.valueOf(data[0]));
|
this.setDelay(Integer.parseInt(data[0]));
|
||||||
|
|
||||||
if (data.length >= 2) {
|
if (data.length >= 2) {
|
||||||
this.teamColor = GameTeamColors.values()[Integer.valueOf(data[1])];
|
this.teamColor = GameTeamColors.values()[Integer.parseInt(data[1])];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -89,7 +89,7 @@ public class WiredEffectKickHabbo extends InteractionWiredEffect {
|
|||||||
String[] data = set.getString("wired_data").split("\t");
|
String[] data = set.getString("wired_data").split("\t");
|
||||||
|
|
||||||
if (data.length >= 1) {
|
if (data.length >= 1) {
|
||||||
this.setDelay(Integer.valueOf(data[0]));
|
this.setDelay(Integer.parseInt(data[0]));
|
||||||
|
|
||||||
if (data.length >= 2) {
|
if (data.length >= 2) {
|
||||||
this.message = data[1];
|
this.message = data[1];
|
||||||
|
@ -69,7 +69,7 @@ public class WiredEffectLeaveTeam extends InteractionWiredEffect {
|
|||||||
this.setDelay(data.delay);
|
this.setDelay(data.delay);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
this.setDelay(Integer.valueOf(wiredData));
|
this.setDelay(Integer.parseInt(wiredData));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -104,8 +104,8 @@ public class WiredEffectMuteHabbo extends InteractionWiredEffect {
|
|||||||
|
|
||||||
if (data.length >= 3) {
|
if (data.length >= 3) {
|
||||||
try {
|
try {
|
||||||
this.setDelay(Integer.valueOf(data[0]));
|
this.setDelay(Integer.parseInt(data[0]));
|
||||||
this.length = Integer.valueOf(data[1]);
|
this.length = Integer.parseInt(data[1]);
|
||||||
this.message = data[2];
|
this.message = data[2];
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
}
|
}
|
||||||
|
@ -132,7 +132,7 @@ public class WiredEffectWhisper extends InteractionWiredEffect {
|
|||||||
this.message = "";
|
this.message = "";
|
||||||
|
|
||||||
if (wiredData.split("\t").length >= 2) {
|
if (wiredData.split("\t").length >= 2) {
|
||||||
super.setDelay(Integer.valueOf(wiredData.split("\t")[0]));
|
super.setDelay(Integer.parseInt(wiredData.split("\t")[0]));
|
||||||
this.message = wiredData.split("\t")[1];
|
this.message = wiredData.split("\t")[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -56,7 +56,7 @@ public class WiredTriggerRepeater extends InteractionWiredTrigger implements ICy
|
|||||||
this.repeatTime = data.repeatTime;
|
this.repeatTime = data.repeatTime;
|
||||||
} else {
|
} else {
|
||||||
if (wiredData.length() >= 1) {
|
if (wiredData.length() >= 1) {
|
||||||
this.repeatTime = (Integer.valueOf(wiredData));
|
this.repeatTime = (Integer.parseInt(wiredData));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -55,7 +55,7 @@ public class WiredTriggerRepeaterLong extends InteractionWiredTrigger implements
|
|||||||
this.repeatTime = data.repeatTime;
|
this.repeatTime = data.repeatTime;
|
||||||
} else {
|
} else {
|
||||||
if (wiredData.length() >= 1) {
|
if (wiredData.length() >= 1) {
|
||||||
this.repeatTime = (Integer.valueOf(wiredData));
|
this.repeatTime = (Integer.parseInt(wiredData));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@ public class ModToolManager {
|
|||||||
this.tickets = new THashMap<>();
|
this.tickets = new THashMap<>();
|
||||||
this.cfhCategories = new TIntObjectHashMap<>();
|
this.cfhCategories = new TIntObjectHashMap<>();
|
||||||
this.loadModTool();
|
this.loadModTool();
|
||||||
LOGGER.info("ModTool Manager -> Loaded! (" + (System.currentTimeMillis() - millis) + " MS)");
|
LOGGER.info("ModTool Manager -> Loaded! ({} MS)", System.currentTimeMillis() - millis);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void requestUserInfo(GameClient client, ClientMessage packet) {
|
public static void requestUserInfo(GameClient client, ClientMessage packet) {
|
||||||
|
@ -26,7 +26,7 @@ public class ModToolSanctions {
|
|||||||
this.sanctionLevelsHashmap = new THashMap<>();
|
this.sanctionLevelsHashmap = new THashMap<>();
|
||||||
this.loadModSanctions();
|
this.loadModSanctions();
|
||||||
|
|
||||||
LOGGER.info("Sanctions Manager -> Loaded! (" + (System.currentTimeMillis() - millis) + " MS)");
|
LOGGER.info("Sanctions Manager -> Loaded! ({} MS)", System.currentTimeMillis() - millis);
|
||||||
}
|
}
|
||||||
|
|
||||||
public synchronized void loadModSanctions() {
|
public synchronized void loadModSanctions() {
|
||||||
|
@ -33,7 +33,7 @@ public class WordFilter {
|
|||||||
public WordFilter() {
|
public WordFilter() {
|
||||||
long start = System.currentTimeMillis();
|
long start = System.currentTimeMillis();
|
||||||
this.reload();
|
this.reload();
|
||||||
LOGGER.info("WordFilter -> Loaded! (" + (System.currentTimeMillis() - start) + " MS)");
|
LOGGER.info("WordFilter -> Loaded! ({} MS)", System.currentTimeMillis() - start);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static String stripDiacritics(String str) {
|
private static String stripDiacritics(String str) {
|
||||||
|
@ -18,7 +18,7 @@ public class EventCategory {
|
|||||||
|
|
||||||
if (parts.length != 3) throw new Exception("A serialized event category should contain 3 fields");
|
if (parts.length != 3) throw new Exception("A serialized event category should contain 3 fields");
|
||||||
|
|
||||||
this.id = Integer.valueOf(parts[0]);
|
this.id = Integer.parseInt(parts[0]);
|
||||||
this.caption = parts[1];
|
this.caption = parts[1];
|
||||||
this.visible = parts[2].equalsIgnoreCase("true");
|
this.visible = parts[2].equalsIgnoreCase("true");
|
||||||
}
|
}
|
||||||
|
@ -38,7 +38,7 @@ public class NavigatorManager {
|
|||||||
this.filters.put(NavigatorUserFilter.name, new NavigatorUserFilter());
|
this.filters.put(NavigatorUserFilter.name, new NavigatorUserFilter());
|
||||||
this.filters.put(NavigatorFavoriteFilter.name, new NavigatorFavoriteFilter());
|
this.filters.put(NavigatorFavoriteFilter.name, new NavigatorFavoriteFilter());
|
||||||
|
|
||||||
LOGGER.info("Navigator Manager -> Loaded! (" + (System.currentTimeMillis() - millis) + " MS)");
|
LOGGER.info("Navigator Manager -> Loaded! ({} MS)", System.currentTimeMillis() - millis);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void loadNavigator() {
|
public void loadNavigator() {
|
||||||
|
@ -29,7 +29,7 @@ public class PermissionsManager {
|
|||||||
|
|
||||||
this.reload();
|
this.reload();
|
||||||
|
|
||||||
LOGGER.info("Permissions Manager -> Loaded! (" + (System.currentTimeMillis() - millis) + " MS)");
|
LOGGER.info("Permissions Manager -> Loaded! ({} MS)", System.currentTimeMillis() - millis);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void reload() {
|
public void reload() {
|
||||||
|
@ -83,7 +83,7 @@ public class PetManager {
|
|||||||
|
|
||||||
reloadPetData();
|
reloadPetData();
|
||||||
|
|
||||||
LOGGER.info("Pet Manager -> Loaded! (" + (System.currentTimeMillis() - millis) + " MS)");
|
LOGGER.info("Pet Manager -> Loaded! ({} MS)", System.currentTimeMillis() - millis);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int getLevel(int experience) {
|
public static int getLevel(int experience) {
|
||||||
@ -234,10 +234,10 @@ public class PetManager {
|
|||||||
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")));
|
||||||
} else {
|
} else {
|
||||||
LOGGER.error("Unknown pet vocal type " + set.getString("type"));
|
LOGGER.error("Unknown pet vocal type {}", set.getString("type"));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
LOGGER.error("Missing pet_actions table entry for pet id " + set.getInt("pet_id"));
|
LOGGER.error("Missing pet_actions table entry for pet id {}", set.getInt("pet_id"));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (!PetData.generalPetVocals.containsKey(PetVocalsType.valueOf(set.getString("type").toUpperCase())))
|
if (!PetData.generalPetVocals.containsKey(PetVocalsType.valueOf(set.getString("type").toUpperCase())))
|
||||||
@ -303,12 +303,12 @@ public class PetManager {
|
|||||||
|
|
||||||
public THashSet<PetRace> getBreeds(String petName) {
|
public THashSet<PetRace> getBreeds(String petName) {
|
||||||
if (!petName.startsWith("a0 pet")) {
|
if (!petName.startsWith("a0 pet")) {
|
||||||
LOGGER.error("Pet " + petName + " not found. Make sure it matches the pattern \"a0 pet<pet_id>\"!");
|
LOGGER.error("Pet {} not found. Make sure it matches the pattern \"a0 pet<pet_id>\"!", petName);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
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);
|
||||||
@ -349,7 +349,7 @@ public class PetManager {
|
|||||||
return this.petData.get(type);
|
return this.petData.get(type);
|
||||||
} else {
|
} else {
|
||||||
try (Connection connection = Emulator.getDatabase().getDataSource().getConnection()) {
|
try (Connection connection = Emulator.getDatabase().getDataSource().getConnection()) {
|
||||||
LOGGER.error("Missing petdata for type " + type + ". Adding this to the database...");
|
LOGGER.error("Missing petdata for type {}. Adding this to the database...", type);
|
||||||
try (PreparedStatement statement = connection.prepareStatement("INSERT INTO pet_actions (pet_type) VALUES (?)")) {
|
try (PreparedStatement statement = connection.prepareStatement("INSERT INTO pet_actions (pet_type) VALUES (?)")) {
|
||||||
statement.setInt(1, type);
|
statement.setInt(1, type);
|
||||||
statement.execute();
|
statement.execute();
|
||||||
@ -361,7 +361,7 @@ public class PetManager {
|
|||||||
if (set.next()) {
|
if (set.next()) {
|
||||||
PetData petData = new PetData(set);
|
PetData petData = new PetData(set);
|
||||||
this.petData.put(type, petData);
|
this.petData.put(type, petData);
|
||||||
LOGGER.error("Missing petdata for type " + type + " added to the database!");
|
LOGGER.error("Missing petdata for type {} added to the database!", type);
|
||||||
return petData;
|
return petData;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -392,17 +392,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()
|
||||||
|
@ -2254,7 +2254,7 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
|
|||||||
game = gameType.getDeclaredConstructor(Room.class).newInstance(this);
|
game = gameType.getDeclaredConstructor(Room.class).newInstance(this);
|
||||||
this.addGame(game);
|
this.addGame(game);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
LOGGER.error("Error getting game " + gameType.getName(), e);
|
LOGGER.error("Error getting game {}", gameType.getName(), e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4979,4 +4979,4 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
|
|||||||
THashSet<RoomUnit> roomUnits = getRoomUnits();
|
THashSet<RoomUnit> roomUnits = getRoomUnits();
|
||||||
return roomUnits.stream().filter(unit -> unit.getCurrentLocation() == tile).collect(Collectors.toSet());
|
return roomUnits.stream().filter(unit -> unit.getCurrentLocation() == tile).collect(Collectors.toSet());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -94,7 +94,7 @@ public class RoomManager {
|
|||||||
registerGameType(IceTagGame.class);
|
registerGameType(IceTagGame.class);
|
||||||
registerGameType(RollerskateGame.class);
|
registerGameType(RollerskateGame.class);
|
||||||
|
|
||||||
LOGGER.info("Room Manager -> Loaded! (" + (System.currentTimeMillis() - millis) + " MS)");
|
LOGGER.info("Room Manager -> Loaded! ({} MS)", System.currentTimeMillis() - millis);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void loadRoomModels() {
|
public void loadRoomModels() {
|
||||||
@ -1128,7 +1128,7 @@ public class RoomManager {
|
|||||||
|
|
||||||
for (Room room : this.activeRooms.values()) {
|
for (Room room : this.activeRooms.values()) {
|
||||||
for (String s : room.getTags().split(";")) {
|
for (String s : room.getTags().split(";")) {
|
||||||
if (s.toLowerCase().equals(tag.toLowerCase())) {
|
if (s.equalsIgnoreCase(tag)) {
|
||||||
rooms.add(room);
|
rooms.add(room);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user