mirror of
https://git.krews.org/morningstar/Arcturus-Community.git
synced 2024-11-23 15:20:52 +01:00
Refactor guild rank names and fix #327
This commit is contained in:
parent
9a161e1184
commit
b439774c11
@ -118,13 +118,13 @@ public final class Emulator {
|
||||
Emulator.texts = new TextsManager();
|
||||
new CleanerThread();
|
||||
Emulator.gameServer = new GameServer(getConfig().getValue("game.host", "127.0.0.1"), getConfig().getInt("game.port", 30000));
|
||||
Emulator.rconServer = new RCONServer(getConfig().getValue("rcon.host", "127.0.0.1"), getConfig().getInt("rcon.port", 30001));
|
||||
//Emulator.rconServer = new RCONServer(getConfig().getValue("rcon.host", "127.0.0.1"), getConfig().getInt("rcon.port", 30001));
|
||||
Emulator.gameEnvironment = new GameEnvironment();
|
||||
Emulator.gameEnvironment.load();
|
||||
Emulator.gameServer.initializePipeline();
|
||||
Emulator.gameServer.connect();
|
||||
Emulator.rconServer.initializePipeline();
|
||||
Emulator.rconServer.connect();
|
||||
//Emulator.rconServer.initializePipeline();
|
||||
//Emulator.rconServer.connect();
|
||||
Emulator.badgeImager = new BadgeImager();
|
||||
Emulator.getLogging().logStart("Arcturus Morningstar has succesfully loaded. You're running: " + Emulator.version);
|
||||
Emulator.getLogging().logStart("System launched in: " + (System.nanoTime() - startTime) / 1e6 + "ms. Using: " + (Runtime.getRuntime().availableProcessors() * 2) + " threads!");
|
||||
|
@ -1,8 +1,8 @@
|
||||
package com.eu.habbo.habbohotel.guilds;
|
||||
|
||||
public enum GuildRank {
|
||||
ADMIN(0),
|
||||
MOD(1),
|
||||
OWNER(0),
|
||||
ADMIN(1),
|
||||
MEMBER(2),
|
||||
REQUESTED(3),
|
||||
DELETED(4);
|
||||
|
@ -79,8 +79,8 @@ public class ModToolIssue implements ISerialize {
|
||||
message.appendString(this.senderUsername); //Reporter user name.
|
||||
message.appendInt(this.reportedId); //Reported user ID.
|
||||
message.appendString(this.reportedUsername); //Reported user name.
|
||||
message.appendInt(this.modId); //MOD User ID?
|
||||
message.appendString(this.modName); //MOD User name?
|
||||
message.appendInt(this.modId); //ADMIN User ID?
|
||||
message.appendString(this.modName); //ADMIN User name?
|
||||
message.appendString(this.message);
|
||||
message.appendInt(0);
|
||||
|
||||
|
@ -18,7 +18,7 @@ public class GuildConfirmRemoveMemberEvent extends MessageHandler {
|
||||
|
||||
if (guild != null) {
|
||||
GuildMember member = Emulator.getGameEnvironment().getGuildManager().getGuildMember(guild, this.client.getHabbo());
|
||||
if (userId == this.client.getHabbo().getHabboInfo().getId() || guild.getOwnerId() == this.client.getHabbo().getHabboInfo().getId() || (member != null && member.getRank().equals(GuildRank.ADMIN)) || this.client.getHabbo().hasPermission("acc_guild_admin")) {
|
||||
if (userId == this.client.getHabbo().getHabboInfo().getId() || guild.getOwnerId() == this.client.getHabbo().getHabboInfo().getId() || (member != null && member.getRank().equals(GuildRank.OWNER)) || this.client.getHabbo().hasPermission("acc_guild_admin")) {
|
||||
Room room = Emulator.getGameEnvironment().getRoomManager().loadRoom(guild.getRoomId());
|
||||
int count = 0;
|
||||
if (room != null) {
|
||||
|
@ -22,7 +22,7 @@ public class GuildDeclineMembershipEvent extends MessageHandler {
|
||||
|
||||
if (guild != null) {
|
||||
GuildMember member = Emulator.getGameEnvironment().getGuildManager().getGuildMember(guild, this.client.getHabbo());
|
||||
if (userId == this.client.getHabbo().getHabboInfo().getId() || guild.getOwnerId() == this.client.getHabbo().getHabboInfo().getId() || member.getRank().equals(GuildRank.ADMIN) || this.client.getHabbo().hasPermission("acc_guild_admin")) {
|
||||
if (userId == this.client.getHabbo().getHabboInfo().getId() || guild.getOwnerId() == this.client.getHabbo().getHabboInfo().getId() || member.getRank().equals(GuildRank.OWNER) || this.client.getHabbo().hasPermission("acc_guild_admin")) {
|
||||
guild.decreaseRequestCount();
|
||||
Emulator.getGameEnvironment().getGuildManager().removeMember(guild, userId);
|
||||
this.client.sendResponse(new GuildMembersComposer(guild, Emulator.getGameEnvironment().getGuildManager().getGuildMembers(guild, 0, 0, ""), this.client.getHabbo(), 0, 0, "", true, Emulator.getGameEnvironment().getGuildManager().getGuildMembersCount(guild, 0, 0, "")));
|
||||
|
@ -22,7 +22,7 @@ public class GuildRemoveMemberEvent extends MessageHandler {
|
||||
|
||||
if (guild != null) {
|
||||
GuildMember member = Emulator.getGameEnvironment().getGuildManager().getGuildMember(guild, this.client.getHabbo());
|
||||
if (userId == this.client.getHabbo().getHabboInfo().getId() || guild.getOwnerId() == this.client.getHabbo().getHabboInfo().getId() || member.getRank().equals(GuildRank.ADMIN) || this.client.getHabbo().hasPermission("acc_guild_admin")) {
|
||||
if (userId == this.client.getHabbo().getHabboInfo().getId() || guild.getOwnerId() == this.client.getHabbo().getHabboInfo().getId() || member.getRank().equals(GuildRank.OWNER) || this.client.getHabbo().hasPermission("acc_guild_admin")) {
|
||||
Habbo habbo = Emulator.getGameEnvironment().getHabboManager().getHabbo(userId);
|
||||
GuildRemovedMemberEvent removedMemberEvent = new GuildRemovedMemberEvent(guild, userId, habbo);
|
||||
Emulator.getPluginManager().fireEvent(removedMemberEvent);
|
||||
|
@ -21,7 +21,7 @@ public class RequestGuildMembersEvent extends MessageHandler {
|
||||
boolean isAdmin = this.client.getHabbo().hasPermission("acc_guild_admin");
|
||||
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));
|
||||
isAdmin = member != null && (member.getRank().equals(GuildRank.OWNER) || member.getRank().equals(GuildRank.ADMIN));
|
||||
}
|
||||
|
||||
this.client.sendResponse(new GuildMembersComposer(g, Emulator.getGameEnvironment().getGuildManager().getGuildMembers(g, pageId, levelId, query), this.client.getHabbo(), pageId, levelId, query, isAdmin, Emulator.getGameEnvironment().getGuildManager().getGuildMembersCount(g, pageId, levelId, query)));
|
||||
|
@ -36,13 +36,13 @@ public class GuildInfoComposer extends MessageComposer {
|
||||
this.response.appendString(this.guild.getBadge());
|
||||
this.response.appendInt(this.guild.getRoomId());
|
||||
this.response.appendString(this.guild.getRoomName());
|
||||
//this.response.appendInt(this.guild.getOwnerId() == this.client.getHabbo().getHabboInfo().getId() ? 3 : (this.member == null ? 0 : (this.member.getRank().equals(GuildRank.MEMBER) || this.member.getRank().equals(GuildRank.MOD) ? 1 : (this.member.getRank().equals(GuildRank.REQUESTED) ? 2 : 0))));
|
||||
this.response.appendInt(adminPermissions ? 4 : (this.member == null ? 0 : (this.member.getRank().equals(GuildRank.MEMBER) ? 1 : (this.member.getRank().equals(GuildRank.REQUESTED) ? 2 : (this.member.getRank().equals(GuildRank.MOD) ? 3 : (this.member.getRank().equals(GuildRank.ADMIN) ? 4 : 0))))));
|
||||
//this.response.appendInt(this.guild.getOwnerId() == this.client.getHabbo().getHabboInfo().getId() ? 3 : (this.member == null ? 0 : (this.member.getRank().equals(GuildRank.MEMBER) || this.member.getRank().equals(GuildRank.ADMIN) ? 1 : (this.member.getRank().equals(GuildRank.REQUESTED) ? 2 : 0))));
|
||||
this.response.appendInt(adminPermissions ? 4 : (this.member == null ? 0 : (this.member.getRank().equals(GuildRank.MEMBER) ? 1 : (this.member.getRank().equals(GuildRank.REQUESTED) ? 2 : (this.member.getRank().equals(GuildRank.ADMIN) ? 3 : (this.member.getRank().equals(GuildRank.OWNER) ? 4 : 0))))));
|
||||
this.response.appendInt(this.guild.getMemberCount()); //Member count.
|
||||
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.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.ADMIN) ||
|
||||
//Habbo owner = Emulator.getGameEnvironment().getHabboManager().getHabbo(this.guild.getOwnerId());
|
||||
|
||||
this.response.appendString(this.guild.getOwnerName());
|
||||
|
@ -42,8 +42,8 @@ public class ThreadUpdatedMessageComposer extends MessageComposer {
|
||||
}
|
||||
|
||||
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)
|
||||
guild.canModForum().state == 2 && (Emulator.getGameEnvironment().getGuildManager().getGuildMember(guild, habbo).getRank() == GuildRank.OWNER
|
||||
|| Emulator.getGameEnvironment().getGuildManager().getGuildMember(guild, habbo).getRank() == GuildRank.ADMIN)
|
||||
|| this.habbo.hasPermission("acc_modtool_ticket_q")) {
|
||||
this.thread.setPinned(isPinned);
|
||||
this.thread.setLocked(isLocked);
|
||||
|
Loading…
Reference in New Issue
Block a user