Registering a server with the Master Server

Now that you've configured the Master Server, it's time to register a server with it. This is easy to do.

Immediately after making a call to Network.InitializeServer, make another call to MasterServer.RegisterHost. This call connects to the Master Server and tells it to display our server in the public game list.

The RegisterHost function takes three parameters, all strings: gameTypeName, gameName, and comment. The game type name is used to separate different game listings from each other. For example, if two games use the same Master Server, they would both supply different game type names in order to avoid getting listings for the other game. The game name is the name of the host server, for example ...

Get Unity Multiplayer Games now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.