You are viewing a potentially older version of this package. View all versions.
Zrikz-RealmForgeStats-1.0.1 icon

RealmForgeStats

Optional client mod that sends your own skill levels and death causes to the server so they can be shown on a server stats page. Never reads your inventory.

Date uploaded a month ago
Version 1.0.1
Download link Zrikz-RealmForgeStats-1.0.1.zip
Downloads 32
Dependency string Zrikz-RealmForgeStats-1.0.1

This mod requires the following mods to function

denikson-BepInExPack_Valheim-5.4.2350 icon
denikson-BepInExPack_Valheim

BepInEx pack for Valheim. Preconfigured with the correct entry point for mods and preferred defaults for the community.

Preferred version: 5.4.2350

README

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.