GS2-Matchmaking Transaction Actions
Combining actions, and concurrency
The background common to every service is collected in Combining Transaction Actions. Read that first; the rest of this section is what GS2-Matchmaking adds to it.
GS2-Matchmaking provides one transaction action, and it only reads.
| Operation | Repeated in one transaction | Across a nested transaction | Boundary that separates targets |
|---|---|---|---|
Verifying participationVerifyIncludeParticipantByUserId | First wins | No collision, because it only reads | season gathering, verify type, target user |
Like any verify action, this one looks at the season gathering as of the start of the transaction. A user who joined the gathering within the same transaction is not yet a participant as far as this check is concerned, so a transaction cannot make someone join and then verify that they joined.
The same applies when the joining happens inside a nested transaction, as the prize of a draw or the result of an exchange. GS2-Matchmaking has no transaction action that joins a gathering, so joining always happens through an API or through processing that another service’s action invokes. Split the transaction where you want to verify something that transaction established.
Verifying two different users is two different targets, so both are checked.
Take care with nested transactions
This action writes nothing, so it never collides with an update arriving from an inner transaction. What it cannot do is see a change that the same transaction made, whichever route that change arrived by.
Concurrency and retries
This action does not return a conflict. It fails only when the check itself does not hold, which is a result rather than an error to retry.
Verify Action
Gs2Matchmaking:VerifyIncludeParticipantByUserId
Verify if persistent gathering includes user ID by User ID
Verifies whether the specified user is or is not a participant of the season gathering.
Quantity specification supported: NO
| Type | Condition | Required | Default | Value Limits | Description | |||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||||||||
| seasonName | string | ✓ | ~ 128 chars | Season Model name Unique Season Model name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||||||||
| season | long | ✓ | 0 ~ 9223372036854775805 | Season | ||||||||
| tier | long | ✓ | 0 ~ 9223372036854775805 | Tier The tier level used to group players of similar rank together. Determined by the player’s rank in the GS2-Experience model specified in the SeasonModel. Players are only matched with others in the same tier, ensuring fair competition. | ||||||||
| seasonGatheringName | string | ✓ | UUID | ~ 128 chars | Season Gathering Name Unique Season Gathering name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | |||||||
| userId | string | ✓ | ~ 128 chars | User ID Specify #{userId} to substitute the currently logged-in user’s ID. | ||||||||
| verifyType | string (enum) enum { “include”, “notInclude” } | ✓ | Type of verification
| |||||||||
| timeOffsetToken | string | ~ 1024 chars | Time offset token |
{
"action": "Gs2Matchmaking:VerifyIncludeParticipantByUserId",
"request": {
"namespaceName": "[string]Namespace name",
"seasonName": "[string]Season Model name",
"season": "[long]Season",
"tier": "[long]Tier",
"seasonGatheringName": "[string]Season Gathering Name",
"userId": "[string]User ID",
"verifyType": "[string]Type of verification",
"timeOffsetToken": "[string]Time offset token"
}
}action: Gs2Matchmaking:VerifyIncludeParticipantByUserId
request:
namespaceName: "[string]Namespace name"
seasonName: "[string]Season Model name"
season: "[long]Season"
tier: "[long]Tier"
seasonGatheringName: "[string]Season Gathering Name"
userId: "[string]User ID"
verifyType: "[string]Type of verification"
timeOffsetToken: "[string]Time offset token"transaction.service("matchmaking").verify.verify_include_participant_by_user_id({
namespaceName="[string]Namespace name",
seasonName="[string]Season Model name",
season="[long]Season",
tier="[long]Tier",
seasonGatheringName="[string]Season Gathering Name",
userId="[string]User ID",
verifyType="[string]Type of verification",
timeOffsetToken="[string]Time offset token",
})