mirror of
https://github.com/burrow-dev/burrow-server.git
synced 2026-11-20 01:37:50 -05:00
feat: stats graphs, playtime, ip search against ban evasion, 150-char chat
- stats graphs for the admin and moderator panels (lib/stats.js, public/stats-view.html) - playtime, private unless shown on the card's bio tab; set on the account page - search accounts by ip address, only against ban evasion; mods see no addresses and each search is logged - privacy policy for the above (terms version 2026-10-17) - the per-second save looks only at accounts in play, with a slow sweep of the rest - items in several dens at once; chat filter hides slurs and threats by default - sexual usernames refused; moderators may enter full rooms; guide login allowed - 150-character chat box (client build 55) - fixes: gifts, trades, dens, pets in dens, den recycling, special animals' colours, jammer walls, settings switches; the buddy list sent at login - the item giver, the rules screen and the art studio rework
This commit is contained in:
1 parent
8400d2f928
commit
04f468af2c
56 files changed
+25667
-3894
No files matched your search
@@ -338,6 +338,16 @@
|
||||
<p class="status" id="bio-status" role="status"></p>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h2>Playtime</h2>
|
||||
<p id="playtime-text"></p>
|
||||
<div class="switch">
|
||||
<div class="what"><b>Show on my card</b><span class="hint">At the top of the Bio tab, for anyone who opens your card in the game.</span></div>
|
||||
<button id="playtime-public" type="button" aria-pressed="false">Private</button>
|
||||
</div>
|
||||
<p class="status" id="playtime-status" role="status"></p>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h2>Discord</h2>
|
||||
<p id="badges" hidden></p>
|
||||
@@ -610,6 +620,7 @@
|
||||
[account.online ? "Playing now" : account.lastSeen ? when(account.lastSeen) : "Not played yet", "Last seen"],
|
||||
[when(account.createdAt), "Created"],
|
||||
[account.logins.toLocaleString(), "Logins"],
|
||||
[played(account.playtime), "Playtime"],
|
||||
[`${account.animals}${ANIMALS[account.animalType] ? ` · ${ANIMALS[account.animalType]} in use` : ""}`, "Animals"],
|
||||
[account.pets.toLocaleString(), "Pets"],
|
||||
[account.items.toLocaleString(), "Clothing"],
|
||||
@@ -638,6 +649,12 @@
|
||||
return row;
|
||||
}));
|
||||
|
||||
$("playtime-text").textContent = `You have played for ${played(account.playtime)}.`;
|
||||
$("playtime-public").textContent = account.playtimePublic ? "Public" : "Private";
|
||||
$("playtime-public").setAttribute("aria-pressed", String(account.playtimePublic));
|
||||
$("playtime-public").setAttribute("aria-label", `Show playtime on my card: ${account.playtimePublic ? "public" : "private"}`);
|
||||
$("playtime-public").disabled = false;
|
||||
|
||||
if (document.activeElement !== $("bio-text")) {
|
||||
$("bio-text").value = account.bio;
|
||||
}
|
||||
@@ -1148,6 +1165,26 @@
|
||||
});
|
||||
$("forget-devices").addEventListener("click", () => act({action: "forgetDevices"}, "two-step-status"));
|
||||
|
||||
// time played, in the largest units that say it: "3 days 4 hours".
|
||||
const played = seconds => {
|
||||
const days = Math.floor(seconds / 86400);
|
||||
const hours = Math.floor(seconds % 86400 / 3600);
|
||||
const minutes = Math.floor(seconds % 3600 / 60);
|
||||
const unit = (count, name) => `${count.toLocaleString()} ${name}${count === 1 ? "" : "s"}`;
|
||||
if (days > 0) {
|
||||
return hours > 0 ? `${unit(days, "day")} ${unit(hours, "hour")}` : unit(days, "day");
|
||||
}
|
||||
if (hours > 0) {
|
||||
return minutes > 0 ? `${unit(hours, "hour")} ${unit(minutes, "minute")}` : unit(hours, "hour");
|
||||
}
|
||||
return unit(minutes, "minute");
|
||||
};
|
||||
$("playtime-public").addEventListener("click", async () => {
|
||||
$("playtime-public").disabled = true;
|
||||
await act({action: "playtimePublic", on: !account.playtimePublic}, "playtime-status");
|
||||
$("playtime-public").disabled = false;
|
||||
});
|
||||
|
||||
const bioCount = () => {
|
||||
$("bio-count").textContent = `${[...$("bio-text").value.trim()].length} / ${account ? account.bioLimit : 200}`;
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user