mirror of
https://github.com/burrow-dev/burrow-server.git
synced 2026-11-19 01:27:51 -05:00
fix: send a game at login only the custom items its packs lack
Every custom item's full def row went to every game at login, though the
item and name packs it fetched minutes before already have them all: with
5000 clothing and 452 den items that was 3.3 MB, 4.2 MB with the colours,
over the send backlog limit (94b8de8 raised it).
- a fetch of the item, den item or name pack notes, per address, how far
the custom items had changed; at login a game is sent the items changed
since, and those with a picture (the packs have no pictures). an address
that fetched nothing lately is sent all, as before.
- "xdi" rows carry the fields the client reads (addItemDef,
addDenItemDef), not the whole base row, and clothing is for any animal
as in the pack.
- accounts keep a digest of the state last written, not a copy of it
(~13 KB an account, ~185 MB on prod).
Measured locally with prod-sized data (20000 colours, 5452 items, 14k
accounts): the login burst 4.2 MB -> 1.5 MB (the colours are most of what
is left), live heap after start 419 -> 297 MB.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
9f69b3511b
commit
c5b1bc37d9
6 files changed
+146
-15
No files matched your search
@@ -1049,6 +1049,11 @@ const handle = async (req, res) => {
|
||||
send(res, extra.body ? 200 : 404, extra.body || "Not found", extra.body ? extra.type : "text/plain");
|
||||
return;
|
||||
}
|
||||
// what custom items this game will have from its packs (customItems.sendAll)
|
||||
const packKind = defpacks.customPackKind(relPath);
|
||||
if (packKind) {
|
||||
customItems.sawPack(from.key, packKind);
|
||||
}
|
||||
const clientPack = await defpacks.clientPack(relPath);
|
||||
if (clientPack) {
|
||||
send(res, 200, clientPack, "application/octet-stream");
|
||||
|
||||
Reference in new issue
Block a user