Stop players from connecting to a LAN session

You could have a Counter Int Variable on the GameMode. The “PostLogin” function that is called there could add 1 to that counter. When someone connects and the Counter is already equal to the max amount of players and the Game is already running, you just let him disconnect again. That could be done by calling a RunOwningClient RPC on the PlayerController that is passed with the PostLogin function. This RPC could then call a simple ConsoleCommand that does “open MainMenu”.

It bit dirty but that would work i guess.

When someone leaves you would just need to lower the counter again.

Only thing you can’t make sure is that the same player connects, because that would need a unique ID that you can compare. And that only ships with OnlineSubsystems like Steam and i don’t know if the SteamID is exposed to Blueprints.