HLAPI end match

I’ve had a good look around and I can’t find much info on this.

Basically, once a certain criteria is met, I want the server player / dedicated server to kick everyone off, stop the match and return it’s self (if player) to the lobby.

currently using the following code, all the clients will return to their respective lobbies, but the server player will stay in the game scene and throw errors.

NetworkServer.DisconnectAll();

if I use

NetworkManager.Shutdown();

in addition, the server player can jump back to the lobby, but can’t start any new matches.

Whats the correct procedure here? thanks.

(what kind of code does the network manager hud button on the server player use to do this?)

I did try this method but the code example is redlined when used in Unity

public NetworkID netId;

isn’t a valid namespace.

https://docs.unity3d.com/ScriptReference/Networking.Match.NetworkMatch.DestroyMatch.html

seems

NetworkManager.singleton.StopHost();

does the trick. Not sure how robust this is, I’ll leave it here for anyone else searching the same subject.

In the end I pulled this from a sample unity project.

https://docs.unity3d.com/ScriptReference/Networking.NetworkManager.StopHost.html