PlayerSync

版本 v1.1.2·更新於 2026-05-29

Sync additional player information across clients.

模組介紹 作者原文

PlayerSync

Synchronizes additional player information like ammo clip and stamina

For feedback and issues, DM @uwufood on the GTFO Modding Discord Server

Why?

The vanilla game doesn't perform synchronization for information such as stamina and weapon clip ammo count (only total ammo count is synced).

This mod adds synchronization for these values. It also performs these updates at a higher frequency than the vanilla game. For the mod to function, both ends needs to have the mod installed.

Synchronized Values

Weapon Ammo / Clip

Synchronization is done on every shot and reload by hooking BulletWeapon.Fire, Shotgun.Fire,

and PlayerInventoryLocal.DoReload. This is then capped at maximum frequency as defined in the config.

Clip information is written directly into all items and can be accessed via

ItemEquippable.GetCurrentClip for the respective item.

AmmoInPack information is simply updated at the same tigher frequency as clip information and can be access via PlayerAmmoStorage just like in the vanilla game.

Note on Reserve Ammo

The ammo information for non-local players/bots will include the clip count in the reserve count. This is to ensure

correct display in vanilla inventory UI. To obtain the actual reserve count for non-local players/bots, subtract

their clip count from the reserve count.

There is a convenience function AmmoSync.ReserveIncludesClip for determining if clip should be subtracted from reserve count to get actual reserve count, the logic is rather simple.

///

/// Returns whether a given player's reserve ammo count includes the clip

/// ammo count, which means whether if the player is not local.

/// For bots this means checking if master is remote.

///

///

/// true if clip ammo count should be subtracted from

/// reserve ammo count to obtain the actual reserve ammo count.

/// For non-supporting clients, this has no side effects in interpretation

/// since clip would always be 0 for them.

///

public static bool ReserveIncludesClip(SNet_Player player) {

if (player.IsBot) player = SNet.Master;

return!player.IsLocal;

}

Stamina

Stamina information is synced and managed by PlayerSync since the vanilla game does not provide a mechanism to track it for other players. The values can be queried via:

namespace PlayerSync.Sync.Stamina;

class StaminaSync {

///

/// Tries to get the stamina info for a given player, returns false if

/// player doesn't exist or unsupported (i.e. not synced).

///

/// player to query

/// stamina information

/// true if found

public static bool GetStaminaInfo(SNet_Player player, out StaminaInfo info) {... }

}

Advanced Configuration

In general, no configuration is needed. Clients with this mod installed will update each other with the information.

The frequency for updates, however, can be configured in the config; this is hard capped at 60Hz.

Possible Future Plans

  • Synchronize modded player attributes (e.g. Oxygen)

安裝與使用 安裝:按包內說明操作

  1. 解壓本站下載的壓縮包,先讀包內的 readme / 說明檔案。
  2. 多數模組依賴遊戲的模組載入器:常見做法是用社群模組管理器(如 r2modman)選中本遊戲安裝,由管理器自動處理載入器與依賴。
  3. 手動安裝時,把模組檔案放進遊戲目錄下對應的 Mod / plugins 資料夾。
  4. 啟動遊戲確認載入成功;帶「前置依賴」的模組需要把依賴一併安裝。

不同模組的安裝位置差異較大,包內說明是最可靠的依據。

前置依賴

下面這些內容需要先安裝,否則該模組不會生效:

BepInEx-BepInExPack_GTFO

檔案與校驗

檔案名稱
PlayerSync-1.1.2.zip
檔案大小
24.7 KiB