feat(world): expand events, rewards, and den behavior

Add owner/developer room-effect controls and chat shortcuts, staff movement that bypasses full or locked destinations, in-game moderation entry points, theatre video synchronization, and shared room effects.

Restore game and trade popups, reliably award refreshments and game rewards, support pet play outside parties, correct den placement categories, improve den item persistence, and refresh custom-item and masterpiece behavior.

Harden room, party, pet, minigame, and item state handling with matching feature and restored-system regression coverage.
This commit is contained in:
Snipzil committed 2026-10-19 10:09:50 -04:00
1 parent 7dee29010a
commit 5c9b2e0066
11 files changed
+389 -29

No files matched your search

+8
View File
@@ -3,6 +3,7 @@
const accounts = require("./accounts.js");
const achievements = require("./achievements.js");
const defpacks = require("./defpacks.js");
const wearRules = require("./wearrules.js");
const {CURRENCIES, MAX_ITEMS, MAX_WORN, activeAvatar, addClothing, sendClothingAdded, sendClothingRemoved, resolvePurchase} = require("./player.js");
// clothing: buying, wearing and recycling (client side: ItemXtCommManager).
@@ -82,6 +83,13 @@ module.exports = ({others, sendItemList}) => {
}
const item = account.items.find(candidate => candidate.inv === invIdx);
if (item) {
// The client flag only makes the control gray. Never trust it: a
// crafted iu packet or a stale client must not bypass a staff rule.
// Check before changing `on`, so a refused request cannot take off
// an otherwise valid item as a side effect.
if (worn && !wearRules.mayWear(item.def, avatar.type)) {
return null;
}
item.on = item.on.filter(avInvId => avInvId !== avatar.avInvId);
// no more than MAX_WORN on one animal: what is over stays off.
if (worn && account.items.filter(candidate => candidate.on.includes(avatar.avInvId)).length >= MAX_WORN) {