Valheim
You are viewing a potentially older version of this package. View Latest Version
Install with App

Details

Date Uploaded
last month
Downloads
250
Size
13KB
ADDatHost Valheim hosting
30% off

RealmForgeStats

Sends each player's own skills and death-cause counters to the server so /stats can show them without anyone uploading a character file by hand.

Why it exists

Valheim keeps characters client-side. A world save contains zero Player ZDOs, and the dedicated server never learns why anyone died — it only sees the character's ZDO reset to 0:0. Meanwhile the game itself tracks 26 distinct death causes (including DeathByTree, with a tier breakdown) plus every skill, in PlayerProfile. Those numbers exist; they just live on each player's PC.

The manual .fch upload on /stats reads exactly the same data, but it needs a person to remember to do it, which is why this mod exists instead.

What is sent

Character name, skill levels, and the death-cause counters. Nothing else. The inventory is deliberately never read — /stats is a public page and a stash is a different decision from a skill level (the same call already made for the upload path).

Trust model

These numbers come from a client, and a client can lie. That is fine for a friendly server's fun page and is not fine for anything that grants advantage, so the server half only ever writes a display file and never feeds gameplay. A client can only write its own row: the key is the sender's peer id, not a name from the payload, so nobody can overwrite anyone else's stats.

Traffic is one small JSON push every 2 minutes, skipped entirely when the numbers have not changed.

Building

Needs the .NET SDK at ~/.dotnet (installed by https://dot.net/v1/dotnet-install.sh --channel 8.0 --install-dir ~/.dotnet, no root required).

./build.sh [instance]      # default: Valheim-Zorus
# -> dist/RealmForgeStats.dll

There are no NuGet dependencies: the game, Unity and BepInEx assemblies are referenced straight out of the named instance's own install, so the plugin is always compiled against the exact build it will run on, and the build works offline. After a game update, rebuild and re-check compatibility with docs/mod-compat-check.py.

Installing

  • Server — drop dist/RealmForgeStats.dll into servers/<instance>/install/BepInEx/plugins/ and restart. The daemon exports REALMFORGE_STATS_DIR, so the plugin writes to servers/<instance>/stats/live-stats.json with no configuration.
  • Players — the same file goes in their r2modman profile's plugins folder. It is required on the client (that is where the numbers are) and harmless if a player chooses not to install it: they simply never appear in the table.

Status

Compiles clean and every game reference it makes resolves against Valheim 1.0.7 (verified with docs/mod-compat-check.py). It has not yet been run against a live client — that needs a player, not this box.

Thunderstore development is made possible with ads. Please consider making an exception to your adblock.