Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Question What is the structure of GetPayloadAllocationAsPlainText()?

Discussion in 'Game Server Hosting' started by CodeMonkeyYT, Mar 11, 2023.

  1. CodeMonkeyYT

    CodeMonkeyYT

    Joined:
    Dec 22, 2014
    Posts:
    121
    Hi there,

    There's a function GetPayloadAllocationAsPlainText();
    And another GetPayloadAllocationFromJsonAs<TPayload>();

    What data does this return? I can't find any mention in the docs.

    Thanks!
     
  2. CodeMonkeyYT

    CodeMonkeyYT

    Joined:
    Dec 22, 2014
    Posts:
    121
    For anyone else who wants to know apparently it returns this structure
    Code (CSharp):
    1. [Serializable]
    2.     public class PayloadAllocation {
    3.         public Unity.Services.Matchmaker.Models.MatchProperties MatchProperties;
    4.         public string GeneratorName;
    5.         public string QueueName;
    6.         public string PoolName;
    7.         public string EnvironmentId;
    8.         public string BackfillTicketId;
    9.         public string MatchId;
    10.         public string PoolId;
    11.     }
    Which you can get with
    Code (CSharp):
    1. PayloadAllocation payloadAllocation = await MultiplayService.Instance.GetPayloadAllocationFromJsonAs<PayloadAllocation>();
     
  3. earthcrosser

    earthcrosser

    Joined:
    Oct 13, 2010
    Posts:
    121
    Just sharing an experience with that line of code that Codemonkey shared. I had Multiplay 1.0.3 installed and I was getting Failed to Deserialize error on the server. I upgraded my Multiplay version to 1.0.5 and the problem went away. So just sharing in case anyone else hits that error.