feat: discord linking, @tags, music and sfx sliders, required device ids

- Discord: the account page links a player's Discord account through
  Discord's sign-in (lib/discord.js); only linked names are shown on cards
  (typed ones are cleared). A bot keeps the Server Booster badge on linked
  accounts that boost. The game tells the client where the player is, for
  the client's Discord rich presence (flashvars discordAppId).
- @username tags in chat, chat balloons and wall posts: only real players'
  names (asked of the server, "xmn"), names with spaces too, drawn on a
  blue box; a click opens the player's card.
- Settings: separate Music and SFX volume sliders for the old one.
- Device ids required: a launcher that sends none (before 1.3.0) is told
  at the game's login "Your client is outdated. Update at
  https://burrow.moe/download". AJ_REQUIRE_DEVICE=0 turns it off.
- Panels: clear a player's Jammer Wall posts; turning away masterpieces
  and player items asks first.
- Item Giver: negative colour ids (the same colour written signed).
- buildVersion 71; the client rebuilt with Snipzil's sitting fix.
This commit is contained in:
Burrowdev committed 2026-10-18 19:35:51 +03:00
1 parent 1d9b70f32e
commit 33f56074a4
35 files changed
+2076 -101

No files matched your search

+10 -6
View File
@@ -73,6 +73,10 @@ const flashVars = () => ({
startupRoom: config.startupRoom,
// "-1" turns the client's stats socket off.
sbStatTrackerIp: "-1",
// the client's Discord rich presence (its app/discord.js): the Discord
// application it shows as, "" for none, and where its button goes.
discordAppId: config.discord.clientId,
presenceUrl: `${config.siteUrl}download`,
sbStatModulator: "0",
currentTimestamp: Math.floor(Date.now() / 1000),
country: "US",
@@ -469,6 +473,7 @@ const renameAndSignIn = (res, body, from) => {
console.log(`[accounts] a rejected username was replaced by "${logText(account.username)}"`);
accounts.setLoginChoices(account, body.login_choices);
const token = accounts.issueToken(account);
devices.noteLauncher(token, Boolean(devices.read(body.device)));
send(res, 200, {auth_token: token, refresh_token: token, device_token: entry.deviceToken});
};
@@ -479,13 +484,11 @@ const authenticate = async (req, res, from) => {
return;
}
// the computer it is on (lib/devices.js): a client that does not say is
// out of date (before 1.3.0) or not ours. 1.2 shows "The server refused
// the login (426)", and still offers its update.
// out of date (before 1.3.0) or not ours. it is signed in all the same,
// and its token noted (signInChecked): with config.requireDevice the game
// then loads and its login popup says to update (lib/world.js), where a
// refusal here only ever showed "The server refused the login (426)".
const device = devices.read(body.device);
if (!device && config.requireDevice) {
send(res, 426, {error_code: 101, error: "client_outdated"});
return;
}
const accountKey = String(body.username).trim().toLowerCase();
if (!from.local && failuresByAddress.blocked(from.key)) {
send(res, 429, {error_code: 429, error: "too_many_attempts"});
@@ -609,6 +612,7 @@ const signInChecked = async (res, body, from, account, saved, device) => {
// the custom client's advanced settings; the official launcher sends none.
accounts.setLoginChoices(account, body.login_choices);
const token = byRefresh ? body.refresh_token : accounts.issueToken(account);
devices.noteLauncher(token, Boolean(device));
send(res, 200, {auth_token: token, refresh_token: token, device_token: deviceToken});
};