open.mp
open.mp copied to clipboard
Players can join the server even if the slot limit has been reached (max_players/max_bots)
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:
- Set
max_playersto 1 andmax_botsto 1. - Run this script:
#include <open.mp>
main() {}
public OnGameModeInit()
{
NPC_Create("test");
}
- 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):
Commit hash in master https://github.com/openmultiplayer/open.mp/actions/runs/18908843333