How to Check Server Status

You may want to check whether your server is working from inside the game.

It is possible to check the status of a master server by getting its node count, which shows how many room servers are connected to the master server. To get the node count it is necessary to connect to the server and call the GetCount() method of a NodeClient instance.

public void Connect() {
    StrixNetwork.instance.applicationId = "00000000-0000-0000-0000-000000000000";
    StrixNetwork.instance.ConnectMasterServer(
        "000000000000000000000000.game.strixcloud.net",
        OnConnectCallback,
        OnConnectFailedCallback
    );
}

// Callback function to be called when connecting to the master server has completed
private void OnConnectCallback(StrixNetworkConnectEventArgs args) {
    Debug.Log("Connection established");

    StrixNetwork.instance.masterSession.nodeClient.GetCount(
        new GetCountMessage<CustomizableMatchServerNode>(),
        response => {
            Debug.Log("Node count " + response.Result.GetCount());
        }, null);
}

// Callback function to be called when connecting to the master server has failed
private void OnConnectFailedCallback(StrixNetworkConnectFailedEventArgs args) {
    Debug.Log("Connect failed. error = " + args.cause);
}

Here StrixNetwork is a singleton class that provides the interface to the Strix API.

The function GetCount() should be called within the OnConnectCallback() callback function. GetCount() can only be called after completion of the connection.