You've already forked Arcturus-Morningstar-Extended
mirror of
https://github.com/duckietm/Arcturus-Morningstar-Extended.git
synced 2026-06-19 15:06:19 +00:00
fix(housekeeping): audit room and session actions
The first audit coverage pass covered economy/account-impacting HK actions, but room and session mutators still returned success without an audit row. Add audit entries for room deletion, force disconnect, room kicks, user kicks, room mute, room state changes, and successful unbans, and extend the coverage contract to keep these privileged actions tracked.
This commit is contained in:
+5
@@ -63,6 +63,11 @@ public class HousekeepingDeleteRoomEvent extends MessageHandler {
|
||||
return;
|
||||
}
|
||||
|
||||
com.eu.habbo.habbohotel.modtool.HousekeepingAuditLog.log(
|
||||
this.client.getHabbo().getHabboInfo().getId(),
|
||||
this.client.getHabbo().getHabboInfo().getUsername(),
|
||||
ACTION_KEY, 0, "roomId=" + roomId,
|
||||
this.client.getHabbo().getHabboInfo().getIpLogin());
|
||||
this.client.sendResponse(new HousekeepingActionResultComposer(ACTION_KEY, true, roomId, ""));
|
||||
}
|
||||
}
|
||||
|
||||
+5
@@ -52,6 +52,11 @@ public class HousekeepingForceDisconnectUserEvent extends MessageHandler {
|
||||
// ACK first so the action result lands before the target's socket
|
||||
// closes (otherwise an alerted user on the same emulator thread may
|
||||
// already be torn down when we try to write).
|
||||
com.eu.habbo.habbohotel.modtool.HousekeepingAuditLog.log(
|
||||
this.client.getHabbo().getHabboInfo().getId(),
|
||||
this.client.getHabbo().getHabboInfo().getUsername(),
|
||||
ACTION_KEY, userId, "reason=" + (reason != null ? reason : ""),
|
||||
this.client.getHabbo().getHabboInfo().getIpLogin());
|
||||
this.client.sendResponse(new HousekeepingActionResultComposer(ACTION_KEY, true, userId, ""));
|
||||
|
||||
target.disconnect();
|
||||
|
||||
+5
@@ -36,6 +36,11 @@ public class HousekeepingKickAllFromRoomEvent extends MessageHandler {
|
||||
|
||||
room.ejectAll();
|
||||
|
||||
com.eu.habbo.habbohotel.modtool.HousekeepingAuditLog.log(
|
||||
this.client.getHabbo().getHabboInfo().getId(),
|
||||
this.client.getHabbo().getHabboInfo().getUsername(),
|
||||
ACTION_KEY, 0, "roomId=" + roomId,
|
||||
this.client.getHabbo().getHabboInfo().getIpLogin());
|
||||
this.client.sendResponse(new HousekeepingActionResultComposer(ACTION_KEY, true, roomId, ""));
|
||||
}
|
||||
}
|
||||
|
||||
+5
@@ -60,6 +60,11 @@ public class HousekeepingKickUserEvent extends MessageHandler {
|
||||
target.alert(reason);
|
||||
}
|
||||
|
||||
com.eu.habbo.habbohotel.modtool.HousekeepingAuditLog.log(
|
||||
this.client.getHabbo().getHabboInfo().getId(),
|
||||
this.client.getHabbo().getHabboInfo().getUsername(),
|
||||
ACTION_KEY, userId, "reason=" + (reason != null ? reason : ""),
|
||||
this.client.getHabbo().getHabboInfo().getIpLogin());
|
||||
this.client.sendResponse(new HousekeepingActionResultComposer(ACTION_KEY, true, userId, ""));
|
||||
}
|
||||
}
|
||||
|
||||
+5
@@ -45,6 +45,11 @@ public class HousekeepingMuteRoomEvent extends MessageHandler {
|
||||
|
||||
room.setMuted(minutes > 0);
|
||||
|
||||
com.eu.habbo.habbohotel.modtool.HousekeepingAuditLog.log(
|
||||
this.client.getHabbo().getHabboInfo().getId(),
|
||||
this.client.getHabbo().getHabboInfo().getUsername(),
|
||||
ACTION_KEY, 0, "roomId=" + roomId + " minutes=" + minutes + " muted=" + (minutes > 0),
|
||||
this.client.getHabbo().getHabboInfo().getIpLogin());
|
||||
this.client.sendResponse(new HousekeepingActionResultComposer(ACTION_KEY, true, roomId, ""));
|
||||
}
|
||||
}
|
||||
|
||||
+5
@@ -44,6 +44,11 @@ public class HousekeepingRoomStateEvent extends MessageHandler {
|
||||
room.setState(open ? RoomState.OPEN : RoomState.LOCKED);
|
||||
room.save();
|
||||
|
||||
com.eu.habbo.habbohotel.modtool.HousekeepingAuditLog.log(
|
||||
this.client.getHabbo().getHabboInfo().getId(),
|
||||
this.client.getHabbo().getHabboInfo().getUsername(),
|
||||
actionKey, 0, "roomId=" + roomId + " open=" + open,
|
||||
this.client.getHabbo().getHabboInfo().getIpLogin());
|
||||
this.client.sendResponse(new HousekeepingActionResultComposer(actionKey, true, roomId, ""));
|
||||
}
|
||||
}
|
||||
|
||||
+7
@@ -44,6 +44,13 @@ public class HousekeepingUnbanUserEvent extends MessageHandler {
|
||||
// on a never-banned user is a benign no-op that returns false.
|
||||
boolean cleared = Emulator.getGameEnvironment().getModToolManager().unban(info.getUsername());
|
||||
|
||||
if (cleared) {
|
||||
com.eu.habbo.habbohotel.modtool.HousekeepingAuditLog.log(
|
||||
this.client.getHabbo().getHabboInfo().getId(),
|
||||
this.client.getHabbo().getHabboInfo().getUsername(),
|
||||
ACTION_KEY, userId, "username=" + info.getUsername(),
|
||||
this.client.getHabbo().getHabboInfo().getIpLogin());
|
||||
}
|
||||
this.client.sendResponse(new HousekeepingActionResultComposer(ACTION_KEY, cleared, cleared ? userId : 0, cleared ? "" : "housekeeping.error.no_active_ban"));
|
||||
}
|
||||
}
|
||||
|
||||
+8
-1
@@ -17,7 +17,14 @@ class HousekeepingAuditCoverageContractTest {
|
||||
"HousekeepingTradeLockUserEvent.java",
|
||||
"HousekeepingGrantItemEvent.java",
|
||||
"HousekeepingTransferRoomOwnershipEvent.java",
|
||||
"HousekeepingSendHotelAlertEvent.java"
|
||||
"HousekeepingSendHotelAlertEvent.java",
|
||||
"HousekeepingDeleteRoomEvent.java",
|
||||
"HousekeepingForceDisconnectUserEvent.java",
|
||||
"HousekeepingKickAllFromRoomEvent.java",
|
||||
"HousekeepingKickUserEvent.java",
|
||||
"HousekeepingMuteRoomEvent.java",
|
||||
"HousekeepingRoomStateEvent.java",
|
||||
"HousekeepingUnbanUserEvent.java"
|
||||
);
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user