Class PartyKit
Used to get lobby/party id secrets to get players together.
Inheritance
Namespace: Trail
Assembly: Trail.dll
Syntax
public static class PartyKit : object
Fields
MaxInviteMessageLength
Declaration
public const int MaxInviteMessageLength = null
Field Value
| Type | Description |
|---|---|
| System.Int32 |
MaxLandingPageFieldsLength
Declaration
public const int MaxLandingPageFieldsLength = null
Field Value
| Type | Description |
|---|---|
| System.Int32 |
MaxLandingPageInfoIdLength
Declaration
public const int MaxLandingPageInfoIdLength = null
Field Value
| Type | Description |
|---|---|
| System.Int32 |
MaxLandingPageInfoLabelLength
Declaration
public const int MaxLandingPageInfoLabelLength = null
Field Value
| Type | Description |
|---|---|
| System.Int32 |
MaxLandingPageInfoValueLength
Declaration
public const int MaxLandingPageInfoValueLength = null
Field Value
| Type | Description |
|---|---|
| System.Int32 |
MaxPartyDataKeyLength
Declaration
public const int MaxPartyDataKeyLength = null
Field Value
| Type | Description |
|---|---|
| System.Int32 |
MaxPartyDataValueLength
Declaration
public const int MaxPartyDataValueLength = null
Field Value
| Type | Description |
|---|---|
| System.Int32 |
Methods
FinalizeInviteLoading(Boolean)
The game always needs to call this method when the user has either successfully finished loading the invite or fail to do so due to any error.
Only the first call to this method will have any effect, subsequent calls will be ignored.
Declaration
public static Result FinalizeInviteLoading(bool success)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Boolean | success | Pass |
Returns
| Type | Description |
|---|---|
| Result |
GetPartyData()
Provides the latest party data. This will always be the latest party data update sent by the current party leader.
Declaration
public static PartyKit.PartyData GetPartyData()
Returns
| Type | Description |
|---|---|
| PartyKit.PartyData | The latest version of the party data sent by the party leader. |
GetPartyData(out PartyKit.PartyData)
Provides the latest party data. This will always be the latest party data update sent by the current party leader.
Declaration
public static Result GetPartyData(out PartyKit.PartyData partyData)
Parameters
| Type | Name | Description |
|---|---|---|
| PartyKit.PartyData | partyData | The latest version of the party data sent by the party leader. |
Returns
| Type | Description |
|---|---|
| Result |
IsInviteLoading()
Indicates if the game was launched from an invite and that invite has not yet been finalized by calling FinalizeLoadingInvite() or LeaveParty().
Declaration
public static bool IsInviteLoading()
Returns
| Type | Description |
|---|---|
| System.Boolean |
|
IsInviteLoading(out Boolean)
Indicates if the game was launched from an invite and that invite has not yet been finalized by calling FinalizeLoadingInvite() or LeaveParty().
Declaration
public static Result IsInviteLoading(out bool isLoading)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Boolean | isLoading |
|
Returns
| Type | Description |
|---|---|
| Result |
LeaveParty()
It causes the user to leave the party. Calling this before the invite process has been finalized is equivalent to calling FinalizeInviteLoading(false).
Declaration
public static Result LeaveParty()
Returns
| Type | Description |
|---|---|
| Result |
ShowInviteLink()
Triggers a modal dialog that shows the user's party invite link.
Declaration
public static Result ShowInviteLink()
Returns
| Type | Description |
|---|---|
| Result |
UpdateInviteLandingPageInfo(IList<PartyKit.LandingPageInfoField>)
Updates the information displayed on the user's party invite landing page.
Only updates from the party leader will cause an immediate change in the information shown on the landing page. However, updates by other users will still be stored and used later to update the landing page if a new user becomes the party leader.
Declaration
public static Result UpdateInviteLandingPageInfo(IList<PartyKit.LandingPageInfoField> infoFields)
Parameters
| Type | Name | Description |
|---|---|---|
| IList<PartyKit.LandingPageInfoField> | infoFields | Refer to the PartyKit documentation to see how to use this parameter to control different parts of the landing page. |
Returns
| Type | Description |
|---|---|
| Result |
UpdateInviteLandingPageInfo(PartyKit.LandingPageInfo)
Updates the information displayed on the user's party invite landing page.
Only updates from the party leader will cause an immediate change in the information shown on the landing page. However, updates by other users will still be stored and used later to update the landing page if a new user becomes the party leader.
Declaration
public static Result UpdateInviteLandingPageInfo(PartyKit.LandingPageInfo info)
Parameters
| Type | Name | Description |
|---|---|---|
| PartyKit.LandingPageInfo | info | Refer to the PartyKit documentation to see how to use this parameter to control different parts of the landing page. |
Returns
| Type | Description |
|---|---|
| Result |
UpdateInviteLoadingMessage(String)
Updates the message displayed to other users in the Party while the user is loading the invite, i.e. loading the game and joining the lobby, match, server, etc.
Declaration
public static Result UpdateInviteLoadingMessage(string message)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | message | Keep the message short, around 40 characters max, or otherwise it will show up cropped. |
Returns
| Type | Description |
|---|---|
| Result |
UpdatePartyData(IList<PartyKit.PartyDataField>)
Broadcasts the party data to all users in the party, including the user sending it.
You should use this method to pass any information you need to share between clients so that all users can end up in the same match, lobby, etc. For example, you could use this to share a lobby ID and a server region.
Only updates from the party leader will actually be sent to the rest of the party members. Updates by other users will still be stored, and if a user later becomes the party leader, their latest party data will be broadcasted to everybody.
Declaration
public static Result UpdatePartyData(IList<PartyKit.PartyDataField> partyDataFields)
Parameters
| Type | Name | Description |
|---|---|---|
| IList<PartyKit.PartyDataField> | partyDataFields | The data to be broadcasted to all the members of the party. |
Returns
| Type | Description |
|---|---|
| Result |
UpdatePartyData(PartyKit.PartyData)
Broadcasts the party data to all users in the party, including the user sending it.
You should use this method to pass any information you need to share between clients so that all users can end up in the same match, lobby, etc. For example, you could use this to share a lobby ID and a server region.
Only updates from the party leader will actually be sent to the rest of the party members. Updates by other users will still be stored, and if a user later becomes the party leader, their latest party data will be broadcasted to everybody.
Declaration
public static Result UpdatePartyData(PartyKit.PartyData partyData)
Parameters
| Type | Name | Description |
|---|---|---|
| PartyKit.PartyData | partyData | The data to be broadcasted to all the members of the party. |
Returns
| Type | Description |
|---|---|
| Result |
Events
OnPartyDataUpdated
Callback for when party data is updated.
Declaration
public static event PartyKit.PartyDataUpdateCallback OnPartyDataUpdated
Event Type
| Type | Description |
|---|---|
| PartyKit.PartyDataUpdateCallback |