🆙 Krews update Done :"Refactored string comparisons to use equalsIgnoreCase, replaced valueOf with parseInt for improved efficiency"
This commit is contained in:
parent
c116cbae22
commit
ffa9811449
@ -38,7 +38,7 @@ public final class Emulator {
|
||||
|
||||
public final static int MAJOR = 3;
|
||||
public final static int MINOR = 6;
|
||||
public final static int BUILD = 0;
|
||||
public final static int BUILD = 1;
|
||||
public final static String PREVIEW = "";
|
||||
|
||||
public static final String version = "Arcturus Morningstar" + " " + MAJOR + "." + MINOR + "." + BUILD + " " + PREVIEW;
|
||||
@ -84,13 +84,6 @@ public final class Emulator {
|
||||
Runtime.getRuntime().addShutdownHook(hook);
|
||||
}
|
||||
|
||||
public static void promptEnterKey(){
|
||||
System.out.println("\n");
|
||||
System.out.println("Press \"ENTER\" if you agree to the terms stated above...");
|
||||
Scanner scanner = new Scanner(System.in);
|
||||
scanner.nextLine();
|
||||
}
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
try {
|
||||
// Check if running on Windows and not in IntelliJ.
|
||||
@ -112,11 +105,6 @@ public final class Emulator {
|
||||
|
||||
System.out.println(logo);
|
||||
|
||||
// Checks if this is a BETA build before allowing them to continue.
|
||||
if (PREVIEW.toLowerCase().contains("beta")) {
|
||||
System.out.println("Warning, this is a beta build, this means that there may be unintended consequences so make sure you take regular backups while using this build. If you notice any issues you should make an issue on the Krews Git.");
|
||||
promptEnterKey();
|
||||
}
|
||||
System.out.println("");
|
||||
LOGGER.warn("Arcturus Morningstar 3.x is no longer accepting merge requests. Please target MS4 branches if you wish to contribute.");
|
||||
LOGGER.info("Follow our development at https://git.krews.org/morningstar/Arcturus-Community, ");
|
||||
|
@ -44,7 +44,7 @@ public class ShutdownCommand extends Command {
|
||||
}
|
||||
RoomTrade.TRADING_ENABLED = false;
|
||||
ShutdownEmulator.timestamp = Emulator.getIntUnixTimestamp() + (60 * minutes);
|
||||
Emulator.getThreading().run(new ShutdownEmulator(message), minutes * 60 * 1000);
|
||||
Emulator.getThreading().run(new ShutdownEmulator(message), (long) minutes * 60 * 1000);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -56,7 +56,7 @@ public class CraftingManager {
|
||||
recipe.addIngredient(ingredientItem, set.getInt("crafting_recipes_ingredients.amount"));
|
||||
altar.addIngredient(ingredientItem);
|
||||
} 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"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -45,7 +45,7 @@ public class GuardianTicket {
|
||||
|
||||
this.votes.put(guardian, new GuardianVote(this.guardianCount, guardian));
|
||||
|
||||
Emulator.getThreading().run(new GuardianNotAccepted(this, guardian), Emulator.getConfig().getInt("guardians.accept.timer") * 1000);
|
||||
Emulator.getThreading().run(new GuardianNotAccepted(this, guardian), Emulator.getConfig().getInt("guardians.accept.timer") * 1000L);
|
||||
}
|
||||
|
||||
|
||||
|
@ -38,7 +38,7 @@ public class GuildManager {
|
||||
this.loadGuildParts();
|
||||
this.loadGuildViews();
|
||||
|
||||
LOGGER.info("Guild Manager -> Loaded! (" + (System.currentTimeMillis() - millis) + " MS)");
|
||||
LOGGER.info("Guild Manager -> Loaded! ({} MS)", System.currentTimeMillis() - millis);
|
||||
}
|
||||
|
||||
|
||||
|
@ -48,7 +48,7 @@ public class CrackableReward {
|
||||
itemId = Integer.parseInt(prize.split(":")[0]);
|
||||
chance = Integer.parseInt(prize.split(":")[1]);
|
||||
} 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 {
|
||||
itemId = Integer.parseInt(prize.replace(":", ""));
|
||||
}
|
||||
|
@ -105,7 +105,7 @@ public class ItemManager {
|
||||
this.highscoreManager.load();
|
||||
this.loadNewUserGifts();
|
||||
|
||||
LOGGER.info("Item Manager -> Loaded! (" + (System.currentTimeMillis() - millis) + " MS)");
|
||||
LOGGER.info("Item Manager -> Loaded! ({} MS)", System.currentTimeMillis() - millis);
|
||||
}
|
||||
|
||||
protected void loadItemInteractions() {
|
||||
|
@ -25,7 +25,7 @@ public class RandomStateParams {
|
||||
this.delay = Integer.parseInt(keyValue[1]);
|
||||
break;
|
||||
default:
|
||||
LOGGER.warn("RandomStateParams: unknown key: " + keyValue[0]);
|
||||
LOGGER.warn("RandomStateParams: unknown key: {}", keyValue[0]);
|
||||
break;
|
||||
}
|
||||
});
|
||||
|
@ -118,7 +118,7 @@ public class YoutubeManager {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
LOGGER.info("YouTube Manager -> Loaded! (" + (System.currentTimeMillis() - millis) + " MS)");
|
||||
LOGGER.info("YouTube Manager -> Loaded! ({} MS)", System.currentTimeMillis() - millis);
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -79,7 +79,7 @@ public class InteractionDefault extends HabboItem {
|
||||
try {
|
||||
currentState = Integer.parseInt(this.getExtradata());
|
||||
} 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());
|
||||
|
@ -129,7 +129,7 @@ public class InteractionFireworks extends InteractionDefault {
|
||||
try {
|
||||
explodeDuration = Integer.parseInt(this.getBaseItem().getCustomParams());
|
||||
} 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 {
|
||||
this.loadData();
|
||||
} 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 {
|
||||
this.loadData();
|
||||
} catch (Exception e) {
|
||||
LOGGER.warn("Incorrect extradata for gift with ID " + this.getId());
|
||||
LOGGER.warn("Incorrect extradata for gift with ID {}", this.getId());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -25,7 +25,7 @@ public class InteractionMusicDisc extends HabboItem {
|
||||
try {
|
||||
this.songId = Integer.parseInt(stuff[6]);
|
||||
} 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());
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -39,7 +39,7 @@ public class InteractionMusicDisc extends HabboItem {
|
||||
try {
|
||||
this.songId = Integer.parseInt(stuff[6]);
|
||||
} 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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -45,7 +45,7 @@ public class ModToolManager {
|
||||
this.tickets = new THashMap<>();
|
||||
this.cfhCategories = new TIntObjectHashMap<>();
|
||||
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) {
|
||||
|
@ -26,7 +26,7 @@ public class ModToolSanctions {
|
||||
this.sanctionLevelsHashmap = new THashMap<>();
|
||||
this.loadModSanctions();
|
||||
|
||||
LOGGER.info("Sanctions Manager -> Loaded! (" + (System.currentTimeMillis() - millis) + " MS)");
|
||||
LOGGER.info("Sanctions Manager -> Loaded! ({} MS)", System.currentTimeMillis() - millis);
|
||||
}
|
||||
|
||||
public synchronized void loadModSanctions() {
|
||||
|
@ -33,7 +33,7 @@ public class WordFilter {
|
||||
public WordFilter() {
|
||||
long start = System.currentTimeMillis();
|
||||
this.reload();
|
||||
LOGGER.info("WordFilter -> Loaded! (" + (System.currentTimeMillis() - start) + " MS)");
|
||||
LOGGER.info("WordFilter -> Loaded! ({} MS)", System.currentTimeMillis() - start);
|
||||
}
|
||||
|
||||
private static String stripDiacritics(String str) {
|
||||
|
@ -38,7 +38,7 @@ public class NavigatorManager {
|
||||
this.filters.put(NavigatorUserFilter.name, new NavigatorUserFilter());
|
||||
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() {
|
||||
|
@ -29,7 +29,7 @@ public class PermissionsManager {
|
||||
|
||||
this.reload();
|
||||
|
||||
LOGGER.info("Permissions Manager -> Loaded! (" + (System.currentTimeMillis() - millis) + " MS)");
|
||||
LOGGER.info("Permissions Manager -> Loaded! ({} MS)", System.currentTimeMillis() - millis);
|
||||
}
|
||||
|
||||
public void reload() {
|
||||
|
@ -83,7 +83,7 @@ public class PetManager {
|
||||
|
||||
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) {
|
||||
@ -234,10 +234,10 @@ public class PetManager {
|
||||
if (petVocalsType != null) {
|
||||
this.petData.get(set.getInt("pet_id")).petVocals.get(petVocalsType).add(new PetVocal(set.getString("message")));
|
||||
} else {
|
||||
LOGGER.error("Unknown pet vocal type " + set.getString("type"));
|
||||
LOGGER.error("Unknown pet vocal type {}", set.getString("type"));
|
||||
}
|
||||
} 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 {
|
||||
if (!PetData.generalPetVocals.containsKey(PetVocalsType.valueOf(set.getString("type").toUpperCase())))
|
||||
@ -303,7 +303,7 @@ public class PetManager {
|
||||
|
||||
public THashSet<PetRace> getBreeds(String petName) {
|
||||
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;
|
||||
}
|
||||
|
||||
@ -349,7 +349,7 @@ public class PetManager {
|
||||
return this.petData.get(type);
|
||||
} else {
|
||||
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 (?)")) {
|
||||
statement.setInt(1, type);
|
||||
statement.execute();
|
||||
@ -361,7 +361,7 @@ public class PetManager {
|
||||
if (set.next()) {
|
||||
PetData petData = new PetData(set);
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
@ -2257,7 +2257,7 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
|
||||
game = gameType.getDeclaredConstructor(Room.class).newInstance(this);
|
||||
this.addGame(game);
|
||||
} catch (Exception e) {
|
||||
LOGGER.error("Error getting game " + gameType.getName(), e);
|
||||
LOGGER.error("Error getting game {}", gameType.getName(), e);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -95,7 +95,7 @@ public class RoomManager {
|
||||
registerGameType(IceTagGame.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() {
|
||||
|
@ -72,8 +72,8 @@ public class HabboInfo implements Runnable {
|
||||
this.rank = Emulator.getGameEnvironment().getPermissionsManager().getRank(set.getInt("rank"));
|
||||
|
||||
if (this.rank == null) {
|
||||
LOGGER.error("No existing rank found with id " + set.getInt("rank") + ". Make sure an entry in the permissions table exists.");
|
||||
LOGGER.warn(this.username + " has an invalid rank with id " + set.getInt("rank") + ". Make sure an entry in the permissions table exists.");
|
||||
LOGGER.error("No existing rank found with id {}. Make sure an entry in the permissions table exists.", set.getInt("rank"));
|
||||
LOGGER.warn("{} has an invalid rank with id {}. Make sure an entry in the permissions table exists.", this.username, set.getInt("rank"));
|
||||
this.rank = Emulator.getGameEnvironment().getPermissionsManager().getRank(1);
|
||||
}
|
||||
|
||||
|
@ -271,7 +271,7 @@ public abstract class HabboItem implements Runnable, IEventTriggers {
|
||||
statement.execute();
|
||||
} catch (SQLException e) {
|
||||
LOGGER.error("Caught SQL exception", e);
|
||||
LOGGER.error("SQLException trying to save HabboItem: " + this.toString());
|
||||
LOGGER.error("SQLException trying to save HabboItem: {}", this.toString());
|
||||
}
|
||||
|
||||
this.needsUpdate = false;
|
||||
|
@ -41,7 +41,7 @@ public class HabboManager {
|
||||
|
||||
this.onlineHabbos = new ConcurrentHashMap<>();
|
||||
|
||||
LOGGER.info("Habbo Manager -> Loaded! (" + (System.currentTimeMillis() - millis) + " MS)");
|
||||
LOGGER.info("Habbo Manager -> Loaded! ({} MS)", System.currentTimeMillis() - millis);
|
||||
}
|
||||
|
||||
public static HabboInfo getOfflineHabboInfo(int id) {
|
||||
|
@ -50,7 +50,7 @@ public class ItemsComponent {
|
||||
if (item != null) {
|
||||
itemsList.put(set.getInt("id"), item);
|
||||
} else {
|
||||
LOGGER.error("Failed to load HabboItem: " + set.getInt("id"));
|
||||
LOGGER.error("Failed to load HabboItem: {}", set.getInt("id"));
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
LOGGER.error("Caught SQL exception", e);
|
||||
|
@ -347,7 +347,7 @@ public class SubscriptionHabboClub extends Subscription {
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
SubscriptionManager.LOGGER.error("Exception processing HC payday for user #" + set.getInt("user_id"), e);
|
||||
SubscriptionManager.LOGGER.error("Exception processing HC payday for user #{}", set.getInt("user_id"), e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -38,7 +38,7 @@ public class WiredHighscoreManager {
|
||||
this.data.clear();
|
||||
this.loadHighscoreData();
|
||||
|
||||
LOGGER.info("Highscore Manager -> Loaded! (" + (System.currentTimeMillis() - millis) + " MS, " + this.data.size() + " items)");
|
||||
LOGGER.info("Highscore Manager -> Loaded! ({} MS, {} items)", System.currentTimeMillis() - millis, this.data.size());
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
|
@ -26,7 +26,7 @@ public class GuardianVoteEvent extends MessageHandler {
|
||||
} else if (voteType == 2) {
|
||||
type = GuardianVoteType.AWFULLY;
|
||||
} else {
|
||||
LOGGER.error("Uknown vote type: " + voteType);
|
||||
LOGGER.error("Uknown vote type: {}", voteType);
|
||||
}
|
||||
|
||||
ticket.vote(this.client.getHabbo(), type);
|
||||
|
@ -39,13 +39,13 @@ public class ModToolSanctionMuteEvent extends MessageHandler {
|
||||
if (item.probationTimestamp > 0 && item.probationTimestamp >= Emulator.getIntUnixTimestamp()) {
|
||||
ModToolSanctionLevelItem modToolSanctionLevelItem = modToolSanctions.getSanctionLevelItem(item.sanctionLevel);
|
||||
|
||||
int muteDurationTimestamp = Math.toIntExact(new Date( System.currentTimeMillis() + (modToolSanctionLevelItem.sanctionHourLength * 60 * 60)).getTime() / 1000);
|
||||
int muteDurationTimestamp = Math.toIntExact(new Date( System.currentTimeMillis() + ((long) modToolSanctionLevelItem.sanctionHourLength * 60 * 60)).getTime() / 1000);
|
||||
|
||||
modToolSanctions.run(userId, this.client.getHabbo(), item.sanctionLevel, cfhTopic, message, 0, true, muteDurationTimestamp);
|
||||
} else {
|
||||
ModToolSanctionLevelItem modToolSanctionLevelItem = modToolSanctions.getSanctionLevelItem(item.sanctionLevel);
|
||||
|
||||
int muteDurationTimestamp = Math.toIntExact(new Date( System.currentTimeMillis() + (modToolSanctionLevelItem.sanctionHourLength * 60 * 60)).getTime() / 1000);
|
||||
int muteDurationTimestamp = Math.toIntExact(new Date( System.currentTimeMillis() + ((long) modToolSanctionLevelItem.sanctionHourLength * 60 * 60)).getTime() / 1000);
|
||||
|
||||
modToolSanctions.run(userId, this.client.getHabbo(), item.sanctionLevel, cfhTopic, message, 0, true, muteDurationTimestamp);
|
||||
}
|
||||
|
@ -24,14 +24,14 @@ public class RequestCreateRoomEvent extends MessageHandler {
|
||||
int tradeType = this.packet.readInt();
|
||||
|
||||
if (!Emulator.getGameEnvironment().getRoomManager().layoutExists(modelName)) {
|
||||
LOGGER.error("[SCRIPTER] Incorrect layout name \"" + modelName + "\". " + this.client.getHabbo().getHabboInfo().getUsername());
|
||||
LOGGER.error("[SCRIPTER] Incorrect layout name \"{}\". {}", modelName, this.client.getHabbo().getHabboInfo().getUsername());
|
||||
return;
|
||||
}
|
||||
|
||||
RoomCategory category = Emulator.getGameEnvironment().getRoomManager().getCategory(categoryId);
|
||||
|
||||
if (category == null || category.getMinRank() > this.client.getHabbo().getHabboInfo().getRank().getId()) {
|
||||
LOGGER.error("[SCRIPTER] Incorrect rank or non existing category ID: \"" + categoryId + "\"." + this.client.getHabbo().getHabboInfo().getUsername());
|
||||
LOGGER.error("[SCRIPTER] Incorrect rank or non existing category ID: \"{}\".{}", categoryId, this.client.getHabbo().getHabboInfo().getUsername());
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -66,7 +66,7 @@ public class RoomSettingsSaveEvent extends MessageHandler {
|
||||
tags.append(tag).append(";");
|
||||
}
|
||||
|
||||
if (!Emulator.getGameEnvironment().getWordFilter().filter(tags.toString(), this.client.getHabbo()).equals(tags.toString())) {
|
||||
if (!Emulator.getGameEnvironment().getWordFilter().filter(tags.toString(), this.client.getHabbo()).contentEquals(tags)) {
|
||||
this.client.sendResponse(new RoomEditSettingsErrorComposer(room.getId(), RoomEditSettingsErrorComposer.ROOM_TAGS_BADWWORDS, ""));
|
||||
return;
|
||||
}
|
||||
|
@ -102,7 +102,7 @@ public class BotSaveSettingsEvent extends MessageHandler {
|
||||
//Invalid chatspeed. Use 7.
|
||||
}
|
||||
|
||||
BotSavedChatEvent chatEvent = new BotSavedChatEvent(bot, Boolean.valueOf(data[data.length - 3]), Boolean.valueOf(data[data.length - 1]), chatSpeed, chat);
|
||||
BotSavedChatEvent chatEvent = new BotSavedChatEvent(bot, Boolean.parseBoolean(data[data.length - 3]), Boolean.parseBoolean(data[data.length - 1]), chatSpeed, chat);
|
||||
Emulator.getPluginManager().fireEvent(chatEvent);
|
||||
|
||||
if (chatEvent.isCancelled())
|
||||
|
@ -61,7 +61,7 @@ public class RedeemClothingEvent extends MessageHandler {
|
||||
this.client.sendResponse(new BubbleAlertComposer(BubbleAlertKeys.FIGURESET_OWNED_ALREADY.key));
|
||||
}
|
||||
} else {
|
||||
LOGGER.error("[Catalog] No definition in catalog_clothing found for clothing name " + item.getBaseItem().getName() + ". Could not redeem clothing!");
|
||||
LOGGER.error("[Catalog] No definition in catalog_clothing found for clothing name {}. Could not redeem clothing!", item.getBaseItem().getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -36,7 +36,7 @@ public class RedeemItemEvent extends MessageHandler {
|
||||
try {
|
||||
credits = Integer.parseInt(item.getBaseItem().getName().split("_")[1]);
|
||||
} catch (Exception e) {
|
||||
LOGGER.error("Failed to parse redeemable furniture: " + item.getBaseItem().getName() + ". Must be in format of CF_<amount>");
|
||||
LOGGER.error("Failed to parse redeemable furniture: {}. Must be in format of CF_<amount>", item.getBaseItem().getName());
|
||||
return;
|
||||
}
|
||||
|
||||
@ -47,7 +47,7 @@ public class RedeemItemEvent extends MessageHandler {
|
||||
try {
|
||||
pixels = Integer.parseInt(item.getBaseItem().getName().split("_")[1]);
|
||||
} catch (Exception e) {
|
||||
LOGGER.error("Failed to parse redeemable pixel furniture: " + item.getBaseItem().getName() + ". Must be in format of PF_<amount>");
|
||||
LOGGER.error("Failed to parse redeemable pixel furniture: {}. Must be in format of PF_<amount>", item.getBaseItem().getName());
|
||||
return;
|
||||
}
|
||||
|
||||
@ -59,14 +59,14 @@ public class RedeemItemEvent extends MessageHandler {
|
||||
try {
|
||||
pointsType = Integer.parseInt(item.getBaseItem().getName().split("_")[1]);
|
||||
} catch (Exception e) {
|
||||
LOGGER.error("Failed to parse redeemable points furniture: " + item.getBaseItem().getName() + ". Must be in format of DF_<pointstype>_<amount> where <pointstype> equals integer representation of seasonal currency.");
|
||||
LOGGER.error("Failed to parse redeemable points furniture: {}. Must be in format of DF_<pointstype>_<amount> where <pointstype> equals integer representation of seasonal currency.", item.getBaseItem().getName());
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
points = Integer.parseInt(item.getBaseItem().getName().split("_")[2]);
|
||||
} catch (Exception e) {
|
||||
LOGGER.error("Failed to parse redeemable points furniture: " + item.getBaseItem().getName() + ". Must be in format of DF_<pointstype>_<amount> where <pointstype> equals integer representation of seasonal currency.");
|
||||
LOGGER.error("Failed to parse redeemable points furniture: {}. Must be in format of DF_<pointstype>_<amount> where <pointstype> equals integer representation of seasonal currency.", item.getBaseItem().getName());
|
||||
return;
|
||||
}
|
||||
|
||||
@ -77,7 +77,7 @@ public class RedeemItemEvent extends MessageHandler {
|
||||
try {
|
||||
points = Integer.parseInt(item.getBaseItem().getName().split("_")[2]);
|
||||
} catch (Exception e) {
|
||||
LOGGER.error("Failed to parse redeemable diamonds furniture: " + item.getBaseItem().getName() + ". Must be in format of CF_diamond_<amount>");
|
||||
LOGGER.error("Failed to parse redeemable diamonds furniture: {}. Must be in format of CF_diamond_<amount>", item.getBaseItem().getName());
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -30,7 +30,7 @@ public class SavePostItStickyPoleEvent extends MessageHandler {
|
||||
CommandHandler.handleCommand(this.client, command);
|
||||
}
|
||||
} else {
|
||||
LOGGER.info("Scripter Alert! " + this.client.getHabbo().getHabboInfo().getUsername() + " | " + this.packet.readString());
|
||||
LOGGER.info("Scripter Alert! {} | {}", this.client.getHabbo().getHabboInfo().getUsername(), this.packet.readString());
|
||||
}
|
||||
} else {
|
||||
String text = this.packet.readString();
|
||||
|
@ -47,7 +47,7 @@ public class YoutubeRequestPlaylistChange extends MessageHandler {
|
||||
|
||||
room.updateItem(item);
|
||||
room.sendComposer(new YoutubeVideoComposer(itemId, video, true, 0).compose());
|
||||
((InteractionYoutubeTV) item).autoAdvance = Emulator.getThreading().run(new YoutubeAdvanceVideo((InteractionYoutubeTV) item), video.getDuration() * 1000);
|
||||
((InteractionYoutubeTV) item).autoAdvance = Emulator.getThreading().run(new YoutubeAdvanceVideo((InteractionYoutubeTV) item), video.getDuration() * 1000L);
|
||||
|
||||
item.needsUpdate(true);
|
||||
}
|
||||
|
@ -28,7 +28,7 @@ public class YoutubeRequestPlaylists extends MessageHandler {
|
||||
ArrayList<YoutubeManager.YoutubePlaylist> playlists = Emulator.getGameEnvironment().getItemManager().getYoutubeManager().getPlaylistsForItemId(itemId);
|
||||
|
||||
if (playlists == null) {
|
||||
LOGGER.error("No YouTube playlists set for base item #" + item.getBaseItem().getId());
|
||||
LOGGER.error("No YouTube playlists set for base item #{}", item.getBaseItem().getId());
|
||||
this.client.sendResponse(new ConnectionErrorComposer(1000));
|
||||
return;
|
||||
}
|
||||
|
@ -80,7 +80,7 @@ public class YoutubeRequestStateChange extends MessageHandler {
|
||||
case RESUME:
|
||||
tv.playing = true;
|
||||
tv.startedWatchingAt = Emulator.getIntUnixTimestamp();
|
||||
tv.autoAdvance = Emulator.getThreading().run(new YoutubeAdvanceVideo(tv), (tv.currentVideo.getDuration() - tv.offset) * 1000);
|
||||
tv.autoAdvance = Emulator.getThreading().run(new YoutubeAdvanceVideo(tv), (tv.currentVideo.getDuration() - tv.offset) * 1000L);
|
||||
room.sendComposer(new YoutubeStateChangeComposer(tv.getId(), 1).compose());
|
||||
break;
|
||||
case PREVIOUS:
|
||||
@ -99,7 +99,7 @@ public class YoutubeRequestStateChange extends MessageHandler {
|
||||
room.sendComposer(new YoutubeVideoComposer(tv.getId(), tv.currentVideo, true, 0).compose());
|
||||
|
||||
tv.cancelAdvancement();
|
||||
tv.autoAdvance = Emulator.getThreading().run(new YoutubeAdvanceVideo(tv), tv.currentVideo.getDuration() * 1000);
|
||||
tv.autoAdvance = Emulator.getThreading().run(new YoutubeAdvanceVideo(tv), tv.currentVideo.getDuration() * 1000L);
|
||||
tv.startedWatchingAt = Emulator.getIntUnixTimestamp();
|
||||
tv.offset = 0;
|
||||
tv.playing = true;
|
||||
|
@ -40,7 +40,7 @@ public class HorseRemoveSaddleEvent extends MessageHandler {
|
||||
if (set.next()) {
|
||||
saddleItemId = set.getInt("id");
|
||||
} else {
|
||||
LOGGER.error("There is no viable fallback saddle item for old horses with no saddle item ID. Horse pet ID: " + horse.getId());
|
||||
LOGGER.error("There is no viable fallback saddle item for old horses with no saddle item ID. Horse pet ID: {}", horse.getId());
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -28,7 +28,7 @@ public class ModToolUserRoomVisitsComposer extends MessageComposer {
|
||||
|
||||
Calendar cal = Calendar.getInstance(TimeZone.getDefault());
|
||||
for (ModToolRoomVisit visit : this.roomVisits) {
|
||||
cal.setTimeInMillis(visit.timestamp * 1000);
|
||||
cal.setTimeInMillis(visit.timestamp * 1000L);
|
||||
this.response.appendInt(visit.roomId);
|
||||
this.response.appendString(visit.roomName);
|
||||
this.response.appendInt(cal.get(Calendar.HOUR));
|
||||
|
@ -55,15 +55,15 @@ public abstract class Server {
|
||||
}
|
||||
|
||||
if (!channelFuture.isSuccess()) {
|
||||
LOGGER.info("Failed to connect to the host (" + this.host + ":" + this.port + ")@" + this.name);
|
||||
LOGGER.info("Failed to connect to the host ({}:{})@{}", this.host, this.port, this.name);
|
||||
System.exit(0);
|
||||
} else {
|
||||
LOGGER.info("Started GameServer on " + this.host + ":" + this.port + "@" + this.name);
|
||||
LOGGER.info("Started GameServer on {}:{}@{}", this.host, this.port, this.name);
|
||||
}
|
||||
}
|
||||
|
||||
public void stop() {
|
||||
LOGGER.info("Stopping " + this.name);
|
||||
LOGGER.info("Stopping {}", this.name);
|
||||
try {
|
||||
this.workerGroup.shutdownGracefully(0, 0, TimeUnit.MILLISECONDS).sync();
|
||||
this.bossGroup.shutdownGracefully(0, 0, TimeUnit.MILLISECONDS).sync();
|
||||
|
@ -74,10 +74,10 @@ public class GameMessageHandler extends ChannelInboundHandlerAdapter {
|
||||
LOGGER.error("Plaintext received instead of ssl, closing channel");
|
||||
}
|
||||
else if (cause instanceof TooLongFrameException) {
|
||||
LOGGER.error("Disconnecting client, reason " + cause.getMessage());
|
||||
LOGGER.error("Disconnecting client, reason {}", cause.getMessage());
|
||||
}
|
||||
else if (cause instanceof SSLHandshakeException) {
|
||||
LOGGER.error("URL Request error from source " + ctx.channel().remoteAddress());
|
||||
LOGGER.error("URL Request error from source {}", ctx.channel().remoteAddress());
|
||||
}
|
||||
else if (cause instanceof NoSuchAlgorithmException) {
|
||||
LOGGER.error("Invalid SSL algorithm, only TLSv1.2 supported in the request");
|
||||
@ -86,10 +86,10 @@ public class GameMessageHandler extends ChannelInboundHandlerAdapter {
|
||||
LOGGER.error("Invalid SSL algorithm, only TLSv1.2 supported in the request");
|
||||
}
|
||||
else if (cause instanceof UnsupportedMessageTypeException) {
|
||||
LOGGER.error("There was an illegal SSL request from (X-forwarded-for/CF-Connecting-IP has not being injected yet!) " + ctx.channel().remoteAddress());
|
||||
LOGGER.error("There was an illegal SSL request from (X-forwarded-for/CF-Connecting-IP has not being injected yet!) {}", ctx.channel().remoteAddress());
|
||||
}
|
||||
else if (cause instanceof SSLException) {
|
||||
LOGGER.error("SSL Problem: "+ cause.getMessage() + cause);
|
||||
LOGGER.error("SSL Problem: {}{}", cause.getMessage(), cause);
|
||||
}
|
||||
else {
|
||||
LOGGER.error("Disconnecting client, exception in GameMessageHandler.", cause);
|
||||
|
@ -471,7 +471,7 @@ public class PluginManager {
|
||||
|
||||
this.loadPlugins();
|
||||
|
||||
LOGGER.info("Plugin Manager -> Loaded! " + this.plugins.size() + " plugins! (" + (System.currentTimeMillis() - millis) + " MS)");
|
||||
LOGGER.info("Plugin Manager -> Loaded! {} plugins! ({} MS)", this.plugins.size(), System.currentTimeMillis() - millis);
|
||||
|
||||
this.registerDefaultEvents();
|
||||
}
|
||||
|
@ -11,6 +11,6 @@ public class RejectedExecutionHandlerImpl implements RejectedExecutionHandler {
|
||||
|
||||
@Override
|
||||
public void rejectedExecution(Runnable r, ThreadPoolExecutor executor) {
|
||||
LOGGER.error(r.toString() + " is rejected");
|
||||
LOGGER.error("{} is rejected", r.toString());
|
||||
}
|
||||
}
|
||||
|
@ -97,7 +97,7 @@ public class YouAreAPirate implements Runnable {
|
||||
return;
|
||||
}
|
||||
|
||||
Emulator.getThreading().run(this, iamapirate[this.index - 1].length() * 100);
|
||||
Emulator.getThreading().run(this, iamapirate[this.index - 1].length() * 100L);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -28,6 +28,6 @@ public class YoutubeAdvanceVideo implements Runnable {
|
||||
room.updateItem(this.tv);
|
||||
room.sendComposer(new YoutubeVideoComposer(tv.getId(), tv.currentVideo, true, 0).compose());
|
||||
|
||||
tv.autoAdvance = Emulator.getThreading().run(new YoutubeAdvanceVideo(this.tv), tv.currentVideo.getDuration() * 1000);
|
||||
tv.autoAdvance = Emulator.getThreading().run(new YoutubeAdvanceVideo(this.tv), tv.currentVideo.getDuration() * 1000L);
|
||||
}
|
||||
}
|
||||
|
@ -15,6 +15,7 @@ import java.awt.image.ColorConvertOp;
|
||||
import java.awt.image.ColorModel;
|
||||
import java.awt.image.WritableRaster;
|
||||
import java.io.File;
|
||||
import java.util.Arrays;
|
||||
import java.util.Map;
|
||||
|
||||
public class BadgeImager {
|
||||
@ -126,21 +127,16 @@ public class BadgeImager {
|
||||
for (Map.Entry<GuildPartType, THashMap<Integer, GuildPart>> set : Emulator.getGameEnvironment().getGuildManager().getGuildParts().entrySet()) {
|
||||
if (set.getKey() == GuildPartType.SYMBOL || set.getKey() == GuildPartType.BASE) {
|
||||
for (Map.Entry<Integer, GuildPart> map : set.getValue().entrySet()) {
|
||||
if (!map.getValue().valueA.isEmpty()) {
|
||||
for (String part : Arrays.asList(map.getValue().valueA, map.getValue().valueB)) {
|
||||
if (!part.isEmpty()) {
|
||||
try {
|
||||
this.cachedImages.put(map.getValue().valueA, ImageIO.read(new File(Emulator.getConfig().getValue("imager.location.badgeparts"), "badgepart_" + map.getValue().valueA.replace(".gif", ".png"))));
|
||||
this.cachedImages.put(part, ImageIO.read(new File(Emulator.getConfig().getValue("imager.location.badgeparts"), "badgepart_" + part.replace(".gif", ".png"))));
|
||||
} catch (Exception e) {
|
||||
LOGGER.info(("[Badge Imager] Missing Badge Part: " + Emulator.getConfig().getValue("imager.location.badgeparts") + "/badgepart_" + map.getValue().valueA.replace(".gif", ".png")));
|
||||
LOGGER.info("[Badge Imager] Missing Badge Part: {}/badgepart_{}", Emulator.getConfig().getValue("imager.location.badgeparts"), part.replace(".gif", ".png"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!map.getValue().valueB.isEmpty()) {
|
||||
try {
|
||||
this.cachedImages.put(map.getValue().valueB, ImageIO.read(new File(Emulator.getConfig().getValue("imager.location.badgeparts"), "badgepart_" + map.getValue().valueB.replace(".gif", ".png"))));
|
||||
} catch (Exception e) {
|
||||
LOGGER.info(("[Badge Imager] Missing Badge Part: " + Emulator.getConfig().getValue("imager.location.badgeparts") + "/badgepart_" + map.getValue().valueB.replace(".gif", ".png")));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -150,6 +146,7 @@ public class BadgeImager {
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
public void generate(Guild guild) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user