You are viewing a potentially older version of this package. View all versions.
khalil-PlayerCountFixed-1.0.0 icon

PlayerCountFixed

Lightweight REPO lobby player counter that safely shows current/max players for RoboUnion, MorePlayers, and MorePlayersSimple rooms.

By khalil
Date uploaded a day ago
Version 1.0.0
Download link khalil-PlayerCountFixed-1.0.0.zip
Downloads 639
Dependency string khalil-PlayerCountFixed-1.0.0

This mod requires the following mods to function

BepInEx-BepInExPack-5.4.2100 icon
BepInEx-BepInExPack

BepInEx pack for Mono Unity games. Preconfigured and ready to use.

Preferred version: 5.4.2100

README

PlayerCountFixed

PlayerCountFixed is a lightweight BepInEx plugin for R.E.P.O. that adds a clean lobby player counter showing:

Players: current/max

It is designed for players who use expanded-lobby mods and want a simple, reliable player-count display without stutter, repeated console errors, or expensive UI scanning.

Important clarification

PlayerCountFixed is not a patched, forked, or repackaged version of any existing player-count mod.

This is a completely new plugin built from scratch. It only uses the same general idea of displaying the lobby player count. The implementation avoids the known problems reported in similar mods, including per-frame text writes, repeated global UI scans, and noisy error logging.

What it does

PlayerCountFixed displays the number of players currently in the room and the room's maximum player count on the lobby screen.

Example:

Players: 3/17

The counter appears in the lobby page using a compact yellow TextMeshPro label.

Supported expanded-lobby mods

PlayerCountFixed can read the host-side configured max player value from these commonly used expanded-lobby mods when you are hosting:

  • RoboUnion
  • MorePlayers
  • MorePlayersSimple

These mods are not required. If none of them are loaded, PlayerCountFixed falls back to the room max value reported by Photon.

How it works

PlayerCountFixed follows a conservative runtime flow:

  1. During startup, it checks which supported expanded-lobby plugin is actually loaded through BepInEx's Chainloader.
  2. It does not decide based on leftover config files or whether a DLL merely exists on disk.
  3. When the lobby page opens, it attaches one TextMeshPro label to the lobby UI.
  4. The label refreshes at a small interval instead of every frame.
  5. Text is only written when the displayed value changes.
  6. Errors are guarded and logged at most once to avoid console spam.

This means the plugin does not perform repeated global Resources.FindObjectsOfTypeAll scans and does not continuously rewrite UI text every frame.

Hosting a room

If you are the room host / Photon master client, PlayerCountFixed reads the configured maximum player count from the loaded expanded-lobby mod when possible:

  • RoboUnion: reads General / MaxPlayers; 0 is treated as the default 6 players.
  • MorePlayers: reads General / Max Players.
  • MorePlayersSimple: reads General / MaxPlayersPublic or General / MaxPlayersPrivate depending on whether the current room is public or private.

If config reading fails for any reason, the display safely falls back to PhotonNetwork.CurrentRoom.MaxPlayers.

Joining someone else's room

When you join another player's room, PlayerCountFixed does not use your local expanded-lobby config. Your local config may not match the host's settings.

Instead, joined-room clients display the actual max player value reported by Photon for that room.

This prevents wrong displays such as showing your local 20 player config when the host actually created a 10 player room.

Installation

Install with Thunderstore Mod Manager / r2modman, or manually copy:

BepInEx/plugins/PlayerCountFixed.dll

into your game's BepInEx plugins folder.

Compatibility notes

  • Requires BepInEx 5.
  • Works without any expanded-lobby mod installed.
  • Supports RoboUnion, MorePlayers, and MorePlayersSimple for host-side configured max player detection.
  • If multiple supported expanded-lobby mods are loaded, PlayerCountFixed uses this priority: MorePlayersSimple > MorePlayers > RoboUnion.

Why use PlayerCountFixed?

PlayerCountFixed was created to provide the same useful lobby information that players want, while avoiding the reliability and performance issues seen in similar player-count display mods.

It is intentionally small, focused, and defensive:

  • no global UI polling loop;
  • no every-frame TextMeshPro assignment;
  • no reliance on stale config files;
  • no hard dependency on expanded-lobby mods;
  • safe fallback when joining other players;
  • one-time guarded logging instead of console spam.

问题反馈

CHANGELOG

Changelog

1.0.0

  • Initial Thunderstore release.
  • Added lobby player counter: Players: current/max.
  • Added host-side max player detection for RoboUnion, MorePlayers, and MorePlayersSimple.
  • Added safe joined-room behavior using Photon room max players instead of local config.
  • Added lightweight UI update loop without global polling or per-frame text assignment.