Repository navigation
Releases
v0.5.0 — the Pandemonium Event, always on
This release brings the Pandemonium Event to every game server: the red portals in Harrogath, the uber bosses with their own fighting behaviour, and Uber Tristram's reward, played the way the realm ran it on 1.14d.
Breaking: the --ubers flag is gone. The event is always on in the game server, and passing --ubers is now ignored.
What this release changes:
Pandemonium Event
- The event is always on in the game server. It only runs on the server side, so the DLL riding in a real client does not apply it.
- The red portals opened from keys and organs now lead where their name says, instead of all being named Nihlathak's Temple.
- The cube recipes follow the realm's rules: Hell difficulty only, in Harrogath, each portal once per game, and which key level opens is picked from the player's seed.
- Uber Mephisto, Uber Diablo and Uber Baal fight with their own behaviour again, including their minions and spawners.
- The bosses spawn where and how the realm spawned them.
Drops and items
- Uber Tristram drops its reward again: the Hellfire Torch, and a Standard of Heroes per player.
- Items the server creates have durability again. The patch that switched durability off for everything is removed.
Build
- libd2 is pinned to its rewritten history.
Upgrading
Remove --ubers from your game server arguments if you set it; leaving it in does no harm. Nothing else needs to be run by hand.
v0.4.0 — a lobby that behaves, and logins that hold
This release makes the realm behave the way a Diablo II client expects in the lobby and in chat, keeps one login from knocking out another, lets the realm survive a Redis primary change, and gives operators a way to move characters between ladder and non-ladder.
Breaking: chat operators are now set with REALMD_CHAT_OPS instead of REALMD_ADMINS. REALMD_ADMINS no longer makes anyone a channel operator.
What this release changes:
Login
- Logging in from a second place no longer invalidates the first login, so several clients started together each get in.
- The realm recovers by itself when the Redis primary changes, instead of failing writes until it is restarted.
Lobby and characters
- Game names can contain spaces and punctuation.
- Games without a password can be joined.
- A new character is selected after creating it, and characters are listed in creation order.
- Chat, the channel list,
/rand the friends commands work as the client expects, also from inside a game. Players no longer show as channel operators. - A character with the same name as its account works.
- A character can no longer get stuck as "in use", and one that another game still holds is refused cleanly.
- Admins can flip a character between ladder and non-ladder (
/admin/chars/set-ladder). It refuses a character that is in a game and refuses ladder to non-ladder unless forced, and every call is logged. - Importing a save takes its hardcore and ladder mode from the caller. Without one, it follows the account's most recently played character of the same type.
- New:
char-forgewrites a character save at a given class and level from the game's own tables (zig build char-forge).
Games
- The creator's max players (1-8) is enforced.
- The game list and game info only show games your character can join.
- Creating a game no longer fails when one game server does not answer.
- Steadier game server timing, and an idle game server uses less CPU.
Upgrading
Replace REALMD_ADMINS with REALMD_CHAT_OPS if you used it to mark channel operators. Nothing else needs to be run by hand.
v0.3.1 — characters are saved, and cannot roll back
A play-tester reported that their character kept rolling back to an older save. It was worse
than that: no deployed game server was writing saves at all, so the "older save" was the only
save that had ever existed. Every character on the realm read charver=1 — created, and never
written since.
Three servers, three different ways of not saving. The Mac-image server cleared the engine's
own -nosave flag and never replaced it. The pre-1.14 host answered fpSaveDatabaseCharacter
with a stack-balancing stub. Only the wine-injected 1.14d DLL implemented the slot, and that
one filed saves under the wrong key whenever its 16-slot join ring had recycled the player.
What this release changes:
- The store refuses to go backwards. Rather than asking every path above it to be
careful,realmd:charveris a compare-and-set token: a load hands back the bytes and the
version they were at, and a save is accepted only while the store is still at that
version. Compare, set and increment are a single Lua script, so there is no window
between them. Version zero is accepted whatever the caller expected, because that means
redis lost its state and was refilled from Postgres — where a live session's bytes are
the newest thing in existence. A refused save is never retried; it is obsolete by
definition. - Character names are claimed realm-wide. They were unique only within an account,
while the seat tables, the retry queue, a departing player's seat release and the Mac
engine's own<charname>.d2sall key on the name alone. Two accounts with a "Bob" was
never a rollback — it was a character swap. The claim is a table rather than a unique
index, so it cannot fail at startup on data that already holds duplicates, and characters
that predate it are covered by a check againstcharsitself. - Saving is continuous. 1.14d's interval drops from 8192 game frames (~5.5 minutes) to
512 (~20 seconds) by patching two immediates inUpdateClients. The pre-1.14 engines
locate the same site by its constant rather than its address —0x80001fffis the
signed-modulo-8192 idiom and nothing else in the image holds that number. Exactly one
match is required, so an engine that does not match is refused rather than guessed at.
All ten shippedD2Game.dllfiles have exactly one, in both encodings, with the fixup at
+7. - Three smaller ways to lose a character, closed. Deleting a character that was in a
game, where the server still held it and wrote it back afterwards. Releasing a seat by
matching a name suffix over an unorderedSMEMBERS, which could free a lock belonging to
somebody still playing. And a save-retry queue that carried no fence and had no age
bound. - One seat table instead of three. The join seat table moves to
packages/gs-seatsand
is shared by all three servers, which previously had one table, another table, and none.
Verified on the real engines under wine: the interval patch applies on all six, a client
reaches a world on 1.14d and its charver climbs 1 → 2 → 3, a save replayed at a superseded
version is refused with the character left intact, and all seven engines still reach a world
in CI.
Upgrading
Nothing to run by hand — the charnames table is created on startup and existing characters
keep their names. From this release a second account can no longer take a name that is already
in use on the realm.
charver is the signal that this is working. It should start climbing for anyone playing; if
every character still reads 1, the save path is not running:
redis-cli GET realmd:charver:<account>/<character>
v0.3.0 — a fleet without wine, and a realm without a link
Two hundred commits, and the theme of all of them is that a game server stops being one
program on one host. The realm and the fleet now meet through redis rather than through a
link between them, there is a game server that does not need wine at all, and there is a
second kind of game server that runs the game's own DLLs instead of injecting into
Game.exe.
Highlights of this release:
- A game server with no wine. 1.14d's macOS i386 build is mapped and run directly on
i386 Linux and serves real clients through the same realm and gateway as the wine
server — one process in a 4.4 MB image, hosting several games, as fast as the wine
build on real hardware. A fleet can mix both, because both meet the realm the same way. - The realm is redis-first, and there can be more than one of it. The game-server
control link andd2dbsare gone: servers publish themselves into redis, take
create/join off a queue there and report back on an event stream any instance drains.
Redis holds the live character and Postgres keeps it; the filesystem backend is
deleted. A character has one seat, claimed in the shared store, so a second client
bringing it is refused with the game that has it instead of being left at a loading
screen. realmdis a package, not just a program. A realm can be built on top of it and
configured by name rather than by address, which is what the Helm chart now does —
replicas, advertised capacity per game server, and the split-horizon trap in
client-facing versus internal addresses written down where it can be read.- A second kind of game server, on the pre-1.14 DLLs.
apps/d2hostdrives real
D2Game/D2Commonagainst our ownFog.dllandD2Net.dll, with no injection. Most
of the work here was measurement: every callback's arity counted at its call site,
D2Lang's and D2Common's per-version ordinals, 1.13c's wholly renumbered export table,
1.06b's classic packet table read off its own bounds check, and the join opcode read
out of each build's own D2Net table — it moved at 1.10, not at 1.09, which is why 1.09
never joined. At this tag a character joins a game on the 1.10f engine; serving a world
on every engine came after it. - Saves that a foreign engine will accept.
FOG_ComputeChecksumwas a placeholder,
so a character this project wrote could never load on an engine whoseFog.dllit also
supplies. It is the.d2schecksum, and it is now the real one.
v0.1.0 — realm server feature-complete
The realm server (realmd) reaches feature-completeness against what a real 1.14d client
actually sends, verified against the game binary rather than assumed.
Highlights of this release:
- Join-screen truth: live player counts (the GS reports them, because realmd only ever
sees joins and never leaves), game descriptions, and a working detail panel. - Join errors the client can actually render. Two codes were swapped, so a game that did
not exist was reported as a bad password; one code was not in the client's switch at
all, which showed nothing and left the screen dead. Full/invalid-name/hardcore/
expansion/ladder rejections implemented, plus the Nightmare and Hell progression gates
at the engine's own thresholds. - Chat lobby names people by their character, not their account — and everything that
takes a name accepts what the player can see. - Characters persist properly: CHARUPGRADE converts the save, the ladder ranks on real
experience, friends survive a restart, and the GS is told a character's real create
time and ladder flag. - Banner ads served end to end, and SID_GETFILETIME stops denying files it holds.
- Hardening found by load: a bounds-checked packet writer (an oversized reply used to be
a panic, not a truncation) and a member leak on disconnect.
Formats come from libd2 (d2-formats, d2-util) rather than second copies living here.
33 end-to-end scenarios, 26 unit tests.