remove hardcoded int GuildMembershipRejectedMessageComposer

This commit is contained in:
brenoepic 2022-04-29 18:51:12 -03:00
parent 16f0a61932
commit 49550f3a76
3 changed files with 6 additions and 4 deletions

View File

@ -35,7 +35,7 @@ public class KickMemberEvent extends MessageHandler {
guild.decreaseMemberCount(); guild.decreaseMemberCount();
if (userId != this.client.getHabbo().getHabboInfo().getId()) { if (userId != this.client.getHabbo().getHabboInfo().getId()) {
this.client.sendResponse(new GuildMembershipRejectedMessageComposer(guild)); this.client.sendResponse(new GuildMembershipRejectedMessageComposer(guild, userId));
} }
Room room = Emulator.getGameEnvironment().getRoomManager().loadRoom(guild.getRoomId()); Room room = Emulator.getGameEnvironment().getRoomManager().loadRoom(guild.getRoomId());

View File

@ -27,7 +27,7 @@ public class RejectMembershipRequestEvent extends MessageHandler {
guild.decreaseRequestCount(); guild.decreaseRequestCount();
Emulator.getGameEnvironment().getGuildManager().removeMember(guild, userId); Emulator.getGameEnvironment().getGuildManager().removeMember(guild, userId);
this.client.sendResponse(new GuildMembersComposer(guild, Emulator.getGameEnvironment().getGuildManager().getGuildMembers(guild, 0, 0, ""), this.client.getHabbo(), 0, 0, "", true, Emulator.getGameEnvironment().getGuildManager().getGuildMembersCount(guild, 0, 0, ""))); this.client.sendResponse(new GuildMembersComposer(guild, Emulator.getGameEnvironment().getGuildManager().getGuildMembers(guild, 0, 0, ""), this.client.getHabbo(), 0, 0, "", true, Emulator.getGameEnvironment().getGuildManager().getGuildMembersCount(guild, 0, 0, "")));
this.client.sendResponse(new GuildMembershipRejectedMessageComposer(guild)); this.client.sendResponse(new GuildMembershipRejectedMessageComposer(guild, userId));
Habbo habbo = Emulator.getGameEnvironment().getHabboManager().getHabbo(userId); Habbo habbo = Emulator.getGameEnvironment().getHabboManager().getHabbo(userId);
Emulator.getPluginManager().fireEvent(new GuildDeclinedMembershipEvent(guild, userId, habbo, this.client.getHabbo())); Emulator.getPluginManager().fireEvent(new GuildDeclinedMembershipEvent(guild, userId, habbo, this.client.getHabbo()));

View File

@ -7,16 +7,18 @@ import com.eu.habbo.messages.outgoing.Outgoing;
public class GuildMembershipRejectedMessageComposer extends MessageComposer { public class GuildMembershipRejectedMessageComposer extends MessageComposer {
private final Guild guild; private final Guild guild;
private final Integer userId;
public GuildMembershipRejectedMessageComposer(Guild guild) { public GuildMembershipRejectedMessageComposer(Guild guild, int userId) {
this.guild = guild; this.guild = guild;
this.userId = userId;
} }
@Override @Override
protected ServerMessage composeInternal() { protected ServerMessage composeInternal() {
this.response.init(Outgoing.GuildMembershipRejectedMessageComposer); this.response.init(Outgoing.GuildMembershipRejectedMessageComposer);
this.response.appendInt(this.guild.getId()); this.response.appendInt(this.guild.getId());
this.response.appendInt(0); this.response.appendInt(this.userId);
return this.response; return this.response;
} }
} }