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?
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.
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 ();
}
}