GS2-Matchmaking
GS2 SDK Reference
GS2 SDK Reference
Models
Namespace
Namespace
Namespace is a mechanism that allows multiple uses of the same service for different purposes within a single project.
Basically, GS2 services have a layer called namespace, and different namespaces are treated as completely different data spaces, even for the same service.
Therefore, it is necessary to create a namespace before starting to use each service.
Type | Description | |
---|---|---|
namespaceId | string | Namespace GRN |
name | string | Namespace name |
description | string | description of Namespace |
enableRating | bool | Use the rating calculation function |
createGatheringTriggerType | enum ['none', 'gs2_realtime', 'gs2_script'] | Action when creating a new gathering |
createGatheringTriggerRealtimeNamespaceId | string | GS2-Realtime namespace to create rooms when creating a gathering |
createGatheringTriggerScriptId | string | GS2-Script script to be executed when creating a gathering |
completeMatchmakingTriggerType | enum ['none', 'gs2_realtime', 'gs2_script'] | Action upon completion of matchmaking |
completeMatchmakingTriggerRealtimeNamespaceId | string | GS2-Realtime namespace to create rooms when matchmaking is complete |
completeMatchmakingTriggerScriptId | string | GS2-Script script to be executed when matchmaking is complete |
changeRatingScript | ScriptSetting | Script to be executed when the rating value changes |
joinNotification | NotificationSetting | Push notifications when new players join the Gathering |
leaveNotification | NotificationSetting | Push notification when a player leaves the Gathering |
completeNotification | NotificationSetting | Push notification when matchmaking is completed |
logSetting | LogSetting | Log output settings |
createdAt | long | Datetime of creation |
updatedAt | long | Datetime of last update |
Gathering
Gathering
An entity representing a group of game players brought together by matchmaking.
It has multiple parameters for matchmaking, and the players are grouped based on the totality of the parameters.
Type | Description | |
---|---|---|
gatheringId | string | Gathering GRN |
name | string | Gathering Name |
attributeRanges | AttributeRange[] | Terms and Conditions |
capacityOfRoles | CapacityOfRole[] | List of application limit |
allowUserIds | string[] | User ID allowed to participate |
metadata | string | metadata |
expiresAt | long | Gathering expiration date |
createdAt | long | Datetime of creation |
updatedAt | long | Datetime of last update |
RatingModelMaster
Rating Model Master
GS2 uses Glicko-2 as its rating algorithm.
Glicko-2 has several parameters, but GS2-Matchmaking aggregates them into a single parameter, volatility, which represents the totality of the parameters.
Volatility is a parameter that expresses the magnitude of change; the larger the value, the greater the change in the rating value.
Type | Description | |
---|---|---|
ratingModelId | string | Rating Model Master GRN |
name | string | Rating Model Name |
metadata | string | metadata |
description | string | description of Namespace |
volatility | int | Magnitude of rate value fluctuation |
createdAt | long | Datetime of creation |
updatedAt | long | Datetime of last update |
RatingModel
Rating Model
GS2 uses Glicko-2 as its rating algorithm.
Glicko-2 has several parameters, but GS2-Matchmaking aggregates them into a single parameter, volatility, which represents the totality of the parameters.
Volatility is a parameter that expresses the magnitude of change; the larger the value, the greater the change in the rating value.
Type | Description | |
---|---|---|
ratingModelId | string | Rating Model GRN |
name | string | Rating Model Name |
metadata | string | metadata |
volatility | int | Magnitude of rate value fluctuation |
CurrentRatingModelMaster
Currently available master data
GS2 uses JSON format files for master data management.
By uploading the file, you can actually reflect the settings on the server.
We provide a master data editor on the management console as a way to create JSON files, but you can also create JSON files using the
The service can also be used by creating a tool more appropriate for game management and exporting a JSON file in the appropriate format.
Please refer to the documentation for the format of the JSON file.
Type | Description | |
---|---|---|
namespaceId | string | Namespace GRN |
settings | string | Master data |
ScriptSetting
Type | Description | |
---|---|---|
triggerScriptId | string | Script GRN |
doneTriggerTargetType | enum ['none', 'gs2_script', 'aws'] | Notification of Completion |
doneTriggerScriptId | string | Script GRN |
doneTriggerQueueNamespaceId | string | Namespace GRN |
NotificationSetting
Type | Description | |
---|---|---|
gatewayNamespaceId | string | Namespace GRN |
enableTransferMobileNotification | bool | Forwarding to mobile push notification |
sound | string | Sound file name to be used for mobile push notifications |
LogSetting
Type | Description | |
---|---|---|
loggingNamespaceId | string | Namespace GRN |
GitHubCheckoutSetting
Type | Description | |
---|---|---|
apiKeyId | string | GitHub API key GRN |
repositoryName | string | Repository Name |
sourcePath | string | Source code file path |
referenceType | enum ['commit_hash', 'branch', 'tag'] | Source of code |
commitHash | string | Commit hash |
branchName | string | Branch Name |
tagName | string | Tag Name |
AttributeRange
Type | Description | |
---|---|---|
name | string | Attribute Name |
min | int | Minimum attribute values that can participate in the Gathering |
max | int | Maximum value of attributes that can participate in the Gathering |
CapacityOfRole
Type | Description | |
---|---|---|
roleName | string | Role Name |
roleAliases | string[] | List of Role Name Aliases |
capacity | int | Number of applicants |
participants | Player[] | List of Participant Players |
Attribute
Type | Description | |
---|---|---|
name | string | Attribute Name |
value | int | Attribute value |
Player
Type | Description | |
---|---|---|
userId | string | User Id |
attributes | Attribute[] | List of Attributes |
roleName | string | Role Name |
denyUserIds | string[] | List of user IDs that are denied participation |
Rating
Rating
An entity that holds the current rating value for each game player.
Type | Description | |
---|---|---|
ratingId | string | Rating GRN |
name | string | Rating Name |
userId | string | User Id |
rateValue | float | |
createdAt | long | Datetime of creation |
updatedAt | long | Datetime of last update |
GameResult
Type | Description | |
---|---|---|
rank | int | Rank |
userId | string | User Id |
Ballot
Type | Description | |
---|---|---|
userId | string | User Id |
ratingName | string | Rating name used for rating calculations |
gatheringName | string | Name of Gathering to be voted |
numberOfPlayer | int | Number of participants |
SignedBallot
Type | Description | |
---|---|---|
body | string | Data for ballot signature targets |
signature | string | Signature |
WrittenBallot
Type | Description | |
---|---|---|
ballot | Ballot | Ballot |
gameResults | GameResult[] | List of Results |
Vote
Type | Description | |
---|---|---|
voteId | string | Vote GRN |
ratingName | string | Rating Name |
gatheringName | string | Gathering Name |
writtenBallots | WrittenBallot[] | List of Ballots |
createdAt | long | Datetime of creation |
updatedAt | long | Datetime of last update |
TimeSpan
Type | Description | |
---|---|---|
days | int | Number of days from current time |
hours | int | Hours from current time |
minutes | int | Minutes from current time |
Methods
describeNamespaces
describeNamespaces
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/matchmaking"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := matchmaking.Gs2MatchmakingRestClient{
Session: &session,
}
result, err := client.DescribeNamespaces(
&matchmaking.DescribeNamespacesRequest {
PageToken: nil,
Limit: nil,
}
)
if err != nil {
panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\DescribeNamespacesRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->describeNamespaces(
(new DescribeNamespacesRequest())
->withPageToken(null)
->withLimit(null)
);
$items = $result->getItems();
$nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.DescribeNamespacesRequest;
import io.gs2.matchmaking.result.DescribeNamespacesResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);
try {
DescribeNamespacesResult result = client.describeNamespaces(
new DescribeNamespacesRequest()
.withPageToken(null)
.withLimit(null)
);
List<Namespace> items = result.getItems();
String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Matchmaking.Gs2MatchmakingRestClient;
using Gs2.Gs2Matchmaking.Request.DescribeNamespacesRequest;
using Gs2.Gs2Matchmaking.Result.DescribeNamespacesResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2MatchmakingRestClient(session);
AsyncResult<Gs2.Gs2Matchmaking.Result.DescribeNamespacesResult> asyncResult = null;
yield return client.DescribeNamespaces(
new Gs2.Gs2Matchmaking.Request.DescribeNamespacesRequest()
.WithPageToken(null)
.WithLimit(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Matchmaking.Gs2MatchmakingRestClient(session);
try {
const result = await client.describeNamespaces(
new Gs2Matchmaking.DescribeNamespacesRequest()
.withPageToken(null)
.withLimit(null)
);
const items = result.getItems();
const nextPageToken = result.getNextPageToken();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import matchmaking
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = matchmaking.Gs2MatchmakingRestClient(session)
try:
result = client.describe_namespaces(
matchmaking.DescribeNamespacesRequest()
.with_page_token(None)
.with_limit(None)
)
items = result.items
next_page_token = result.next_page_token
except core.Gs2Exception as e:
exit(1)
client = gs2('matchmaking')
api_result = client.describe_namespaces({
pageToken=nil,
limit=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
Get list of namespaces
Request
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
pageToken | string | ~ 1024 chars | Token specifying the position from which to start acquiring data | ||
limit | int | ✓ | 30 | 1 ~ 1000 | Number of data acquired |
Result
Type | Description | |
---|---|---|
items | Namespace[] | List of Namespace |
nextPageToken | string | Page token to retrieve the rest of the listing |
createNamespace
createNamespace
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/matchmaking"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := matchmaking.Gs2MatchmakingRestClient{
Session: &session,
}
result, err := client.CreateNamespace(
&matchmaking.CreateNamespaceRequest {
Name: pointy.String("namespace1"),
Description: nil,
EnableRating: pointy.Bool(true),
CreateGatheringTriggerType: pointy.String("none"),
CreateGatheringTriggerRealtimeNamespaceId: nil,
CreateGatheringTriggerScriptId: nil,
CompleteMatchmakingTriggerType: pointy.String("none"),
CompleteMatchmakingTriggerRealtimeNamespaceId: nil,
CompleteMatchmakingTriggerScriptId: nil,
ChangeRatingScript: nil,
JoinNotification: nil,
LeaveNotification: nil,
CompleteNotification: nil,
LogSetting: &matchmaking.LogSetting{
LoggingNamespaceId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"),
},
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\CreateNamespaceRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->createNamespace(
(new CreateNamespaceRequest())
->withName(self::namespace1)
->withDescription(null)
->withEnableRating(True)
->withCreateGatheringTriggerType("none")
->withCreateGatheringTriggerRealtimeNamespaceId(null)
->withCreateGatheringTriggerScriptId(null)
->withCompleteMatchmakingTriggerType("none")
->withCompleteMatchmakingTriggerRealtimeNamespaceId(null)
->withCompleteMatchmakingTriggerScriptId(null)
->withChangeRatingScript(null)
->withJoinNotification(null)
->withLeaveNotification(null)
->withCompleteNotification(null)
->withLogSetting((new \Gs2\Matchmaking\Model\LogSetting())
->withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"))
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.CreateNamespaceRequest;
import io.gs2.matchmaking.result.CreateNamespaceResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);
try {
CreateNamespaceResult result = client.createNamespace(
new CreateNamespaceRequest()
.withName("namespace1")
.withDescription(null)
.withEnableRating(true)
.withCreateGatheringTriggerType("none")
.withCreateGatheringTriggerRealtimeNamespaceId(null)
.withCreateGatheringTriggerScriptId(null)
.withCompleteMatchmakingTriggerType("none")
.withCompleteMatchmakingTriggerRealtimeNamespaceId(null)
.withCompleteMatchmakingTriggerScriptId(null)
.withChangeRatingScript(null)
.withJoinNotification(null)
.withLeaveNotification(null)
.withCompleteNotification(null)
.withLogSetting(new io.gs2.matchmaking.model.LogSetting()
.withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"))
);
Namespace item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Matchmaking.Gs2MatchmakingRestClient;
using Gs2.Gs2Matchmaking.Request.CreateNamespaceRequest;
using Gs2.Gs2Matchmaking.Result.CreateNamespaceResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2MatchmakingRestClient(session);
AsyncResult<Gs2.Gs2Matchmaking.Result.CreateNamespaceResult> asyncResult = null;
yield return client.CreateNamespace(
new Gs2.Gs2Matchmaking.Request.CreateNamespaceRequest()
.WithName("namespace1")
.WithDescription(null)
.WithEnableRating(true)
.WithCreateGatheringTriggerType("none")
.WithCreateGatheringTriggerRealtimeNamespaceId(null)
.WithCreateGatheringTriggerScriptId(null)
.WithCompleteMatchmakingTriggerType("none")
.WithCompleteMatchmakingTriggerRealtimeNamespaceId(null)
.WithCompleteMatchmakingTriggerScriptId(null)
.WithChangeRatingScript(null)
.WithJoinNotification(null)
.WithLeaveNotification(null)
.WithCompleteNotification(null)
.WithLogSetting(new Gs2.Gs2Matchmaking.Model.LogSetting()
.WithLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001")),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Matchmaking.Gs2MatchmakingRestClient(session);
try {
const result = await client.createNamespace(
new Gs2Matchmaking.CreateNamespaceRequest()
.withName("namespace1")
.withDescription(null)
.withEnableRating(true)
.withCreateGatheringTriggerType("none")
.withCreateGatheringTriggerRealtimeNamespaceId(null)
.withCreateGatheringTriggerScriptId(null)
.withCompleteMatchmakingTriggerType("none")
.withCompleteMatchmakingTriggerRealtimeNamespaceId(null)
.withCompleteMatchmakingTriggerScriptId(null)
.withChangeRatingScript(null)
.withJoinNotification(null)
.withLeaveNotification(null)
.withCompleteNotification(null)
.withLogSetting(new Gs2Matchmaking.model.LogSetting()
.withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"))
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import matchmaking
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = matchmaking.Gs2MatchmakingRestClient(session)
try:
result = client.create_namespace(
matchmaking.CreateNamespaceRequest()
.with_name(self.hash1)
.with_description(None)
.with_enable_rating(True)
.with_create_gathering_trigger_type('none')
.with_create_gathering_trigger_realtime_namespace_id(None)
.with_create_gathering_trigger_script_id(None)
.with_complete_matchmaking_trigger_type('none')
.with_complete_matchmaking_trigger_realtime_namespace_id(None)
.with_complete_matchmaking_trigger_script_id(None)
.with_change_rating_script(None)
.with_join_notification(None)
.with_leave_notification(None)
.with_complete_notification(None)
.with_log_setting(
matchmaking.LogSetting()
.with_logging_namespace_id('grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001'))
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('matchmaking')
api_result = client.create_namespace({
name='namespace1',
description=nil,
enableRating=true,
createGatheringTriggerType='none',
createGatheringTriggerRealtimeNamespaceId=nil,
createGatheringTriggerScriptId=nil,
completeMatchmakingTriggerType='none',
completeMatchmakingTriggerRealtimeNamespaceId=nil,
completeMatchmakingTriggerScriptId=nil,
changeRatingScript=nil,
joinNotification=nil,
leaveNotification=nil,
completeNotification=nil,
logSetting={
loggingNamespaceId='grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001',
},
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
Create a new namespace
Request
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
name | string | ✓ | ~ 32 chars | Namespace name | |
description | string | ~ 1024 chars | description of Namespace | ||
enableRating | bool | ✓ | false | Use the rating calculation function | |
createGatheringTriggerType | enum ['none', 'gs2_realtime', 'gs2_script'] | ✓ | ~ 128 chars | Action when creating a new gathering | |
createGatheringTriggerRealtimeNamespaceId | string | {createGatheringTriggerType} == "gs2_realtime" | ~ 1024 chars | GS2-Realtime namespace to create rooms when creating a gathering | |
createGatheringTriggerScriptId | string | {createGatheringTriggerType} == "gs2_script" | ~ 1024 chars | GS2-Script script to be executed when creating a gathering | |
completeMatchmakingTriggerType | enum ['none', 'gs2_realtime', 'gs2_script'] | ✓ | ~ 128 chars | Action upon completion of matchmaking | |
completeMatchmakingTriggerRealtimeNamespaceId | string | {completeMatchmakingTriggerType} == "gs2_realtime" | ~ 1024 chars | GS2-Realtime namespace to create rooms when matchmaking is complete | |
completeMatchmakingTriggerScriptId | string | {completeMatchmakingTriggerType} == "gs2_script" | ~ 1024 chars | GS2-Script script to be executed when matchmaking is complete | |
changeRatingScript | ScriptSetting | Script to be executed when the rating value changes | |||
joinNotification | NotificationSetting | Push notifications when new players join the Gathering | |||
leaveNotification | NotificationSetting | Push notification when a player leaves the Gathering | |||
completeNotification | NotificationSetting | Push notification when matchmaking is completed | |||
logSetting | LogSetting | Log output settings |
Result
Type | Description | |
---|---|---|
item | Namespace | Namespace created |
getNamespaceStatus
getNamespaceStatus
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/matchmaking"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := matchmaking.Gs2MatchmakingRestClient{
Session: &session,
}
result, err := client.GetNamespaceStatus(
&matchmaking.GetNamespaceStatusRequest {
NamespaceName: pointy.String("namespace1"),
}
)
if err != nil {
panic("error occurred")
}
status := result.Status
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\GetNamespaceStatusRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->getNamespaceStatus(
(new GetNamespaceStatusRequest())
->withNamespaceName(self::namespace1)
);
$status = $result->getStatus();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.GetNamespaceStatusRequest;
import io.gs2.matchmaking.result.GetNamespaceStatusResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);
try {
GetNamespaceStatusResult result = client.getNamespaceStatus(
new GetNamespaceStatusRequest()
.withNamespaceName("namespace1")
);
String status = result.getStatus();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Matchmaking.Gs2MatchmakingRestClient;
using Gs2.Gs2Matchmaking.Request.GetNamespaceStatusRequest;
using Gs2.Gs2Matchmaking.Result.GetNamespaceStatusResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2MatchmakingRestClient(session);
AsyncResult<Gs2.Gs2Matchmaking.Result.GetNamespaceStatusResult> asyncResult = null;
yield return client.GetNamespaceStatus(
new Gs2.Gs2Matchmaking.Request.GetNamespaceStatusRequest()
.WithNamespaceName("namespace1"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var status = result.Status;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Matchmaking.Gs2MatchmakingRestClient(session);
try {
const result = await client.getNamespaceStatus(
new Gs2Matchmaking.GetNamespaceStatusRequest()
.withNamespaceName("namespace1")
);
const status = result.getStatus();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import matchmaking
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = matchmaking.Gs2MatchmakingRestClient(session)
try:
result = client.get_namespace_status(
matchmaking.GetNamespaceStatusRequest()
.with_namespace_name(self.hash1)
)
status = result.status
except core.Gs2Exception as e:
exit(1)
client = gs2('matchmaking')
api_result = client.get_namespace_status({
namespaceName='namespace1',
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
status = result.status;
Request
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 32 chars | Namespace name |
Result
Type | Description | |
---|---|---|
status | string |
getNamespace
getNamespace
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/matchmaking"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := matchmaking.Gs2MatchmakingRestClient{
Session: &session,
}
result, err := client.GetNamespace(
&matchmaking.GetNamespaceRequest {
NamespaceName: pointy.String("namespace1"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\GetNamespaceRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->getNamespace(
(new GetNamespaceRequest())
->withNamespaceName(self::namespace1)
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.GetNamespaceRequest;
import io.gs2.matchmaking.result.GetNamespaceResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);
try {
GetNamespaceResult result = client.getNamespace(
new GetNamespaceRequest()
.withNamespaceName("namespace1")
);
Namespace item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Matchmaking.Gs2MatchmakingRestClient;
using Gs2.Gs2Matchmaking.Request.GetNamespaceRequest;
using Gs2.Gs2Matchmaking.Result.GetNamespaceResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2MatchmakingRestClient(session);
AsyncResult<Gs2.Gs2Matchmaking.Result.GetNamespaceResult> asyncResult = null;
yield return client.GetNamespace(
new Gs2.Gs2Matchmaking.Request.GetNamespaceRequest()
.WithNamespaceName("namespace1"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Matchmaking.Gs2MatchmakingRestClient(session);
try {
const result = await client.getNamespace(
new Gs2Matchmaking.GetNamespaceRequest()
.withNamespaceName("namespace1")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import matchmaking
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = matchmaking.Gs2MatchmakingRestClient(session)
try:
result = client.get_namespace(
matchmaking.GetNamespaceRequest()
.with_namespace_name(self.hash1)
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('matchmaking')
api_result = client.get_namespace({
namespaceName='namespace1',
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
Get namespace
Request
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 32 chars | Namespace name |
Result
Type | Description | |
---|---|---|
item | Namespace | Namespace |
updateNamespace
updateNamespace
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/matchmaking"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := matchmaking.Gs2MatchmakingRestClient{
Session: &session,
}
result, err := client.UpdateNamespace(
&matchmaking.UpdateNamespaceRequest {
NamespaceName: pointy.String("namespace1"),
Description: pointy.String("description1"),
EnableRating: pointy.Bool(true),
CreateGatheringTriggerType: pointy.String("none"),
CreateGatheringTriggerRealtimeNamespaceId: nil,
CreateGatheringTriggerScriptId: nil,
CompleteMatchmakingTriggerType: pointy.String("none"),
CompleteMatchmakingTriggerRealtimeNamespaceId: nil,
CompleteMatchmakingTriggerScriptId: nil,
ChangeRatingScript: nil,
JoinNotification: nil,
LeaveNotification: nil,
CompleteNotification: nil,
LogSetting: &matchmaking.LogSetting{
LoggingNamespaceId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"),
},
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\UpdateNamespaceRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->updateNamespace(
(new UpdateNamespaceRequest())
->withNamespaceName(self::namespace1)
->withDescription("description1")
->withEnableRating(True)
->withCreateGatheringTriggerType("none")
->withCreateGatheringTriggerRealtimeNamespaceId(null)
->withCreateGatheringTriggerScriptId(null)
->withCompleteMatchmakingTriggerType("none")
->withCompleteMatchmakingTriggerRealtimeNamespaceId(null)
->withCompleteMatchmakingTriggerScriptId(null)
->withChangeRatingScript(null)
->withJoinNotification(null)
->withLeaveNotification(null)
->withCompleteNotification(null)
->withLogSetting((new \Gs2\Matchmaking\Model\LogSetting())
->withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"))
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.UpdateNamespaceRequest;
import io.gs2.matchmaking.result.UpdateNamespaceResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);
try {
UpdateNamespaceResult result = client.updateNamespace(
new UpdateNamespaceRequest()
.withNamespaceName("namespace1")
.withDescription("description1")
.withEnableRating(true)
.withCreateGatheringTriggerType("none")
.withCreateGatheringTriggerRealtimeNamespaceId(null)
.withCreateGatheringTriggerScriptId(null)
.withCompleteMatchmakingTriggerType("none")
.withCompleteMatchmakingTriggerRealtimeNamespaceId(null)
.withCompleteMatchmakingTriggerScriptId(null)
.withChangeRatingScript(null)
.withJoinNotification(null)
.withLeaveNotification(null)
.withCompleteNotification(null)
.withLogSetting(new io.gs2.matchmaking.model.LogSetting()
.withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"))
);
Namespace item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Matchmaking.Gs2MatchmakingRestClient;
using Gs2.Gs2Matchmaking.Request.UpdateNamespaceRequest;
using Gs2.Gs2Matchmaking.Result.UpdateNamespaceResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2MatchmakingRestClient(session);
AsyncResult<Gs2.Gs2Matchmaking.Result.UpdateNamespaceResult> asyncResult = null;
yield return client.UpdateNamespace(
new Gs2.Gs2Matchmaking.Request.UpdateNamespaceRequest()
.WithNamespaceName("namespace1")
.WithDescription("description1")
.WithEnableRating(true)
.WithCreateGatheringTriggerType("none")
.WithCreateGatheringTriggerRealtimeNamespaceId(null)
.WithCreateGatheringTriggerScriptId(null)
.WithCompleteMatchmakingTriggerType("none")
.WithCompleteMatchmakingTriggerRealtimeNamespaceId(null)
.WithCompleteMatchmakingTriggerScriptId(null)
.WithChangeRatingScript(null)
.WithJoinNotification(null)
.WithLeaveNotification(null)
.WithCompleteNotification(null)
.WithLogSetting(new Gs2.Gs2Matchmaking.Model.LogSetting()
.WithLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001")),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Matchmaking.Gs2MatchmakingRestClient(session);
try {
const result = await client.updateNamespace(
new Gs2Matchmaking.UpdateNamespaceRequest()
.withNamespaceName("namespace1")
.withDescription("description1")
.withEnableRating(true)
.withCreateGatheringTriggerType("none")
.withCreateGatheringTriggerRealtimeNamespaceId(null)
.withCreateGatheringTriggerScriptId(null)
.withCompleteMatchmakingTriggerType("none")
.withCompleteMatchmakingTriggerRealtimeNamespaceId(null)
.withCompleteMatchmakingTriggerScriptId(null)
.withChangeRatingScript(null)
.withJoinNotification(null)
.withLeaveNotification(null)
.withCompleteNotification(null)
.withLogSetting(new Gs2Matchmaking.model.LogSetting()
.withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"))
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import matchmaking
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = matchmaking.Gs2MatchmakingRestClient(session)
try:
result = client.update_namespace(
matchmaking.UpdateNamespaceRequest()
.with_namespace_name(self.hash1)
.with_description('description1')
.with_enable_rating(True)
.with_create_gathering_trigger_type('none')
.with_create_gathering_trigger_realtime_namespace_id(None)
.with_create_gathering_trigger_script_id(None)
.with_complete_matchmaking_trigger_type('none')
.with_complete_matchmaking_trigger_realtime_namespace_id(None)
.with_complete_matchmaking_trigger_script_id(None)
.with_change_rating_script(None)
.with_join_notification(None)
.with_leave_notification(None)
.with_complete_notification(None)
.with_log_setting(
matchmaking.LogSetting()
.with_logging_namespace_id('grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001'))
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('matchmaking')
api_result = client.update_namespace({
namespaceName='namespace1',
description='description1',
enableRating=true,
createGatheringTriggerType='none',
createGatheringTriggerRealtimeNamespaceId=nil,
createGatheringTriggerScriptId=nil,
completeMatchmakingTriggerType='none',
completeMatchmakingTriggerRealtimeNamespaceId=nil,
completeMatchmakingTriggerScriptId=nil,
changeRatingScript=nil,
joinNotification=nil,
leaveNotification=nil,
completeNotification=nil,
logSetting={
loggingNamespaceId='grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001',
},
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
Update namespace
Request
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 32 chars | Namespace name | |
description | string | ~ 1024 chars | description of Namespace | ||
enableRating | bool | ✓ | false | Use the rating calculation function | |
createGatheringTriggerType | enum ['none', 'gs2_realtime', 'gs2_script'] | ✓ | ~ 128 chars | Action when creating a new gathering | |
createGatheringTriggerRealtimeNamespaceId | string | {createGatheringTriggerType} == "gs2_realtime" | ~ 1024 chars | GS2-Realtime namespace to create rooms when creating a gathering | |
createGatheringTriggerScriptId | string | {createGatheringTriggerType} == "gs2_script" | ~ 1024 chars | GS2-Script script to be executed when creating a gathering | |
completeMatchmakingTriggerType | enum ['none', 'gs2_realtime', 'gs2_script'] | ✓ | ~ 128 chars | Action upon completion of matchmaking | |
completeMatchmakingTriggerRealtimeNamespaceId | string | {completeMatchmakingTriggerType} == "gs2_realtime" | ~ 1024 chars | GS2-Realtime namespace to create rooms when matchmaking is complete | |
completeMatchmakingTriggerScriptId | string | {completeMatchmakingTriggerType} == "gs2_script" | ~ 1024 chars | GS2-Script script to be executed when matchmaking is complete | |
changeRatingScript | ScriptSetting | Script to be executed when the rating value changes | |||
joinNotification | NotificationSetting | Push notifications when new players join the Gathering | |||
leaveNotification | NotificationSetting | Push notification when a player leaves the Gathering | |||
completeNotification | NotificationSetting | Push notification when matchmaking is completed | |||
logSetting | LogSetting | Log output settings |
Result
Type | Description | |
---|---|---|
item | Namespace | Updated namespace |
deleteNamespace
deleteNamespace
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/matchmaking"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := matchmaking.Gs2MatchmakingRestClient{
Session: &session,
}
result, err := client.DeleteNamespace(
&matchmaking.DeleteNamespaceRequest {
NamespaceName: pointy.String("namespace1"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\DeleteNamespaceRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->deleteNamespace(
(new DeleteNamespaceRequest())
->withNamespaceName(self::namespace1)
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.DeleteNamespaceRequest;
import io.gs2.matchmaking.result.DeleteNamespaceResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);
try {
DeleteNamespaceResult result = client.deleteNamespace(
new DeleteNamespaceRequest()
.withNamespaceName("namespace1")
);
Namespace item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Matchmaking.Gs2MatchmakingRestClient;
using Gs2.Gs2Matchmaking.Request.DeleteNamespaceRequest;
using Gs2.Gs2Matchmaking.Result.DeleteNamespaceResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2MatchmakingRestClient(session);
AsyncResult<Gs2.Gs2Matchmaking.Result.DeleteNamespaceResult> asyncResult = null;
yield return client.DeleteNamespace(
new Gs2.Gs2Matchmaking.Request.DeleteNamespaceRequest()
.WithNamespaceName("namespace1"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Matchmaking.Gs2MatchmakingRestClient(session);
try {
const result = await client.deleteNamespace(
new Gs2Matchmaking.DeleteNamespaceRequest()
.withNamespaceName("namespace1")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import matchmaking
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = matchmaking.Gs2MatchmakingRestClient(session)
try:
result = client.delete_namespace(
matchmaking.DeleteNamespaceRequest()
.with_namespace_name(self.hash1)
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('matchmaking')
api_result = client.delete_namespace({
namespaceName='namespace1',
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
Delete namespace
Request
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 32 chars | Namespace name |
Result
Type | Description | |
---|---|---|
item | Namespace | Deleted namespace |
describeGatherings
describeGatherings
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/matchmaking"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := matchmaking.Gs2MatchmakingRestClient{
Session: &session,
}
result, err := client.DescribeGatherings(
&matchmaking.DescribeGatheringsRequest {
NamespaceName: pointy.String("namespace1"),
PageToken: nil,
Limit: nil,
}
)
if err != nil {
panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\DescribeGatheringsRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->describeGatherings(
(new DescribeGatheringsRequest())
->withNamespaceName(self::namespace1)
->withPageToken(null)
->withLimit(null)
);
$items = $result->getItems();
$nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.DescribeGatheringsRequest;
import io.gs2.matchmaking.result.DescribeGatheringsResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);
try {
DescribeGatheringsResult result = client.describeGatherings(
new DescribeGatheringsRequest()
.withNamespaceName("namespace1")
.withPageToken(null)
.withLimit(null)
);
List<Gathering> items = result.getItems();
String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Matchmaking.Gs2MatchmakingRestClient;
using Gs2.Gs2Matchmaking.Request.DescribeGatheringsRequest;
using Gs2.Gs2Matchmaking.Result.DescribeGatheringsResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2MatchmakingRestClient(session);
AsyncResult<Gs2.Gs2Matchmaking.Result.DescribeGatheringsResult> asyncResult = null;
yield return client.DescribeGatherings(
new Gs2.Gs2Matchmaking.Request.DescribeGatheringsRequest()
.WithNamespaceName("namespace1")
.WithPageToken(null)
.WithLimit(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Matchmaking.Gs2MatchmakingRestClient(session);
try {
const result = await client.describeGatherings(
new Gs2Matchmaking.DescribeGatheringsRequest()
.withNamespaceName("namespace1")
.withPageToken(null)
.withLimit(null)
);
const items = result.getItems();
const nextPageToken = result.getNextPageToken();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import matchmaking
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = matchmaking.Gs2MatchmakingRestClient(session)
try:
result = client.describe_gatherings(
matchmaking.DescribeGatheringsRequest()
.with_namespace_name(self.hash1)
.with_page_token(None)
.with_limit(None)
)
items = result.items
next_page_token = result.next_page_token
except core.Gs2Exception as e:
exit(1)
client = gs2('matchmaking')
api_result = client.describe_gatherings({
namespaceName='namespace1',
pageToken=nil,
limit=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
Get list of Gatherings
Request
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 32 chars | Namespace name | |
pageToken | string | ~ 1024 chars | Token specifying the position from which to start acquiring data | ||
limit | int | ✓ | 30 | 1 ~ 1000 | Number of data acquired |
Result
Type | Description | |
---|---|---|
items | Gathering[] | List of Gathering |
nextPageToken | string | Page token to retrieve the rest of the listing |
createGathering
createGathering
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/matchmaking"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := matchmaking.Gs2MatchmakingRestClient{
Session: &session,
}
result, err := client.CreateGathering(
&matchmaking.CreateGatheringRequest {
NamespaceName: pointy.String("namespace1"),
AccessToken: pointy.String("$access_token_0001"),
Player: &matchmaking.Player{
Attributes: []matchmaking.Attribute{
matchmaking.Attribute{
Name: pointy.String("stage"),
Value: pointy.Int32(1),
},
matchmaking.Attribute{
Name: pointy.String("level"),
Value: pointy.Int32(10),
},
},
},
AttributeRanges: []matchmaking.AttributeRange{
matchmaking.AttributeRange{
Name: pointy.String("stage"),
Min: pointy.Int32(1),
Max: pointy.Int32(1),
},
matchmaking.AttributeRange{
Name: pointy.String("level"),
Min: pointy.Int32(0),
Max: pointy.Int32(10),
},
},
CapacityOfRoles: []matchmaking.CapacityOfRole{
matchmaking.CapacityOfRole{
RoleName: pointy.String("default"),
Capacity: pointy.Int32(4),
},
},
AllowUserIds: nil,
ExpiresAt: nil,
ExpiresAtTimeSpan: nil,
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\CreateGatheringRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->createGathering(
(new CreateGatheringRequest())
->withNamespaceName(self::namespace1)
->withAccessToken(self::$accessToken0001)
->withPlayer((new \Gs2\Matchmaking\Model\Player())
->withAttributes([ (new \Gs2\Matchmaking\Model\Attribute())
->withName("stage")
->withValue(1),
(new \Gs2\Matchmaking\Model\Attribute())
->withName("level")
->withValue(10),
]))
->withAttributeRanges([ (new \Gs2\Matchmaking\Model\AttributeRange())
->withName("stage")
->withMin(1)
->withMax(1),
(new \Gs2\Matchmaking\Model\AttributeRange())
->withName("level")
->withMin(0)
->withMax(10),
])
->withCapacityOfRoles([ (new \Gs2\Matchmaking\Model\CapacityOfRole())
->withRoleName("default")
->withCapacity(4),
])
->withAllowUserIds(null)
->withExpiresAt(null)
->withExpiresAtTimeSpan(null)
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.CreateGatheringRequest;
import io.gs2.matchmaking.result.CreateGatheringResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);
try {
CreateGatheringResult result = client.createGathering(
new CreateGatheringRequest()
.withNamespaceName("namespace1")
.withAccessToken("$access_token_0001")
.withPlayer(new io.gs2.matchmaking.model.Player()
.withAttributes(Arrays.asList(
new io.gs2.matchmaking.model.Attribute()
.withName("stage")
.withValue(1),
new io.gs2.matchmaking.model.Attribute()
.withName("level")
.withValue(10)
)))
.withAttributeRanges(Arrays.asList(
new io.gs2.matchmaking.model.AttributeRange()
.withName("stage")
.withMin(1)
.withMax(1),
new io.gs2.matchmaking.model.AttributeRange()
.withName("level")
.withMin(0)
.withMax(10)
))
.withCapacityOfRoles(Arrays.asList(
new io.gs2.matchmaking.model.CapacityOfRole()
.withRoleName("default")
.withCapacity(4)
))
.withAllowUserIds(null)
.withExpiresAt(null)
.withExpiresAtTimeSpan(null)
);
Gathering item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Matchmaking.Gs2MatchmakingRestClient;
using Gs2.Gs2Matchmaking.Request.CreateGatheringRequest;
using Gs2.Gs2Matchmaking.Result.CreateGatheringResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2MatchmakingRestClient(session);
AsyncResult<Gs2.Gs2Matchmaking.Result.CreateGatheringResult> asyncResult = null;
yield return client.CreateGathering(
new Gs2.Gs2Matchmaking.Request.CreateGatheringRequest()
.WithNamespaceName("namespace1")
.WithAccessToken("$access_token_0001")
.WithPlayer(new Gs2.Gs2Matchmaking.Model.Player()
.WithAttributes(new Gs2.Gs2Matchmaking.Model.Attribute_[] {
new Gs2.Gs2Matchmaking.Model.Attribute_()
.WithName("stage")
.WithValue(1),
new Gs2.Gs2Matchmaking.Model.Attribute_()
.WithName("level")
.WithValue(10)
}))
.WithAttributeRanges(new Gs2.Gs2Matchmaking.Model.AttributeRange[] {
new Gs2.Gs2Matchmaking.Model.AttributeRange()
.WithName("stage")
.WithMin(1)
.WithMax(1),
new Gs2.Gs2Matchmaking.Model.AttributeRange()
.WithName("level")
.WithMin(0)
.WithMax(10)
})
.WithCapacityOfRoles(new Gs2.Gs2Matchmaking.Model.CapacityOfRole[] {
new Gs2.Gs2Matchmaking.Model.CapacityOfRole()
.WithRoleName("default")
.WithCapacity(4)
})
.WithAllowUserIds(null)
.WithExpiresAt(null)
.WithExpiresAtTimeSpan(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Matchmaking.Gs2MatchmakingRestClient(session);
try {
const result = await client.createGathering(
new Gs2Matchmaking.CreateGatheringRequest()
.withNamespaceName("namespace1")
.withAccessToken("$access_token_0001")
.withPlayer(new Gs2Matchmaking.model.Player()
.withAttributes([
new Gs2Matchmaking.model.Attribute()
.withName("stage")
.withValue(1),
new Gs2Matchmaking.model.Attribute()
.withName("level")
.withValue(10)
]))
.withAttributeRanges([
new Gs2Matchmaking.model.AttributeRange()
.withName("stage")
.withMin(1)
.withMax(1),
new Gs2Matchmaking.model.AttributeRange()
.withName("level")
.withMin(0)
.withMax(10)
])
.withCapacityOfRoles([
new Gs2Matchmaking.model.CapacityOfRole()
.withRoleName("default")
.withCapacity(4)
])
.withAllowUserIds(null)
.withExpiresAt(null)
.withExpiresAtTimeSpan(null)
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import matchmaking
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = matchmaking.Gs2MatchmakingRestClient(session)
try:
result = client.create_gathering(
matchmaking.CreateGatheringRequest()
.with_namespace_name(self.hash1)
.with_access_token(self.access_token_0001)
.with_player(
matchmaking.Player()
.with_attributes([ matchmaking.Attribute()
.with_name('stage')
.with_value(1),
matchmaking.Attribute()
.with_name('level')
.with_value(10),
]))
.with_attribute_ranges([ matchmaking.AttributeRange()
.with_name('stage')
.with_min(1)
.with_max(1),
matchmaking.AttributeRange()
.with_name('level')
.with_min(0)
.with_max(10),
])
.with_capacity_of_roles([ matchmaking.CapacityOfRole()
.with_role_name('default')
.with_capacity(4),
])
.with_allow_user_ids(None)
.with_expires_at(None)
.with_expires_at_time_span(None)
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('matchmaking')
api_result = client.create_gathering({
namespaceName='namespace1',
accessToken='$access_token_0001',
player={
attributes={
{
name='stage',
value=1,
},
{
name='level',
value=10,
}
},
},
attributeRanges={
{
name='stage',
min=1,
max=1,
},
{
name='level',
min=0,
max=10,
}
},
capacityOfRoles={
{
roleName='default',
capacity=4,
}
},
allowUserIds=nil,
expiresAt=nil,
expiresAtTimeSpan=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
Create a Gathering and start recruiting
The recruitment criteria
are the ranges of each attribute value that will be allowed to participate in the created gathering.
For example, if you want to recruit players who want to participate in the same game mode, you can use the following formula to matchmaking with participation criteria players whose attribute values correspond exactly to the game mode
attribute name: game mode
attribute minimum: a number representing the game mode
`attribute maximum: a number representing the game mode
to allow matchmaking between players who wish to play in the same game mode.
If you wish to implement other rating-based matchmaking, you can use the
By specifying a range of attribute values centered on the room creator's rating value, you can matchmaking between players with similar rating values.
You can update this recruitment criteria
later, so you can gradually relax the criteria.
Roles are used when you want to set the number of recruits for each role, such as 1 shield, 1 healer, 2 attackers, etc.
Roles can have aliases.
For example, a shield role can be further classified into two jobs': paladin and knight.
In this case, the game could be implemented to advertise for recruits with the role name
Shieldand the alias
PaladinKnight
.
The player then specifies their own
Job` as the role in their player information.
In this way, both paladin
and knight
can participate in a gathering where the recruiting condition is shield
.
On the other hand, if, when creating a gathering, you only want to recruit paladins
and not knights
, you can specify
This can be accomplished by specifying paladin
directly in the name of the role to be recruited, or by not including knight
in the alias.
The Number of players
in the Participants
field specifies the number of players to be recruited. By specifying role names, you can set the number of recruits for each role name.
The Participant's player info list
in Participant
is used when a party has been built among players in advance, or for recruiting additional players after a participant leaves.
Request
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 32 chars | Namespace name | |
accessToken | string | ✓ | ~ 128 chars | User Id | |
player | Player | ✓ | Own player information | ||
attributeRanges | AttributeRange[] | [] | Terms and Conditions | ||
capacityOfRoles | CapacityOfRole[] | ✓ | [] | List of application limit | |
allowUserIds | string[] | [] | User ID allowed to participate | ||
expiresAt | long | Gathering expiration date | |||
expiresAtTimeSpan | TimeSpan_ | Time to expiration |
Result
Type | Description | |
---|---|---|
item | Gathering | Created Gathering |
createGatheringByUserId
createGatheringByUserId
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/matchmaking"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := matchmaking.Gs2MatchmakingRestClient{
Session: &session,
}
result, err := client.CreateGatheringByUserId(
&matchmaking.CreateGatheringByUserIdRequest {
NamespaceName: pointy.String("namespace1"),
UserId: pointy.String("user-0001"),
Player: nil,
AttributeRanges: []matchmaking.AttributeRange{
{'name': 'stage'},
{'name': 'level'},
},
CapacityOfRoles: []matchmaking.CapacityOfRole{
{'default': 4},
},
AllowUserIds: nil,
ExpiresAt: nil,
ExpiresAtTimeSpan: nil,
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\CreateGatheringByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->createGatheringByUserId(
(new CreateGatheringByUserIdRequest())
->withNamespaceName(self::namespace1)
->withUserId("user-0001")
->withPlayer(null)
->withAttributeRanges([ {'name': 'stage'},
{'name': 'level'},
])
->withCapacityOfRoles([ {'default': 4},
])
->withAllowUserIds(null)
->withExpiresAt(null)
->withExpiresAtTimeSpan(null)
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.CreateGatheringByUserIdRequest;
import io.gs2.matchmaking.result.CreateGatheringByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);
try {
CreateGatheringByUserIdResult result = client.createGatheringByUserId(
new CreateGatheringByUserIdRequest()
.withNamespaceName("namespace1")
.withUserId("user-0001")
.withPlayer(null)
.withAttributeRanges(Arrays.asList(
{'name': 'stage'},
{'name': 'level'}
))
.withCapacityOfRoles(Arrays.asList(
{'default': 4}
))
.withAllowUserIds(null)
.withExpiresAt(null)
.withExpiresAtTimeSpan(null)
);
Gathering item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Matchmaking.Gs2MatchmakingRestClient;
using Gs2.Gs2Matchmaking.Request.CreateGatheringByUserIdRequest;
using Gs2.Gs2Matchmaking.Result.CreateGatheringByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2MatchmakingRestClient(session);
AsyncResult<Gs2.Gs2Matchmaking.Result.CreateGatheringByUserIdResult> asyncResult = null;
yield return client.CreateGatheringByUserId(
new Gs2.Gs2Matchmaking.Request.CreateGatheringByUserIdRequest()
.WithNamespaceName("namespace1")
.WithUserId("user-0001")
.WithPlayer(null)
.WithAttributeRanges(new Gs2.Gs2Matchmaking.Model.AttributeRange[] {
{'name': 'stage'},
{'name': 'level'}
})
.WithCapacityOfRoles(new Gs2.Gs2Matchmaking.Model.CapacityOfRole[] {
{'default': 4}
})
.WithAllowUserIds(null)
.WithExpiresAt(null)
.WithExpiresAtTimeSpan(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Matchmaking.Gs2MatchmakingRestClient(session);
try {
const result = await client.createGatheringByUserId(
new Gs2Matchmaking.CreateGatheringByUserIdRequest()
.withNamespaceName("namespace1")
.withUserId("user-0001")
.withPlayer(null)
.withAttributeRanges([
{'name': 'stage'},
{'name': 'level'}
])
.withCapacityOfRoles([
{'default': 4}
])
.withAllowUserIds(null)
.withExpiresAt(null)
.withExpiresAtTimeSpan(null)
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import matchmaking
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = matchmaking.Gs2MatchmakingRestClient(session)
try:
result = client.create_gathering_by_user_id(
matchmaking.CreateGatheringByUserIdRequest()
.with_namespace_name(self.hash1)
.with_user_id('user-0001')
.with_player(None)
.with_attribute_ranges([ {'name': 'stage'},
{'name': 'level'},
])
.with_capacity_of_roles([ {'default': 4},
])
.with_allow_user_ids(None)
.with_expires_at(None)
.with_expires_at_time_span(None)
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('matchmaking')
api_result = client.create_gathering_by_user_id({
namespaceName='namespace1',
userId='user-0001',
player=nil,
attributeRanges={
{'name': 'stage'},
{'name': 'level'}
},
capacityOfRoles={
{'default': 4}
},
allowUserIds=nil,
expiresAt=nil,
expiresAtTimeSpan=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
Create a Gathering by specifying a user ID and start recruiting
The recruitment criteria
are the ranges of each attribute value that will be allowed to participate in the created gathering.
For example, if you want to recruit players who want to participate in the same game mode, you can use the following formula to matchmaking with participation criteria players whose attribute values correspond exactly to the game mode
attribute name: game mode
attribute minimum: a number representing the game mode
`attribute maximum: a number representing the game mode
to allow matchmaking between players who wish to play in the same game mode.
If you wish to implement other rating-based matchmaking, you can use the
By specifying a range of attribute values centered on the room creator's rating value, you can matchmaking between players with similar rating values.
You can update this recruitment criteria
later, so you can gradually relax the criteria.
Roles are used when you want to set the number of recruits for each role, such as 1 shield, 1 healer, 2 attackers, etc.
Roles can have aliases.
For example, a shield role can be further classified into two jobs': paladin and knight.
In this case, the game could be implemented to advertise for recruits with the role name
Shieldand the alias
PaladinKnight
.
The player then specifies their own
Job` as the role in their player information.
In this way, both paladin
and knight
can participate in a gathering where the recruiting condition is shield
.
On the other hand, if, when creating a gathering, you only want to recruit paladins
and not knights
, you can specify
This can be accomplished by specifying paladin
directly in the name of the role to be recruited, or by not including knight
in the alias.
The Number of players
in the Participants
field specifies the number of players to be recruited. By specifying role names, you can set the number of recruits for each role name.
The Participant's player info list
in Participant
is used when a party has been built among players in advance, or for recruiting additional players after a participant leaves.
Request
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 32 chars | Namespace name | |
userId | string | ✓ | ~ 128 chars | User Id | |
player | Player | ✓ | Own player information | ||
attributeRanges | AttributeRange[] | [] | Terms and Conditions | ||
capacityOfRoles | CapacityOfRole[] | ✓ | [] | List of application limit | |
allowUserIds | string[] | [] | User ID allowed to participate | ||
expiresAt | long | Gathering expiration date | |||
expiresAtTimeSpan | TimeSpan_ | Time to expiration |
Result
Type | Description | |
---|---|---|
item | Gathering | Created Gathering |
updateGathering
updateGathering
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/matchmaking"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := matchmaking.Gs2MatchmakingRestClient{
Session: &session,
}
result, err := client.UpdateGathering(
&matchmaking.UpdateGatheringRequest {
NamespaceName: pointy.String("namespace1"),
GatheringName: pointy.String("$gathering1.name"),
AccessToken: pointy.String("$access_token_0001"),
AttributeRanges: []matchmaking.AttributeRange{
matchmaking.AttributeRange{
Name: pointy.String("stage"),
Min: pointy.Int32(1),
Max: pointy.Int32(1),
},
matchmaking.AttributeRange{
Name: pointy.String("level"),
Min: pointy.Int32(0),
Max: pointy.Int32(50),
},
},
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\UpdateGatheringRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->updateGathering(
(new UpdateGatheringRequest())
->withNamespaceName(self::namespace1)
->withGatheringName(self::$gathering1.name)
->withAccessToken(self::$accessToken0001)
->withAttributeRanges([ (new \Gs2\Matchmaking\Model\AttributeRange())
->withName("stage")
->withMin(1)
->withMax(1),
(new \Gs2\Matchmaking\Model\AttributeRange())
->withName("level")
->withMin(0)
->withMax(50),
])
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.UpdateGatheringRequest;
import io.gs2.matchmaking.result.UpdateGatheringResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);
try {
UpdateGatheringResult result = client.updateGathering(
new UpdateGatheringRequest()
.withNamespaceName("namespace1")
.withGatheringName("$gathering1.name")
.withAccessToken("$access_token_0001")
.withAttributeRanges(Arrays.asList(
new io.gs2.matchmaking.model.AttributeRange()
.withName("stage")
.withMin(1)
.withMax(1),
new io.gs2.matchmaking.model.AttributeRange()
.withName("level")
.withMin(0)
.withMax(50)
))
);
Gathering item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Matchmaking.Gs2MatchmakingRestClient;
using Gs2.Gs2Matchmaking.Request.UpdateGatheringRequest;
using Gs2.Gs2Matchmaking.Result.UpdateGatheringResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2MatchmakingRestClient(session);
AsyncResult<Gs2.Gs2Matchmaking.Result.UpdateGatheringResult> asyncResult = null;
yield return client.UpdateGathering(
new Gs2.Gs2Matchmaking.Request.UpdateGatheringRequest()
.WithNamespaceName("namespace1")
.WithGatheringName("$gathering1.name")
.WithAccessToken("$access_token_0001")
.WithAttributeRanges(new Gs2.Gs2Matchmaking.Model.AttributeRange[] {
new Gs2.Gs2Matchmaking.Model.AttributeRange()
.WithName("stage")
.WithMin(1)
.WithMax(1),
new Gs2.Gs2Matchmaking.Model.AttributeRange()
.WithName("level")
.WithMin(0)
.WithMax(50)
}),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Matchmaking.Gs2MatchmakingRestClient(session);
try {
const result = await client.updateGathering(
new Gs2Matchmaking.UpdateGatheringRequest()
.withNamespaceName("namespace1")
.withGatheringName("$gathering1.name")
.withAccessToken("$access_token_0001")
.withAttributeRanges([
new Gs2Matchmaking.model.AttributeRange()
.withName("stage")
.withMin(1)
.withMax(1),
new Gs2Matchmaking.model.AttributeRange()
.withName("level")
.withMin(0)
.withMax(50)
])
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import matchmaking
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = matchmaking.Gs2MatchmakingRestClient(session)
try:
result = client.update_gathering(
matchmaking.UpdateGatheringRequest()
.with_namespace_name(self.hash1)
.with_gathering_name(self.gathering1.name)
.with_access_token(self.access_token_0001)
.with_attribute_ranges([ matchmaking.AttributeRange()
.with_name('stage')
.with_min(1)
.with_max(1),
matchmaking.AttributeRange()
.with_name('level')
.with_min(0)
.with_max(50),
])
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('matchmaking')
api_result = client.update_gathering({
namespaceName='namespace1',
gatheringName='$gathering1.name',
accessToken='$access_token_0001',
attributeRanges={
{
name='stage',
min=1,
max=1,
},
{
name='level',
min=0,
max=50,
}
},
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
Update Gathering
Request
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 32 chars | Namespace name | |
gatheringName | string | ✓ | UUID | ~ 128 chars | Gathering Name |
accessToken | string | ✓ | ~ 128 chars | User Id | |
attributeRanges | AttributeRange[] | [] | Terms and Conditions |
Result
Type | Description | |
---|---|---|
item | Gathering | Updated Gathering |
updateGatheringByUserId
updateGatheringByUserId
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/matchmaking"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := matchmaking.Gs2MatchmakingRestClient{
Session: &session,
}
result, err := client.UpdateGatheringByUserId(
&matchmaking.UpdateGatheringByUserIdRequest {
NamespaceName: pointy.String("namespace1"),
GatheringName: pointy.String("gathering-0001"),
UserId: pointy.String("user-0001"),
AttributeRanges: []matchmaking.AttributeRange{
{'name': 'stage'},
{'name': 'level'},
},
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\UpdateGatheringByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->updateGatheringByUserId(
(new UpdateGatheringByUserIdRequest())
->withNamespaceName(self::namespace1)
->withGatheringName("gathering-0001")
->withUserId("user-0001")
->withAttributeRanges([ {'name': 'stage'},
{'name': 'level'},
])
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.UpdateGatheringByUserIdRequest;
import io.gs2.matchmaking.result.UpdateGatheringByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);
try {
UpdateGatheringByUserIdResult result = client.updateGatheringByUserId(
new UpdateGatheringByUserIdRequest()
.withNamespaceName("namespace1")
.withGatheringName("gathering-0001")
.withUserId("user-0001")
.withAttributeRanges(Arrays.asList(
{'name': 'stage'},
{'name': 'level'}
))
);
Gathering item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Matchmaking.Gs2MatchmakingRestClient;
using Gs2.Gs2Matchmaking.Request.UpdateGatheringByUserIdRequest;
using Gs2.Gs2Matchmaking.Result.UpdateGatheringByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2MatchmakingRestClient(session);
AsyncResult<Gs2.Gs2Matchmaking.Result.UpdateGatheringByUserIdResult> asyncResult = null;
yield return client.UpdateGatheringByUserId(
new Gs2.Gs2Matchmaking.Request.UpdateGatheringByUserIdRequest()
.WithNamespaceName("namespace1")
.WithGatheringName("gathering-0001")
.WithUserId("user-0001")
.WithAttributeRanges(new Gs2.Gs2Matchmaking.Model.AttributeRange[] {
{'name': 'stage'},
{'name': 'level'}
}),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Matchmaking.Gs2MatchmakingRestClient(session);
try {
const result = await client.updateGatheringByUserId(
new Gs2Matchmaking.UpdateGatheringByUserIdRequest()
.withNamespaceName("namespace1")
.withGatheringName("gathering-0001")
.withUserId("user-0001")
.withAttributeRanges([
{'name': 'stage'},
{'name': 'level'}
])
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import matchmaking
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = matchmaking.Gs2MatchmakingRestClient(session)
try:
result = client.update_gathering_by_user_id(
matchmaking.UpdateGatheringByUserIdRequest()
.with_namespace_name(self.hash1)
.with_gathering_name('gathering-0001')
.with_user_id('user-0001')
.with_attribute_ranges([ {'name': 'stage'},
{'name': 'level'},
])
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('matchmaking')
api_result = client.update_gathering_by_user_id({
namespaceName='namespace1',
gatheringName='gathering-0001',
userId='user-0001',
attributeRanges={
{'name': 'stage'},
{'name': 'level'}
},
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
Update Gathering with User ID
Request
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 32 chars | Namespace name | |
gatheringName | string | ✓ | UUID | ~ 128 chars | Gathering Name |
userId | string | ✓ | ~ 128 chars | User Id | |
attributeRanges | AttributeRange[] | [] | Terms and Conditions |
Result
Type | Description | |
---|---|---|
item | Gathering | Updated Gathering |
doMatchmakingByPlayer
doMatchmakingByPlayer
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/matchmaking"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := matchmaking.Gs2MatchmakingRestClient{
Session: &session,
}
result, err := client.DoMatchmakingByPlayer(
&matchmaking.DoMatchmakingByPlayerRequest {
NamespaceName: pointy.String("namespace1"),
Player: {'userId': 'user-0001', 'attributes': [{'name': 'attr1', 'value': 1}, {'name': 'attr2', 'value': 1}]},
MatchmakingContextToken: nil,
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
matchmakingContextToken := result.MatchmakingContextToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\DoMatchmakingByPlayerRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->doMatchmakingByPlayer(
(new DoMatchmakingByPlayerRequest())
->withNamespaceName(self::namespace1)
->withPlayer({'userId': 'user-0001', 'attributes': [{'name': 'attr1', 'value': 1}, {'name': 'attr2', 'value': 1}]})
->withMatchmakingContextToken(null)
);
$item = $result->getItem();
$matchmakingContextToken = $result->getMatchmakingContextToken();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.DoMatchmakingByPlayerRequest;
import io.gs2.matchmaking.result.DoMatchmakingByPlayerResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);
try {
DoMatchmakingByPlayerResult result = client.doMatchmakingByPlayer(
new DoMatchmakingByPlayerRequest()
.withNamespaceName("namespace1")
.withPlayer({'userId': 'user-0001', 'attributes': [{'name': 'attr1', 'value': 1}, {'name': 'attr2', 'value': 1}]})
.withMatchmakingContextToken(null)
);
Gathering item = result.getItem();
String matchmakingContextToken = result.getMatchmakingContextToken();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Matchmaking.Gs2MatchmakingRestClient;
using Gs2.Gs2Matchmaking.Request.DoMatchmakingByPlayerRequest;
using Gs2.Gs2Matchmaking.Result.DoMatchmakingByPlayerResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2MatchmakingRestClient(session);
AsyncResult<Gs2.Gs2Matchmaking.Result.DoMatchmakingByPlayerResult> asyncResult = null;
yield return client.DoMatchmakingByPlayer(
new Gs2.Gs2Matchmaking.Request.DoMatchmakingByPlayerRequest()
.WithNamespaceName("namespace1")
.WithPlayer({'userId': 'user-0001', 'attributes': [{'name': 'attr1', 'value': 1}, {'name': 'attr2', 'value': 1}]})
.WithMatchmakingContextToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var matchmakingContextToken = result.MatchmakingContextToken;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Matchmaking.Gs2MatchmakingRestClient(session);
try {
const result = await client.doMatchmakingByPlayer(
new Gs2Matchmaking.DoMatchmakingByPlayerRequest()
.withNamespaceName("namespace1")
.withPlayer({'userId': 'user-0001', 'attributes': [{'name': 'attr1', 'value': 1}, {'name': 'attr2', 'value': 1}]})
.withMatchmakingContextToken(null)
);
const item = result.getItem();
const matchmakingContextToken = result.getMatchmakingContextToken();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import matchmaking
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = matchmaking.Gs2MatchmakingRestClient(session)
try:
result = client.do_matchmaking_by_player(
matchmaking.DoMatchmakingByPlayerRequest()
.with_namespace_name(self.hash1)
.with_player({'userId': 'user-0001', 'attributes': [{'name': 'attr1', 'value': 1}, {'name': 'attr2', 'value': 1}]})
.with_matchmaking_context_token(None)
)
item = result.item
matchmaking_context_token = result.matchmaking_context_token
except core.Gs2Exception as e:
exit(1)
client = gs2('matchmaking')
api_result = client.do_matchmaking_by_player({
namespaceName='namespace1',
player={'userId': 'user-0001', 'attributes': [{'name': 'attr1', 'value': 1}, {'name': 'attr2', 'value': 1}]},
matchmakingContextToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
matchmakingContextToken = result.matchmakingContextToken;
Find a Gathering in which the Player can participate and join.
Search for a certain period of time and return a matchmaking status token' if the target is not found.
Next time, the search process can be resumed from the previous time by submitting a request again with a
token to keep the matchmaking status`.
When all gatherings are searched but there is no gathering to join, null is returned for both the gathering and the token.
Request
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 32 chars | Namespace name | |
player | Player | ✓ | Player Information | ||
matchmakingContextToken | string | ~ 5120 chars | Used to resume search Token that holds matchmaking state |
Result
Type | Description | |
---|---|---|
item | Gathering | Participated Gathering |
matchmakingContextToken | string | Token that preserves matchmaking status |
doMatchmaking
doMatchmaking
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/matchmaking"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := matchmaking.Gs2MatchmakingRestClient{
Session: &session,
}
result, err := client.DoMatchmaking(
&matchmaking.DoMatchmakingRequest {
NamespaceName: pointy.String("namespace1"),
AccessToken: pointy.String("$access_token_0001"),
Player: {'userId': 'user-0001', 'attributes': [{'name': 'attr1', 'value': 1}, {'name': 'attr2', 'value': 1}]},
MatchmakingContextToken: nil,
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
matchmakingContextToken := result.MatchmakingContextToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\DoMatchmakingRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->doMatchmaking(
(new DoMatchmakingRequest())
->withNamespaceName(self::namespace1)
->withAccessToken(self::$accessToken0001)
->withPlayer({'userId': 'user-0001', 'attributes': [{'name': 'attr1', 'value': 1}, {'name': 'attr2', 'value': 1}]})
->withMatchmakingContextToken(null)
);
$item = $result->getItem();
$matchmakingContextToken = $result->getMatchmakingContextToken();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.DoMatchmakingRequest;
import io.gs2.matchmaking.result.DoMatchmakingResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);
try {
DoMatchmakingResult result = client.doMatchmaking(
new DoMatchmakingRequest()
.withNamespaceName("namespace1")
.withAccessToken("$access_token_0001")
.withPlayer({'userId': 'user-0001', 'attributes': [{'name': 'attr1', 'value': 1}, {'name': 'attr2', 'value': 1}]})
.withMatchmakingContextToken(null)
);
Gathering item = result.getItem();
String matchmakingContextToken = result.getMatchmakingContextToken();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Matchmaking.Gs2MatchmakingRestClient;
using Gs2.Gs2Matchmaking.Request.DoMatchmakingRequest;
using Gs2.Gs2Matchmaking.Result.DoMatchmakingResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2MatchmakingRestClient(session);
AsyncResult<Gs2.Gs2Matchmaking.Result.DoMatchmakingResult> asyncResult = null;
yield return client.DoMatchmaking(
new Gs2.Gs2Matchmaking.Request.DoMatchmakingRequest()
.WithNamespaceName("namespace1")
.WithAccessToken("$access_token_0001")
.WithPlayer({'userId': 'user-0001', 'attributes': [{'name': 'attr1', 'value': 1}, {'name': 'attr2', 'value': 1}]})
.WithMatchmakingContextToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var matchmakingContextToken = result.MatchmakingContextToken;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Matchmaking.Gs2MatchmakingRestClient(session);
try {
const result = await client.doMatchmaking(
new Gs2Matchmaking.DoMatchmakingRequest()
.withNamespaceName("namespace1")
.withAccessToken("$access_token_0001")
.withPlayer({'userId': 'user-0001', 'attributes': [{'name': 'attr1', 'value': 1}, {'name': 'attr2', 'value': 1}]})
.withMatchmakingContextToken(null)
);
const item = result.getItem();
const matchmakingContextToken = result.getMatchmakingContextToken();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import matchmaking
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = matchmaking.Gs2MatchmakingRestClient(session)
try:
result = client.do_matchmaking(
matchmaking.DoMatchmakingRequest()
.with_namespace_name(self.hash1)
.with_access_token(self.access_token_0001)
.with_player({'userId': 'user-0001', 'attributes': [{'name': 'attr1', 'value': 1}, {'name': 'attr2', 'value': 1}]})
.with_matchmaking_context_token(None)
)
item = result.item
matchmaking_context_token = result.matchmaking_context_token
except core.Gs2Exception as e:
exit(1)
client = gs2('matchmaking')
api_result = client.do_matchmaking({
namespaceName='namespace1',
accessToken='$access_token_0001',
player={'userId': 'user-0001', 'attributes': [{'name': 'attr1', 'value': 1}, {'name': 'attr2', 'value': 1}]},
matchmakingContextToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
matchmakingContextToken = result.matchmakingContextToken;
Find a Gathering you can join and participate.
Search for a certain period of time and return a token holding matchmaking status
if no target is found.
Next time, you can resume the search process from the previous time by submitting a request again with a token to keep the matchmaking status
.
When all gatherings are searched but there is no gathering to join, null is returned for both the gathering and the token.
Request
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 32 chars | Namespace name | |
accessToken | string | ✓ | ~ 128 chars | User Id | |
player | Player | ✓ | Own player information | ||
matchmakingContextToken | string | ~ 5120 chars | Used to resume search Token that holds matchmaking state |
Result
Type | Description | |
---|---|---|
item | Gathering | Participated Gatherings |
matchmakingContextToken | string | Token that preserves matchmaking status |
doMatchmakingByUserId
doMatchmakingByUserId
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/matchmaking"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := matchmaking.Gs2MatchmakingRestClient{
Session: &session,
}
result, err := client.DoMatchmakingByUserId(
&matchmaking.DoMatchmakingByUserIdRequest {
NamespaceName: pointy.String("namespace1"),
UserId: pointy.String("user-0001"),
Player: nil,
MatchmakingContextToken: nil,
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
matchmakingContextToken := result.MatchmakingContextToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\DoMatchmakingByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->doMatchmakingByUserId(
(new DoMatchmakingByUserIdRequest())
->withNamespaceName(self::namespace1)
->withUserId("user-0001")
->withPlayer(null)
->withMatchmakingContextToken(null)
);
$item = $result->getItem();
$matchmakingContextToken = $result->getMatchmakingContextToken();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.DoMatchmakingByUserIdRequest;
import io.gs2.matchmaking.result.DoMatchmakingByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);
try {
DoMatchmakingByUserIdResult result = client.doMatchmakingByUserId(
new DoMatchmakingByUserIdRequest()
.withNamespaceName("namespace1")
.withUserId("user-0001")
.withPlayer(null)
.withMatchmakingContextToken(null)
);
Gathering item = result.getItem();
String matchmakingContextToken = result.getMatchmakingContextToken();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Matchmaking.Gs2MatchmakingRestClient;
using Gs2.Gs2Matchmaking.Request.DoMatchmakingByUserIdRequest;
using Gs2.Gs2Matchmaking.Result.DoMatchmakingByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2MatchmakingRestClient(session);
AsyncResult<Gs2.Gs2Matchmaking.Result.DoMatchmakingByUserIdResult> asyncResult = null;
yield return client.DoMatchmakingByUserId(
new Gs2.Gs2Matchmaking.Request.DoMatchmakingByUserIdRequest()
.WithNamespaceName("namespace1")
.WithUserId("user-0001")
.WithPlayer(null)
.WithMatchmakingContextToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var matchmakingContextToken = result.MatchmakingContextToken;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Matchmaking.Gs2MatchmakingRestClient(session);
try {
const result = await client.doMatchmakingByUserId(
new Gs2Matchmaking.DoMatchmakingByUserIdRequest()
.withNamespaceName("namespace1")
.withUserId("user-0001")
.withPlayer(null)
.withMatchmakingContextToken(null)
);
const item = result.getItem();
const matchmakingContextToken = result.getMatchmakingContextToken();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import matchmaking
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = matchmaking.Gs2MatchmakingRestClient(session)
try:
result = client.do_matchmaking_by_user_id(
matchmaking.DoMatchmakingByUserIdRequest()
.with_namespace_name(self.hash1)
.with_user_id('user-0001')
.with_player(None)
.with_matchmaking_context_token(None)
)
item = result.item
matchmaking_context_token = result.matchmaking_context_token
except core.Gs2Exception as e:
exit(1)
client = gs2('matchmaking')
api_result = client.do_matchmaking_by_user_id({
namespaceName='namespace1',
userId='user-0001',
player=nil,
matchmakingContextToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
matchmakingContextToken = result.matchmakingContextToken;
Find a Gathering you can join and participate.
Search for a certain period of time and return a token holding matchmaking status
if no target is found.
Next time, you can resume the search process from the previous time by submitting a request again with a token to keep the matchmaking status
.
When all gatherings are searched but there is no gathering to join, null is returned for both the gathering and the token.
Request
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 32 chars | Namespace name | |
userId | string | ✓ | ~ 128 chars | User Id | |
player | Player | ✓ | Own player information | ||
matchmakingContextToken | string | ~ 5120 chars | Used to resume search Token that holds matchmaking state |
Result
Type | Description | |
---|---|---|
item | Gathering | Participated Gatherings |
matchmakingContextToken | string | Token that preserves matchmaking status |
getGathering
getGathering
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/matchmaking"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := matchmaking.Gs2MatchmakingRestClient{
Session: &session,
}
result, err := client.GetGathering(
&matchmaking.GetGatheringRequest {
NamespaceName: pointy.String("namespace1"),
GatheringName: pointy.String("$gathering1.name"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\GetGatheringRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->getGathering(
(new GetGatheringRequest())
->withNamespaceName(self::namespace1)
->withGatheringName(self::$gathering1.name)
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.GetGatheringRequest;
import io.gs2.matchmaking.result.GetGatheringResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);
try {
GetGatheringResult result = client.getGathering(
new GetGatheringRequest()
.withNamespaceName("namespace1")
.withGatheringName("$gathering1.name")
);
Gathering item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Matchmaking.Gs2MatchmakingRestClient;
using Gs2.Gs2Matchmaking.Request.GetGatheringRequest;
using Gs2.Gs2Matchmaking.Result.GetGatheringResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2MatchmakingRestClient(session);
AsyncResult<Gs2.Gs2Matchmaking.Result.GetGatheringResult> asyncResult = null;
yield return client.GetGathering(
new Gs2.Gs2Matchmaking.Request.GetGatheringRequest()
.WithNamespaceName("namespace1")
.WithGatheringName("$gathering1.name"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Matchmaking.Gs2MatchmakingRestClient(session);
try {
const result = await client.getGathering(
new Gs2Matchmaking.GetGatheringRequest()
.withNamespaceName("namespace1")
.withGatheringName("$gathering1.name")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import matchmaking
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = matchmaking.Gs2MatchmakingRestClient(session)
try:
result = client.get_gathering(
matchmaking.GetGatheringRequest()
.with_namespace_name(self.hash1)
.with_gathering_name(self.gathering1.name)
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('matchmaking')
api_result = client.get_gathering({
namespaceName='namespace1',
gatheringName='$gathering1.name',
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
Get Gathering
Request
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 32 chars | Namespace name | |
gatheringName | string | ✓ | UUID | ~ 128 chars | Gathering Name |
Result
Type | Description | |
---|---|---|
item | Gathering | Gathering |
cancelMatchmaking
cancelMatchmaking
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/matchmaking"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := matchmaking.Gs2MatchmakingRestClient{
Session: &session,
}
result, err := client.CancelMatchmaking(
&matchmaking.CancelMatchmakingRequest {
NamespaceName: pointy.String("namespace1"),
GatheringName: pointy.String("$gathering1.name"),
AccessToken: pointy.String("$access_token_0001"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\CancelMatchmakingRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->cancelMatchmaking(
(new CancelMatchmakingRequest())
->withNamespaceName(self::namespace1)
->withGatheringName(self::$gathering1.name)
->withAccessToken(self::$accessToken0001)
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.CancelMatchmakingRequest;
import io.gs2.matchmaking.result.CancelMatchmakingResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);
try {
CancelMatchmakingResult result = client.cancelMatchmaking(
new CancelMatchmakingRequest()
.withNamespaceName("namespace1")
.withGatheringName("$gathering1.name")
.withAccessToken("$access_token_0001")
);
Gathering item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Matchmaking.Gs2MatchmakingRestClient;
using Gs2.Gs2Matchmaking.Request.CancelMatchmakingRequest;
using Gs2.Gs2Matchmaking.Result.CancelMatchmakingResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2MatchmakingRestClient(session);
AsyncResult<Gs2.Gs2Matchmaking.Result.CancelMatchmakingResult> asyncResult = null;
yield return client.CancelMatchmaking(
new Gs2.Gs2Matchmaking.Request.CancelMatchmakingRequest()
.WithNamespaceName("namespace1")
.WithGatheringName("$gathering1.name")
.WithAccessToken("$access_token_0001"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Matchmaking.Gs2MatchmakingRestClient(session);
try {
const result = await client.cancelMatchmaking(
new Gs2Matchmaking.CancelMatchmakingRequest()
.withNamespaceName("namespace1")
.withGatheringName("$gathering1.name")
.withAccessToken("$access_token_0001")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import matchmaking
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = matchmaking.Gs2MatchmakingRestClient(session)
try:
result = client.cancel_matchmaking(
matchmaking.CancelMatchmakingRequest()
.with_namespace_name(self.hash1)
.with_gathering_name(self.gathering1.name)
.with_access_token(self.access_token_0001)
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('matchmaking')
api_result = client.cancel_matchmaking({
namespaceName='namespace1',
gatheringName='$gathering1.name',
accessToken='$access_token_0001',
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
Cancel Matchmaking
If matchmaking is completed before leaving the Gathering, a NotFoundException (404 error) will be thrown and the match will fail
Request
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 32 chars | Namespace name | |
gatheringName | string | ✓ | UUID | ~ 128 chars | Gathering Name |
accessToken | string | ✓ | ~ 128 chars | User Id |
Result
Type | Description | |
---|---|---|
item | Gathering | Canceled Gathering |
cancelMatchmakingByUserId
cancelMatchmakingByUserId
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/matchmaking"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := matchmaking.Gs2MatchmakingRestClient{
Session: &session,
}
result, err := client.CancelMatchmakingByUserId(
&matchmaking.CancelMatchmakingByUserIdRequest {
NamespaceName: pointy.String("namespace1"),
GatheringName: pointy.String("gathering-0001"),
UserId: pointy.String("user-0001"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\CancelMatchmakingByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->cancelMatchmakingByUserId(
(new CancelMatchmakingByUserIdRequest())
->withNamespaceName(self::namespace1)
->withGatheringName("gathering-0001")
->withUserId("user-0001")
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.CancelMatchmakingByUserIdRequest;
import io.gs2.matchmaking.result.CancelMatchmakingByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);
try {
CancelMatchmakingByUserIdResult result = client.cancelMatchmakingByUserId(
new CancelMatchmakingByUserIdRequest()
.withNamespaceName("namespace1")
.withGatheringName("gathering-0001")
.withUserId("user-0001")
);
Gathering item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Matchmaking.Gs2MatchmakingRestClient;
using Gs2.Gs2Matchmaking.Request.CancelMatchmakingByUserIdRequest;
using Gs2.Gs2Matchmaking.Result.CancelMatchmakingByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2MatchmakingRestClient(session);
AsyncResult<Gs2.Gs2Matchmaking.Result.CancelMatchmakingByUserIdResult> asyncResult = null;
yield return client.CancelMatchmakingByUserId(
new Gs2.Gs2Matchmaking.Request.CancelMatchmakingByUserIdRequest()
.WithNamespaceName("namespace1")
.WithGatheringName("gathering-0001")
.WithUserId("user-0001"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Matchmaking.Gs2MatchmakingRestClient(session);
try {
const result = await client.cancelMatchmakingByUserId(
new Gs2Matchmaking.CancelMatchmakingByUserIdRequest()
.withNamespaceName("namespace1")
.withGatheringName("gathering-0001")
.withUserId("user-0001")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import matchmaking
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = matchmaking.Gs2MatchmakingRestClient(session)
try:
result = client.cancel_matchmaking_by_user_id(
matchmaking.CancelMatchmakingByUserIdRequest()
.with_namespace_name(self.hash1)
.with_gathering_name('gathering-0001')
.with_user_id('user-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('matchmaking')
api_result = client.cancel_matchmaking_by_user_id({
namespaceName='namespace1',
gatheringName='gathering-0001',
userId='user-0001',
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
Cancel matchmaking by specifying user ID
If matchmaking is completed before leaving the Gathering, a NotFoundException (404 error) will be thrown and the match will fail
Request
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 32 chars | Namespace name | |
gatheringName | string | ✓ | UUID | ~ 128 chars | Gathering Name |
userId | string | ✓ | ~ 128 chars | User Id |
Result
Type | Description | |
---|---|---|
item | Gathering | Canceled Gathering |
deleteGathering
deleteGathering
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/matchmaking"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := matchmaking.Gs2MatchmakingRestClient{
Session: &session,
}
result, err := client.DeleteGathering(
&matchmaking.DeleteGatheringRequest {
NamespaceName: pointy.String("namespace1"),
GatheringName: pointy.String("gathering-0001"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\DeleteGatheringRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->deleteGathering(
(new DeleteGatheringRequest())
->withNamespaceName(self::namespace1)
->withGatheringName("gathering-0001")
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.DeleteGatheringRequest;
import io.gs2.matchmaking.result.DeleteGatheringResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);
try {
DeleteGatheringResult result = client.deleteGathering(
new DeleteGatheringRequest()
.withNamespaceName("namespace1")
.withGatheringName("gathering-0001")
);
Gathering item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Matchmaking.Gs2MatchmakingRestClient;
using Gs2.Gs2Matchmaking.Request.DeleteGatheringRequest;
using Gs2.Gs2Matchmaking.Result.DeleteGatheringResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2MatchmakingRestClient(session);
AsyncResult<Gs2.Gs2Matchmaking.Result.DeleteGatheringResult> asyncResult = null;
yield return client.DeleteGathering(
new Gs2.Gs2Matchmaking.Request.DeleteGatheringRequest()
.WithNamespaceName("namespace1")
.WithGatheringName("gathering-0001"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Matchmaking.Gs2MatchmakingRestClient(session);
try {
const result = await client.deleteGathering(
new Gs2Matchmaking.DeleteGatheringRequest()
.withNamespaceName("namespace1")
.withGatheringName("gathering-0001")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import matchmaking
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = matchmaking.Gs2MatchmakingRestClient(session)
try:
result = client.delete_gathering(
matchmaking.DeleteGatheringRequest()
.with_namespace_name(self.hash1)
.with_gathering_name('gathering-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('matchmaking')
api_result = client.delete_gathering({
namespaceName='namespace1',
gatheringName='gathering-0001',
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
Delete Gathering
Request
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 32 chars | Namespace name | |
gatheringName | string | ✓ | UUID | ~ 128 chars | Gathering Name |
Result
Type | Description | |
---|---|---|
item | Gathering | Deleted Gathering |
describeRatingModelMasters
describeRatingModelMasters
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/matchmaking"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := matchmaking.Gs2MatchmakingRestClient{
Session: &session,
}
result, err := client.DescribeRatingModelMasters(
&matchmaking.DescribeRatingModelMastersRequest {
NamespaceName: pointy.String("namespace1"),
PageToken: nil,
Limit: nil,
}
)
if err != nil {
panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\DescribeRatingModelMastersRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->describeRatingModelMasters(
(new DescribeRatingModelMastersRequest())
->withNamespaceName(self::namespace1)
->withPageToken(null)
->withLimit(null)
);
$items = $result->getItems();
$nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.DescribeRatingModelMastersRequest;
import io.gs2.matchmaking.result.DescribeRatingModelMastersResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);
try {
DescribeRatingModelMastersResult result = client.describeRatingModelMasters(
new DescribeRatingModelMastersRequest()
.withNamespaceName("namespace1")
.withPageToken(null)
.withLimit(null)
);
List<RatingModelMaster> items = result.getItems();
String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Matchmaking.Gs2MatchmakingRestClient;
using Gs2.Gs2Matchmaking.Request.DescribeRatingModelMastersRequest;
using Gs2.Gs2Matchmaking.Result.DescribeRatingModelMastersResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2MatchmakingRestClient(session);
AsyncResult<Gs2.Gs2Matchmaking.Result.DescribeRatingModelMastersResult> asyncResult = null;
yield return client.DescribeRatingModelMasters(
new Gs2.Gs2Matchmaking.Request.DescribeRatingModelMastersRequest()
.WithNamespaceName("namespace1")
.WithPageToken(null)
.WithLimit(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Matchmaking.Gs2MatchmakingRestClient(session);
try {
const result = await client.describeRatingModelMasters(
new Gs2Matchmaking.DescribeRatingModelMastersRequest()
.withNamespaceName("namespace1")
.withPageToken(null)
.withLimit(null)
);
const items = result.getItems();
const nextPageToken = result.getNextPageToken();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import matchmaking
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = matchmaking.Gs2MatchmakingRestClient(session)
try:
result = client.describe_rating_model_masters(
matchmaking.DescribeRatingModelMastersRequest()
.with_namespace_name(self.hash1)
.with_page_token(None)
.with_limit(None)
)
items = result.items
next_page_token = result.next_page_token
except core.Gs2Exception as e:
exit(1)
client = gs2('matchmaking')
api_result = client.describe_rating_model_masters({
namespaceName='namespace1',
pageToken=nil,
limit=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
Get list of rating model masters
Request
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 32 chars | Namespace name | |
pageToken | string | ~ 1024 chars | Token specifying the position from which to start acquiring data | ||
limit | int | ✓ | 30 | 1 ~ 1000 | Number of data acquired |
Result
Type | Description | |
---|---|---|
items | RatingModelMaster[] | List of Rating Model Master |
nextPageToken | string | Page token to retrieve the rest of the listing |
createRatingModelMaster
createRatingModelMaster
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/matchmaking"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := matchmaking.Gs2MatchmakingRestClient{
Session: &session,
}
result, err := client.CreateRatingModelMaster(
&matchmaking.CreateRatingModelMasterRequest {
NamespaceName: pointy.String("namespace1"),
Name: pointy.String("mode1"),
Description: nil,
Metadata: nil,
Volatility: nil,
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\CreateRatingModelMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->createRatingModelMaster(
(new CreateRatingModelMasterRequest())
->withNamespaceName(self::namespace1)
->withName("mode1")
->withDescription(null)
->withMetadata(null)
->withVolatility(null)
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.CreateRatingModelMasterRequest;
import io.gs2.matchmaking.result.CreateRatingModelMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);
try {
CreateRatingModelMasterResult result = client.createRatingModelMaster(
new CreateRatingModelMasterRequest()
.withNamespaceName("namespace1")
.withName("mode1")
.withDescription(null)
.withMetadata(null)
.withVolatility(null)
);
RatingModelMaster item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Matchmaking.Gs2MatchmakingRestClient;
using Gs2.Gs2Matchmaking.Request.CreateRatingModelMasterRequest;
using Gs2.Gs2Matchmaking.Result.CreateRatingModelMasterResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2MatchmakingRestClient(session);
AsyncResult<Gs2.Gs2Matchmaking.Result.CreateRatingModelMasterResult> asyncResult = null;
yield return client.CreateRatingModelMaster(
new Gs2.Gs2Matchmaking.Request.CreateRatingModelMasterRequest()
.WithNamespaceName("namespace1")
.WithName("mode1")
.WithDescription(null)
.WithMetadata(null)
.WithVolatility(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Matchmaking.Gs2MatchmakingRestClient(session);
try {
const result = await client.createRatingModelMaster(
new Gs2Matchmaking.CreateRatingModelMasterRequest()
.withNamespaceName("namespace1")
.withName("mode1")
.withDescription(null)
.withMetadata(null)
.withVolatility(null)
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import matchmaking
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = matchmaking.Gs2MatchmakingRestClient(session)
try:
result = client.create_rating_model_master(
matchmaking.CreateRatingModelMasterRequest()
.with_namespace_name(self.hash1)
.with_name('mode1')
.with_description(None)
.with_metadata(None)
.with_volatility(None)
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('matchmaking')
api_result = client.create_rating_model_master({
namespaceName='namespace1',
name='mode1',
description=nil,
metadata=nil,
volatility=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
Create a new rating model master
Request
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 32 chars | Namespace name | |
name | string | ✓ | ~ 128 chars | Rating Model Name | |
description | string | ~ 1024 chars | description of Namespace | ||
metadata | string | ~ 128 chars | metadata | ||
volatility | int | ✓ | 100 | 1 ~ 350 | Magnitude of rate value fluctuation |
Result
Type | Description | |
---|---|---|
item | RatingModelMaster | Created rating model master |
getRatingModelMaster
getRatingModelMaster
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/matchmaking"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := matchmaking.Gs2MatchmakingRestClient{
Session: &session,
}
result, err := client.GetRatingModelMaster(
&matchmaking.GetRatingModelMasterRequest {
NamespaceName: pointy.String("namespace1"),
RatingName: pointy.String("mode1"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\GetRatingModelMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->getRatingModelMaster(
(new GetRatingModelMasterRequest())
->withNamespaceName(self::namespace1)
->withRatingName("mode1")
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.GetRatingModelMasterRequest;
import io.gs2.matchmaking.result.GetRatingModelMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);
try {
GetRatingModelMasterResult result = client.getRatingModelMaster(
new GetRatingModelMasterRequest()
.withNamespaceName("namespace1")
.withRatingName("mode1")
);
RatingModelMaster item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Matchmaking.Gs2MatchmakingRestClient;
using Gs2.Gs2Matchmaking.Request.GetRatingModelMasterRequest;
using Gs2.Gs2Matchmaking.Result.GetRatingModelMasterResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2MatchmakingRestClient(session);
AsyncResult<Gs2.Gs2Matchmaking.Result.GetRatingModelMasterResult> asyncResult = null;
yield return client.GetRatingModelMaster(
new Gs2.Gs2Matchmaking.Request.GetRatingModelMasterRequest()
.WithNamespaceName("namespace1")
.WithRatingName("mode1"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Matchmaking.Gs2MatchmakingRestClient(session);
try {
const result = await client.getRatingModelMaster(
new Gs2Matchmaking.GetRatingModelMasterRequest()
.withNamespaceName("namespace1")
.withRatingName("mode1")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import matchmaking
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = matchmaking.Gs2MatchmakingRestClient(session)
try:
result = client.get_rating_model_master(
matchmaking.GetRatingModelMasterRequest()
.with_namespace_name(self.hash1)
.with_rating_name('mode1')
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('matchmaking')
api_result = client.get_rating_model_master({
namespaceName='namespace1',
ratingName='mode1',
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
Obtain rating model master
Request
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 32 chars | Namespace name | |
ratingName | string | ✓ | ~ 128 chars | Rating Model Name |
Result
Type | Description | |
---|---|---|
item | RatingModelMaster | Rating Model Master |
updateRatingModelMaster
updateRatingModelMaster
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/matchmaking"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := matchmaking.Gs2MatchmakingRestClient{
Session: &session,
}
result, err := client.UpdateRatingModelMaster(
&matchmaking.UpdateRatingModelMasterRequest {
NamespaceName: pointy.String("namespace1"),
RatingName: pointy.String("mode1"),
Description: pointy.String("description1"),
Metadata: nil,
Volatility: pointy.Int32(50),
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\UpdateRatingModelMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->updateRatingModelMaster(
(new UpdateRatingModelMasterRequest())
->withNamespaceName(self::namespace1)
->withRatingName("mode1")
->withDescription("description1")
->withMetadata(null)
->withVolatility(50)
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.UpdateRatingModelMasterRequest;
import io.gs2.matchmaking.result.UpdateRatingModelMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);
try {
UpdateRatingModelMasterResult result = client.updateRatingModelMaster(
new UpdateRatingModelMasterRequest()
.withNamespaceName("namespace1")
.withRatingName("mode1")
.withDescription("description1")
.withMetadata(null)
.withVolatility(50)
);
RatingModelMaster item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Matchmaking.Gs2MatchmakingRestClient;
using Gs2.Gs2Matchmaking.Request.UpdateRatingModelMasterRequest;
using Gs2.Gs2Matchmaking.Result.UpdateRatingModelMasterResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2MatchmakingRestClient(session);
AsyncResult<Gs2.Gs2Matchmaking.Result.UpdateRatingModelMasterResult> asyncResult = null;
yield return client.UpdateRatingModelMaster(
new Gs2.Gs2Matchmaking.Request.UpdateRatingModelMasterRequest()
.WithNamespaceName("namespace1")
.WithRatingName("mode1")
.WithDescription("description1")
.WithMetadata(null)
.WithVolatility(50),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Matchmaking.Gs2MatchmakingRestClient(session);
try {
const result = await client.updateRatingModelMaster(
new Gs2Matchmaking.UpdateRatingModelMasterRequest()
.withNamespaceName("namespace1")
.withRatingName("mode1")
.withDescription("description1")
.withMetadata(null)
.withVolatility(50)
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import matchmaking
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = matchmaking.Gs2MatchmakingRestClient(session)
try:
result = client.update_rating_model_master(
matchmaking.UpdateRatingModelMasterRequest()
.with_namespace_name(self.hash1)
.with_rating_name('mode1')
.with_description('description1')
.with_metadata(None)
.with_volatility(50)
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('matchmaking')
api_result = client.update_rating_model_master({
namespaceName='namespace1',
ratingName='mode1',
description='description1',
metadata=nil,
volatility=50,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
Update rating model master
Request
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 32 chars | Namespace name | |
ratingName | string | ✓ | ~ 128 chars | Rating Model Name | |
description | string | ~ 1024 chars | description of Namespace | ||
metadata | string | ~ 128 chars | metadata | ||
volatility | int | ✓ | 100 | 1 ~ 350 | Magnitude of rate value fluctuation |
Result
Type | Description | |
---|---|---|
item | RatingModelMaster | Updated rating model master |
deleteRatingModelMaster
deleteRatingModelMaster
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/matchmaking"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := matchmaking.Gs2MatchmakingRestClient{
Session: &session,
}
result, err := client.DeleteRatingModelMaster(
&matchmaking.DeleteRatingModelMasterRequest {
NamespaceName: pointy.String("namespace1"),
RatingName: pointy.String("mode1"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\DeleteRatingModelMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->deleteRatingModelMaster(
(new DeleteRatingModelMasterRequest())
->withNamespaceName(self::namespace1)
->withRatingName("mode1")
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.DeleteRatingModelMasterRequest;
import io.gs2.matchmaking.result.DeleteRatingModelMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);
try {
DeleteRatingModelMasterResult result = client.deleteRatingModelMaster(
new DeleteRatingModelMasterRequest()
.withNamespaceName("namespace1")
.withRatingName("mode1")
);
RatingModelMaster item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Matchmaking.Gs2MatchmakingRestClient;
using Gs2.Gs2Matchmaking.Request.DeleteRatingModelMasterRequest;
using Gs2.Gs2Matchmaking.Result.DeleteRatingModelMasterResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2MatchmakingRestClient(session);
AsyncResult<Gs2.Gs2Matchmaking.Result.DeleteRatingModelMasterResult> asyncResult = null;
yield return client.DeleteRatingModelMaster(
new Gs2.Gs2Matchmaking.Request.DeleteRatingModelMasterRequest()
.WithNamespaceName("namespace1")
.WithRatingName("mode1"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Matchmaking.Gs2MatchmakingRestClient(session);
try {
const result = await client.deleteRatingModelMaster(
new Gs2Matchmaking.DeleteRatingModelMasterRequest()
.withNamespaceName("namespace1")
.withRatingName("mode1")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import matchmaking
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = matchmaking.Gs2MatchmakingRestClient(session)
try:
result = client.delete_rating_model_master(
matchmaking.DeleteRatingModelMasterRequest()
.with_namespace_name(self.hash1)
.with_rating_name('mode1')
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('matchmaking')
api_result = client.delete_rating_model_master({
namespaceName='namespace1',
ratingName='mode1',
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
Delete Rating Model Master
Request
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 32 chars | Namespace name | |
ratingName | string | ✓ | ~ 128 chars | Rating Model Name |
Result
Type | Description | |
---|---|---|
item | RatingModelMaster | Deleted Rating Model Master |
describeRatingModels
describeRatingModels
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/matchmaking"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := matchmaking.Gs2MatchmakingRestClient{
Session: &session,
}
result, err := client.DescribeRatingModels(
&matchmaking.DescribeRatingModelsRequest {
NamespaceName: pointy.String("namespace1"),
}
)
if err != nil {
panic("error occurred")
}
items := result.Items
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\DescribeRatingModelsRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->describeRatingModels(
(new DescribeRatingModelsRequest())
->withNamespaceName(self::namespace1)
);
$items = $result->getItems();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.DescribeRatingModelsRequest;
import io.gs2.matchmaking.result.DescribeRatingModelsResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);
try {
DescribeRatingModelsResult result = client.describeRatingModels(
new DescribeRatingModelsRequest()
.withNamespaceName("namespace1")
);
List<RatingModel> items = result.getItems();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Matchmaking.Gs2MatchmakingRestClient;
using Gs2.Gs2Matchmaking.Request.DescribeRatingModelsRequest;
using Gs2.Gs2Matchmaking.Result.DescribeRatingModelsResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2MatchmakingRestClient(session);
AsyncResult<Gs2.Gs2Matchmaking.Result.DescribeRatingModelsResult> asyncResult = null;
yield return client.DescribeRatingModels(
new Gs2.Gs2Matchmaking.Request.DescribeRatingModelsRequest()
.WithNamespaceName("namespace1"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Matchmaking.Gs2MatchmakingRestClient(session);
try {
const result = await client.describeRatingModels(
new Gs2Matchmaking.DescribeRatingModelsRequest()
.withNamespaceName("namespace1")
);
const items = result.getItems();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import matchmaking
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = matchmaking.Gs2MatchmakingRestClient(session)
try:
result = client.describe_rating_models(
matchmaking.DescribeRatingModelsRequest()
.with_namespace_name(self.hash1)
)
items = result.items
except core.Gs2Exception as e:
exit(1)
client = gs2('matchmaking')
api_result = client.describe_rating_models({
namespaceName='namespace1',
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;
Get list of rating models
Request
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 32 chars | Namespace name |
Result
Type | Description | |
---|---|---|
items | RatingModel[] | List of Rating Model |
getRatingModel
getRatingModel
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/matchmaking"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := matchmaking.Gs2MatchmakingRestClient{
Session: &session,
}
result, err := client.GetRatingModel(
&matchmaking.GetRatingModelRequest {
NamespaceName: pointy.String("namespace1"),
RatingName: pointy.String("mode1"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\GetRatingModelRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->getRatingModel(
(new GetRatingModelRequest())
->withNamespaceName(self::namespace1)
->withRatingName("mode1")
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.GetRatingModelRequest;
import io.gs2.matchmaking.result.GetRatingModelResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);
try {
GetRatingModelResult result = client.getRatingModel(
new GetRatingModelRequest()
.withNamespaceName("namespace1")
.withRatingName("mode1")
);
RatingModel item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Matchmaking.Gs2MatchmakingRestClient;
using Gs2.Gs2Matchmaking.Request.GetRatingModelRequest;
using Gs2.Gs2Matchmaking.Result.GetRatingModelResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2MatchmakingRestClient(session);
AsyncResult<Gs2.Gs2Matchmaking.Result.GetRatingModelResult> asyncResult = null;
yield return client.GetRatingModel(
new Gs2.Gs2Matchmaking.Request.GetRatingModelRequest()
.WithNamespaceName("namespace1")
.WithRatingName("mode1"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Matchmaking.Gs2MatchmakingRestClient(session);
try {
const result = await client.getRatingModel(
new Gs2Matchmaking.GetRatingModelRequest()
.withNamespaceName("namespace1")
.withRatingName("mode1")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import matchmaking
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = matchmaking.Gs2MatchmakingRestClient(session)
try:
result = client.get_rating_model(
matchmaking.GetRatingModelRequest()
.with_namespace_name(self.hash1)
.with_rating_name('mode1')
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('matchmaking')
api_result = client.get_rating_model({
namespaceName='namespace1',
ratingName='mode1',
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
Obtain rating model
Request
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 32 chars | Namespace name | |
ratingName | string | ✓ | ~ 128 chars | Rating Model Name |
Result
Type | Description | |
---|---|---|
item | RatingModel | Rating Model |
exportMaster
exportMaster
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/matchmaking"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := matchmaking.Gs2MatchmakingRestClient{
Session: &session,
}
result, err := client.ExportMaster(
&matchmaking.ExportMasterRequest {
NamespaceName: pointy.String("namespace1"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\ExportMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->exportMaster(
(new ExportMasterRequest())
->withNamespaceName(self::namespace1)
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.ExportMasterRequest;
import io.gs2.matchmaking.result.ExportMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);
try {
ExportMasterResult result = client.exportMaster(
new ExportMasterRequest()
.withNamespaceName("namespace1")
);
CurrentRatingModelMaster item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Matchmaking.Gs2MatchmakingRestClient;
using Gs2.Gs2Matchmaking.Request.ExportMasterRequest;
using Gs2.Gs2Matchmaking.Result.ExportMasterResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2MatchmakingRestClient(session);
AsyncResult<Gs2.Gs2Matchmaking.Result.ExportMasterResult> asyncResult = null;
yield return client.ExportMaster(
new Gs2.Gs2Matchmaking.Request.ExportMasterRequest()
.WithNamespaceName("namespace1"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Matchmaking.Gs2MatchmakingRestClient(session);
try {
const result = await client.exportMaster(
new Gs2Matchmaking.ExportMasterRequest()
.withNamespaceName("namespace1")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import matchmaking
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = matchmaking.Gs2MatchmakingRestClient(session)
try:
result = client.export_master(
matchmaking.ExportMasterRequest()
.with_namespace_name(self.hash1)
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('matchmaking')
api_result = client.export_master({
namespaceName='namespace1',
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
Export master data for currently available rating masters
Request
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 32 chars | Namespace name |
Result
Type | Description | |
---|---|---|
item | CurrentRatingModelMaster | Currently available rating masters |
getCurrentRatingModelMaster
getCurrentRatingModelMaster
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/matchmaking"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := matchmaking.Gs2MatchmakingRestClient{
Session: &session,
}
result, err := client.GetCurrentRatingModelMaster(
&matchmaking.GetCurrentRatingModelMasterRequest {
NamespaceName: pointy.String("namespace1"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\GetCurrentRatingModelMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->getCurrentRatingModelMaster(
(new GetCurrentRatingModelMasterRequest())
->withNamespaceName(self::namespace1)
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.GetCurrentRatingModelMasterRequest;
import io.gs2.matchmaking.result.GetCurrentRatingModelMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);
try {
GetCurrentRatingModelMasterResult result = client.getCurrentRatingModelMaster(
new GetCurrentRatingModelMasterRequest()
.withNamespaceName("namespace1")
);
CurrentRatingModelMaster item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Matchmaking.Gs2MatchmakingRestClient;
using Gs2.Gs2Matchmaking.Request.GetCurrentRatingModelMasterRequest;
using Gs2.Gs2Matchmaking.Result.GetCurrentRatingModelMasterResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2MatchmakingRestClient(session);
AsyncResult<Gs2.Gs2Matchmaking.Result.GetCurrentRatingModelMasterResult> asyncResult = null;
yield return client.GetCurrentRatingModelMaster(
new Gs2.Gs2Matchmaking.Request.GetCurrentRatingModelMasterRequest()
.WithNamespaceName("namespace1"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Matchmaking.Gs2MatchmakingRestClient(session);
try {
const result = await client.getCurrentRatingModelMaster(
new Gs2Matchmaking.GetCurrentRatingModelMasterRequest()
.withNamespaceName("namespace1")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import matchmaking
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = matchmaking.Gs2MatchmakingRestClient(session)
try:
result = client.get_current_rating_model_master(
matchmaking.GetCurrentRatingModelMasterRequest()
.with_namespace_name(self.hash1)
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('matchmaking')
api_result = client.get_current_rating_model_master({
namespaceName='namespace1',
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
Get currently available rating masters
Request
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 32 chars | Namespace name |
Result
Type | Description | |
---|---|---|
item | CurrentRatingModelMaster | Currently available rating masters |
updateCurrentRatingModelMaster
updateCurrentRatingModelMaster
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/matchmaking"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := matchmaking.Gs2MatchmakingRestClient{
Session: &session,
}
result, err := client.UpdateCurrentRatingModelMaster(
&matchmaking.UpdateCurrentRatingModelMasterRequest {
NamespaceName: pointy.String("namespace1"),
Settings: pointy.String("{\n \"version\": \"2020-06-24\",\n \"ratingModels\": [\n {\n \"name\": \"mode1\",\n \"metadata\": \"MODE1\",\n \"volatility\": 100\n },\n {\n \"name\": \"mode2\",\n \"metadata\": \"MODE2\",\n \"volatility\": 150\n }\n ]\n}"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\UpdateCurrentRatingModelMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->updateCurrentRatingModelMaster(
(new UpdateCurrentRatingModelMasterRequest())
->withNamespaceName(self::namespace1)
->withSettings("{\n \"version\": \"2020-06-24\",\n \"ratingModels\": [\n {\n \"name\": \"mode1\",\n \"metadata\": \"MODE1\",\n \"volatility\": 100\n },\n {\n \"name\": \"mode2\",\n \"metadata\": \"MODE2\",\n \"volatility\": 150\n }\n ]\n}")
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.UpdateCurrentRatingModelMasterRequest;
import io.gs2.matchmaking.result.UpdateCurrentRatingModelMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);
try {
UpdateCurrentRatingModelMasterResult result = client.updateCurrentRatingModelMaster(
new UpdateCurrentRatingModelMasterRequest()
.withNamespaceName("namespace1")
.withSettings("{\n \"version\": \"2020-06-24\",\n \"ratingModels\": [\n {\n \"name\": \"mode1\",\n \"metadata\": \"MODE1\",\n \"volatility\": 100\n },\n {\n \"name\": \"mode2\",\n \"metadata\": \"MODE2\",\n \"volatility\": 150\n }\n ]\n}")
);
CurrentRatingModelMaster item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Matchmaking.Gs2MatchmakingRestClient;
using Gs2.Gs2Matchmaking.Request.UpdateCurrentRatingModelMasterRequest;
using Gs2.Gs2Matchmaking.Result.UpdateCurrentRatingModelMasterResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2MatchmakingRestClient(session);
AsyncResult<Gs2.Gs2Matchmaking.Result.UpdateCurrentRatingModelMasterResult> asyncResult = null;
yield return client.UpdateCurrentRatingModelMaster(
new Gs2.Gs2Matchmaking.Request.UpdateCurrentRatingModelMasterRequest()
.WithNamespaceName("namespace1")
.WithSettings("{\n \"version\": \"2020-06-24\",\n \"ratingModels\": [\n {\n \"name\": \"mode1\",\n \"metadata\": \"MODE1\",\n \"volatility\": 100\n },\n {\n \"name\": \"mode2\",\n \"metadata\": \"MODE2\",\n \"volatility\": 150\n }\n ]\n}"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Matchmaking.Gs2MatchmakingRestClient(session);
try {
const result = await client.updateCurrentRatingModelMaster(
new Gs2Matchmaking.UpdateCurrentRatingModelMasterRequest()
.withNamespaceName("namespace1")
.withSettings("{\n \"version\": \"2020-06-24\",\n \"ratingModels\": [\n {\n \"name\": \"mode1\",\n \"metadata\": \"MODE1\",\n \"volatility\": 100\n },\n {\n \"name\": \"mode2\",\n \"metadata\": \"MODE2\",\n \"volatility\": 150\n }\n ]\n}")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import matchmaking
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = matchmaking.Gs2MatchmakingRestClient(session)
try:
result = client.update_current_rating_model_master(
matchmaking.UpdateCurrentRatingModelMasterRequest()
.with_namespace_name(self.hash1)
.with_settings('{\n "version": "2020-06-24",\n "ratingModels": [\n {\n "name": "mode1",\n "metadata": "MODE1",\n "volatility": 100\n },\n {\n "name": "mode2",\n "metadata": "MODE2",\n "volatility": 150\n }\n ]\n}')
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('matchmaking')
api_result = client.update_current_rating_model_master({
namespaceName='namespace1',
settings='{\n "version": "2020-06-24",\n "ratingModels": [\n {\n "name": "mode1",\n "metadata": "MODE1",\n "volatility": 100\n },\n {\n "name": "mode2",\n "metadata": "MODE2",\n "volatility": 150\n }\n ]\n}',
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
Update and currently available rating master
Request
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 32 chars | Namespace name | |
settings | string | ✓ | ~ 5242880 chars | Master data |
Result
Type | Description | |
---|---|---|
item | CurrentRatingModelMaster | Updated and currently available rating master |
updateCurrentRatingModelMasterFromGitHub
updateCurrentRatingModelMasterFromGitHub
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/matchmaking"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := matchmaking.Gs2MatchmakingRestClient{
Session: &session,
}
result, err := client.UpdateCurrentRatingModelMasterFromGitHub(
&matchmaking.UpdateCurrentRatingModelMasterFromGitHubRequest {
NamespaceName: pointy.String("namespace1"),
CheckoutSetting: {'apiKeyId': '$gitHubApiKey1.apiKeyId', 'repositoryName': 'gs2io/master-data', 'sourcePath': 'path/to/file.json', 'referenceType': 'branch', 'branchName': 'develop'},
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\UpdateCurrentRatingModelMasterFromGitHubRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->updateCurrentRatingModelMasterFromGitHub(
(new UpdateCurrentRatingModelMasterFromGitHubRequest())
->withNamespaceName(self::namespace1)
->withCheckoutSetting({'apiKeyId': '$gitHubApiKey1.apiKeyId', 'repositoryName': 'gs2io/master-data', 'sourcePath': 'path/to/file.json', 'referenceType': 'branch', 'branchName': 'develop'})
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.UpdateCurrentRatingModelMasterFromGitHubRequest;
import io.gs2.matchmaking.result.UpdateCurrentRatingModelMasterFromGitHubResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);
try {
UpdateCurrentRatingModelMasterFromGitHubResult result = client.updateCurrentRatingModelMasterFromGitHub(
new UpdateCurrentRatingModelMasterFromGitHubRequest()
.withNamespaceName("namespace1")
.withCheckoutSetting({'apiKeyId': '$gitHubApiKey1.apiKeyId', 'repositoryName': 'gs2io/master-data', 'sourcePath': 'path/to/file.json', 'referenceType': 'branch', 'branchName': 'develop'})
);
CurrentRatingModelMaster item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Matchmaking.Gs2MatchmakingRestClient;
using Gs2.Gs2Matchmaking.Request.UpdateCurrentRatingModelMasterFromGitHubRequest;
using Gs2.Gs2Matchmaking.Result.UpdateCurrentRatingModelMasterFromGitHubResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2MatchmakingRestClient(session);
AsyncResult<Gs2.Gs2Matchmaking.Result.UpdateCurrentRatingModelMasterFromGitHubResult> asyncResult = null;
yield return client.UpdateCurrentRatingModelMasterFromGitHub(
new Gs2.Gs2Matchmaking.Request.UpdateCurrentRatingModelMasterFromGitHubRequest()
.WithNamespaceName("namespace1")
.WithCheckoutSetting({'apiKeyId': '$gitHubApiKey1.apiKeyId', 'repositoryName': 'gs2io/master-data', 'sourcePath': 'path/to/file.json', 'referenceType': 'branch', 'branchName': 'develop'}),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Matchmaking.Gs2MatchmakingRestClient(session);
try {
const result = await client.updateCurrentRatingModelMasterFromGitHub(
new Gs2Matchmaking.UpdateCurrentRatingModelMasterFromGitHubRequest()
.withNamespaceName("namespace1")
.withCheckoutSetting({'apiKeyId': '$gitHubApiKey1.apiKeyId', 'repositoryName': 'gs2io/master-data', 'sourcePath': 'path/to/file.json', 'referenceType': 'branch', 'branchName': 'develop'})
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import matchmaking
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = matchmaking.Gs2MatchmakingRestClient(session)
try:
result = client.update_current_rating_model_master_from_git_hub(
matchmaking.UpdateCurrentRatingModelMasterFromGitHubRequest()
.with_namespace_name(self.hash1)
.with_checkout_setting({'apiKeyId': '$gitHubApiKey1.apiKeyId', 'repositoryName': 'gs2io/master-data', 'sourcePath': 'path/to/file.json', 'referenceType': 'branch', 'branchName': 'develop'})
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('matchmaking')
api_result = client.update_current_rating_model_master_from_git_hub({
namespaceName='namespace1',
checkoutSetting={'apiKeyId': '$gitHubApiKey1.apiKeyId', 'repositoryName': 'gs2io/master-data', 'sourcePath': 'path/to/file.json', 'referenceType': 'branch', 'branchName': 'develop'},
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
Update and currently available rating master
Request
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 32 chars | Namespace name | |
checkoutSetting | GitHubCheckoutSetting | ✓ | Setup to check out master data from GitHub |
Result
Type | Description | |
---|---|---|
item | CurrentRatingModelMaster | Updated and currently available rating master |
describeRatings
describeRatings
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/matchmaking"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := matchmaking.Gs2MatchmakingRestClient{
Session: &session,
}
result, err := client.DescribeRatings(
&matchmaking.DescribeRatingsRequest {
NamespaceName: pointy.String("namespace1"),
AccessToken: pointy.String("$access_token_0001"),
PageToken: nil,
Limit: nil,
}
)
if err != nil {
panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\DescribeRatingsRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->describeRatings(
(new DescribeRatingsRequest())
->withNamespaceName(self::namespace1)
->withAccessToken(self::$accessToken0001)
->withPageToken(null)
->withLimit(null)
);
$items = $result->getItems();
$nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.DescribeRatingsRequest;
import io.gs2.matchmaking.result.DescribeRatingsResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);
try {
DescribeRatingsResult result = client.describeRatings(
new DescribeRatingsRequest()
.withNamespaceName("namespace1")
.withAccessToken("$access_token_0001")
.withPageToken(null)
.withLimit(null)
);
List<Rating> items = result.getItems();
String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Matchmaking.Gs2MatchmakingRestClient;
using Gs2.Gs2Matchmaking.Request.DescribeRatingsRequest;
using Gs2.Gs2Matchmaking.Result.DescribeRatingsResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2MatchmakingRestClient(session);
AsyncResult<Gs2.Gs2Matchmaking.Result.DescribeRatingsResult> asyncResult = null;
yield return client.DescribeRatings(
new Gs2.Gs2Matchmaking.Request.DescribeRatingsRequest()
.WithNamespaceName("namespace1")
.WithAccessToken("$access_token_0001")
.WithPageToken(null)
.WithLimit(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Matchmaking.Gs2MatchmakingRestClient(session);
try {
const result = await client.describeRatings(
new Gs2Matchmaking.DescribeRatingsRequest()
.withNamespaceName("namespace1")
.withAccessToken("$access_token_0001")
.withPageToken(null)
.withLimit(null)
);
const items = result.getItems();
const nextPageToken = result.getNextPageToken();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import matchmaking
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = matchmaking.Gs2MatchmakingRestClient(session)
try:
result = client.describe_ratings(
matchmaking.DescribeRatingsRequest()
.with_namespace_name(self.hash1)
.with_access_token(self.access_token_0001)
.with_page_token(None)
.with_limit(None)
)
items = result.items
next_page_token = result.next_page_token
except core.Gs2Exception as e:
exit(1)
client = gs2('matchmaking')
api_result = client.describe_ratings({
namespaceName='namespace1',
accessToken='$access_token_0001',
pageToken=nil,
limit=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
Get list of ratings
Request
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 32 chars | Namespace name | |
accessToken | string | ✓ | ~ 128 chars | User Id | |
pageToken | string | ~ 1024 chars | Token specifying the position from which to start acquiring data | ||
limit | int | ✓ | 30 | 1 ~ 1000 | Number of data acquired |
Result
Type | Description | |
---|---|---|
items | Rating[] | List of Rating |
nextPageToken | string | Page token to retrieve the rest of the listing |
describeRatingsByUserId
describeRatingsByUserId
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/matchmaking"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := matchmaking.Gs2MatchmakingRestClient{
Session: &session,
}
result, err := client.DescribeRatingsByUserId(
&matchmaking.DescribeRatingsByUserIdRequest {
NamespaceName: pointy.String("namespace1"),
UserId: pointy.String("user-0001"),
PageToken: nil,
Limit: nil,
}
)
if err != nil {
panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\DescribeRatingsByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->describeRatingsByUserId(
(new DescribeRatingsByUserIdRequest())
->withNamespaceName(self::namespace1)
->withUserId("user-0001")
->withPageToken(null)
->withLimit(null)
);
$items = $result->getItems();
$nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.DescribeRatingsByUserIdRequest;
import io.gs2.matchmaking.result.DescribeRatingsByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);
try {
DescribeRatingsByUserIdResult result = client.describeRatingsByUserId(
new DescribeRatingsByUserIdRequest()
.withNamespaceName("namespace1")
.withUserId("user-0001")
.withPageToken(null)
.withLimit(null)
);
List<Rating> items = result.getItems();
String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Matchmaking.Gs2MatchmakingRestClient;
using Gs2.Gs2Matchmaking.Request.DescribeRatingsByUserIdRequest;
using Gs2.Gs2Matchmaking.Result.DescribeRatingsByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2MatchmakingRestClient(session);
AsyncResult<Gs2.Gs2Matchmaking.Result.DescribeRatingsByUserIdResult> asyncResult = null;
yield return client.DescribeRatingsByUserId(
new Gs2.Gs2Matchmaking.Request.DescribeRatingsByUserIdRequest()
.WithNamespaceName("namespace1")
.WithUserId("user-0001")
.WithPageToken(null)
.WithLimit(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Matchmaking.Gs2MatchmakingRestClient(session);
try {
const result = await client.describeRatingsByUserId(
new Gs2Matchmaking.DescribeRatingsByUserIdRequest()
.withNamespaceName("namespace1")
.withUserId("user-0001")
.withPageToken(null)
.withLimit(null)
);
const items = result.getItems();
const nextPageToken = result.getNextPageToken();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import matchmaking
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = matchmaking.Gs2MatchmakingRestClient(session)
try:
result = client.describe_ratings_by_user_id(
matchmaking.DescribeRatingsByUserIdRequest()
.with_namespace_name(self.hash1)
.with_user_id('user-0001')
.with_page_token(None)
.with_limit(None)
)
items = result.items
next_page_token = result.next_page_token
except core.Gs2Exception as e:
exit(1)
client = gs2('matchmaking')
api_result = client.describe_ratings_by_user_id({
namespaceName='namespace1',
userId='user-0001',
pageToken=nil,
limit=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
Obtain list of ratings by specifying a user ID
Request
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 32 chars | Namespace name | |
userId | string | ✓ | ~ 128 chars | User Id | |
pageToken | string | ~ 1024 chars | Token specifying the position from which to start acquiring data | ||
limit | int | ✓ | 30 | 1 ~ 1000 | Number of data acquired |
Result
Type | Description | |
---|---|---|
items | Rating[] | List of Rating |
nextPageToken | string | Page token to retrieve the rest of the listing |
getRating
getRating
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/matchmaking"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := matchmaking.Gs2MatchmakingRestClient{
Session: &session,
}
result, err := client.GetRating(
&matchmaking.GetRatingRequest {
NamespaceName: pointy.String("namespace1"),
AccessToken: pointy.String("$access_token_0001"),
RatingName: pointy.String("rating-0001"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\GetRatingRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->getRating(
(new GetRatingRequest())
->withNamespaceName(self::namespace1)
->withAccessToken(self::$accessToken0001)
->withRatingName("rating-0001")
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.GetRatingRequest;
import io.gs2.matchmaking.result.GetRatingResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);
try {
GetRatingResult result = client.getRating(
new GetRatingRequest()
.withNamespaceName("namespace1")
.withAccessToken("$access_token_0001")
.withRatingName("rating-0001")
);
Rating item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Matchmaking.Gs2MatchmakingRestClient;
using Gs2.Gs2Matchmaking.Request.GetRatingRequest;
using Gs2.Gs2Matchmaking.Result.GetRatingResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2MatchmakingRestClient(session);
AsyncResult<Gs2.Gs2Matchmaking.Result.GetRatingResult> asyncResult = null;
yield return client.GetRating(
new Gs2.Gs2Matchmaking.Request.GetRatingRequest()
.WithNamespaceName("namespace1")
.WithAccessToken("$access_token_0001")
.WithRatingName("rating-0001"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Matchmaking.Gs2MatchmakingRestClient(session);
try {
const result = await client.getRating(
new Gs2Matchmaking.GetRatingRequest()
.withNamespaceName("namespace1")
.withAccessToken("$access_token_0001")
.withRatingName("rating-0001")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import matchmaking
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = matchmaking.Gs2MatchmakingRestClient(session)
try:
result = client.get_rating(
matchmaking.GetRatingRequest()
.with_namespace_name(self.hash1)
.with_access_token(self.access_token_0001)
.with_rating_name('rating-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('matchmaking')
api_result = client.get_rating({
namespaceName='namespace1',
accessToken='$access_token_0001',
ratingName='rating-0001',
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
Get Rating
Request
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 32 chars | Namespace name | |
accessToken | string | ✓ | ~ 128 chars | User Id | |
ratingName | string | ✓ | ~ 128 chars | Rating Name |
Result
Type | Description | |
---|---|---|
item | Rating | Rating |
getRatingByUserId
getRatingByUserId
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/matchmaking"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := matchmaking.Gs2MatchmakingRestClient{
Session: &session,
}
result, err := client.GetRatingByUserId(
&matchmaking.GetRatingByUserIdRequest {
NamespaceName: pointy.String("namespace1"),
UserId: pointy.String("user-0001"),
RatingName: pointy.String("rating-0001"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\GetRatingByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->getRatingByUserId(
(new GetRatingByUserIdRequest())
->withNamespaceName(self::namespace1)
->withUserId("user-0001")
->withRatingName("rating-0001")
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.GetRatingByUserIdRequest;
import io.gs2.matchmaking.result.GetRatingByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);
try {
GetRatingByUserIdResult result = client.getRatingByUserId(
new GetRatingByUserIdRequest()
.withNamespaceName("namespace1")
.withUserId("user-0001")
.withRatingName("rating-0001")
);
Rating item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Matchmaking.Gs2MatchmakingRestClient;
using Gs2.Gs2Matchmaking.Request.GetRatingByUserIdRequest;
using Gs2.Gs2Matchmaking.Result.GetRatingByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2MatchmakingRestClient(session);
AsyncResult<Gs2.Gs2Matchmaking.Result.GetRatingByUserIdResult> asyncResult = null;
yield return client.GetRatingByUserId(
new Gs2.Gs2Matchmaking.Request.GetRatingByUserIdRequest()
.WithNamespaceName("namespace1")
.WithUserId("user-0001")
.WithRatingName("rating-0001"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Matchmaking.Gs2MatchmakingRestClient(session);
try {
const result = await client.getRatingByUserId(
new Gs2Matchmaking.GetRatingByUserIdRequest()
.withNamespaceName("namespace1")
.withUserId("user-0001")
.withRatingName("rating-0001")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import matchmaking
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = matchmaking.Gs2MatchmakingRestClient(session)
try:
result = client.get_rating_by_user_id(
matchmaking.GetRatingByUserIdRequest()
.with_namespace_name(self.hash1)
.with_user_id('user-0001')
.with_rating_name('rating-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('matchmaking')
api_result = client.get_rating_by_user_id({
namespaceName='namespace1',
userId='user-0001',
ratingName='rating-0001',
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
Obtain rating by specifying user IDs
Request
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 32 chars | Namespace name | |
userId | string | ✓ | ~ 128 chars | User Id | |
ratingName | string | ✓ | ~ 128 chars | Rating Name |
Result
Type | Description | |
---|---|---|
item | Rating | Rating |
putResult
putResult
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/matchmaking"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := matchmaking.Gs2MatchmakingRestClient{
Session: &session,
}
result, err := client.PutResult(
&matchmaking.PutResultRequest {
NamespaceName: pointy.String("namespace1"),
RatingName: pointy.String("rating-0001"),
GameResults: []matchmaking.GameResult{
{'rank': 1, 'userId': 'user-0001'},
{'rank': 2, 'userId': 'user-0002'},
{'rank': 2, 'userId': 'user-0003'},
{'rank': 3, 'userId': 'user-0004'},
},
}
)
if err != nil {
panic("error occurred")
}
items := result.Items
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\PutResultRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->putResult(
(new PutResultRequest())
->withNamespaceName(self::namespace1)
->withRatingName("rating-0001")
->withGameResults([ {'rank': 1, 'userId': 'user-0001'},
{'rank': 2, 'userId': 'user-0002'},
{'rank': 2, 'userId': 'user-0003'},
{'rank': 3, 'userId': 'user-0004'},
])
);
$items = $result->getItems();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.PutResultRequest;
import io.gs2.matchmaking.result.PutResultResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);
try {
PutResultResult result = client.putResult(
new PutResultRequest()
.withNamespaceName("namespace1")
.withRatingName("rating-0001")
.withGameResults(Arrays.asList(
{'rank': 1, 'userId': 'user-0001'},
{'rank': 2, 'userId': 'user-0002'},
{'rank': 2, 'userId': 'user-0003'},
{'rank': 3, 'userId': 'user-0004'}
))
);
List<Rating> items = result.getItems();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Matchmaking.Gs2MatchmakingRestClient;
using Gs2.Gs2Matchmaking.Request.PutResultRequest;
using Gs2.Gs2Matchmaking.Result.PutResultResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2MatchmakingRestClient(session);
AsyncResult<Gs2.Gs2Matchmaking.Result.PutResultResult> asyncResult = null;
yield return client.PutResult(
new Gs2.Gs2Matchmaking.Request.PutResultRequest()
.WithNamespaceName("namespace1")
.WithRatingName("rating-0001")
.WithGameResults(new Gs2.Gs2Matchmaking.Model.GameResult[] {
{'rank': 1, 'userId': 'user-0001'},
{'rank': 2, 'userId': 'user-0002'},
{'rank': 2, 'userId': 'user-0003'},
{'rank': 3, 'userId': 'user-0004'}
}),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Matchmaking.Gs2MatchmakingRestClient(session);
try {
const result = await client.putResult(
new Gs2Matchmaking.PutResultRequest()
.withNamespaceName("namespace1")
.withRatingName("rating-0001")
.withGameResults([
{'rank': 1, 'userId': 'user-0001'},
{'rank': 2, 'userId': 'user-0002'},
{'rank': 2, 'userId': 'user-0003'},
{'rank': 3, 'userId': 'user-0004'}
])
);
const items = result.getItems();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import matchmaking
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = matchmaking.Gs2MatchmakingRestClient(session)
try:
result = client.put_result(
matchmaking.PutResultRequest()
.with_namespace_name(self.hash1)
.with_rating_name('rating-0001')
.with_game_results([ {'rank': 1, 'userId': 'user-0001'},
{'rank': 2, 'userId': 'user-0002'},
{'rank': 2, 'userId': 'user-0003'},
{'rank': 3, 'userId': 'user-0004'},
])
)
items = result.items
except core.Gs2Exception as e:
exit(1)
client = gs2('matchmaking')
api_result = client.put_result({
namespaceName='namespace1',
ratingName='rating-0001',
gameResults={
{'rank': 1, 'userId': 'user-0001'},
{'rank': 2, 'userId': 'user-0002'},
{'rank': 2, 'userId': 'user-0003'},
{'rank': 3, 'userId': 'user-0004'}
},
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;
Recalculate rating values
The rating calculation process uses a calculation algorithm based on the Glicko-2 rating system.
The initial rating value is 1500, and the more a player wins against a distant opponent, the greater the increase in rating value, and the greater the decrease in rating value for the losing side.
The rating calculation requires list of participating user IDs.
Therefore, it is not appropriate to call this API directly from the client. It should be called from the game server, which can determine whether the game has been won or lost.
If a client-driven game, such as a P2P game, is being realized, please use the voting function to determine the winner.
Request
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 32 chars | Namespace name | |
ratingName | string | ✓ | ~ 128 chars | Rating Name | |
gameResults | GameResult[] | List of Results |
Result
Type | Description | |
---|---|---|
items | Rating[] | List of Updated Rating |
deleteRating
deleteRating
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/matchmaking"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := matchmaking.Gs2MatchmakingRestClient{
Session: &session,
}
result, err := client.DeleteRating(
&matchmaking.DeleteRatingRequest {
NamespaceName: pointy.String("namespace1"),
UserId: pointy.String("user-0001"),
RatingName: pointy.String("rating-0001"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\DeleteRatingRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->deleteRating(
(new DeleteRatingRequest())
->withNamespaceName(self::namespace1)
->withUserId("user-0001")
->withRatingName("rating-0001")
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.DeleteRatingRequest;
import io.gs2.matchmaking.result.DeleteRatingResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);
try {
DeleteRatingResult result = client.deleteRating(
new DeleteRatingRequest()
.withNamespaceName("namespace1")
.withUserId("user-0001")
.withRatingName("rating-0001")
);
Rating item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Matchmaking.Gs2MatchmakingRestClient;
using Gs2.Gs2Matchmaking.Request.DeleteRatingRequest;
using Gs2.Gs2Matchmaking.Result.DeleteRatingResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2MatchmakingRestClient(session);
AsyncResult<Gs2.Gs2Matchmaking.Result.DeleteRatingResult> asyncResult = null;
yield return client.DeleteRating(
new Gs2.Gs2Matchmaking.Request.DeleteRatingRequest()
.WithNamespaceName("namespace1")
.WithUserId("user-0001")
.WithRatingName("rating-0001"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Matchmaking.Gs2MatchmakingRestClient(session);
try {
const result = await client.deleteRating(
new Gs2Matchmaking.DeleteRatingRequest()
.withNamespaceName("namespace1")
.withUserId("user-0001")
.withRatingName("rating-0001")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import matchmaking
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = matchmaking.Gs2MatchmakingRestClient(session)
try:
result = client.delete_rating(
matchmaking.DeleteRatingRequest()
.with_namespace_name(self.hash1)
.with_user_id('user-0001')
.with_rating_name('rating-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('matchmaking')
api_result = client.delete_rating({
namespaceName='namespace1',
userId='user-0001',
ratingName='rating-0001',
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
Delete Rating
Request
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 32 chars | Namespace name | |
userId | string | ✓ | ~ 128 chars | User Id | |
ratingName | string | ✓ | ~ 128 chars | Rating Name |
Result
Type | Description | |
---|---|---|
item | Rating | Deleted Rating |
getBallot
getBallot
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/matchmaking"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := matchmaking.Gs2MatchmakingRestClient{
Session: &session,
}
result, err := client.GetBallot(
&matchmaking.GetBallotRequest {
NamespaceName: pointy.String("namespace1"),
RatingName: pointy.String("rating-0001"),
GatheringName: pointy.String("gathering-0001"),
AccessToken: pointy.String("$access_token_0001"),
NumberOfPlayer: pointy.Int32(4),
KeyId: pointy.String("$key1.keyId"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
body := result.Body
signature := result.Signature
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\GetBallotRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->getBallot(
(new GetBallotRequest())
->withNamespaceName(self::namespace1)
->withRatingName("rating-0001")
->withGatheringName("gathering-0001")
->withAccessToken(self::$accessToken0001)
->withNumberOfPlayer(4)
->withKeyId(self::$key1.keyId)
);
$item = $result->getItem();
$body = $result->getBody();
$signature = $result->getSignature();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.GetBallotRequest;
import io.gs2.matchmaking.result.GetBallotResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);
try {
GetBallotResult result = client.getBallot(
new GetBallotRequest()
.withNamespaceName("namespace1")
.withRatingName("rating-0001")
.withGatheringName("gathering-0001")
.withAccessToken("$access_token_0001")
.withNumberOfPlayer(4)
.withKeyId("$key1.keyId")
);
Ballot item = result.getItem();
String body = result.getBody();
String signature = result.getSignature();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Matchmaking.Gs2MatchmakingRestClient;
using Gs2.Gs2Matchmaking.Request.GetBallotRequest;
using Gs2.Gs2Matchmaking.Result.GetBallotResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2MatchmakingRestClient(session);
AsyncResult<Gs2.Gs2Matchmaking.Result.GetBallotResult> asyncResult = null;
yield return client.GetBallot(
new Gs2.Gs2Matchmaking.Request.GetBallotRequest()
.WithNamespaceName("namespace1")
.WithRatingName("rating-0001")
.WithGatheringName("gathering-0001")
.WithAccessToken("$access_token_0001")
.WithNumberOfPlayer(4)
.WithKeyId("$key1.keyId"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var body = result.Body;
var signature = result.Signature;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Matchmaking.Gs2MatchmakingRestClient(session);
try {
const result = await client.getBallot(
new Gs2Matchmaking.GetBallotRequest()
.withNamespaceName("namespace1")
.withRatingName("rating-0001")
.withGatheringName("gathering-0001")
.withAccessToken("$access_token_0001")
.withNumberOfPlayer(4)
.withKeyId("$key1.keyId")
);
const item = result.getItem();
const body = result.getBody();
const signature = result.getSignature();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import matchmaking
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = matchmaking.Gs2MatchmakingRestClient(session)
try:
result = client.get_ballot(
matchmaking.GetBallotRequest()
.with_namespace_name(self.hash1)
.with_rating_name('rating-0001')
.with_gathering_name('gathering-0001')
.with_access_token(self.access_token_0001)
.with_number_of_player(4)
.with_key_id(self.key1.key_id)
)
item = result.item
body = result.body
signature = result.signature
except core.Gs2Exception as e:
exit(1)
client = gs2('matchmaking')
api_result = client.get_ballot({
namespaceName='namespace1',
ratingName='rating-0001',
gatheringName='gathering-0001',
accessToken='$access_token_0001',
numberOfPlayer=4,
keyId='$key1.keyId',
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
body = result.body;
signature = result.signature;
Prepared ballot along with signatures
Request
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 32 chars | Namespace name | |
ratingName | string | ✓ | ~ 128 chars | Rating Name | |
gatheringName | string | ✓ | ~ 128 chars | Gathering Name | |
accessToken | string | ✓ | ~ 128 chars | User Id | |
numberOfPlayer | int | ✓ | 2 ~ 10 | Number of participants | |
keyId | string | ✓ | ~ 1024 chars | encryption key GRN |
Result
Type | Description | |
---|---|---|
item | Ballot | Ballot |
body | string | Data to be signed |
signature | string | Signature |
getBallotByUserId
getBallotByUserId
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/matchmaking"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := matchmaking.Gs2MatchmakingRestClient{
Session: &session,
}
result, err := client.GetBallotByUserId(
&matchmaking.GetBallotByUserIdRequest {
NamespaceName: pointy.String("namespace1"),
RatingName: pointy.String("rating-0001"),
GatheringName: pointy.String("gathering-0001"),
UserId: pointy.String("user-0001"),
NumberOfPlayer: pointy.Int32(4),
KeyId: pointy.String("$key1.keyId"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
body := result.Body
signature := result.Signature
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\GetBallotByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->getBallotByUserId(
(new GetBallotByUserIdRequest())
->withNamespaceName(self::namespace1)
->withRatingName("rating-0001")
->withGatheringName("gathering-0001")
->withUserId("user-0001")
->withNumberOfPlayer(4)
->withKeyId(self::$key1.keyId)
);
$item = $result->getItem();
$body = $result->getBody();
$signature = $result->getSignature();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.GetBallotByUserIdRequest;
import io.gs2.matchmaking.result.GetBallotByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);
try {
GetBallotByUserIdResult result = client.getBallotByUserId(
new GetBallotByUserIdRequest()
.withNamespaceName("namespace1")
.withRatingName("rating-0001")
.withGatheringName("gathering-0001")
.withUserId("user-0001")
.withNumberOfPlayer(4)
.withKeyId("$key1.keyId")
);
Ballot item = result.getItem();
String body = result.getBody();
String signature = result.getSignature();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Matchmaking.Gs2MatchmakingRestClient;
using Gs2.Gs2Matchmaking.Request.GetBallotByUserIdRequest;
using Gs2.Gs2Matchmaking.Result.GetBallotByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2MatchmakingRestClient(session);
AsyncResult<Gs2.Gs2Matchmaking.Result.GetBallotByUserIdResult> asyncResult = null;
yield return client.GetBallotByUserId(
new Gs2.Gs2Matchmaking.Request.GetBallotByUserIdRequest()
.WithNamespaceName("namespace1")
.WithRatingName("rating-0001")
.WithGatheringName("gathering-0001")
.WithUserId("user-0001")
.WithNumberOfPlayer(4)
.WithKeyId("$key1.keyId"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var body = result.Body;
var signature = result.Signature;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Matchmaking.Gs2MatchmakingRestClient(session);
try {
const result = await client.getBallotByUserId(
new Gs2Matchmaking.GetBallotByUserIdRequest()
.withNamespaceName("namespace1")
.withRatingName("rating-0001")
.withGatheringName("gathering-0001")
.withUserId("user-0001")
.withNumberOfPlayer(4)
.withKeyId("$key1.keyId")
);
const item = result.getItem();
const body = result.getBody();
const signature = result.getSignature();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import matchmaking
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = matchmaking.Gs2MatchmakingRestClient(session)
try:
result = client.get_ballot_by_user_id(
matchmaking.GetBallotByUserIdRequest()
.with_namespace_name(self.hash1)
.with_rating_name('rating-0001')
.with_gathering_name('gathering-0001')
.with_user_id('user-0001')
.with_number_of_player(4)
.with_key_id(self.key1.key_id)
)
item = result.item
body = result.body
signature = result.signature
except core.Gs2Exception as e:
exit(1)
client = gs2('matchmaking')
api_result = client.get_ballot_by_user_id({
namespaceName='namespace1',
ratingName='rating-0001',
gatheringName='gathering-0001',
userId='user-0001',
numberOfPlayer=4,
keyId='$key1.keyId',
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
body = result.body;
signature = result.signature;
Create ballot with signatures, specifying user ID
Request
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 32 chars | Namespace name | |
ratingName | string | ✓ | ~ 128 chars | Rating Name | |
gatheringName | string | ✓ | ~ 128 chars | Gathering Name | |
userId | string | ✓ | ~ 128 chars | User Id | |
numberOfPlayer | int | ✓ | 2 ~ 10 | Number of participants | |
keyId | string | ✓ | ~ 1024 chars | encryption key GRN |
Result
Type | Description | |
---|---|---|
item | Ballot | Ballot |
body | string | Data to be signed |
signature | string | Signature |
vote
vote
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/matchmaking"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := matchmaking.Gs2MatchmakingRestClient{
Session: &session,
}
result, err := client.Vote(
&matchmaking.VoteRequest {
NamespaceName: pointy.String("namespace1"),
BallotBody: pointy.String("$ballotBody"),
BallotSignature: pointy.String("$ballotSignature"),
GameResults: []matchmaking.GameResult{
{'rank': 1, 'userId': 'user-0001'},
{'rank': 2, 'userId': 'user-0002'},
{'rank': 2, 'userId': 'user-0003'},
{'rank': 3, 'userId': 'user-0004'},
},
KeyId: pointy.String("$key1.keyId"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\VoteRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->vote(
(new VoteRequest())
->withNamespaceName(self::namespace1)
->withBallotBody(self::$ballotBody)
->withBallotSignature(self::$ballotSignature)
->withGameResults([ {'rank': 1, 'userId': 'user-0001'},
{'rank': 2, 'userId': 'user-0002'},
{'rank': 2, 'userId': 'user-0003'},
{'rank': 3, 'userId': 'user-0004'},
])
->withKeyId(self::$key1.keyId)
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.VoteRequest;
import io.gs2.matchmaking.result.VoteResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);
try {
VoteResult result = client.vote(
new VoteRequest()
.withNamespaceName("namespace1")
.withBallotBody("$ballotBody")
.withBallotSignature("$ballotSignature")
.withGameResults(Arrays.asList(
{'rank': 1, 'userId': 'user-0001'},
{'rank': 2, 'userId': 'user-0002'},
{'rank': 2, 'userId': 'user-0003'},
{'rank': 3, 'userId': 'user-0004'}
))
.withKeyId("$key1.keyId")
);
Ballot item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Matchmaking.Gs2MatchmakingRestClient;
using Gs2.Gs2Matchmaking.Request.VoteRequest;
using Gs2.Gs2Matchmaking.Result.VoteResult;
var session = new Gs2RestSession(
new BasicGs2Credent