When I try to call the “CreateTicketAsync” callback like in this example, I initialize the Unity Services and authenticate myself previously and Multiplay set up. What things I could miss? I set up the matchmaker in the Unity Dashboard. Do I have to do something else before calling “CreateTicketAsync”?
Unity: 2021.3.14f1
Multiplay: 1.0.0-pre.7
Matchmaker: 1.0.0-pre.14
Example Code:
private async Task CreateTicket()
{
var attributes = new Dictionary<string, object>();
var players = new List<Player>
{
new(AuthenticationService.Instance.PlayerId)
};
// Set options for matchmaking
var options = new CreateTicketOptions("MainWorld", attributes);
// Create ticket
var ticketResponse = await MatchmakerService.Instance.CreateTicketAsync(players, options);
// Print the created ticket id
Debug.LogFormat($"Created ticket with id: {ticketResponse.Id}");
}
Errors:
[Matchmaker]: BadRequest (21400)
Title: Bad Request
Errors:
{"error":["No config found for upid 758efb56-0ce6-46cf-a4ff-ac1eff77c195 and env 4adef20a-8ca3-4acf-b7fc-43a2e817ac82"]}
UnityEngine.Logger:LogError (string,object)
Unity.Services.Matchmaker.Logger:LogError (object) (at Library/PackageCache/com.unity.services.matchmaker@1.0.0-pre.14/Runtime/SDK/Utils/Logger.cs:17)
Unity.Services.Matchmaker.WrappedMatchmakerService:ResolveErrorWrapping (Unity.Services.Matchmaker.MatchmakerExceptionReason,System.Exception) (at Library/PackageCache/com.unity.services.matchmaker@1.0.0-pre.14/Runtime/SDK/WrappedMatchmakerService.cs:322)
Unity.Services.Matchmaker.WrappedMatchmakerService/<TryCatchRequest>d__14`2<Unity.Services.Matchmaker.Tickets.CreateTicketRequest, Unity.Services.Matchmaker.Models.CreateTicketResponse>:MoveNext () (at Library/PackageCache/com.unity.services.matchmaker@1.0.0-pre.14/Runtime/SDK/WrappedMatchmakerService.cs:251)
System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1<Unity.Services.Matchmaker.Response`1<Unity.Services.Matchmaker.Models.CreateTicketResponse>>:SetException (System.Exception)
Unity.Services.Matchmaker.Apis.Tickets.TicketsApiClient/<CreateTicketAsync>d__7:MoveNext () (at Library/PackageCache/com.unity.services.matchmaker@1.0.0-pre.14/Runtime/Apis/TicketsApi.cs:122)
System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1<Unity.Services.Matchmaker.Http.HttpClientResponse>:SetResult (Unity.Services.Matchmaker.Http.HttpClientResponse)
Unity.Services.Matchmaker.Http.HttpClient/<MakeRequestAsync>d__1:MoveNext () (at Library/PackageCache/com.unity.services.matchmaker@1.0.0-pre.14/Runtime/Http/HttpClient.cs:41)
System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1<Unity.Services.Matchmaker.Http.HttpClientResponse>:SetResult (Unity.Services.Matchmaker.Http.HttpClientResponse)
Unity.Services.Matchmaker.Http.HttpClient/<CreateWebRequestAsync>d__3:MoveNext () (at Library/PackageCache/com.unity.services.matchmaker@1.0.0-pre.14/Runtime/Http/HttpClient.cs:56)
System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1<Unity.Services.Matchmaker.Http.HttpClientResponse>:SetResult (Unity.Services.Matchmaker.Http.HttpClientResponse)
Unity.Services.Matchmaker.Http.HttpClient/<CreateHttpClientResponse>d__4:MoveNext () (at Library/PackageCache/com.unity.services.matchmaker@1.0.0-pre.14/Runtime/Http/HttpClient.cs:84)
System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1<Unity.Services.Matchmaker.Http.HttpClientResponse>:SetResult (Unity.Services.Matchmaker.Http.HttpClientResponse)
Unity.Services.Matchmaker.Http.HttpClient/<>c__DisplayClass4_0/<<CreateHttpClientResponse>b__0>d:MoveNext () (at Library/PackageCache/com.unity.services.matchmaker@1.0.0-pre.14/Runtime/Http/HttpClient.cs:81)
System.Threading.Tasks.TaskCompletionSource`1<Unity.Services.Matchmaker.Http.HttpClientResponse>:SetResult (Unity.Services.Matchmaker.Http.HttpClientResponse)
Unity.Services.Matchmaker.Http.UnityWebRequestHelpers/<>c__DisplayClass0_0:<GetAwaiter>b__0 (UnityEngine.AsyncOperation) (at Library/PackageCache/com.unity.services.matchmaker@1.0.0-pre.14/Runtime/Http/UnityWebRequestHelpers.cs:34)
UnityEngine.AsyncOperation:InvokeCompletionEvent ()
HttpException`1: (400) HTTP/1.1 400 Bad Request
Unity.Services.Matchmaker.Http.ResponseHandler.HandleAsyncResponse (Unity.Services.Matchmaker.Http.HttpClientResponse response, System.Collections.Generic.Dictionary`2[TKey,TValue] statusCodeToTypeMap) (at Library/PackageCache/com.unity.services.matchmaker@1.0.0-pre.14/Runtime/Http/ResponseHandler.cs:122)
Unity.Services.Matchmaker.Http.ResponseHandler.HandleAsyncResponse[T] (Unity.Services.Matchmaker.Http.HttpClientResponse response, System.Collections.Generic.Dictionary`2[TKey,TValue] statusCodeToTypeMap) (at Library/PackageCache/com.unity.services.matchmaker@1.0.0-pre.14/Runtime/Http/ResponseHandler.cs:226)
Unity.Services.Matchmaker.Apis.Tickets.TicketsApiClient.CreateTicketAsync (Unity.Services.Matchmaker.Tickets.CreateTicketRequest request, Unity.Services.Matchmaker.Configuration operationConfiguration) (at Library/PackageCache/com.unity.services.matchmaker@1.0.0-pre.14/Runtime/Apis/TicketsApi.cs:121)
Unity.Services.Matchmaker.WrappedMatchmakerService.TryCatchRequest[TRequest,TReturn] (System.Func`3[T1,T2,TResult] func, TRequest request) (at Library/PackageCache/com.unity.services.matchmaker@1.0.0-pre.14/Runtime/SDK/WrappedMatchmakerService.cs:228)
Rethrow as MatchmakerServiceException: HTTP/1.1 400 Bad Request
Unity.Services.Matchmaker.WrappedMatchmakerService.ResolveErrorWrapping (Unity.Services.Matchmaker.MatchmakerExceptionReason reason, System.Exception exception) (at Library/PackageCache/com.unity.services.matchmaker@1.0.0-pre.14/Runtime/SDK/WrappedMatchmakerService.cs:328)
Unity.Services.Matchmaker.WrappedMatchmakerService.TryCatchRequest[TRequest,TReturn] (System.Func`3[T1,T2,TResult] func, TRequest request) (at Library/PackageCache/com.unity.services.matchmaker@1.0.0-pre.14/Runtime/SDK/WrappedMatchmakerService.cs:251)
Unity.Services.Matchmaker.WrappedMatchmakerService.CreateTicketAsync (System.Collections.Generic.List`1[T] players, Unity.Services.Matchmaker.CreateTicketOptions options) (at Library/PackageCache/com.unity.services.matchmaker@1.0.0-pre.14/Runtime/SDK/WrappedMatchmakerService.cs:55)
Asteroids_Host_Simple.Other.ApplicationController.CreateTicket () (at Assets/Asteroids-Host-Simple/Other/ApplicationController.cs:95)
Asteroids_Host_Simple.Other.ApplicationController.LaunchInMode (System.Boolean isServer, System.String profileName) (at Assets/Asteroids-Host-Simple/Other/ApplicationController.cs:76)
Asteroids_Host_Simple.Other.ApplicationController.Start () (at Assets/Asteroids-Host-Simple/Other/ApplicationController.cs:34)
System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.<ThrowAsync>b__7_0 (System.Object state) (at <d6232873609549b8a045fa15811a5bd3>:0)
UnityEngine.UnitySynchronizationContext+WorkRequest.Invoke () (at <bae255e3e08e46f7bc2fbd23dde96338>:0)
UnityEngine.UnitySynchronizationContext.Exec () (at <bae255e3e08e46f7bc2fbd23dde96338>:0)
UnityEngine.UnitySynchronizationContext.ExecuteTasks () (at <bae255e3e08e46f7bc2fbd23dde96338>:0)