Merge branch 'master' into 'dev'

Fix issue #980 - People with rights should be able to edit sticky notes

See merge request morningstar/Arcturus-Community!488
This commit is contained in:
Remco 2022-03-03 22:41:48 +00:00
commit f3b0a9d170
2 changed files with 6 additions and 6 deletions

View File

@ -6,6 +6,7 @@ import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
import com.eu.habbo.habbohotel.users.Habbo; import com.eu.habbo.habbohotel.users.Habbo;
import com.eu.habbo.habbohotel.users.HabboInfo; import com.eu.habbo.habbohotel.users.HabboInfo;
import com.eu.habbo.habbohotel.users.HabboManager; import com.eu.habbo.habbohotel.users.HabboManager;
import com.eu.habbo.habbohotel.users.HabboStats;
import com.eu.habbo.habbohotel.users.subscriptions.Subscription; import com.eu.habbo.habbohotel.users.subscriptions.Subscription;
/** /**
@ -42,8 +43,7 @@ public class SubscriptionCommand extends Command {
HabboInfo info = HabboManager.getOfflineHabboInfo(params[1]); HabboInfo info = HabboManager.getOfflineHabboInfo(params[1]);
if (info != null) { if (info != null) {
Habbo habbo = Emulator.getGameServer().getGameClientManager().getHabbo(params[1]); HabboStats stats = info.getHabboStats();
String subscription = params[2].toUpperCase(); String subscription = params[2].toUpperCase();
String action = params[3]; String action = params[3];
@ -67,11 +67,11 @@ public class SubscriptionCommand extends Command {
return true; return true;
} }
habbo.getHabboStats().createSubscription(subscription, timeToAdd); stats.createSubscription(subscription, timeToAdd);
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_subscription.success_add_time", "Successfully added %time% seconds to %subscription% on %user%").replace("%time%", timeToAdd + "").replace("%user%", params[1]).replace("%subscription%", subscription), RoomChatMessageBubbles.ALERT); gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_subscription.success_add_time", "Successfully added %time% seconds to %subscription% on %user%").replace("%time%", timeToAdd + "").replace("%user%", params[1]).replace("%subscription%", subscription), RoomChatMessageBubbles.ALERT);
} }
else if(action.equalsIgnoreCase("remove") || action.equalsIgnoreCase("-") || action.equalsIgnoreCase("r")) { else if(action.equalsIgnoreCase("remove") || action.equalsIgnoreCase("-") || action.equalsIgnoreCase("r")) {
Subscription s = habbo.getHabboStats().getSubscription(subscription); Subscription s = stats.getSubscription(subscription);
if (s == null) { if (s == null) {
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_subscription.user_not_have", "%user% does not have the %subscription% subscription").replace("%user%", params[1]).replace("%subscription%", subscription), RoomChatMessageBubbles.ALERT); gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_subscription.user_not_have", "%user% does not have the %subscription% subscription").replace("%user%", params[1]).replace("%subscription%", subscription), RoomChatMessageBubbles.ALERT);

View File

@ -39,12 +39,12 @@ public class PostItSaveDataEvent extends MessageHandler {
if (!(item instanceof InteractionPostIt)) if (!(item instanceof InteractionPostIt))
return; return;
if (!color.equalsIgnoreCase(PostItColor.YELLOW.hexColor) && !room.hasRights(this.client.getHabbo()) && item.getUserId() != this.client.getHabbo().getHabboInfo().getId()) { if (!color.equalsIgnoreCase(PostItColor.YELLOW.hexColor) && !room.hasRights(this.client.getHabbo())) {
if (!text.startsWith(item.getExtradata().replace(item.getExtradata().split(" ")[0], ""))) { if (!text.startsWith(item.getExtradata().replace(item.getExtradata().split(" ")[0], ""))) {
return; return;
} }
} else { } else {
if (!room.hasRights(this.client.getHabbo()) && item.getUserId() != this.client.getHabbo().getHabboInfo().getId()) if (!room.hasRights(this.client.getHabbo()))
return; return;
} }