Skip to content

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

@edgyaf

Description

@edgyaf

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingnightly

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions