open.mp icon indicating copy to clipboard operation
open.mp copied to clipboard

Players can join the server even if the slot limit has been reached (max_players/max_bots)

Open edgyaf opened this issue 2 weeks ago • 0 comments
trafficstars

Describe the bug NPCs take slots used by regular players, so the slots count in server query decreases correctly. max_players 110 with 10 NPCs connected (max_bots set to 10) displays 100 slots in server query. Despite this, players still can join up to 110, occupying higher slots (so in result it can display things like 110/100 in query).

To Reproduce Steps to reproduce the behavior:

  1. Set max_players to 1 and max_bots to 1.
  2. Run this script:
#include <open.mp>

main() {}

public OnGameModeInit()
{
    NPC_Create("test");
}
  1. Try to connect as regular player - it shouldn't be allowed, but the player can join fine.

Expected behavior Player can't connect. Case above describes situation where there are 0 slots available for regular players, but same thing applies to higher values like 110 slots with 10 NPCs.

Screenshots and/or logs max_players = 2 , max_bots = 1 (1 NPC connected, 2 regular players managed to connect): Image

Commit hash in master https://github.com/openmultiplayer/open.mp/actions/runs/18908843333

edgyaf avatar Nov 04 '25 22:11 edgyaf