How to have server refuse connections from new players

I have a networked multiplayer match game, where based on the state of the match (as determined by the server), I want to refuse new client connection requests. So, for example if the match is already in progress, new players can’t join until the match is over.

We are using the new networking API, the problem is I can’t seem to find where in the API I can process a connection request and refuse a connection. All the triggers/hooks I can find all relates to responding to connections after the players have already connected.

Many thanks!
Andrew

Why not simply disconnect the new client from the OnServerConnect event? I don’t think blocking clients is available in the API, but if you disconnect them soon as they connect it really wouldn’t affect the game since they don’t get to receive any info.

Thanks! I can give that a look as well!

Another option that we were able to find is under NetworkManager Component-> Spawn Info → Advanced Configuration there is a “Max Connections” properties. Setting that value appears to do what we needed.