Schema upload required in order to leverage "AuthService"?

I’m working on updating to 1.0 and using the new AuthService features with auto-login disabled on the CoherenceBridge as I intend to control login from my main menu UI. When I start my game, I see a warning:

(coherence) RequestFactory: Your current Schema has not been uploaded to the coherence Cloud. You will not be able to establish a connection with the coherence Cloud and will not be able to use our Services. You can upload your current Schema from the coherence Cloud Tab in the Hub Window.

This warning is accurate in that I have not uploaded my schema yet. With that being said, I am confused why the schema would need to be uploaded at this stage when the application hasn’t tried to interact with any of the rooms, worlds, etc. APIs?

Additionally, if I call LoginAsGuest (as shown below) I get the following error:

IAuthClient authService = _cloudService.GameServices.AuthService;
Task<Result> initialLoginTask = authService.LoginAsGuest();
while (!initialLoginTask.IsCompleted)
{
    yield return null;
}

(coherence) Request: Failed to parse request error body {“error_code”:“ERR_PROJECT_SCHEMA_NOT_FOUND”}

This feels unintuitive that I would need to have a schema uploaded to the Coherence cloud, especially when, at this point, I only intend to work with the local replication server while developing. Am I missing something where I need to configure the CoherenceBridge to connect to the local services, not the cloud ones?

1 Like

After reading through the example connection dialog provided as part of the SDK, I realize that an assumption I made is that I need first to authenticate the user to the Coherence Cloud in order to work with the play/rooms API, which I now think might be an incorrect assumption.

Is it correct that I only need to integrate with the AuthService and user accounts if I want to use the lobbies/matchmaking service?

Something which leads me to believe that I need to use the AuthService before I do anything with rooms is that the example shown on the rooms page of the documentation shows a call to WaitForCloudServiceLoginAsync (Rooms - Unity Multiplayer SDK Documentation | coherence):

// Wait for connection to be established with the coherence Cloud, authenticated as a Guest User.
await cloudService.WaitForCloudServiceLoginAsync(1000);

Is it correct that this example suggests you need to be authenticated to the cloud services before you can call the rooms API, or is that not what this is suggesting, and I misunderstood?

1 Like

Thanks for the questions, Kevin. I’ll ask the SDK team for clarification, as I don’t know myself!

1 Like

Using our Cloud services and talking to a local Replication Server are different actions.

If you want to browse or create rooms from a local Replication Server you don’t need to authenticate with coherence. You can simply use a ReplicationServerRoomsService instance.

Using any of the coherence Cloud services requires authenticating from a client with a known (uploaded) Schema ID, thats why you get the warning.

The Rooms Sample UI should cover all your use cases on how to use ReplicationServerRoomsService or CloudRoomsService indistinctively (they share the same interface).

2 Likes