GS2-Matchmaking
GS2 SDK のリファレンス
GS2 SDK リファレンス
モデル
Namespace
ネームスペース
ネームスペースは一つのプロジェクトで同じサービスを異なる用途で複数利用できるようにするための仕組みです。
GS2 のサービスは基本的にネームスペースというレイヤーがあり、ネームスペースが異なれば同じサービスでもまったく別のデータ空間として取り扱われます。
そのため、各サービスの利用を開始するにあたってネームスペースを作成する必要があります。
型 | 説明 | |
---|---|---|
namespaceId | string | ネームスペースGRN |
name | string | ネームスペース名 |
description | string | 説明文 |
enableRating | bool | レーティング計算機能を使用するか |
createGatheringTriggerType | enum ['none', 'gs2_realtime', 'gs2_script'] | ギャザリング新規作成時のアクション |
createGatheringTriggerRealtimeNamespaceId | string | ギャザリング作成時にルームを作成する GS2-Realtime のネームスペース |
createGatheringTriggerScriptId | string | ギャザリング作成時に実行される GS2-Script のスクリプト |
completeMatchmakingTriggerType | enum ['none', 'gs2_realtime', 'gs2_script'] | マッチメイキング完了時のアクション |
completeMatchmakingTriggerRealtimeNamespaceId | string | マッチメイキング完了時にルームを作成する GS2-Realtime のネームスペース |
completeMatchmakingTriggerScriptId | string | マッチメイキング完了時に実行される GS2-Script のスクリプト |
joinNotification | NotificationSetting | ギャザリングに新規プレイヤーが参加したときのプッシュ通知 |
leaveNotification | NotificationSetting | ギャザリングからプレイヤーが離脱したときのプッシュ通知 |
completeNotification | NotificationSetting | マッチメイキングが完了したときのプッシュ通知 |
logSetting | LogSetting | ログの出力設定 |
createdAt | long | 作成日時 |
updatedAt | long | 最終更新日時 |
Gathering
ギャザリング
マッチメイキングによって集められたゲームプレイヤーグループを表すエンティティです。
マッチメイキング用のパラメータを複数持っており、パラメータを総合的に判断してプレイヤーをグルーピングします。
型 | 説明 | |
---|---|---|
gatheringId | string | ギャザリングGRN |
name | string | ギャザリング名 |
attributeRanges | AttributeRange[] | 募集条件 |
capacityOfRoles | CapacityOfRole[] | 募集枠 |
allowUserIds | string[] | 参加を許可するユーザ |
metadata | string | メタデータ |
expiresAt | long | ギャザリングの有効期限 |
createdAt | long | 作成日時 |
updatedAt | long | 最終更新日時 |
RatingModelMaster
レーティングモデルマスター
GS2 ではレーティングアルゴリズムとして Glicko-2 を採用しています。
Glicko-2 には複数のパラメータがありますが、GS2-Matchmaking ではそれらを総合的に表す ボラティリティ という1つのパラメータに集約しています。
ボラティリティ は変化の大きさを表すパラメータで、値が大きいほどレーティングの値の変動量が大きくなります。
型 | 説明 | |
---|---|---|
ratingModelId | string | レーティングモデルマスターGRN |
name | string | レーティングモデル名 |
metadata | string | メタデータ |
description | string | 説明文 |
volatility | int | レート値の変動の大きさ |
createdAt | long | 作成日時 |
updatedAt | long | 最終更新日時 |
RatingModel
レーティングモデル
GS2 ではレーティングアルゴリズムとして Glicko-2 を採用しています。
Glicko-2 には複数のパラメータがありますが、GS2-Matchmaking ではそれらを総合的に表す ボラティリティ という1つのパラメータに集約しています。
ボラティリティ は変化の大きさを表すパラメータで、値が大きいほどレーティングの値の変動量が大きくなります。
型 | 説明 | |
---|---|---|
ratingModelId | string | レーティングモデルGRN |
name | string | レーティングモデル名 |
metadata | string | メタデータ |
volatility | int | レート値の変動の大きさ |
CurrentRatingModelMaster
現在有効なマスターデータ
GS2ではマスターデータの管理にJSON形式のファイルを使用します。
ファイルをアップロードすることで、実際にサーバーに設定を反映することができます。
JSONファイルを作成する方法として、マネージメントコンソール上でのマスターデータエディタを提供していますが
よりゲームの運営に相応しいツールを作成し、適切なフォーマットのJSONファイルを書き出すことでもサービスを利用可能です。
JSONファイルの形式についてはドキュメントを参照ください。
型 | 説明 | |
---|---|---|
namespaceId | string | ネームスペースGRN |
settings | string | マスターデータ |
NotificationSetting
型 | 説明 | |
---|---|---|
gatewayNamespaceId | string | ネームスペースGRN |
enableTransferMobileNotification | bool | モバイルプッシュ通知へ転送するか |
sound | string | モバイルプッシュ通知で使用するサウンドファイル名 |
LogSetting
型 | 説明 | |
---|---|---|
loggingNamespaceId | string | ネームスペースGRN |
GitHubCheckoutSetting
型 | 説明 | |
---|---|---|
apiKeyId | string | GitHub のAPIキーGRN |
repositoryName | string | リポジトリ名 |
sourcePath | string | ソースコードのファイルパス |
referenceType | enum ['commit_hash', 'branch', 'tag'] | コードの取得元 |
commitHash | string | コミットハッシュ |
branchName | string | ブランチ名 |
tagName | string | タグ名 |
AttributeRange
型 | 説明 | |
---|---|---|
name | string | 属性名 |
min | int | ギャザリング参加可能な属性値の最小値 |
max | int | ギャザリング参加可能な属性値の最大値 |
CapacityOfRole
型 | 説明 | |
---|---|---|
roleName | string | ロール名 |
roleAliases | string[] | ロール名の別名リスト |
capacity | int | 募集人数 |
participants | Player[] | 参加者のプレイヤー情報リスト |
Attribute
型 | 説明 | |
---|---|---|
name | string | 属性名 |
value | int | 属性値 |
Player
型 | 説明 | |
---|---|---|
userId | string | ユーザーID |
attributes | Attribute[] | 属性値のリスト |
roleName | string | ロール名 |
denyUserIds | string[] | 参加を拒否するユーザIDリスト |
Rating
レーティング
ゲームプレイヤー毎の現在のレーティングの値を保持するエンティティです。
型 | 説明 | |
---|---|---|
ratingId | string | レーティングGRN |
name | string | レーティング名 |
userId | string | ユーザーID |
rateValue | float | |
createdAt | long | 作成日時 |
updatedAt | long | 最終更新日時 |
GameResult
型 | 説明 | |
---|---|---|
rank | int | 順位 |
userId | string | ユーザーID |
Ballot
型 | 説明 | |
---|---|---|
userId | string | ユーザーID |
ratingName | string | レーティング計算に使用するレーティング名 |
gatheringName | string | 投票対象のギャザリング名 |
numberOfPlayer | int | 参加人数 |
SignedBallot
型 | 説明 | |
---|---|---|
body | string | 投票用紙の署名対象のデータ |
signature | string | 投票用紙の署名 |
WrittenBallot
型 | 説明 | |
---|---|---|
ballot | Ballot | 投票用紙 |
gameResults | GameResult[] | 投票内容。対戦結果のリスト |
Vote
型 | 説明 | |
---|---|---|
voteId | string | 投票状況GRN |
ratingName | string | レーティング名 |
gatheringName | string | 投票対象のギャザリング名 |
writtenBallots | WrittenBallot[] | 投票用紙のリスト |
createdAt | long | 作成日時 |
updatedAt | long | 最終更新日時 |
TimeSpan
型 | 説明 | |
---|---|---|
days | int | 現在時刻からの日数 |
hours | int | 現在時刻からの時間 |
minutes | int | 現在時刻からの分 |
メソッド
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.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.describeNamespaces(
new 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
# エラー発生時
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
ネームスペースの一覧を取得
Request
型 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|
pageToken | string | ~ 1024文字 | データの取得を開始する位置を指定するトークン | ||
limit | int | ✓ | 30 | 1 ~ 1000 | データの取得件数 |
Result
型 | 説明 | |
---|---|---|
items | Namespace[] | ネームスペースのリスト |
nextPageToken | string | リストの続きを取得するためのページトークン |
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,
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)
->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)
.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.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.createNamespace(
new CreateNamespaceRequest()
.withName("namespace1")
.withDescription(null)
.withEnableRating(true)
.withCreateGatheringTriggerType("none")
.withCreateGatheringTriggerRealtimeNamespaceId(null)
.withCreateGatheringTriggerScriptId(null)
.withCompleteMatchmakingTriggerType("none")
.withCompleteMatchmakingTriggerRealtimeNamespaceId(null)
.withCompleteMatchmakingTriggerScriptId(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)
.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_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,
joinNotification=nil,
leaveNotification=nil,
completeNotification=nil,
logSetting={
loggingNamespaceId='grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001',
},
})
if(api_result.isError) then
# エラー発生時
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
ネームスペースを新規作成
Request
型 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|
name | string | ✓ | ~ 32文字 | ネームスペース名 | |
description | string | ~ 1024文字 | 説明文 | ||
enableRating | bool | ✓ | false | レーティング計算機能を使用するか | |
createGatheringTriggerType | enum ['none', 'gs2_realtime', 'gs2_script'] | ✓ | ~ 128文字 | ギャザリング新規作成時のアクション | |
createGatheringTriggerRealtimeNamespaceId | string | {createGatheringTriggerType} == "gs2_realtime" | ~ 1024文字 | ギャザリング作成時にルームを作成する GS2-Realtime のネームスペース | |
createGatheringTriggerScriptId | string | {createGatheringTriggerType} == "gs2_script" | ~ 1024文字 | ギャザリング作成時に実行される GS2-Script のスクリプト | |
completeMatchmakingTriggerType | enum ['none', 'gs2_realtime', 'gs2_script'] | ✓ | ~ 128文字 | マッチメイキング完了時のアクション | |
completeMatchmakingTriggerRealtimeNamespaceId | string | {completeMatchmakingTriggerType} == "gs2_realtime" | ~ 1024文字 | マッチメイキング完了時にルームを作成する GS2-Realtime のネームスペース | |
completeMatchmakingTriggerScriptId | string | {completeMatchmakingTriggerType} == "gs2_script" | ~ 1024文字 | マッチメイキング完了時に実行される GS2-Script のスクリプト | |
joinNotification | NotificationSetting | ギャザリングに新規プレイヤーが参加したときのプッシュ通知 | |||
leaveNotification | NotificationSetting | ギャザリングからプレイヤーが離脱したときのプッシュ通知 | |||
completeNotification | NotificationSetting | マッチメイキングが完了したときのプッシュ通知 | |||
logSetting | LogSetting | ログの出力設定 |
Result
型 | 説明 | |
---|---|---|
item | Namespace | 作成したネームスペース |
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.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.getNamespaceStatus(
new 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
# エラー発生時
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
status = result.status;
ネームスペースの状態を取得
Request
型 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 32文字 | ネームスペース名 |
Result
型 | 説明 | |
---|---|---|
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.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.getNamespace(
new 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
# エラー発生時
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
ネームスペースを取得
Request
型 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 32文字 | ネームスペース名 |
Result
型 | 説明 | |
---|---|---|
item | 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,
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)
->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)
.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.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.updateNamespace(
new UpdateNamespaceRequest()
.withNamespaceName("namespace1")
.withDescription("description1")
.withEnableRating(true)
.withCreateGatheringTriggerType("none")
.withCreateGatheringTriggerRealtimeNamespaceId(null)
.withCreateGatheringTriggerScriptId(null)
.withCompleteMatchmakingTriggerType("none")
.withCompleteMatchmakingTriggerRealtimeNamespaceId(null)
.withCompleteMatchmakingTriggerScriptId(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)
.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_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,
joinNotification=nil,
leaveNotification=nil,
completeNotification=nil,
logSetting={
loggingNamespaceId='grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001',
},
})
if(api_result.isError) then
# エラー発生時
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
ネームスペースを更新
Request
型 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 32文字 | ネームスペース名 | |
description | string | ~ 1024文字 | 説明文 | ||
enableRating | bool | ✓ | false | レーティング計算機能を使用するか | |
createGatheringTriggerType | enum ['none', 'gs2_realtime', 'gs2_script'] | ✓ | ~ 128文字 | ギャザリング新規作成時のアクション | |
createGatheringTriggerRealtimeNamespaceId | string | {createGatheringTriggerType} == "gs2_realtime" | ~ 1024文字 | ギャザリング作成時にルームを作成する GS2-Realtime のネームスペース | |
createGatheringTriggerScriptId | string | {createGatheringTriggerType} == "gs2_script" | ~ 1024文字 | ギャザリング作成時に実行される GS2-Script のスクリプト | |
completeMatchmakingTriggerType | enum ['none', 'gs2_realtime', 'gs2_script'] | ✓ | ~ 128文字 | マッチメイキング完了時のアクション | |
completeMatchmakingTriggerRealtimeNamespaceId | string | {completeMatchmakingTriggerType} == "gs2_realtime" | ~ 1024文字 | マッチメイキング完了時にルームを作成する GS2-Realtime のネームスペース | |
completeMatchmakingTriggerScriptId | string | {completeMatchmakingTriggerType} == "gs2_script" | ~ 1024文字 | マッチメイキング完了時に実行される GS2-Script のスクリプト | |
joinNotification | NotificationSetting | ギャザリングに新規プレイヤーが参加したときのプッシュ通知 | |||
leaveNotification | NotificationSetting | ギャザリングからプレイヤーが離脱したときのプッシュ通知 | |||
completeNotification | NotificationSetting | マッチメイキングが完了したときのプッシュ通知 | |||
logSetting | LogSetting | ログの出力設定 |
Result
型 | 説明 | |
---|---|---|
item | 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.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.deleteNamespace(
new 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
# エラー発生時
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
ネームスペースを削除
Request
型 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 32文字 | ネームスペース名 |
Result
型 | 説明 | |
---|---|---|
item | 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.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.describeGatherings(
new 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
# エラー発生時
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
ギャザリングの一覧を取得
Request
型 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 32文字 | ネームスペース名 | |
pageToken | string | ~ 1024文字 | データの取得を開始する位置を指定するトークン | ||
limit | int | ✓ | 30 | 1 ~ 1000 | データの取得件数 |
Result
型 | 説明 | |
---|---|---|
items | Gathering[] | ギャザリングのリスト |
nextPageToken | string | リストの続きを取得するためのページトークン |
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.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.createGathering(
new 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
# エラー発生時
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
ギャザリングを作成して募集を開始
募集条件
には、作成したギャザリングに参加を許可する各属性値の範囲を指定します。
たとえば、同一ゲームモードを希望するプレイヤーを募集したい場合は、ゲームモードに対応した属性値が完全一致する参加条件プレイヤーとマッチメイキングするように
属性名:ゲームモード
属性最小値: ゲームモードを表す数値
属性最大値: ゲームモードを表す数値
とすることで、同一ゲームモードを希望するプレイヤー同士をマッチメイキングできます。
他にレーティングをベースにしたマッチメイキングを実施したい場合は、
ルーム作成者のレーティング値を中心とした属性値の範囲を指定することで、レーティング値の近いプレイヤー同士をマッチメイキングできます。
この 募集条件
はあとで更新することができますので、徐々に条件を緩和していくことができます。
ロール とは 盾役1人・回復役1人・攻撃役2人 などの役割ごとに募集人数を設定したい場合に使用します。
ロールにはエイリアスを指定できます。
たとえば、盾役は パラディン と ナイト の2種類の ジョブ
に更に分類できるとします。
この場合、ロール名 に 盾役
エイリアス に パラディン
ナイト
として募集を出すようにゲームを実装します。
そして、プレイヤーは自分自身の ジョブ
を自身のプレイヤー情報のロールに指定します。
こうすることで、募集条件が 盾役
になっているギャザリングには パラディン
も ナイト
も参加できます。
一方で、ギャザリングを作成するときに、 パラディン
だけ募集したくて、 ナイト
を募集したくない場合は、
募集するロール名に パラディン
を直接指定したり、エイリアスに ナイト
を含めないようにすることで実現できます。
参加者
の 募集人数
はプレイヤーの募集人数を指定します。ロール名を指定することで、ロール名ごとの募集人数を設定できます。
参加者
の 参加者のプレイヤー情報リスト
には事前にプレイヤー間でパーティを構築している場合や、参加者が離脱したあとの追加募集で使用します。
Request
型 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 32文字 | ネームスペース名 | |
accessToken | string | ✓ | ~ 128文字 | ユーザーID | |
player | Player | ✓ | 自身のプレイヤー情報 | ||
attributeRanges | AttributeRange[] | [] | 募集条件 | ||
capacityOfRoles | CapacityOfRole[] | ✓ | [] | 募集枠 | |
allowUserIds | string[] | [] | 参加を許可するユーザ | ||
expiresAt | long | ギャザリングの有効期限 | |||
expiresAtTimeSpan | TimeSpan_ | 有効期限までの時間 |
Result
型 | 説明 | |
---|---|---|
item | 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.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.createGatheringByUserId(
new 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
# エラー発生時
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
ユーザーIDを指定してギャザリングを作成して募集を開始
募集条件
には、作成したギャザリングに参加を許可する各属性値の範囲を指定します。
たとえば、同一ゲームモードを希望するプレイヤーを募集したい場合は、ゲームモードに対応した属性値が完全一致する参加条件プレイヤーとマッチメイキングするように
属性名:ゲームモード
属性最小値: ゲームモードを表す数値
属性最大値: ゲームモードを表す数値
とすることで、同一ゲームモードを希望するプレイヤー同士をマッチメイキングできます。
他にレーティングをベースにしたマッチメイキングを実施したい場合は、
ルーム作成者のレーティング値を中心とした属性値の範囲を指定することで、レーティング値の近いプレイヤー同士をマッチメイキングできます。
この 募集条件
はあとで更新することができますので、徐々に条件を緩和していくことができます。
ロール とは 盾役1人・回復役1人・攻撃役2人 などの役割ごとに募集人数を設定したい場合に使用します。
ロールにはエイリアスを指定できます。
たとえば、盾役は パラディン と ナイト の2種類の ジョブ
に更に分類できるとします。
この場合、ロール名 に 盾役
エイリアス に パラディン
ナイト
として募集を出すようにゲームを実装します。
そして、プレイヤーは自分自身の ジョブ
を自身のプレイヤー情報のロールに指定します。
こうすることで、募集条件が 盾役
になっているギャザリングには パラディン
も ナイト
も参加できます。
一方で、ギャザリングを作成するときに、 パラディン
だけ募集したくて、 ナイト
を募集したくない場合は、
募集するロール名に パラディン
を直接指定したり、エイリアスに ナイト
を含めないようにすることで実現できます。
参加者
の 募集人数
はプレイヤーの募集人数を指定します。ロール名を指定することで、ロール名ごとの募集人数を設定できます。
参加者
の 参加者のプレイヤー情報リスト
には事前にプレイヤー間でパーティを構築している場合や、参加者が離脱したあとの追加募集で使用します。
Request
型 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 32文字 | ネームスペース名 | |
userId | string | ✓ | ~ 128文字 | ユーザーID | |
player | Player | ✓ | 自身のプレイヤー情報 | ||
attributeRanges | AttributeRange[] | [] | 募集条件 | ||
capacityOfRoles | CapacityOfRole[] | ✓ | [] | 募集枠 | |
allowUserIds | string[] | [] | 参加を許可するユーザ | ||
expiresAt | long | ギャザリングの有効期限 | |||
expiresAtTimeSpan | TimeSpan_ | 有効期限までの時間 |
Result
型 | 説明 | |
---|---|---|
item | 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.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.updateGathering(
new 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
# エラー発生時
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
ギャザリングを更新
Request
型 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 32文字 | ネームスペース名 | |
gatheringName | string | ✓ | UUID | ~ 128文字 | ギャザリング名 |
accessToken | string | ✓ | ~ 128文字 | ユーザーID | |
attributeRanges | AttributeRange[] | [] | 募集条件 |
Result
型 | 説明 | |
---|---|---|
item | 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.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.updateGatheringByUserId(
new 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
# エラー発生時
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
ユーザーIDを指定してギャザリングを更新
Request
型 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 32文字 | ネームスペース名 | |
gatheringName | string | ✓ | UUID | ~ 128文字 | ギャザリング名 |
userId | string | ✓ | ~ 128文字 | ユーザーID | |
attributeRanges | AttributeRange[] | [] | 募集条件 |
Result
型 | 説明 | |
---|---|---|
item | 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.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.doMatchmakingByPlayer(
new 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
# エラー発生時
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
matchmakingContextToken = result.matchmakingContextToken;
Player が参加できるギャザリングを探して参加する
一定時間 検索を行い、対象が見つからなかったときには マッチメイキングの状態を保持するトークン
を返す。
次回 マッチメイキングの状態を保持するトークン
をつけて再度リクエストを出すことで、前回の続きから検索処理を再開できる。
すべてのギャザリングを検索したが、参加できるギャザリングが存在しなかった場合はギャザリングもトークンもどちらも null が応答される。
Request
型 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 32文字 | ネームスペース名 | |
player | Player | ✓ | プレイヤー情報 | ||
matchmakingContextToken | string | ~ 5120文字 | 検索の再開に使用する マッチメイキングの状態を保持するトークン |
Result
型 | 説明 | |
---|---|---|
item | Gathering | 参加したギャザリング |
matchmakingContextToken | string | マッチメイキングの状態を保持するトークン |
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.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return 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),
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
# エラー発生時
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
matchmakingContextToken = result.matchmakingContextToken;
自分が参加できるギャザリングを探して参加する
一定時間 検索を行い、対象が見つからなかったときには マッチメイキングの状態を保持するトークン
を返す。
次回 マッチメイキングの状態を保持するトークン
をつけて再度リクエストを出すことで、前回の続きから検索処理を再開できる。
すべてのギャザリングを検索したが、参加できるギャザリングが存在しなかった場合はギャザリングもトークンもどちらも null が応答される。
Request
型 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 32文字 | ネームスペース名 | |
accessToken | string | ✓ | ~ 128文字 | ユーザーID | |
player | Player | ✓ | 自身のプレイヤー情報 | ||
matchmakingContextToken | string | ~ 5120文字 | 検索の再開に使用する マッチメイキングの状態を保持するトークン |
Result
型 | 説明 | |
---|---|---|
item | Gathering | 参加したギャザリング |
matchmakingContextToken | string | マッチメイキングの状態を保持するトークン |
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.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.doMatchmakingByUserId(
new 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
# エラー発生時
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
matchmakingContextToken = result.matchmakingContextToken;
自分が参加できるギャザリングを探して参加する
一定時間 検索を行い、対象が見つからなかったときには マッチメイキングの状態を保持するトークン
を返す。
次回 マッチメイキングの状態を保持するトークン
をつけて再度リクエストを出すことで、前回の続きから検索処理を再開できる。
すべてのギャザリングを検索したが、参加できるギャザリングが存在しなかった場合はギャザリングもトークンもどちらも null が応答される。
Request
型 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 32文字 | ネームスペース名 | |
userId | string | ✓ | ~ 128文字 | ユーザーID | |
player | Player | ✓ | 自身のプレイヤー情報 | ||
matchmakingContextToken | string | ~ 5120文字 | 検索の再開に使用する マッチメイキングの状態を保持するトークン |
Result
型 | 説明 | |
---|---|---|
item | Gathering | 参加したギャザリング |
matchmakingContextToken | string | マッチメイキングの状態を保持するトークン |
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.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.getGathering(
new 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
# エラー発生時
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
ギャザリングを取得
Request
型 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 32文字 | ネームスペース名 | |
gatheringName | string | ✓ | UUID | ~ 128文字 | ギャザリング名 |
Result
型 | 説明 | |
---|---|---|
item | 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.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.cancelMatchmaking(
new 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
# エラー発生時
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
マッチメイキングをキャンセルする
ギャザリングから離脱する前にマッチメイキングが完了した場合は、NotFoundException(404エラー) が発生し失敗します
Request
型 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 32文字 | ネームスペース名 | |
gatheringName | string | ✓ | UUID | ~ 128文字 | ギャザリング名 |
accessToken | string | ✓ | ~ 128文字 | ユーザーID |
Result
型 | 説明 | |
---|---|---|
item | 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.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.cancelMatchmakingByUserId(
new 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
# エラー発生時
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
ユーザIDを指定してマッチメイキングをキャンセルする
ギャザリングから離脱する前にマッチメイキングが完了した場合は、NotFoundException(404エラー) が発生し失敗します
Request
型 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 32文字 | ネームスペース名 | |
gatheringName | string | ✓ | UUID | ~ 128文字 | ギャザリング名 |
userId | string | ✓ | ~ 128文字 | ユーザーID |
Result
型 | 説明 | |
---|---|---|
item | 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.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.deleteGathering(
new 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
# エラー発生時
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
ギャザリングを削除
Request
型 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 32文字 | ネームスペース名 | |
gatheringName | string | ✓ | UUID | ~ 128文字 | ギャザリング名 |
Result
型 | 説明 | |
---|---|---|
item | 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.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.describeRatingModelMasters(
new 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
# エラー発生時
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
レーティングモデルマスターの一覧を取得
Request
型 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 32文字 | ネームスペース名 | |
pageToken | string | ~ 1024文字 | データの取得を開始する位置を指定するトークン | ||
limit | int | ✓ | 30 | 1 ~ 1000 | データの取得件数 |
Result
型 | 説明 | |
---|---|---|
items | RatingModelMaster[] | レーティングモデルマスターのリスト |
nextPageToken | string | リストの続きを取得するためのページトークン |
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.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.createRatingModelMaster(
new 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
# エラー発生時
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
レーティングモデルマスターを新規作成
Request
型 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 32文字 | ネームスペース名 | |
name | string | ✓ | ~ 128文字 | レーティングモデル名 | |
description | string | ~ 1024文字 | 説明文 | ||
metadata | string | ~ 128文字 | メタデータ | ||
volatility | int | ✓ | 100 | 1 ~ 350 | レート値の変動の大きさ |
Result
型 | 説明 | |
---|---|---|
item | RatingModelMaster | 作成したレーティングモデルマスター |
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.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.getRatingModelMaster(
new 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
# エラー発生時
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
レーティングモデルマスターを取得
Request
型 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 32文字 | ネームスペース名 | |
ratingName | string | ✓ | ~ 128文字 | レーティングモデル名 |
Result
型 | 説明 | |
---|---|---|
item | RatingModelMaster | レーティングモデルマスター |
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.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.updateRatingModelMaster(
new 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
# エラー発生時
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
レーティングモデルマスターを更新
Request
型 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 32文字 | ネームスペース名 | |
ratingName | string | ✓ | ~ 128文字 | レーティングモデル名 | |
description | string | ~ 1024文字 | 説明文 | ||
metadata | string | ~ 128文字 | メタデータ | ||
volatility | int | ✓ | 100 | 1 ~ 350 | レート値の変動の大きさ |
Result
型 | 説明 | |
---|---|---|
item | RatingModelMaster | 更新したレーティングモデルマスター |
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.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.deleteRatingModelMaster(
new 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
# エラー発生時
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
レーティングモデルマスターを削除
Request
型 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 32文字 | ネームスペース名 | |
ratingName | string | ✓ | ~ 128文字 | レーティングモデル名 |
Result
型 | 説明 | |
---|---|---|
item | RatingModelMaster | 削除したレーティングモデルマスター |
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.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.describeRatingModels(
new 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
# エラー発生時
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;
レーティングモデルの一覧を取得
Request
型 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 32文字 | ネームスペース名 |
Result
型 | 説明 | |
---|---|---|
items | RatingModel[] | レーティングモデルのリスト |
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.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.getRatingModel(
new 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
# エラー発生時
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
レーティングモデルを取得
Request
型 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 32文字 | ネームスペース名 | |
ratingName | string | ✓ | ~ 128文字 | レーティングモデル名 |
Result
型 | 説明 | |
---|---|---|
item | RatingModel | レーティングモデル |
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.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.exportMaster(
new 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
# エラー発生時
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
現在有効なレーティングマスターのマスターデータをエクスポート
Request
型 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 32文字 | ネームスペース名 |
Result
型 | 説明 | |
---|---|---|
item | CurrentRatingModelMaster | 現在有効なレーティングマスター |
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.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.getCurrentRatingModelMaster(
new 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
# エラー発生時
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
現在有効なレーティングマスターを取得
Request
型 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 32文字 | ネームスペース名 |
Result
型 | 説明 | |
---|---|---|
item | CurrentRatingModelMaster | 現在有効なレーティングマスター |
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.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return 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}"),
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
# エラー発生時
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
現在有効なレーティングマスターを更新
Request
型 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 32文字 | ネームスペース名 | |
settings | string | ✓ | ~ 5242880文字 | マスターデータ |
Result
型 | 説明 | |
---|---|---|
item | CurrentRatingModelMaster | 更新した現在有効なレーティングマスター |
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.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.updateCurrentRatingModelMasterFromGitHub(
new 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
# エラー発生時
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
現在有効なレーティングマスターを更新
Request
型 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 32文字 | ネームスペース名 | |
checkoutSetting | GitHubCheckoutSetting | ✓ | GitHubからマスターデータをチェックアウトしてくる設定 |
Result
型 | 説明 | |
---|---|---|
item | CurrentRatingModelMaster | 更新した現在有効なレーティングマスター |
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.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.describeRatings(
new 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
# エラー発生時
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
レーティングの一覧を取得
Request
型 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 32文字 | ネームスペース名 | |
accessToken | string | ✓ | ~ 128文字 | ユーザーID | |
pageToken | string | ~ 1024文字 | データの取得を開始する位置を指定するトークン | ||
limit | int | ✓ | 30 | 1 ~ 1000 | データの取得件数 |
Result
型 | 説明 | |
---|---|---|
items | Rating[] | レーティングのリスト |
nextPageToken | string | リストの続きを取得するためのページトークン |
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.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.describeRatingsByUserId(
new 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
# エラー発生時
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
ユーザIDを指定してレーティングの一覧を取得
Request
型 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 32文字 | ネームスペース名 | |
userId | string | ✓ | ~ 128文字 | ユーザーID | |
pageToken | string | ~ 1024文字 | データの取得を開始する位置を指定するトークン | ||
limit | int | ✓ | 30 | 1 ~ 1000 | データの取得件数 |
Result
型 | 説明 | |
---|---|---|
items | Rating[] | レーティングのリスト |
nextPageToken | string | リストの続きを取得するためのページトークン |
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.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.getRating(
new 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
# エラー発生時
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
レーティングを取得
Request
型 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 32文字 | ネームスペース名 | |
accessToken | string | ✓ | ~ 128文字 | ユーザーID | |
ratingName | string | ✓ | ~ 128文字 | レーティング名 |
Result
型 | 説明 | |
---|---|---|
item | 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.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.getRatingByUserId(
new 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
# エラー発生時
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
ユーザーIDを指定してレーティングを取得
Request
型 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 32文字 | ネームスペース名 | |
userId | string | ✓ | ~ 128文字 | ユーザーID | |
ratingName | string | ✓ | ~ 128文字 | レーティング名 |
Result
型 | 説明 | |
---|---|---|
item | 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.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.putResult(
new 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
# エラー発生時
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;
レーティング値の再計算を実行
レーティングの計算処理には Glicko-2 rating system をベースとした計算アルゴリズムを採用しています。
レーティング値の初期値は1500で、レーティングの値が離れた相手に勝利するほど上昇幅は大きく、同じく負けた側は減少幅は大きくなります。
レーティングの計算には参加したユーザIDのリストが必要となります。
そのため、クライアントから直接このAPIを呼び出すのは適切ではありません。ゲームの勝敗を判断できるゲームサーバから呼び出すようにしてください。
P2P 対戦など、クライアント主導で対戦を実現している場合は、投票機能を利用して勝敗を決定するようにしてください。
Request
型 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 32文字 | ネームスペース名 | |
ratingName | string | ✓ | ~ 128文字 | レーティング名 | |
gameResults | GameResult[] | 対戦結果 |
Result
型 | 説明 | |
---|---|---|
items | 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.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.deleteRating(
new 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
# エラー発生時
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
レーティングを削除
Request
型 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 32文字 | ネームスペース名 | |
userId | string | ✓ | ~ 128文字 | ユーザーID | |
ratingName | string | ✓ | ~ 128文字 | レーティング名 |
Result
型 | 説明 | |
---|---|---|
item | 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.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.getBallot(
new 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
# エラー発生時
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
body = result.body;
signature = result.signature;
署名と共に投票用紙を作成
Request
型 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 32文字 | ネームスペース名 | |
ratingName | string | ✓ | ~ 128文字 | レーティング名 | |
gatheringName | string | ✓ | ~ 128文字 | 投票対象のギャザリング名 | |
accessToken | string | ✓ | ~ 128文字 | ユーザーID | |
numberOfPlayer | int | ✓ | 2 ~ 10 | 参加人数 | |
keyId | string | ✓ | ~ 1024文字 | 暗号鍵GRN |
Result
型 | 説明 | |
---|---|---|
item | Ballot | 投票用紙 |
body | string | 署名対象のデータ |
signature | string | 署名データ |
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.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.getBallotByUserId(
new 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
# エラー発生時
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
body = result.body;
signature = result.signature;
ユーザーIDを指定して署名と共に投票用紙を作成
Request
型 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 32文字 | ネームスペース名 | |
ratingName | string | ✓ | ~ 128文字 | レーティング名 | |
gatheringName | string | ✓ | ~ 128文字 | 投票対象のギャザリング名 | |
userId | string | ✓ | ~ 128文字 | ユーザーID | |
numberOfPlayer | int | ✓ | 2 ~ 10 | 参加人数 | |
keyId | string | ✓ | ~ 1024文字 | 暗号鍵GRN |
Result
型 | 説明 | |
---|---|---|
item | Ballot | 投票用紙 |
body | string | 署名対象のデータ |
signature | string | 署名データ |
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'