Offline match in a multiplayer game

Hello, please look at the following question by marcelop:

For my game, I have done what seanr suggested, and it works very nicely! My only concern is that the network server is still listening to a port, which is unnecessary. Is it possible to do what seanr said, but without occupying any ports?

Thank you for reading :slight_smile:

I have my multiplayer game’s singleplayer setting set to where it hosts a server with a max of 1 player and a host ID that is different so other people can’t see it.

That’s the only workaround I can think of.

My solution similar to @Wolfrik_Creations, but in the new UNet.

I have a MatchGameManager class overriding UNet’s NetworkManager:

public class MatchGameManager : NetworkManager
{
	public void StartSingle ()
	{
		maxConnections = -1;
		// Just make sure match making is stopped
		if (matchMaker != null)
			StopMatchMaker ();
		// Just make sure no server is running
		if (!IsClientConnected () && !NetworkServer.active && matchMaker == null)
			StartHost ();
	}
}