NetworkManager default implementations of virtual methods

I’m having some trouble getting my head around the sequence of events which occurs on the NetworkManager upon starting/connecting to a server. Are we allowed to see the default implementations of the virtual methods? I’ve found a handful of methods in different places, but nothing complete or concise.

Specifically at the moment I want to register some message handlers on the client as early as possible, and I am unsure where to do that after invoking NetworkManager.StartClient() (though StartClient is not virtual, it would be nice to know what chain of events it sets in motion too).

Thanks :slight_smile:

NetworkManager.StartClient() is not virtual because it has three overloads. To customize it you need to implement three virtual functions. NetworkManager.OnStartClient() is virtual and is called from inside all the overloaded versions of StartClient(), so it is simpler to override just that one function.

Thanks :slight_smile: Registering message handlers in OnStartClient() does the trick!

There’s some outdated snippets regarding the virtual methods here http://docs.unity3d.com/Manual/UNetManager.html
For example NetworkServer.AddPlayer() is still used in the reference, instead of AddPlayerForConnection().