PhValheimCompanion
Connects client and server events to PhValheim's backend (phvalheim-server)
模組介紹 作者原文
PhValheim Server Side Companion
phvalheim-companion is a custom mod for Valheim servers backed by PhValheim (phvalheim-server). This is a server-side mod that is automatically added to all deployed PhValheim worlds >=phvalheim-server 2.4.
Summary
- This mod is intended to connect in-game telemetry with PhValheim's backend. The idea is to capture events and other statistics about the running world, e.g., server start, server stop, player join, player disocnnect, player death, etc...
- The codebase for this mod was forked from Aaron Scherer valheim-discord-notifier. All external functionality of this forked mod has been disabled until it's needed futher. Internal event handlers were used to tie into PhValheim's backend. I learned alot about HTTP POST within C# from this code base. Thank you, @aequasi!
Current capability: output from game console
- On server start
PhValheim Companion: [Sent] {"action":"start","world":"mytestworld22"}
PhValheim Companion: [Received] Backend response:OK
- On player join
PhValheim Companion: [Sent] {"action":"join","world":"mytestworld22","citizen":"Boogeyman"}
PhValheim Companion: [Received] Backend response:OK
The Backend response: OK is PhValheim's backend returning a result back to game.
This mod and the new changes to phvalheim-server >=2.4 lay the foundation for advanced bi-directional interaction between a running world and PhValheim.
Next steps:
- Capture all players that join a world and store them in PhValheim's database. These players will be listed (mouse hover) on the public interface so folks will be able to identify which character they used in the world.
- Capture player statistics. E.g., builds and deaths
- Capture progression of the world. E.g., No hung heads at the shrines = copper/tin age, A hung Eikthyr head = bronze age and so forth. DONE!
See for more information regarding the main project.
Changelog
- 1.0.5 removed all unused code
- 1.0.4 Update readme
- 1.0.3 Updated to support 0.216.9
- 1.0.2 Corrected a URI issue with unused (as of now) server-side code.
- 1.0.1 A significant and new capability was added to phvalheim-client, phvalheim-server and phvalheim-companion, allowing in-game client notifications to be sent back to the originating PhValheim server. The first feature that uses this new method detects world progression. E.g., When a boss head is hung at the spawn shrines, PhValheim Server will now display icons on the public interface indicating progression.
- 1.0.0 Initial release sends world start and player join to the backend.
安裝與使用 安裝:BepInEx 外掛
- 本站下載的壓縮包就是模組本體,通常是 BepInEx 外掛(解壓後得到 .dll 或外掛資料夾)。
- 建議流程:用社群模組管理器(如 r2modman)選中本遊戲後匯入該模組,管理器會自動裝好 BepInEx 前置並處理依賴。
- 手動流程:先在遊戲目錄裝好 BepInEx 載入器,再把解壓出的 .dll 或外掛資料夾放進 BepInEx/plugins/。
- 啟動遊戲,BepInEx 控制台會列印載入日誌;確認這個模組出現在日誌裡即為安裝成功。
帶「前置依賴」的模組需要一併安裝,否則不會載入。功能開關通常在遊戲內或外掛自帶的設定檔裡調整。 多人連線時,主機與所有用戶端需要安裝一致的模組。
下面這些內容需要先安裝,否則該模組不會生效: