GS2-Matchmaking Transaction Actions

Specification of verify/consume/acquire 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.

OperationRepeated in one transactionAcross a nested transactionBoundary that separates targetsUnder sequential execution mode
Verifying participation
VerifyIncludeParticipantByUserId
Checks that match exactly are gathered into oneNo collision, because it only readsseason gathering, verify type, target userNo change; it already succeeds because it only reads
Verifying a rating
VerifyRatingByUserId
Checks that match exactly are gathered into one. The rate value is never added up or multiplied by the quantityNo collision, because it only readsnamespace, user, rating, verify type, rate valueNo 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

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
✓
~ 128 charsNamespace name
Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
seasonNamestring
✓
~ 128 charsSeason Model name
Unique Season Model name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
seasonlong
✓
0 ~ 9223372036854775805Season
tierlong
✓
0 ~ 9223372036854775805Tier
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.
seasonGatheringNamestring
✓
UUID~ 128 charsSeason Gathering Name
Unique Season Gathering name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
userIdstring
✓
~ 128 charsUser ID
Specify #{userId} to substitute the currently logged-in user’s ID.
verifyTypestring (enum)
enum {
  “include”,
  “notInclude”
}
✓
Type of verification
DefinitionDescription
includeSpecified user is included in the Season Gathering
notIncludeSpecified user is not included in the Season Gathering
timeOffsetTokenstring~ 1024 charsTime 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

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
✓
~ 128 charsNamespace name
Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
userIdstring
✓
~ 128 charsUser ID
Specify #{userId} to substitute the currently logged-in user’s ID.
ratingNamestring
✓
~ 128 charsRating name
Unique Rating name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
verifyTypestring (enum)
enum {
  “less”,
  “lessEqual”,
  “greater”,
  “greaterEqual”,
  “equal”,
  “notEqual”
}
✓
Type of verification
DefinitionDescription
lessRate value is less than the specified value
lessEqualRate value is less than or equal to the specified value
greaterRate value is greater than the specified value
greaterEqualRate value is greater than or equal to the specified value
equalRate value is equal to the specified value
notEqualRate value is not equal to the specified value
rateValuefloat
✓
0 ~ 65535.0Rate value to be compared
timeOffsetTokenstring~ 1024 charsTime 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",
})