fix: official game table and lists, feedback, museum and books

recordings of the official game (tools/recorder.js) had its game table and
several generic lists in them:

- lib/games.json follows the official table: the print kits, Brady's lab,
  the carnival games (in the room) and the buddy games have their real
  ids, and every game its "Play!" picture
- lists the server has nothing of its own for are answered as the official
  server did (lib/official-lists.json): the Journey Book's facts, and its
  pages and four of the Chamber of Knowledge's books rebuilt from the media
  files; Jam-A-Gram stamps are the official ones
- feedback windows send to the staff panels' feedback, over the game's own
  connection; museum gem donations are taken (cd)
- fact cards and museum exhibits missing from a list are had by their id
  (factDefs), and their arrows do nothing past the list
This commit is contained in:
Burrowdev committed 2026-10-23 21:52:59 +03:00
1 parent 6c273554d7
commit 15f321fb00
12 files changed
+812 -99

No files matched your search

+43
View File
@@ -19,6 +19,7 @@ const badges = require("./badges.js");
const bans = require("./bans.js");
const devices = require("./devices.js");
const chatlog = require("./chatlog.js");
const support = require("./support.js");
const chatFilter = require("./chatfilter.js");
const chatSpam = require("./chatspam.js");
const chatStyles = require("./chatstyles.js");
@@ -128,6 +129,15 @@ const DEF_COMBINED_LIST = 1060;
const DEF_DEN_ROOM = 1040;
const DEF_CURRENCY_EXCHANGE = 1051;
const DEF_DIAMOND = 1054;
// generic lists as the official server answered them (gl), recorded with
// tools/recorder.js: used where this server has none of its own. one was
// not recorded and is made up the same way: the Journey Book's pages (53),
// found among the media files (each has a "jb_title_<land>" part) with the
// name of each land, which opens the book at the page of the land the
// player is in (GuiManager.onJourneyBookMediaListReceived). likewise the
// books of the Chamber of Knowledge (EBookChooser, lists 353-356) and their
// pages, for the four whose pages could be found.
const OFFICIAL_LISTS = require("./official-lists.json");
const SHOP_LIST_TYPES = [DEF_ITEM, DEF_DEN_ITEM, DEF_DEN_ROOM, DEF_COMBINED_LIST, DEF_CURRENCY_EXCHANGE, DEF_DIAMOND];
// a shop's title when its room gives it none (a shop in a land's main room,
// or one opened from elsewhere): what it sells (strings in lib/defpacks.js).
@@ -226,6 +236,11 @@ const sees = (viewer, subject) => (!subject.invisible || roles.isActiveStaff(vie
&& !(viewer.account.hideBlocked && blocks.has(viewer.account, subject.account));
// everyone else in the room who should hear about this player's animal.
const watchers = session => others(session).filter(other => sees(other, session));
// the game's feedback windows by type (FeedbackManager.frameLabelForType;
// the titles are the feedback defs' own), for the panel to say where a
// message came from
const FEEDBACK_KINDS = new Map([[1, "Theatre feedback"], [3, "Feedback"], [4, "Jamaa Journal feedback"], [5, "Feedback"],
[11, "Theatre feedback"], [18, "Jammer Wall feedback"], [19, "Chat feedback"], [21, "Theatre feedback"], [22, "Theatre feedback"]]);
const TYPING_EVERY_MS = 2000; // "typing" passed on at most this often per player (xty)
// tags ("@name") in chat and on Jammer Walls (xmn): the longest player's
@@ -937,6 +952,16 @@ const handlers = {
count = defpacks.petIds().length;
entries = defpacks.petIds().flatMap(id => [id, 1]);
}
// what the official server answered, where this one has nothing of its
// own (lib/official-lists.json, from recordings of the official game:
// the Journey Book's facts and pictures among them)
if ((count === undefined ? entries.length : count) === 0 && Object.hasOwn(OFFICIAL_LISTS, String(Number(listId)))) {
const official = OFFICIAL_LISTS[String(Number(listId))];
if (official.type === type) {
entries = official.entries;
count = official.count;
}
}
// for shops the first unused field is the title's string id; left empty
// it keeps the shop window's own title (Shop.gotItemListCallback).
const title = SHOP_LIST_TYPES.includes(type) ? (session.room && roomInfo.shopTitle(session.room.base, listId)) || SHOP_KIND_TITLES.get(type) : 0;
@@ -1078,6 +1103,24 @@ const handlers = {
}
},
// the game's feedback windows (the purple Help and Feedback buttons, the
// orbs in rooms, the newspaper's and the theatre's: the patched
// gui.FeedbackManager): xfb [the window's feedback type, the text]. it
// goes to the staff panels' feedback (lib/support.js), named by where it
// was written.
xfb(session, roomId, [type, ...text]) {
const where = FEEDBACK_KINDS.get(Number(type)) || "Feedback";
const said = text.join("%").trim();
if (!said) {
return;
}
const result = support.sendFeedback(session.account, "feedback", `${where} (in ${session.room ? session.room.displayName : "the game"}): ${said}`);
// the window has thanked them already; said only when it did not go
if (!result.ok) {
tell(session, result.error === "too_many" ? "You have sent a lot of feedback today. Try again tomorrow." : "That feedback could not be sent.");
}
},
// the patched client's tags (AJClient.resolveMentions): xmn [id, the text
// after each "@", ...] -> "xmn" [.., .., id, then for each text: how many
// of its characters are a player's name (0 for none), the name as it is