ServerInfo
Exposes a small HTTP JSON API with a Valheim server's world name, connected players (with Steam avatars), and installed mods - built for live status pages that read it directly from the browser.
模組介紹 作者原文
Server Info
A BepInEx plugin for Valheim dedicated servers. Exposes a small HTTP API
with the world name, connected players, and installed mods (enriched with
each mod's manifest.json when it has one) — used by the project's
status page to show live server state.
Installing
Copy ServerInfo.dll into the server's BepInEx/plugins/ folder and
restart the server process — that's it. BepInEx generates
BepInEx/config/Odin_Sons.ServerInfo.cfg on first run with every setting
below at its default, so there's nothing else to set up before it works.
Network setup
The plugin runs its own HTTP server; it doesn't need nginx or any other
reverse proxy in front of it. Two things to check on a fresh server:
- Firewall / port forwarding. Whatever port you configure (8880 by
default) needs to be reachable from wherever your status page or
browser calls it from — open it in your firewall, and forward it on
your router if the server is behind NAT.
- Windows: URL reservation. HttpListener needs an admin-granted
reservation before a non-admin process can bind a port for all hosts.
This only controls which local Windows accounts may bind that port —
it has no effect on network access, which is what the firewall step
above is for. If the log shows an access error on startup, find the
account actually running the server (whoami) and run once as
administrator (replace 8880 and YOUR_USERNAME):
netsh http add urlacl url= user=YOUR_USERNAME
If you're not sure which account will run it (e.g. a service manager
that may change this), user=Everyone always works but lets any
local account on the machine claim that reservation too — fine on a
single-user machine, worth avoiding on a shared one.
Cross-origin requests are controlled by two settings, both under [Server]:
- Domain — the public domain or IP this server is reachable at.
Empty by default. It isn't used by the plugin for anything except
gating the next setting — think of it as "this server is ready to be
public" rather than an address the plugin acts on.
- AllowedOrigin — who's allowed to read the response from a
browser. Defaults to * (any site), but is only actually sent once
Domain is set — so a fresh install doesn't advertise a CORS policy
for a server that isn't publicly reachable yet.
If your status page reads this endpoint directly from the browser, set
Domain to this server's real address and, if you want to restrict who
can read the response, set AllowedOrigin to the status page's exact
origin (scheme+host+port, e.g. — the
browser requires an exact match, so a domain that merely points at the
same server doesn't count as the same origin).
Configuration
Set via BepInEx/config/Odin_Sons.ServerInfo.cfg. Numeric settings
declare an acceptable range — BepInEx clamps an out-of-range value in
the file to the nearest bound instead of accepting it as-is, and any
BepInEx config-editor mod (e.g. Configuration Manager) renders them as a
bounded slider rather than free text.
[Server]
| Key | Type | Default | Range | Meaning |
|---|---|---|---|---|
| Port | Int32 | 8880 | 1–65535 | HTTP port for the web server. |
| ServerInfoPath | String | /serverinfo | — | URL path the server info endpoint is served on. |
| Domain | String | (empty) | — | This server's public domain or IP. Gates AllowedOrigin — see below. |
| AllowedOrigin | String | * | — | Value sent as Access-Control-Allow-Origin, only once Domain is set. |
| RequestTimeoutSeconds | Int32 | 5 | 1–60 | How long a request waits for the game's main thread before timing out. |
[Cache]
| Key | Type | Default | Range | Meaning |
|---|---|---|---|---|
| CacheIntervalSeconds | Int32 | 5 | 1–3600 | How often the server/player list is recomputed. |
| AvatarCacheMinutes | Int32 | 60 | 1–1440 | How long a fetched avatar URL is reused, and how long an inactive player's entry is kept. |
[Steam]
| Key | Type | Default | Meaning |
|---|---|---|---|
| SteamApiKey | String | (empty) | Optional; w
安裝與使用 安裝:BepInEx 外掛
- 本站下載的壓縮包就是模組本體,通常是 BepInEx 外掛(解壓後得到 .dll 或外掛資料夾)。
- 建議流程:用社群模組管理器(如 r2modman)選中本遊戲後匯入該模組,管理器會自動裝好 BepInEx 前置並處理依賴。
- 手動流程:先在遊戲目錄裝好 BepInEx 載入器,再把解壓出的 .dll 或外掛資料夾放進 BepInEx/plugins/。
- 啟動遊戲,BepInEx 控制台會列印載入日誌;確認這個模組出現在日誌裡即為安裝成功。
帶「前置依賴」的模組需要一併安裝,否則不會載入。功能開關通常在遊戲內或外掛自帶的設定檔裡調整。 多人連線時,主機與所有用戶端需要安裝一致的模組。
下面這些內容需要先安裝,否則該模組不會生效: