Updated Group Forums. Credits to Beny.

This commit is contained in:
KrewsOrg 2019-04-29 05:13:02 +01:00
parent d409998e71
commit ba118eb625
42 changed files with 1401 additions and 1312 deletions

View File

@ -246,7 +246,7 @@ public class Guild implements Runnable
public int getDateCreated()
{
return this.dateCreated;
return dateCreated;
}
public int getMemberCount()

View File

@ -5,9 +5,7 @@ import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.items.interactions.InteractionGuildFurni;
import com.eu.habbo.habbohotel.rooms.Room;
import com.eu.habbo.habbohotel.users.Habbo;
import com.eu.habbo.messages.ServerMessage;
import com.eu.habbo.messages.outgoing.guilds.GuildJoinErrorComposer;
import com.eu.habbo.messages.outgoing.guilds.GuildMembershipRequestedComposer;
import gnu.trove.TCollections;
import gnu.trove.iterator.TIntObjectIterator;
import gnu.trove.map.TIntObjectMap;
@ -21,58 +19,47 @@ import java.util.Collection;
import java.util.List;
import java.util.NoSuchElementException;
public class GuildManager
{
public class GuildManager {
private final THashMap<GuildPartType, THashMap<Integer, GuildPart>> guildParts;
private final TIntObjectMap<Guild> guilds;
public GuildManager()
{
public GuildManager() {
long millis = System.currentTimeMillis();
this.guildParts = new THashMap<>();
this.guilds = TCollections.synchronizedMap(new TIntObjectHashMap<>());
this.guildParts = new THashMap<GuildPartType, THashMap<Integer, GuildPart>>();
this.guilds = TCollections.synchronizedMap(new TIntObjectHashMap<Guild>());
this.loadGuildParts();
Emulator.getLogging().logStart("Guild Manager -> Loaded! (" + (System.currentTimeMillis() - millis) + " MS)");
}
public void loadGuildParts()
{
public void loadGuildParts() {
this.guildParts.clear();
for (GuildPartType t : GuildPartType.values())
{
this.guildParts.put(t, new THashMap<>());
for (GuildPartType t : GuildPartType.values()) {
this.guildParts.put(t, new THashMap<Integer, GuildPart>());
}
try (Connection connection = Emulator.getDatabase().getDataSource().getConnection();
Statement statement = connection.createStatement();
ResultSet set = statement.executeQuery("SELECT * FROM guilds_elements"))
{
while (set.next())
{
ResultSet set = statement.executeQuery("SELECT * FROM guilds_elements")) {
while (set.next()) {
this.guildParts.get(GuildPartType.valueOf(set.getString("type").toUpperCase())).put(set.getInt("id"), new GuildPart(set));
}
}
catch (SQLException e)
{
} catch (SQLException e) {
Emulator.getLogging().logSQLException(e);
}
}
public Guild createGuild(Habbo habbo, int roomId, String roomName, String name, String description, String badge, int colorOne, int colorTwo)
{
public Guild createGuild(Habbo habbo, int roomId, String roomName, String name, String description, String badge, int colorOne, int colorTwo) {
Guild guild = new Guild(habbo.getHabboInfo().getId(), habbo.getHabboInfo().getUsername(), roomId, roomName, name, description, colorOne, colorTwo, badge);
try (Connection connection = Emulator.getDatabase().getDataSource().getConnection())
{
try (PreparedStatement statement = connection.prepareStatement("INSERT INTO guilds (name, description, room_id, user_id, color_one, color_two, badge, date_created) VALUES (?, ?, ?, ?, ?, ?, ?, ?)", Statement.RETURN_GENERATED_KEYS))
{
try (Connection connection = Emulator.getDatabase().getDataSource().getConnection()) {
try (PreparedStatement statement = connection.prepareStatement("INSERT INTO guilds (name, description, room_id, user_id, color_one, color_two, badge, date_created) VALUES (?, ?, ?, ?, ?, ?, ?, ?)", Statement.RETURN_GENERATED_KEYS)) {
statement.setString(1, name);
statement.setString(2, description);
statement.setInt(3, roomId);
@ -83,35 +70,28 @@ public class GuildManager
statement.setInt(8, Emulator.getIntUnixTimestamp());
statement.execute();
try (ResultSet set = statement.getGeneratedKeys())
{
if (set.next())
{
try (ResultSet set = statement.getGeneratedKeys()) {
if (set.next()) {
guild.setId(set.getInt(1));
}
}
}
try (PreparedStatement statement = connection.prepareStatement("INSERT INTO guilds_members (guild_id, user_id, level_id, member_since) VALUES (?, ?, ?, ?)", Statement.RETURN_GENERATED_KEYS))
{
try (PreparedStatement statement = connection.prepareStatement("INSERT INTO guilds_members (guild_id, user_id, level_id, member_since) VALUES (?, ?, ?, ?)", Statement.RETURN_GENERATED_KEYS)) {
statement.setInt(1, guild.getId());
statement.setInt(2, habbo.getHabboInfo().getId());
statement.setInt(3, 0);
statement.setInt(4, Emulator.getIntUnixTimestamp());
statement.execute();
try (ResultSet set = statement.getGeneratedKeys())
{
if (set.next())
{
try (ResultSet set = statement.getGeneratedKeys()) {
if (set.next()) {
guild.increaseMemberCount();
//guild.addMember(new GuildMember(habbo.getHabboInfo().getId(), habbo.getHabboInfo().getUsername(), habbo.getHabboInfo().getLook(), Emulator.getIntUnixTimestamp(), 2));
}
}
}
}
catch (SQLException e)
{
} catch (SQLException e) {
Emulator.getLogging().logSQLException(e);
}
@ -121,107 +101,83 @@ public class GuildManager
}
public void deleteGuild(Guild guild)
{
public void deleteGuild(Guild guild) {
THashSet<GuildMember> members = this.getGuildMembers(guild);
for (GuildMember member : members)
{
for (GuildMember member : members) {
Habbo habbo = Emulator.getGameEnvironment().getHabboManager().getHabbo(member.getUserId());
if (habbo != null)
{
if (habbo != null) {
habbo.getHabboStats().removeGuild(guild.getId());
if (habbo.getHabboStats().guild == guild.getId())
{
if (habbo.getHabboStats().guild == guild.getId()) {
habbo.getHabboStats().guild = 0;
}
}
}
try (Connection connection = Emulator.getDatabase().getDataSource().getConnection())
{
try (PreparedStatement deleteFavourite = connection.prepareStatement("UPDATE users_settings SET guild_id = ? WHERE guild_id = ?"))
{
try (Connection connection = Emulator.getDatabase().getDataSource().getConnection()) {
try (PreparedStatement deleteFavourite = connection.prepareStatement("UPDATE users_settings SET guild_id = ? WHERE guild_id = ?")) {
deleteFavourite.setInt(1, 0);
deleteFavourite.setInt(2, guild.getId());
deleteFavourite.execute();
}
try (PreparedStatement statement = connection.prepareStatement("DELETE FROM guilds_members WHERE guild_id = ?"))
{
try (PreparedStatement statement = connection.prepareStatement("DELETE FROM guilds_members WHERE guild_id = ?")) {
statement.setInt(1, guild.getId());
statement.execute();
}
try (PreparedStatement statement = connection.prepareStatement("DELETE FROM guilds WHERE id = ?"))
{
try (PreparedStatement statement = connection.prepareStatement("DELETE FROM guilds WHERE id = ?")) {
statement.setInt(1, guild.getId());
statement.execute();
}
Room room = Emulator.getGameEnvironment().getRoomManager().getRoom(guild.getRoomId());
if (room != null)
{
if (room != null) {
room.setGuild(0);
}
}
catch (SQLException e)
{
} catch (SQLException e) {
Emulator.getLogging().logSQLException(e);
}
}
public void clearInactiveGuilds()
{
List<Integer> toRemove = new ArrayList<>();
public void clearInactiveGuilds() {
List<Integer> toRemove = new ArrayList<Integer>();
TIntObjectIterator<Guild> guilds = this.guilds.iterator();
for (int i = this.guilds.size(); i-- > 0; )
{
try
{
for (int i = this.guilds.size(); i-- > 0; ) {
try {
guilds.advance();
}
catch (NoSuchElementException e)
{
} catch (NoSuchElementException e) {
break;
}
if (guilds.value().lastRequested < Emulator.getIntUnixTimestamp() - 300)
{
if (guilds.value().lastRequested < Emulator.getIntUnixTimestamp() - 300) {
toRemove.add(guilds.value().getId());
}
}
for (Integer i : toRemove)
{
for (Integer i : toRemove) {
this.guilds.remove(i);
}
}
public void joinGuild(Guild guild, GameClient client, int userId, boolean acceptRequest)
{
public void joinGuild(Guild guild, GameClient client, int userId, boolean acceptRequest) {
boolean error = false;
try (Connection connection = Emulator.getDatabase().getDataSource().getConnection())
{
try(PreparedStatement statement = connection.prepareStatement("SELECT COUNT(id) as total FROM guilds_members WHERE user_id = ?"))
{
try (Connection connection = Emulator.getDatabase().getDataSource().getConnection()) {
try (PreparedStatement statement = connection.prepareStatement("SELECT COUNT(id) as total FROM guilds_members WHERE user_id = ?")) {
if (userId == 0)
statement.setInt(1, client.getHabbo().getHabboInfo().getId());
else
statement.setInt(1, userId);
try (ResultSet set = statement.executeQuery())
{
if (set.next())
{
if (set.getInt(1) >= 100)
{
try (ResultSet set = statement.executeQuery()) {
if (set.next()) {
if (set.getInt(1) >= 100) {
//TODO Add non acceptRequest errors. See Outgoing.GroupEditFailComposer
if (userId == 0)
client.sendResponse(new GuildJoinErrorComposer(GuildJoinErrorComposer.GROUP_LIMIT_EXCEED));
@ -234,17 +190,12 @@ public class GuildManager
}
}
if(!error)
{
try (PreparedStatement statement = connection.prepareStatement("SELECT COUNT(id) as total FROM guilds_members WHERE guild_id = ? AND level_id < 3"))
{
if (!error) {
try (PreparedStatement statement = connection.prepareStatement("SELECT COUNT(id) as total FROM guilds_members WHERE guild_id = ? AND level_id < 3")) {
statement.setInt(1, guild.getId());
try (ResultSet set = statement.executeQuery())
{
if (set.next())
{
if (set.getInt(1) >= 50000)
{
try (ResultSet set = statement.executeQuery()) {
if (set.next()) {
if (set.getInt(1) >= 50000) {
client.sendResponse(new GuildJoinErrorComposer(GuildJoinErrorComposer.GROUP_FULL));
error = true;
}
@ -252,19 +203,13 @@ public class GuildManager
}
}
if (userId == 0 && !error)
{
if (guild.getState() == GuildState.LOCKED)
{
try (PreparedStatement statement = connection.prepareStatement("SELECT COUNT(id) as total FROM guilds_members WHERE guild_id = ? AND level_id = 3"))
{
if (userId == 0 && !error) {
if (guild.getState() == GuildState.LOCKED) {
try (PreparedStatement statement = connection.prepareStatement("SELECT COUNT(id) as total FROM guilds_members WHERE guild_id = ? AND level_id = 3")) {
statement.setInt(1, guild.getId());
try (ResultSet set = statement.executeQuery())
{
if (set.next())
{
if (set.getInt(1) >= 100)
{
try (ResultSet set = statement.executeQuery()) {
if (set.next()) {
if (set.getInt(1) >= 100) {
client.sendResponse(new GuildJoinErrorComposer(GuildJoinErrorComposer.GROUP_NOT_ACCEPT_REQUESTS));
error = true;
}
@ -272,18 +217,13 @@ public class GuildManager
}
}
if(!error)
{
try (PreparedStatement statement = connection.prepareStatement("SELECT COUNT(id) as total FROM guilds_members WHERE guild_id = ? AND user_id = ? LIMIT 1"))
{
if (!error) {
try (PreparedStatement statement = connection.prepareStatement("SELECT COUNT(id) as total FROM guilds_members WHERE guild_id = ? AND user_id = ? LIMIT 1")) {
statement.setInt(1, guild.getId());
statement.setInt(2, client.getHabbo().getHabboInfo().getId());
try (ResultSet set = statement.executeQuery())
{
if (set.next())
{
if (set.getInt(1) >= 1)
{
try (ResultSet set = statement.executeQuery()) {
if (set.next()) {
if (set.getInt(1) >= 1) {
error = true;
}
}
@ -292,10 +232,8 @@ public class GuildManager
}
}
if(!error)
{
try (PreparedStatement statement = connection.prepareStatement("INSERT INTO guilds_members (guild_id, user_id, member_since, level_id) VALUES (?, ?, ?, ?)"))
{
if (!error) {
try (PreparedStatement statement = connection.prepareStatement("INSERT INTO guilds_members (guild_id, user_id, member_since, level_id) VALUES (?, ?, ?, ?)")) {
statement.setInt(1, guild.getId());
statement.setInt(2, client.getHabbo().getHabboInfo().getId());
statement.setInt(3, Emulator.getIntUnixTimestamp());
@ -303,11 +241,8 @@ public class GuildManager
statement.execute();
}
}
}
else if(!error)
{
try (PreparedStatement statement = connection.prepareStatement("UPDATE guilds_members SET level_id = ?, member_since = ? WHERE user_id = ? AND guild_id = ?"))
{
} else if (!error) {
try (PreparedStatement statement = connection.prepareStatement("UPDATE guilds_members SET level_id = ?, member_since = ? WHERE user_id = ? AND guild_id = ?")) {
statement.setInt(1, GuildRank.MEMBER.type);
statement.setInt(2, Emulator.getIntUnixTimestamp());
statement.setInt(3, userId);
@ -316,128 +251,92 @@ public class GuildManager
}
}
if(userId == 0 && !error)
{
if (userId == 0 && !error) {
if (guild.getState() == GuildState.LOCKED)
{
guild.increaseRequestCount();
ServerMessage membershipRequestMessage = new GuildMembershipRequestedComposer(guild.getId(), client.getHabbo().getHabboInfo().getId(), client.getHabbo().getHabboInfo().getUsername(), client.getHabbo().getHabboInfo().getLook(), client.getHabbo().getHabboInfo().getGender()).compose();
for (GuildMember member : this.getOnlyAdmins(guild).values())
{
Habbo habbo = Emulator.getGameEnvironment().getHabboManager().getHabbo(member.getUserId());
if (habbo != null)
{
habbo.getClient().sendResponse(membershipRequestMessage);
}
}
}
else
{
else {
guild.increaseMemberCount();
client.getHabbo().getHabboStats().addGuild(guild.getId());
}
}
}
}
catch (SQLException e)
{
} catch (SQLException e) {
Emulator.getLogging().logSQLException(e);
}
}
public void setAdmin(Guild guild, int userId)
{
try (Connection connection = Emulator.getDatabase().getDataSource().getConnection(); PreparedStatement statement = connection.prepareStatement("UPDATE guilds_members SET level_id = ? WHERE user_id = ? AND guild_id = ? LIMIT 1"))
{
public void setAdmin(Guild guild, int userId) {
try (Connection connection = Emulator.getDatabase().getDataSource().getConnection(); PreparedStatement statement = connection.prepareStatement("UPDATE guilds_members SET level_id = ? WHERE user_id = ? AND guild_id = ? LIMIT 1")) {
statement.setInt(1, 1);
statement.setInt(2, userId);
statement.setInt(3, guild.getId());
statement.execute();
}
catch (SQLException e)
{
} catch (SQLException e) {
Emulator.getLogging().logSQLException(e);
}
}
public void removeAdmin(Guild guild, int userId)
{
if(guild.getOwnerId() == userId)
public void removeAdmin(Guild guild, int userId) {
if (guild.getOwnerId() == userId)
return;
try (Connection connection = Emulator.getDatabase().getDataSource().getConnection(); PreparedStatement statement = connection.prepareStatement("UPDATE guilds_members SET level_id = ? WHERE user_id = ? AND guild_id = ? LIMIT 1"))
{
try (Connection connection = Emulator.getDatabase().getDataSource().getConnection(); PreparedStatement statement = connection.prepareStatement("UPDATE guilds_members SET level_id = ? WHERE user_id = ? AND guild_id = ? LIMIT 1")) {
statement.setInt(1, 2);
statement.setInt(2, userId);
statement.setInt(3, guild.getId());
statement.execute();
}
catch (SQLException e)
{
} catch (SQLException e) {
Emulator.getLogging().logSQLException(e);
}
}
public void removeMember(Guild guild, int userId)
{
if(guild.getOwnerId() == userId)
public void removeMember(Guild guild, int userId) {
if (guild.getOwnerId() == userId)
return;
Habbo habbo = Emulator.getGameEnvironment().getHabboManager().getHabbo(userId);
if(habbo != null && habbo.getHabboStats().guild == guild.getId())
{
if (habbo != null && habbo.getHabboStats().guild == guild.getId()) {
habbo.getHabboStats().removeGuild(guild.getId());
habbo.getHabboStats().guild = 0;
habbo.getHabboStats().run();
}
try (Connection connection = Emulator.getDatabase().getDataSource().getConnection(); PreparedStatement statement = connection.prepareStatement("DELETE FROM guilds_members WHERE user_id = ? AND guild_id = ? LIMIT 1"))
{
try (Connection connection = Emulator.getDatabase().getDataSource().getConnection(); PreparedStatement statement = connection.prepareStatement("DELETE FROM guilds_members WHERE user_id = ? AND guild_id = ? LIMIT 1")) {
statement.setInt(1, userId);
statement.setInt(2, guild.getId());
statement.execute();
}
catch (SQLException e)
{
} catch (SQLException e) {
Emulator.getLogging().logSQLException(e);
}
}
public void addGuild(Guild guild)
{
public void addGuild(Guild guild) {
guild.lastRequested = Emulator.getIntUnixTimestamp();
this.guilds.put(guild.getId(), guild);
}
public GuildMember getGuildMember(Guild guild, Habbo habbo)
{
return this.getGuildMember(guild.getId(), habbo.getHabboInfo().getId());
public GuildMember getGuildMember(Guild guild, Habbo habbo) {
return getGuildMember(guild.getId(), habbo.getHabboInfo().getId());
}
public GuildMember getGuildMember(int guildId, int habboId)
{
public GuildMember getGuildMember(int guildId, int habboId) {
GuildMember member = null;
try (Connection connection = Emulator.getDatabase().getDataSource().getConnection(); PreparedStatement statement = connection.prepareStatement("SELECT users.username, users.look, guilds_members.* FROM guilds_members INNER JOIN users ON guilds_members.user_id = users.id WHERE guilds_members.guild_id = ? AND guilds_members.user_id = ? LIMIT 1"))
{
try (Connection connection = Emulator.getDatabase().getDataSource().getConnection(); PreparedStatement statement = connection.prepareStatement("SELECT users.username, users.look, guilds_members.* FROM guilds_members INNER JOIN users ON guilds_members.user_id = users.id WHERE guilds_members.guild_id = ? AND guilds_members.user_id = ? LIMIT 1")) {
statement.setInt(1, guildId);
statement.setInt(2, habboId);
try (ResultSet set = statement.executeQuery())
{
if (set.next())
{
try (ResultSet set = statement.executeQuery()) {
if (set.next()) {
member = new GuildMember(set);
}
}
}
catch (SQLException e)
{
} catch (SQLException e) {
Emulator.getLogging().logSQLException(e);
}
@ -445,29 +344,22 @@ public class GuildManager
}
public THashSet<GuildMember> getGuildMembers(int guildId)
{
public THashSet<GuildMember> getGuildMembers(int guildId) {
return this.getGuildMembers(this.getGuild(guildId));
}
THashSet<GuildMember> getGuildMembers(Guild guild)
{
THashSet<GuildMember> guildMembers = new THashSet<>();
THashSet<GuildMember> getGuildMembers(Guild guild) {
THashSet<GuildMember> guildMembers = new THashSet<GuildMember>();
try (Connection connection = Emulator.getDatabase().getDataSource().getConnection(); PreparedStatement statement = connection.prepareStatement("SELECT users.username, users.look, guilds_members.* FROM guilds_members INNER JOIN users ON guilds_members.user_id = users.id WHERE guilds_members.guild_id = ?"))
{
try (Connection connection = Emulator.getDatabase().getDataSource().getConnection(); PreparedStatement statement = connection.prepareStatement("SELECT users.username, users.look, guilds_members.* FROM guilds_members INNER JOIN users ON guilds_members.user_id = users.id WHERE guilds_members.guild_id = ?")) {
statement.setInt(1, guild.getId());
try (ResultSet set = statement.executeQuery())
{
while (set.next())
{
try (ResultSet set = statement.executeQuery()) {
while (set.next()) {
guildMembers.add(new GuildMember(set));
}
}
}
catch (SQLException e)
{
} catch (SQLException e) {
Emulator.getLogging().logSQLException(e);
}
@ -475,261 +367,209 @@ public class GuildManager
}
public ArrayList<GuildMember> getGuildMembers(Guild guild, int page, int levelId, String query)
{
ArrayList<GuildMember> guildMembers = new ArrayList<>();
public ArrayList<GuildMember> getGuildMembers(Guild guild, int page, int levelId, String query) {
ArrayList<GuildMember> guildMembers = new ArrayList<GuildMember>();
try (Connection connection = Emulator.getDatabase().getDataSource().getConnection(); PreparedStatement statement = connection.prepareStatement("SELECT users.username, users.look, guilds_members.* FROM guilds_members INNER JOIN users ON guilds_members.user_id = users.id WHERE guilds_members.guild_id = ? " + (this.rankQuery(levelId)) + " AND users.username LIKE ? ORDER BY level_id, member_since ASC LIMIT ?, ?"))
{
try (Connection connection = Emulator.getDatabase().getDataSource().getConnection(); PreparedStatement statement = connection.prepareStatement("SELECT users.username, users.look, guilds_members.* FROM guilds_members INNER JOIN users ON guilds_members.user_id = users.id WHERE guilds_members.guild_id = ? " + (rankQuery(levelId)) + " AND users.username LIKE ? ORDER BY level_id, member_since ASC LIMIT ?, ?")) {
statement.setInt(1, guild.getId());
statement.setString(2, "%" + query + "%");
statement.setInt(3, page * 14);
statement.setInt(4, (page * 14) + 14);
try (ResultSet set = statement.executeQuery())
{
while (set.next())
{
try (ResultSet set = statement.executeQuery()) {
while (set.next()) {
guildMembers.add(new GuildMember(set));
}
}
}
catch (SQLException e)
{
} catch (SQLException e) {
Emulator.getLogging().logSQLException(e);
}
return guildMembers;
}
public int getGuildMembersCount(Guild guild, int levelId, String query)
{
int rows = 0;
try (Connection connection = Emulator.getDatabase().getDataSource().getConnection(); PreparedStatement statement = connection.prepareStatement("SELECT COUNT(*) as row_count FROM guilds_members INNER JOIN users ON guilds_members.user_id = users.id WHERE guilds_members.guild_id = ? " + (this.rankQuery(levelId)) + " AND users.username LIKE ? ORDER BY level_id, member_since"))
{
public THashMap<Integer, GuildMember> getOnlyAdmins(Guild guild) {
THashMap<Integer, GuildMember> guildAdmins = new THashMap<Integer, GuildMember>();
try (Connection connection = Emulator.getDatabase().getDataSource().getConnection(); PreparedStatement statement = connection.prepareStatement("SELECT users.username, users.look, guilds_members.* FROM guilds_members INNER JOIN users ON guilds_members.user_id = users.id WHERE guilds_members.guild_id = ? " + (rankQuery(1)))) {
statement.setInt(1, guild.getId());
statement.setString(2, "%" + query + "%");
try (ResultSet set = statement.executeQuery())
{
if (set.next())
{
rows = set.getInt("row_count");
}
}
}
catch (SQLException e)
{
Emulator.getLogging().logSQLException(e);
}
return rows;
}
public THashMap<Integer, GuildMember> getOnlyAdmins(Guild guild)
{
THashMap<Integer, GuildMember> guildAdmins = new THashMap<>();
try (Connection connection = Emulator.getDatabase().getDataSource().getConnection(); PreparedStatement statement = connection.prepareStatement("SELECT users.username, users.look, guilds_members.* FROM guilds_members INNER JOIN users ON guilds_members.user_id = users.id WHERE guilds_members.guild_id = ? " + (this.rankQuery(1))))
{
statement.setInt(1, guild.getId());
try (ResultSet set = statement.executeQuery())
{
while (set.next())
{
try (ResultSet set = statement.executeQuery()) {
while (set.next()) {
guildAdmins.put(set.getInt("user_id"), new GuildMember(set));
}
}
}
catch (SQLException e)
{
} catch (SQLException e) {
Emulator.getLogging().logSQLException(e);
}
return guildAdmins;
}
private String rankQuery(int level)
{
switch(level)
{
case 2: return "AND guilds_members.level_id = 3";
case 1: return "AND (guilds_members.level_id = 0 OR guilds_members.level_id = 1)";
default: return "AND guilds_members.level_id >= 0 AND guilds_members.level_id <= 2";
private String rankQuery(int level) {
switch (level) {
case 2:
return "AND guilds_members.level_id = 3";
case 1:
return "AND (guilds_members.level_id = 0 OR guilds_members.level_id = 1)";
default:
return "AND guilds_members.level_id >= 0 AND guilds_members.level_id <= 2";
}
}
public Guild getGuild(int guildId)
{
public Guild getGuild(int guildId) {
Guild g = this.guilds.get(guildId);
if(g == null)
{
try (Connection connection = Emulator.getDatabase().getDataSource().getConnection(); PreparedStatement statement = connection.prepareStatement("SELECT users.username, rooms.name as room_name, guilds.* FROM guilds INNER JOIN users ON guilds.user_id = users.id INNER JOIN rooms ON rooms.id = guilds.room_id WHERE guilds.id = ? LIMIT 1"))
{
if (g == null) {
try (Connection connection = Emulator.getDatabase().getDataSource().getConnection(); PreparedStatement statement = connection.prepareStatement("SELECT users.username, rooms.name as room_name, guilds.* FROM guilds INNER JOIN users ON guilds.user_id = users.id INNER JOIN rooms ON rooms.id = guilds.room_id WHERE guilds.id = ? LIMIT 1")) {
statement.setInt(1, guildId);
try (ResultSet set = statement.executeQuery())
{
if (set.next())
{
try (ResultSet set = statement.executeQuery()) {
if (set.next()) {
g = new Guild(set);
}
}
if(g != null)
if (g != null)
g.loadMemberCount();
}
catch (SQLException e)
{
} catch (SQLException e) {
Emulator.getLogging().logSQLException(e);
}
}
if(g != null)
{
if (g != null) {
g.lastRequested = Emulator.getIntUnixTimestamp();
if(!this.guilds.containsKey(guildId))
if (!this.guilds.containsKey(guildId))
this.guilds.put(guildId, g);
}
return g;
}
public List<Guild> getGuilds(int userId)
{
List<Guild> guilds = new ArrayList<>();
public List<Guild> getGuilds(int userId) {
List<Guild> guilds = new ArrayList<Guild>();
try (Connection connection = Emulator.getDatabase().getDataSource().getConnection(); PreparedStatement statement = connection.prepareStatement("SELECT guild_id FROM guilds_members WHERE user_id = ? AND level_id <= 2 ORDER BY member_since ASC"))
{
try (Connection connection = Emulator.getDatabase().getDataSource().getConnection(); PreparedStatement statement = connection.prepareStatement("SELECT guild_id FROM guilds_members WHERE user_id = ? AND level_id <= 2 ORDER BY member_since ASC")) {
statement.setInt(1, userId);
try (ResultSet set = statement.executeQuery())
{
while (set.next())
{
Guild guild = this.getGuild(set.getInt("guild_id"));
try (ResultSet set = statement.executeQuery()) {
while (set.next()) {
Guild guild = getGuild(set.getInt("guild_id"));
if (guild != null)
{
if (guild != null) {
guilds.add(guild);
}
}
}
}
catch (SQLException e)
{
} catch (SQLException e) {
Emulator.getLogging().logSQLException(e);
}
return guilds;
}
public boolean symbolColor(int colorId)
{
for(GuildPart part : this.getSymbolColors())
{
if(part.id == colorId)
public List<Guild> getAllGuilds() {
List<Guild> guilds = new ArrayList<Guild>();
try (Connection connection = Emulator.getDatabase().getDataSource().getConnection(); PreparedStatement statement = connection.prepareStatement("SELECT id FROM guilds ORDER BY id DESC LIMIT 20")) {
try (ResultSet set = statement.executeQuery()) {
while (set.next()) {
Guild guild = getGuild(set.getInt("id"));
if (guild != null) {
guilds.add(guild);
}
}
}
} catch (SQLException e) {
Emulator.getLogging().logSQLException(e);
}
return guilds;
}
public boolean symbolColor(int colorId) {
for (GuildPart part : this.getSymbolColors()) {
if (part.id == colorId)
return true;
}
return false;
}
public boolean backgroundColor(int colorId)
{
for(GuildPart part : this.getBackgroundColors())
{
if(part.id == colorId)
public boolean backgroundColor(int colorId) {
for (GuildPart part : this.getBackgroundColors()) {
if (part.id == colorId)
return true;
}
return false;
}
public THashMap<GuildPartType, THashMap<Integer, GuildPart>> getGuildParts()
{
public THashMap<GuildPartType, THashMap<Integer, GuildPart>> getGuildParts() {
return this.guildParts;
}
public Collection<GuildPart> getBases()
{
public Collection<GuildPart> getBases() {
return this.guildParts.get(GuildPartType.BASE).values();
}
public GuildPart getBase(int id)
{
public GuildPart getBase(int id) {
return this.guildParts.get(GuildPartType.BASE).get(id);
}
public Collection<GuildPart> getSymbols()
{
public Collection<GuildPart> getSymbols() {
return this.guildParts.get(GuildPartType.SYMBOL).values();
}
public GuildPart getSymbol(int id)
{
public GuildPart getSymbol(int id) {
return this.guildParts.get(GuildPartType.SYMBOL).get(id);
}
public Collection<GuildPart> getBaseColors()
{
public Collection<GuildPart> getBaseColors() {
return this.guildParts.get(GuildPartType.BASE_COLOR).values();
}
public GuildPart getBaseColor(int id)
{
public GuildPart getBaseColor(int id) {
return this.guildParts.get(GuildPartType.BASE_COLOR).get(id);
}
public Collection<GuildPart> getSymbolColors()
{
public Collection<GuildPart> getSymbolColors() {
return this.guildParts.get(GuildPartType.SYMBOL_COLOR).values();
}
public GuildPart getSymbolColor(int id)
{
public GuildPart getSymbolColor(int id) {
return this.guildParts.get(GuildPartType.SYMBOL_COLOR).get(id);
}
public Collection<GuildPart> getBackgroundColors()
{
return this.guildParts.get(GuildPartType.BACKGROUND_COLOR).values();
public Collection<GuildPart> getBackgroundColors() {
return this.guildParts.get(GuildPartType.BACKGROUND_COLOR).values();
}
public GuildPart getBackgroundColor(int id)
{
public GuildPart getBackgroundColor(int id) {
return this.guildParts.get(GuildPartType.BACKGROUND_COLOR).get(id);
}
public GuildPart getPart(GuildPartType type, int id)
{
public GuildPart getPart(GuildPartType type, int id) {
return this.guildParts.get(type).get(id);
}
public void setGuild(InteractionGuildFurni furni, int guildId)
{
public void setGuild(InteractionGuildFurni furni, int guildId) {
furni.setGuildId(guildId);
try (Connection connection = Emulator.getDatabase().getDataSource().getConnection(); PreparedStatement statement = connection.prepareStatement("UPDATE items SET guild_id = ? WHERE id = ?"))
{
try (Connection connection = Emulator.getDatabase().getDataSource().getConnection(); PreparedStatement statement = connection.prepareStatement("UPDATE items SET guild_id = ? WHERE id = ?")) {
statement.setInt(1, guildId);
statement.setInt(2, furni.getId());
statement.execute();
}
catch (SQLException e)
{
} catch (SQLException e) {
Emulator.getLogging().logSQLException(e);
}
}
public void dispose()
{
public void dispose() {
TIntObjectIterator<Guild> guildIterator = this.guilds.iterator();
for(int i = this.guilds.size(); i-- > 0;)
{
for (int i = this.guilds.size(); i-- > 0; ) {
guildIterator.advance();
if(guildIterator.value().needsUpdate)
if (guildIterator.value().needsUpdate)
guildIterator.value().run();
guildIterator.remove();

View File

@ -31,17 +31,17 @@ public class GuildMember implements Comparable
public int getUserId()
{
return this.userId;
return userId;
}
public String getUsername()
{
return this.username;
return username;
}
public String getLook()
{
return this.look;
return look;
}
public void setLook(String look)
@ -51,7 +51,7 @@ public class GuildMember implements Comparable
public int getJoinDate()
{
return this.joinDate;
return joinDate;
}
public void setJoinDate(int joinDate)
@ -61,7 +61,7 @@ public class GuildMember implements Comparable
public GuildRank getRank()
{
return this.rank;
return rank;
}
public void setRank(GuildRank rank)

View File

@ -3,27 +3,73 @@ package com.eu.habbo.habbohotel.guilds.forums;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.guilds.Guild;
import com.eu.habbo.habbohotel.users.Habbo;
import com.eu.habbo.messages.ISerialize;
import com.eu.habbo.messages.ServerMessage;
import gnu.trove.map.hash.TIntObjectHashMap;
import gnu.trove.procedure.TObjectProcedure;
import java.sql.*;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.stream.Collectors;
public class GuildForum
{
public class GuildForum implements ISerialize {
private final int guild;
private int lastRequested = Emulator.getIntUnixTimestamp();
private GuildForumComment lastComment = null;
public GuildForum(int guild)
{
private int totalThreads;
private final TIntObjectHashMap<GuildForumThread> threads;
private int lastRequested = Emulator.getIntUnixTimestamp();
public GuildForum(int guild) {
this.guild = guild;
this.threads = new TIntObjectHashMap<GuildForumThread>();
try (Connection connection = Emulator.getDatabase().getDataSource().getConnection(); PreparedStatement statement = connection.prepareStatement("SELECT author.username as author_name, author.look as look, COALESCE(admin.username, '') as admin_name, guilds_forums.id as thread_id, 0 as row_number, guilds_forums.* FROM guilds_forums " +
"INNER JOIN users AS author ON author.id = user_id " +
"LEFT JOIN users AS admin ON guilds_forums.admin_id = admin.id " +
"WHERE guild_id = ?")) {
statement.setInt(1, this.guild);
try (ResultSet set = statement.executeQuery()) {
while (set.next()) {
this.threads.put(set.getInt("id"), new GuildForumThread(set));
}
}
} catch (SQLException e) {
Emulator.getLogging().logSQLException(e);
}
}
public GuildForumThread createThread(Habbo habbo, String subject, String message)
{
public GuildForumComment getLastComment() {
if (!this.threads.valueCollection().isEmpty()) {
GuildForumThread thread = Collections.max(this.threads.valueCollection(), Comparator.comparing(GuildForumThread::getLastCommentTimestamp));
if (thread != null && thread.comments.size() > 0) {
return thread.comments.get(thread.comments.size() - 1);
}
}
return null;
}
public List<GuildForumThread> getThreads() {
return new ArrayList<>(this.threads.valueCollection());
}
public List<GuildForumThread> getThreadsByAuthor(int userId) {
return this.threads.valueCollection().stream().filter(p -> p.getAuthorId() == userId).collect(Collectors.toList());
}
public GuildForumThread getThread(int threadId) {
return threads.get(threadId);
}
public GuildForumThread createThread(Habbo habbo, String subject, String message) {
int timestamp = Emulator.getIntUnixTimestamp();
GuildForumThread thread = null;
try (Connection connection = Emulator.getDatabase().getDataSource().getConnection(); PreparedStatement statement = connection.prepareStatement("INSERT INTO guilds_forums (guild_id, user_id, subject, message, timestamp) VALUES (?, ?, ?, ?, ?)", Statement.RETURN_GENERATED_KEYS))
{
try (Connection connection = Emulator.getDatabase().getDataSource().getConnection(); PreparedStatement statement = connection.prepareStatement("INSERT INTO guilds_forums (guild_id, user_id, subject, message, timestamp) VALUES (?, ?, ?, ?, ?)", Statement.RETURN_GENERATED_KEYS)) {
statement.setInt(1, this.guild);
statement.setInt(2, habbo.getClient().getHabbo().getHabboInfo().getId());
statement.setString(3, subject);
@ -31,104 +77,124 @@ public class GuildForum
statement.setInt(5, timestamp);
statement.execute();
try (ResultSet set = statement.getGeneratedKeys())
{
if (set.next())
{
return thread = new GuildForumThread(habbo, set.getInt(1), this.guild, subject, message, timestamp);
try (ResultSet set = statement.getGeneratedKeys()) {
if (set.next()) {
thread = new GuildForumThread(habbo, set.getInt(1), this.guild, subject, message, timestamp);
this.threads.put(set.getInt(1), //Thread id
thread);
}
}
}
catch(SQLException e)
{
} catch (SQLException e) {
Emulator.getLogging().logSQLException(e);
}
return thread;
}
public int getGuild()
{
//TODO:
public void hideThread(int threadId) {
this.threads.get(threadId).setState(ThreadState.HIDDEN_BY_ADMIN);
}
public int getGuild() {
return this.guild;
}
public int getLastRequestedTime()
{
int getLastRequestedTime() {
return this.lastRequested;
}
public void serializeThreads(final ServerMessage message)
{
@Override
public void serialize(ServerMessage message) {
}
public int threadSize()
{
public void serializeThreads(final ServerMessage message) {
synchronized (this.threads) {
message.appendInt(this.threads.size());
return 0;
this.threads.forEachValue(new TObjectProcedure<GuildForumThread>() {
@Override
public boolean execute(GuildForumThread thread) {
thread.serialize(message);
return true;
}
});
}
}
public void updateLastRequested()
{
public int threadSize() {
synchronized (this.threads) {
return this.threads.size();
}
}
void updateLastRequested() {
this.lastRequested = Emulator.getIntUnixTimestamp();
}
public enum ThreadState
{
OPEN(0),
CLOSED(1),
public enum ThreadState {
CLOSED(0),
OPEN(1),
HIDDEN_BY_ADMIN(10), //DELETED
HIDDEN_BY_STAFF(20);
public final int state;
ThreadState(int state)
{
ThreadState(int state) {
this.state = state;
}
public static ThreadState fromValue(int state)
{
switch (state)
{
case 0: return OPEN;
case 1: return CLOSED;
case 10: return HIDDEN_BY_ADMIN;
case 20: return HIDDEN_BY_STAFF;
public static ThreadState fromValue(int state) {
switch (state) {
case 0:
return CLOSED;
case 1:
return OPEN;
case 10:
return HIDDEN_BY_ADMIN;
case 20:
return HIDDEN_BY_STAFF;
}
return OPEN;
}
}
public void serializeUserForum(ServerMessage response, Habbo habbo)
{
public void serializeUserForum(ServerMessage response, Habbo habbo) {
Guild guild = Emulator.getGameEnvironment().getGuildManager().getGuild(this.guild);
response.appendInt(guild.getId()); //k._SafeStr_6864 = _arg_2._SafeStr_5878(); = guild_id
response.appendString(guild.getName()); //k._name = _arg_2.readString(); = name
response.appendString(guild.getDescription()); //k._SafeStr_5790 = _arg_2.readString(); = description
response.appendString(guild.getBadge()); //k._icon = _arg_2.readString(); = icon
response.appendInt(0); //k._SafeStr_11338 = _arg_2._SafeStr_5878(); (?)
response.appendInt(0); //k._SafeStr_19191 = _arg_2._SafeStr_5878(); = rating
response.appendInt(0); //k._SafeStr_11328 = _arg_2._SafeStr_5878(); = total_messages
response.appendInt(0); //k._SafeStr_19192 = _arg_2._SafeStr_5878(); = new_messages
GuildForum forum = Emulator.getGameEnvironment().getGuildForumManager().getGuildForum(this.guild);
if (this.lastComment != null)
{
response.appendInt(this.lastComment.getThreadId()); //k._SafeStr_19193 = _arg_2._SafeStr_5878(); (?)
response.appendInt(this.lastComment.getUserId()); //k._SafeStr_19194 = _arg_2._SafeStr_5878(); = last_author_id
response.appendString(this.lastComment.getUserName()); //k._SafeStr_19195 = _arg_2.readString(); = last_author_name
response.appendInt(this.lastComment.getTimestamp()); //k._SafeStr_19196 = _arg_2._SafeStr_5878(); = update_time
Integer amountOfComments = forum.getThreads().stream().map(GuildForumThread::getAmountOfComments).mapToInt(Integer::intValue).sum();
response.appendInt(guild.getId());
response.appendString(guild.getName());
response.appendString(guild.getDescription());
response.appendString(guild.getBadge());
response.appendInt(0);
response.appendInt(0); //Rating
response.appendInt(amountOfComments);
response.appendInt(0); //New Messages
GuildForumComment comment = this.getLastComment();
if (comment != null) {
response.appendInt(comment.getThreadId());
response.appendInt(comment.getUserId());
response.appendString(comment.getUserName());
response.appendInt(Emulator.getIntUnixTimestamp() - comment.getTimestamp());
return;
}
response.appendInt(-1);
response.appendInt(-1);
response.appendString("");
response.appendInt(0);
}
}

View File

@ -8,9 +8,10 @@ import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.List;
import java.util.stream.Collectors;
public class GuildForumComment implements ISerialize, Runnable
{
public class GuildForumComment implements ISerialize, Runnable {
private int id;
private final int guildId;
private final int threadId;
@ -23,161 +24,134 @@ public class GuildForumComment implements ISerialize, Runnable
private GuildForum.ThreadState state = GuildForum.ThreadState.OPEN;
private int adminId;
private String adminName;
private int authorPostCount;
public GuildForumComment(int guildId, int threadId, int userId, String userName, String look, String message)
{
this.guildId = guildId;
this.threadId = threadId;
this.userId = userId;
this.userName = userName;
this.look = look;
public GuildForumComment(int guildId, int threadId, int userId, String userName, String look, String message) {
this.guildId = guildId;
this.threadId = threadId;
this.userId = userId;
this.userName = userName;
this.look = look;
this.timestamp = Emulator.getIntUnixTimestamp();
this.message = message;
this.message = message;
this.adminName = "";
}
public GuildForumComment(final ResultSet set, final int index) throws SQLException
{
this.id = set.getInt("id");
this.guildId = set.getInt("guild_id");
this.threadId = set.getInt("thread_id");
this.index = index;
this.userId = set.getInt("user_id");
this.userName = set.getString("author_name");
this.look = set.getString("look");
public GuildForumComment(final ResultSet set, int index, int guildId) throws SQLException {
this.id = set.getInt("id");
this.guildId = guildId;
this.threadId = set.getInt("thread_id");
this.index = index;
this.userId = set.getInt("user_id");
this.userName = set.getString("author_name");
this.look = set.getString("look");
this.timestamp = set.getInt("timestamp");
this.message = set.getString("message");
this.state = GuildForum.ThreadState.valueOf(set.getString("state"));
this.adminId = set.getInt("admin_id");
this.message = set.getString("message");
this.state = GuildForum.ThreadState.valueOf(set.getString("state"));
this.adminId = set.getInt("admin_id");
this.adminName = set.getString("admin_name");
}
public void setAuthorPostCount(int authorPostCount)
{
this.authorPostCount = authorPostCount;
public int getAuthorPostCount() {
GuildForum guildForum = Emulator.getGameEnvironment().getGuildForumManager().getGuildForum(this.guildId);
List<GuildForumComment> matchingObjects = guildForum.getThreads().stream().flatMap(e -> e.getAllComments().stream()).collect(Collectors.toList()).stream().filter(c -> c.getUserId() == this.userId).collect(Collectors.toList());
return matchingObjects.size();
}
@Override
public void serialize(ServerMessage message)
{
message.appendInt(this.id); //_local_2.messageId = k._SafeStr_5878(); = message_id
message.appendInt(this.index); //_local_2.messageIndex = k._SafeStr_5878(); = message_index
message.appendInt(this.userId); //_local_2._SafeStr_11317 = k._SafeStr_5878(); = author_id
message.appendString(this.userName); //_local_2._SafeStr_6798 = k.readString(); = author_name
message.appendString(this.look); //_local_2._SafeStr_11319 = k.readString(); = author_look
message.appendInt(Emulator.getIntUnixTimestamp() - this.timestamp); //_local_2._SafeStr_11164 = k._SafeStr_5878(); = creation_time
message.appendString(this.message); //_local_2._SafeStr_9526 = k.readString(); = message
message.appendByte(this.state.state); //_local_2.state = k.readByte(); = state
message.appendInt(this.adminId); //_local_2._SafeStr_19188 = k._SafeStr_5878(); = admin_id
message.appendString(this.adminName); //_local_2._SafeStr_11326 = k.readString(); = admin_name
message.appendInt(0); //_local_2._SafeStr_19189 = k._SafeStr_5878(); = (UNUSED)
message.appendInt(this.authorPostCount); //_local_2._SafeStr_11320 = k._SafeStr_5878(); = author_post_count
public void serialize(ServerMessage message) {
message.appendInt(this.id);
message.appendInt(this.index - 1);
message.appendInt(this.userId);
message.appendString(this.userName);
message.appendString(this.look);
message.appendInt(Emulator.getIntUnixTimestamp() - this.timestamp);
message.appendString(this.message);
message.appendByte(this.state.state);
message.appendInt(this.adminId);
message.appendString(this.adminName);
message.appendInt(0);
message.appendInt(this.getAuthorPostCount());
}
public int getId()
{
public int getId() {
return this.id;
}
public void setId(int id)
{
public void setId(int id) {
this.id = id;
}
public int getThreadId()
{
public int getThreadId() {
return this.threadId;
}
public int getIndex()
{
public int getIndex() {
return this.index;
}
public void setIndex(int index)
{
public void setIndex(int index) {
this.index = index;
}
public int getUserId()
{
public int getUserId() {
return this.userId;
}
public String getUserName()
{
public String getUserName() {
return this.userName;
}
public String getLook()
{
public String getLook() {
return this.look;
}
public int getTimestamp()
{
public int getTimestamp() {
return this.timestamp;
}
public String getMessage()
{
public String getMessage() {
return this.message;
}
public GuildForum.ThreadState getState()
{
public GuildForum.ThreadState getState() {
return this.state;
}
public void setState(GuildForum.ThreadState state)
{
public void setState(GuildForum.ThreadState state) {
this.state = state;
}
public int getAdminId()
{
public int getAdminId() {
return this.adminId;
}
public void setAdminId(int adminId)
{
public void setAdminId(int adminId) {
this.adminId = adminId;
}
public String getAdminName()
{
public String getAdminName() {
return this.adminName;
}
public void setAdminName(String adminName)
{
public void setAdminName(String adminName) {
this.adminName = adminName;
}
public int getAuthorPostCount()
{
return this.authorPostCount;
}
@Override
public void run()
{
try (Connection connection = Emulator.getDatabase().getDataSource().getConnection(); PreparedStatement statement = connection.prepareStatement("UPDATE guilds_forums_comments SET state = ?, admin_id = ? WHERE id = ?"))
{
public void run() {
try (Connection connection = Emulator.getDatabase().getDataSource().getConnection(); PreparedStatement statement = connection.prepareStatement("UPDATE guilds_forums_comments SET state = ?, admin_id = ? WHERE id = ?")) {
statement.setString(1, this.state.name());
statement.setInt(2, this.adminId);
statement.setInt(3, this.getId());
statement.execute();
}
catch (SQLException e)
{
} catch (SQLException e) {
Emulator.getLogging().logSQLException(e);
}
}
public int getGuildId()
{
public int getGuildId() {
return this.guildId;
}
}

View File

@ -8,80 +8,144 @@ import gnu.trove.iterator.TIntObjectIterator;
import gnu.trove.map.TIntObjectMap;
import gnu.trove.map.hash.TIntObjectHashMap;
import java.util.ArrayList;
import java.util.List;
import java.util.NoSuchElementException;
import java.util.*;
public class GuildForumManager
{
public class GuildForumManager {
private final TIntObjectMap<GuildForum> guildForums;
public GuildForumManager()
{
this.guildForums = TCollections.synchronizedMap(new TIntObjectHashMap<>());
public void addGuildForum(int guildId) {
GuildForum forum = new GuildForum(guildId);
this.guildForums.put(guildId, forum);
}
public GuildForum getGuildForum(int guildId)
{
synchronized (this.guildForums)
{
public GuildForumManager() {
this.guildForums = TCollections.synchronizedMap(new TIntObjectHashMap<GuildForum>());
}
public GuildForum getGuildForum(int guildId) {
synchronized (this.guildForums) {
GuildForum forum = this.guildForums.get(guildId);
if (forum == null)
{
if (forum == null) {
Guild guild = Emulator.getGameEnvironment().getGuildManager().getGuild(guildId);
if (guild != null && guild.hasForum())
{
forum = new GuildForum(guild.getId());
this.guildForums.put(guild.getId(), forum);
if (guild != null && guild.hasForum()) {
forum = new GuildForum(guildId);
this.guildForums.put(guildId, forum);
}
}
if (forum != null)
{
if (forum != null) {
forum.updateLastRequested();
return forum;
}
return forum;
return null;
}
}
public void clearInactiveForums()
{
int time = Emulator.getIntUnixTimestamp();
public void clearInactiveForums() {
List<Integer> toRemove = new ArrayList<Integer>();
TIntObjectIterator<GuildForum> guildForums = this.guildForums.iterator();
for(int i = this.guildForums.size(); i-- > 0;)
{
try
{
for (int i = this.guildForums.size(); i-- > 0; ) {
try {
guildForums.advance();
}
catch (NoSuchElementException e)
{
} catch (NoSuchElementException | ConcurrentModificationException e) {
break;
}
if (time - guildForums.value().getLastRequestedTime() > 300)
{
this.guildForums.remove(guildForums.key());
if (guildForums.value().getLastRequestedTime() < Emulator.getIntUnixTimestamp() - 300) {
toRemove.add(guildForums.key());
}
for (Integer j : toRemove) {
this.guildForums.remove(j);
}
}
}
public List<GuildForum> getGuildForums(Habbo habbo)
{
public List<GuildForum> getGuildForums(Habbo habbo) {
List<GuildForum> forums = new ArrayList<>();
for (Integer i : habbo.getHabboStats().guilds)
{
Guild guild = Emulator.getGameEnvironment().getGuildManager().getGuild(i);
if (guild != null && guild.hasForum())
{
forums.add(this.getGuildForum(i));
for (Integer i : habbo.getHabboStats().guilds) {
forums.add(this.getGuildForum(i));
}
return forums;
}
public List<GuildForum> getAllForums() {
List<GuildForum> forums = new ArrayList<>();
for (Guild guild : Emulator.getGameEnvironment().getGuildManager().getAllGuilds()) {
if (guild != null && guild.hasForum()) {
forums.add(this.getGuildForum(guild.getId()));
}
}
return forums;
}
public List<GuildForum> getAllForumsWithPosts() {
List<GuildForum> forums = new ArrayList<>();
for (Guild guild : Emulator.getGameEnvironment().getGuildManager().getAllGuilds()) {
if (guild != null && guild.hasForum()) {
GuildForum forum = this.getGuildForum(guild.getId());
if (forum.getLastComment() == null)
continue;
forums.add(forum);
}
}
return forums;
}
private static final Comparator<GuildForum> SORT_ACTIVE = new Comparator<GuildForum>() {
@Override
public int compare(GuildForum o1, GuildForum o2) {
if (o2.getLastComment() == null || o2.getLastComment().getTimestamp() <= 0)
return 0;
if (o1.getLastComment() == null || o1.getLastComment().getTimestamp() <= 0)
return 0;
return o2.getLastComment().getTimestamp() - o1.getLastComment().getTimestamp();
}
};
private static final Comparator<GuildForum> SORT_VISITED = new Comparator<GuildForum>() {
@Override
public int compare(GuildForum o1, GuildForum o2) {
if (o2.getLastRequestedTime() <= 0 || o1.getLastRequestedTime() <= 0)
return 0;
return o2.getLastRequestedTime() - o1.getLastRequestedTime();
}
};
public List<GuildForum> getAllForumsByActive() {
List<GuildForum> forums = this.getAllForumsWithPosts();
forums.sort(SORT_ACTIVE);
return forums;
}
public List<GuildForum> getAllForumsByVisited() {
List<GuildForum> forums = this.getAllForumsWithPosts();
forums.sort(SORT_VISITED);
return forums;
}
}

View File

@ -4,14 +4,15 @@ import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.users.Habbo;
import com.eu.habbo.messages.ISerialize;
import com.eu.habbo.messages.ServerMessage;
import gnu.trove.map.hash.THashMap;
import java.sql.*;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.ConcurrentHashMap;
public class GuildForumThread implements ISerialize, Runnable
{
public class GuildForumThread implements ISerialize, Runnable {
private final int threadId;
private final int guildId;
private final int authorId;
@ -23,16 +24,24 @@ public class GuildForumThread implements ISerialize, Runnable
private boolean pinned = false;
private boolean locked = false;
private int lastAuthorId;
private int lastAuthorId = 0;
private String lastAuthorName;
private int lastCommentTimestamp;
public int getLastCommentTimestamp() {
return this.lastCommentTimestamp;
}
private int lastCommentTimestamp = 0;
private int adminId;
private String adminName = "";
public final ConcurrentHashMap<Integer, GuildForumComment> comments = new ConcurrentHashMap<>();
private int commentsIndex = 1;
public GuildForumThread(Habbo habbo, int threadId, int guildId, String subject, String message, int timestamp)
{
public final THashMap<Integer, GuildForumComment> comments;
public GuildForumThread(Habbo habbo, int threadId, int guildId, String subject, String message, int timestamp) {
this.threadId = threadId;
this.guildId = guildId;
this.authorId = habbo.getHabboInfo().getId();
@ -44,11 +53,13 @@ public class GuildForumThread implements ISerialize, Runnable
this.lastAuthorId = this.authorId;
this.lastAuthorName = this.authorName;
this.lastCommentTimestamp = this.timestamp;
this.comments = new THashMap<>();
}
//Via de database inladen;
public GuildForumThread(ResultSet set) throws SQLException
{
public GuildForumThread(ResultSet set) throws SQLException {
this.threadId = set.getInt("id");
this.guildId = set.getInt("guild_id");
this.authorId = set.getInt("user_id");
@ -67,97 +78,76 @@ public class GuildForumThread implements ISerialize, Runnable
this.lastAuthorName = this.authorName;
this.lastCommentTimestamp = this.timestamp;
this.addComment(new GuildForumComment(set, 0));
this.comments = new THashMap<>();
this.comments.put(commentsIndex, new GuildForumComment(set, commentsIndex, guildId));
commentsIndex++;
try (Connection connection = Emulator.getDatabase().getDataSource().getConnection(); PreparedStatement statement = connection.prepareStatement("SELECT " +
"author.username AS author_name, " +
"COALESCE(admin.username, '') as admin_name, " +
"author.look, " +
"guilds_forums_comments.*" +
"guilds_forums_comments.* " +
"FROM guilds_forums_comments " +
"INNER JOIN users AS author ON guilds_forums_comments.user_id = author.id " +
"LEFT JOIN users AS admin ON guilds_forums_comments.admin_id = admin.id " +
"WHERE thread_id = ? " +
"ORDER BY id ASC"))
{
"ORDER BY id ASC")) {
statement.setInt(1, this.threadId);
try (ResultSet commentSet = statement.executeQuery())
{
int index = 1;
while (commentSet.next())
{
if (!commentSet.isLast())
{
this.comments.put(set.getInt("id"), new GuildForumComment(commentSet, index));
}
else
{
this.addComment(new GuildForumComment(commentSet, index));
}
++index;
try (ResultSet commentSet = statement.executeQuery()) {
while (commentSet.next()) {
this.comments.put(commentsIndex, new GuildForumComment(commentSet, commentsIndex, this.guildId));
commentsIndex++;
}
}
}
catch (SQLException e)
{
} catch (SQLException e) {
Emulator.getLogging().logSQLException(e);
}
}
public void addComment(GuildForumComment comment)
{
if (comment.getIndex() == -1)
{
if (!this.comments.isEmpty())
{
GuildForumComment previousComment = this.comments.get(this.comments.size() - 1);
public void setPinned(boolean pinned) {
this.pinned = pinned;
}
if (previousComment != null)
{
comment.setIndex(previousComment.getIndex() + 1);
}
}
public void setLocked(boolean locked) {
this.locked = locked;
}
public void addComment(GuildForumComment comment) {
synchronized (this.comments) {
comment.setIndex(commentsIndex);
this.comments.put(commentsIndex, comment);
commentsIndex++;
}
this.comments.put(comment.getId(), comment);
this.lastAuthorId = comment.getUserId();
this.lastAuthorName = comment.getUserName();
this.lastCommentTimestamp = comment.getTimestamp();
}
public GuildForumComment addComment(Habbo habbo, String message)
{
public GuildForumComment addComment(Habbo habbo, String message) {
int commentId = -1;
GuildForumComment comment = new GuildForumComment(this.guildId, this.threadId, habbo.getHabboInfo().getId(), habbo.getHabboInfo().getUsername(), habbo.getHabboInfo().getLook(), message);
try (Connection connection = Emulator.getDatabase().getDataSource().getConnection(); PreparedStatement statement = connection.prepareStatement("INSERT INTO guilds_forums_comments (thread_id, user_id, timestamp, message) VALUES (?, ?, ?, ?)", Statement.RETURN_GENERATED_KEYS))
{
try (Connection connection = Emulator.getDatabase().getDataSource().getConnection(); PreparedStatement statement = connection.prepareStatement("INSERT INTO guilds_forums_comments (thread_id, user_id, timestamp, message) VALUES (?, ?, ?, ?)", Statement.RETURN_GENERATED_KEYS)) {
statement.setInt(1, this.threadId);
statement.setInt(2, habbo.getHabboInfo().getId());
int nowTimestamp = Emulator.getIntUnixTimestamp();
statement.setInt(3, nowTimestamp);
statement.setString(4, message);
statement.execute();
try (ResultSet set = statement.getGeneratedKeys())
{
if (set.next())
{
try (ResultSet set = statement.getGeneratedKeys()) {
if (set.next()) {
commentId = set.getInt(1);
}
}
}
catch (SQLException e)
{
} catch (SQLException e) {
Emulator.getLogging().logSQLException(e);
}
if (commentId >= 0)
{
if (commentId >= 0) {
comment.setId(commentId);
this.addComment(comment);
addComment(comment);
return comment;
}
@ -165,131 +155,149 @@ public class GuildForumThread implements ISerialize, Runnable
return null;
}
public GuildForumComment getComment(int id)
{
synchronized (this.comments)
{
public GuildForumComment getCommentById(int id) {
synchronized (this.comments) {
for(GuildForumComment comment : this.comments.values()) {
if(comment.getId() == id) {
return comment;
}
}
}
return null;
}
public GuildForumComment getCommentByIndex(int id) {
synchronized (this.comments) {
return this.comments.get(id);
}
}
public List<GuildForumComment> getComments(int page, int limit)
{
return new ArrayList<>();
/* Original Group Forum Code By Claudio and TheGeneral.
Rewritten because it was terrible.
Credits To Beny.
*/
public List<GuildForumComment> getComments(int page, int limit) {
List<GuildForumComment> allComments = new ArrayList(this.comments.values());
Collections.reverse(allComments);
List<GuildForumComment> comments = new ArrayList<>();
int start = page;
int end = start + limit;
int i = 0;
synchronized (this.comments) {
for(GuildForumComment comment : allComments) {
if(i >= start && i < end) {
comments.add(comment);
}
i++;
}
}
return comments;
}
public int getId()
{
public Collection<GuildForumComment> getAllComments() {
synchronized (this.comments) {
return this.comments.values();
}
}
public Integer getAmountOfComments() {
synchronized (this.comments) {
return this.comments.size();
}
}
public int getId() {
return this.threadId;
}
public int getGuildId()
{
public int getGuildId() {
return this.guildId;
}
public int getCommentsSize()
{
public int getCommentsSize() {
return this.comments.size();
}
public String getSubject()
{
public String getSubject() {
return this.subject;
}
public int getThreadId()
{
public int getThreadId() {
return this.threadId;
}
public int getAuthorId()
{
public int getAuthorId() {
return this.authorId;
}
public String getAuthorName()
{
public String getAuthorName() {
return this.authorName;
}
public String getMessage()
{
public String getMessage() {
return this.message;
}
public GuildForum.ThreadState getState()
{
public GuildForum.ThreadState getState() {
return this.state;
}
public void setState(GuildForum.ThreadState state)
{
public void setState(GuildForum.ThreadState state) {
this.state = state;
}
public void setAdminId(int adminId)
{
public void setAdminId(int adminId) {
this.adminId = adminId;
}
public void setAdminName(String adminName)
{
public void setAdminName(String adminName) {
this.adminName = adminName;
}
public void serializeComments(final ServerMessage message, int index, int limit)
{
List<GuildForumComment> comments;
synchronized (this.comments)
{
comments = this.getComments(index, limit);
}
if (comments != null)
{
message.appendInt(comments.size());
for (GuildForumComment comment : comments)
{
comment.serialize(message);
}
}
public boolean isPinned() {
return pinned;
}
public boolean isLocked() {
return locked;
}
@Override
public void serialize(ServerMessage message)
{
public void serialize(ServerMessage message) {
int nowTimestamp = Emulator.getIntUnixTimestamp();
message.appendInt(this.threadId); //_local_2.threadId = k._SafeStr_5878();
message.appendInt(this.authorId); //_local_2._SafeStr_11333 = k._SafeStr_5878(); = thread_author_id
message.appendString(this.authorName); //_local_2._SafeStr_11334 = k.readString(); = thread_author_name
message.appendString(this.subject); //_local_2.header = k.readString(); = look
message.appendBoolean(this.pinned); //_local_2._SafeStr_11331 = k.readBoolean(); = pinned
message.appendBoolean(this.locked); //_local_2._SafeStr_5801 = k.readBoolean(); = locked
message.appendInt(nowTimestamp - this.timestamp); //_local_2._SafeStr_11164 = k._SafeStr_5878(); = creation_time
message.appendInt(this.getCommentsSize()); //_local_2._SafeStr_11239 = k._SafeStr_5878(); = total_messages
message.appendInt(0); //_local_2._SafeStr_11260 = k._SafeStr_5878(); = unread_messages(?)
message.appendInt(1); //_local_2._SafeStr_11242 = k._SafeStr_5878(); = Something message count related.
message.appendInt(this.lastAuthorId); //_local_2._SafeStr_11188 = k._SafeStr_5878(); = last_author_id
message.appendString(this.lastAuthorName); //_local_2._SafeStr_11189 = k.readString(); = last_author_name
message.appendInt(nowTimestamp - this.lastCommentTimestamp); //_local_2._SafeStr_11190 = k._SafeStr_5878(); = update_time, seconds ago
message.appendByte(this.state.state); //_local_2.state = k.readByte(); = state
message.appendInt(this.adminId); //_local_2._SafeStr_19188 = k._SafeStr_5878(); = admin id
message.appendString(this.adminName); //_local_2._SafeStr_11326 = k.readString(); = admin_name
message.appendInt(this.threadId); //_local_2._SafeStr_19214 = k._SafeStr_5878(); //UNUSED?
message.appendInt(this.threadId);
message.appendInt(this.authorId);
message.appendString(this.authorName);
message.appendString(this.subject);
message.appendBoolean(this.pinned);
message.appendBoolean(this.locked);
message.appendInt(nowTimestamp - this.timestamp);
message.appendInt(this.getCommentsSize());
message.appendInt(0);
message.appendInt(1);
message.appendInt(this.lastAuthorId);
message.appendString(this.lastAuthorName);
message.appendInt(nowTimestamp - this.lastCommentTimestamp);
message.appendByte(this.state.state);
message.appendInt(this.adminId);
message.appendString(this.adminName);
message.appendInt(this.threadId);
}
@Override
public void run()
{
try (Connection connection = Emulator.getDatabase().getDataSource().getConnection(); PreparedStatement statement = connection.prepareStatement("UPDATE guilds_forums SET message = ?, state = ?, pinned = ?, locked = ?, admin_id = ? WHERE id = ?"))
{
public void run() {
try (Connection connection = Emulator.getDatabase().getDataSource().getConnection(); PreparedStatement statement = connection.prepareStatement("UPDATE guilds_forums SET message = ?, state = ?, pinned = ?, locked = ?, admin_id = ? WHERE id = ?")) {
statement.setString(1, this.message);
statement.setString(2, this.state.name());
statement.setString(3, this.pinned ? "1" : "0");
@ -297,9 +305,7 @@ public class GuildForumThread implements ISerialize, Runnable
statement.setInt(5, this.adminId);
statement.setInt(6, this.getId());
statement.execute();
}
catch (SQLException e)
{
} catch (SQLException e) {
Emulator.getLogging().logSQLException(e);
}
}

View File

@ -468,23 +468,9 @@ public class Habbo implements Runnable
public int noobStatus()
{
if (this.firstVisit)
{
return 2;
}
int accountAge = Emulator.getIntUnixTimestamp() - this.habboInfo.getAccountCreated();
if (accountAge < (86400))
{
return 2;
}
if (accountAge < (3 * 86400))
{
return 1;
}
return 0;
}
public void clearCaches()

View File

@ -29,8 +29,7 @@ import com.eu.habbo.messages.incoming.guardians.GuardianNoUpdatesWantedEvent;
import com.eu.habbo.messages.incoming.guardians.GuardianVoteEvent;
import com.eu.habbo.messages.incoming.guides.*;
import com.eu.habbo.messages.incoming.guilds.*;
import com.eu.habbo.messages.incoming.guilds.forums.GuildForumDataEvent;
import com.eu.habbo.messages.incoming.guilds.forums.GuildForumListEvent;
import com.eu.habbo.messages.incoming.guilds.forums.*;
import com.eu.habbo.messages.incoming.handshake.*;
import com.eu.habbo.messages.incoming.helper.RequestTalentTrackEvent;
import com.eu.habbo.messages.incoming.hotelview.*;
@ -525,16 +524,23 @@ public class PacketManager
this.registerHandler(Incoming.GuildConfirmRemoveMemberEvent, GuildConfirmRemoveMemberEvent.class);
this.registerHandler(Incoming.GuildRemoveFavoriteEvent, GuildRemoveFavoriteEvent.class);
this.registerHandler(Incoming.GuildDeleteEvent, GuildDeleteEvent.class);
this.registerHandler(Incoming.GuildForumListEvent, GuildForumListEvent.class);
this.registerHandler(Incoming.GuildForumThreadsEvent, GuildForumThreadsEvent.class);
this.registerHandler(Incoming.GuildForumDataEvent, GuildForumDataEvent.class);
this.registerHandler(Incoming.GuildForumPostThreadEvent, GuildForumPostThreadEvent.class);
this.registerHandler(Incoming.GuildForumUpdateSettingsEvent, GuildForumUpdateSettingsEvent.class);
this.registerHandler(Incoming.GuildForumThreadsMessagesEvent, GuildForumThreadsMessagesEvent.class);
this.registerHandler(Incoming.GuildForumModerateMessageEvent, GuildForumModerateMessageEvent.class);
this.registerHandler(Incoming.GuildForumModerateThreadEvent, GuildForumModerateThreadEvent.class);
this.registerHandler(Incoming.GuildForumThreadUpdateEvent, GuildForumThreadUpdateEvent.class);
this.registerHandler(Incoming.GetHabboGuildBadgesMessageEvent, GetHabboGuildBadgesMessageEvent.class);
this.registerHandler(Incoming.GuildForumDataEvent, GuildForumDataEvent.class);
this.registerHandler(Incoming.GuildForumListEvent, GuildForumListEvent.class);
// this.registerHandler(Incoming.GuildForumDataEvent, GuildForumModerateMessageEvent.class);
// this.registerHandler(Incoming.GuildForumDataEvent, GuildForumModerateThreadEvent.class);
// this.registerHandler(Incoming.GuildForumDataEvent, GuildForumPostThreadEvent.class);
// this.registerHandler(Incoming.GuildForumDataEvent, GuildForumThreadsEvent.class);
// this.registerHandler(Incoming.GuildForumDataEvent, GuildForumThreadsMessagesEvent.class);
// this.registerHandler(Incoming.GuildForumDataEvent, GuildForumUpdateSettingsEvent.class);
}
void registerPets() throws Exception

View File

@ -347,16 +347,17 @@ public class Incoming
public static final int StopBreedingEvent = 2713;
public static final int ConfirmPetBreedingEvent = 3382;
public static final int GuildForumListEvent = 873;
public static final int GuildForumThreadsEvent = 436;
public static final int GuildForumDataEvent = 3149;
public static final int UNKNOWN_GUILD_FORUMS_EVENT2 = 3900;
public static final int UNKNOWN_GUILD_FORUMS_EVENT3 = 873;
public static final int GuildForumListEvent = 436;
public static final int UNKNOWN_GUILD_FORUMS_EVENT5 = 232;
public static final int UNKNOWN_GUILD_FORUMS_EVENT6 = 2214;
public static final int UNKNOWN_GUILD_FORUMS_EVENT7 = 3529;
public static final int UNKNOWN_GUILD_FORUMS_EVENT8 = 1397;
public static final int UNKNOWN_GUILD_FORUMS_EVENT9 = 3045;
public static final int UNKNOWN_GUILD_FORUMS_EVENT10 = 286;
public static final int GuildForumPostThreadEvent = 3529;
public static final int GuildForumUpdateSettingsEvent = 2214;
public static final int GuildForumThreadsMessagesEvent = 232;
public static final int GuildForumModerateMessageEvent = 286;
public static final int GuildForumModerateThreadEvent = 1397;
public static final int GuildForumThreadUpdateEvent = 3045;
public static final int GuildForumMarkAsReadEvent = 1855;
public static final int UNKNOWN_SNOWSTORM_6000 = 6000;

View File

@ -32,6 +32,7 @@ public class GuildAcceptMembershipEvent extends MessageHandler
if (habbo.getHabboStats().hasGuild(guild.getId()))
{
this.client.sendResponse(new GuildAcceptMemberErrorComposer(guild.getId(), GuildAcceptMemberErrorComposer.ALREADY_ACCEPTED));
return;
}
else
{
@ -40,6 +41,7 @@ public class GuildAcceptMembershipEvent extends MessageHandler
if(member == null || member.getRank().type != GuildRank.REQUESTED.type)
{
this.client.sendResponse(new GuildAcceptMemberErrorComposer(guild.getId(), GuildAcceptMemberErrorComposer.NO_LONGER_MEMBER));
return;
}
else
{

View File

@ -25,7 +25,7 @@ public class GuildChangeBadgeEvent extends MessageHandler
int count = this.packet.readInt();
StringBuilder badge = new StringBuilder();
String badge = "";
byte base = 1;
@ -37,21 +37,21 @@ public class GuildChangeBadgeEvent extends MessageHandler
if (base == 1)
{
badge.append("b");
badge += "b";
} else
{
badge.append("s");
badge += "s";
}
badge.append(id < 100 ? "0" : "").append(id < 10 ? "0" : "").append(id).append(color < 10 ? "0" : "").append(color).append(pos);
badge += (id < 100 ? "0" : "") + (id < 10 ? "0" : "") + id + (color < 10 ? "0" : "") + color + "" + pos;
base += 3;
}
if (guild.getBadge().toLowerCase().equals(badge.toString().toLowerCase()))
if (guild.getBadge().toLowerCase().equals(badge.toLowerCase()))
return;
GuildChangedBadgeEvent badgeEvent = new GuildChangedBadgeEvent(guild, badge.toString());
GuildChangedBadgeEvent badgeEvent = new GuildChangedBadgeEvent(guild, badge);
Emulator.getPluginManager().fireEvent(badgeEvent);
if (badgeEvent.isCancelled())

View File

@ -29,7 +29,7 @@ public class GuildDeclineMembershipEvent extends MessageHandler
{
guild.decreaseRequestCount();
Emulator.getGameEnvironment().getGuildManager().removeMember(guild, userId);
this.client.sendResponse(new GuildMembersComposer(guild, Emulator.getGameEnvironment().getGuildManager().getGuildMembersCount(guild, 2, ""), Emulator.getGameEnvironment().getGuildManager().getGuildMembers(guild, 0, 2, ""), 0, 2, "", true));
this.client.sendResponse(new GuildMembersComposer(guild, Emulator.getGameEnvironment().getGuildManager().getGuildMembers(guild, 0, 0, ""), this.client.getHabbo(), 0, 0, "", true));
this.client.sendResponse(new GuildRefreshMembersListComposer(guild));
Habbo habbo = Emulator.getGameEnvironment().getHabboManager().getHabbo(userId);

View File

@ -48,7 +48,7 @@ public class RequestGuildBuyEvent extends MessageHandler
int count = this.packet.readInt();
StringBuilder badge = new StringBuilder();
String badge = "";
byte base = 1;
@ -60,19 +60,20 @@ public class RequestGuildBuyEvent extends MessageHandler
if(base == 1)
{
badge.append("b");
badge += "b";
}
else
{
badge.append("s");
badge += "s";
}
badge.append(id < 100 ? "0" : "").append(id < 10 ? "0" : "").append(id).append(color < 10 ? "0" : "").append(color).append(pos);
badge += (id < 100 ? "0" : "") + (id < 10 ? "0" : "") + id + (color < 10 ? "0" : "") + color + "" + pos;
base += 3;
}
Guild guild = Emulator.getGameEnvironment().getGuildManager().createGuild(this.client.getHabbo(), roomId, r.getName(), name, description, badge.toString(), colorOne, colorTwo);
Guild guild = Emulator.getGameEnvironment().getGuildManager().createGuild(this.client.getHabbo(), roomId, r.getName(), name, description, badge, colorOne, colorTwo);
r.setGuild(guild.getId());
r.setNeedsUpdate(true);

View File

@ -15,7 +15,7 @@ public class RequestGuildBuyRoomsEvent extends MessageHandler
{
List<Room> rooms = Emulator.getGameEnvironment().getRoomManager().getRoomsForHabbo(this.client.getHabbo());
THashSet<Room> roomList = new THashSet<>();
THashSet<Room> roomList = new THashSet<Room>();
for(Room room : rooms)
{

View File

@ -25,10 +25,10 @@ public class RequestGuildMembersEvent extends MessageHandler
if (!isAdmin && this.client.getHabbo().getHabboStats().hasGuild(g.getId()))
{
GuildMember member = Emulator.getGameEnvironment().getGuildManager().getGuildMember(g, this.client.getHabbo());
isAdmin = member != null && (member.getRank().equals(GuildRank.ADMIN) || member.getRank().equals(GuildRank.MOD) && levelId == 2);
isAdmin = member != null && member.getRank().equals(GuildRank.ADMIN);
}
this.client.sendResponse(new GuildMembersComposer(g, Emulator.getGameEnvironment().getGuildManager().getGuildMembersCount(g, levelId, query), Emulator.getGameEnvironment().getGuildManager().getGuildMembers(g, pageId, levelId, query), pageId, levelId, query, isAdmin));
this.client.sendResponse(new GuildMembersComposer(g, Emulator.getGameEnvironment().getGuildManager().getGuildMembers(g, pageId, levelId, query), this.client.getHabbo(), pageId, levelId, query, isAdmin));
}
}
}

View File

@ -11,7 +11,7 @@ public class RequestOwnGuildsEvent extends MessageHandler
@Override
public void handle() throws Exception
{
THashSet<Guild> guilds = new THashSet<>();
THashSet<Guild> guilds = new THashSet<Guild>();
for(int i : this.client.getHabbo().getHabboStats().guilds)
{

View File

@ -1,6 +1,7 @@
package com.eu.habbo.messages.incoming.guilds.forums;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.guilds.forums.GuildForum;
import com.eu.habbo.messages.incoming.MessageHandler;
import com.eu.habbo.messages.outgoing.guilds.forums.GuildForumDataComposer;
@ -9,8 +10,13 @@ public class GuildForumDataEvent extends MessageHandler
@Override
public void handle() throws Exception
{
int guildId = this.packet.readInt();
int guildId = packet.readInt();
this.client.sendResponse(new GuildForumDataComposer(Emulator.getGameEnvironment().getGuildForumManager().getGuildForum(guildId), this.client.getHabbo()));
GuildForum forum = Emulator.getGameEnvironment().getGuildForumManager().getGuildForum(guildId);
if(forum == null)
return;
this.client.sendResponse(new GuildForumDataComposer(forum, this.client.getHabbo()));
}
}

View File

@ -4,23 +4,22 @@ import com.eu.habbo.Emulator;
import com.eu.habbo.messages.incoming.MessageHandler;
import com.eu.habbo.messages.outgoing.guilds.forums.GuildForumListComposer;
public class GuildForumListEvent extends MessageHandler
{
public class GuildForumListEvent extends MessageHandler {
@Override
public void handle() throws Exception
{
public void handle() throws Exception {
int mode = this.packet.readInt();
int page = this.packet.readInt();
int amount = this.packet.readInt();
switch(page)
{
switch (mode) {
case 0:
this.client.sendResponse(new GuildForumListComposer(Emulator.getGameEnvironment().getGuildForumManager().getGuildForums(this.client.getHabbo()), this.client.getHabbo(), mode));
this.client.sendResponse(new GuildForumListComposer(Emulator.getGameEnvironment().getGuildForumManager().getAllForumsByVisited(), this.client.getHabbo(), mode, page));
break;
case 1:
this.client.sendResponse(new GuildForumListComposer(Emulator.getGameEnvironment().getGuildForumManager().getAllForumsByActive(), this.client.getHabbo(), mode, page));
break;
case 2:
this.client.sendResponse(new GuildForumListComposer(Emulator.getGameEnvironment().getGuildForumManager().getGuildForums(this.client.getHabbo()), this.client.getHabbo(), mode, page));
break;
}
}

View File

@ -2,40 +2,63 @@ package com.eu.habbo.messages.incoming.guilds.forums;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.guilds.Guild;
import com.eu.habbo.habbohotel.guilds.GuildMember;
import com.eu.habbo.habbohotel.guilds.GuildRank;
import com.eu.habbo.habbohotel.guilds.forums.GuildForum;
import com.eu.habbo.habbohotel.guilds.forums.GuildForumComment;
import com.eu.habbo.habbohotel.guilds.forums.GuildForumThread;
import com.eu.habbo.messages.incoming.MessageHandler;
import com.eu.habbo.messages.outgoing.generic.alerts.BubbleAlertComposer;
import com.eu.habbo.messages.outgoing.generic.alerts.BubbleAlertKeys;
import com.eu.habbo.messages.outgoing.guilds.forums.PostUpdateMessageComposer;
public class GuildForumModerateMessageEvent extends MessageHandler
{
public class GuildForumModerateMessageEvent extends MessageHandler {
@Override
public void handle() throws Exception
{
int guildId = this.packet.readInt();
int threadId = this.packet.readInt();
int messageId = this.packet.readInt();
int state = this.packet.readInt();
public void handle() throws Exception {
int guildId = packet.readInt();
int threadId = packet.readInt();
int messageId = packet.readInt();
int state = packet.readInt();
Guild guild = Emulator.getGameEnvironment().getGuildManager().getGuild(guildId);
if(guild == null || guild.getOwnerId() != this.client.getHabbo().getHabboInfo().getId())
boolean isStaff = this.client.getHabbo().hasPermission("acc_modtool_ticket_q");
final GuildMember member = Emulator.getGameEnvironment().getGuildManager().getGuildMember(guildId, this.client.getHabbo().getHabboInfo().getId());
boolean isAdmin = member != null && (member.getRank() == GuildRank.MOD || member.getRank() == GuildRank.ADMIN || guild.getOwnerId() == this.client.getHabbo().getHabboInfo().getId());
if (guild == null || (!isAdmin && !isStaff))
return;
GuildForum forum = Emulator.getGameEnvironment().getGuildForumManager().getGuildForum(guildId);
GuildForumThread thread = forum.getThread(threadId);
//
if (thread != null) {
if(messageId >= 0) {
Emulator.getLogging().logDebugLine("Forum message ID - " + messageId);
GuildForumComment comment = thread.getCommentById(messageId);
comment.setState(GuildForum.ThreadState.fromValue(state));
comment.setAdminId(this.client.getHabbo().getHabboInfo().getId());
comment.setAdminName(this.client.getHabbo().getHabboInfo().getUsername());
Emulator.getThreading().run(comment);
this.client.sendResponse(new PostUpdateMessageComposer(guildId, threadId, comment));
}
switch (state) {
case 10:
case 20:
this.client.sendResponse(new BubbleAlertComposer(BubbleAlertKeys.FORUMS_MESSAGE_HIDDEN.key).compose());
break;
case 1:
this.client.sendResponse(new BubbleAlertComposer(BubbleAlertKeys.FORUMS_MESSAGE_RESTORED.key).compose());
break;
}
} else {
//
//
}
}
}

View File

@ -2,30 +2,50 @@ package com.eu.habbo.messages.incoming.guilds.forums;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.guilds.Guild;
import com.eu.habbo.habbohotel.guilds.GuildMember;
import com.eu.habbo.habbohotel.guilds.GuildRank;
import com.eu.habbo.habbohotel.guilds.forums.GuildForum;
import com.eu.habbo.habbohotel.guilds.forums.GuildForumThread;
import com.eu.habbo.messages.incoming.MessageHandler;
import com.eu.habbo.messages.outgoing.generic.alerts.BubbleAlertComposer;
import com.eu.habbo.messages.outgoing.generic.alerts.BubbleAlertKeys;
import com.eu.habbo.messages.outgoing.guilds.forums.GuildForumThreadMessagesComposer;
public class GuildForumModerateThreadEvent extends MessageHandler
{
public class GuildForumModerateThreadEvent extends MessageHandler {
@Override
public void handle() throws Exception
{
int guildId = this.packet.readInt();
int threadId = this.packet.readInt();
int state = this.packet.readInt();
public void handle() throws Exception {
int guildId = packet.readInt();
int threadId = packet.readInt();
int state = packet.readInt();
Guild guild = Emulator.getGameEnvironment().getGuildManager().getGuild(guildId);
if(guild == null || guild.getOwnerId() != this.client.getHabbo().getHabboInfo().getId())
boolean isStaff = this.client.getHabbo().hasPermission("acc_modtool_ticket_q");
final GuildMember member = Emulator.getGameEnvironment().getGuildManager().getGuildMember(guildId, this.client.getHabbo().getHabboInfo().getId());
boolean isAdmin = member != null && (member.getRank() == GuildRank.MOD || member.getRank() == GuildRank.ADMIN || guild.getOwnerId() == this.client.getHabbo().getHabboInfo().getId());
if (guild == null || (!isAdmin && !isStaff))
return;
GuildForum forum = Emulator.getGameEnvironment().getGuildForumManager().getGuildForum(guildId);
GuildForumThread thread = forum.getThread(threadId);
thread.setState(GuildForum.ThreadState.fromValue(state));
thread.setAdminId(this.client.getHabbo().getHabboInfo().getId());
thread.setAdminName(this.client.getHabbo().getHabboInfo().getUsername());
switch (state) {
case 10:
case 20:
this.client.sendResponse(new BubbleAlertComposer(BubbleAlertKeys.FORUMS_THREAD_HIDDEN.key).compose());
break;
case 1:
this.client.sendResponse(new BubbleAlertComposer(BubbleAlertKeys.FORUMS_THREAD_RESTORED.key).compose());
break;
}
Emulator.getThreading().run(thread);
//
this.client.sendResponse(new GuildForumThreadMessagesComposer(thread));
}
}

View File

@ -1,50 +1,68 @@
package com.eu.habbo.messages.incoming.guilds.forums;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.guilds.Guild;
import com.eu.habbo.habbohotel.guilds.GuildMember;
import com.eu.habbo.habbohotel.guilds.GuildRank;
import com.eu.habbo.habbohotel.guilds.forums.GuildForum;
import com.eu.habbo.habbohotel.guilds.forums.GuildForumComment;
import com.eu.habbo.habbohotel.guilds.forums.GuildForumThread;
import com.eu.habbo.messages.incoming.MessageHandler;
import com.eu.habbo.messages.outgoing.guilds.forums.GuildForumAddCommentComposer;
import com.eu.habbo.messages.outgoing.guilds.forums.GuildForumThreadMessagesComposer;
public class GuildForumPostThreadEvent extends MessageHandler
{
public class GuildForumPostThreadEvent extends MessageHandler {
@Override
public void handle() throws Exception
{
public void handle() throws Exception {
int guildId = this.packet.readInt();
int threadId = this.packet.readInt();
String subject = this.packet.readString();
String message = this.packet.readString();
//TODO: Add check if user has guild
//TODO: Add check if threads can be posted.
//
//
//
//
final GuildForum forum = Emulator.getGameEnvironment().getGuildForumManager().getGuildForum(guildId);
final Guild guild = Emulator.getGameEnvironment().getGuildManager().getGuild(guildId);
final GuildMember member = Emulator.getGameEnvironment().getGuildManager().getGuildMember(guildId, this.client.getHabbo().getHabboInfo().getId());
boolean isStaff = this.client.getHabbo().hasPermission("acc_modtool_ticket_q");
final GuildForumThread thread;
if (forum != null) {
if (message.length() < 10 || message.length() > 4000) return;
if (threadId == 0) {
if ((guild.canPostThreads().state == 0)
|| (guild.canPostThreads().state == 1 && member != null)
|| (guild.canPostThreads().state == 2 && member != null && (member.getRank() == GuildRank.MOD || member.getRank() == GuildRank.ADMIN))
|| (guild.canPostThreads().state == 3 && guild.getOwnerId() == this.client.getHabbo().getHabboInfo().getId())
|| isStaff) {
thread = forum.createThread(this.client.getHabbo(), subject, message);
GuildForumComment comment = new GuildForumComment(guildId, threadId, this.client.getHabbo().getHabboInfo().getId(),
this.client.getHabbo().getHabboInfo().getUsername(), this.client.getHabbo().getHabboInfo().getLook(), message);
thread.addComment(comment);
this.client.sendResponse(new GuildForumThreadMessagesComposer(thread));
}
} else {
if ((guild.canPostThreads().state == 0)
|| (guild.canPostThreads().state == 1 && member != null)
|| (guild.canPostThreads().state == 2 && member != null && (member.getRank() == GuildRank.MOD || member.getRank() == GuildRank.ADMIN))
|| (guild.canPostThreads().state == 3 && guild.getOwnerId() == this.client.getHabbo().getHabboInfo().getId())
|| isStaff) {
thread = forum.getThread(threadId);
if(thread == null)
return;
GuildForumComment comment = thread.addComment(this.client.getHabbo(), message);
if (comment != null) {
this.client.sendResponse(new GuildForumAddCommentComposer(comment));
}
}
}
}
}
}

View File

@ -0,0 +1,17 @@
package com.eu.habbo.messages.incoming.guilds.forums;
import com.eu.habbo.Emulator;
import com.eu.habbo.messages.incoming.MessageHandler;
import com.eu.habbo.messages.outgoing.guilds.forums.ThreadUpdatedMessageComposer;
public class GuildForumThreadUpdateEvent extends MessageHandler {
@Override
public void handle() throws Exception {
int groupId = this.packet.readInt();
int threadId = this.packet.readInt();
boolean isPinned = this.packet.readBoolean();
boolean isLocked = this.packet.readBoolean();
this.client.sendResponse(new ThreadUpdatedMessageComposer(Emulator.getGameEnvironment().getGuildForumManager().getGuildForum(groupId), threadId, this.client.getHabbo(), isPinned, isLocked));
}
}

View File

@ -1,6 +1,7 @@
package com.eu.habbo.messages.incoming.guilds.forums;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.guilds.forums.GuildForum;
import com.eu.habbo.messages.incoming.MessageHandler;
import com.eu.habbo.messages.outgoing.guilds.forums.GuildForumDataComposer;
import com.eu.habbo.messages.outgoing.guilds.forums.GuildForumThreadsComposer;
@ -10,11 +11,17 @@ public class GuildForumThreadsEvent extends MessageHandler
@Override
public void handle() throws Exception
{
int groupdId = this.packet.readInt();
int index = this.packet.readInt();
int groupdId = packet.readInt();
int index = packet.readInt();
GuildForum forum = Emulator.getGameEnvironment().getGuildForumManager().getGuildForum(groupdId);
if(forum == null)
return;
this.client.sendResponse(new GuildForumDataComposer(forum, this.client.getHabbo()));
this.client.sendResponse(new GuildForumThreadsComposer(forum, index));
this.client.sendResponse(new GuildForumThreadsComposer(Emulator.getGameEnvironment().getGuildForumManager().getGuildForum(groupdId), index));
this.client.sendResponse(new GuildForumDataComposer(Emulator.getGameEnvironment().getGuildForumManager().getGuildForum(groupdId), this.client.getHabbo()));
//TODO read guild id;
}
}

View File

@ -3,34 +3,42 @@ package com.eu.habbo.messages.incoming.guilds.forums;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.guilds.Guild;
import com.eu.habbo.habbohotel.guilds.forums.GuildForum;
import com.eu.habbo.habbohotel.guilds.forums.GuildForumThread;
import com.eu.habbo.messages.incoming.MessageHandler;
import com.eu.habbo.messages.outgoing.generic.alerts.BubbleAlertComposer;
import com.eu.habbo.messages.outgoing.guilds.forums.GuildForumCommentsComposer;
import com.eu.habbo.messages.outgoing.guilds.forums.GuildForumDataComposer;
public class GuildForumThreadsMessagesEvent extends MessageHandler
{
@Override
public void handle() throws Exception
{
int guildId = this.packet.readInt();
int threadId = this.packet.readInt();
int index = this.packet.readInt(); //40
int limit = this.packet.readInt(); //20
int guildId = packet.readInt();
int threadId = packet.readInt();
int index = packet.readInt(); //40
int limit = packet.readInt(); //20
Guild guild = Emulator.getGameEnvironment().getGuildManager().getGuild(guildId);
if(guild == null)
return;
GuildForum forum = Emulator.getGameEnvironment().getGuildForumManager().getGuildForum(guildId);
//
//
if(forum == null)
return;
GuildForumThread thread = forum.getThread(threadId);
if (thread.getState() == GuildForum.ThreadState.HIDDEN_BY_ADMIN && guild.getOwnerId() != this.client.getHabbo().getHabboInfo().getId())
{
this.client.sendResponse(new BubbleAlertComposer("forums.error.access_denied"));
} else
{
this.client.sendResponse(new GuildForumCommentsComposer(guildId, threadId, index, thread.getComments(index, limit)));
}
//
this.client.sendResponse(new GuildForumDataComposer(forum, this.client.getHabbo()));
}
}

View File

@ -3,7 +3,10 @@ package com.eu.habbo.messages.incoming.guilds.forums;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.guilds.Guild;
import com.eu.habbo.habbohotel.guilds.SettingsState;
import com.eu.habbo.habbohotel.guilds.forums.GuildForum;
import com.eu.habbo.messages.incoming.MessageHandler;
import com.eu.habbo.messages.outgoing.generic.alerts.BubbleAlertComposer;
import com.eu.habbo.messages.outgoing.generic.alerts.BubbleAlertKeys;
import com.eu.habbo.messages.outgoing.guilds.forums.GuildForumDataComposer;
public class GuildForumUpdateSettingsEvent extends MessageHandler
@ -11,29 +14,33 @@ public class GuildForumUpdateSettingsEvent extends MessageHandler
@Override
public void handle() throws Exception
{
int guildId = this.packet.readInt();
int canRead = this.packet.readInt();
int postMessages = this.packet.readInt();
int postThreads = this.packet.readInt();
int modForum = this.packet.readInt();
int guildId = packet.readInt();
int canRead = packet.readInt();
int postMessages = packet.readInt();
int postThreads = packet.readInt();
int modForum = packet.readInt();
Guild guild = Emulator.getGameEnvironment().getGuildManager().getGuild(guildId);
if(guild == null || guild.getOwnerId() != this.client.getHabbo().getHabboInfo().getId())
return;
this.client.sendResponse(new GuildForumDataComposer(Emulator.getGameEnvironment().getGuildForumManager().getGuildForum(1), this.client.getHabbo()));
GuildForum forum = Emulator.getGameEnvironment().getGuildForumManager().getGuildForum(guildId);
if(forum == null)
return;
guild.setReadForum(SettingsState.fromValue(canRead));
guild.setPostMessages(SettingsState.fromValue(postMessages));
guild.setPostThreads(SettingsState.fromValue(postThreads));
guild.setModForum(SettingsState.fromValue(modForum));
guild.needsUpdate = true;
Emulator.getThreading().run(guild);
this.client.sendResponse(new BubbleAlertComposer(BubbleAlertKeys.FORUMS_FORUM_SETTINGS_UPDATED.key).compose());
//TODO: DATABASE SAVING, PERMISSION CHECK
this.client.sendResponse(new GuildForumDataComposer(forum, this.client.getHabbo()));
}
}

View File

@ -102,406 +102,406 @@ public class Outgoing
public final static int AlertPurchaseFailedComposer = 1404;
public final static int RoomDataComposer = 687;
public final static int TagsComposer = 2012;
public final static int InventoryRefreshComposer = 3151;
public final static int RemovePetComposer = 3253;
public final static int RemoveWallItemComposer = 3208;
public final static int TradeCompleteComposer = 2369;
public final static int NewsWidgetsComposer = 286;
public final static int WiredEffectDataComposer = 1434;
public final static int BubbleAlertComposer = 1992;
public final static int ReloadRecyclerComposer = 3433;
public final static int MoodLightDataComposer = 2710;
public final static int WiredRewardAlertComposer = 178;
public final static int CatalogPageComposer = 804;
public final static int CatalogModeComposer = 3828;
public final static int ChangeNameUpdateComposer = 118;
public final static int AddFloorItemComposer = 1534;
public final static int DebugConsoleComposer = 3284;
public final static int HallOfFameComposer = 3005;
public final static int WiredSavedComposer = 1155;
public final static int RoomPaintComposer = 2454;
public final static int MarketplaceConfigComposer = 1823;
public final static int AddBotComposer = 1352;
public final static int FriendRequestErrorComposer = 892;
public final static int GuildMembersComposer = 1200;
public final static int RoomOpenComposer = 758;
public final static int ModToolRoomChatlogComposer = 3434;
public final static int DiscountComposer = 2347;
public final static int MarketplaceCancelSaleComposer = 3264;
public final static int RoomPetRespectComposer = 2788;
public final static int RoomSettingsComposer = 1498;
public final static int TalentTrackComposer = 3406;
public final static int CatalogPagesListComposer = 1032;
public final static int AlertLimitedSoldOutComposer = 377;
public final static int CatalogUpdatedComposer = 1866;
public final static int PurchaseOKComposer = 869;
public final static int WallItemUpdateComposer = 2009;
public final static int TradeAcceptedComposer = 2568;
public final static int AddWallItemComposer = 2187;
public final static int RoomEntryInfoComposer = 749;
public final static int HotelViewDataComposer = 1745;
public final static int PresentItemOpenedComposer = 56;
public final static int RoomUserRemoveRightsComposer = 84;
public final static int UserBCLimitsComposer = 3828;
public final static int PetTrainingPanelComposer = 1164;
public final static int RoomPaneComposer = 749;
public final static int RedeemVoucherErrorComposer = 714;
public final static int RoomCreatedComposer = 1304;
public final static int GenericAlertComposer = 3801;
public final static int GroupPartsComposer = 2238;
public final static int ModToolIssueInfoComposer = 3609;
public final static int RoomUserWhisperComposer = 2704;
public final static int BotErrorComposer = 639;
public final static int FreezeLivesComposer = 2324;
public final static int LoadFriendRequestsComposer = 280;
public final static int MarketplaceSellItemComposer = 54;
public final static int ClubDataComposer = 2405;
public final static int ProfileFriendsComposer = 2016;
public final static int MarketplaceOwnItemsComposer = 3884;
public final static int RoomOwnerComposer = 339;
public final static int WiredConditionDataComposer = 1108;
public final static int ModToolUserInfoComposer = 2866;
public final static int UserWardrobeComposer = 3315;
public final static int RoomPetExperienceComposer = 2156;
public final static int FriendChatMessageComposer = 1587;
public final static int PetInformationComposer = 2901;
public final static int RoomThicknessComposer = 3547;
public final static int AddPetComposer = 2101;
public final static int UpdateStackHeightComposer = 558;
public final static int RemoveBotComposer = 233;
public final static int RoomEnterErrorComposer = 899;
public final static int PollQuestionsComposer = 2997;
public final static int GenericErrorMessages = 1600;
public final static int RoomWallItemsComposer = 1369;
public final static int RoomUserEffectComposer = 1167;
public final static int PetBreedsComposer = 3331;
public final static int ModToolIssueChatlogComposer = 607;
public final static int RoomUserActionComposer = 1631;
public final static int BotSettingsComposer = 1618;
public final static int UserProfileComposer = 3898;
public final static int MinimailCountComposer = 2803;
public final static int UserAchievementScoreComposer = 1968;
public final static int PetLevelUpComposer = 859;
public final static int UserPointsComposer = 2275;
public final static int ReportRoomFormComposer = 1121;
public final static int ModToolIssueHandledComposer = 934;
public final static int FloodCounterComposer = 566;
public final static int UpdateFailedComposer = 156;
public final static int FloorPlanEditorDoorSettingsComposer = 1664;
public final static int FloorPlanEditorBlockedTilesComposer = 3990;
public final static int BuildersClubExpiredComposer = 1452;
public final static int RoomSettingsSavedComposer = 948;
public final static int MessengerInitComposer = 1605;
public final static int UserClothesComposer = 1450;
public final static int UserEffectsListComposer = 340;
public final static int NewUserIdentityComposer = 3738;
public final static int NewNavigatorEventCategoriesComposer = 3244;
public final static int NewNavigatorCollapsedCategoriesComposer = 1543;
public final static int NewNavigatorLiftedRoomsComposer = 3104;
public final static int NewNavigatorSavedSearchesComposer = 3984;
public final static int RoomUnitUpdateUsernameComposer = 2182;
public final static int PostItDataComposer = 2202;
public final static int ModToolReportReceivedAlertComposer = 3635;
public final static int ModToolIssueResponseAlertComposer = 3796;
public final static int AchievementListComposer = 305;
public final static int AchievementProgressComposer = 2107;
public final static int AchievementUnlockedComposer = 806;
public final static int ClubGiftsComposer = 619;
public final static int MachineIDComposer = 1488;
public final static int PongComposer = 10;
public final static int ModToolIssueHandlerDimensionsComposer = 1576;
public final static int InventoryRefreshComposer = 3151; // PRODUCTION-201611291003-338511768
public final static int RemovePetComposer = 3253; // PRODUCTION-201611291003-338511768
public final static int RemoveWallItemComposer = 3208; // PRODUCTION-201611291003-338511768
public final static int TradeCompleteComposer = 2369; // PRODUCTION-201611291003-338511768
public final static int NewsWidgetsComposer = 286; // PRODUCTION-201611291003-338511768
public final static int WiredEffectDataComposer = 1434; // PRODUCTION-201611291003-338511768
public final static int BubbleAlertComposer = 1992; // PRODUCTION-201611291003-338511768
public final static int ReloadRecyclerComposer = 3433; // PRODUCTION-201611291003-338511768
public final static int MoodLightDataComposer = 2710; // PRODUCTION-201611291003-338511768
public final static int WiredRewardAlertComposer = 178; // PRODUCTION-201611291003-338511768
public final static int CatalogPageComposer = 804; // PRODUCTION-201611291003-338511768
public final static int CatalogModeComposer = 3828; // PRODUCTION-201611291003-338511768
public final static int ChangeNameUpdateComposer = 118; // PRODUCTION-201611291003-338511768
public final static int AddFloorItemComposer = 1534; // PRODUCTION-201611291003-338511768
public final static int DebugConsoleComposer = 3284; // PRODUCTION-201611291003-338511768
public final static int HallOfFameComposer = 3005; // PRODUCTION-201611291003-338511768
public final static int WiredSavedComposer = 1155; // PRODUCTION-201611291003-338511768
public final static int RoomPaintComposer = 2454; // PRODUCTION-201611291003-338511768
public final static int MarketplaceConfigComposer = 1823; // PRODUCTION-201611291003-338511768
public final static int AddBotComposer = 1352; // PRODUCTION-201611291003-338511768
public final static int FriendRequestErrorComposer = 892; // PRODUCTION-201611291003-338511768
public final static int GuildMembersComposer = 1200; // PRODUCTION-201611291003-338511768
public final static int RoomOpenComposer = 758; // PRODUCTION-201611291003-338511768
public final static int ModToolRoomChatlogComposer = 3434; // PRODUCTION-201611291003-338511768
public final static int DiscountComposer = 2347; // PRODUCTION-201611291003-338511768
public final static int MarketplaceCancelSaleComposer = 3264; // PRODUCTION-201611291003-338511768
public final static int RoomPetRespectComposer = 2788; // PRODUCTION-201611291003-338511768
public final static int RoomSettingsComposer = 1498; // PRODUCTION-201611291003-338511768
public final static int TalentTrackComposer = 3406; // PRODUCTION-201611291003-338511768
public final static int CatalogPagesListComposer = 1032; // PRODUCTION-201611291003-338511768
public final static int AlertLimitedSoldOutComposer = 377; // PRODUCTION-201611291003-338511768
public final static int CatalogUpdatedComposer = 1866; // PRODUCTION-201611291003-338511768
public final static int PurchaseOKComposer = 869; // PRODUCTION-201611291003-338511768
public final static int WallItemUpdateComposer = 2009; // PRODUCTION-201611291003-338511768
public final static int TradeAcceptedComposer = 2568; // PRODUCTION-201611291003-338511768
public final static int AddWallItemComposer = 2187; // PRODUCTION-201611291003-338511768
public final static int RoomEntryInfoComposer = 749; // PRODUCTION-201611291003-338511768
public final static int HotelViewDataComposer = 1745; // PRODUCTION-201611291003-338511768
public final static int PresentItemOpenedComposer = 56; // PRODUCTION-201611291003-338511768
public final static int RoomUserRemoveRightsComposer = 84; // PRODUCTION-201611291003-338511768
public final static int UserBCLimitsComposer = 3828; // PRODUCTION-201611291003-338511768
public final static int PetTrainingPanelComposer = 1164; // PRODUCTION-201611291003-338511768
public final static int RoomPaneComposer = 749; // PRODUCTION-201611291003-338511768
public final static int RedeemVoucherErrorComposer = 714; // PRODUCTION-201611291003-338511768
public final static int RoomCreatedComposer = 1304; // PRODUCTION-201611291003-338511768
public final static int GenericAlertComposer = 3801; // PRODUCTION-201611291003-338511768
public final static int GroupPartsComposer = 2238; // PRODUCTION-201611291003-338511768
public final static int ModToolIssueInfoComposer = 3609; // PRODUCTION-201611291003-338511768
public final static int RoomUserWhisperComposer = 2704; // PRODUCTION-201611291003-338511768
public final static int BotErrorComposer = 639; // PRODUCTION-201611291003-338511768
public final static int FreezeLivesComposer = 2324; // PRODUCTION-201611291003-338511768
public final static int LoadFriendRequestsComposer = 280; // PRODUCTION-201611291003-338511768
public final static int MarketplaceSellItemComposer = 54; // PRODUCTION-201611291003-338511768
public final static int ClubDataComposer = 2405; // PRODUCTION-201611291003-338511768
public final static int ProfileFriendsComposer = 2016; // PRODUCTION-201611291003-338511768
public final static int MarketplaceOwnItemsComposer = 3884; // PRODUCTION-201611291003-338511768
public final static int RoomOwnerComposer = 339; // PRODUCTION-201611291003-338511768
public final static int WiredConditionDataComposer = 1108; // PRODUCTION-201611291003-338511768
public final static int ModToolUserInfoComposer = 2866; // PRODUCTION-201611291003-338511768
public final static int UserWardrobeComposer = 3315; // PRODUCTION-201611291003-338511768
public final static int RoomPetExperienceComposer = 2156; // PRODUCTION-201611291003-338511768
public final static int FriendChatMessageComposer = 1587; // PRODUCTION-201611291003-338511768
public final static int PetInformationComposer = 2901; // PRODUCTION-201611291003-338511768
public final static int RoomThicknessComposer = 3547; // PRODUCTION-201611291003-338511768
public final static int AddPetComposer = 2101; // PRODUCTION-201611291003-338511768
public final static int UpdateStackHeightComposer = 558; // PRODUCTION-201611291003-338511768
public final static int RemoveBotComposer = 233; // PRODUCTION-201611291003-338511768
public final static int RoomEnterErrorComposer = 899; // PRODUCTION-201611291003-338511768
public final static int PollQuestionsComposer = 2997; // PRODUCTION-201611291003-338511768
public final static int GenericErrorMessages = 1600; // PRODUCTION-201611291003-338511768
public final static int RoomWallItemsComposer = 1369; // PRODUCTION-201611291003-338511768
public final static int RoomUserEffectComposer = 1167; // PRODUCTION-201611291003-338511768
public final static int PetBreedsComposer = 3331; // PRODUCTION-201611291003-338511768
public final static int ModToolIssueChatlogComposer = 607; // PRODUCTION-201611291003-338511768
public final static int RoomUserActionComposer = 1631; // PRODUCTION-201611291003-338511768
public final static int BotSettingsComposer = 1618; // PRODUCTION-201611291003-338511768
public final static int UserProfileComposer = 3898; // PRODUCTION-201611291003-338511768
public final static int MinimailCountComposer = 2803; // PRODUCTION-201611291003-338511768
public final static int UserAchievementScoreComposer = 1968; // PRODUCTION-201611291003-338511768
public final static int PetLevelUpComposer = 859; // PRODUCTION-201611291003-338511768
public final static int UserPointsComposer = 2275; // PRODUCTION-201611291003-338511768
public final static int ReportRoomFormComposer = 1121; // PRODUCTION-201611291003-338511768
public final static int ModToolIssueHandledComposer = 934; // PRODUCTION-201611291003-338511768
public final static int FloodCounterComposer = 566; // PRODUCTION-201611291003-338511768
public final static int UpdateFailedComposer = 156; // PRODUCTION-201611291003-338511768
public final static int FloorPlanEditorDoorSettingsComposer = 1664; // PRODUCTION-201611291003-338511768
public final static int FloorPlanEditorBlockedTilesComposer = 3990; // PRODUCTION-201611291003-338511768
public final static int BuildersClubExpiredComposer = 1452; // PRODUCTION-201611291003-338511768
public final static int RoomSettingsSavedComposer = 948; // PRODUCTION-201611291003-338511768
public final static int MessengerInitComposer = 1605; // PRODUCTION-201611291003-338511768
public final static int UserClothesComposer = 1450; // PRODUCTION-201611291003-338511768
public final static int UserEffectsListComposer = 340; // PRODUCTION-201611291003-338511768
public final static int NewUserIdentityComposer = 3738; // PRODUCTION-201611291003-338511768
public final static int NewNavigatorEventCategoriesComposer = 3244; // PRODUCTION-201611291003-338511768
public final static int NewNavigatorCollapsedCategoriesComposer = 1543; // PRODUCTION-201611291003-338511768
public final static int NewNavigatorLiftedRoomsComposer = 3104; // PRODUCTION-201611291003-338511768
public final static int NewNavigatorSavedSearchesComposer = 3984; // PRODUCTION-201611291003-338511768
public final static int RoomUnitUpdateUsernameComposer = 2182; // PRODUCTION-201611291003-338511768
public final static int PostItDataComposer = 2202; // PRODUCTION-201611291003-338511768
public final static int ModToolReportReceivedAlertComposer = 3635; // PRODUCTION-201611291003-338511768
public final static int ModToolIssueResponseAlertComposer = 3796; // PRODUCTION-201611291003-338511768
public final static int AchievementListComposer = 305; // PRODUCTION-201611291003-338511768
public final static int AchievementProgressComposer = 2107; // PRODUCTION-201611291003-338511768
public final static int AchievementUnlockedComposer = 806; // PRODUCTION-201611291003-338511768
public final static int ClubGiftsComposer = 619; // PRODUCTION-201611291003-338511768
public final static int MachineIDComposer = 1488; // PRODUCTION-201611291003-338511768
public final static int PongComposer = 10; // PRODUCTION-201611291003-338511768
public final static int ModToolIssueHandlerDimensionsComposer = 1576; // PRODUCTION-201611291003-338511768
//Uknown but work
public final static int IsFirstLoginOfDayComposer = 793;
public final static int UnknownComposer5 = 2833;
public final static int IgnoredUsersComposer = 126;
public final static int NewNavigatorMetaDataComposer = 3052;
public final static int NewNavigatorSearchResultsComposer = 2690;
public final static int MysticBoxStartOpenComposer = 3201;
public final static int MysticBoxCloseComposer = 596;
public final static int MysticBoxPrizeComposer = 3712;
public final static int RentableSpaceInfoComposer = 3559;
public final static int RentableSpaceUnknownComposer = 2046;
public final static int RentableSpaceUnknown2Composer = 1868;
public final static int GuildConfirmRemoveMemberComposer = 1876;
public final static int HotelViewBadgeButtonConfigComposer = 2998;
public final static int EpicPopupFrameComposer = 3945;
public final static int BaseJumpLoadGameURLComposer = 2624;
public final static int RoomUserTagsComposer = 1255;
public final static int RoomInviteErrorComposer = 462;
public final static int PostItStickyPoleOpenComposer = 2366;
public final static int NewYearResolutionProgressComposer = 3370;
public final static int ClubGiftReceivedComposer = 659;
public final static int ItemStateComposer = 2376;
public final static int ItemExtraDataComposer = 2547;
public final static int IsFirstLoginOfDayComposer = 793; // PRODUCTION-201611291003-338511768 //Quest Engine
public final static int UnknownComposer5 = 2833; // PRODUCTION-201611291003-338511768 //Mysterbox
public final static int IgnoredUsersComposer = 126; // PRODUCTION-201611291003-338511768
public final static int NewNavigatorMetaDataComposer = 3052; // PRODUCTION-201611291003-338511768
public final static int NewNavigatorSearchResultsComposer = 2690; // PRODUCTION-201611291003-338511768
public final static int MysticBoxStartOpenComposer = 3201; // PRODUCTION-201611291003-338511768
public final static int MysticBoxCloseComposer = 596; // PRODUCTION-201611291003-338511768
public final static int MysticBoxPrizeComposer = 3712; // PRODUCTION-201611291003-338511768
public final static int RentableSpaceInfoComposer = 3559; // PRODUCTION-201611291003-338511768
public final static int RentableSpaceUnknownComposer = 2046; // PRODUCTION-201611291003-338511768
public final static int RentableSpaceUnknown2Composer = 1868; // PRODUCTION-201611291003-338511768
public final static int GuildConfirmRemoveMemberComposer = 1876; // PRODUCTION-201611291003-338511768
public final static int HotelViewBadgeButtonConfigComposer = 2998; // PRODUCTION-201611291003-338511768
public final static int EpicPopupFrameComposer = 3945; // PRODUCTION-201611291003-338511768
public final static int BaseJumpLoadGameURLComposer = 2624; // PRODUCTION-201611291003-338511768
public final static int RoomUserTagsComposer = 1255; // PRODUCTION-201611291003-338511768
public final static int RoomInviteErrorComposer = 462; // PRODUCTION-201611291003-338511768
public final static int PostItStickyPoleOpenComposer = 2366; // PRODUCTION-201611291003-338511768
public final static int NewYearResolutionProgressComposer = 3370; // PRODUCTION-201611291003-338511768
public final static int ClubGiftReceivedComposer = 659; // PRODUCTION-201611291003-338511768
public final static int ItemStateComposer = 2376; // PRODUCTION-201611291003-338511768
public final static int ItemExtraDataComposer = 2547; // PRODUCTION-201611291003-338511768
public final static int PostUpdateMessageComposer = 324; // PRODUCTION-201611291003-338511768
//NotSure Needs Testing
public final static int QuestionInfoComposer = 2665;
public final static int TalentTrackEmailVerifiedComposer = 612;
public final static int TalentTrackEmailFailedComposer = 1815;
public final static int UnknownAvatarEditorComposer = 3473;
public final static int QuestionInfoComposer = 2665; // PRODUCTION-201611291003-338511768
public final static int TalentTrackEmailVerifiedComposer = 612; // PRODUCTION-201611291003-338511768
public final static int TalentTrackEmailFailedComposer = 1815; // PRODUCTION-201611291003-338511768
public final static int UnknownAvatarEditorComposer = 3473; // PRODUCTION-201611291003-338511768
public final static int GuildMembershipRequestedComposer = 1180;
public final static int GuildMembershipRequestedComposer = 1180; // PRODUCTION-201611291003-338511768
public final static int GuildForumsUnreadMessagesCountComposer = 2379;
public final static int GuildForumThreadMessagesComposer = 1862;
public final static int GuildForumAddCommentComposer = 2049;
public final static int GuildForumDataComposer = 3011;
public final static int GuildForumCommentsComposer = 509;
public final static int UnknownGuildForumComposer6 = 324;
public final static int UnknownGuildForumComposer7 = 2528;
public final static int GuildForumThreadsComposer = 1073;
public final static int GuildForumListComposer = 3001;
public final static int GuildForumsUnreadMessagesCountComposer = 2379; // PRODUCTION-201611291003-338511768
public final static int GuildForumThreadMessagesComposer = 1862; // PRODUCTION-201611291003-338511768
public final static int GuildForumAddCommentComposer = 2049; // PRODUCTION-201611291003-338511768
public final static int GuildForumDataComposer = 3011; // PRODUCTION-201611291003-338511768
public final static int GuildForumCommentsComposer = 509; // PRODUCTION-201611291003-338511768
public final static int UnknownGuildForumComposer6 = 324; // PRODUCTION-201611291003-338511768
public final static int UnknownGuildForumComposer7 = 2528; // PRODUCTION-201611291003-338511768
public final static int GuildForumThreadsComposer = 1073; // PRODUCTION-201611291003-338511768
public final static int GuildForumListComposer = 3001; // PRODUCTION-201611291003-338511768
public final static int ThreadUpdateMessageComposer = 2528;
public final static int GuideSessionAttachedComposer = 1591; // PRODUCTION-201611291003-338511768
public final static int GuideSessionDetachedComposer = 138; // PRODUCTION-201611291003-338511768
public final static int GuideSessionStartedComposer = 3209; // PRODUCTION-201611291003-338511768
public final static int GuideSessionEndedComposer = 1456; // PRODUCTION-201611291003-338511768
public final static int GuideSessionErrorComposer = 673; // PRODUCTION-201611291003-338511768
public final static int GuideSessionMessageComposer = 841; // PRODUCTION-201611291003-338511768
public final static int GuideSessionRequesterRoomComposer = 1847; // PRODUCTION-201611291003-338511768
public final static int GuideSessionInvitedToGuideRoomComposer = 219; // PRODUCTION-201611291003-338511768
public final static int GuideSessionPartnerIsTypingComposer = 1016; // PRODUCTION-201611291003-338511768
public final static int GuideSessionAttachedComposer = 1591;
public final static int GuideSessionDetachedComposer = 138;
public final static int GuideSessionStartedComposer = 3209;
public final static int GuideSessionEndedComposer = 1456;
public final static int GuideSessionErrorComposer = 673;
public final static int GuideSessionMessageComposer = 841;
public final static int GuideSessionRequesterRoomComposer = 1847;
public final static int GuideSessionInvitedToGuideRoomComposer = 219;
public final static int GuideSessionPartnerIsTypingComposer = 1016;
public final static int GuideToolsComposer = 1548; // PRODUCTION-201611291003-338511768
public final static int GuardianNewReportReceivedComposer = 735; // PRODUCTION-201611291003-338511768
public final static int GuardianVotingRequestedComposer = 143; // PRODUCTION-201611291003-338511768
public final static int GuardianVotingVotesComposer = 1829; // PRODUCTION-201611291003-338511768
public final static int GuardianVotingResultComposer = 3276; // PRODUCTION-201611291003-338511768
public final static int GuardianVotingTimeEnded = 30; // PRODUCTION-201611291003-338511768
public final static int GuideToolsComposer = 1548;
public final static int GuardianNewReportReceivedComposer = 735;
public final static int GuardianVotingRequestedComposer = 143;
public final static int GuardianVotingVotesComposer = 1829;
public final static int GuardianVotingResultComposer = 3276;
public final static int GuardianVotingTimeEnded = 30;
public final static int RoomMutedComposer = 2533; // PRODUCTION-201611291003-338511768
public final static int RoomMutedComposer = 2533;
public final static int HideDoorbellComposer = 3783; // PRODUCTION-201611291003-338511768
public final static int RoomQueueStatusMessage = 2208; // PRODUCTION-201611291003-338511768
public final static int RoomUnknown3Composer = 1033; // PRODUCTION-201611291003-338511768
public final static int HideDoorbellComposer = 3783;
public final static int RoomQueueStatusMessage = 2208;
public final static int RoomUnknown3Composer = 1033;
public final static int EffectsListRemoveComposer = 2228; // PRODUCTION-201611291003-338511768
public final static int EffectsListRemoveComposer = 2228;
public final static int OldPublicRoomsComposer = 2726; // PRODUCTION-201611291003-338511768
public final static int ItemStateComposer2 = 3431; // PRODUCTION-201611291003-338511768
public final static int OldPublicRoomsComposer = 2726;
public final static int ItemStateComposer2 = 3431;
public final static int HotelWillCloseInMinutesComposer = 1050; // PRODUCTION-201611291003-338511768
public final static int HotelWillCloseInMinutesAndBackInComposer = 1350; // PRODUCTION-201611291003-338511768
public final static int HotelClosesAndWillOpenAtComposer = 2771; // PRODUCTION-201611291003-338511768
public final static int HotelClosedAndOpensComposer = 3728; // PRODUCTION-201611291003-338511768
public final static int StaffAlertAndOpenHabboWayComposer = 1683; // PRODUCTION-201611291003-338511768
public final static int StaffAlertWithLinkComposer = 2030; // PRODUCTION-201611291003-338511768
public final static int StaffAlertWIthLinkAndOpenHabboWayComposer = 1890; // PRODUCTION-201611291003-338511768
public final static int HotelWillCloseInMinutesComposer = 1050;
public final static int HotelWillCloseInMinutesAndBackInComposer = 1350;
public final static int HotelClosesAndWillOpenAtComposer = 2771;
public final static int HotelClosedAndOpensComposer = 3728;
public final static int StaffAlertAndOpenHabboWayComposer = 1683;
public final static int StaffAlertWithLinkComposer = 2030;
public final static int StaffAlertWIthLinkAndOpenHabboWayComposer = 1890;
public final static int RoomMessagesPostedCountComposer = 1634;
public final static int CantScratchPetNotOldEnoughComposer = 1130;
public final static int PetBoughtNotificationComposer = 1111;
public final static int MessagesForYouComposer = 2035;
public final static int UnknownStatusComposer = 1243;
public final static int CloseWebPageComposer = 426;
public final static int PickMonthlyClubGiftNotificationComposer = 2188;
public final static int RemoveGuildFromRoomComposer = 3129;
public final static int RoomBannedUsersComposer = 1869;
public final static int OpenRoomCreationWindowComposer = 2064;
public final static int ItemsDataUpdateComposer = 1453;
public final static int WelcomeGiftComposer = 2707;
public final static int SimplePollStartComposer = 2665;
public final static int RoomNoRightsComposer = 2392;
public final static int GuildEditFailComposer = 3988;
public final static int MinimailNewMessageComposer = 1911;
public final static int RoomFilterWordsComposer = 2937;
public final static int VerifyMobileNumberComposer = 3639;
public final static int NewUserGiftComposer = 3575;
public final static int UpdateUserLookComposer = 2429;
public final static int RoomUserIgnoredComposer = 207;
public final static int PetBreedingFailedComposer = 1625;
public final static int RoomUserNameChangedComposer = 2182;
public final static int LoveLockFurniStartComposer = 3753;
public final static int LoveLockFurniFriendConfirmedComposer = 382;
public final static int LoveLockFurniFinishedComposer = 770;
public final static int PetPackageNameValidationComposer = 546;
public final static int GameCenterFeaturedPlayersComposer = 3097;
public final static int HabboMallComposer = 1237;
public final static int TargetedOfferComposer = 119;
public final static int LeprechaunStarterBundleComposer = 2380;
public final static int VerifyMobilePhoneWindowComposer = 2890;
public final static int VerifyMobilePhoneCodeWindowComposer = 800;
public final static int VerifyMobilePhoneDoneComposer = 91;
public final static int RoomUserReceivedHandItemComposer = 354;
public final static int MutedWhisperComposer = 826;
public final static int UnknownHintComposer = 1787;
public final static int BullyReportClosedComposer = 2674;
public final static int PromoteOwnRoomsListComposer = 2468;
public final static int NotEnoughPointsTypeComposer = 3914;
public final static int WatchAndEarnRewardComposer = 2125;
public final static int NewYearResolutionComposer = 66;
public final static int WelcomeGiftErrorComposer = 2293;
public final static int RentableItemBuyOutPriceComposer = 35;
public final static int VipTutorialsStartComposer = 2278;
public final static int NewNavigatorCategoryUserCountComposer = 1455;
public final static int CameraRoomThumbnailSavedComposer = 3595;
public final static int RoomEditSettingsErrorComposer = 1555;
public final static int GuildAcceptMemberErrorComposer = 818;
public final static int MostUselessErrorAlertComposer = 662;
public final static int AchievementsConfigurationComposer = 1689;
public final static int PetBreedingResultComposer = 634;
public final static int RoomUserQuestionAnsweredComposer = 2589;
public final static int PetBreedingStartComposer = 1746;
public final static int CustomNotificationComposer = 909;
public final static int UpdateStackHeightTileHeightComposer = 2816;
public final static int HotelViewCustomTimerComposer = 3926;
public final static int MarketplaceItemPostedComposer = 1359;
public final static int HabboWayQuizComposer2 = 2927;
public final static int GuildFavoriteRoomUserUpdateComposer = 3403;
public final static int RoomAdErrorComposer = 1759;
public final static int NewNavigatorSettingsComposer = 518;
public final static int CameraPublishWaitMessageComposer = 2057;
public final static int RoomInviteComposer = 3870;
public final static int BullyReportRequestComposer = 3463;
public final static int UnknownHelperComposer = 77;
public final static int HelperRequestDisabledComposer = 1651;
public final static int RoomUnitIdleComposer = 1797;
public final static int QuestCompletedComposer = 949;
public final static int UnkownPetPackageComposer = 1723;
public final static int ForwardToRoomComposer = 160;
public final static int EffectsListEffectEnableComposer = 1959;
public final static int CompetitionEntrySubmitResultComposer = 1177;
public final static int ExtendClubMessageComposer = 3964;
public final static int HotelViewConcurrentUsersComposer = 2737;
public final static int RoomMessagesPostedCountComposer = 1634; // PRODUCTION-201611291003-338511768
public final static int CantScratchPetNotOldEnoughComposer = 1130; // PRODUCTION-201611291003-338511768
public final static int PetBoughtNotificationComposer = 1111; // PRODUCTION-201611291003-338511768
public final static int MessagesForYouComposer = 2035; // PRODUCTION-201611291003-338511768
public final static int UnknownStatusComposer = 1243; // PRODUCTION-201611291003-338511768
public final static int CloseWebPageComposer = 426; // PRODUCTION-201611291003-338511768
public final static int PickMonthlyClubGiftNotificationComposer = 2188; // PRODUCTION-201611291003-338511768
public final static int RemoveGuildFromRoomComposer = 3129; // PRODUCTION-201611291003-338511768
public final static int RoomBannedUsersComposer = 1869; // PRODUCTION-201611291003-338511768
public final static int OpenRoomCreationWindowComposer = 2064; // PRODUCTION-201611291003-338511768
public final static int ItemsDataUpdateComposer = 1453; // PRODUCTION-201611291003-338511768
public final static int WelcomeGiftComposer = 2707; // PRODUCTION-201611291003-338511768
public final static int SimplePollStartComposer = 2665; // PRODUCTION-201611291003-338511768
public final static int RoomNoRightsComposer = 2392; // PRODUCTION-201611291003-338511768
public final static int GuildEditFailComposer = 3988; // PRODUCTION-201611291003-338511768
public final static int MinimailNewMessageComposer = 1911; // PRODUCTION-201611291003-338511768
public final static int RoomFilterWordsComposer = 2937; // PRODUCTION-201611291003-338511768
public final static int VerifyMobileNumberComposer = 3639; // PRODUCTION-201611291003-338511768
public final static int NewUserGiftComposer = 3575; // PRODUCTION-201611291003-338511768
public final static int UpdateUserLookComposer = 2429; // PRODUCTION-201611291003-338511768
public final static int RoomUserIgnoredComposer = 207; // PRODUCTION-201611291003-338511768
public final static int PetBreedingFailedComposer = 1625; // PRODUCTION-201611291003-338511768
public final static int RoomUserNameChangedComposer = 2182; // PRODUCTION-201611291003-338511768
public final static int LoveLockFurniStartComposer = 3753; // PRODUCTION-201611291003-338511768
public final static int LoveLockFurniFriendConfirmedComposer = 382; // PRODUCTION-201611291003-338511768
public final static int LoveLockFurniFinishedComposer = 770; // PRODUCTION-201611291003-338511768
public final static int PetPackageNameValidationComposer = 546; // PRODUCTION-201611291003-338511768
public final static int GameCenterFeaturedPlayersComposer = 3097; // PRODUCTION-201611291003-338511768
public final static int HabboMallComposer = 1237; // PRODUCTION-201611291003-338511768
public final static int TargetedOfferComposer = 119; // PRODUCTION-201611291003-338511768
public final static int LeprechaunStarterBundleComposer = 2380; // PRODUCTION-201611291003-338511768
public final static int VerifyMobilePhoneWindowComposer = 2890; // PRODUCTION-201611291003-338511768
public final static int VerifyMobilePhoneCodeWindowComposer = 800; // PRODUCTION-201611291003-338511768
public final static int VerifyMobilePhoneDoneComposer = 91; // PRODUCTION-201611291003-338511768
public final static int RoomUserReceivedHandItemComposer = 354; // PRODUCTION-201611291003-338511768
public final static int MutedWhisperComposer = 826; // PRODUCTION-201611291003-338511768
public final static int UnknownHintComposer = 1787; // PRODUCTION-201611291003-338511768
public final static int BullyReportClosedComposer = 2674; // PRODUCTION-201611291003-338511768
public final static int PromoteOwnRoomsListComposer = 2468; // PRODUCTION-201611291003-338511768
public final static int NotEnoughPointsTypeComposer = 3914; // PRODUCTION-201611291003-338511768
public final static int WatchAndEarnRewardComposer = 2125; // PRODUCTION-201611291003-338511768
public final static int NewYearResolutionComposer = 66; // PRODUCTION-201611291003-338511768
public final static int WelcomeGiftErrorComposer = 2293; // PRODUCTION-201611291003-338511768
public final static int RentableItemBuyOutPriceComposer = 35; // PRODUCTION-201611291003-338511768
public final static int VipTutorialsStartComposer = 2278; // PRODUCTION-201611291003-338511768
public final static int NewNavigatorCategoryUserCountComposer = 1455; // PRODUCTION-201611291003-338511768
public final static int CameraRoomThumbnailSavedComposer = 3595; // PRODUCTION-201611291003-338511768
public final static int RoomEditSettingsErrorComposer = 1555; // PRODUCTION-201611291003-338511768
public final static int GuildAcceptMemberErrorComposer = 818; // PRODUCTION-201611291003-338511768
public final static int MostUselessErrorAlertComposer = 662; // PRODUCTION-201611291003-338511768
public final static int AchievementsConfigurationComposer = 1689; // PRODUCTION-201611291003-338511768
public final static int PetBreedingResultComposer = 634; // PRODUCTION-201611291003-338511768
public final static int RoomUserQuestionAnsweredComposer = 2589; // PRODUCTION-201611291003-338511768
public final static int PetBreedingStartComposer = 1746; // PRODUCTION-201611291003-338511768
public final static int CustomNotificationComposer = 909; // PRODUCTION-201611291003-338511768
public final static int UpdateStackHeightTileHeightComposer = 2816; // PRODUCTION-201611291003-338511768
public final static int HotelViewCustomTimerComposer = 3926; // PRODUCTION-201611291003-338511768
public final static int MarketplaceItemPostedComposer = 1359; // PRODUCTION-201611291003-338511768
public final static int HabboWayQuizComposer2 = 2927; // PRODUCTION-201611291003-338511768
public final static int GuildFavoriteRoomUserUpdateComposer = 3403; // PRODUCTION-201611291003-338511768
public final static int RoomAdErrorComposer = 1759; // PRODUCTION-201611291003-338511768
public final static int NewNavigatorSettingsComposer = 518; // PRODUCTION-201611291003-338511768
public final static int CameraPublishWaitMessageComposer = 2057; // PRODUCTION-201611291003-338511768
public final static int RoomInviteComposer = 3870; // PRODUCTION-201611291003-338511768
public final static int BullyReportRequestComposer = 3463; // PRODUCTION-201611291003-338511768
public final static int UnknownHelperComposer = 77; // PRODUCTION-201611291003-338511768
public final static int HelperRequestDisabledComposer = 1651; // PRODUCTION-201611291003-338511768
public final static int RoomUnitIdleComposer = 1797; // PRODUCTION-201611291003-338511768
public final static int QuestCompletedComposer = 949; // PRODUCTION-201611291003-338511768
public final static int UnkownPetPackageComposer = 1723; // PRODUCTION-201611291003-338511768
public final static int ForwardToRoomComposer = 160; // PRODUCTION-201611291003-338511768
public final static int EffectsListEffectEnableComposer = 1959; // PRODUCTION-201611291003-338511768
public final static int CompetitionEntrySubmitResultComposer = 1177; // PRODUCTION-201611291003-338511768
public final static int ExtendClubMessageComposer = 3964; // PRODUCTION-201611291003-338511768
public final static int HotelViewConcurrentUsersComposer = 2737; // PRODUCTION-201611291003-338511768
public final static int InventoryAddEffectComposer =-1;//error 404
public final static int TalentLevelUpdateComposer = 638;
public final static int BullyReportedMessageComposer = 3285;
public final static int UnknownQuestComposer3 = 1122;
public final static int FriendToolbarNotificationComposer = 3082;
public final static int MessengerErrorComposer = 896;
public final static int CameraPriceComposer = 3878;
public final static int PetBreedingCompleted = 2527;
public final static int RoomUserUnbannedComposer = 3429;
public final static int HotelViewCommunityGoalComposer = 2525;
public final static int UserClassificationComposer = 966;
public final static int CanCreateEventComposer = 2599;
public final static int UnknownGuild2Composer = 1459;
public final static int YoutubeDisplayListComposer = 1112;
public final static int YoutubeMessageComposer2 = 1411;
public final static int YoutubeMessageComposer3 = 1554;
public final static int RoomCategoryUpdateMessageComposer = 3896;
public final static int QuestsComposer = 3625;
public final static int GiftReceiverNotFoundComposer = 1517;
public final static int ConvertedForwardToRoomComposer = 1331;
public final static int FavoriteRoomChangedComposer = 2524;
public final static int AlertPurchaseUnavailableComposer = 3770;
public final static int PetBreedingStartFailedComposer = 2621;
public final static int DailyQuestComposer = 1878;
public final static int NewNavigatorRoomEventComposer = 1840;
public final static int HotelViewHideCommunityVoteButtonComposer = 1435;
public final static int CatalogSearchResultComposer = 3388;
public final static int FriendFindingRoomComposer = 1210;
public final static int QuestComposer = 230;
public final static int ModToolSanctionDataComposer = 2782;
public final static int TalentLevelUpdateComposer = 638; // PRODUCTION-201611291003-338511768
public final static int BullyReportedMessageComposer = 3285; // PRODUCTION-201611291003-338511768
public final static int UnknownQuestComposer3 = 1122; // PRODUCTION-201611291003-338511768
public final static int FriendToolbarNotificationComposer = 3082; // PRODUCTION-201611291003-338511768
public final static int MessengerErrorComposer = 896; // PRODUCTION-201611291003-338511768
public final static int CameraPriceComposer = 3878; // PRODUCTION-201611291003-338511768
public final static int PetBreedingCompleted = 2527; // PRODUCTION-201611291003-338511768
public final static int RoomUserUnbannedComposer = 3429; // PRODUCTION-201611291003-338511768
public final static int HotelViewCommunityGoalComposer = 2525; // PRODUCTION-201611291003-338511768
public final static int UserClassificationComposer = 966; // PRODUCTION-201611291003-338511768
public final static int CanCreateEventComposer = 2599; // PRODUCTION-201611291003-338511768
public final static int UnknownGuild2Composer = 1459; // PRODUCTION-201611291003-338511768
public final static int YoutubeDisplayListComposer = 1112; // PRODUCTION-201611291003-338511768
public final static int YoutubeMessageComposer2 = 1411; // PRODUCTION-201611291003-338511768
public final static int YoutubeMessageComposer3 = 1554; // PRODUCTION-201611291003-338511768
public final static int RoomCategoryUpdateMessageComposer = 3896; // PRODUCTION-201611291003-338511768
public final static int QuestsComposer = 3625; // PRODUCTION-201611291003-338511768
public final static int GiftReceiverNotFoundComposer = 1517; // PRODUCTION-201611291003-338511768
public final static int ConvertedForwardToRoomComposer = 1331; // PRODUCTION-201611291003-338511768
public final static int FavoriteRoomChangedComposer = 2524; // PRODUCTION-201611291003-338511768
public final static int AlertPurchaseUnavailableComposer = 3770; // PRODUCTION-201611291003-338511768
public final static int PetBreedingStartFailedComposer = 2621; // PRODUCTION-201611291003-338511768
public final static int DailyQuestComposer = 1878; // PRODUCTION-201611291003-338511768
public final static int NewNavigatorRoomEventComposer = 1840; // PRODUCTION-201611291003-338511768
public final static int HotelViewHideCommunityVoteButtonComposer = 1435; // PRODUCTION-201611291003-338511768
public final static int CatalogSearchResultComposer = 3388; // PRODUCTION-201611291003-338511768
public final static int FriendFindingRoomComposer = 1210; // PRODUCTION-201611291003-338511768
public final static int QuestComposer = 230; // PRODUCTION-201611291003-338511768
public final static int ModToolSanctionDataComposer = 2782; // PRODUCTION-201611291003-338511768
public final static int RoomEventMessageComposer = 2274;
public final static int JukeBoxMySongsComposer = 2602;
public final static int JukeBoxNowPlayingMessageComposer = 469;
public final static int JukeBoxPlaylistFullComposer = 105;
public final static int JukeBoxPlayListUpdatedComposer = 1748;
public final static int JukeBoxPlayListAddSongComposer = 1140;
public final static int JukeBoxPlayListComposer = 34;
public final static int JukeBoxTrackDataComposer = 3365;
public final static int JukeBoxTrackCodeComposer = 1381;
public final static int CraftableProductsComposer = 1000;
public final static int CraftingRecipeComposer = 2774;
public final static int CraftingResultComposer = 618;
public final static int CraftingComposerFour = 2124;
public final static int UnknownComposer_100 = 1553;
public final static int UnknownComposer_1031 = 1001;
public final static int ConnectionErrorComposer = 1004;
public final static int BotForceOpenContextMenuComposer = 296;
public final static int UnknownComposer_1111 = 1551;
public final static int Game2WeeklyLeaderboardComposer = 2196;
public final static int UnknownComposer_1165 = 904;
public final static int EffectsListAddComposer = 2867;
public final static int UnknownComposer_1188 = 1437;
public final static int UnknownComposer_1218 = 1730;
public final static int SubmitCompetitionRoomComposer = 3841;
public final static int GameAchievementsListComposer = 2265;
public final static int UnknownComposer_1271 = 1660;
public final static int OtherTradingDisabledComposer = 1254;
public final static int BaseJumpUnloadGameComposer = 1715;
public final static int UnknownComposer_1322 = 1730;
public final static int UnknownComposer_137 = 2897;
public final static int GameCenterAccountInfoComposer = 2893;
public final static int UnknowComposer_1390 = 2270;
public final static int BaseJumpLoadGameComposer = 3654;
public final static int UnknowComposer_1427 = 3319;
public final static int AdventCalendarDataComposer = 2531;
public final static int UnknownComposer_152 = 3954;
public final static int UnknownComposer_1529 = 1730;
public final static int UnknownComposer_1577 = 2641;
public final static int UnknownComposer_1712 = 1730;
public final static int NewYearResolutionCompletedComposer = 740;
public final static int UnknownComposer_1741 = 2246;
public final static int UnknownComposer_1744 = 2873;
public final static int AdventCalendarProductComposer = 2551;
public final static int ModToolSanctionInfoComposer = 2221;
public final static int UnknownComposer_1965 = 3292;
public final static int UnknownComposer_2053 = 1660;
public final static int GuideSessionPartnerIsPlayingComposer = 448;
public final static int BaseJumpLeaveQueueComposer = 1477;
public final static int Game2WeeklySmallLeaderboardComposer = 3512;
public final static int CatalogBuyVIPSMSComposer = 3315;
public final static int GameCenterGameListComposer = 222;
public final static int RoomUsersGuildBadgesComposer = 2402;
public final static int UnknownComposer_2563 = 1774;
public final static int UnknownComposer_2601 = 1663;
public final static int UnknownComposer_2621 = 1927;
public final static int UnknownComposer_2698 = 563;
public final static int JukeBoxMySongsComposer = 2602; // PRODUCTION-201611291003-338511768
public final static int JukeBoxNowPlayingMessageComposer = 469; // PRODUCTION-201611291003-338511768
public final static int JukeBoxPlaylistFullComposer = 105; // PRODUCTION-201611291003-338511768
public final static int JukeBoxPlayListUpdatedComposer = 1748; // PRODUCTION-201611291003-338511768
public final static int JukeBoxPlayListAddSongComposer = 1140; // PRODUCTION-201611291003-338511768
public final static int JukeBoxPlayListComposer = 34; // PRODUCTION-201611291003-338511768
public final static int JukeBoxTrackDataComposer = 3365; // PRODUCTION-201611291003-338511768
public final static int JukeBoxTrackCodeComposer = 1381; // PRODUCTION-201611291003-338511768
public final static int CraftableProductsComposer = 1000; // PRODUCTION-201611291003-338511768
public final static int CraftingRecipeComposer = 2774; // PRODUCTION-201611291003-338511768
public final static int CraftingResultComposer = 618; // PRODUCTION-201611291003-338511768
public final static int CraftingComposerFour = 2124; // PRODUCTION-201611291003-338511768
public final static int UnknownComposer_100 = 1553; // PRODUCTION-201611291003-338511768 //PetBReedingResult
public final static int UnknownComposer_1031 = 1001; // PRODUCTION-201611291003-338511768
public final static int ConnectionErrorComposer = 1004; // PRODUCTION-201611291003-338511768
public final static int BotForceOpenContextMenuComposer = 296; // PRODUCTION-201611291003-338511768
public final static int UnknownComposer_1111 = 1551; // PRODUCTION-201611291003-338511768
public final static int Game2WeeklyLeaderboardComposer = 2196; // PRODUCTION-201611291003-338511768
public final static int UnknownComposer_1165 = 904; // PRODUCTION-201611291003-338511768
public final static int EffectsListAddComposer = 2867; // PRODUCTION-201611291003-338511768
public final static int UnknownComposer_1188 = 1437; // PRODUCTION-201611291003-338511768
public final static int UnknownComposer_1218 = 1730; // PRODUCTION-201611291003-338511768
public final static int SubmitCompetitionRoomComposer = 3841; // PRODUCTION-201611291003-338511768
public final static int GameAchievementsListComposer = 2265; // PRODUCTION-201611291003-338511768
public final static int UnknownComposer_1271 = 1660; // PRODUCTION-201611291003-338511768
public final static int OtherTradingDisabledComposer = 1254; // PRODUCTION-201611291003-338511768
public final static int BaseJumpUnloadGameComposer = 1715; // PRODUCTION-201611291003-338511768
public final static int UnknownComposer_1322 = 1730; // PRODUCTION-201611291003-338511768
public final static int UnknownComposer_137 = 2897; // PRODUCTION-201611291003-338511768
public final static int GameCenterAccountInfoComposer = 2893; // PRODUCTION-201611291003-338511768
public final static int UnknowComposer_1390 = 2270; // PRODUCTION-201611291003-338511768
public final static int BaseJumpLoadGameComposer = 3654; // PRODUCTION-201611291003-338511768
public final static int UnknowComposer_1427 = 3319; // PRODUCTION-201611291003-338511768
public final static int AdventCalendarDataComposer = 2531; // PRODUCTION-201611291003-338511768
public final static int UnknownComposer_152 = 3954; // PRODUCTION-201611291003-338511768
public final static int UnknownComposer_1529 = 1730; // PRODUCTION-201611291003-338511768
public final static int UnknownComposer_1577 = 2641; // PRODUCTION-201611291003-338511768
public final static int UnknownComposer_1712 = 1730; // PRODUCTION-201611291003-338511768
public final static int NewYearResolutionCompletedComposer = 740; // PRODUCTION-201611291003-338511768
public final static int UnknownComposer_1741 = 2246; // PRODUCTION-201611291003-338511768
public final static int UnknownComposer_1744 = 2873; // PRODUCTION-201611291003-338511768
public final static int AdventCalendarProductComposer = 2551; // PRODUCTION-201611291003-338511768
public final static int ModToolSanctionInfoComposer = 2221; // PRODUCTION-201611291003-338511768
public final static int UnknownComposer_1965 = 3292; // PRODUCTION-201611291003-338511768
public final static int UnknownComposer_2053 = 1660; // PRODUCTION-201611291003-338511768
public final static int GuideSessionPartnerIsPlayingComposer = 448; // PRODUCTION-201611291003-338511768
public final static int BaseJumpLeaveQueueComposer = 1477; // PRODUCTION-201611291003-338511768
public final static int Game2WeeklySmallLeaderboardComposer = 3512; // PRODUCTION-201611291003-338511768
public final static int CatalogBuyVIPSMSComposer = 3315; // PRODUCTION-201611291003-338511768
public final static int GameCenterGameListComposer = 222; // PRODUCTION-201611291003-338511768
public final static int RoomUsersGuildBadgesComposer = 2402; // PRODUCTION-201611291003-338511768
public final static int UnknownComposer_2563 = 1774; // PRODUCTION-201611291003-338511768
public final static int UnknownComposer_2601 = 1663; // PRODUCTION-201611291003-338511768
public final static int UnknownComposer_2621 = 1927; // PRODUCTION-201611291003-338511768
public final static int UnknownComposer_2698 = 563; // PRODUCTION-201611291003-338511768
// 2699;
// 2748;
// 2773;
// 2964;
// 3020;
// 3024;
// 3046;
// 3124;
// 3179;
// 3189;
// 328;
// 3291;
// 3334;
public final static int HabboWayQuizComposer1 = 3379;
public final static int YouTradingDisabledComposer = 3058;
// 3391;
// 3427;
// 347;
// 3509;
// 3519;
// 3581;
// 3684;
public final static int YouTradingDisabledComposer = 3058; // PRODUCTION-201611291003-338511768
// 3707;
// 3745;
// 3759;
// 3782;
public final static int RoomFloorThicknessUpdatedComposer = 3786;
public final static int CameraPurchaseSuccesfullComposer = 2783;
public final static int CameraCompetitionStatusComposer = 133;
public final static int CameraURLComposer = 3696;
// 3822;
public final static int CameraPurchaseSuccesfullComposer = 2783; // PRODUCTION-201611291003-338511768
public final static int CameraCompetitionStatusComposer = 133; // PRODUCTION-201611291003-338511768
// 3986;
// 467;
// 549;
public final static int CameraURLComposer = 3696; // PRODUCTION-201611291003-338511768
// 608;
// 624;
// 675;
public final static int HotelViewCatalogPageExpiringComposer = 690;
// 749;
// 812;
// 843;
// 947;
// 982;
public final static int SimplePollAnswerComposer = 2589;
@ -564,4 +564,6 @@ public class Outgoing
public static final int SnowStormOnPlayerExitedArenaComposer = 5027;
public static final int SnowStormGenericErrorComposer = 5028;
public static final int SnowStormUserRematchedComposer = 5029;
}

View File

@ -6,8 +6,8 @@ import com.eu.habbo.messages.outgoing.Outgoing;
public class GuildConfirmRemoveMemberComposer extends MessageComposer
{
private final int userId;
private final int furniCount;
private int userId;
private int furniCount;
public GuildConfirmRemoveMemberComposer(int userId, int furniCount)
{

View File

@ -11,7 +11,7 @@ public class GuildEditFailComposer extends MessageComposer
public static final int HC_REQUIRED = 2;
public static final int MAX_GUILDS_JOINED = 3;
private final int errorCode;
private int errorCode;
public GuildEditFailComposer(int errorCode)
{

View File

@ -8,8 +8,8 @@ import com.eu.habbo.messages.outgoing.Outgoing;
public class GuildFavoriteRoomUserUpdateComposer extends MessageComposer
{
private final RoomUnit roomUnit;
private final Guild guild;
private RoomUnit roomUnit;
private Guild guild;
public GuildFavoriteRoomUserUpdateComposer(RoomUnit roomUnit, Guild guild)
{

View File

@ -25,7 +25,7 @@ public class GuildFurniWidgetComposer extends MessageComposer
public ServerMessage compose()
{
this.response.init(Outgoing.GuildFurniWidgetComposer);
this.response.appendInt(this.item.getId());
this.response.appendInt(item.getId());
this.response.appendInt(this.guild.getId());
this.response.appendString(this.guild.getName());
this.response.appendInt(this.guild.getRoomId());

View File

@ -45,14 +45,14 @@ public class GuildInfoComposer extends MessageComposer
this.response.appendBoolean(this.client.getHabbo().getHabboStats().guild == this.guild.getId()); //favorite group
this.response.appendString(new SimpleDateFormat("dd-MM-yyyy").format(new Date(this.guild.getDateCreated() * 1000L)));
this.response.appendBoolean(adminPermissions || (this.guild.getOwnerId() == this.client.getHabbo().getHabboInfo().getId()));
this.response.appendBoolean(adminPermissions || (this.member != null && (this.member.getRank().equals(GuildRank.MOD) || this.member.getRank().equals(GuildRank.ADMIN)))); //Is admin. //this.member.getRank().equals(GuildRank.MOD) ||
this.response.appendBoolean(adminPermissions || (this.member != null && (this.member.getRank().equals(GuildRank.ADMIN)))); //Is admin. //this.member.getRank().equals(GuildRank.MOD) ||
//Habbo owner = Emulator.getGameEnvironment().getHabboManager().getHabbo(this.guild.getOwnerId());
this.response.appendString(this.guild.getOwnerName());
this.response.appendBoolean(this.newWindow);
this.response.appendBoolean(this.guild.getRights() == 0); //User can place furni. this.guild.getRights() == 0
this.response.appendInt((adminPermissions || (this.member != null && (this.member.getRank().equals(GuildRank.MOD) || this.guild.getOwnerId() == this.client.getHabbo().getHabboInfo().getId()))) ? this.guild.getRequestCount() : 0); //Guild invites count.
this.response.appendBoolean(true); //Unknown
this.response.appendBoolean(this.guild.getRights() == 0); //User can place furni.
this.response.appendInt((adminPermissions || this.guild.getOwnerId() == this.client.getHabbo().getHabboInfo().getId()) ? this.guild.getRequestCount() : 0); //Guild invites count.
this.response.appendBoolean(this.guild.hasForum()); //Unknown
return this.response;
}
}

View File

@ -13,19 +13,19 @@ import java.util.TimeZone;
public class GuildMembersComposer extends MessageComposer
{
private final Guild guild;
private final int totalResults;
private final ArrayList<GuildMember> members;
private final Guild guild;
private final Habbo session;
private final int pageId;
private final int level;
private final String searchValue;
private final boolean isAdmin;
public GuildMembersComposer(Guild guild, int totalResults, ArrayList<GuildMember> members, int pageId, int level, String searchValue, boolean isAdmin)
public GuildMembersComposer(Guild guild, ArrayList<GuildMember> members, Habbo session, int pageId, int level, String searchValue, boolean isAdmin)
{
this.guild = guild;
this.totalResults = totalResults;
this.members = members;
this.session = session;
this.pageId = pageId;
this.level = level;
this.searchValue = searchValue;
@ -40,7 +40,7 @@ public class GuildMembersComposer extends MessageComposer
this.response.appendString(this.guild.getName());
this.response.appendInt(this.guild.getRoomId());
this.response.appendString(this.guild.getBadge());
this.response.appendInt(this.totalResults);
this.response.appendInt(this.guild.getMemberCount());
this.response.appendInt(this.members.size());
Calendar cal = Calendar.getInstance(TimeZone.getDefault());

View File

@ -1,37 +0,0 @@
package com.eu.habbo.messages.outgoing.guilds;
import com.eu.habbo.habbohotel.users.HabboGender;
import com.eu.habbo.messages.ServerMessage;
import com.eu.habbo.messages.outgoing.MessageComposer;
import com.eu.habbo.messages.outgoing.Outgoing;
public class GuildMembershipRequestedComposer extends MessageComposer
{
private final int guildId;
private final int requester;
private final String username;
private final String look;
private final HabboGender gender;
public GuildMembershipRequestedComposer(int guildId, int requester, String username, String look, HabboGender gender)
{
this.guildId = guildId;
this.requester = requester;
this.username = username;
this.look = look;
this.gender = gender;
}
@Override
public ServerMessage compose()
{
this.response.init(Outgoing.GuildMembershipRequestedComposer);
this.response.appendInt(this.guildId);
this.response.appendInt(2);
this.response.appendInt(this.requester);
this.response.appendString(this.username);
this.response.appendString(this.look);
this.response.appendString(this.gender.name());
return this.response;
}
}

View File

@ -6,7 +6,7 @@ import com.eu.habbo.messages.outgoing.Outgoing;
public class RemoveGuildFromRoomComposer extends MessageComposer
{
private final int guildId;
private int guildId;
public RemoveGuildFromRoomComposer(int guildId)
{

View File

@ -1,15 +0,0 @@
package com.eu.habbo.messages.outgoing.guilds.forums;
import com.eu.habbo.messages.ServerMessage;
import com.eu.habbo.messages.outgoing.MessageComposer;
public class ForumsTestComposer extends MessageComposer
{
@Override
public ServerMessage compose()
{
this.response.init(2379);
this.response.appendInt(0);
return this.response;
}
}

View File

@ -26,10 +26,12 @@ public class GuildForumCommentsComposer extends MessageComposer
public ServerMessage compose()
{
this.response.init(Outgoing.GuildForumCommentsComposer);
this.response.appendInt(this.guildId); //guild_id
this.response.appendInt(this.threadId); //thread_id
this.response.appendInt(this.index); //start_index
this.response.appendInt(this.guildForumCommentList.size());
for (final GuildForumComment comment : this.guildForumCommentList)
{
comment.serialize(this.response);

View File

@ -2,46 +2,78 @@ package com.eu.habbo.messages.outgoing.guilds.forums;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.guilds.Guild;
import com.eu.habbo.habbohotel.guilds.GuildMember;
import com.eu.habbo.habbohotel.guilds.GuildRank;
import com.eu.habbo.habbohotel.guilds.forums.GuildForum;
import com.eu.habbo.habbohotel.users.Habbo;
import com.eu.habbo.messages.ServerMessage;
import com.eu.habbo.messages.outgoing.MessageComposer;
import com.eu.habbo.messages.outgoing.Outgoing;
public class GuildForumDataComposer extends MessageComposer
{
public class GuildForumDataComposer extends MessageComposer {
public final GuildForum forum;
public Habbo habbo;
public GuildForumDataComposer(GuildForum forum, Habbo habbo)
{
public GuildForumDataComposer(GuildForum forum, Habbo habbo) {
this.forum = forum;
this.habbo = habbo;
}
@Override
public ServerMessage compose()
{
//Possibly related to settings.
public ServerMessage compose() {
this.response.init(Outgoing.GuildForumDataComposer);
//_SafeStr_3845._SafeStr_19178(k)
{
this.forum.serializeUserForum(this.response, this.habbo);
Guild guild = Emulator.getGameEnvironment().getGuildManager().getGuild(this.forum.getGuild());
GuildMember member = Emulator.getGameEnvironment().getGuildManager().getGuildMember(guild, habbo);
boolean isAdmin = member != null && (member.getRank() == GuildRank.MOD || member.getRank() == GuildRank.ADMIN || guild.getOwnerId() == this.habbo.getHabboInfo().getId());
boolean isStaff = this.habbo.hasPermission("acc_modtool_ticket_q");
String errorRead = "";
String errorPost = "";
String errorStartThread = "";
String errorModerate = "";
if (guild.canReadForum().state == 1 && member == null && !isStaff) {
errorRead = "not_member";
} else if (guild.canReadForum().state == 2 && !isAdmin && !isStaff) {
errorRead = "not_admin";
}
if (guild.canPostMessages().state == 1 && member == null && !isStaff) {
errorPost = "not_member";
} else if (guild.canPostMessages().state == 2 && !isAdmin && !isStaff) {
errorPost = "not_admin";
} else if (guild.canPostMessages().state == 3 && guild.getOwnerId() != this.habbo.getHabboInfo().getId() && !isStaff) {
errorPost = "now_owner";
}
if (guild.canPostThreads().state == 1 && member == null && !isStaff) {
errorStartThread = "not_member";
} else if (guild.canPostThreads().state == 2 && !isAdmin && !isStaff) {
errorStartThread = "not_admin";
} else if (guild.canPostThreads().state == 3 && guild.getOwnerId() != this.habbo.getHabboInfo().getId() && !isStaff) {
errorStartThread = "now_owner";
}
if (guild.canModForum().state == 2 && !isAdmin && !isStaff) {
errorModerate = "not_admin";
} else if (guild.canModForum().state == 3 && guild.getOwnerId() != this.habbo.getHabboInfo().getId() && !isStaff) {
errorModerate = "now_owner";
}
this.response.appendInt(guild.canReadForum().state);
this.response.appendInt(guild.canPostMessages().state);
this.response.appendInt(guild.canPostThreads().state);
this.response.appendInt(guild.canModForum().state);
this.response.appendString(""); //_local_2._SafeStr_19197 = k.readString();
this.response.appendString(""); //_local_2._SafeStr_19198 = k.readString(); = member
this.response.appendString(guild.getOwnerId()== this.habbo.getClient().getHabbo().getHabboInfo().getId() ? "" : "not_owner"); //_local_2._SafeStr_19199 = k.readString(); = owner
this.response.appendString(guild.getOwnerId()== this.habbo.getClient().getHabbo().getHabboInfo().getId() ? "" : "not_admin"); //_local_2._SafeStr_19200 = k.readString(); = admin
this.response.appendString(""); //_local_2._SafeStr_19201 = k.readString(); = citizen
this.response.appendBoolean(guild.getOwnerId() == this.habbo.getClient().getHabbo().getHabboInfo().getId()); //;_local_2._SafeStr_19202 = k.readBoolean(); = acces forum settings
this.response.appendBoolean(false); //_local_2._SafeStr_19203 = k.readBoolean();
this.response.appendString(errorRead);
this.response.appendString(errorPost);
this.response.appendString(errorStartThread);
this.response.appendString(errorModerate);
this.response.appendString(""); //citizen
this.response.appendBoolean(guild.getOwnerId() == this.habbo.getHabboInfo().getId()); //Forum Settings
this.response.appendBoolean(guild.getOwnerId() == this.habbo.getHabboInfo().getId() || isStaff); //Can Mod (staff)
}
return this.response;
}

View File

@ -7,30 +7,34 @@ import com.eu.habbo.messages.outgoing.MessageComposer;
import com.eu.habbo.messages.outgoing.Outgoing;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
public class GuildForumListComposer extends MessageComposer
{
public class GuildForumListComposer extends MessageComposer {
private final List<GuildForum> forums;
private final Habbo habbo;
private final int viewMode;
private final int startIndex;
public GuildForumListComposer(List<GuildForum> forums, Habbo habbo, int viewMode)
{
this.forums = forums;
this.habbo = habbo;
public GuildForumListComposer(List<GuildForum> forums, Habbo habbo, int viewMode, int page) {
this.forums = forums;
this.habbo = habbo;
this.viewMode = viewMode;
this.startIndex = page;
}
@Override
public ServerMessage compose()
{
public ServerMessage compose() {
forums.removeIf(Objects::isNull);
List<Integer> guilds = forums.stream().skip(this.startIndex).limit(20).map(GuildForum::getGuild).collect(Collectors.toList());
this.response.init(Outgoing.GuildForumListComposer);
this.response.appendInt(this.viewMode);
this.response.appendInt(guilds.size());
this.response.appendInt(0);
this.response.appendInt(0);
this.response.appendInt(this.forums.size()); //Count...
for (final GuildForum forum : this.forums)
{
this.response.appendInt(this.forums.size());
for (final GuildForum forum : this.forums) {
forum.serializeUserForum(this.response, this.habbo);
}

View File

@ -5,13 +5,13 @@ import com.eu.habbo.messages.ServerMessage;
import com.eu.habbo.messages.outgoing.MessageComposer;
import com.eu.habbo.messages.outgoing.Outgoing;
public class UnknownGuildForumComposer6 extends MessageComposer
public class PostUpdateMessageComposer extends MessageComposer
{
public final int guildId;
public final int threadId;
public final GuildForumComment comment;
public UnknownGuildForumComposer6(int guildId, int threadId, GuildForumComment comment)
public PostUpdateMessageComposer(int guildId, int threadId, GuildForumComment comment)
{
this.guildId = guildId;
this.threadId = threadId;
@ -21,10 +21,12 @@ public class UnknownGuildForumComposer6 extends MessageComposer
@Override
public ServerMessage compose()
{
this.response.init(Outgoing.UnknownGuildForumComposer6);
this.response.init(Outgoing.PostUpdateMessageComposer);
this.response.appendInt(this.guildId); //guild_id
this.response.appendInt(this.threadId); //thread_id
this.comment.serialize(this.response); //Comment
return this.response;
}
}

View File

@ -0,0 +1,73 @@
package com.eu.habbo.messages.outgoing.guilds.forums;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.guilds.Guild;
import com.eu.habbo.habbohotel.guilds.GuildRank;
import com.eu.habbo.habbohotel.guilds.forums.GuildForum;
import com.eu.habbo.habbohotel.guilds.forums.GuildForumThread;
import com.eu.habbo.habbohotel.users.Habbo;
import com.eu.habbo.messages.ServerMessage;
import com.eu.habbo.messages.outgoing.MessageComposer;
import com.eu.habbo.messages.outgoing.Outgoing;
import com.eu.habbo.messages.outgoing.generic.alerts.BubbleAlertComposer;
import com.eu.habbo.messages.outgoing.generic.alerts.BubbleAlertKeys;
public class ThreadUpdatedMessageComposer extends MessageComposer {
public final GuildForumThread thread;
public final GuildForum forum;
private final Habbo habbo;
private final boolean isPinned;
private final boolean isLocked;
public ThreadUpdatedMessageComposer(GuildForum forum, Integer thread, Habbo habbo, boolean isPinned, boolean isLocked) {
this.forum = forum;
this.habbo = habbo;
this.thread = forum.getThread(thread);
this.isPinned = isPinned;
this.isLocked = isLocked;
}
@Override
public ServerMessage compose() {
Guild guild = Emulator.getGameEnvironment().getGuildManager().getGuild(forum.getGuild());
if (this.thread == null)
return null;
if (isPinned != thread.isPinned()) {
this.habbo.getClient().sendResponse(new BubbleAlertComposer(isPinned ? BubbleAlertKeys.FORUMS_THREAD_PINNED.key : BubbleAlertKeys.FORUMS_THREAD_UNPINNED.key).compose());
}
if (isLocked != thread.isLocked()) {
this.habbo.getClient().sendResponse(new BubbleAlertComposer(isLocked ? BubbleAlertKeys.FORUMS_THREAD_LOCKED.key : BubbleAlertKeys.FORUMS_THREAD_UNLOCKED.key).compose());
}
if (this.habbo.getHabboInfo().getId() != guild.getOwnerId() ||
guild.canModForum().state == 2 && (Emulator.getGameEnvironment().getGuildManager().getGuildMember(guild, habbo).getRank() == GuildRank.ADMIN
|| Emulator.getGameEnvironment().getGuildManager().getGuildMember(guild, habbo).getRank() == GuildRank.MOD)
|| this.habbo.hasPermission("acc_modtool_ticket_q")) {
this.thread.setPinned(isPinned);
this.thread.setLocked(isLocked);
this.response.init(Outgoing.ThreadUpdateMessageComposer);
this.response.appendInt(this.thread.getGuildId());
this.thread.serialize(this.response);
guild.needsUpdate = true;
Emulator.getThreading().run(this.thread);
Emulator.getThreading().run(guild);
return this.response;
}
return null;
}
}

View File

@ -1,25 +0,0 @@
package com.eu.habbo.messages.outgoing.guilds.forums;
import com.eu.habbo.habbohotel.guilds.forums.GuildForumThread;
import com.eu.habbo.messages.ServerMessage;
import com.eu.habbo.messages.outgoing.MessageComposer;
import com.eu.habbo.messages.outgoing.Outgoing;
public class UnknownGuildForumComposer7 extends MessageComposer
{
public final GuildForumThread thread;
public UnknownGuildForumComposer7(GuildForumThread thread)
{
this.thread = thread;
}
@Override
public ServerMessage compose()
{
this.response.init(Outgoing.UnknownGuildForumComposer7);
this.response.appendInt(this.thread.getGuildId());
this.thread.serialize(this.response);
return this.response;
}
}