Updated to 1.12 decompiled.

This commit is contained in:
capheus 2018-09-28 19:25:00 +00:00
parent 406beb9bc2
commit 2fb1143952
494 changed files with 3391 additions and 2960 deletions

View File

@ -5,7 +5,7 @@
## **To Get The Camera To Work Visit http://arcturus.wf and register.** ##
## **TUTORIAL FOR PLUGINS http://arcturus.wf/thread-2415.html** ##
# **DO NOT EDIT THE SOURCE. USE THE PLUGIN API.** #
## Current Stable Version: 1.11.0 ##
## Current Stable Version: 1.12.0 ##
Arcturus Morningstar is a Habbo emulator written in Java aiming to be an exact clone of the offical server, based on Arcturus Emulator by TheGeneral.
Targeting PRODUCTION-201611291003-338511768

26
pom.xml
View File

@ -6,13 +6,28 @@
<groupId>com.eu.habbo</groupId>
<artifactId>Habbo</artifactId>
<version>1.11.0</version>
<version>1.12.0</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<additionalparam>-Xdoclint:none</additionalparam>
</properties>
<profiles>
<profile>
<id>java8-doclint-disabled</id>
<activation>
<jdk>[1.8,)</jdk>
</activation>
<properties>
<javadoc.opts>-Xdoclint:none</javadoc.opts>
</properties>
</profile>
</profiles>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
@ -48,6 +63,15 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.0.0</version>
<configuration>
<additionalOptions><additionalOption>-Xdoclint:none</additionalOption></additionalOptions>
</configuration>
</plugin>
</plugins>
</build>

View File

@ -0,0 +1,41 @@
#DATABASE UPDATE: 1.11.0 -> 1.12.0
#Texts update
INSERT INTO `emulator_texts` (`key` ,`value`) VALUES
('scripter.warning.chat.length', '%username% tried to send a room chat message with length %length% while the maximum length is 100 characters.');
#Update catalog_pages table.
ALTER TABLE `catalog_pages` CHANGE `page_headline` `page_headline` VARCHAR(1024) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '', CHANGE `page_teaser` `page_teaser` VARCHAR(64) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '', CHANGE `page_special` `page_special` VARCHAR(2048) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '', CHANGE `page_text1` `page_text1` VARCHAR(2048) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '', CHANGE `page_text2` `page_text2` VARCHAR(1024) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '', CHANGE `page_text_details` `page_text_details` VARCHAR(64) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '', CHANGE `page_text_teaser` `page_text_teaser` VARCHAR(64) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '';
#Configuration Update
INSERT INTO `emulator_settings` (`key`, `value`) VALUES ('hotel.room.nooblobby', '3'); #Defines the noob lobby for NUX
INSERT INTO `emulator_settings` (`key`, `value`) VALUES ('hotel.floorplan.max.widthlength', '64'); #Maximum x/y size for the floorplan editor.
INSERT INTO `emulator_settings` (`key`, `value`) VALUES ('hotel.floorplan.max.totalarea', '4096'); #Maximum total tiles for the floor plan editor.
ALTER TABLE `bots` CHANGE `chat_lines` `chat_lines` VARCHAR(5112) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '';
UPDATE bots SET chat_lines = '' WHERE chat_lines LIKE 'Default Message!%';
INSERT INTO `emulator_settings` (`key`, `value`) VALUES ('hotel.bot.max.chatlength', '120');
INSERT INTO `emulator_settings` (`key`, `value`) VALUES ('hotel.bot.max.namelength', '15');
INSERT INTO `emulator_settings` (`key`, `value`) VALUES ('hotel.bot.max.chatdelay', '604800');
INSERT INTO `emulator_settings` (`key`, `value`) VALUES ('hotel.chat.max.length', '100');
UPDATE items_base SET interaction_type = 'tent' WHERE item_name LIKE '%tent%';
INSERT INTO `emulator_texts` (`key`, `value`) VALUES ('commands.keys.cmd_invisible', 'invisible;hideme'), ('commands.description.cmd_invisible', ':invisible');
INSERT INTO `emulator_texts` (`key`, `value`) VALUES ('commands.succes.cmd_invisible.updated', 'You are now invisible. Reload the room to reset.');
ALTER TABLE `permissions` ADD `cmd_invisible` ENUM('0','1','2') NOT NULL DEFAULT '0' AFTER `cmd_hal`;
ALTER TABLE `permissions` ADD `acc_can_stalk` ENUM('0','1') NOT NULL DEFAULT '0' AFTER `cmd_ha`;
INSERT INTO `emulator_texts` (`key`, `value`) VALUES
('commands.keys.cmd_hidewired', 'hidewired;hidemywired;wiredbegone'),
('commands.succes.cmd_hidewired.hidden', 'Wired is now hidden.'),
('commands.succes.cmd_hidewired.shown', 'Wired is now shown.'),
('commands.errors.cmd_hidewired.permission', 'You don\'t have permission to hide wireds in this room!');
ALTER TABLE `permissions` ADD `cmd_hidewired` ENUM('0','1','2') NOT NULL DEFAULT '2' AFTER `cmd_happyhour`;
ALTER TABLE `rooms` ADD `hidewired` ENUM('0','1') NOT NULL DEFAULT '0' AFTER `jukebox_active`;
UPDATE `emulator_texts` SET `value` = ':masspoints <amount> [type] ' WHERE `emulator_texts`.`key` = 'commands.description.cmd_masspoints';
#END DATABASE UPDATE: 1.11.0 -> 1.12.0

View File

View File

@ -1,6 +1,9 @@
package com.eu.habbo;
import com.eu.habbo.core.*;
import com.eu.habbo.core.CleanerThread;
import com.eu.habbo.core.ConfigurationManager;
import com.eu.habbo.core.Logging;
import com.eu.habbo.core.TextsManager;
import com.eu.habbo.core.consolecommands.ConsoleCommand;
import com.eu.habbo.database.Database;
import com.eu.habbo.habbohotel.GameEnvironment;
@ -16,8 +19,6 @@ import com.eu.habbo.plugin.events.emulator.EmulatorStoppedEvent;
import com.eu.habbo.threading.ThreadPooling;
import com.eu.habbo.threading.runnables.CameraClientAutoReconnect;
import com.eu.habbo.util.imager.badges.BadgeImager;
import io.netty.util.internal.logging.InternalLoggerFactory;
import io.netty.util.internal.logging.Slf4JLoggerFactory;
import java.io.BufferedReader;
import java.io.InputStreamReader;
@ -25,7 +26,6 @@ import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Random;
import java.util.regex.Pattern;
public final class Emulator
{
@ -33,7 +33,7 @@ public final class Emulator
public final static int MAJOR = 1;
public final static int MINOR = 11;
public final static int MINOR = 12;
public final static int BUILD = 0;
@ -154,7 +154,7 @@ public final class Emulator
if (Emulator.getConfig().getValue("username").isEmpty())
{
Emulator.getLogging().logErrorLine("No account has been found in config.ini Please create an account on Arcturus.wf and edit the config.ini in order to maximize usage of Arcturus! http://arcturus.wf");
Emulator.getLogging().logErrorLine("No account has been found in config.ini Please create an account on Arcturus.pw and edit the config.ini in order to maximize usage of Arcturus! http://arcturus.wf");
}
Emulator.getThreading().run(new Runnable()

View File

@ -1,7 +1,6 @@
package com.eu.habbo.core;
import com.eu.habbo.Emulator;
import com.eu.habbo.plugin.PluginManager;
import com.eu.habbo.plugin.events.emulator.EmulatorConfigUpdatedEvent;
import java.io.File;
@ -9,7 +8,6 @@ import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.sql.*;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;

View File

@ -3,10 +3,11 @@ package com.eu.habbo.core;
import com.eu.habbo.Emulator;
import com.eu.habbo.util.callback.HTTPPostError;
import gnu.trove.set.hash.THashSet;
import sun.rmi.runtime.Log;
import java.io.*;
import java.nio.file.Files;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
@ -60,10 +61,10 @@ public class Logging
public static final String ANSI_WHITE = "\u001B[37m";
private final THashSet<Loggable> errorLogs = new THashSet<Loggable>();
private final THashSet<Loggable> errorLogs = new THashSet<>();
private final THashSet<Loggable> commandLogs = new THashSet<Loggable>();
private final THashSet<Loggable> commandLogs = new THashSet<>();
public Logging()
{

View File

@ -3,8 +3,6 @@ package com.eu.habbo.core;
import com.eu.habbo.Emulator;
import java.sql.*;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;
public class TextsManager

View File

@ -1,12 +1,11 @@
package com.eu.habbo.core.consolecommands;
import gnu.trove.map.hash.THashMap;
import gnu.trove.set.hash.THashSet;
public abstract class ConsoleCommand
{
public static THashMap<String, ConsoleCommand> commands = new THashMap<String, ConsoleCommand>();
public static THashMap<String, ConsoleCommand> commands = new THashMap<>();
public final String key;

View File

@ -2,7 +2,7 @@ package com.eu.habbo.core.consolecommands;
import com.eu.habbo.Emulator;
import com.eu.habbo.messages.PacketManager;
import com.eu.habbo.habbohotel.users.Habbo;
public class ConsoleTestCommand extends ConsoleCommand
{
@ -16,8 +16,11 @@ public class ConsoleTestCommand extends ConsoleCommand
{
System.out.println("This is a test command for live debugging.");
PacketManager.DEBUG_SHOW_PACKETS = true;
Emulator.getConfig().update("debug.show.packets", "1");
//AchievementManager.progressAchievement(4, Emulator.getGameEnvironment().getAchievementManager().getAchievement("AllTimeHotelPresence"), 30);
Habbo habbo = Emulator.getGameEnvironment().getHabboManager().getHabbo(1);
habbo.getHabboInfo().getMachineID();
}
}

View File

@ -4,10 +4,6 @@ import com.eu.habbo.Emulator;
import com.eu.habbo.core.ConfigurationManager;
import com.zaxxer.hikari.HikariDataSource;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.sql.Statement;
public class Database
{

View File

@ -1,6 +1,5 @@
package com.eu.habbo.database;
import com.eu.habbo.Emulator;
import com.eu.habbo.core.ConfigurationManager;
import com.eu.habbo.core.Logging;
import com.zaxxer.hikari.HikariConfig;
@ -8,8 +7,6 @@ import com.zaxxer.hikari.HikariDataSource;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.PrintWriter;
class DatabasePool
{
private final Logger log = LoggerFactory.getLogger(DatabasePool.class);

View File

@ -22,7 +22,7 @@ public class Achievement
public Achievement(ResultSet set) throws SQLException
{
levels = new THashMap<Integer, AchievementLevel>();
levels = new THashMap<>();
id = set.getInt("id");
this.name = set.getString("name");
@ -44,28 +44,24 @@ public class Achievement
public AchievementLevel getLevelForProgress(int progress)
{
AchievementLevel l = null;
for(AchievementLevel level : this.levels.values())
if (progress > 0)
{
if (l == null && level.level == 1)
for (AchievementLevel level : this.levels.values())
{
l = level;
}
if (progress >= level.progress)
{
if (l != null)
if (progress >= level.progress)
{
if (l.level > level.level)
if (l != null)
{
continue;
if (l.level > level.level)
{
continue;
}
}
}
l = level;
l = level;
}
}
}
return l;
}
@ -82,4 +78,9 @@ public class Achievement
return null;
}
public AchievementLevel firstLevel()
{
return this.levels.get(1);
}
}

View File

@ -82,7 +82,7 @@ public class AchievementManager
if (!this.talentTrackLevels.containsKey(level.type))
{
this.talentTrackLevels.put(level.type, new LinkedHashMap<Integer, TalentTrackLevel>());
this.talentTrackLevels.put(level.type, new LinkedHashMap<>());
}
this.talentTrackLevels.get(level.type).put(level.level, level);
@ -186,11 +186,13 @@ public class AchievementManager
int currentProgress = habbo.getHabboStats().getAchievementProgress(achievement);
boolean created = false;
if(currentProgress == -1)
{
currentProgress = 0;
createUserEntry(habbo, achievement);
habbo.getHabboStats().setProgress(achievement, 0);
created = true;
}
if(Emulator.getPluginManager().isRegistered(UserAchievementProgressEvent.class, true))
@ -205,16 +207,18 @@ public class AchievementManager
AchievementLevel oldLevel = achievement.getLevelForProgress(currentProgress);
if(oldLevel == null)
return;
{
oldLevel = achievement.firstLevel();
}
if(oldLevel.level == achievement.levels.size() && currentProgress == oldLevel.progress) //Maximum achievement gotten.
if(oldLevel.level == achievement.levels.size() && currentProgress >= oldLevel.progress) //Maximum achievement gotten.
return;
habbo.getHabboStats().setProgress(achievement, currentProgress + amount);
AchievementLevel newLevel = achievement.getLevelForProgress(currentProgress + amount);
if(oldLevel.level == newLevel.level && newLevel.level < achievement.levels.size())
if(newLevel == null || (oldLevel.level == newLevel.level && newLevel.level < achievement.levels.size()))
{
habbo.getClient().sendResponse(new AchievementProgressComposer(habbo, achievement));
}

View File

@ -2,9 +2,7 @@ package com.eu.habbo.habbohotel.achievements;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.items.Item;
import gnu.trove.map.TIntIntMap;
import gnu.trove.map.TObjectIntMap;
import gnu.trove.map.hash.TIntIntHashMap;
import gnu.trove.map.hash.TObjectIntHashMap;
import gnu.trove.set.hash.THashSet;
@ -35,8 +33,8 @@ public class TalentTrackLevel
{
this.type = TalentTrackType.valueOf(set.getString("type").toUpperCase());
this.level = set.getInt("level");
this.achievements = new TObjectIntHashMap<Achievement>();
this.items = new THashSet<Item>();
this.achievements = new TObjectIntHashMap<>();
this.items = new THashSet<>();
String[] achievements = set.getString("achievement_ids").split(",");
String[] achievementLevels = set.getString("achievement_levels").split(",");

View File

@ -22,6 +22,7 @@ import java.util.Arrays;
public class Bot implements Runnable
{
public static final String NO_CHAT_SET = "${bot.skill.chatter.configuration.text.placeholder}";
private int id;
@ -91,7 +92,7 @@ public class Bot implements Runnable
this.chatAuto = false;
this.chatRandom = false;
this.chatDelay = 1000;
this.chatLines = new ArrayList<String>();
this.chatLines = new ArrayList<>();
this.type = "generic_bot";
this.room = null;
}
@ -108,7 +109,7 @@ public class Bot implements Runnable
this.chatAuto = set.getString("chat_auto").equals("1");
this.chatRandom = set.getString("chat_random").equals("1");
this.chatDelay = set.getShort("chat_delay");
this.chatLines = new ArrayList<String>(Arrays.asList(set.getString("chat_lines").split("\r")));
this.chatLines = new ArrayList<>(Arrays.asList(set.getString("chat_lines").split("\r")));
this.type = set.getString("type");
this.effect = set.getInt("effect");
this.room = null;
@ -130,7 +131,7 @@ public class Bot implements Runnable
this.chatRandom = false;
this.chatDelay = 10;
this.chatTimeOut = Emulator.getIntUnixTimestamp() + this.chatDelay;
this.chatLines = new ArrayList<String>(Arrays.asList(new String[] {"Default Message :D"}));
this.chatLines = new ArrayList<>(Arrays.asList(new String[] {"Default Message :D"}));
this.type = bot.getType();
this.effect = bot.getEffect();
this.room = null;
@ -220,12 +221,19 @@ public class Bot implements Runnable
if(this.room != null)
{
this.lastChatIndex = (this.chatRandom ? (short)Emulator.getRandom().nextInt(this.chatLines.size()) : (this.lastChatIndex == (this.chatLines.size() - 1) ? 0 : this.lastChatIndex++));
if (this.lastChatIndex >= this.chatLines.size())
{
this.lastChatIndex = 0;
}
this.talk(this.chatLines.get(this.lastChatIndex)
.replace("%owner%", this.room.getOwnerName())
.replace("%item_count%", this.room.itemCount() + "")
.replace("%name%", this.name)
.replace("%roomname%", this.room.getName())
.replace("%user_count%", this.room.getUserCount() + ""));
this.chatTimeOut = Emulator.getIntUnixTimestamp() + this.chatDelay;
}
}
@ -438,6 +446,12 @@ public class Bot implements Runnable
}
public boolean hasChat()
{
return !this.chatLines.isEmpty();
}
public void setChatRandom(boolean chatRandom)
{
this.chatRandom = chatRandom;
@ -453,8 +467,9 @@ public class Bot implements Runnable
public void setChatDelay(short chatDelay)
{
this.chatDelay = chatDelay;
this.chatDelay = (short)Math.min(Math.max(chatDelay, BotManager.MINIMUM_CHAT_SPEED), BotManager.MAXIMUM_CHAT_SPEED);
this.needsUpdate = true;
this.chatTimeOut = Emulator.getIntUnixTimestamp() + this.chatDelay;
}

View File

@ -21,9 +21,19 @@ import java.util.Map;
public class BotManager
{
//Configuration. Loaded from database & updated accordingly.
public static int MINIMUM_CHAT_SPEED = 7;
final private static THashMap<String, Class<? extends Bot>> botDefenitions = new THashMap<String, Class<? extends Bot>>();
public static int MAXIMUM_CHAT_SPEED = 604800;
public static int MAXIMUM_CHAT_LENGTH = 120;
public static int MAXIMUM_NAME_LENGTH = 15;
final private static THashMap<String, Class<? extends Bot>> botDefenitions = new THashMap<>();
public BotManager()

View File

@ -9,14 +9,17 @@ import com.eu.habbo.threading.runnables.RoomUnitWalkToRoomUnit;
import gnu.trove.map.hash.THashMap;
import gnu.trove.set.hash.THashSet;
import java.sql.*;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
public class ButlerBot extends Bot
{
public static THashMap<THashSet<String>, Integer> serveItems = new THashMap<THashSet<String>, Integer>();
public static THashMap<THashSet<String>, Integer> serveItems = new THashMap<>();
public ButlerBot(ResultSet set) throws SQLException
@ -32,7 +35,7 @@ public class ButlerBot extends Bot
public static void initialise()
{
if(serveItems == null)
serveItems = new THashMap<THashSet<String>, Integer>();
serveItems = new THashMap<>();
serveItems.clear();
@ -41,7 +44,7 @@ public class ButlerBot extends Bot
while (set.next())
{
String[] keys = set.getString("keys").split(";");
THashSet<String> ks = new THashSet<String>();
THashSet<String> ks = new THashSet<>();
for(String key : keys)
{
ks.add(key);
@ -86,7 +89,7 @@ public class ButlerBot extends Bot
final String key = s;
final Bot b = this;
List<Runnable> tasks = new ArrayList<Runnable>();
List<Runnable> tasks = new ArrayList<>();
tasks.add(new RoomUnitGiveHanditem(serveEvent.habbo.getRoomUnit(), serveEvent.habbo.getHabboInfo().getCurrentRoom(), serveEvent.itemId));
tasks.add(new RoomUnitGiveHanditem(this.getRoomUnit(), serveEvent.habbo.getHabboInfo().getCurrentRoom(), 0));

View File

@ -15,7 +15,7 @@ public class VisitorBot extends Bot
{
private static SimpleDateFormat formatDate;
private boolean showedLog = false;
private THashSet<ModToolRoomVisit> visits = new THashSet<ModToolRoomVisit>();
private THashSet<ModToolRoomVisit> visits = new THashSet<>();
public VisitorBot(ResultSet set) throws SQLException
{

View File

@ -242,7 +242,17 @@ public class CatalogItem implements ISerialize, Runnable, Comparable<CatalogItem
itemId = itemId.split(":")[0];
}
int identifier = Integer.parseInt(itemId);
int identifier = 0;
try
{
identifier = Integer.parseInt(itemId);
}
catch (Exception e)
{
Emulator.getLogging().logStart("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");
continue;
}
if (identifier > 0)
{
Item item = Emulator.getGameEnvironment().getItemManager().getItem(identifier);
@ -431,29 +441,32 @@ public class CatalogItem implements ISerialize, Runnable, Comparable<CatalogItem
}
private static boolean haveOffer(CatalogItem item)
public static boolean haveOffer(CatalogItem item)
{
if(!item.haveOffer)
return false;
if(item.getAmount() != 1)
return false;
if(item.isLimited())
return false;
if (item.bundle.size() > 1)
return false;
if(item.getName().toLowerCase().startsWith("cf_") || item.getName().toLowerCase().startsWith("cfc_"))
return false;
for(Item i : item.getBaseItems())
{
if(i.getName().toLowerCase().startsWith("cf_") || i.getName().toLowerCase().startsWith("cfc_") || i.getName().toLowerCase().startsWith("rentable_bot"))
return false;
}
if(item.getName().toLowerCase().startsWith("cf_") || item.getName().toLowerCase().startsWith("cfc_"))
return false;
if(item.isLimited())
return false;
if(item.getName().toLowerCase().startsWith("rentable_bot_"))
return false;
if(item.getAmount() != 1)
return false;
return item.bundle.size() <= 1;
return true;
}
}

View File

@ -29,6 +29,10 @@ public class CatalogLimitedConfiguration implements Runnable
synchronized (this.limitedNumbers)
{
int num = this.limitedNumbers.pop();
if(this.limitedNumbers.isEmpty())
{
Emulator.getGameEnvironment().getCatalogManager().moveCatalogItem(Emulator.getGameEnvironment().getCatalogManager().getCatalogItem(itemId), Emulator.getConfig().getInt("catalog.ltd.page.soldout"));
}
return num;
}
}

View File

@ -15,7 +15,6 @@ import com.eu.habbo.habbohotel.users.HabboBadge;
import com.eu.habbo.habbohotel.users.HabboGender;
import com.eu.habbo.habbohotel.users.HabboItem;
import com.eu.habbo.messages.outgoing.catalog.*;
import com.eu.habbo.messages.outgoing.events.calendar.AdventCalendarDataComposer;
import com.eu.habbo.messages.outgoing.events.calendar.AdventCalendarProductComposer;
import com.eu.habbo.messages.outgoing.generic.alerts.BubbleAlertComposer;
import com.eu.habbo.messages.outgoing.generic.alerts.BubbleAlertKeys;
@ -24,7 +23,6 @@ import com.eu.habbo.messages.outgoing.inventory.AddBotComposer;
import com.eu.habbo.messages.outgoing.inventory.AddHabboItemComposer;
import com.eu.habbo.messages.outgoing.inventory.AddPetComposer;
import com.eu.habbo.messages.outgoing.inventory.InventoryRefreshComposer;
import com.eu.habbo.messages.outgoing.unknown.NuxAlertComposer;
import com.eu.habbo.messages.outgoing.users.AddUserBadgeComposer;
import com.eu.habbo.messages.outgoing.users.UserCreditsComposer;
import com.eu.habbo.messages.outgoing.users.UserPointsComposer;
@ -140,17 +138,17 @@ public class CatalogManager
public CatalogManager()
{
long millis = System.currentTimeMillis();
this.catalogPages = TCollections.synchronizedMap(new TIntObjectHashMap<CatalogPage>());
this.catalogFeaturedPages = new TIntObjectHashMap<CatalogFeaturedPage>();
this.prizes = new THashMap<Integer, THashSet<Item>>();
this.giftWrappers = new THashMap<Integer, Integer>();
this.giftFurnis = new THashMap<Integer, Integer>();
this.clubItems = new THashSet<CatalogItem>();
this.catalogPages = TCollections.synchronizedMap(new TIntObjectHashMap<>());
this.catalogFeaturedPages = new TIntObjectHashMap<>();
this.prizes = new THashMap<>();
this.giftWrappers = new THashMap<>();
this.giftFurnis = new THashMap<>();
this.clubItems = new THashSet<>();
this.clubOffers = new THashMap<>();
this.clothing = new THashMap<Integer, ClothItem>();
this.clothing = new THashMap<>();
this.offerDefs = new TIntIntHashMap();
this.vouchers = new ArrayList<Voucher>();
this.limitedNumbers = new THashMap<Integer, CatalogLimitedConfiguration>();
this.vouchers = new ArrayList<>();
this.limitedNumbers = new THashMap<>();
this.calendarRewards = new THashMap<>();
this.initialize();
@ -188,7 +186,7 @@ public class CatalogManager
{
this.limitedNumbers.clear();
THashMap<Integer, LinkedList<Integer>> limiteds = new THashMap<Integer, LinkedList<Integer>>();
THashMap<Integer, LinkedList<Integer>> limiteds = new THashMap<>();
TIntIntHashMap totals = new TIntIntHashMap();
try (Connection connection = Emulator.getDatabase().getDataSource().getConnection(); PreparedStatement statement = connection.prepareStatement("SELECT * FROM catalog_items_limited"))
{
@ -198,7 +196,7 @@ public class CatalogManager
{
if (!limiteds.containsKey(set.getInt("catalog_item_id")))
{
limiteds.put(set.getInt("catalog_item_id"), new LinkedList<Integer>());
limiteds.put(set.getInt("catalog_item_id"), new LinkedList<>());
}
totals.adjustOrPutValue(set.getInt("catalog_item_id"), 1, 1);
@ -226,7 +224,7 @@ public class CatalogManager
{
this.catalogPages.clear();
final THashMap<Integer, CatalogPage> pages = new THashMap<Integer, CatalogPage>();
final THashMap<Integer, CatalogPage> pages = new THashMap<>();
pages.put(-1, new CatalogRootLayout(null));
ResultSet set = null;
try (Connection connection = Emulator.getDatabase().getDataSource().getConnection(); PreparedStatement statement = connection.prepareStatement("SELECT * FROM catalog_pages ORDER BY parent_id, id"))
@ -354,7 +352,7 @@ public class CatalogManager
{
page.addOfferId(item.getOfferId());
this.offerDefs.put(item.getOfferId(), page.getId());
this.offerDefs.put(item.getOfferId(), item.getId());
}
}
else
@ -438,7 +436,7 @@ public class CatalogManager
{
if (this.prizes.get(set.getInt("rarity")) == null)
{
this.prizes.put(set.getInt("rarity"), new THashSet<Item>());
this.prizes.put(set.getInt("rarity"), new THashSet<>());
}
this.prizes.get(set.getInt("rarity")).add(item);
@ -682,7 +680,7 @@ public class CatalogManager
public List<CatalogPage> getCatalogPages(int parentId, final Habbo habbo)
{
final List<CatalogPage> pages = new ArrayList<CatalogPage>();
final List<CatalogPage> pages = new ArrayList<>();
this.catalogPages.get(parentId).childPages.forEachValue(new TObjectProcedure<CatalogPage>()
{
@ -856,7 +854,7 @@ public class CatalogManager
if (limitedConfiguration == null)
{
limitedConfiguration = new CatalogLimitedConfiguration(item.getId(), new LinkedList<Integer>(), 0);
limitedConfiguration = new CatalogLimitedConfiguration(item.getId(), new LinkedList<>(), 0);
limitedConfiguration.generateNumbers(1, item.limitedStack);
this.limitedNumbers.put(item.getId(), limitedConfiguration);
}
@ -982,10 +980,10 @@ public class CatalogManager
int totalCredits = 0;
int totalPoints = 0;
THashSet<HabboItem> itemsList = new THashSet<HabboItem>();
THashSet<HabboItem> itemsList = new THashSet<>();
if(amount > 1 && !item.isHaveOffer())
if(amount > 1 && !CatalogItem.haveOffer(item))
{
String message = Emulator.getTexts().getValue("scripter.warning.catalog.amount").replace("%username%", habbo.getHabboInfo().getUsername()).replace("%itemname%", item.getName()).replace("%pagename%", page.getCaption());
Emulator.getGameEnvironment().getModToolManager().quickTicket(habbo.getClient().getHabbo(), "Scripter", message);
@ -1016,7 +1014,7 @@ public class CatalogManager
if(free ||
item.getPoints() <= habbo.getClient().getHabbo().getHabboInfo().getCurrencyAmount(item.getPointsType()) - totalPoints)
{
if (((i + 1) % 6 != 0 && item.isHaveOffer()) || !item.isHaveOffer())
if (((i + 1) % 6 != 0 && CatalogItem.haveOffer(item)) || !CatalogItem.haveOffer(item))
{
totalCredits += item.getCredits();
totalPoints += item.getPoints();
@ -1036,7 +1034,7 @@ public class CatalogManager
String type = item.getName().replace("rentable_bot_", "");
type = type.replace("bot_", "");
THashMap<String, String> data = new THashMap<String, String>();
THashMap<String, String> data = new THashMap<>();
for(String s : item.getExtradata().split(";"))
{
@ -1098,7 +1096,10 @@ public class CatalogManager
}
if(pet == null)
{
habbo.getClient().sendResponse(new AlertPurchaseFailedComposer(AlertPurchaseFailedComposer.SERVER_ERROR));
return;
}
habbo.getClient().getHabbo().getInventory().getPetsComponent().addPet(pet);
habbo.getClient().sendResponse(new AddPetComposer(pet));
@ -1130,7 +1131,7 @@ public class CatalogManager
extradata = "UMAD";
}
extradata = habbo.getClient().getHabbo().getHabboInfo().getUsername() + (char) 9 + Calendar.getInstance().get(Calendar.DAY_OF_MONTH) + "-" + (Calendar.getInstance().get(Calendar.MONTH) + 1) + "-" + Calendar.getInstance().get(Calendar.YEAR) + (char) 9 + extradata;
extradata = habbo.getClient().getHabbo().getHabboInfo().getUsername() + (char) 9 + Calendar.getInstance().get(Calendar.DAY_OF_MONTH) + "-" + (Calendar.getInstance().get(Calendar.MONTH) + 1) + "-" + Calendar.getInstance().get(Calendar.YEAR) + (char) 9 + Emulator.getGameEnvironment().getWordFilter().filter(extradata, habbo);
}
if (InteractionTeleport.class.isAssignableFrom(baseItem.getInteractionType().getType()))
@ -1255,7 +1256,7 @@ public class CatalogManager
Emulator.getThreading().run(badge);
habbo.getInventory().getBadgesComponent().addBadge(badge);
habbo.getClient().sendResponse(new AddUserBadgeComposer(badge));
THashMap<String, String> keys = new THashMap<String, String>();
THashMap<String, String> keys = new THashMap<>();
keys.put("display", "BUBBLE");
keys.put("image", "${image.library.url}album1584/" + badge.getCode() + ".gif");
keys.put("message", Emulator.getTexts().getValue("commands.generic.cmd_badge.received"));

View File

@ -12,7 +12,6 @@ import gnu.trove.map.hash.TIntObjectHashMap;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Collections;
public abstract class CatalogPage implements Comparable<CatalogPage>, ISerialize
{
@ -36,9 +35,9 @@ public abstract class CatalogPage implements Comparable<CatalogPage>, ISerialize
protected String textDetails;
protected String textTeaser;
protected TIntArrayList offerIds = new TIntArrayList();
protected THashMap<Integer, CatalogPage> childPages = new THashMap<Integer, CatalogPage>();;
private TIntObjectMap<CatalogItem> catalogItems = TCollections.synchronizedMap(new TIntObjectHashMap<CatalogItem>());
private ArrayList<Integer> included = new ArrayList<Integer>();
protected THashMap<Integer, CatalogPage> childPages = new THashMap<>();;
private TIntObjectMap<CatalogItem> catalogItems = TCollections.synchronizedMap(new TIntObjectHashMap<>());
private ArrayList<Integer> included = new ArrayList<>();
public CatalogPage(ResultSet set) throws SQLException
{
@ -76,6 +75,7 @@ public abstract class CatalogPage implements Comparable<CatalogPage>, ISerialize
catch (Exception e)
{
Emulator.getLogging().logErrorLine(e);
Emulator.getLogging().logErrorLine("Failed to parse includes column value of (" + id + ") for catalog page (" + this.id + ")");
}
}
}

View File

@ -4,8 +4,6 @@ package com.eu.habbo.habbohotel.catalog;
import com.eu.habbo.messages.ISerialize;
import com.eu.habbo.messages.ServerMessage;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.List;
public class TargetOffer implements ISerialize

View File

@ -42,21 +42,21 @@ public class FrontPageFeaturedLayout extends CatalogPage
public void serializeExtra(ServerMessage message)
{
message.appendInt(Emulator.getGameEnvironment().getCatalogManager().getCatalogFeaturedPages().size()); // count
message.appendInt(Emulator.getGameEnvironment().getCatalogManager().getCatalogFeaturedPages().size());
for (CatalogFeaturedPage page : Emulator.getGameEnvironment().getCatalogManager().getCatalogFeaturedPages().valueCollection())
{
page.serialize(message);
}
message.appendInt(1); //Position
message.appendString("NUOVO: Affare Stanza di Rilassamento"); // Text
message.appendString("catalogue/feature_cata_vert_oly16bundle4.png"); // Image
message.appendString("NUOVO: Affare Stanza di Rilassamento");
message.appendString("catalogue/feature_cata_vert_oly16bundle4.png");
message.appendInt(0); //Type
//0 : String //Page Name
//1 : Int //Page ID
//2 : String //Productdata
message.appendString(""); // page link?
message.appendInt(-1); // page id?
message.appendString("");
message.appendInt(-1);
message.appendInt(2);
message.appendString("Il RITORNO di Habburgers! (TUTTI furni nuovi)");

View File

@ -3,23 +3,16 @@ package com.eu.habbo.habbohotel.catalog.layouts;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.bots.Bot;
import com.eu.habbo.habbohotel.catalog.CatalogItem;
import com.eu.habbo.habbohotel.catalog.CatalogPage;
import com.eu.habbo.habbohotel.items.Item;
import com.eu.habbo.habbohotel.rooms.Room;
import com.eu.habbo.habbohotel.users.Habbo;
import com.eu.habbo.habbohotel.users.HabboItem;
import com.eu.habbo.messages.outgoing.catalog.AlertPurchaseFailedComposer;
import com.eu.habbo.messages.outgoing.catalog.AlertPurchaseUnavailableComposer;
import com.eu.habbo.messages.outgoing.generic.alerts.BubbleAlertComposer;
import com.eu.habbo.messages.outgoing.generic.alerts.BubbleAlertKeys;
import com.eu.habbo.messages.outgoing.generic.alerts.GenericAlertComposer;
import com.eu.habbo.messages.outgoing.navigator.CanCreateRoomComposer;
import com.eu.habbo.messages.outgoing.rooms.ForwardToRoomComposer;
import gnu.trove.map.TIntObjectMap;
import gnu.trove.map.hash.THashMap;
import gnu.trove.map.hash.TIntObjectHashMap;
import gnu.trove.procedure.TObjectProcedure;
import gnu.trove.set.hash.THashSet;
import java.sql.*;
import java.util.Map;
@ -86,7 +79,7 @@ public class RoomBundleLayout extends SingleBundle
{
item[0].getBundle().clear();
THashMap<Item, Integer> items = new THashMap<Item, Integer>();
THashMap<Item, Integer> items = new THashMap<>();
for(HabboItem i : this.room.getFloorItems())
{
@ -274,7 +267,7 @@ public class RoomBundleLayout extends SingleBundle
r.setFloorPaint(this.room.getFloorPaint());
r.setScore(0);
r.setNeedsUpdate(true);
THashMap<String, String> keys = new THashMap<String, String>();
THashMap<String, String> keys = new THashMap<>();
keys.put("ROOMNAME", r.getName());
keys.put("ROOMID", r.getId() + "");
keys.put("OWNER", r.getOwnerName());

View File

@ -36,7 +36,7 @@ public class MarketPlace
public static THashSet<MarketPlaceOffer> getOwnOffers(Habbo habbo)
{
THashSet<MarketPlaceOffer> offers = new THashSet<MarketPlaceOffer>();
THashSet<MarketPlaceOffer> offers = new THashSet<>();
try (Connection connection = Emulator.getDatabase().getDataSource().getConnection(); PreparedStatement statement = connection.prepareStatement("SELECT items_base.type AS type, items.item_id AS base_item_id, items.limited_data AS ltd_data, marketplace_items.* FROM marketplace_items INNER JOIN items ON marketplace_items.item_id = items.id INNER JOIN items_base ON items.item_id = items_base.id WHERE marketplace_items.user_id = ?"))
{
statement.setInt(1, habbo.getHabboInfo().getId());
@ -470,7 +470,7 @@ public class MarketPlace
{
int credits = 0;
THashSet<MarketPlaceOffer> offers = new THashSet<MarketPlaceOffer>();
THashSet<MarketPlaceOffer> offers = new THashSet<>();
offers.addAll(client.getHabbo().getInventory().getMarketplaceItems());
for(MarketPlaceOffer offer : offers)

View File

@ -44,7 +44,7 @@ public class AboutCommand extends Command
message += "\r" +
"<b>Thanks for using Arcturus. Report issues on the forums. http://arcturus.wf \r\r" +
"<b>Thanks for using Arcturus. Report issues on the forums. http://arcturus.pw \r\r" +
" - The General";
gameClient.sendResponse(new GenericAlertComposer(message));

View File

@ -2,11 +2,9 @@ package com.eu.habbo.habbohotel.commands;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.rooms.RoomChatMessage;
import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
import com.eu.habbo.habbohotel.users.Habbo;
import com.eu.habbo.messages.outgoing.generic.alerts.GenericAlertComposer;
import com.eu.habbo.messages.outgoing.rooms.users.RoomUserWhisperComposer;
public class AlertCommand extends Command {

View File

@ -3,6 +3,7 @@ package com.eu.habbo.habbohotel.commands;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.users.Habbo;
import java.sql.Connection;
import java.sql.PreparedStatement;

View File

@ -1,9 +1,7 @@
package com.eu.habbo.habbohotel.commands;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.rooms.RoomChatMessage;
import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
import com.eu.habbo.messages.outgoing.rooms.users.RoomUserWhisperComposer;
public class ArcturusCommand extends Command
{

View File

@ -2,13 +2,11 @@ package com.eu.habbo.habbohotel.commands;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.rooms.RoomChatMessage;
import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
import com.eu.habbo.habbohotel.users.Habbo;
import com.eu.habbo.habbohotel.users.HabboBadge;
import com.eu.habbo.messages.outgoing.generic.alerts.BubbleAlertComposer;
import com.eu.habbo.messages.outgoing.generic.alerts.BubbleAlertKeys;
import com.eu.habbo.messages.outgoing.rooms.users.RoomUserWhisperComposer;
import com.eu.habbo.messages.outgoing.users.AddUserBadgeComposer;
import gnu.trove.map.hash.THashMap;
@ -59,7 +57,7 @@ public class BadgeCommand extends Command
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.succes.cmd_badge.given").replace("%user%", params[1]).replace("%badge%", params[2]), RoomChatMessageBubbles.ALERT);
THashMap<String, String> keys = new THashMap<String, String>();
THashMap<String, String> keys = new THashMap<>();
keys.put("display", "BUBBLE");
keys.put("image", "${image.library.url}album1584/" + badge.getCode() + ".gif");
keys.put("message", Emulator.getTexts().getValue("commands.generic.cmd_badge.received"));

View File

@ -4,12 +4,10 @@ import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.modtool.ModToolBan;
import com.eu.habbo.habbohotel.modtool.ModToolBanType;
import com.eu.habbo.habbohotel.rooms.RoomChatMessage;
import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
import com.eu.habbo.habbohotel.users.Habbo;
import com.eu.habbo.habbohotel.users.HabboInfo;
import com.eu.habbo.habbohotel.users.HabboManager;
import com.eu.habbo.messages.outgoing.rooms.users.RoomUserWhisperComposer;
public class BanCommand extends Command
{
@ -91,16 +89,9 @@ public class BanCommand extends Command
}
}
ModToolBan ban = Emulator.getGameEnvironment().getModToolManager().ban(target.getId(), gameClient.getHabbo(), reason, banTime, ModToolBanType.ACCOUNT, -1).get(0);
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.succes.cmd_ban.ban_issued").replace("%user%", target.getUsername()).replace("%time%", ban.expireDate - Emulator.getIntUnixTimestamp() + "").replace("%reason%", ban.reason), RoomChatMessageBubbles.ALERT);
try
{
ModToolBan ban = Emulator.getGameEnvironment().getModToolManager().ban(target.getId(), gameClient.getHabbo(), reason, banTime, ModToolBanType.ACCOUNT, -1).get(0);
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.succes.cmd_ban.ban_issued").replace("%user%", target.getUsername()).replace("%time%", ban.expireDate - Emulator.getIntUnixTimestamp() + "").replace("%reason%", ban.reason), RoomChatMessageBubbles.ALERT);
}
catch (Exception e)
{
}
return true;
}
}

View File

@ -2,9 +2,7 @@ package com.eu.habbo.habbohotel.commands;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.rooms.RoomChatMessage;
import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
import com.eu.habbo.messages.outgoing.rooms.users.RoomUserWhisperComposer;
public class BlockAlertCommand extends Command
{

View File

@ -2,9 +2,7 @@ package com.eu.habbo.habbohotel.commands;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.rooms.RoomChatMessage;
import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
import com.eu.habbo.messages.outgoing.rooms.users.RoomUserWhisperComposer;
import com.eu.habbo.messages.outgoing.users.MeMenuSettingsComposer;
public class ChatTypeCommand extends Command

View File

@ -6,7 +6,6 @@ import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.permissions.Permission;
import com.eu.habbo.habbohotel.permissions.PermissionSetting;
import com.eu.habbo.habbohotel.pets.Pet;
import com.eu.habbo.habbohotel.pets.Pet;
import com.eu.habbo.habbohotel.pets.PetCommand;
import com.eu.habbo.habbohotel.pets.PetVocalsType;
import com.eu.habbo.habbohotel.rooms.Room;
@ -15,13 +14,12 @@ import com.eu.habbo.plugin.events.users.UserCommandEvent;
import com.eu.habbo.plugin.events.users.UserExecuteCommandEvent;
import gnu.trove.iterator.TIntObjectIterator;
import gnu.trove.map.hash.THashMap;
import gnu.trove.set.hash.THashSet;
import java.util.*;
public class CommandHandler
{
private final static THashMap<String, Command> commands = new THashMap<String, Command>(5);
private final static THashMap<String, Command> commands = new THashMap<>(5);
public CommandHandler()
{
@ -65,8 +63,10 @@ public class CommandHandler
addCommand(new HabnamCommand());
addCommand(new HandItemCommand());
addCommand(new HappyHourCommand());
addCommand(new HideWiredCommand());
addCommand(new HotelAlertCommand());
addCommand(new HotelAlertLinkCommand());
addCommand(new InvisibleCommand());
addCommand(new IPBanCommand());
addCommand(new LayCommand());
addCommand(new MachineBanCommand());
@ -265,7 +265,7 @@ public class CommandHandler
if (command.key.equalsIgnoreCase(s))
{
if (command.level <= pet.getLevel())
((Pet) pet).handleCommand(command, gameClient.getHabbo(), args);
pet.handleCommand(command, gameClient.getHabbo(), args);
else
pet.say(pet.getPetData().randomVocal(PetVocalsType.UNKNOWN_COMMAND));
@ -284,7 +284,7 @@ public class CommandHandler
public List<Command> getCommandsForRank(int rankId)
{
List<Command> allowedCommands = new ArrayList<Command>();
List<Command> allowedCommands = new ArrayList<>();
if (Emulator.getGameEnvironment().getPermissionsManager().rankExists(rankId))
{
THashMap<String, Permission> permissions = Emulator.getGameEnvironment().getPermissionsManager().getRank(rankId).getPermissions();

View File

@ -2,8 +2,6 @@ package com.eu.habbo.habbohotel.commands;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.messages.outgoing.generic.alerts.GenericAlertComposer;
import com.eu.habbo.messages.outgoing.generic.alerts.MessagesForYouComposer;
import java.util.List;

View File

@ -2,11 +2,8 @@ package com.eu.habbo.habbohotel.commands;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.rooms.RoomChatMessage;
import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
import com.eu.habbo.messages.outgoing.rooms.users.RoomUserWhisperComposer;
import com.eu.habbo.networking.camera.CameraClient;
import com.eu.habbo.threading.runnables.CameraClientAutoReconnect;
public class ConnectCameraCommand extends Command
{

View File

@ -2,10 +2,8 @@ package com.eu.habbo.habbohotel.commands;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.rooms.RoomChatMessage;
import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
import com.eu.habbo.habbohotel.users.Habbo;
import com.eu.habbo.messages.outgoing.rooms.users.RoomUserWhisperComposer;
public class ControlCommand extends Command
{

View File

@ -2,14 +2,11 @@ package com.eu.habbo.habbohotel.commands;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.rooms.RoomChatMessage;
import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
import com.eu.habbo.habbohotel.users.Habbo;
import com.eu.habbo.habbohotel.users.HabboInfo;
import com.eu.habbo.habbohotel.users.HabboManager;
import com.eu.habbo.messages.outgoing.generic.alerts.GenericAlertComposer;
import com.eu.habbo.messages.outgoing.rooms.users.RoomUserWhisperComposer;
import com.eu.habbo.messages.outgoing.users.UserCreditsComposer;
public class CreditsCommand extends Command
{

View File

@ -2,9 +2,7 @@ package com.eu.habbo.habbohotel.commands;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.rooms.RoomChatMessage;
import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
import com.eu.habbo.messages.outgoing.rooms.users.RoomUserWhisperComposer;
public class DiagonalCommand extends Command
{

View File

@ -2,10 +2,8 @@ package com.eu.habbo.habbohotel.commands;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.rooms.RoomChatMessage;
import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
import com.eu.habbo.habbohotel.users.Habbo;
import com.eu.habbo.messages.outgoing.rooms.users.RoomUserWhisperComposer;
public class DisconnectCommand extends Command
{

View File

@ -4,12 +4,10 @@ import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.bots.Bot;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.permissions.Permission;
import com.eu.habbo.habbohotel.rooms.RoomChatMessage;
import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
import com.eu.habbo.habbohotel.users.Habbo;
import com.eu.habbo.messages.outgoing.generic.alerts.GenericAlertComposer;
import com.eu.habbo.messages.outgoing.inventory.InventoryRefreshComposer;
import com.eu.habbo.messages.outgoing.rooms.users.RoomUserWhisperComposer;
import gnu.trove.map.hash.TIntObjectHashMap;
import gnu.trove.procedure.TObjectProcedure;

View File

@ -3,14 +3,12 @@ package com.eu.habbo.habbohotel.commands;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.permissions.Permission;
import com.eu.habbo.habbohotel.rooms.RoomChatMessage;
import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
import com.eu.habbo.habbohotel.users.Habbo;
import com.eu.habbo.habbohotel.users.HabboItem;
import com.eu.habbo.messages.outgoing.generic.alerts.GenericAlertComposer;
import com.eu.habbo.messages.outgoing.inventory.InventoryItemsComposer;
import com.eu.habbo.messages.outgoing.inventory.InventoryRefreshComposer;
import com.eu.habbo.messages.outgoing.rooms.users.RoomUserWhisperComposer;
import com.eu.habbo.threading.runnables.QueryDeleteHabboItems;
import gnu.trove.map.TIntObjectMap;
import gnu.trove.map.hash.TIntObjectHashMap;
@ -53,7 +51,7 @@ public class EmptyInventoryCommand extends Command
if (habbo != null)
{
TIntObjectMap<HabboItem> items = new TIntObjectHashMap<HabboItem>();
TIntObjectMap<HabboItem> items = new TIntObjectHashMap<>();
items.putAll(habbo.getInventory().getItemsComponent().getItems());
habbo.getInventory().getItemsComponent().getItems().clear();
Emulator.getThreading().run(new QueryDeleteHabboItems(items));

View File

@ -4,12 +4,10 @@ import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.permissions.Permission;
import com.eu.habbo.habbohotel.pets.Pet;
import com.eu.habbo.habbohotel.rooms.RoomChatMessage;
import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
import com.eu.habbo.habbohotel.users.Habbo;
import com.eu.habbo.messages.outgoing.generic.alerts.GenericAlertComposer;
import com.eu.habbo.messages.outgoing.inventory.InventoryRefreshComposer;
import com.eu.habbo.messages.outgoing.rooms.users.RoomUserWhisperComposer;
import gnu.trove.map.hash.TIntObjectHashMap;
import gnu.trove.procedure.TObjectProcedure;

View File

@ -2,11 +2,8 @@ package com.eu.habbo.habbohotel.commands;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.rooms.RoomChatMessage;
import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
import com.eu.habbo.habbohotel.users.Habbo;
import com.eu.habbo.messages.outgoing.rooms.users.RoomUserEffectComposer;
import com.eu.habbo.messages.outgoing.rooms.users.RoomUserWhisperComposer;
public class EnableCommand extends Command
{

View File

@ -5,10 +5,8 @@ import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.users.Habbo;
import com.eu.habbo.messages.ServerMessage;
import com.eu.habbo.messages.outgoing.generic.alerts.BubbleAlertComposer;
import com.eu.habbo.messages.outgoing.generic.alerts.GenericAlertComposer;
import gnu.trove.map.hash.THashMap;
import java.util.ArrayList;
import java.util.Map;
public class EventCommand extends Command
@ -33,7 +31,7 @@ public class EventCommand extends Command
message += " ";
}
THashMap<String, String> codes = new THashMap<String, String>();
THashMap<String, String> codes = new THashMap<>();
codes.put("ROOMNAME", gameClient.getHabbo().getHabboInfo().getCurrentRoom().getName());
codes.put("ROOMID", gameClient.getHabbo().getHabboInfo().getCurrentRoom().getId() + "");
codes.put("USERNAME", gameClient.getHabbo().getHabboInfo().getUsername());

View File

@ -3,9 +3,7 @@ package com.eu.habbo.habbohotel.commands;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.permissions.Permission;
import com.eu.habbo.habbohotel.rooms.RoomChatMessage;
import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
import com.eu.habbo.messages.outgoing.rooms.users.RoomUserWhisperComposer;
public class FreezeBotsCommand extends Command
{

View File

@ -2,10 +2,8 @@ package com.eu.habbo.habbohotel.commands;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.rooms.RoomChatMessage;
import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
import com.eu.habbo.habbohotel.users.Habbo;
import com.eu.habbo.messages.outgoing.rooms.users.RoomUserWhisperComposer;
public class FreezeCommand extends Command
{

View File

@ -3,7 +3,6 @@ package com.eu.habbo.habbohotel.commands;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.items.Item;
import com.eu.habbo.habbohotel.rooms.RoomChatMessage;
import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
import com.eu.habbo.habbohotel.users.Habbo;
import com.eu.habbo.habbohotel.users.HabboInfo;
@ -11,9 +10,7 @@ import com.eu.habbo.habbohotel.users.HabboItem;
import com.eu.habbo.habbohotel.users.HabboManager;
import com.eu.habbo.messages.outgoing.generic.alerts.BubbleAlertComposer;
import com.eu.habbo.messages.outgoing.generic.alerts.BubbleAlertKeys;
import com.eu.habbo.messages.outgoing.generic.alerts.WiredRewardAlertComposer;
import com.eu.habbo.messages.outgoing.inventory.InventoryRefreshComposer;
import com.eu.habbo.messages.outgoing.rooms.users.RoomUserWhisperComposer;
import gnu.trove.map.hash.THashMap;
public class GiftCommand extends Command
@ -84,7 +81,7 @@ public class GiftCommand extends Command
{
habbo.getClient().sendResponse(new InventoryRefreshComposer());
THashMap<String, String> keys = new THashMap<String, String>();
THashMap<String, String> keys = new THashMap<>();
keys.put("display", "BUBBLE");
keys.put("image", "${image.library.url}notifications/gift.gif");
keys.put("message", Emulator.getTexts().getValue("generic.gift.received.anonymous"));

View File

@ -3,15 +3,9 @@ package com.eu.habbo.habbohotel.commands;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.permissions.Rank;
import com.eu.habbo.habbohotel.rooms.RoomChatMessage;
import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
import com.eu.habbo.habbohotel.users.Habbo;
import com.eu.habbo.habbohotel.users.HabboInfo;
import com.eu.habbo.habbohotel.users.HabboManager;
import com.eu.habbo.messages.outgoing.generic.alerts.GenericAlertComposer;
import com.eu.habbo.messages.outgoing.modtool.ModToolComposer;
import com.eu.habbo.messages.outgoing.rooms.users.RoomUserWhisperComposer;
import com.eu.habbo.messages.outgoing.users.UserPerksComposer;
import org.apache.commons.lang3.StringUtils;
public class GiveRankCommand extends Command

View File

@ -6,7 +6,6 @@ import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.users.Habbo;
import com.eu.habbo.messages.outgoing.generic.alerts.GenericAlertComposer;
import java.util.Collection;
import java.util.Map;
public class HappyHourCommand extends Command

View File

@ -0,0 +1,34 @@
package com.eu.habbo.habbohotel.commands;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.rooms.Room;
public class HideWiredCommand extends Command
{
public HideWiredCommand()
{
super("cmd_hidewired", Emulator.getTexts().getValue("commands.keys.cmd_hidewired").split(";"));
}
@Override
public boolean handle(GameClient gameClient, String[] params) throws Exception
{
Room room = gameClient.getHabbo().getHabboInfo().getCurrentRoom();
if (room != null)
{
if (room.isOwner(gameClient.getHabbo()))
{
room.setHideWired(!room.isHideWired());
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.succes.cmd_hidewired." + (room.isHideWired() ? "hidden" : "shown")));
}
else
{
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.errors.cmd_hidewired.permission"));
}
}
return true;
}
}

View File

@ -2,12 +2,10 @@ package com.eu.habbo.habbohotel.commands;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.rooms.RoomChatMessage;
import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
import com.eu.habbo.habbohotel.users.Habbo;
import com.eu.habbo.messages.ServerMessage;
import com.eu.habbo.messages.outgoing.generic.alerts.GenericAlertComposer;
import com.eu.habbo.messages.outgoing.rooms.users.RoomUserWhisperComposer;
import java.util.Map;

View File

@ -2,14 +2,11 @@ package com.eu.habbo.habbohotel.commands;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.modtool.ModToolBan;
import com.eu.habbo.habbohotel.modtool.ModToolBanType;
import com.eu.habbo.habbohotel.rooms.RoomChatMessage;
import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
import com.eu.habbo.habbohotel.users.Habbo;
import com.eu.habbo.habbohotel.users.HabboInfo;
import com.eu.habbo.habbohotel.users.HabboManager;
import com.eu.habbo.messages.outgoing.rooms.users.RoomUserWhisperComposer;
public class IPBanCommand extends Command
{

View File

@ -0,0 +1,28 @@
package com.eu.habbo.habbohotel.commands;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.rooms.RoomUnit;
import com.eu.habbo.messages.outgoing.rooms.users.RoomUserRemoveComposer;
public class InvisibleCommand extends Command
{
public InvisibleCommand()
{
super("cmd_invisible", Emulator.getTexts().getValue("commands.keys.cmd_invisible").split(";"));
}
@Override
public boolean handle(GameClient gameClient, String[] params) throws Exception
{
RoomUnit roomUnit = gameClient.getHabbo().getRoomUnit();
roomUnit.setInvisible(true);
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.succes.cmd_invisible.updated"));
gameClient.getHabbo().getHabboInfo().getCurrentRoom().sendComposer(new RoomUserRemoveComposer(roomUnit).compose());
return true;
}
}

View File

@ -2,16 +2,11 @@ package com.eu.habbo.habbohotel.commands;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.modtool.ModToolBan;
import com.eu.habbo.habbohotel.modtool.ModToolBanType;
import com.eu.habbo.habbohotel.rooms.RoomChatMessage;
import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
import com.eu.habbo.habbohotel.users.Habbo;
import com.eu.habbo.habbohotel.users.HabboInfo;
import com.eu.habbo.habbohotel.users.HabboManager;
import com.eu.habbo.messages.outgoing.rooms.users.RoomUserWhisperComposer;
import java.util.List;
public class MachineBanCommand extends Command
{
@ -64,14 +59,14 @@ public class MachineBanCommand extends Command
}
count = Emulator.getGameEnvironment().getModToolManager().ban(habbo.getId(), gameClient.getHabbo(), reason, IPBanCommand.TEN_YEARS, ModToolBanType.MACHINE, -1).size();
// for (Habbo h : Emulator.getGameServer().getGameClientManager().getHabbosWithMachineId(ban.machineId))
// {
// if (h != null)
// {
// count++;
// Emulator.getGameEnvironment().getModToolManager().ban(h.getHabboInfo().getId(), gameClient.getHabbo(), reason, IPBanCommand.TEN_YEARS, ModToolBanType.MACHINE);
// }
// }
}
else
{

View File

@ -2,7 +2,6 @@ package com.eu.habbo.habbohotel.commands;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.rooms.RoomChatMessage;
import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
import com.eu.habbo.habbohotel.users.Habbo;
import com.eu.habbo.habbohotel.users.HabboBadge;
@ -10,7 +9,6 @@ import com.eu.habbo.habbohotel.users.inventory.BadgesComponent;
import com.eu.habbo.messages.ServerMessage;
import com.eu.habbo.messages.outgoing.generic.alerts.BubbleAlertComposer;
import com.eu.habbo.messages.outgoing.generic.alerts.BubbleAlertKeys;
import com.eu.habbo.messages.outgoing.rooms.users.RoomUserWhisperComposer;
import com.eu.habbo.messages.outgoing.users.AddUserBadgeComposer;
import gnu.trove.map.hash.THashMap;
@ -34,7 +32,7 @@ public class MassBadgeCommand extends Command
if(!badge.isEmpty())
{
THashMap<String, String> keys = new THashMap<String, String>();
THashMap<String, String> keys = new THashMap<>();
keys.put("display", "BUBBLE");
keys.put("image", "${image.library.url}album1584/" + badge + ".gif");
keys.put("message", Emulator.getTexts().getValue("commands.generic.cmd_badge.received"));

View File

@ -2,13 +2,10 @@ package com.eu.habbo.habbohotel.commands;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.rooms.RoomChatMessage;
import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
import com.eu.habbo.habbohotel.users.Habbo;
import com.eu.habbo.messages.outgoing.rooms.users.RoomUserWhisperComposer;
import com.eu.habbo.messages.outgoing.users.UserCreditsComposer;
import java.util.Collection;
import java.util.Map;
public class MassCreditsCommand extends Command

View File

@ -3,16 +3,13 @@ package com.eu.habbo.habbohotel.commands;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.items.Item;
import com.eu.habbo.habbohotel.rooms.RoomChatMessage;
import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
import com.eu.habbo.habbohotel.users.Habbo;
import com.eu.habbo.habbohotel.users.HabboItem;
import com.eu.habbo.messages.ServerMessage;
import com.eu.habbo.messages.outgoing.generic.alerts.BubbleAlertComposer;
import com.eu.habbo.messages.outgoing.generic.alerts.BubbleAlertKeys;
import com.eu.habbo.messages.outgoing.generic.alerts.WiredRewardAlertComposer;
import com.eu.habbo.messages.outgoing.inventory.InventoryRefreshComposer;
import com.eu.habbo.messages.outgoing.rooms.users.RoomUserWhisperComposer;
import gnu.trove.map.hash.THashMap;
import java.util.Map;
@ -59,7 +56,7 @@ public class MassGiftCommand extends Command
final String finalMessage = message;
THashMap<String, String> keys = new THashMap<String, String>();
THashMap<String, String> keys = new THashMap<>();
keys.put("display", "BUBBLE");
keys.put("image", "${image.library.url}notifications/gift.gif");
keys.put("message", Emulator.getTexts().getValue("generic.gift.received.anonymous"));

View File

@ -2,13 +2,9 @@ package com.eu.habbo.habbohotel.commands;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.rooms.RoomChatMessage;
import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
import com.eu.habbo.habbohotel.users.Habbo;
import com.eu.habbo.messages.outgoing.rooms.users.RoomUserWhisperComposer;
import com.eu.habbo.messages.outgoing.users.UserCurrencyComposer;
import java.util.Collection;
import java.util.Map;
public class MassPixelsCommand extends Command

View File

@ -2,15 +2,10 @@ package com.eu.habbo.habbohotel.commands;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.rooms.RoomChatMessage;
import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
import com.eu.habbo.habbohotel.users.Habbo;
import com.eu.habbo.messages.outgoing.generic.alerts.GenericAlertComposer;
import com.eu.habbo.messages.outgoing.rooms.users.RoomUserWhisperComposer;
import com.eu.habbo.messages.outgoing.users.UserCurrencyComposer;
import com.eu.habbo.messages.outgoing.users.UserPointsComposer;
import java.util.Collection;
import java.util.Map;
public class MassPointsCommand extends Command
@ -27,16 +22,16 @@ public class MassPointsCommand extends Command
String amountString = "";
if(params.length == 3)
{
amountString = params[1];
try
{
type = Integer.valueOf(params[1]);
type = Integer.valueOf(params[2]);
} 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);
return true;
}
amountString = params[2];
}
else if(params.length == 2)
{

View File

@ -2,13 +2,11 @@ package com.eu.habbo.habbohotel.commands;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.rooms.RoomChatMessage;
import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
import com.eu.habbo.habbohotel.users.Habbo;
import com.eu.habbo.habbohotel.users.HabboGender;
import com.eu.habbo.messages.outgoing.rooms.users.RoomUserWhisperComposer;
import com.eu.habbo.messages.outgoing.users.UserDataComposer;
import com.eu.habbo.messages.outgoing.rooms.users.RoomUserDataComposer;
import com.eu.habbo.messages.outgoing.users.UserDataComposer;
public class MimicCommand extends Command
{

View File

@ -2,9 +2,7 @@ package com.eu.habbo.habbohotel.commands;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.rooms.RoomChatMessage;
import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
import com.eu.habbo.messages.outgoing.rooms.users.RoomUserWhisperComposer;
public class MuteBotsCommand extends Command
{

View File

@ -2,11 +2,9 @@ package com.eu.habbo.habbohotel.commands;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.rooms.RoomChatMessage;
import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
import com.eu.habbo.habbohotel.users.Habbo;
import com.eu.habbo.messages.outgoing.rooms.users.RoomUserIgnoredComposer;
import com.eu.habbo.messages.outgoing.rooms.users.RoomUserWhisperComposer;
public class MuteCommand extends Command
{

View File

@ -2,9 +2,7 @@ package com.eu.habbo.habbohotel.commands;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.rooms.RoomChatMessage;
import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
import com.eu.habbo.messages.outgoing.rooms.users.RoomUserWhisperComposer;
public class MutePetsCommand extends Command
{

View File

@ -3,12 +3,9 @@ package com.eu.habbo.habbohotel.commands;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.pets.Pet;
import com.eu.habbo.habbohotel.pets.Pet;
import com.eu.habbo.habbohotel.pets.PetManager;
import com.eu.habbo.habbohotel.rooms.RoomChatMessage;
import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
import com.eu.habbo.messages.outgoing.generic.alerts.GenericAlertComposer;
import com.eu.habbo.messages.outgoing.rooms.users.RoomUserWhisperComposer;
import gnu.trove.procedure.TIntObjectProcedure;
public class PetInfoCommand extends Command
@ -49,9 +46,9 @@ public class PetInfoCommand extends Command
Emulator.getTexts().getValue("generic.pet.scratches") + ": " + pet.getRespect() + "\r" +
Emulator.getTexts().getValue("generic.pet.energy") + ": " + pet.getEnergy() + "/" + PetManager.maxEnergy(pet.getLevel()) + "\r" +
Emulator.getTexts().getValue("generic.pet.happyness") + ": " + pet.getHappyness() + "\r" +
Emulator.getTexts().getValue("generic.pet.level.thirst") + ": " + ((Pet) pet).levelThirst + "\r" +
Emulator.getTexts().getValue("generic.pet.level.hunger") + ": " + ((Pet) pet).levelHunger + "\r" +
Emulator.getTexts().getValue("generic.pet.current_action") + ": " + (((Pet) pet).getTask() == null ? Emulator.getTexts().getValue("generic.nothing") : ((Pet) pet).getTask().name()) + "\r" +
Emulator.getTexts().getValue("generic.pet.level.thirst") + ": " + pet.levelThirst + "\r" +
Emulator.getTexts().getValue("generic.pet.level.hunger") + ": " + pet.levelHunger + "\r" +
Emulator.getTexts().getValue("generic.pet.current_action") + ": " + (pet.getTask() == null ? Emulator.getTexts().getValue("generic.nothing") : pet.getTask().name()) + "\r" +
Emulator.getTexts().getValue("generic.can.walk") + ": " + (pet.getRoomUnit().canWalk() ? Emulator.getTexts().getValue("generic.yes") : Emulator.getTexts().getValue("generic.no")) + ""
));
}

View File

@ -2,12 +2,9 @@ package com.eu.habbo.habbohotel.commands;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.rooms.RoomChatMessage;
import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
import com.eu.habbo.habbohotel.users.Habbo;
import com.eu.habbo.messages.outgoing.generic.alerts.GenericAlertComposer;
import com.eu.habbo.messages.outgoing.rooms.users.RoomUserWhisperComposer;
import com.eu.habbo.messages.outgoing.users.UserCurrencyComposer;
public class PixelCommand extends Command
{

View File

@ -2,11 +2,9 @@ package com.eu.habbo.habbohotel.commands;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.rooms.RoomChatMessage;
import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
import com.eu.habbo.habbohotel.users.Habbo;
import com.eu.habbo.messages.outgoing.generic.alerts.GenericAlertComposer;
import com.eu.habbo.messages.outgoing.rooms.users.RoomUserWhisperComposer;
import com.eu.habbo.messages.outgoing.users.UserPointsComposer;
public class PointsCommand extends Command

View File

@ -8,7 +8,6 @@ import com.eu.habbo.habbohotel.rooms.RoomTile;
import com.eu.habbo.habbohotel.users.Habbo;
import com.eu.habbo.habbohotel.users.HabboGender;
import com.eu.habbo.messages.outgoing.rooms.users.RoomUserTalkComposer;
import com.eu.habbo.messages.outgoing.rooms.users.RoomUserWhisperComposer;
public class PullCommand extends Command
{

View File

@ -8,7 +8,6 @@ import com.eu.habbo.habbohotel.rooms.RoomTile;
import com.eu.habbo.habbohotel.users.Habbo;
import com.eu.habbo.habbohotel.users.HabboGender;
import com.eu.habbo.messages.outgoing.rooms.users.RoomUserTalkComposer;
import com.eu.habbo.messages.outgoing.rooms.users.RoomUserWhisperComposer;
public class PushCommand extends Command
{

View File

@ -2,11 +2,9 @@ package com.eu.habbo.habbohotel.commands;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.rooms.RoomChatMessage;
import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
import com.eu.habbo.habbohotel.users.HabboItem;
import com.eu.habbo.messages.outgoing.inventory.InventoryRefreshComposer;
import com.eu.habbo.messages.outgoing.rooms.users.RoomUserWhisperComposer;
import com.eu.habbo.threading.runnables.QueryDeleteHabboItems;
import gnu.trove.map.TIntIntMap;
import gnu.trove.map.hash.TIntIntHashMap;
@ -25,7 +23,7 @@ public class RedeemCommand extends Command
@Override
public boolean handle(final GameClient gameClient, String[] params) throws Exception
{
ArrayList<HabboItem> items = new ArrayList<HabboItem>();
ArrayList<HabboItem> items = new ArrayList<>();
int credits = 0;
int pixels = 0;
@ -79,7 +77,7 @@ public class RedeemCommand extends Command
}
}
TIntObjectHashMap<HabboItem> deleted = new TIntObjectHashMap<HabboItem>();
TIntObjectHashMap<HabboItem> deleted = new TIntObjectHashMap<>();
for(HabboItem item : items)
{
gameClient.getHabbo().getInventory().getItemsComponent().removeHabboItem(item);

View File

@ -6,7 +6,6 @@ import com.eu.habbo.habbohotel.rooms.Room;
import com.eu.habbo.habbohotel.users.Habbo;
import com.eu.habbo.messages.ServerMessage;
import com.eu.habbo.messages.outgoing.rooms.ForwardToRoomComposer;
import gnu.trove.set.hash.THashSet;
import java.util.ArrayList;
import java.util.Collection;
@ -29,7 +28,7 @@ public class ReloadRoomCommand extends Command
Room room = gameClient.getHabbo().getHabboInfo().getCurrentRoom();
if (room != null)
{
Collection<Habbo> habbos = new ArrayList<Habbo>(room.getHabbos());
Collection<Habbo> habbos = new ArrayList<>(room.getHabbos());
Emulator.getGameEnvironment().getRoomManager().unloadRoom(room);
room = Emulator.getGameEnvironment().getRoomManager().loadRoom(room.getId());
ServerMessage message = new ForwardToRoomComposer(room.getId()).compose();

View File

@ -3,10 +3,8 @@ package com.eu.habbo.habbohotel.commands;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.rooms.Room;
import com.eu.habbo.habbohotel.rooms.RoomChatMessage;
import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
import com.eu.habbo.messages.outgoing.generic.alerts.GenericAlertComposer;
import com.eu.habbo.messages.outgoing.rooms.users.RoomUserWhisperComposer;
public class RoomAlertCommand extends Command
{

View File

@ -6,9 +6,7 @@ import com.eu.habbo.habbohotel.catalog.CatalogPage;
import com.eu.habbo.habbohotel.catalog.CatalogPageLayouts;
import com.eu.habbo.habbohotel.catalog.layouts.RoomBundleLayout;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.rooms.RoomChatMessage;
import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
import com.eu.habbo.messages.outgoing.rooms.users.RoomUserWhisperComposer;
import java.sql.*;

View File

@ -2,11 +2,8 @@ package com.eu.habbo.habbohotel.commands;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.rooms.RoomChatMessage;
import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
import com.eu.habbo.habbohotel.users.Habbo;
import com.eu.habbo.messages.outgoing.rooms.users.RoomUserWhisperComposer;
import gnu.trove.procedure.TObjectProcedure;
public class RoomCreditsCommand extends Command
{

View File

@ -2,16 +2,10 @@ package com.eu.habbo.habbohotel.commands;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.rooms.RoomChatMessage;
import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
import com.eu.habbo.habbohotel.users.DanceType;
import com.eu.habbo.habbohotel.users.Habbo;
import com.eu.habbo.messages.outgoing.rooms.users.RoomUserDanceComposer;
import com.eu.habbo.messages.outgoing.rooms.users.RoomUserWhisperComposer;
import gnu.trove.iterator.TIntObjectIterator;
import gnu.trove.map.TIntObjectMap;
import java.util.NoSuchElementException;
public class RoomDanceCommand extends Command
{

View File

@ -2,15 +2,9 @@ package com.eu.habbo.habbohotel.commands;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.rooms.RoomChatMessage;
import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
import com.eu.habbo.habbohotel.users.Habbo;
import com.eu.habbo.messages.outgoing.rooms.users.RoomUserEffectComposer;
import com.eu.habbo.messages.outgoing.rooms.users.RoomUserWhisperComposer;
import gnu.trove.iterator.TIntObjectIterator;
import gnu.trove.map.TIntObjectMap;
import java.util.NoSuchElementException;
public class RoomEffectCommand extends Command
{

View File

@ -3,16 +3,11 @@ package com.eu.habbo.habbohotel.commands;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.items.Item;
import com.eu.habbo.habbohotel.rooms.RoomChatMessage;
import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
import com.eu.habbo.habbohotel.users.Habbo;
import com.eu.habbo.habbohotel.users.HabboItem;
import com.eu.habbo.messages.outgoing.generic.alerts.WiredRewardAlertComposer;
import com.eu.habbo.messages.outgoing.inventory.InventoryRefreshComposer;
import com.eu.habbo.messages.outgoing.rooms.users.RoomUserWhisperComposer;
import gnu.trove.procedure.TObjectProcedure;
import java.util.Map;
public class RoomGiftCommand extends Command
{

View File

@ -2,16 +2,9 @@ package com.eu.habbo.habbohotel.commands;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.rooms.RoomChatMessage;
import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
import com.eu.habbo.habbohotel.users.Habbo;
import com.eu.habbo.messages.outgoing.rooms.users.RoomUserEffectComposer;
import com.eu.habbo.messages.outgoing.rooms.users.RoomUserHandItemComposer;
import com.eu.habbo.messages.outgoing.rooms.users.RoomUserWhisperComposer;
import gnu.trove.iterator.TIntObjectIterator;
import gnu.trove.map.TIntObjectMap;
import java.util.NoSuchElementException;
public class RoomItemCommand extends Command
{

View File

@ -6,8 +6,6 @@ import com.eu.habbo.habbohotel.permissions.Permission;
import com.eu.habbo.habbohotel.rooms.Room;
import com.eu.habbo.habbohotel.users.Habbo;
import com.eu.habbo.messages.outgoing.generic.alerts.GenericAlertComposer;
import gnu.trove.iterator.TIntObjectIterator;
import gnu.trove.procedure.TObjectProcedure;
public class RoomKickCommand extends Command
{

View File

@ -3,9 +3,7 @@ package com.eu.habbo.habbohotel.commands;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.rooms.Room;
import com.eu.habbo.habbohotel.rooms.RoomChatMessage;
import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
import com.eu.habbo.messages.outgoing.rooms.users.RoomUserWhisperComposer;
public class RoomMuteCommand extends Command
{

View File

@ -2,11 +2,8 @@ package com.eu.habbo.habbohotel.commands;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.rooms.RoomChatMessage;
import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
import com.eu.habbo.habbohotel.users.Habbo;
import com.eu.habbo.messages.outgoing.rooms.users.RoomUserWhisperComposer;
import gnu.trove.procedure.TObjectProcedure;
public class RoomPixelsCommand extends Command
{

View File

@ -2,11 +2,8 @@ package com.eu.habbo.habbohotel.commands;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.rooms.RoomChatMessage;
import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
import com.eu.habbo.habbohotel.users.Habbo;
import com.eu.habbo.messages.outgoing.rooms.users.RoomUserWhisperComposer;
import gnu.trove.procedure.TObjectProcedure;
public class RoomPointsCommand extends Command
{

View File

@ -2,15 +2,8 @@ package com.eu.habbo.habbohotel.commands;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.rooms.RoomChatMessage;
import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
import com.eu.habbo.habbohotel.users.Habbo;
import com.eu.habbo.messages.outgoing.rooms.users.RoomUserTalkComposer;
import com.eu.habbo.messages.outgoing.rooms.users.RoomUserWhisperComposer;
import gnu.trove.iterator.TIntObjectIterator;
import gnu.trove.map.TIntObjectMap;
import java.util.NoSuchElementException;
public class SayAllCommand extends Command
{

View File

@ -6,7 +6,6 @@ import com.eu.habbo.habbohotel.rooms.RoomChatMessage;
import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
import com.eu.habbo.habbohotel.users.Habbo;
import com.eu.habbo.messages.outgoing.rooms.users.RoomUserTalkComposer;
import com.eu.habbo.messages.outgoing.rooms.users.RoomUserWhisperComposer;
public class SayCommand extends Command
{

View File

@ -2,9 +2,7 @@ package com.eu.habbo.habbohotel.commands;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.rooms.RoomChatMessage;
import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
import com.eu.habbo.messages.outgoing.rooms.users.RoomUserWhisperComposer;
public class SetMaxCommand extends Command
{

View File

@ -2,9 +2,7 @@ package com.eu.habbo.habbohotel.commands;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.rooms.RoomChatMessage;
import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
import com.eu.habbo.messages.outgoing.rooms.users.RoomUserWhisperComposer;
public class SetPollCommand extends Command
{

View File

@ -3,9 +3,7 @@ package com.eu.habbo.habbohotel.commands;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.rooms.Room;
import com.eu.habbo.habbohotel.rooms.RoomChatMessage;
import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
import com.eu.habbo.messages.outgoing.rooms.users.RoomUserWhisperComposer;
public class SetSpeedCommand extends Command
{

View File

@ -2,15 +2,8 @@ package com.eu.habbo.habbohotel.commands;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.rooms.RoomChatMessage;
import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
import com.eu.habbo.habbohotel.users.Habbo;
import com.eu.habbo.messages.outgoing.rooms.users.RoomUserShoutComposer;
import com.eu.habbo.messages.outgoing.rooms.users.RoomUserWhisperComposer;
import gnu.trove.iterator.TIntObjectIterator;
import gnu.trove.map.TIntObjectMap;
import java.util.NoSuchElementException;
public class ShoutAllCommand extends Command
{

View File

@ -6,7 +6,6 @@ import com.eu.habbo.habbohotel.rooms.RoomChatMessage;
import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
import com.eu.habbo.habbohotel.users.Habbo;
import com.eu.habbo.messages.outgoing.rooms.users.RoomUserShoutComposer;
import com.eu.habbo.messages.outgoing.rooms.users.RoomUserWhisperComposer;
public class ShoutCommand extends Command
{

View File

@ -4,10 +4,6 @@ import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.rooms.RoomUnitStatus;
import com.eu.habbo.habbohotel.users.Habbo;
import gnu.trove.iterator.TIntObjectIterator;
import gnu.trove.map.TIntObjectMap;
import java.util.NoSuchElementException;
public class SitDownCommand extends Command
{

View File

@ -3,12 +3,8 @@ package com.eu.habbo.habbohotel.commands;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.messenger.Message;
import com.eu.habbo.habbohotel.rooms.RoomChatMessage;
import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
import com.eu.habbo.messages.ServerMessage;
import com.eu.habbo.messages.outgoing.friends.FriendChatMessageComposer;
import com.eu.habbo.messages.outgoing.generic.alerts.GenericAlertComposer;
import com.eu.habbo.messages.outgoing.rooms.users.RoomUserWhisperComposer;
public class StaffAlertCommand extends Command
{

View File

@ -2,11 +2,9 @@ package com.eu.habbo.habbohotel.commands;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.rooms.RoomChatMessage;
import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
import com.eu.habbo.habbohotel.users.Habbo;
import com.eu.habbo.messages.outgoing.generic.alerts.GenericAlertComposer;
import com.eu.habbo.messages.outgoing.rooms.users.RoomUserWhisperComposer;
import java.util.ArrayList;
import java.util.Collections;
@ -50,7 +48,7 @@ public class StaffOnlineCommand extends Command
synchronized (Emulator.getGameEnvironment().getHabboManager().getOnlineHabbos())
{
ArrayList<Habbo> staffs = new ArrayList<Habbo>();
ArrayList<Habbo> staffs = new ArrayList<>();
for(Map.Entry<Integer, Habbo> set : Emulator.getGameEnvironment().getHabboManager().getOnlineHabbos().entrySet())
{

View File

@ -2,14 +2,9 @@ package com.eu.habbo.habbohotel.commands;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.rooms.RoomChatMessage;
import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
import com.eu.habbo.habbohotel.users.Habbo;
import com.eu.habbo.messages.outgoing.rooms.ForwardToRoomComposer;
import com.eu.habbo.messages.outgoing.rooms.RoomDataComposer;
import com.eu.habbo.messages.outgoing.rooms.RoomEntryInfoComposer;
import com.eu.habbo.messages.outgoing.rooms.RoomOpenComposer;
import com.eu.habbo.messages.outgoing.rooms.users.RoomUserWhisperComposer;
public class StalkCommand extends Command
{

View File

@ -2,14 +2,12 @@ package com.eu.habbo.habbohotel.commands;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.rooms.RoomChatMessage;
import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
import com.eu.habbo.habbohotel.rooms.RoomTile;
import com.eu.habbo.habbohotel.users.Habbo;
import com.eu.habbo.messages.outgoing.generic.alerts.GenericAlertComposer;
import com.eu.habbo.messages.outgoing.rooms.ForwardToRoomComposer;
import com.eu.habbo.messages.outgoing.rooms.HideDoorbellComposer;
import com.eu.habbo.messages.outgoing.rooms.users.RoomUserWhisperComposer;
public class SummonCommand extends Command
{
@ -48,7 +46,7 @@ public class SummonCommand extends Command
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.generic.cmd_summon.summoning").replace("%user%", params[1]), RoomChatMessageBubbles.ALERT);
//Emulator.getGameEnvironment().getRoomManager().leaveRoom(habbo, habbo.getHabboInfo().getCurrentRoom());
Emulator.getGameEnvironment().getRoomManager().leaveRoom(habbo, habbo.getHabboInfo().getCurrentRoom());
habbo.getClient().sendResponse(new ForwardToRoomComposer(gameClient.getHabbo().getHabboInfo().getCurrentRoom().getId()));
Emulator.getGameEnvironment().getRoomManager().enterRoom(habbo, gameClient.getHabbo().getHabboInfo().getCurrentRoom().getId(), "", true);

View File

@ -2,11 +2,9 @@ package com.eu.habbo.habbohotel.commands;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.rooms.RoomChatMessage;
import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
import com.eu.habbo.habbohotel.users.Habbo;
import com.eu.habbo.messages.outgoing.rooms.ForwardToRoomComposer;
import com.eu.habbo.messages.outgoing.rooms.users.RoomUserWhisperComposer;
import java.util.Map;

View File

@ -8,7 +8,6 @@ import com.eu.habbo.habbohotel.rooms.RoomTile;
import com.eu.habbo.habbohotel.users.Habbo;
import com.eu.habbo.habbohotel.users.HabboGender;
import com.eu.habbo.messages.outgoing.rooms.users.RoomUserTalkComposer;
import com.eu.habbo.messages.outgoing.rooms.users.RoomUserWhisperComposer;
public class SuperPullCommand extends Command
{

View File

@ -2,14 +2,11 @@ package com.eu.habbo.habbohotel.commands;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.modtool.ModToolBan;
import com.eu.habbo.habbohotel.modtool.ModToolBanType;
import com.eu.habbo.habbohotel.rooms.RoomChatMessage;
import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
import com.eu.habbo.habbohotel.users.Habbo;
import com.eu.habbo.habbohotel.users.HabboInfo;
import com.eu.habbo.habbohotel.users.HabboManager;
import com.eu.habbo.messages.outgoing.rooms.users.RoomUserWhisperComposer;
public class SuperbanCommand extends Command
{

View File

@ -2,13 +2,11 @@ package com.eu.habbo.habbohotel.commands;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.rooms.RoomChatMessage;
import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
import com.eu.habbo.habbohotel.users.Habbo;
import com.eu.habbo.habbohotel.users.HabboBadge;
import com.eu.habbo.habbohotel.users.inventory.BadgesComponent;
import com.eu.habbo.messages.outgoing.inventory.InventoryBadgesComposer;
import com.eu.habbo.messages.outgoing.rooms.users.RoomUserWhisperComposer;
public class TakeBadgeCommand extends Command
{

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