Fixed guild rights

This commit is contained in:
Beny 2019-05-12 06:35:08 +01:00
parent d0e12d6871
commit 3c4c118d96
6 changed files with 14 additions and 15 deletions

View File

@ -17,7 +17,7 @@ public class Guild implements Runnable
private int roomId; private int roomId;
private String roomName; private String roomName;
private GuildState state; private GuildState state;
private int rights; private boolean rights;
private int colorOne; private int colorOne;
private int colorTwo; private int colorTwo;
private String badge; private String badge;
@ -43,7 +43,7 @@ public class Guild implements Runnable
this.state = GuildState.values()[set.getInt("state")]; this.state = GuildState.values()[set.getInt("state")];
this.roomId = set.getInt("room_id"); this.roomId = set.getInt("room_id");
this.roomName = set.getString("room_name"); this.roomName = set.getString("room_name");
this.rights = set.getString("rights").equalsIgnoreCase("1") ? 1 : 0; this.rights = set.getString("rights").equalsIgnoreCase("1");
this.colorOne = set.getInt("color_one"); this.colorOne = set.getInt("color_one");
this.colorTwo = set.getInt("color_two"); this.colorTwo = set.getInt("color_two");
this.badge = set.getString("badge"); this.badge = set.getString("badge");
@ -67,7 +67,7 @@ public class Guild implements Runnable
this.name = name; this.name = name;
this.description = description; this.description = description;
this.state = GuildState.OPEN; this.state = GuildState.OPEN;
this.rights = 0; this.rights = false;
this.colorOne = colorOne; this.colorOne = colorOne;
this.colorTwo = colorTwo; this.colorTwo = colorTwo;
this.badge = badge; this.badge = badge;
@ -119,7 +119,7 @@ public class Guild implements Runnable
statement.setString(1, this.name); statement.setString(1, this.name);
statement.setString(2, this.description); statement.setString(2, this.description);
statement.setInt(3, this.state.state); statement.setInt(3, this.state.state);
statement.setString(4, this.rights == 1 ? "1" : "0"); statement.setString(4, this.rights ? "1" : "0");
statement.setInt(5, this.colorOne); statement.setInt(5, this.colorOne);
statement.setInt(6, this.colorTwo); statement.setInt(6, this.colorTwo);
statement.setString(7, this.badge); statement.setString(7, this.badge);
@ -200,12 +200,12 @@ public class Guild implements Runnable
this.state = state; this.state = state;
} }
public int getRights() public boolean getRights()
{ {
return this.rights; return this.rights;
} }
public void setRights(int rights) public void setRights(boolean rights)
{ {
this.rights = rights; this.rights = rights;
} }

View File

@ -4620,7 +4620,7 @@ public class Room implements Comparable<Room>, ISerialize, Runnable
if(Emulator.getGameEnvironment().getGuildManager().getOnlyAdmins(guild).get(habbo.getHabboInfo().getId()) != null) if(Emulator.getGameEnvironment().getGuildManager().getOnlyAdmins(guild).get(habbo.getHabboInfo().getId()) != null)
return 3; return 3;
if(guild.getRights() == 0) if(guild.getRights())
{ {
return 2; return 2;
} }

View File

@ -25,7 +25,7 @@ public class GuildChangeSettingsEvent extends MessageHandler
if (room == null) if (room == null)
return; return;
GuildChangedSettingsEvent settingsEvent = new GuildChangedSettingsEvent(guild, this.packet.readInt(), this.packet.readInt()); GuildChangedSettingsEvent settingsEvent = new GuildChangedSettingsEvent(guild, this.packet.readInt(), this.packet.readInt() == 0);
Emulator.getPluginManager().fireEvent(settingsEvent); Emulator.getPluginManager().fireEvent(settingsEvent);
if (settingsEvent.isCancelled()) if (settingsEvent.isCancelled())

View File

@ -50,7 +50,7 @@ public class GuildInfoComposer extends MessageComposer
this.response.appendString(this.guild.getOwnerName()); this.response.appendString(this.guild.getOwnerName());
this.response.appendBoolean(this.newWindow); this.response.appendBoolean(this.newWindow);
this.response.appendBoolean(this.guild.getRights() == 0); //User can place furni. this.response.appendBoolean(this.guild.getRights()); //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.appendInt((adminPermissions || this.guild.getOwnerId() == this.client.getHabbo().getHabboInfo().getId()) ? this.guild.getRequestCount() : 0); //Guild invites count.
this.response.appendBoolean(this.guild.hasForum()); //Unknown this.response.appendBoolean(this.guild.hasForum()); //Unknown
return this.response; return this.response;

View File

@ -19,8 +19,8 @@ public class GuildManageComposer extends MessageComposer
{ {
this.response.init(Outgoing.GuildManageComposer); this.response.init(Outgoing.GuildManageComposer);
this.response.appendInt(1); this.response.appendInt(1);
this.response.appendInt(1); this.response.appendInt(guild.getRoomId());
this.response.appendString("Room Name"); this.response.appendString(guild.getRoomName());
this.response.appendBoolean(false); this.response.appendBoolean(false);
this.response.appendBoolean(true); this.response.appendBoolean(true);
this.response.appendInt(this.guild.getId()); this.response.appendInt(this.guild.getId());
@ -30,7 +30,7 @@ public class GuildManageComposer extends MessageComposer
this.response.appendInt(this.guild.getColorOne()); this.response.appendInt(this.guild.getColorOne());
this.response.appendInt(this.guild.getColorTwo()); this.response.appendInt(this.guild.getColorTwo());
this.response.appendInt(this.guild.getState().state); this.response.appendInt(this.guild.getState().state);
this.response.appendInt(this.guild.getRights()); this.response.appendInt(this.guild.getRights() ? 0 : 1);
this.response.appendBoolean(false); this.response.appendBoolean(false);
this.response.appendString(""); this.response.appendString("");
this.response.appendInt(5); this.response.appendInt(5);

View File

@ -7,10 +7,9 @@ public class GuildChangedSettingsEvent extends GuildEvent
public int state; public int state;
public boolean rights;
public int rights; public GuildChangedSettingsEvent(Guild guild, int state, boolean rights)
public GuildChangedSettingsEvent(Guild guild, int state, int rights)
{ {
super(guild); super(guild);
this.state = state; this.state = state;