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 two transaction actions, and both only read.
| Operation | Repeated in one transaction | Across a nested transaction | Boundary that separates targets | Under sequential execution mode |
|---|---|---|---|---|
Verifying participationVerifyIncludeParticipantByUserId | Checks that match exactly are gathered into one | No collision, because it only reads | season gathering, verify type, target user | No change; it already succeeds because it only reads |
Verifying a ratingVerifyRatingByUserId | Checks that match exactly are gathered into one. The rate value is never added up or multiplied by the quantity | No collision, because it only reads | namespace, user, rating, verify type, rate value | No change; it already succeeds because it only reads |
Like any verify action, these look at the season gathering and the rating as of the start of the transaction. A user who has not been rated yet is compared using the initial value of the rating model.
For the participation check, 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. Rating checks with different rate values are not added up either; each is kept and checked on its own.
Take care with nested transactions
These actions write nothing, so they never collide with an update arriving from an inner transaction. What they cannot do is see a change that the same transaction made, whichever route that change arrived by.
Concurrency and retries
These actions do not return a conflict. They fail 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",
})Gs2Matchmaking:VerifyRatingByUserId
Verify Rating by User ID
Verifies that the specified user’s rate value for the specified rating model satisfies the specified condition against the given value without modifying the rate value. A user who has not been rated yet is compared using the initial value defined in the rating model. If the condition is not met, an error is returned.
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 (.). | ||||||||||||||||
| userId | string | ✓ | ~ 128 chars | User ID Specify #{userId} to substitute the currently logged-in user’s ID. | ||||||||||||||||
| ratingName | string | ✓ | ~ 128 chars | Rating name Unique Rating name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||||||||||||||||
| verifyType | string (enum) enum { “less”, “lessEqual”, “greater”, “greaterEqual”, “equal”, “notEqual” } | ✓ | Type of verification
| |||||||||||||||||
| rateValue | float | ✓ | 0 ~ 65535.0 | Rate value to be compared | ||||||||||||||||
| timeOffsetToken | string | ~ 1024 chars | Time offset token |
{
"action": "Gs2Matchmaking:VerifyRatingByUserId",
"request": {
"namespaceName": "[string]Namespace name",
"userId": "[string]User ID",
"ratingName": "[string]Rating name",
"verifyType": "[string]Type of verification",
"rateValue": "[float]Rate value to be compared",
"timeOffsetToken": "[string]Time offset token"
}
}action: Gs2Matchmaking:VerifyRatingByUserId
request:
namespaceName: "[string]Namespace name"
userId: "[string]User ID"
ratingName: "[string]Rating name"
verifyType: "[string]Type of verification"
rateValue: "[float]Rate value to be compared"
timeOffsetToken: "[string]Time offset token"transaction.service("matchmaking").verify.verify_rating_by_user_id({
namespaceName="[string]Namespace name",
userId="[string]User ID",
ratingName="[string]Rating name",
verifyType="[string]Type of verification",
rateValue="[float]Rate value to be compared",
timeOffsetToken="[string]Time offset token",
})