PlayerSync
Sync additional player information across clients.
| Last updated | 2 days ago |
| Total downloads | 56 |
| Total rating | 0 |
| Categories | Client Mods Libraries |
| Dependency string | food-PlayerSync-1.0.2 |
| Dependants | 1 other package depends on this package |
This mod requires the following mods to function
BepInEx-BepInExPack_GTFO
BepInEx pack for GTFO. Preconfigured and includes Unity Base DLLs.
Preferred version: 3.2.2README
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.
This information is adjusted to account for the clip size. This mod sends the same data as vanilla if other clients don't have the mod installed.
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 {
/// <summary>
/// Tries to get the stamina info for a given player, returns false if
/// player doesn't exist or unsupported (i.e. not synced).
/// </summary>
/// <param name="player">player to query</param>
/// <param name="info">stamina information</param>
/// <returns>true if found</returns>
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)