From 1912873fe46c1094d22a5ff632c41a68ecb11696 Mon Sep 17 00:00:00 2001 From: nttzx Date: Thu, 6 Aug 2020 12:19:12 -0400 Subject: [PATCH 1/6] Verify the length of desc & name of the group --- .../incoming/guilds/GuildChangeNameDescEvent.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/eu/habbo/messages/incoming/guilds/GuildChangeNameDescEvent.java b/src/main/java/com/eu/habbo/messages/incoming/guilds/GuildChangeNameDescEvent.java index fc28261c..e0a44e3e 100644 --- a/src/main/java/com/eu/habbo/messages/incoming/guilds/GuildChangeNameDescEvent.java +++ b/src/main/java/com/eu/habbo/messages/incoming/guilds/GuildChangeNameDescEvent.java @@ -2,8 +2,10 @@ package com.eu.habbo.messages.incoming.guilds; import com.eu.habbo.Emulator; import com.eu.habbo.habbohotel.guilds.Guild; +import com.eu.habbo.habbohotel.permissions.Permission; import com.eu.habbo.habbohotel.rooms.Room; import com.eu.habbo.messages.incoming.MessageHandler; +import com.eu.habbo.messages.outgoing.guilds.GuildEditFailComposer; import com.eu.habbo.plugin.events.guilds.GuildChangedNameEvent; public class GuildChangeNameDescEvent extends MessageHandler { @@ -14,10 +16,19 @@ public class GuildChangeNameDescEvent extends MessageHandler { Guild guild = Emulator.getGameEnvironment().getGuildManager().getGuild(guildId); if (guild != null) { - if (guild.getOwnerId() == this.client.getHabbo().getHabboInfo().getId() || this.client.getHabbo().hasPermission("acc_guild_admin")) { + if (guild.getOwnerId() == this.client.getHabbo().getHabboInfo().getId() || this.client.getHabbo().hasPermission(Permission.ACC_GUILD_ADMIN)) { GuildChangedNameEvent nameEvent = new GuildChangedNameEvent(guild, this.packet.readString(), this.packet.readString()); Emulator.getPluginManager().fireEvent(nameEvent); + if(nameEvent.name.length() > 29){ + this.client.sendResponse(new GuildEditFailComposer(GuildEditFailComposer.INVALID_GUILD_NAME)); + return; + } + + if(nameEvent.description.length() > 254){ + return; + } + if (nameEvent.isCancelled()) return; From 2d99f8b579355bd8333f591d8b35da9a69ebb020 Mon Sep 17 00:00:00 2001 From: Harmonic Date: Sun, 6 Sep 2020 08:25:19 -0400 Subject: [PATCH 2/6] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8a4a8145..364c2985 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ Arcturus Morningstar is released under the [GNU General Public License v3](https ## Versions ## ![image](https://img.shields.io/badge/VERSION-2.4.0-success.svg?style=for-the-badge&logo=appveyor) -![image](https://img.shields.io/badge/STATUS-UNSTABLE-red.svg?style=for-the-badge&logo=appveyor) +![image](https://img.shields.io/badge/STATUS-STABLE-blue.svg?style=for-the-badge&logo=appveyor) Compiled Download: https://git.krews.org/morningstar/Arcturus-Community/releases From 9e1fb44a53a2264583508c36f7c7e79a80ca4e84 Mon Sep 17 00:00:00 2001 From: Harmonic Date: Thu, 24 Sep 2020 16:12:39 -0400 Subject: [PATCH 3/6] Revert "Merge branch 'patch-4' into 'master'" This reverts merge request !274 --- .../incoming/guilds/GuildChangeNameDescEvent.java | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/main/java/com/eu/habbo/messages/incoming/guilds/GuildChangeNameDescEvent.java b/src/main/java/com/eu/habbo/messages/incoming/guilds/GuildChangeNameDescEvent.java index f25a3484..7942b2cd 100644 --- a/src/main/java/com/eu/habbo/messages/incoming/guilds/GuildChangeNameDescEvent.java +++ b/src/main/java/com/eu/habbo/messages/incoming/guilds/GuildChangeNameDescEvent.java @@ -5,7 +5,6 @@ import com.eu.habbo.habbohotel.guilds.Guild; import com.eu.habbo.habbohotel.permissions.Permission; import com.eu.habbo.habbohotel.rooms.Room; import com.eu.habbo.messages.incoming.MessageHandler; -import com.eu.habbo.messages.outgoing.guilds.GuildEditFailComposer; import com.eu.habbo.plugin.events.guilds.GuildChangedNameEvent; public class GuildChangeNameDescEvent extends MessageHandler { @@ -20,15 +19,6 @@ public class GuildChangeNameDescEvent extends MessageHandler { GuildChangedNameEvent nameEvent = new GuildChangedNameEvent(guild, this.packet.readString(), this.packet.readString()); Emulator.getPluginManager().fireEvent(nameEvent); - if(nameEvent.name.length() > 29){ - this.client.sendResponse(new GuildEditFailComposer(GuildEditFailComposer.INVALID_GUILD_NAME)); - return; - } - - if(nameEvent.description.length() > 254){ - return; - } - if (nameEvent.isCancelled()) return; From 0a93514b0667b85a64c10ae03120a389e2f79f56 Mon Sep 17 00:00:00 2001 From: jeanropke Date: Fri, 25 Sep 2020 10:01:54 -0300 Subject: [PATCH 4/6] Fixed ArrayIndexOutOfBoundsException --- .../habbohotel/commands/WordQuizCommand.java | 25 +++++++++++-------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/src/main/java/com/eu/habbo/habbohotel/commands/WordQuizCommand.java b/src/main/java/com/eu/habbo/habbohotel/commands/WordQuizCommand.java index 09a6c4dc..ba74d5d2 100644 --- a/src/main/java/com/eu/habbo/habbohotel/commands/WordQuizCommand.java +++ b/src/main/java/com/eu/habbo/habbohotel/commands/WordQuizCommand.java @@ -2,6 +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.RoomChatMessageBubbles; + +import java.util.Arrays; public class WordQuizCommand extends Command { public WordQuizCommand() { @@ -11,21 +14,21 @@ public class WordQuizCommand extends Command { @Override public boolean handle(GameClient gameClient, String[] params) throws Exception { if (!gameClient.getHabbo().getHabboInfo().getCurrentRoom().hasActiveWordQuiz()) { + if(params.length == 1) { + gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.description.cmd_word_quiz"), RoomChatMessageBubbles.ALERT); + return true; + } StringBuilder question = new StringBuilder(); int duration = 60; - if (params.length > 2) { - for (int i = 1; i < params.length - 1; i++) { - question.append(" ").append(params[i]); - } + try { + duration = Integer.parseInt(params[params.length-1]); + params = Arrays.copyOf(params, params.length-1); + } + catch (Exception e) {} - try { - duration = Integer.valueOf(params[params.length - 1]); - } catch (Exception e) { - question.append(" ").append(params[params.length - 1]); - } - } else { - question = new StringBuilder(params[1]); + for (int i = 1; i < params.length; i++) { + question.append(" ").append(params[i]); } gameClient.getHabbo().getHabboInfo().getCurrentRoom().startWordQuiz(question.toString(), duration * 1000); From a4c200146fbb44541805f76d4c0caab0101bc1d1 Mon Sep 17 00:00:00 2001 From: Beny Date: Tue, 6 Oct 2020 20:06:11 -0400 Subject: [PATCH 5/6] Revert "Merge branch 'master' into 'master'" This reverts merge request !304 --- .../habbohotel/commands/WordQuizCommand.java | 25 ++++++++----------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/src/main/java/com/eu/habbo/habbohotel/commands/WordQuizCommand.java b/src/main/java/com/eu/habbo/habbohotel/commands/WordQuizCommand.java index ba74d5d2..09a6c4dc 100644 --- a/src/main/java/com/eu/habbo/habbohotel/commands/WordQuizCommand.java +++ b/src/main/java/com/eu/habbo/habbohotel/commands/WordQuizCommand.java @@ -2,9 +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.RoomChatMessageBubbles; - -import java.util.Arrays; public class WordQuizCommand extends Command { public WordQuizCommand() { @@ -14,21 +11,21 @@ public class WordQuizCommand extends Command { @Override public boolean handle(GameClient gameClient, String[] params) throws Exception { if (!gameClient.getHabbo().getHabboInfo().getCurrentRoom().hasActiveWordQuiz()) { - if(params.length == 1) { - gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.description.cmd_word_quiz"), RoomChatMessageBubbles.ALERT); - return true; - } StringBuilder question = new StringBuilder(); int duration = 60; - try { - duration = Integer.parseInt(params[params.length-1]); - params = Arrays.copyOf(params, params.length-1); - } - catch (Exception e) {} + if (params.length > 2) { + for (int i = 1; i < params.length - 1; i++) { + question.append(" ").append(params[i]); + } - for (int i = 1; i < params.length; i++) { - question.append(" ").append(params[i]); + try { + duration = Integer.valueOf(params[params.length - 1]); + } catch (Exception e) { + question.append(" ").append(params[params.length - 1]); + } + } else { + question = new StringBuilder(params[1]); } gameClient.getHabbo().getHabboInfo().getCurrentRoom().startWordQuiz(question.toString(), duration * 1000); From b9e103e89b115722e428a7702adee87e2833d977 Mon Sep 17 00:00:00 2001 From: TenShie Date: Sat, 12 Dec 2020 05:52:09 -0500 Subject: [PATCH 6/6] Adding Comments after debugging the Source SWF --- .../com/eu/habbo/habbohotel/messenger/MessengerBuddy.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/eu/habbo/habbohotel/messenger/MessengerBuddy.java b/src/main/java/com/eu/habbo/habbohotel/messenger/MessengerBuddy.java index 4a292b87..b48d7b9e 100644 --- a/src/main/java/com/eu/habbo/habbohotel/messenger/MessengerBuddy.java +++ b/src/main/java/com/eu/habbo/habbohotel/messenger/MessengerBuddy.java @@ -180,10 +180,10 @@ public class MessengerBuddy implements Runnable, ISerialize { message.appendBoolean(this.online == 1); message.appendBoolean(this.inRoom); //IN ROOM message.appendString(this.look); - message.appendInt(0); + message.appendInt(0); // Friends category ID message.appendString(this.motto); - message.appendString(""); - message.appendString(""); + message.appendString(""); //Last seen as DATETIMESTRING + message.appendString(""); // Realname or Facebookame as String message.appendBoolean(false); //Offline messaging. message.appendBoolean(false); message.appendBoolean(false);