mirror of
https://git.krews.org/morningstar/Arcturus-Community.git
synced 2024-11-30 09:50:51 +01:00
Merge branch '297-userinfosanction' into 'dev'
feat(ModToolUserInfoComposer): display last sanction + small improv. See merge request morningstar/Arcturus-Community!79
This commit is contained in:
commit
b0446cebc4
@ -142,10 +142,11 @@ public class SecureLoginEvent extends MessageHandler {
|
||||
this.client.sendResponse(new AchievementListComposer(this.client.getHabbo()));
|
||||
|
||||
ModToolSanctions modToolSanctions = Emulator.getGameEnvironment().getModToolSanctions();
|
||||
|
||||
if (Emulator.getConfig().getBoolean("hotel.sanctions.enabled")) {
|
||||
THashMap<Integer, ArrayList<ModToolSanctionItem>> modToolSanctionItemsHashMap = Emulator.getGameEnvironment().getModToolSanctions().getSanctions(habbo.getHabboInfo().getId());
|
||||
ArrayList<ModToolSanctionItem> modToolSanctionItems = modToolSanctionItemsHashMap.get(habbo.getHabboInfo().getId());
|
||||
|
||||
|
||||
if (modToolSanctionItems != null && modToolSanctionItems.size() > 0) {
|
||||
ModToolSanctionItem item = modToolSanctionItems.get(modToolSanctionItems.size() - 1);
|
||||
|
||||
@ -171,6 +172,7 @@ public class SecureLoginEvent extends MessageHandler {
|
||||
habbo.mute(Math.toIntExact(diff));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Emulator.getPluginManager().fireEvent(new UserLoginEvent(habbo, this.client.getChannel().localAddress()));
|
||||
|
||||
|
@ -26,10 +26,11 @@ public class ModToolSanctionAlertEvent extends MessageHandler {
|
||||
|
||||
if (habbo != null) {
|
||||
ModToolSanctions modToolSanctions = Emulator.getGameEnvironment().getModToolSanctions();
|
||||
|
||||
if (Emulator.getConfig().getBoolean("hotel.sanctions.enabled")) {
|
||||
THashMap<Integer, ArrayList<ModToolSanctionItem>> modToolSanctionItemsHashMap = Emulator.getGameEnvironment().getModToolSanctions().getSanctions(habbo.getHabboInfo().getId());
|
||||
ArrayList<ModToolSanctionItem> modToolSanctionItems = modToolSanctionItemsHashMap.get(habbo.getHabboInfo().getId());
|
||||
|
||||
if (Emulator.getConfig().getBoolean("hotel.sanctions.enabled")) {
|
||||
if (modToolSanctionItems != null && !modToolSanctionItems.isEmpty()) {
|
||||
ModToolSanctionItem item = modToolSanctionItems.get(modToolSanctionItems.size() - 1);
|
||||
|
||||
|
@ -50,10 +50,11 @@ public class ModToolSanctionBanEvent extends MessageHandler {
|
||||
}
|
||||
if (this.client.getHabbo().hasPermission(Permission.ACC_SUPPORTTOOL)) {
|
||||
ModToolSanctions modToolSanctions = Emulator.getGameEnvironment().getModToolSanctions();
|
||||
|
||||
if (Emulator.getConfig().getBoolean("hotel.sanctions.enabled")) {
|
||||
THashMap<Integer, ArrayList<ModToolSanctionItem>> modToolSanctionItemsHashMap = Emulator.getGameEnvironment().getModToolSanctions().getSanctions(userId);
|
||||
ArrayList<ModToolSanctionItem> modToolSanctionItems = modToolSanctionItemsHashMap.get(userId);
|
||||
|
||||
if (Emulator.getConfig().getBoolean("hotel.sanctions.enabled")) {
|
||||
if (modToolSanctionItems != null && !modToolSanctionItemsHashMap.isEmpty()) {
|
||||
ModToolSanctionItem item = modToolSanctionItems.get(modToolSanctionItems.size() - 1);
|
||||
|
||||
|
@ -28,10 +28,11 @@ public class ModToolSanctionMuteEvent extends MessageHandler {
|
||||
|
||||
if (habbo != null) {
|
||||
ModToolSanctions modToolSanctions = Emulator.getGameEnvironment().getModToolSanctions();
|
||||
|
||||
if (Emulator.getConfig().getBoolean("hotel.sanctions.enabled")) {
|
||||
THashMap<Integer, ArrayList<ModToolSanctionItem>> modToolSanctionItemsHashMap = Emulator.getGameEnvironment().getModToolSanctions().getSanctions(habbo.getHabboInfo().getId());
|
||||
ArrayList<ModToolSanctionItem> modToolSanctionItems = modToolSanctionItemsHashMap.get(habbo.getHabboInfo().getId());
|
||||
|
||||
if (Emulator.getConfig().getBoolean("hotel.sanctions.enabled")) {
|
||||
if (modToolSanctionItems != null && !modToolSanctionItemsHashMap.isEmpty()) {
|
||||
ModToolSanctionItem item = modToolSanctionItems.get(modToolSanctionItems.size() - 1);
|
||||
|
||||
|
@ -26,10 +26,11 @@ public class ModToolSanctionTradeLockEvent extends MessageHandler {
|
||||
|
||||
if (habbo != null) {
|
||||
ModToolSanctions modToolSanctions = Emulator.getGameEnvironment().getModToolSanctions();
|
||||
|
||||
if (Emulator.getConfig().getBoolean("hotel.sanctions.enabled")) {
|
||||
THashMap<Integer, ArrayList<ModToolSanctionItem>> modToolSanctionItemsHashMap = Emulator.getGameEnvironment().getModToolSanctions().getSanctions(userId);
|
||||
ArrayList<ModToolSanctionItem> modToolSanctionItems = modToolSanctionItemsHashMap.get(userId);
|
||||
|
||||
if (Emulator.getConfig().getBoolean("hotel.sanctions.enabled")) {
|
||||
if (modToolSanctionItems != null && !modToolSanctionItems.isEmpty()) {
|
||||
ModToolSanctionItem item = modToolSanctionItems.get(modToolSanctionItems.size() - 1);
|
||||
|
||||
|
@ -26,12 +26,14 @@ public class ModToolSanctionInfoComposer extends MessageComposer {
|
||||
@Override
|
||||
public ServerMessage compose() {
|
||||
ModToolSanctions modToolSanctions = Emulator.getGameEnvironment().getModToolSanctions();
|
||||
THashMap<Integer, ArrayList<ModToolSanctionItem>> modToolSanctionItemsHashMap = Emulator.getGameEnvironment().getModToolSanctions().getSanctions(habbo.getHabboInfo().getId());
|
||||
ArrayList<ModToolSanctionItem> modToolSanctionItems = modToolSanctionItemsHashMap.get(habbo.getHabboInfo().getId());
|
||||
|
||||
Date probationEndTime;
|
||||
Date probationStartTime = null;
|
||||
|
||||
if (Emulator.getConfig().getBoolean("hotel.sanctions.enabled")) {
|
||||
THashMap<Integer, ArrayList<ModToolSanctionItem>> modToolSanctionItemsHashMap = Emulator.getGameEnvironment().getModToolSanctions().getSanctions(habbo.getHabboInfo().getId());
|
||||
ArrayList<ModToolSanctionItem> modToolSanctionItems = modToolSanctionItemsHashMap.get(habbo.getHabboInfo().getId());
|
||||
|
||||
if (modToolSanctionItems != null && modToolSanctionItems.size() > 0) {
|
||||
ModToolSanctionItem item = modToolSanctionItems.get(modToolSanctionItems.size() - 1);
|
||||
|
||||
@ -69,6 +71,7 @@ public class ModToolSanctionInfoComposer extends MessageComposer {
|
||||
this.response.appendBoolean(item.isMuted); // muted
|
||||
this.response.appendString(tradeLockedUntil == null ? "" : tradeLockedUntil.toString()); // trade locked until
|
||||
|
||||
}
|
||||
} else {
|
||||
this.response.init(Outgoing.ModToolSanctionInfoComposer);
|
||||
|
||||
|
@ -1,12 +1,17 @@
|
||||
package com.eu.habbo.messages.outgoing.modtool;
|
||||
|
||||
import com.eu.habbo.Emulator;
|
||||
import com.eu.habbo.habbohotel.modtool.ModToolSanctionItem;
|
||||
import com.eu.habbo.habbohotel.modtool.ModToolSanctionLevelItem;
|
||||
import com.eu.habbo.habbohotel.modtool.ModToolSanctions;
|
||||
import com.eu.habbo.messages.ServerMessage;
|
||||
import com.eu.habbo.messages.outgoing.MessageComposer;
|
||||
import com.eu.habbo.messages.outgoing.Outgoing;
|
||||
import gnu.trove.map.hash.THashMap;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class ModToolUserInfoComposer extends MessageComposer {
|
||||
private final ResultSet set;
|
||||
@ -37,11 +42,23 @@ public class ModToolUserInfoComposer extends MessageComposer {
|
||||
this.response.appendString(this.set.getString("mail"));
|
||||
this.response.appendString("Rank (" + this.set.getInt("rank_id") + "): " + this.set.getString("rank_name")); //user_class_txt
|
||||
|
||||
if (false) //has sanction
|
||||
ModToolSanctions modToolSanctions = Emulator.getGameEnvironment().getModToolSanctions();
|
||||
|
||||
if (Emulator.getConfig().getBoolean("hotel.sanctions.enabled")) {
|
||||
THashMap<Integer, ArrayList<ModToolSanctionItem>> modToolSanctionItemsHashMap = Emulator.getGameEnvironment().getModToolSanctions().getSanctions(this.set.getInt("user_id"));
|
||||
ArrayList<ModToolSanctionItem> modToolSanctionItems = modToolSanctionItemsHashMap.get(this.set.getInt("user_id"));
|
||||
|
||||
if (modToolSanctionItems != null && modToolSanctionItems.size() > 0) //has sanction
|
||||
{
|
||||
this.response.appendString("SOME SANCTION");
|
||||
ModToolSanctionItem item = modToolSanctionItems.get(modToolSanctionItems.size() - 1);
|
||||
ModToolSanctionLevelItem modToolSanctionLevelItem = modToolSanctions.getSanctionLevelItem(item.sanctionLevel);
|
||||
|
||||
this.response.appendString(modToolSanctions.getSanctionType(modToolSanctionLevelItem));
|
||||
this.response.appendInt(31);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return this.response;
|
||||
} catch (SQLException e) {
|
||||
Emulator.getLogging().logSQLException(e);
|
||||
|
Loading…
Reference in New Issue
Block a user