mirror of
https://git.krews.org/morningstar/Arcturus-Community.git
synced 2025-01-18 23:46:28 +01:00
Merge branch 'patch-fix-favorite-group' into 'dev'
Fix update favorite group (users) See merge request morningstar/Arcturus-Community!354
This commit is contained in:
commit
c7e4885df7
@ -2,11 +2,15 @@ package com.eu.habbo.messages.incoming.guilds;
|
||||
|
||||
import com.eu.habbo.Emulator;
|
||||
import com.eu.habbo.habbohotel.guilds.Guild;
|
||||
import com.eu.habbo.habbohotel.guilds.GuildMember;
|
||||
import com.eu.habbo.habbohotel.permissions.Permission;
|
||||
import com.eu.habbo.habbohotel.users.Habbo;
|
||||
import com.eu.habbo.messages.incoming.MessageHandler;
|
||||
import com.eu.habbo.messages.outgoing.guilds.GuildFavoriteRoomUserUpdateComposer;
|
||||
import com.eu.habbo.messages.outgoing.guilds.RemoveGuildFromRoomComposer;
|
||||
import com.eu.habbo.messages.outgoing.rooms.RoomDataComposer;
|
||||
import com.eu.habbo.plugin.events.guilds.GuildDeletedEvent;
|
||||
import gnu.trove.set.hash.THashSet;
|
||||
|
||||
public class GuildDeleteEvent extends MessageHandler {
|
||||
@Override
|
||||
@ -18,6 +22,15 @@ public class GuildDeleteEvent extends MessageHandler {
|
||||
if (guild != null) {
|
||||
if (guild.getOwnerId() == this.client.getHabbo().getHabboInfo().getId() || this.client.getHabbo().hasPermission(Permission.ACC_GUILD_ADMIN)) //TODO Add staff permission override.
|
||||
{
|
||||
THashSet<GuildMember> members = Emulator.getGameEnvironment().getGuildManager().getGuildMembers(guild.getId());
|
||||
|
||||
for (GuildMember member : members) {
|
||||
Habbo habbo = Emulator.getGameServer().getGameClientManager().getHabbo(member.getUserId());
|
||||
if (habbo != null)
|
||||
if (habbo.getHabboInfo().getCurrentRoom() != null && habbo.getRoomUnit() != null)
|
||||
habbo.getHabboInfo().getCurrentRoom().sendComposer(new GuildFavoriteRoomUserUpdateComposer(habbo.getRoomUnit(), null).compose());
|
||||
}
|
||||
|
||||
Emulator.getGameEnvironment().getGuildManager().deleteGuild(guild);
|
||||
Emulator.getPluginManager().fireEvent(new GuildDeletedEvent(guild, this.client.getHabbo()));
|
||||
Emulator.getGameEnvironment().getRoomManager().getRoom(guild.getRoomId()).sendComposer(new RemoveGuildFromRoomComposer(guildId).compose());
|
||||
|
@ -22,7 +22,7 @@ public class GuildRemoveFavoriteEvent extends MessageHandler {
|
||||
this.client.getHabbo().getHabboStats().guild = 0;
|
||||
|
||||
if (this.client.getHabbo().getHabboInfo().getCurrentRoom() != null && guild != null) {
|
||||
this.client.getHabbo().getHabboInfo().getCurrentRoom().sendComposer(new GuildFavoriteRoomUserUpdateComposer(this.client.getHabbo().getRoomUnit(), guild).compose());
|
||||
this.client.getHabbo().getHabboInfo().getCurrentRoom().sendComposer(new GuildFavoriteRoomUserUpdateComposer(this.client.getHabbo().getRoomUnit(), null).compose());
|
||||
}
|
||||
|
||||
this.client.sendResponse(new UserProfileComposer(this.client.getHabbo(), this.client));
|
||||
|
@ -8,6 +8,7 @@ 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.incoming.MessageHandler;
|
||||
import com.eu.habbo.messages.outgoing.guilds.GuildFavoriteRoomUserUpdateComposer;
|
||||
import com.eu.habbo.messages.outgoing.guilds.GuildInfoComposer;
|
||||
import com.eu.habbo.messages.outgoing.guilds.GuildRefreshMembersListComposer;
|
||||
import com.eu.habbo.plugin.events.guilds.GuildRemovedMemberEvent;
|
||||
@ -44,8 +45,11 @@ public class GuildRemoveMemberEvent extends MessageHandler {
|
||||
if (habbo.getHabboStats().guild == guildId)
|
||||
habbo.getHabboStats().guild = 0;
|
||||
|
||||
if (room != null && habbo.getHabboInfo().getCurrentRoom() == room) {
|
||||
room.refreshRightsForHabbo(habbo);
|
||||
if (room != null) {
|
||||
if (habbo.getHabboInfo().getCurrentRoom() != null && habbo.getRoomUnit() != null)
|
||||
habbo.getHabboInfo().getCurrentRoom().sendComposer(new GuildFavoriteRoomUserUpdateComposer(habbo.getRoomUnit(), null).compose());
|
||||
if (habbo.getHabboInfo().getCurrentRoom() == room)
|
||||
room.refreshRightsForHabbo(habbo);
|
||||
}
|
||||
|
||||
habbo.getClient().sendResponse(new GuildInfoComposer(guild, habbo.getClient(), false, null));
|
||||
|
@ -19,9 +19,9 @@ public class GuildFavoriteRoomUserUpdateComposer extends MessageComposer {
|
||||
protected ServerMessage composeInternal() {
|
||||
this.response.init(Outgoing.GuildFavoriteRoomUserUpdateComposer);
|
||||
this.response.appendInt(this.roomUnit.getId());
|
||||
this.response.appendInt(this.guild.getId());
|
||||
this.response.appendInt(this.guild.getState().state);
|
||||
this.response.appendString(this.guild.getName());
|
||||
this.response.appendInt(this.guild != null ? this.guild.getId() : 0);
|
||||
this.response.appendInt(this.guild != null ? this.guild.getState().state : 3);
|
||||
this.response.appendString(this.guild != null ? this.guild.getName() : "");
|
||||
return this.response;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user