GS2-Matchmaking SDK API リファレンス
モデル
Namespace
ネームスペース
ネームスペースは、一つのプロジェクト内で同じサービスを異なる用途で複数利用するためのエンティティです。
GS2 の各サービスはネームスペース単位で管理されます。ネームスペースが異なれば、同じサービスでも完全に独立したデータ空間として扱われます。
そのため、各サービスの利用を開始するにあたってネームスペースを作成する必要があります。
詳細
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| namespaceId | string | ※ | ~ 1024文字 | ネームスペース
GRN ※ サーバーが自動で設定 | ||||||||||
| name | string | ✓ | ~ 128文字 | ネームスペース名 ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 | ||||||||||
| description | string | ~ 1024文字 | 説明文 | |||||||||||
| transactionSetting | TransactionSetting | トランザクション設定 マッチメイキング操作時のトランザクションの処理方法を制御する設定です。 | ||||||||||||
| enableRating | bool | false | レーティング計算機能の有効化 Glicko-2 ベースのレーティング計算機能を有効にするかどうか。 有効にすると、プレイヤーは Vote システムを通じて対戦結果を送信し、レーティングが自動的に更新されます。 RatingModel マスターデータの設定が必要です。デフォルトは false です。 | |||||||||||
| enableDisconnectDetection | 文字列列挙型 enum { “disable”, “enable” } | “disable” | 切断検知 マッチメイキング中のプレイヤーが待機中であることを定期的に報告する必要があるかを制御します。 有効にすると、プレイヤーが設定されたタイムアウト期間内にキープアライブを送信しない場合、ギャザリングから自動的に退出処理されます。 これにより「ゴースト」プレイヤーがマッチメイキングの完了をブロックすることを防ぎます。デフォルトは “disable” です。
| |||||||||||
| disconnectDetectionTimeoutSeconds | int | {enableDisconnectDetection} == “enable” | ✓※ | 15 ~ 600 | 切断検知タイムアウト(秒) キープアライブ報告なしにプレイヤーを切断とみなしギャザリングから退出させるまでの待機秒数。 切断検知が有効な場合のみ適用されます。15 から 600 秒の範囲で指定します。 ※ enableDisconnectDetection が “enable” であれば 必須 | |||||||||
| createGatheringTriggerType | 文字列列挙型 enum { “none”, “gs2_realtime”, “gs2_script” } | “none” | ギャザリング作成時トリガータイプ 新しいギャザリングが作成されたときに実行するアクションの種類。 GS2-Realtime のルーム作成をトリガーしてリアルタイム通信を開始したり、GS2-Script を実行してカスタムロジックを実行できます。デフォルトは “none” です。
| |||||||||||
| createGatheringTriggerRealtimeNamespaceId | string | {createGatheringTriggerType} == “gs2_realtime” | ✓※ | ~ 1024文字 | ギャザリング作成時にルームを作成する GS2-Realtime のネームスペース ※ createGatheringTriggerType が “gs2_realtime” であれば 必須 | |||||||||
| createGatheringTriggerScriptId | string | {createGatheringTriggerType} == “gs2_script” | ✓※ | ~ 1024文字 | ギャザリング作成時に実行される GS2-Script のスクリプト
GRN Script トリガーリファレンス - createGathering※ createGatheringTriggerType が “gs2_script” であれば 必須 | |||||||||
| completeMatchmakingTriggerType | 文字列列挙型 enum { “none”, “gs2_realtime”, “gs2_script” } | “none” | マッチメイキング完了時トリガータイプ マッチメイキングが完了した(すべてのロール枠が埋まった)ときに実行するアクションの種類。 マッチングされたプレイヤー向けに GS2-Realtime のルーム作成をトリガーしたり、GS2-Script を実行してカスタムの事後処理ロジックを実行できます。デフォルトは “none” です。
| |||||||||||
| completeMatchmakingTriggerRealtimeNamespaceId | string | {completeMatchmakingTriggerType} == “gs2_realtime” | ✓※ | ~ 1024文字 | マッチメイキング完了時にルームを作成する GS2-Realtime のネームスペース
GRN ※ completeMatchmakingTriggerType が “gs2_realtime” であれば 必須 | |||||||||
| completeMatchmakingTriggerScriptId | string | {completeMatchmakingTriggerType} == “gs2_script” | ✓※ | ~ 1024文字 | マッチメイキング完了時に実行される GS2-Script のスクリプト
GRN Script トリガーリファレンス - completeMatchmaking※ completeMatchmakingTriggerType が “gs2_script” であれば 必須 | |||||||||
| enableCollaborateSeasonRating | 文字列列挙型 enum { “enable”, “disable” } | “disable” | シーズンレーティング連携の有効化 シーズンベースのレーティング計算のために GS2-SeasonRating との連携を有効にするかどうか。 有効にすると、マッチメイキング完了時に指定した GS2-SeasonRating のネームスペースにレーティング計算セッションが自動作成されます。 デフォルトは “disable” です。
| |||||||||||
| collaborateSeasonRatingNamespaceId | string | {enableCollaborateSeasonRating} == “enable” | ✓※ | ~ 1024文字 | シーズンレーティングネームスペース
GRN マッチメイキング完了時にレーティング計算セッションが作成される GS2-SeasonRating のネームスペースの GRN。 シーズンレーティング連携が有効な場合のみ適用されます。 ※ enableCollaborateSeasonRating が “enable” であれば 必須 | |||||||||
| collaborateSeasonRatingTtl | int | {enableCollaborateSeasonRating} == “enable” | 60 | 60 ~ 7200 | シーズンレーティング結果TTL(秒) マッチメイキング完了後、GS2-SeasonRating 経由の対戦結果送信を受け付ける最大待機時間(秒)。 この期間内に結果が送信されない場合、レーティングセッションは期限切れとなります。60 から 7200 秒の範囲で指定します。デフォルトは 60 です。 ※ enableCollaborateSeasonRating が “enable” であれば 有効 | |||||||||
| changeRatingScript | ScriptSetting | レーティング値が変化したときに実行するスクリプトの設定 Script トリガーリファレンス - changeRating | ||||||||||||
| joinNotification | NotificationSetting | 参加通知 新しいプレイヤーがギャザリングに参加したときのプッシュ通知設定。 既存の参加者に新しいプレイヤーが参加したことを通知し、ゲームクライアントがマッチメイキング UI を更新できるようにします。 | ||||||||||||
| leaveNotification | NotificationSetting | 離脱通知 プレイヤーがギャザリングから離脱したときのプッシュ通知設定。 残りの参加者にプレイヤーが離脱したことを通知し、ゲームクライアントに変更を反映させます。 | ||||||||||||
| completeNotification | NotificationSetting | 完了通知 マッチメイキングが完了した(すべてのロール枠が埋まった)ときのプッシュ通知設定。 すべての参加者にギャザリングが満員になり対戦を開始できることを通知します。 | ||||||||||||
| changeRatingNotification | NotificationSetting | レーティング変動通知 投票処理後にプレイヤーのレーティング値が変動したときのプッシュ通知設定。 影響を受けたプレイヤーに新しいレーティングを通知し、ゲームクライアントに更新された値を表示させます。 | ||||||||||||
| logSetting | LogSetting | ログの出力設定 APIリクエスト・レスポンスのログを GS2-Log に出力するための設定。 設定すると、マッチメイキングの操作(ギャザリングの作成・参加・離脱、投票、レーティング変動など)がモニタリングと分析のためにログ出力されます。 | ||||||||||||
| createdAt | long | ※ | 現在時刻 | 作成日時 UNIX 時間・ミリ秒 ※ サーバーが自動で設定 | ||||||||||
| updatedAt | long | ※ | 現在時刻 | 最終更新日時 UNIX 時間・ミリ秒 ※ サーバーが自動で設定 | ||||||||||
| revision | long | 0 | 0 ~ 9223372036854775805 | リビジョン |
TransactionSetting
トランザクション設定
トランザクション設定は、トランザクションの実行方法・整合性・非同期処理・競合回避の仕組みを制御する設定です。
自動実行(AutoRun)、アトミック実行(AtomicCommit)、GS2-Distributor を利用した非同期実行、スクリプト結果の一括適用、GS2-JobQueue による入手アクションの非同期化などを組み合わせ、ゲームロジックに応じた堅牢なトランザクション管理を可能にします。
詳細
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| enableAutoRun | bool | false | 発行したトランザクションをサーバーサイドで自動的に実行するか | |||
| enableAtomicCommit | bool | {enableAutoRun} == true | false | トランザクションの実行をアトミックにコミットするか ※ enableAutoRun が true であれば 有効 | ||
| transactionUseDistributor | bool | {enableAtomicCommit} == true | false | トランザクションを非同期処理で実行する ※ enableAtomicCommit が true であれば 有効 | ||
| commitScriptResultInUseDistributor | bool | {transactionUseDistributor} == true | false | スクリプトの結果コミット処理を非同期処理で実行するか ※ transactionUseDistributor が true であれば 有効 | ||
| acquireActionUseJobQueue | bool | {enableAtomicCommit} == true | false | 入手アクションを実行する際に GS2-JobQueue を使用するか ※ enableAtomicCommit が true であれば 有効 | ||
| distributorNamespaceId | string | “grn:gs2:{region}:{ownerId}:distributor:default” | ~ 1024文字 | トランザクションの実行に使用する GS2-Distributor ネームスペース GRN | ||
| queueNamespaceId | string | “grn:gs2:{region}:{ownerId}:queue:default” | ~ 1024文字 | トランザクションの実行に使用する GS2-JobQueue のネームスペース GRN |
ScriptSetting
スクリプト設定
GS2 ではマイクロサービスのイベントに関連づけて、カスタムスクリプトを実行することができます。
このモデルは、スクリプトの実行をトリガーするための設定を保持します。
スクリプトの実行方式は大きく2種類あり、それは「同期実行」と「非同期実行」です。
同期実行は、スクリプトの実行が完了するまで処理がブロックされます。
代わりに、スクリプトの実行結果を使って API の実行を止めたり、API のレスポンス内容を制御することができます。
一方、非同期実行ではスクリプトの完了を待つために処理がブロックされることはありません。
ただし、スクリプトの実行結果を利用して API の実行を停止したり、API の応答内容を変更することはできません。
非同期実行は API の応答フローに影響を与えないため、原則として非同期実行を推奨します。
非同期実行には実行方式が2種類あり、GS2-Script と Amazon EventBridge があります。
Amazon EventBridge を使用することで、Lua 以外の言語で処理を記述することができます。
詳細
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| triggerScriptId | string | ~ 1024文字 | API 実行時に同期的に実行される GS2-Script のスクリプト
GRN 「grn:gs2:」ではじまる GRN 形式のIDで指定する必要があります。 | |||||||||||
| doneTriggerTargetType | 文字列列挙型 enum { “none”, “gs2_script”, “aws” } | “none” | 非同期スクリプトの実行方法 非同期実行で使用するスクリプトの種類を指定します。 「非同期実行のスクリプトを使用しない(none)」「GS2-Scriptを使用する(gs2_script)」「Amazon EventBridgeを使用する(aws)」が選択できます。
| |||||||||||
| doneTriggerScriptId | string | {doneTriggerTargetType} == “gs2_script” | ~ 1024文字 | 非同期実行する GS2-Script スクリプト
GRN 「grn:gs2:」ではじまる GRN 形式のIDで指定する必要があります。 ※ doneTriggerTargetType が “gs2_script” であれば 有効 | ||||||||||
| doneTriggerQueueNamespaceId | string | {doneTriggerTargetType} == “gs2_script” | ~ 1024文字 | 非同期実行スクリプトを実行する GS2-JobQueue ネームスペース
GRN 非同期実行スクリプトを直接実行するのではなく、GS2-JobQueue を経由する場合は GS2-JobQueue のネームスペースGRN を指定します。 GS2-JobQueue を利用する理由は多くはありませんので、特に理由がなければ指定する必要はありません。 ※ doneTriggerTargetType が “gs2_script” であれば 有効 |
NotificationSetting
プッシュ通知に関する設定
GS2 のマイクロサービス内で何らかのイベントが発生した際に、プッシュ通知を送信するための設定です。
ここでいうプッシュ通知は GS2-Gateway の提供する WebSocket インターフェースを経由した処理であり、スマートフォンのプッシュ通知とは性質が異なります。
たとえば、マッチメイキングが完了した時やフレンドリクエストが届いた時など、ゲームクライアントの操作とは関係なく状態が変化した際に GS2-Gateway を経由してプッシュ通知をすることで、ゲームクライアントは状態の変化を検知することができます。
GS2-Gateway のプッシュ通知は通知先のデバイスがオフラインだった時に追加の処理としてモバイルプッシュ通知を送信できます。
モバイルプッシュ通知をうまく利用すれば、マッチメイキング中にゲームを終了しても、モバイルプッシュ通知を使用してプレイヤーに通知し、ゲームに戻ってくるフローを実現できる可能性があります。
詳細
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| gatewayNamespaceId | string | “grn:gs2:{region}:{ownerId}:gateway:default” | ~ 1024文字 | プッシュ通知に使用する GS2-Gateway のネームスペース 「grn:gs2:」から始まる GRN 形式で GS2-Gateway のネームスペースIDを指定します。 | ||||||||
| enableTransferMobileNotification | bool? | false | モバイルプッシュ通知へ転送するか この通知を送信しようとした時、通知先のデバイスがオフラインだった場合、モバイルプッシュ通知へ転送するかどうかを指定します。 | |||||||||
| sound | string | {enableTransferMobileNotification} == true | ~ 1024文字 | モバイルプッシュ通知で使用するサウンドファイル名 ここで指定したサウンドファイル名は、モバイルプッシュ通知を送信する際に使用され、特別なサウンドで通知を出すことができます。 ※ enableTransferMobileNotification が true であれば 有効 | ||||||||
| enable | 文字列列挙型 enum { “Enabled”, “Disabled” } | “Enabled” | プッシュ通知を有効にするか
|
LogSetting
ログの出力設定
ログデータの出力設定を管理します。この型は、ログデータを書き出すために使用される GS2-Log ネームスペースの識別子(Namespace ID)を保持します。
ログネームスペースID(loggingNamespaceId)には、ログデータを収集し保存する GS2-Log のネームスペースを、GRNの形式で指定します。
この設定をすることで、設定されたネームスペース内で発生したAPIリクエスト・レスポンスのログデータが、対象の GS2-Log ネームスペース側へ出力されるようになります。
GS2-Log ではリアルタイムでログが提供され、システムの監視や分析、デバッグなどに利用できます。
詳細
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| loggingNamespaceId | string | ✓ | ~ 1024文字 | ログを出力する GS2-Log のネームスペース
GRN 「grn:gs2:」ではじまる GRN 形式のIDで指定する必要があります。 |
GitHubCheckoutSetting
GitHubからマスターデータをチェックアウトする設定
詳細
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| apiKeyId | string | ✓ | ~ 1024文字 | GitHub APIキーの GRN | ||||||||||
| repositoryName | string | ✓ | ~ 1024文字 | リポジトリ名 | ||||||||||
| sourcePath | string | ✓ | ~ 1024文字 | マスターデータ(JSON)ファイルのパス | ||||||||||
| referenceType | 文字列列挙型 enum { “commit_hash”, “branch”, “tag” } | ✓ | コードの取得元
| |||||||||||
| commitHash | string | {referenceType} == “commit_hash” | ✓※ | ~ 1024文字 | コミットハッシュ ※ referenceType が “commit_hash” であれば 必須 | |||||||||
| branchName | string | {referenceType} == “branch” | ✓※ | ~ 1024文字 | ブランチ名 ※ referenceType が “branch” であれば 必須 | |||||||||
| tagName | string | {referenceType} == “tag” | ✓※ | ~ 1024文字 | タグ名 ※ referenceType が “tag” であれば 必須 |
Gathering
ギャザリング
マッチメイキングによって集められたゲームプレイヤーグループを表すエンティティです。
マッチメイキング用のパラメータを複数持っており、パラメータを総合的に判断してプレイヤーをグルーピングします。
プレイヤーは自身のロール・属性値・拒否リスト(一緒にプレイしたくないユーザー)を指定してギャザリングに参加します。
参加時には属性値の範囲条件、ロールの定員、ホワイトリスト制限(allowUserIds)が検証されます。
すべてのロール枠が定員に達するとギャザリングは完成状態となり、マッチメイキングが完了します。
ギャザリング名は UUID 形式で自動生成され、有効期限を設定して自動クリーンアップすることも可能です。
詳細
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| gatheringId | string | ※ | ~ 1024文字 | ギャザリング
GRN ※ サーバーが自動で設定 | ||
| name | string | ✓ | UUID | ~ 128文字 | ギャザリング名 ギャザリングの一意な名前を保持します。 名前は UUID(Universally Unique Identifier)フォーマットで自動的に生成され、ギャザリングを識別するために使用されます。 | |
| attributeRanges | List<AttributeRange> | [] | 0 ~ 5 items | 募集条件 このギャザリングに参加するためにプレイヤーが満たすべき属性範囲条件のリスト。 各エントリは属性名と許容される最小値・最大値の範囲を指定します。 プレイヤー自身の属性値がこの範囲内でなければ参加できません。最大5件。 | ||
| capacityOfRoles | List<CapacityOfRole> | [] | 1 ~ 5 items | 募集枠リスト このギャザリングの募集枠を定義します。 各エントリはロール名、その別名、およびそのロールに参加可能な最大人数を指定します。 すべてのロール枠が定員に達するとマッチメイキングが完了となります。最小1件、最大5件。 | ||
| allowUserIds | List<string> | [] | 0 ~ 100 items | 参加許可ユーザーIDリスト このギャザリングへの参加を許可されたユーザーIDのホワイトリスト。 指定した場合、リストに含まれるユーザーのみがこのギャザリングのマッチメイキングに参加できます。 フレンド限定マッチメイキングや招待制マッチメイキングに利用します。最大100件。 | ||
| metadata | string | ~ 1024文字 | メタデータ メタデータには任意の値を設定できます。 これらの値は GS2 の動作には影響しないため、ゲーム内で利用する情報の保存先として使用できます。 | |||
| expiresAt | long | ギャザリングの有効期限 このギャザリングが自動的に期限切れとなり削除される時刻。 この時刻までにマッチメイキングが完了しない場合、ギャザリングはクリーンアップされます。 未指定の場合、マッチメイキングが完了するか手動で削除されるまでギャザリングは維持されます。 | ||||
| createdAt | long | ※ | 現在時刻 | 作成日時 UNIX 時間・ミリ秒 ※ サーバーが自動で設定 | ||
| updatedAt | long | ※ | 現在時刻 | 最終更新日時 UNIX 時間・ミリ秒 ※ サーバーが自動で設定 | ||
| revision | long | 0 | 0 ~ 9223372036854775805 | リビジョン |
SeasonGathering
シーズンギャザリング
シーズン期間中にプレイヤーを集める永続的なギャザリング。
マッチメイキング完了後に解散する通常のギャザリングとは異なり、シーズンギャザリングはシーズン中ずっと存続し参加者を蓄積します。
プレイヤーはティアー(GS2-Experience のランクに基づく)とシーズン番号でグルーピングされ、各シーズンギャザリングには SeasonModel で定義された最大参加人数の制限があります。
詳細
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| seasonGatheringId | string | ※ | ~ 1024文字 | シーズンギャザリング
GRN ※ サーバーが自動で設定 | ||
| seasonName | string | ✓ | ~ 128文字 | シーズンモデル名 シーズンモデル固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 | ||
| season | long | ✓ | 0 ~ 9223372036854775805 | シーズン | ||
| tier | long | ✓ | 0 ~ 9223372036854775805 | ティアー 同程度のランクのプレイヤーをグルーピングするためのティアーレベル。 SeasonModel で指定された GS2-Experience モデルにおけるプレイヤーのランクによって決定されます。 プレイヤーは同じティアーのプレイヤーとのみマッチングされ、公平な対戦が保証されます。 | ||
| name | string | ✓ | UUID | ~ 128文字 | シーズンギャザリング名 シーズンギャザリング固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 | |
| participants | List<string> | [] | 0 ~ 1000 items | 参加者のユーザーIDリスト このシーズンギャザリングに参加したプレイヤーのユーザーIDリスト。 プレイヤーが参加するとこのリストに追加され、最大参加人数に達するまでシーズン中ずっと増え続けます。 | ||
| createdAt | long | ※ | 現在時刻 | 作成日時 UNIX 時間・ミリ秒 ※ サーバーが自動で設定 | ||
| revision | long | 0 | 0 ~ 9223372036854775805 | リビジョン |
JoinedSeasonGathering
参加中のシーズンギャザリング
特定のシーズンとティアーにおいて、プレイヤーがどのシーズンギャザリングに参加しているかを追跡するレコード。
プレイヤーがシーズンギャザリングに参加した際に自動的に作成され、プレイヤーの現在のギャザリングを素早く検索するためのインデックスとして機能します。
各プレイヤーはシーズンとティアーの組み合わせごとに最大1つのシーズンギャザリングに所属できます。
詳細
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| joinedSeasonGatheringId | string | ※ | ~ 1024文字 | 参加中のシーズンギャザリング
GRN ※ サーバーが自動で設定 | ||
| userId | string | ✓ | ~ 128文字 | ユーザーID | ||
| seasonName | string | ✓ | ~ 128文字 | シーズンモデル名 シーズンモデル固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 | ||
| season | long | ✓ | 0 ~ 9223372036854775805 | シーズン | ||
| tier | long | ✓ | 0 ~ 9223372036854775805 | ティアー 同程度のランクのプレイヤーをグルーピングするためのティアーレベル。 SeasonModel で指定された GS2-Experience モデルにおけるプレイヤーのランクによって決定されます。 プレイヤーは同じティアーのプレイヤーとのみマッチングされ、公平な対戦が保証されます。 | ||
| seasonGatheringName | string | ✓ | ~ 128文字 | シーズンギャザリング名 このプレイヤーが参加しているシーズンギャザリングの名前。 同一シーズン・ティアー内の特定のシーズンギャザリングエンティティを参照するために使用されます。 | ||
| createdAt | long | ※ | 現在時刻 | 作成日時 UNIX 時間・ミリ秒 ※ サーバーが自動で設定 |
Rating
レーティング
ゲームプレイヤー毎の現在のレーティングの値を保持するエンティティです。
プレイヤーが初めてレーティング付きマッチメイキングに参加した時に自動的に作成されます。
レーティングは Glicko-2 アルゴリズムを使用して計算され、初期レート値とレーティングの不確実性を表す Rating Deviation (rd) を持ちます。
対戦回数が増えるにつれて、レート値はプレイヤーの真の実力に収束していきます。
詳細
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| ratingId | string | ※ | ~ 1024文字 | レーティング
GRN ※ サーバーが自動で設定 | ||
| name | string | ✓ | ~ 128文字 | レーティング名 レーティング固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 | ||
| userId | string | ✓ | ~ 128文字 | ユーザーID | ||
| rateValue | float | 1500.0 | 0 ~ 65535.0 | レート値 Glicko-2 アルゴリズムで計算されたプレイヤーの現在のレーティングスコア。 RatingModel で定義された初期値(通常 1500.0)がデフォルトです。 対戦結果と対戦相手の相対的な強さに基づいて値が増減します。 | ||
| createdAt | long | ※ | 現在時刻 | 作成日時 UNIX 時間・ミリ秒 ※ サーバーが自動で設定 | ||
| updatedAt | long | ※ | 現在時刻 | 最終更新日時 UNIX 時間・ミリ秒 ※ サーバーが自動で設定 | ||
| revision | long | 0 | 0 ~ 9223372036854775805 | リビジョン |
Ballot
投票用紙
レーティング付きマッチメイキングのゲーム終了後に、各プレイヤーが対戦結果を報告するために発行される投票用紙。
レーティングモデル名、ギャザリング名、参加人数といった対戦のコンテキスト情報を含みます。
各プレイヤーはサーバーで署名された投票用紙を受け取り、ゲーム結果を記入して Vote API に提出します。
投票システムは、レーティング計算を確定するために提出された投票用紙の50%超の合意を必要とします。
詳細
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| userId | string | ✓ | ~ 128文字 | ユーザーID | ||
| ratingName | string | ✓ | ~ 128文字 | レーティング名 この対戦後のレーティング計算に使用する RatingModel の名前。 この対戦の結果処理に適用されるレーティングシステムのパラメータ(初期値、ボラティリティ)を特定します。 | ||
| gatheringName | string | ✓ | ~ 128文字 | ギャザリング名 対戦結果の報告対象となるギャザリングの名前。 特定のマッチメイキングセッションを識別し、同じ対戦の全参加者からの投票を関連付けるために使用されます。 | ||
| numberOfPlayer | int | ✓ | 2 ~ 10 | 参加人数 この対戦に参加したプレイヤーの総数。 期待される投票数の決定と合意の検証(プレイヤーの50%超が一致する結果を提出する必要がある)に使用されます。 2 から 10 の範囲で指定します。 |
Vote
投票状況
レーティング計算のための最終的な対戦結果を決定するために、特定の対戦の投票用紙を集約するエンティティ。
各 Vote はレーティングモデル名とギャザリング名の組み合わせで識別されます。
対戦参加者から投票用紙が収集され、一致する結果を持つ投票が十分に提出されると(50%超の合意)、
投票が完了とみなされ、参加者のレーティング値が対戦結果に基づいて更新されます。
詳細
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| voteId | string | ※ | ~ 1024文字 | 投票状況
GRN ※ サーバーが自動で設定 | ||
| ratingName | string | ✓ | ~ 128文字 | レーティングモデル名 レーティングモデル固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 | ||
| gatheringName | string | ✓ | UUID | ~ 128文字 | ギャザリング名 ギャザリングの一意な名前を保持します。 名前は UUID(Universally Unique Identifier)フォーマットで自動的に生成され、ギャザリングを識別するために使用されます。 | |
| writtenBallots | List<WrittenBallot> | [] | 0 ~ 10 items | 記入済み投票用紙のリスト 対戦参加者から提出された投票用紙のコレクション。 各記入済み投票用紙は署名付き投票用紙と、その参加者が報告したゲーム結果(プレイヤーの順位)を含みます。 期待される投票数の50%超が一致する結果を含む場合、投票が確定しレーティング計算が実行されます。最大10件。 | ||
| createdAt | long | ※ | 現在時刻 | 作成日時 UNIX 時間・ミリ秒 ※ サーバーが自動で設定 | ||
| updatedAt | long | ※ | 現在時刻 | 最終更新日時 UNIX 時間・ミリ秒 ※ サーバーが自動で設定 |
RatingModel
レーティングモデル
GS2 ではレーティングアルゴリズムとして Glicko-2 を採用しています。
Glicko-2 には複数のパラメータがありますが、GS2-Matchmaking ではそれらを総合的に表す ボラティリティ という1つのパラメータに集約しています。
ボラティリティ は変化の大きさを表すパラメータで、値が大きいほどレーティングの値の変動量が大きくなります。
詳細
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| ratingModelId | string | ※ | ~ 1024文字 | レーティングモデル
GRN ※ サーバーが自動で設定 | ||
| name | string | ✓ | ~ 128文字 | レーティングモデル名 レーティングモデル固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 | ||
| metadata | string | ~ 128文字 | メタデータ メタデータには任意の値を設定できます。 これらの値は GS2 の動作には影響しないため、ゲーム内で利用する情報の保存先として使用できます。 | |||
| initialValue | int | 1500 | 100 ~ 10000 | レート値の初期値 プレイヤーが初めてレーティング付きマッチメイキングに参加したときに割り当てられる開始レート値。 デフォルトは 1500 です。すべてのプレイヤーは同じレーティングから開始し、対戦結果に基づいて調整されます。 | ||
| volatility | int | 100 | 1 ~ 20000 | レーティングのボラティリティ 各対戦後にレート値がどの程度変動するかを制御する Glicko-2 のパラメータ。 値が大きいほどレーティングの変動幅が大きくなり、より早くレーティングが調整されます。 値が小さいほどレーティングが安定し、緩やかに変化します。デフォルトは 100 です。 |
SeasonModel
シーズンモデル
シーズンマッチメイキングにおいて、一定期間有効な永続ギャザリングの期間・最大参加人数・ティアー連携設定を定義するマスターデータです。
GS2-Schedule により期間を管理し、必要に応じて GS2-Experience と連携して同一ティアー内で永続ギャザリングを形成します。
詳細
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| seasonModelId | string | ※ | ~ 1024文字 | シーズンモデル
GRN ※ サーバーが自動で設定 | ||
| name | string | ✓ | ~ 128文字 | シーズンモデル名 シーズンモデル固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 | ||
| metadata | string | ~ 128文字 | メタデータ メタデータには任意の値を設定できます。 これらの値は GS2 の動作には影響しないため、ゲーム内で利用する情報の保存先として使用できます。 | |||
| maximumParticipants | int | ✓ | 2 ~ 1000 | 最大参加人数 1つのシーズンギャザリングに参加可能なプレイヤーの最大人数。 この上限に達するとシーズンギャザリングは満員となり、それ以上のプレイヤーは参加できなくなります。 2 から 1000 の範囲で指定します。 | ||
| experienceModelId | string | ~ 1024文字 | ティアー管理用の経験値モデル
GRN プレイヤーのティアーを決定するために使用する GS2-Experience の経験値モデルの GRN。 この経験値モデルにおけるプレイヤーのランクがマッチメイキングのティアーとして使用され、同程度のレベルのプレイヤー同士がグルーピングされます。 未指定の場合、ティアーによるグルーピングは無効となり、レベルに関係なく全プレイヤーがマッチングされます。 | |||
| challengePeriodEventId | string | ✓ | ~ 1024文字 | チャレンジ期間イベント
GRN このシーズンの有効期間を定義する GS2-Schedule イベントの GRN。 このイベントがアクティブな間のみ、シーズンギャザリングの作成・参加が可能です。 イベント期間が終了するとシーズンがクローズし、新しいマッチメイキングはできなくなります。 |
AttributeRange
募集条件
ギャザリングに参加するための属性の許容範囲を定義する条件。
プレイヤーが参加を試みる際、対応する名前の属性値が指定された最小値・最大値の範囲内である必要があります。
スキルベースやレベルベースのマッチメイキングフィルターを作成するために使用されます。
詳細
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| name | string | ✓ | ~ 128文字 | 属性名 この範囲条件を適用する属性の名前。 条件が評価されるためには、プレイヤーの属性リスト内の属性名と一致する必要があります。 | ||
| min | int | 0 | 0 ~ 2147483646 | 属性値の最小値 ギャザリングに参加するために必要な属性値の下限(この値を含む)。 属性値がこの閾値を下回るプレイヤーは参加できません。 | ||
| max | int | 0 | 0 ~ 2147483646 | 属性値の最大値 ギャザリングに参加可能な属性値の上限(この値を含む)。 属性値がこの閾値を超えるプレイヤーは参加できません。 |
CapacityOfRole
募集枠
ギャザリング内の特定のロールに対する募集枠を定義します。
各ロールは名前、オプションの別名、最大定員、および現在参加しているプレイヤーリストを持ちます。
ロールの別名により柔軟なマッチングが可能です。例えば「タンク」ロールに「パラディン」「ナイト」の別名を設定すると、どちらのサブロールを指定したプレイヤーもタンク枠を埋められます。
すべてのロールの参加者が定員に達すると、ギャザリングのマッチメイキングが完了します。
詳細
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| roleName | string | “default” | ~ 128文字 | ロール名 この募集枠のロール名。 ロール区分のない一般的なマッチメイキングの場合、デフォルト値 “default” を使用します。 ロールベースのマッチメイキング(例: “タンク”、“ヒーラー”、“アタッカー”)の場合、ここにロールカテゴリ名を指定します。 | ||
| roleAliases | List<string> | [] | 0 ~ 9 items | ロール名の別名リスト この募集枠で受け入れ可能な代替ロール名。 これらの別名のいずれかをロール名として指定したプレイヤーが、この枠にマッチングされます。 サブロールマッチングを実現します。例: “タンク” ロールに対する “パラディン” と “ナイト” の別名。最大9件。 | ||
| capacity | int | ✓ | 1 ~ 256 | 募集人数 このロール枠を埋めることができるプレイヤーの最大数。 参加者数がこの定員に達すると、ロールは満員となりこのロールのプレイヤーはそれ以上参加できません。 1 から 256 の範囲で指定します。 | ||
| participants | List<Player> | [] | 0 ~ 1000 items | 参加者のプレイヤー情報リスト 現在このロール枠を占有しているプレイヤーのリスト。 プレイヤーはギャザリングに参加すると追加され、離脱すると削除されます。 各プレイヤーエントリにはユーザーID、属性、ロール名、拒否リストが含まれます。ユーザーIDによる一意性が保証されます。 |
Attribute
属性値
マッチメイキングのためにプレイヤーに関連付けられた名前付きの数値属性。
ギャザリングの AttributeRange 条件と組み合わせて、どのプレイヤーが参加可能かをフィルタリングするために使用されます。
例えば「レベル」属性の値が 50 のプレイヤーは、レベル 40〜60 を要求するギャザリングにマッチします。
各プレイヤーは最大5つの属性を持てます。
詳細
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| name | string | ✓ | ~ 128文字 | 属性名 属性固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 | ||
| value | int | 0 | 0 ~ 2147483646 | 属性値 このプレイヤーの属性の数値。 マッチメイキング時にギャザリングの AttributeRange 条件で指定された最小値・最大値の範囲と照合されます。 |
Player
参加者のプレイヤー情報
マッチメイキングに参加するプレイヤーを表し、ID、属性、ロール、拒否リストを含みます。
ギャザリングに参加する際、プレイヤーの属性値、希望するロール、一緒にプレイしたくないユーザーのリストを持つ Player オブジェクトが作成されます。
プレイヤーの属性はギャザリングの属性範囲条件と照合され、拒否リストは不要なペアリングを防ぐためにクロスチェックされます。
詳細
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| userId | string | ✓ | ~ 128文字 | ユーザーID | ||
| attributes | List<Attribute> | [] | 0 ~ 5 items | 属性値のリスト マッチメイキング条件の評価に使用されるプレイヤーの名前付き数値属性。 各属性はギャザリングの AttributeRange 条件と照合され参加資格が判定されます。 ギャザリング作成時に範囲条件を設定する場合、プレイヤー自身の属性値もその範囲内である必要があります。最大5件。 | ||
| roleName | string | “default” | ~ 128文字 | ロール名 このプレイヤーがギャザリングで埋めたいロール。 ロール区分のない一般的なマッチメイキングの場合、デフォルト値 “default” を使用します。 ロールベースのマッチメイキングの場合、プレイヤーの具体的なロール(例: “パラディン”、“ナイト”)を指定し、ギャザリングの定員定義のロール名および別名とマッチングされます。 | ||
| denyUserIds | List<string> | [] | 0 ~ 100 items | 参加拒否ユーザーIDリスト このプレイヤーがマッチングを拒否するユーザーIDのブラックリスト。 マッチメイキング時、ギャザリングに既に参加しているプレイヤーがこのリストに含まれている場合、そのギャザリングに参加できません。 逆に、既存の参加者の拒否リストにこのプレイヤーが含まれている場合も参加がブロックされます。最大100件。 | ||
| createdAt | long | ※ | 現在時刻 | 作成日時 UNIX 時間・ミリ秒 ※ サーバーが自動で設定 |
GameResult
対戦結果
Vote システムを通じたレーティング計算に使用される、対戦における1人のプレイヤーの結果を表します。
各 GameResult エントリはユーザーIDとその対戦での順位(最終順位)をペアにします。
順位の値が小さいほど高い成績を示します(1位 = rank 1)。同じ順位のプレイヤーは引き分けとして扱われます。
詳細
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| rank | int | ✓ | 0 ~ 2147483646 | 順位 対戦におけるプレイヤーの最終順位。1 が最上位(勝者)です。 Glicko-2 アルゴリズムによるレーティング変動の計算に使用されます。上位のプレイヤーはレーティングが上昇し、下位のプレイヤーはレーティングが低下します。 同じ順位のプレイヤーは引き分けとして処理されます。 | ||
| userId | string | ✓ | ~ 128文字 | ユーザーID |
SignedBallot
署名付き投票用紙
真正性を検証するためのデジタル署名が付与された投票用紙。
マッチメイキング完了後にサーバーがプレイヤーに署名付き投票用紙を発行し、正当な参加者のみが対戦結果を提出できることを保証します。
投票用紙が Vote API に提出される際に署名が検証され、対戦コンテキスト(レーティング名、ギャザリング名、参加人数)の改ざんを防止します。
詳細
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| body | string | ✓ | ~ 1024文字 | 投票用紙本体 デジタル署名の対象となるシリアライズされた投票用紙データ。 署名と照合して検証可能な形式で、投票コンテキスト(ユーザーID、レーティング名、ギャザリング名、参加人数)を含みます。 | ||
| signature | string | ✓ | ~ 256文字 | 署名 投票用紙本体の真正性と完全性を検証するためのデジタル署名。 GS2-Key の暗号化キーを使用してサーバーで生成され、投票用紙の提出時に偽造や改ざんを防止するために検証されます。 |
WrittenBallot
記入済み投票用紙
対戦結果を書き込んだ投票用紙を表すデータモデルです。
ユーザーIDと順位を含む投票内容を保持し、署名付きで Vote API に渡されます。
TimeSpan
時間間隔(期間)
日・時間・分で構成される時間の長さを表します。
現在時刻からのギャザリングの有効期限など、相対的な時間オフセットの指定に使用されます。
全体の期間は3つのコンポーネントを合算して計算されます。
詳細
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| days | int | 0 | 0 ~ 365 | 日数 期間における日数。最大365日。デフォルトは0。 | ||
| hours | int | 0 | 0 ~ 24 | 時間 期間における時間数。最大24時間。デフォルトは0。 | ||
| minutes | int | 0 | 0 ~ 60 | 分 期間における分数。最大60分。デフォルトは0。 |
CurrentModelMaster
現在アクティブなモデルのマスターデータ
現在ネームスペース内で有効な、モデルの定義を記述したマスターデータです。
GS2ではマスターデータの管理にJSON形式のファイルを使用します。
ファイルをアップロードすることで、実際にサーバーに設定を反映することができます。
JSONファイルを作成する方法として、マネージメントコンソール内にマスターデータエディタを提供しています。
また、よりゲームの運営に相応しいツールを作成し、適切なフォーマットのJSONファイルを書き出すことでもサービスを利用可能です。
Note
JSONファイルの形式については GS2-Matchmaking マスターデータリファレンス をご参照ください。詳細
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| namespaceId | string | ※ | ~ 1024文字 | ネームスペース
GRN ※ サーバーが自動で設定 | ||
| settings | string | ✓ | ~ 5242880 バイト (5MB) | マスターデータ |
RatingModelMaster
レーティングモデルマスター
レーティングモデルマスターは、ゲーム内で使用されるレーティングモデルの編集・管理用データで、マネージメントコンソールのマスターデータエディタで一時的に保持されます。
インポート・更新処理を行うことで、実際にゲームから参照されるレーティングモデルとして反映されます。
GS2 ではレーティングアルゴリズムとして Glicko-2 を採用しています。
Glicko-2 には複数のパラメータがありますが、GS2-Matchmaking ではそれらを総合的に表す ボラティリティ という1つのパラメータに集約しています。
ボラティリティ は変化の大きさを表すパラメータで、値が大きいほどレーティングの値の変動量が大きくなります。
詳細
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| ratingModelId | string | ※ | ~ 1024文字 | レーティングモデルマスター
GRN ※ サーバーが自動で設定 | ||
| name | string | ✓ | ~ 128文字 | レーティングモデル名 レーティングモデル固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 | ||
| metadata | string | ~ 128文字 | メタデータ メタデータには任意の値を設定できます。 これらの値は GS2 の動作には影響しないため、ゲーム内で利用する情報の保存先として使用できます。 | |||
| description | string | ~ 1024文字 | 説明文 | |||
| initialValue | int | 1500 | 100 ~ 10000 | レート値の初期値 プレイヤーが初めてレーティング付きマッチメイキングに参加したときに割り当てられる開始レート値。 デフォルトは 1500 です。すべてのプレイヤーは同じレーティングから開始し、対戦結果に基づいて調整されます。 | ||
| volatility | int | 100 | 1 ~ 20000 | レーティングのボラティリティ 各対戦後にレート値がどの程度変動するかを制御する Glicko-2 のパラメータ。 値が大きいほどレーティングの変動幅が大きくなり、より早くレーティングが調整されます。 値が小さいほどレーティングが安定し、緩やかに変化します。デフォルトは 100 です。 | ||
| createdAt | long | ※ | 現在時刻 | 作成日時 UNIX 時間・ミリ秒 ※ サーバーが自動で設定 | ||
| updatedAt | long | ※ | 現在時刻 | 最終更新日時 UNIX 時間・ミリ秒 ※ サーバーが自動で設定 | ||
| revision | long | 0 | 0 ~ 9223372036854775805 | リビジョン |
SeasonModelMaster
シーズンモデルマスター
シーズンモデルマスターは、ゲーム内で使用されるレーティングモデルの編集・管理用データで、マネージメントコンソールのマスターデータエディタで一時的に保持されます。
インポート・更新処理を行うことで、実際にゲームから参照されるレーティングモデルとして反映されます。
シーズンモデルは、シーズンマッチメイキングにおいて、一定期間有効な永続ギャザリングの期間・最大参加人数・ティアー連携設定を定義するマスターデータです。
GS2-Schedule により期間を管理し、必要に応じて GS2-Experience と連携して同一ティアー内で永続ギャザリングを形成します。
詳細
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| seasonModelId | string | ※ | ~ 1024文字 | シーズンモデルマスター
GRN ※ サーバーが自動で設定 | ||
| name | string | ✓ | ~ 128文字 | シーズンモデル名 シーズンモデル固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 | ||
| metadata | string | ~ 128文字 | メタデータ メタデータには任意の値を設定できます。 これらの値は GS2 の動作には影響しないため、ゲーム内で利用する情報の保存先として使用できます。 | |||
| description | string | ~ 1024文字 | 説明文 | |||
| maximumParticipants | int | ✓ | 2 ~ 1000 | 最大参加人数 1つのシーズンギャザリングに参加可能なプレイヤーの最大人数。 この上限に達するとシーズンギャザリングは満員となり、それ以上のプレイヤーは参加できなくなります。 2 から 1000 の範囲で指定します。 | ||
| experienceModelId | string | ~ 1024文字 | ティアー管理用の経験値モデル
GRN プレイヤーのティアーを決定するために使用する GS2-Experience の経験値モデルの GRN。 この経験値モデルにおけるプレイヤーのランクがマッチメイキングのティアーとして使用され、同程度のレベルのプレイヤー同士がグルーピングされます。 未指定の場合、ティアーによるグルーピングは無効となり、レベルに関係なく全プレイヤーがマッチングされます。 | |||
| challengePeriodEventId | string | ✓ | ~ 1024文字 | チャレンジ期間イベント
GRN このシーズンの有効期間を定義する GS2-Schedule イベントの GRN。 このイベントがアクティブな間のみ、シーズンギャザリングの作成・参加が可能です。 イベント期間が終了するとシーズンがクローズし、新しいマッチメイキングはできなくなります。 | ||
| createdAt | long | ※ | 現在時刻 | 作成日時 UNIX 時間・ミリ秒 ※ サーバーが自動で設定 | ||
| updatedAt | long | ※ | 現在時刻 | 最終更新日時 UNIX 時間・ミリ秒 ※ サーバーが自動で設定 | ||
| revision | long | 0 | 0 ~ 9223372036854775805 | リビジョン |
メソッド
describeNamespaces
ネームスペースの一覧を取得
プロジェクト内において、サービス単位で作成されたネームスペースの一覧を取得します。
オプションのページトークンを使用して、リストの特定の位置からデータの取得を開始できます。
また、取得するネームスペースの数を制限することも可能です。
詳細
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| namePrefix | string | ~ 64文字 | ネームスペース名のフィルター接頭辞 | |||
| pageToken | string | ~ 1024文字 | データの取得を開始する位置を指定するトークン | |||
| limit | int | 30 | 1 ~ 1000 | データの取得件数 |
Result
| 型 | 説明 | |
|---|---|---|
| items | List<Namespace> | ネームスペースのリスト |
| nextPageToken | string | リストの続きを取得するためのページトークン |
実装例
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 {
NamePrefix: nil,
PageToken: nil,
Limit: nil,
}
)
if err != nil {
panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageTokenuse 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 Gs2MatchmakingRestClient(
$session
);
try {
$result = $client->describeNamespaces(
(new DescribeNamespacesRequest())
->withNamePrefix(null)
->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()
.withNamePrefix(null)
.withPageToken(null)
.withLimit(null)
);
List<Namespace> items = result.getItems();
String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);
AsyncResult<Gs2.Gs2Matchmaking.Result.DescribeNamespacesResult> asyncResult = null;
yield return client.DescribeNamespaces(
new Gs2.Gs2Matchmaking.Request.DescribeNamespacesRequest()
.WithNamePrefix(null)
.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()
.withNamePrefix(null)
.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_name_prefix(None)
.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({
namePrefix=nil,
pageToken=nil,
limit=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;client = gs2('matchmaking')
api_result_handler = client.describe_namespaces_async({
namePrefix=nil,
pageToken=nil,
limit=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;createNamespace
ネームスペースを新規作成
ネームスペースの名前、説明、および各種設定を含む詳細情報を指定する必要があります。
詳細
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| name | string | ✓ | ~ 128文字 | ネームスペース名 ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 | ||||||||||
| description | string | ~ 1024文字 | 説明文 | |||||||||||
| transactionSetting | TransactionSetting | トランザクション設定 マッチメイキング操作時のトランザクションの処理方法を制御する設定です。 | ||||||||||||
| enableRating | bool | false | レーティング計算機能の有効化 Glicko-2 ベースのレーティング計算機能を有効にするかどうか。 有効にすると、プレイヤーは Vote システムを通じて対戦結果を送信し、レーティングが自動的に更新されます。 RatingModel マスターデータの設定が必要です。デフォルトは false です。 | |||||||||||
| enableDisconnectDetection | 文字列列挙型 enum { “disable”, “enable” } | “disable” | 切断検知 マッチメイキング中のプレイヤーが待機中であることを定期的に報告する必要があるかを制御します。 有効にすると、プレイヤーが設定されたタイムアウト期間内にキープアライブを送信しない場合、ギャザリングから自動的に退出処理されます。 これにより「ゴースト」プレイヤーがマッチメイキングの完了をブロックすることを防ぎます。デフォルトは “disable” です。
| |||||||||||
| disconnectDetectionTimeoutSeconds | int | {enableDisconnectDetection} == “enable” | ✓※ | 15 ~ 600 | 切断検知タイムアウト(秒) キープアライブ報告なしにプレイヤーを切断とみなしギャザリングから退出させるまでの待機秒数。 切断検知が有効な場合のみ適用されます。15 から 600 秒の範囲で指定します。 ※ enableDisconnectDetection が “enable” であれば必須 | |||||||||
| createGatheringTriggerType | 文字列列挙型 enum { “none”, “gs2_realtime”, “gs2_script” } | “none” | ギャザリング作成時トリガータイプ 新しいギャザリングが作成されたときに実行するアクションの種類。 GS2-Realtime のルーム作成をトリガーしてリアルタイム通信を開始したり、GS2-Script を実行してカスタムロジックを実行できます。デフォルトは “none” です。
| |||||||||||
| createGatheringTriggerRealtimeNamespaceId | string | {createGatheringTriggerType} == “gs2_realtime” | ✓※ | ~ 1024文字 | ギャザリング作成時にルームを作成する GS2-Realtime のネームスペース ※ createGatheringTriggerType が “gs2_realtime” であれば必須 | |||||||||
| createGatheringTriggerScriptId | string | {createGatheringTriggerType} == “gs2_script” | ✓※ | ~ 1024文字 | ギャザリング作成時に実行される GS2-Script のスクリプト
GRN ※ createGatheringTriggerType が “gs2_script” であれば必須 | |||||||||
| completeMatchmakingTriggerType | 文字列列挙型 enum { “none”, “gs2_realtime”, “gs2_script” } | “none” | マッチメイキング完了時トリガータイプ マッチメイキングが完了した(すべてのロール枠が埋まった)ときに実行するアクションの種類。 マッチングされたプレイヤー向けに GS2-Realtime のルーム作成をトリガーしたり、GS2-Script を実行してカスタムの事後処理ロジックを実行できます。デフォルトは “none” です。
| |||||||||||
| completeMatchmakingTriggerRealtimeNamespaceId | string | {completeMatchmakingTriggerType} == “gs2_realtime” | ✓※ | ~ 1024文字 | マッチメイキング完了時にルームを作成する GS2-Realtime のネームスペース
GRN ※ completeMatchmakingTriggerType が “gs2_realtime” であれば必須 | |||||||||
| completeMatchmakingTriggerScriptId | string | {completeMatchmakingTriggerType} == “gs2_script” | ✓※ | ~ 1024文字 | マッチメイキング完了時に実行される GS2-Script のスクリプト
GRN ※ completeMatchmakingTriggerType が “gs2_script” であれば必須 | |||||||||
| enableCollaborateSeasonRating | 文字列列挙型 enum { “enable”, “disable” } | “disable” | シーズンレーティング連携の有効化 シーズンベースのレーティング計算のために GS2-SeasonRating との連携を有効にするかどうか。 有効にすると、マッチメイキング完了時に指定した GS2-SeasonRating のネームスペースにレーティング計算セッションが自動作成されます。 デフォルトは “disable” です。
| |||||||||||
| collaborateSeasonRatingNamespaceId | string | {enableCollaborateSeasonRating} == “enable” | ✓※ | ~ 1024文字 | シーズンレーティングネームスペース
GRN ※ enableCollaborateSeasonRating が “enable” であれば必須 | |||||||||
| collaborateSeasonRatingTtl | int | {enableCollaborateSeasonRating} == “enable” | 60 | 60 ~ 7200 | シーズンレーティング結果TTL(秒) マッチメイキング完了後、GS2-SeasonRating 経由の対戦結果送信を受け付ける最大待機時間(秒)。 この期間内に結果が送信されない場合、レーティングセッションは期限切れとなります。60 から 7200 秒の範囲で指定します。デフォルトは 60 です。 ※ enableCollaborateSeasonRating が “enable” であれば必須 | |||||||||
| changeRatingScript | ScriptSetting | レーティング値が変化したときに実行するスクリプトの設定 Script トリガーリファレンス - changeRating | ||||||||||||
| joinNotification | NotificationSetting | 参加通知 新しいプレイヤーがギャザリングに参加したときのプッシュ通知設定。 既存の参加者に新しいプレイヤーが参加したことを通知し、ゲームクライアントがマッチメイキング UI を更新できるようにします。 | ||||||||||||
| leaveNotification | NotificationSetting | 離脱通知 プレイヤーがギャザリングから離脱したときのプッシュ通知設定。 残りの参加者にプレイヤーが離脱したことを通知し、ゲームクライアントに変更を反映させます。 | ||||||||||||
| completeNotification | NotificationSetting | 完了通知 マッチメイキングが完了した(すべてのロール枠が埋まった)ときのプッシュ通知設定。 すべての参加者にギャザリングが満員になり対戦を開始できることを通知します。 | ||||||||||||
| changeRatingNotification | NotificationSetting | レーティング変動通知 投票処理後にプレイヤーのレーティング値が変動したときのプッシュ通知設定。 影響を受けたプレイヤーに新しいレーティングを通知し、ゲームクライアントに更新された値を表示させます。 | ||||||||||||
| logSetting | LogSetting | ログの出力設定 APIリクエスト・レスポンスのログを GS2-Log に出力するための設定。 設定すると、マッチメイキングの操作(ギャザリングの作成・参加・離脱、投票、レーティング変動など)がモニタリングと分析のためにログ出力されます。 |
Result
| 型 | 説明 | |
|---|---|---|
| item | Namespace | 作成したネームスペース |
実装例
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("namespace-0001"),
Description: nil,
TransactionSetting: nil,
EnableRating: pointy.Bool(true),
EnableDisconnectDetection: nil,
DisconnectDetectionTimeoutSeconds: nil,
CreateGatheringTriggerType: pointy.String("none"),
CreateGatheringTriggerRealtimeNamespaceId: nil,
CreateGatheringTriggerScriptId: nil,
CompleteMatchmakingTriggerType: pointy.String("none"),
CompleteMatchmakingTriggerRealtimeNamespaceId: nil,
CompleteMatchmakingTriggerScriptId: nil,
EnableCollaborateSeasonRating: pointy.String("disable"),
CollaborateSeasonRatingNamespaceId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:seasonRating:namespace-0001"),
CollaborateSeasonRatingTtl: pointy.Int32(60),
ChangeRatingScript: nil,
JoinNotification: nil,
LeaveNotification: nil,
CompleteNotification: nil,
ChangeRatingNotification: nil,
LogSetting: &matchmaking.LogSetting{
LoggingNamespaceId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"),
},
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse 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 Gs2MatchmakingRestClient(
$session
);
try {
$result = $client->createNamespace(
(new CreateNamespaceRequest())
->withName("namespace-0001")
->withDescription(null)
->withTransactionSetting(null)
->withEnableRating(True)
->withEnableDisconnectDetection(null)
->withDisconnectDetectionTimeoutSeconds(null)
->withCreateGatheringTriggerType("none")
->withCreateGatheringTriggerRealtimeNamespaceId(null)
->withCreateGatheringTriggerScriptId(null)
->withCompleteMatchmakingTriggerType("none")
->withCompleteMatchmakingTriggerRealtimeNamespaceId(null)
->withCompleteMatchmakingTriggerScriptId(null)
->withEnableCollaborateSeasonRating("disable")
->withCollaborateSeasonRatingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:seasonRating:namespace-0001")
->withCollaborateSeasonRatingTtl(60)
->withChangeRatingScript(null)
->withJoinNotification(null)
->withLeaveNotification(null)
->withCompleteNotification(null)
->withChangeRatingNotification(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("namespace-0001")
.withDescription(null)
.withTransactionSetting(null)
.withEnableRating(true)
.withEnableDisconnectDetection(null)
.withDisconnectDetectionTimeoutSeconds(null)
.withCreateGatheringTriggerType("none")
.withCreateGatheringTriggerRealtimeNamespaceId(null)
.withCreateGatheringTriggerScriptId(null)
.withCompleteMatchmakingTriggerType("none")
.withCompleteMatchmakingTriggerRealtimeNamespaceId(null)
.withCompleteMatchmakingTriggerScriptId(null)
.withEnableCollaborateSeasonRating("disable")
.withCollaborateSeasonRatingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:seasonRating:namespace-0001")
.withCollaborateSeasonRatingTtl(60)
.withChangeRatingScript(null)
.withJoinNotification(null)
.withLeaveNotification(null)
.withCompleteNotification(null)
.withChangeRatingNotification(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;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);
AsyncResult<Gs2.Gs2Matchmaking.Result.CreateNamespaceResult> asyncResult = null;
yield return client.CreateNamespace(
new Gs2.Gs2Matchmaking.Request.CreateNamespaceRequest()
.WithName("namespace-0001")
.WithDescription(null)
.WithTransactionSetting(null)
.WithEnableRating(true)
.WithEnableDisconnectDetection(null)
.WithDisconnectDetectionTimeoutSeconds(null)
.WithCreateGatheringTriggerType("none")
.WithCreateGatheringTriggerRealtimeNamespaceId(null)
.WithCreateGatheringTriggerScriptId(null)
.WithCompleteMatchmakingTriggerType("none")
.WithCompleteMatchmakingTriggerRealtimeNamespaceId(null)
.WithCompleteMatchmakingTriggerScriptId(null)
.WithEnableCollaborateSeasonRating("disable")
.WithCollaborateSeasonRatingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:seasonRating:namespace-0001")
.WithCollaborateSeasonRatingTtl(60)
.WithChangeRatingScript(null)
.WithJoinNotification(null)
.WithLeaveNotification(null)
.WithCompleteNotification(null)
.WithChangeRatingNotification(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("namespace-0001")
.withDescription(null)
.withTransactionSetting(null)
.withEnableRating(true)
.withEnableDisconnectDetection(null)
.withDisconnectDetectionTimeoutSeconds(null)
.withCreateGatheringTriggerType("none")
.withCreateGatheringTriggerRealtimeNamespaceId(null)
.withCreateGatheringTriggerScriptId(null)
.withCompleteMatchmakingTriggerType("none")
.withCompleteMatchmakingTriggerRealtimeNamespaceId(null)
.withCompleteMatchmakingTriggerScriptId(null)
.withEnableCollaborateSeasonRating("disable")
.withCollaborateSeasonRatingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:seasonRating:namespace-0001")
.withCollaborateSeasonRatingTtl(60)
.withChangeRatingScript(null)
.withJoinNotification(null)
.withLeaveNotification(null)
.withCompleteNotification(null)
.withChangeRatingNotification(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('namespace-0001')
.with_description(None)
.with_transaction_setting(None)
.with_enable_rating(True)
.with_enable_disconnect_detection(None)
.with_disconnect_detection_timeout_seconds(None)
.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_enable_collaborate_season_rating('disable')
.with_collaborate_season_rating_namespace_id('grn:gs2:ap-northeast-1:YourOwnerId:seasonRating:namespace-0001')
.with_collaborate_season_rating_ttl(60)
.with_change_rating_script(None)
.with_join_notification(None)
.with_leave_notification(None)
.with_complete_notification(None)
.with_change_rating_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="namespace-0001",
description=nil,
transactionSetting=nil,
enableRating=true,
enableDisconnectDetection=nil,
disconnectDetectionTimeoutSeconds=nil,
createGatheringTriggerType="none",
createGatheringTriggerRealtimeNamespaceId=nil,
createGatheringTriggerScriptId=nil,
completeMatchmakingTriggerType="none",
completeMatchmakingTriggerRealtimeNamespaceId=nil,
completeMatchmakingTriggerScriptId=nil,
enableCollaborateSeasonRating="disable",
collaborateSeasonRatingNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:seasonRating:namespace-0001",
collaborateSeasonRatingTtl=60,
changeRatingScript=nil,
joinNotification=nil,
leaveNotification=nil,
completeNotification=nil,
changeRatingNotification=nil,
logSetting={
loggingNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001",
},
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('matchmaking')
api_result_handler = client.create_namespace_async({
name="namespace-0001",
description=nil,
transactionSetting=nil,
enableRating=true,
enableDisconnectDetection=nil,
disconnectDetectionTimeoutSeconds=nil,
createGatheringTriggerType="none",
createGatheringTriggerRealtimeNamespaceId=nil,
createGatheringTriggerScriptId=nil,
completeMatchmakingTriggerType="none",
completeMatchmakingTriggerRealtimeNamespaceId=nil,
completeMatchmakingTriggerScriptId=nil,
enableCollaborateSeasonRating="disable",
collaborateSeasonRatingNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:seasonRating:namespace-0001",
collaborateSeasonRatingTtl=60,
changeRatingScript=nil,
joinNotification=nil,
leaveNotification=nil,
completeNotification=nil,
changeRatingNotification=nil,
logSetting={
loggingNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001",
},
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;getNamespaceStatus
ネームスペースの状態を取得
指定されたネームスペースの現在の状態を取得します。
これには、ネームスペースがアクティブか、保留中か、またはその他の状態にあるかが含まれます。
詳細
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
Result
| 型 | 説明 | |
|---|---|---|
| status | string |
実装例
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("namespace-0001"),
}
)
if err != nil {
panic("error occurred")
}
status := result.Statususe 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 Gs2MatchmakingRestClient(
$session
);
try {
$result = $client->getNamespaceStatus(
(new GetNamespaceStatusRequest())
->withNamespaceName("namespace-0001")
);
$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("namespace-0001")
);
String status = result.getStatus();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);
AsyncResult<Gs2.Gs2Matchmaking.Result.GetNamespaceStatusResult> asyncResult = null;
yield return client.GetNamespaceStatus(
new Gs2.Gs2Matchmaking.Request.GetNamespaceStatusRequest()
.WithNamespaceName("namespace-0001"),
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("namespace-0001")
);
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('namespace-0001')
)
status = result.status
except core.Gs2Exception as e:
exit(1)client = gs2('matchmaking')
api_result = client.get_namespace_status({
namespaceName="namespace-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
status = result.status;client = gs2('matchmaking')
api_result_handler = client.get_namespace_status_async({
namespaceName="namespace-0001",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
status = result.status;getNamespace
ネームスペースを取得
指定されたネームスペースの詳細情報を取得します。
これには、ネームスペースの名前、説明、およびその他の設定情報が含まれます。
詳細
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
Result
| 型 | 説明 | |
|---|---|---|
| item | Namespace | ネームスペース |
実装例
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("namespace-0001"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse 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 Gs2MatchmakingRestClient(
$session
);
try {
$result = $client->getNamespace(
(new GetNamespaceRequest())
->withNamespaceName("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.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("namespace-0001")
);
Namespace item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);
AsyncResult<Gs2.Gs2Matchmaking.Result.GetNamespaceResult> asyncResult = null;
yield return client.GetNamespace(
new Gs2.Gs2Matchmaking.Request.GetNamespaceRequest()
.WithNamespaceName("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.getNamespace(
new Gs2Matchmaking.GetNamespaceRequest()
.withNamespaceName("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.get_namespace(
matchmaking.GetNamespaceRequest()
.with_namespace_name('namespace-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('matchmaking')
api_result = client.get_namespace({
namespaceName="namespace-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('matchmaking')
api_result_handler = client.get_namespace_async({
namespaceName="namespace-0001",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;updateNamespace
ネームスペースを更新
指定されたネームスペースの設定を更新します。
ネームスペースの説明や、特定の設定を変更することができます。
詳細
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 | ||||||||||
| description | string | ~ 1024文字 | 説明文 | |||||||||||
| transactionSetting | TransactionSetting | トランザクション設定 マッチメイキング操作時のトランザクションの処理方法を制御する設定です。 | ||||||||||||
| enableRating | bool | false | レーティング計算機能の有効化 Glicko-2 ベースのレーティング計算機能を有効にするかどうか。 有効にすると、プレイヤーは Vote システムを通じて対戦結果を送信し、レーティングが自動的に更新されます。 RatingModel マスターデータの設定が必要です。デフォルトは false です。 | |||||||||||
| enableDisconnectDetection | 文字列列挙型 enum { “disable”, “enable” } | “disable” | 切断検知 マッチメイキング中のプレイヤーが待機中であることを定期的に報告する必要があるかを制御します。 有効にすると、プレイヤーが設定されたタイムアウト期間内にキープアライブを送信しない場合、ギャザリングから自動的に退出処理されます。 これにより「ゴースト」プレイヤーがマッチメイキングの完了をブロックすることを防ぎます。デフォルトは “disable” です。
| |||||||||||
| disconnectDetectionTimeoutSeconds | int | {enableDisconnectDetection} == “enable” | ✓※ | 15 ~ 600 | 切断検知タイムアウト(秒) キープアライブ報告なしにプレイヤーを切断とみなしギャザリングから退出させるまでの待機秒数。 切断検知が有効な場合のみ適用されます。15 から 600 秒の範囲で指定します。 ※ enableDisconnectDetection が “enable” であれば必須 | |||||||||
| createGatheringTriggerType | 文字列列挙型 enum { “none”, “gs2_realtime”, “gs2_script” } | “none” | ギャザリング作成時トリガータイプ 新しいギャザリングが作成されたときに実行するアクションの種類。 GS2-Realtime のルーム作成をトリガーしてリアルタイム通信を開始したり、GS2-Script を実行してカスタムロジックを実行できます。デフォルトは “none” です。
| |||||||||||
| createGatheringTriggerRealtimeNamespaceId | string | {createGatheringTriggerType} == “gs2_realtime” | ✓※ | ~ 1024文字 | ギャザリング作成時にルームを作成する GS2-Realtime のネームスペース ※ createGatheringTriggerType が “gs2_realtime” であれば必須 | |||||||||
| createGatheringTriggerScriptId | string | {createGatheringTriggerType} == “gs2_script” | ✓※ | ~ 1024文字 | ギャザリング作成時に実行される GS2-Script のスクリプト
GRN ※ createGatheringTriggerType が “gs2_script” であれば必須 | |||||||||
| completeMatchmakingTriggerType | 文字列列挙型 enum { “none”, “gs2_realtime”, “gs2_script” } | “none” | マッチメイキング完了時トリガータイプ マッチメイキングが完了した(すべてのロール枠が埋まった)ときに実行するアクションの種類。 マッチングされたプレイヤー向けに GS2-Realtime のルーム作成をトリガーしたり、GS2-Script を実行してカスタムの事後処理ロジックを実行できます。デフォルトは “none” です。
| |||||||||||
| completeMatchmakingTriggerRealtimeNamespaceId | string | {completeMatchmakingTriggerType} == “gs2_realtime” | ✓※ | ~ 1024文字 | マッチメイキング完了時にルームを作成する GS2-Realtime のネームスペース
GRN ※ completeMatchmakingTriggerType が “gs2_realtime” であれば必須 | |||||||||
| completeMatchmakingTriggerScriptId | string | {completeMatchmakingTriggerType} == “gs2_script” | ✓※ | ~ 1024文字 | マッチメイキング完了時に実行される GS2-Script のスクリプト
GRN ※ completeMatchmakingTriggerType が “gs2_script” であれば必須 | |||||||||
| enableCollaborateSeasonRating | 文字列列挙型 enum { “enable”, “disable” } | “disable” | シーズンレーティング連携の有効化 シーズンベースのレーティング計算のために GS2-SeasonRating との連携を有効にするかどうか。 有効にすると、マッチメイキング完了時に指定した GS2-SeasonRating のネームスペースにレーティング計算セッションが自動作成されます。 デフォルトは “disable” です。
| |||||||||||
| collaborateSeasonRatingNamespaceId | string | {enableCollaborateSeasonRating} == “enable” | ✓※ | ~ 1024文字 | シーズンレーティングネームスペース
GRN ※ enableCollaborateSeasonRating が “enable” であれば必須 | |||||||||
| collaborateSeasonRatingTtl | int | {enableCollaborateSeasonRating} == “enable” | 60 | 60 ~ 7200 | シーズンレーティング結果TTL(秒) マッチメイキング完了後、GS2-SeasonRating 経由の対戦結果送信を受け付ける最大待機時間(秒)。 この期間内に結果が送信されない場合、レーティングセッションは期限切れとなります。60 から 7200 秒の範囲で指定します。デフォルトは 60 です。 ※ enableCollaborateSeasonRating が “enable” であれば必須 | |||||||||
| changeRatingScript | ScriptSetting | レーティング値が変化したときに実行するスクリプトの設定 Script トリガーリファレンス - changeRating | ||||||||||||
| joinNotification | NotificationSetting | 参加通知 新しいプレイヤーがギャザリングに参加したときのプッシュ通知設定。 既存の参加者に新しいプレイヤーが参加したことを通知し、ゲームクライアントがマッチメイキング UI を更新できるようにします。 | ||||||||||||
| leaveNotification | NotificationSetting | 離脱通知 プレイヤーがギャザリングから離脱したときのプッシュ通知設定。 残りの参加者にプレイヤーが離脱したことを通知し、ゲームクライアントに変更を反映させます。 | ||||||||||||
| completeNotification | NotificationSetting | 完了通知 マッチメイキングが完了した(すべてのロール枠が埋まった)ときのプッシュ通知設定。 すべての参加者にギャザリングが満員になり対戦を開始できることを通知します。 | ||||||||||||
| changeRatingNotification | NotificationSetting | レーティング変動通知 投票処理後にプレイヤーのレーティング値が変動したときのプッシュ通知設定。 影響を受けたプレイヤーに新しいレーティングを通知し、ゲームクライアントに更新された値を表示させます。 | ||||||||||||
| logSetting | LogSetting | ログの出力設定 APIリクエスト・レスポンスのログを GS2-Log に出力するための設定。 設定すると、マッチメイキングの操作(ギャザリングの作成・参加・離脱、投票、レーティング変動など)がモニタリングと分析のためにログ出力されます。 |
Result
| 型 | 説明 | |
|---|---|---|
| item | Namespace | 更新したネームスペース |
実装例
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("namespace-0001"),
Description: pointy.String("description1"),
TransactionSetting: nil,
EnableRating: pointy.Bool(true),
EnableDisconnectDetection: nil,
DisconnectDetectionTimeoutSeconds: nil,
CreateGatheringTriggerType: pointy.String("none"),
CreateGatheringTriggerRealtimeNamespaceId: nil,
CreateGatheringTriggerScriptId: nil,
CompleteMatchmakingTriggerType: pointy.String("none"),
CompleteMatchmakingTriggerRealtimeNamespaceId: nil,
CompleteMatchmakingTriggerScriptId: nil,
EnableCollaborateSeasonRating: pointy.String("enable"),
CollaborateSeasonRatingNamespaceId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:seasonRating:namespace-0001"),
CollaborateSeasonRatingTtl: pointy.Int32(60),
ChangeRatingScript: nil,
JoinNotification: nil,
LeaveNotification: nil,
CompleteNotification: nil,
ChangeRatingNotification: nil,
LogSetting: &matchmaking.LogSetting{
LoggingNamespaceId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"),
},
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse 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 Gs2MatchmakingRestClient(
$session
);
try {
$result = $client->updateNamespace(
(new UpdateNamespaceRequest())
->withNamespaceName("namespace-0001")
->withDescription("description1")
->withTransactionSetting(null)
->withEnableRating(True)
->withEnableDisconnectDetection(null)
->withDisconnectDetectionTimeoutSeconds(null)
->withCreateGatheringTriggerType("none")
->withCreateGatheringTriggerRealtimeNamespaceId(null)
->withCreateGatheringTriggerScriptId(null)
->withCompleteMatchmakingTriggerType("none")
->withCompleteMatchmakingTriggerRealtimeNamespaceId(null)
->withCompleteMatchmakingTriggerScriptId(null)
->withEnableCollaborateSeasonRating("enable")
->withCollaborateSeasonRatingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:seasonRating:namespace-0001")
->withCollaborateSeasonRatingTtl(60)
->withChangeRatingScript(null)
->withJoinNotification(null)
->withLeaveNotification(null)
->withCompleteNotification(null)
->withChangeRatingNotification(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("namespace-0001")
.withDescription("description1")
.withTransactionSetting(null)
.withEnableRating(true)
.withEnableDisconnectDetection(null)
.withDisconnectDetectionTimeoutSeconds(null)
.withCreateGatheringTriggerType("none")
.withCreateGatheringTriggerRealtimeNamespaceId(null)
.withCreateGatheringTriggerScriptId(null)
.withCompleteMatchmakingTriggerType("none")
.withCompleteMatchmakingTriggerRealtimeNamespaceId(null)
.withCompleteMatchmakingTriggerScriptId(null)
.withEnableCollaborateSeasonRating("enable")
.withCollaborateSeasonRatingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:seasonRating:namespace-0001")
.withCollaborateSeasonRatingTtl(60)
.withChangeRatingScript(null)
.withJoinNotification(null)
.withLeaveNotification(null)
.withCompleteNotification(null)
.withChangeRatingNotification(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;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);
AsyncResult<Gs2.Gs2Matchmaking.Result.UpdateNamespaceResult> asyncResult = null;
yield return client.UpdateNamespace(
new Gs2.Gs2Matchmaking.Request.UpdateNamespaceRequest()
.WithNamespaceName("namespace-0001")
.WithDescription("description1")
.WithTransactionSetting(null)
.WithEnableRating(true)
.WithEnableDisconnectDetection(null)
.WithDisconnectDetectionTimeoutSeconds(null)
.WithCreateGatheringTriggerType("none")
.WithCreateGatheringTriggerRealtimeNamespaceId(null)
.WithCreateGatheringTriggerScriptId(null)
.WithCompleteMatchmakingTriggerType("none")
.WithCompleteMatchmakingTriggerRealtimeNamespaceId(null)
.WithCompleteMatchmakingTriggerScriptId(null)
.WithEnableCollaborateSeasonRating("enable")
.WithCollaborateSeasonRatingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:seasonRating:namespace-0001")
.WithCollaborateSeasonRatingTtl(60)
.WithChangeRatingScript(null)
.WithJoinNotification(null)
.WithLeaveNotification(null)
.WithCompleteNotification(null)
.WithChangeRatingNotification(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("namespace-0001")
.withDescription("description1")
.withTransactionSetting(null)
.withEnableRating(true)
.withEnableDisconnectDetection(null)
.withDisconnectDetectionTimeoutSeconds(null)
.withCreateGatheringTriggerType("none")
.withCreateGatheringTriggerRealtimeNamespaceId(null)
.withCreateGatheringTriggerScriptId(null)
.withCompleteMatchmakingTriggerType("none")
.withCompleteMatchmakingTriggerRealtimeNamespaceId(null)
.withCompleteMatchmakingTriggerScriptId(null)
.withEnableCollaborateSeasonRating("enable")
.withCollaborateSeasonRatingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:seasonRating:namespace-0001")
.withCollaborateSeasonRatingTtl(60)
.withChangeRatingScript(null)
.withJoinNotification(null)
.withLeaveNotification(null)
.withCompleteNotification(null)
.withChangeRatingNotification(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('namespace-0001')
.with_description('description1')
.with_transaction_setting(None)
.with_enable_rating(True)
.with_enable_disconnect_detection(None)
.with_disconnect_detection_timeout_seconds(None)
.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_enable_collaborate_season_rating('enable')
.with_collaborate_season_rating_namespace_id('grn:gs2:ap-northeast-1:YourOwnerId:seasonRating:namespace-0001')
.with_collaborate_season_rating_ttl(60)
.with_change_rating_script(None)
.with_join_notification(None)
.with_leave_notification(None)
.with_complete_notification(None)
.with_change_rating_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="namespace-0001",
description="description1",
transactionSetting=nil,
enableRating=true,
enableDisconnectDetection=nil,
disconnectDetectionTimeoutSeconds=nil,
createGatheringTriggerType="none",
createGatheringTriggerRealtimeNamespaceId=nil,
createGatheringTriggerScriptId=nil,
completeMatchmakingTriggerType="none",
completeMatchmakingTriggerRealtimeNamespaceId=nil,
completeMatchmakingTriggerScriptId=nil,
enableCollaborateSeasonRating="enable",
collaborateSeasonRatingNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:seasonRating:namespace-0001",
collaborateSeasonRatingTtl=60,
changeRatingScript=nil,
joinNotification=nil,
leaveNotification=nil,
completeNotification=nil,
changeRatingNotification=nil,
logSetting={
loggingNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001",
},
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('matchmaking')
api_result_handler = client.update_namespace_async({
namespaceName="namespace-0001",
description="description1",
transactionSetting=nil,
enableRating=true,
enableDisconnectDetection=nil,
disconnectDetectionTimeoutSeconds=nil,
createGatheringTriggerType="none",
createGatheringTriggerRealtimeNamespaceId=nil,
createGatheringTriggerScriptId=nil,
completeMatchmakingTriggerType="none",
completeMatchmakingTriggerRealtimeNamespaceId=nil,
completeMatchmakingTriggerScriptId=nil,
enableCollaborateSeasonRating="enable",
collaborateSeasonRatingNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:seasonRating:namespace-0001",
collaborateSeasonRatingTtl=60,
changeRatingScript=nil,
joinNotification=nil,
leaveNotification=nil,
completeNotification=nil,
changeRatingNotification=nil,
logSetting={
loggingNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001",
},
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;deleteNamespace
ネームスペースを削除
指定されたネームスペースを削除します。
この操作は不可逆であり、削除されたネームスペースに関連するすべてのデータは回復不能になります。
詳細
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
Result
| 型 | 説明 | |
|---|---|---|
| item | Namespace | 削除したネームスペース |
実装例
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("namespace-0001"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse 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 Gs2MatchmakingRestClient(
$session
);
try {
$result = $client->deleteNamespace(
(new DeleteNamespaceRequest())
->withNamespaceName("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.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("namespace-0001")
);
Namespace item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);
AsyncResult<Gs2.Gs2Matchmaking.Result.DeleteNamespaceResult> asyncResult = null;
yield return client.DeleteNamespace(
new Gs2.Gs2Matchmaking.Request.DeleteNamespaceRequest()
.WithNamespaceName("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.deleteNamespace(
new Gs2Matchmaking.DeleteNamespaceRequest()
.withNamespaceName("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.delete_namespace(
matchmaking.DeleteNamespaceRequest()
.with_namespace_name('namespace-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('matchmaking')
api_result = client.delete_namespace({
namespaceName="namespace-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('matchmaking')
api_result_handler = client.delete_namespace_async({
namespaceName="namespace-0001",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;getServiceVersion
マイクロサービスのバージョンを取得
詳細
Request
Request parameters: None
Result
| 型 | 説明 | |
|---|---|---|
| item | string | バージョン |
実装例
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.GetServiceVersion(
&matchmaking.GetServiceVersionRequest {
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse 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\GetServiceVersionRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2MatchmakingRestClient(
$session
);
try {
$result = $client->getServiceVersion(
(new GetServiceVersionRequest())
);
$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.GetServiceVersionRequest;
import io.gs2.matchmaking.result.GetServiceVersionResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);
try {
GetServiceVersionResult result = client.getServiceVersion(
new GetServiceVersionRequest()
);
String item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);
AsyncResult<Gs2.Gs2Matchmaking.Result.GetServiceVersionResult> asyncResult = null;
yield return client.GetServiceVersion(
new Gs2.Gs2Matchmaking.Request.GetServiceVersionRequest(),
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.getServiceVersion(
new Gs2Matchmaking.GetServiceVersionRequest()
);
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_service_version(
matchmaking.GetServiceVersionRequest()
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('matchmaking')
api_result = client.get_service_version({
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('matchmaking')
api_result_handler = client.get_service_version_async({
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;dumpUserDataByUserId
指定したユーザーIDに紐づくデータのダンプを取得
個人情報保護の法的要件を満たすために使用したり、データのバックアップや移行に使用できます。
詳細
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| userId | string | ✓ | ~ 128文字 | ユーザーID | ||
| timeOffsetToken | string | ~ 1024文字 | タイムオフセットトークン |
Result
| 型 | 説明 |
|---|
実装例
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.DumpUserDataByUserId(
&matchmaking.DumpUserDataByUserIdRequest {
UserId: pointy.String("user-0001"),
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}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\DumpUserDataByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2MatchmakingRestClient(
$session
);
try {
$result = $client->dumpUserDataByUserId(
(new DumpUserDataByUserIdRequest())
->withUserId("user-0001")
->withTimeOffsetToken(null)
);
} 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.DumpUserDataByUserIdRequest;
import io.gs2.matchmaking.result.DumpUserDataByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);
try {
DumpUserDataByUserIdResult result = client.dumpUserDataByUserId(
new DumpUserDataByUserIdRequest()
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);
AsyncResult<Gs2.Gs2Matchmaking.Result.DumpUserDataByUserIdResult> asyncResult = null;
yield return client.DumpUserDataByUserId(
new Gs2.Gs2Matchmaking.Request.DumpUserDataByUserIdRequest()
.WithUserId("user-0001")
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;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.dumpUserDataByUserId(
new Gs2Matchmaking.DumpUserDataByUserIdRequest()
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
} 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.dump_user_data_by_user_id(
matchmaking.DumpUserDataByUserIdRequest()
.with_user_id('user-0001')
.with_time_offset_token(None)
)
except core.Gs2Exception as e:
exit(1)client = gs2('matchmaking')
api_result = client.dump_user_data_by_user_id({
userId="user-0001",
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.resultclient = gs2('matchmaking')
api_result_handler = client.dump_user_data_by_user_id_async({
userId="user-0001",
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.resultcheckDumpUserDataByUserId
指定したユーザーIDに紐づくデータのダンプが完了しているか確認
詳細
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| userId | string | ✓ | ~ 128文字 | ユーザーID | ||
| timeOffsetToken | string | ~ 1024文字 | タイムオフセットトークン |
Result
| 型 | 説明 | |
|---|---|---|
| url | string | 出力データのURL |
実装例
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.CheckDumpUserDataByUserId(
&matchmaking.CheckDumpUserDataByUserIdRequest {
UserId: pointy.String("user-0001"),
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
url := result.Urluse 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\CheckDumpUserDataByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2MatchmakingRestClient(
$session
);
try {
$result = $client->checkDumpUserDataByUserId(
(new CheckDumpUserDataByUserIdRequest())
->withUserId("user-0001")
->withTimeOffsetToken(null)
);
$url = $result->getUrl();
} 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.CheckDumpUserDataByUserIdRequest;
import io.gs2.matchmaking.result.CheckDumpUserDataByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);
try {
CheckDumpUserDataByUserIdResult result = client.checkDumpUserDataByUserId(
new CheckDumpUserDataByUserIdRequest()
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
String url = result.getUrl();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);
AsyncResult<Gs2.Gs2Matchmaking.Result.CheckDumpUserDataByUserIdResult> asyncResult = null;
yield return client.CheckDumpUserDataByUserId(
new Gs2.Gs2Matchmaking.Request.CheckDumpUserDataByUserIdRequest()
.WithUserId("user-0001")
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var url = result.Url;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.checkDumpUserDataByUserId(
new Gs2Matchmaking.CheckDumpUserDataByUserIdRequest()
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
const url = result.getUrl();
} 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.check_dump_user_data_by_user_id(
matchmaking.CheckDumpUserDataByUserIdRequest()
.with_user_id('user-0001')
.with_time_offset_token(None)
)
url = result.url
except core.Gs2Exception as e:
exit(1)client = gs2('matchmaking')
api_result = client.check_dump_user_data_by_user_id({
userId="user-0001",
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
url = result.url;client = gs2('matchmaking')
api_result_handler = client.check_dump_user_data_by_user_id_async({
userId="user-0001",
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
url = result.url;cleanUserDataByUserId
ユーザーデータの完全削除
指定されたユーザーIDに紐づくデータのクリーニングを実行します。
これにより、特定のユーザーデータをプロジェクトから安全に削除できます。
詳細
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| userId | string | ✓ | ~ 128文字 | ユーザーID | ||
| timeOffsetToken | string | ~ 1024文字 | タイムオフセットトークン |
Result
| 型 | 説明 |
|---|
実装例
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.CleanUserDataByUserId(
&matchmaking.CleanUserDataByUserIdRequest {
UserId: pointy.String("user-0001"),
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}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\CleanUserDataByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2MatchmakingRestClient(
$session
);
try {
$result = $client->cleanUserDataByUserId(
(new CleanUserDataByUserIdRequest())
->withUserId("user-0001")
->withTimeOffsetToken(null)
);
} 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.CleanUserDataByUserIdRequest;
import io.gs2.matchmaking.result.CleanUserDataByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);
try {
CleanUserDataByUserIdResult result = client.cleanUserDataByUserId(
new CleanUserDataByUserIdRequest()
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);
AsyncResult<Gs2.Gs2Matchmaking.Result.CleanUserDataByUserIdResult> asyncResult = null;
yield return client.CleanUserDataByUserId(
new Gs2.Gs2Matchmaking.Request.CleanUserDataByUserIdRequest()
.WithUserId("user-0001")
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;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.cleanUserDataByUserId(
new Gs2Matchmaking.CleanUserDataByUserIdRequest()
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
} 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.clean_user_data_by_user_id(
matchmaking.CleanUserDataByUserIdRequest()
.with_user_id('user-0001')
.with_time_offset_token(None)
)
except core.Gs2Exception as e:
exit(1)client = gs2('matchmaking')
api_result = client.clean_user_data_by_user_id({
userId="user-0001",
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.resultclient = gs2('matchmaking')
api_result_handler = client.clean_user_data_by_user_id_async({
userId="user-0001",
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.resultcheckCleanUserDataByUserId
指定したユーザーIDのユーザーデータの完全削除が完了しているか確認
詳細
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| userId | string | ✓ | ~ 128文字 | ユーザーID | ||
| timeOffsetToken | string | ~ 1024文字 | タイムオフセットトークン |
Result
| 型 | 説明 |
|---|
実装例
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.CheckCleanUserDataByUserId(
&matchmaking.CheckCleanUserDataByUserIdRequest {
UserId: pointy.String("user-0001"),
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}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\CheckCleanUserDataByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2MatchmakingRestClient(
$session
);
try {
$result = $client->checkCleanUserDataByUserId(
(new CheckCleanUserDataByUserIdRequest())
->withUserId("user-0001")
->withTimeOffsetToken(null)
);
} 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.CheckCleanUserDataByUserIdRequest;
import io.gs2.matchmaking.result.CheckCleanUserDataByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);
try {
CheckCleanUserDataByUserIdResult result = client.checkCleanUserDataByUserId(
new CheckCleanUserDataByUserIdRequest()
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);
AsyncResult<Gs2.Gs2Matchmaking.Result.CheckCleanUserDataByUserIdResult> asyncResult = null;
yield return client.CheckCleanUserDataByUserId(
new Gs2.Gs2Matchmaking.Request.CheckCleanUserDataByUserIdRequest()
.WithUserId("user-0001")
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;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.checkCleanUserDataByUserId(
new Gs2Matchmaking.CheckCleanUserDataByUserIdRequest()
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
} 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.check_clean_user_data_by_user_id(
matchmaking.CheckCleanUserDataByUserIdRequest()
.with_user_id('user-0001')
.with_time_offset_token(None)
)
except core.Gs2Exception as e:
exit(1)client = gs2('matchmaking')
api_result = client.check_clean_user_data_by_user_id({
userId="user-0001",
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.resultclient = gs2('matchmaking')
api_result_handler = client.check_clean_user_data_by_user_id_async({
userId="user-0001",
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.resultprepareImportUserDataByUserId
指定したユーザーIDに紐づくデータのインポートを実行
インポートに使用できるデータは GS2 によってエクスポートして取得したデータに限定され、古いデータはインポートに失敗する可能性があります。
エクスポートしたユーザーIDと異なるユーザーIDでインポートすることができますが、ユーザーデータのペイロード内にユーザーIDが含まれる場合はその限りではありません。
このAPIの戻り値で応答されたURLにエクスポートした zip ファイルをアップロードし、importUserDataByUserId を呼び出すことで実際のインポート処理を開始できます。
詳細
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| userId | string | ✓ | ~ 128文字 | ユーザーID | ||
| timeOffsetToken | string | ~ 1024文字 | タイムオフセットトークン |
Result
| 型 | 説明 | |
|---|---|---|
| uploadToken | string | アップロード後に結果を反映する際に使用するトークン |
| uploadUrl | string | ユーザーデータアップロード処理の実行に使用するURL |
実装例
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.PrepareImportUserDataByUserId(
&matchmaking.PrepareImportUserDataByUserIdRequest {
UserId: pointy.String("user-0001"),
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
uploadToken := result.UploadToken
uploadUrl := result.UploadUrluse 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\PrepareImportUserDataByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2MatchmakingRestClient(
$session
);
try {
$result = $client->prepareImportUserDataByUserId(
(new PrepareImportUserDataByUserIdRequest())
->withUserId("user-0001")
->withTimeOffsetToken(null)
);
$uploadToken = $result->getUploadToken();
$uploadUrl = $result->getUploadUrl();
} 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.PrepareImportUserDataByUserIdRequest;
import io.gs2.matchmaking.result.PrepareImportUserDataByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);
try {
PrepareImportUserDataByUserIdResult result = client.prepareImportUserDataByUserId(
new PrepareImportUserDataByUserIdRequest()
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
String uploadToken = result.getUploadToken();
String uploadUrl = result.getUploadUrl();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);
AsyncResult<Gs2.Gs2Matchmaking.Result.PrepareImportUserDataByUserIdResult> asyncResult = null;
yield return client.PrepareImportUserDataByUserId(
new Gs2.Gs2Matchmaking.Request.PrepareImportUserDataByUserIdRequest()
.WithUserId("user-0001")
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var uploadToken = result.UploadToken;
var uploadUrl = result.UploadUrl;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.prepareImportUserDataByUserId(
new Gs2Matchmaking.PrepareImportUserDataByUserIdRequest()
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
const uploadToken = result.getUploadToken();
const uploadUrl = result.getUploadUrl();
} 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.prepare_import_user_data_by_user_id(
matchmaking.PrepareImportUserDataByUserIdRequest()
.with_user_id('user-0001')
.with_time_offset_token(None)
)
upload_token = result.upload_token
upload_url = result.upload_url
except core.Gs2Exception as e:
exit(1)client = gs2('matchmaking')
api_result = client.prepare_import_user_data_by_user_id({
userId="user-0001",
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
uploadToken = result.uploadToken;
uploadUrl = result.uploadUrl;client = gs2('matchmaking')
api_result_handler = client.prepare_import_user_data_by_user_id_async({
userId="user-0001",
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
uploadToken = result.uploadToken;
uploadUrl = result.uploadUrl;importUserDataByUserId
指定したユーザーIDに紐づくデータのインポートを実行
インポートに使用できるデータは GS2 によってエクスポートして取得したデータに限定され、古いデータはインポートに失敗する可能性があります。
エクスポートしたユーザーIDと異なるユーザーIDでインポートすることができますが、ユーザーデータのペイロード内にユーザーIDが含まれる場合はその限りではありません。
このAPIを呼び出す前に prepareImportUserDataByUserId を呼び出して、アップロード準備を完了させる必要があります。
詳細
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| userId | string | ✓ | ~ 128文字 | ユーザーID | ||
| uploadToken | string | ✓ | ~ 1024文字 | アップロード準備で受け取ったトークン | ||
| timeOffsetToken | string | ~ 1024文字 | タイムオフセットトークン |
Result
| 型 | 説明 |
|---|
実装例
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.ImportUserDataByUserId(
&matchmaking.ImportUserDataByUserIdRequest {
UserId: pointy.String("user-0001"),
UploadToken: pointy.String("upload-0001"),
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}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\ImportUserDataByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2MatchmakingRestClient(
$session
);
try {
$result = $client->importUserDataByUserId(
(new ImportUserDataByUserIdRequest())
->withUserId("user-0001")
->withUploadToken("upload-0001")
->withTimeOffsetToken(null)
);
} 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.ImportUserDataByUserIdRequest;
import io.gs2.matchmaking.result.ImportUserDataByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);
try {
ImportUserDataByUserIdResult result = client.importUserDataByUserId(
new ImportUserDataByUserIdRequest()
.withUserId("user-0001")
.withUploadToken("upload-0001")
.withTimeOffsetToken(null)
);
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);
AsyncResult<Gs2.Gs2Matchmaking.Result.ImportUserDataByUserIdResult> asyncResult = null;
yield return client.ImportUserDataByUserId(
new Gs2.Gs2Matchmaking.Request.ImportUserDataByUserIdRequest()
.WithUserId("user-0001")
.WithUploadToken("upload-0001")
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;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.importUserDataByUserId(
new Gs2Matchmaking.ImportUserDataByUserIdRequest()
.withUserId("user-0001")
.withUploadToken("upload-0001")
.withTimeOffsetToken(null)
);
} 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.import_user_data_by_user_id(
matchmaking.ImportUserDataByUserIdRequest()
.with_user_id('user-0001')
.with_upload_token('upload-0001')
.with_time_offset_token(None)
)
except core.Gs2Exception as e:
exit(1)client = gs2('matchmaking')
api_result = client.import_user_data_by_user_id({
userId="user-0001",
uploadToken="upload-0001",
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.resultclient = gs2('matchmaking')
api_result_handler = client.import_user_data_by_user_id_async({
userId="user-0001",
uploadToken="upload-0001",
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.resultcheckImportUserDataByUserId
指定したユーザーIDに紐づくデータのインポートが完了しているか確認
詳細
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| userId | string | ✓ | ~ 128文字 | ユーザーID | ||
| uploadToken | string | ✓ | ~ 1024文字 | アップロード準備で受け取ったトークン | ||
| timeOffsetToken | string | ~ 1024文字 | タイムオフセットトークン |
Result
| 型 | 説明 | |
|---|---|---|
| url | string | 出力ログのURL |
実装例
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.CheckImportUserDataByUserId(
&matchmaking.CheckImportUserDataByUserIdRequest {
UserId: pointy.String("user-0001"),
UploadToken: pointy.String("upload-0001"),
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
url := result.Urluse 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\CheckImportUserDataByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2MatchmakingRestClient(
$session
);
try {
$result = $client->checkImportUserDataByUserId(
(new CheckImportUserDataByUserIdRequest())
->withUserId("user-0001")
->withUploadToken("upload-0001")
->withTimeOffsetToken(null)
);
$url = $result->getUrl();
} 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.CheckImportUserDataByUserIdRequest;
import io.gs2.matchmaking.result.CheckImportUserDataByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);
try {
CheckImportUserDataByUserIdResult result = client.checkImportUserDataByUserId(
new CheckImportUserDataByUserIdRequest()
.withUserId("user-0001")
.withUploadToken("upload-0001")
.withTimeOffsetToken(null)
);
String url = result.getUrl();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);
AsyncResult<Gs2.Gs2Matchmaking.Result.CheckImportUserDataByUserIdResult> asyncResult = null;
yield return client.CheckImportUserDataByUserId(
new Gs2.Gs2Matchmaking.Request.CheckImportUserDataByUserIdRequest()
.WithUserId("user-0001")
.WithUploadToken("upload-0001")
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var url = result.Url;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.checkImportUserDataByUserId(
new Gs2Matchmaking.CheckImportUserDataByUserIdRequest()
.withUserId("user-0001")
.withUploadToken("upload-0001")
.withTimeOffsetToken(null)
);
const url = result.getUrl();
} 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.check_import_user_data_by_user_id(
matchmaking.CheckImportUserDataByUserIdRequest()
.with_user_id('user-0001')
.with_upload_token('upload-0001')
.with_time_offset_token(None)
)
url = result.url
except core.Gs2Exception as e:
exit(1)client = gs2('matchmaking')
api_result = client.check_import_user_data_by_user_id({
userId="user-0001",
uploadToken="upload-0001",
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
url = result.url;client = gs2('matchmaking')
api_result_handler = client.check_import_user_data_by_user_id_async({
userId="user-0001",
uploadToken="upload-0001",
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
url = result.url;describeGatherings
ギャザリングの一覧を取得
指定されたネームスペース内のすべてのギャザリングのページネーション付きリストを取得します。
現在参加者を募集中のギャザリングおよび完了したギャザリングが含まれます。
詳細
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 | ||
| pageToken | string | ~ 1024文字 | データの取得を開始する位置を指定するトークン | |||
| limit | int | 30 | 1 ~ 1000 | データの取得件数 |
Result
| 型 | 説明 | |
|---|---|---|
| items | List<Gathering> | ギャザリングのリスト |
| nextPageToken | string | リストの続きを取得するためのページトークン |
実装例
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("namespace-0001"),
PageToken: nil,
Limit: nil,
}
)
if err != nil {
panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageTokenuse 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 Gs2MatchmakingRestClient(
$session
);
try {
$result = $client->describeGatherings(
(new DescribeGatheringsRequest())
->withNamespaceName("namespace-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.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("namespace-0001")
.withPageToken(null)
.withLimit(null)
);
List<Gathering> items = result.getItems();
String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);
AsyncResult<Gs2.Gs2Matchmaking.Result.DescribeGatheringsResult> asyncResult = null;
yield return client.DescribeGatherings(
new Gs2.Gs2Matchmaking.Request.DescribeGatheringsRequest()
.WithNamespaceName("namespace-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.describeGatherings(
new Gs2Matchmaking.DescribeGatheringsRequest()
.withNamespaceName("namespace-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_gatherings(
matchmaking.DescribeGatheringsRequest()
.with_namespace_name('namespace-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_gatherings({
namespaceName="namespace-0001",
pageToken=nil,
limit=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;client = gs2('matchmaking')
api_result_handler = client.describe_gatherings_async({
namespaceName="namespace-0001",
pageToken=nil,
limit=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;createGathering
ギャザリングを作成して募集を開始
募集条件 には、作成したギャザリングに参加を許可する各属性値の範囲を指定します。
たとえば、同一ゲームモードを希望するプレイヤーを募集したい場合は、ゲームモードに対応した属性値が完全一致する参加条件プレイヤーとマッチメイキングするように
- 属性名:ゲームモード
- 属性最小値: ゲームモードを表す数値
- 属性最大値: ゲームモードを表す数値
とすることで、同一ゲームモードを希望するプレイヤー同士をマッチメイキングできます。
他にレーティングをベースにしたマッチメイキングを実施したい場合は、
ルーム作成者のレーティング値を中心とした属性値の範囲を指定することで、レーティング値の近いプレイヤー同士をマッチメイキングできます。
この 募集条件 はあとで更新することができますので、徐々に条件を緩和していくことができます。
ロール とは 盾役1人・回復役1人・攻撃役2人 などの役割ごとに募集人数を設定したい場合に使用します。
ロールにはエイリアスを指定できます。
たとえば、盾役は パラディン と ナイト の2種類の ジョブ に更に分類できるとします。
この場合、ロール名 に 盾役 エイリアス に パラディン ナイト として募集を出すようにゲームを実装します。
そして、プレイヤーは自分自身の ジョブ を自身のプレイヤー情報のロールに指定します。
こうすることで、募集条件が 盾役 になっているギャザリングには パラディン も ナイト も参加できます。
一方で、ギャザリングを作成するときに、 パラディン だけ募集したくて、 ナイト を募集したくない場合は、
募集するロール名に パラディン を直接指定したり、エイリアスに ナイト を含めないようにすることで実現できます。
参加者 の 募集人数 はプレイヤーの募集人数を指定します。ロール名を指定することで、ロール名ごとの募集人数を設定できます。
参加者 の 参加者のプレイヤー情報リスト には事前にプレイヤー間でパーティを構築している場合や、参加者が離脱したあとの追加募集で使用します。
詳細
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 | ||
| accessToken | string | ✓ | ~ 128文字 | アクセストークン | ||
| player | Player | ✓ | 自身のプレイヤー情報 | |||
| attributeRanges | List<AttributeRange> | [] | 0 ~ 5 items | 募集条件 このギャザリングに参加するためにプレイヤーが満たすべき属性範囲条件のリスト。 各エントリは属性名と許容される最小値・最大値の範囲を指定します。 プレイヤー自身の属性値がこの範囲内でなければ参加できません。最大5件。 | ||
| capacityOfRoles | List<CapacityOfRole> | [] | 1 ~ 5 items | 募集枠リスト このギャザリングの募集枠を定義します。 各エントリはロール名、その別名、およびそのロールに参加可能な最大人数を指定します。 すべてのロール枠が定員に達するとマッチメイキングが完了となります。最小1件、最大5件。 | ||
| allowUserIds | List<string> | [] | 0 ~ 100 items | 参加許可ユーザーIDリスト このギャザリングへの参加を許可されたユーザーIDのホワイトリスト。 指定した場合、リストに含まれるユーザーのみがこのギャザリングのマッチメイキングに参加できます。 フレンド限定マッチメイキングや招待制マッチメイキングに利用します。最大100件。 | ||
| expiresAt | long | ギャザリングの有効期限 このギャザリングが自動的に期限切れとなり削除される時刻。 この時刻までにマッチメイキングが完了しない場合、ギャザリングはクリーンアップされます。 未指定の場合、マッチメイキングが完了するか手動で削除されるまでギャザリングは維持されます。 | ||||
| expiresAtTimeSpan | TimeSpan | 有効期限までの時間 |
Result
| 型 | 説明 | |
|---|---|---|
| item | Gathering | 作成したギャザリング |
実装例
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("namespace-0001"),
AccessToken: pointy.String("accessToken-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.Itemuse 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 Gs2MatchmakingRestClient(
$session
);
try {
$result = $client->createGathering(
(new CreateGatheringRequest())
->withNamespaceName("namespace-0001")
->withAccessToken("accessToken-0001")
->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("namespace-0001")
.withAccessToken("accessToken-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;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);
AsyncResult<Gs2.Gs2Matchmaking.Result.CreateGatheringResult> asyncResult = null;
yield return client.CreateGathering(
new Gs2.Gs2Matchmaking.Request.CreateGatheringRequest()
.WithNamespaceName("namespace-0001")
.WithAccessToken("accessToken-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("namespace-0001")
.withAccessToken("accessToken-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('namespace-0001')
.with_access_token('accessToken-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="namespace-0001",
accessToken="accessToken-0001",
player={
attributes={
{
name="stage",
value=1,
},
{
name="level",
value=10,
}
},
},
attributeRanges={
{
name="stage",
min=1,
max=1,
},
{
name="level",
min=0,
max=10,
}
},
capacityOfRoles={
{
roleName="default",
capacity=4,
}
},
allowUserIds=nil,
expiresAt=nil,
expiresAtTimeSpan=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('matchmaking')
api_result_handler = client.create_gathering_async({
namespaceName="namespace-0001",
accessToken="accessToken-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,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;createGatheringByUserId
ユーザーIDを指定してギャザリングを作成して募集を開始
募集条件 には、作成したギャザリングに参加を許可する各属性値の範囲を指定します。
たとえば、同一ゲームモードを希望するプレイヤーを募集したい場合は、ゲームモードに対応した属性値が完全一致する参加条件プレイヤーとマッチメイキングするように属性名:ゲームモード 属性最小値: ゲームモードを表す数値 属性最大値: ゲームモードを表す数値
とすることで、同一ゲームモードを希望するプレイヤー同士をマッチメイキングできます。
他にレーティングをベースにしたマッチメイキングを実施したい場合は、
ルーム作成者のレーティング値を中心とした属性値の範囲を指定することで、レーティング値の近いプレイヤー同士をマッチメイキングできます。
この 募集条件 はあとで更新することができますので、徐々に条件を緩和していくことができます。
ロール とは 盾役1人・回復役1人・攻撃役2人 などの役割ごとに募集人数を設定したい場合に使用します。
ロールにはエイリアスを指定できます。
たとえば、盾役は パラディン と ナイト の2種類の ジョブ に更に分類できるとします。
この場合、ロール名 に 盾役 エイリアス に パラディン ナイト として募集を出すようにゲームを実装します。
そして、プレイヤーは自分自身の ジョブ を自身のプレイヤー情報のロールに指定します。
こうすることで、募集条件が 盾役 になっているギャザリングには パラディン も ナイト も参加できます。
一方で、ギャザリングを作成するときに、 パラディン だけ募集したくて、 ナイト を募集したくない場合は、
募集するロール名に パラディン を直接指定したり、エイリアスに ナイト を含めないようにすることで実現できます。
参加者 の 募集人数 はプレイヤーの募集人数を指定します。ロール名を指定することで、ロール名ごとの募集人数を設定できます。
参加者 の 参加者のプレイヤー情報リスト には事前にプレイヤー間でパーティを構築している場合や、参加者が離脱したあとの追加募集で使用します。
詳細
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 | ||
| userId | string | ✓ | ~ 128文字 | ユーザーID | ||
| player | Player | ✓ | 自身のプレイヤー情報 | |||
| attributeRanges | List<AttributeRange> | [] | 0 ~ 5 items | 募集条件 このギャザリングに参加するためにプレイヤーが満たすべき属性範囲条件のリスト。 各エントリは属性名と許容される最小値・最大値の範囲を指定します。 プレイヤー自身の属性値がこの範囲内でなければ参加できません。最大5件。 | ||
| capacityOfRoles | List<CapacityOfRole> | [] | 1 ~ 5 items | 募集枠リスト このギャザリングの募集枠を定義します。 各エントリはロール名、その別名、およびそのロールに参加可能な最大人数を指定します。 すべてのロール枠が定員に達するとマッチメイキングが完了となります。最小1件、最大5件。 | ||
| allowUserIds | List<string> | [] | 0 ~ 100 items | 参加許可ユーザーIDリスト このギャザリングへの参加を許可されたユーザーIDのホワイトリスト。 指定した場合、リストに含まれるユーザーのみがこのギャザリングのマッチメイキングに参加できます。 フレンド限定マッチメイキングや招待制マッチメイキングに利用します。最大100件。 | ||
| expiresAt | long | ギャザリングの有効期限 このギャザリングが自動的に期限切れとなり削除される時刻。 この時刻までにマッチメイキングが完了しない場合、ギャザリングはクリーンアップされます。 未指定の場合、マッチメイキングが完了するか手動で削除されるまでギャザリングは維持されます。 | ||||
| expiresAtTimeSpan | TimeSpan | 有効期限までの時間 | ||||
| timeOffsetToken | string | ~ 1024文字 | タイムオフセットトークン |
Result
| 型 | 説明 | |
|---|---|---|
| item | Gathering | 作成したギャザリング |
実装例
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("namespace-0001"),
UserId: pointy.String("user-0001"),
Player: &matchmaking.Player{
UserId: pointy.String("user-0001"),
Attributes: []Matchmaking.Attribute{
Matchmaking.Attribute{
Name: pointy.String("attr1"),
Value: 1,
}
Matchmaking.Attribute{
Name: pointy.String("attr2"),
Value: 1,
}
},
},
AttributeRanges: []matchmaking.AttributeRange{
matchmaking.AttributeRange{
Name: pointy.String("stage"),
Min: pointy.Int32(1),
Max: pointy.Int32(2),
},
matchmaking.AttributeRange{
Name: pointy.String("level"),
Min: pointy.Int32(3),
Max: pointy.Int32(5),
},
},
CapacityOfRoles: []matchmaking.CapacityOfRole{
matchmaking.CapacityOfRole{
Capacity: pointy.Int32(4),
},
},
AllowUserIds: nil,
ExpiresAt: nil,
ExpiresAtTimeSpan: nil,
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse 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 Gs2MatchmakingRestClient(
$session
);
try {
$result = $client->createGatheringByUserId(
(new CreateGatheringByUserIdRequest())
->withNamespaceName("namespace-0001")
->withUserId("user-0001")
->withPlayer((new Player())
->withUserId("user-0001")
->withAttributes([
(new \Gs2\Matchmaking\Model\Attribute())
->withName("attr1")
->withValue(1)
(new \Gs2\Matchmaking\Model\Attribute())
->withName("attr2")
->withValue(1)
]))
->withAttributeRanges([
(new AttributeRange())
->withName("stage")
->withMin(1)
->withMax(2),
(new AttributeRange())
->withName("level")
->withMin(3)
->withMax(5),
])
->withCapacityOfRoles([
(new CapacityOfRole())
->withCapacity(4),
])
->withAllowUserIds(null)
->withExpiresAt(null)
->withExpiresAtTimeSpan(null)
->withTimeOffsetToken(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("namespace-0001")
.withUserId("user-0001")
.withPlayer(new Player()
.withUserId("user-0001")
.withAttributes(Arrays.asList(
new io.gs2.matchmaking.model.Attribute()
.withName("attr1")
.withValue(1)
new io.gs2.matchmaking.model.Attribute()
.withName("attr2")
.withValue(1),
))
.withAttributeRanges(Arrays.asList(
new AttributeRange()
.withName("stage")
.withMin(1)
.withMax(2),
new AttributeRange()
.withName("level")
.withMin(3)
.withMax(5)
))
.withCapacityOfRoles(Arrays.asList(
new CapacityOfRole()
.withCapacity(4)
))
.withAllowUserIds(null)
.withExpiresAt(null)
.withExpiresAtTimeSpan(null)
.withTimeOffsetToken(null)
);
Gathering item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);
AsyncResult<Gs2.Gs2Matchmaking.Result.CreateGatheringByUserIdResult> asyncResult = null;
yield return client.CreateGatheringByUserId(
new Gs2.Gs2Matchmaking.Request.CreateGatheringByUserIdRequest()
.WithNamespaceName("namespace-0001")
.WithUserId("user-0001")
.WithPlayer(new Gs2.Gs2Matchmaking.Model.Player()
.WithUserId("user-0001")
.WithAttributes(new Gs2.Gs2Matchmaking.Model.Attribute[] {
.WithName("attr1")
.WithValue(1)
.WithName("attr2")
.WithValue(1)
}))
.WithAttributeRanges(new Gs2.Gs2Matchmaking.Model.AttributeRange[] {
new Gs2.Gs2Matchmaking.Model.AttributeRange()
.WithName("stage")
.WithMin(1)
.WithMax(2),
new Gs2.Gs2Matchmaking.Model.AttributeRange()
.WithName("level")
.WithMin(3)
.WithMax(5),
})
.WithCapacityOfRoles(new Gs2.Gs2Matchmaking.Model.CapacityOfRole[] {
new Gs2.Gs2Matchmaking.Model.CapacityOfRole()
.WithCapacity(4),
})
.WithAllowUserIds(null)
.WithExpiresAt(null)
.WithExpiresAtTimeSpan(null)
.WithTimeOffsetToken(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("namespace-0001")
.withUserId("user-0001")
.withPlayer(new Gs2Matchmaking.model.Player()
.withUserId("user-0001")
.withAttributes([
new Gs2Matchmaking.model.Attribute()
.withName("attr1")
.withValue(1)
new Gs2Matchmaking.model.Attribute()
.withName("attr2")
.withValue(1)
]))
.withAttributeRanges([
new Gs2Matchmaking.model.AttributeRange()
.withName("stage")
.withMin(1)
.withMax(2),
new Gs2Matchmaking.model.AttributeRange()
.withName("level")
.withMin(3)
.withMax(5),
])
.withCapacityOfRoles([
new Gs2Matchmaking.model.CapacityOfRole()
.withCapacity(4),
])
.withAllowUserIds(null)
.withExpiresAt(null)
.withExpiresAtTimeSpan(null)
.withTimeOffsetToken(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('namespace-0001')
.with_user_id('user-0001')
.with_player(matchmaking.Player()
.with_user_id('user-0001')
.with_attributes([
matchmaking.attribute()
.with_name('attr1')
.with_value(1),
matchmaking.attribute()
.with_name('attr2')
.with_value(1),
]))
.with_attribute_ranges([
matchmaking.AttributeRange()
.with_name('stage')
.with_min(1)
.with_max(2),
matchmaking.AttributeRange()
.with_name('level')
.with_min(3)
.with_max(5),
])
.with_capacity_of_roles([
matchmaking.CapacityOfRole()
.with_capacity(4),
])
.with_allow_user_ids(None)
.with_expires_at(None)
.with_expires_at_time_span(None)
.with_time_offset_token(None)
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('matchmaking')
api_result = client.create_gathering_by_user_id({
namespaceName="namespace-0001",
userId="user-0001",
player={
user_id="user-0001",
attributes={
attribute={
name="attr1",
value=1,
}attribute={
name="attr2",
value=1,
}
},
},
attributeRanges={
{
name="stage",
min=1,
max=2,
},
{
name="level",
min=3,
max=5,
}
},
capacityOfRoles={
{
capacity=4,
}
},
allowUserIds=nil,
expiresAt=nil,
expiresAtTimeSpan=nil,
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('matchmaking')
api_result_handler = client.create_gathering_by_user_id_async({
namespaceName="namespace-0001",
userId="user-0001",
player={
user_id="user-0001",
attributes={
attribute={
name="attr1",
value=1,
}attribute={
name="attr2",
value=1,
}
},
},
attributeRanges={
{
name="stage",
min=1,
max=2,
},
{
name="level",
min=3,
max=5,
}
},
capacityOfRoles={
{
capacity=4,
}
},
allowUserIds=nil,
expiresAt=nil,
expiresAtTimeSpan=nil,
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;updateGathering
ギャザリングを更新
指定されたギャザリングの募集条件(属性値の範囲)を更新します。
参加者を待っている間に、マッチング条件を徐々に緩和または厳格化できます。
詳細
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 | ||
| gatheringName | string | ✓ | UUID | ~ 128文字 | ギャザリング名 ギャザリングの一意な名前を保持します。 名前は UUID(Universally Unique Identifier)フォーマットで自動的に生成され、ギャザリングを識別するために使用されます。 | |
| accessToken | string | ✓ | ~ 128文字 | アクセストークン | ||
| attributeRanges | List<AttributeRange> | [] | 0 ~ 5 items | 募集条件 このギャザリングに参加するためにプレイヤーが満たすべき属性範囲条件のリスト。 各エントリは属性名と許容される最小値・最大値の範囲を指定します。 プレイヤー自身の属性値がこの範囲内でなければ参加できません。最大5件。 |
Result
| 型 | 説明 | |
|---|---|---|
| item | Gathering | 更新したギャザリング |
実装例
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("namespace-0001"),
GatheringName: pointy.String("gathering-0001"),
AccessToken: pointy.String("accessToken-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.Itemuse 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 Gs2MatchmakingRestClient(
$session
);
try {
$result = $client->updateGathering(
(new UpdateGatheringRequest())
->withNamespaceName("namespace-0001")
->withGatheringName("gathering-0001")
->withAccessToken("accessToken-0001")
->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("namespace-0001")
.withGatheringName("gathering-0001")
.withAccessToken("accessToken-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;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);
AsyncResult<Gs2.Gs2Matchmaking.Result.UpdateGatheringResult> asyncResult = null;
yield return client.UpdateGathering(
new Gs2.Gs2Matchmaking.Request.UpdateGatheringRequest()
.WithNamespaceName("namespace-0001")
.WithGatheringName("gathering-0001")
.WithAccessToken("accessToken-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("namespace-0001")
.withGatheringName("gathering-0001")
.withAccessToken("accessToken-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('namespace-0001')
.with_gathering_name('gathering-0001')
.with_access_token('accessToken-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="namespace-0001",
gatheringName="gathering-0001",
accessToken="accessToken-0001",
attributeRanges={
{
name="stage",
min=1,
max=1,
},
{
name="level",
min=0,
max=50,
}
},
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('matchmaking')
api_result_handler = client.update_gathering_async({
namespaceName="namespace-0001",
gatheringName="gathering-0001",
accessToken="accessToken-0001",
attributeRanges={
{
name="stage",
min=1,
max=1,
},
{
name="level",
min=0,
max=50,
}
},
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;updateGatheringByUserId
ユーザーIDを指定してギャザリングを更新
指定されたユーザーのギャザリングの募集条件(属性値の範囲)を更新します。
詳細
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 | ||
| gatheringName | string | ✓ | UUID | ~ 128文字 | ギャザリング名 ギャザリングの一意な名前を保持します。 名前は UUID(Universally Unique Identifier)フォーマットで自動的に生成され、ギャザリングを識別するために使用されます。 | |
| userId | string | ✓ | ~ 128文字 | ユーザーID | ||
| attributeRanges | List<AttributeRange> | [] | 0 ~ 5 items | 募集条件 このギャザリングに参加するためにプレイヤーが満たすべき属性範囲条件のリスト。 各エントリは属性名と許容される最小値・最大値の範囲を指定します。 プレイヤー自身の属性値がこの範囲内でなければ参加できません。最大5件。 | ||
| timeOffsetToken | string | ~ 1024文字 | タイムオフセットトークン |
Result
| 型 | 説明 | |
|---|---|---|
| item | Gathering | 更新したギャザリング |
実装例
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("namespace-0001"),
GatheringName: pointy.String("gathering-0001"),
UserId: pointy.String("user-0001"),
AttributeRanges: []matchmaking.AttributeRange{
matchmaking.AttributeRange{
Name: pointy.String("stage"),
Min: pointy.Int32(1),
Max: pointy.Int32(2),
},
matchmaking.AttributeRange{
Name: pointy.String("level"),
Min: pointy.Int32(3),
Max: pointy.Int32(5),
},
},
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse 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 Gs2MatchmakingRestClient(
$session
);
try {
$result = $client->updateGatheringByUserId(
(new UpdateGatheringByUserIdRequest())
->withNamespaceName("namespace-0001")
->withGatheringName("gathering-0001")
->withUserId("user-0001")
->withAttributeRanges([
(new AttributeRange())
->withName("stage")
->withMin(1)
->withMax(2),
(new AttributeRange())
->withName("level")
->withMin(3)
->withMax(5),
])
->withTimeOffsetToken(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.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("namespace-0001")
.withGatheringName("gathering-0001")
.withUserId("user-0001")
.withAttributeRanges(Arrays.asList(
new AttributeRange()
.withName("stage")
.withMin(1)
.withMax(2),
new AttributeRange()
.withName("level")
.withMin(3)
.withMax(5)
))
.withTimeOffsetToken(null)
);
Gathering item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);
AsyncResult<Gs2.Gs2Matchmaking.Result.UpdateGatheringByUserIdResult> asyncResult = null;
yield return client.UpdateGatheringByUserId(
new Gs2.Gs2Matchmaking.Request.UpdateGatheringByUserIdRequest()
.WithNamespaceName("namespace-0001")
.WithGatheringName("gathering-0001")
.WithUserId("user-0001")
.WithAttributeRanges(new Gs2.Gs2Matchmaking.Model.AttributeRange[] {
new Gs2.Gs2Matchmaking.Model.AttributeRange()
.WithName("stage")
.WithMin(1)
.WithMax(2),
new Gs2.Gs2Matchmaking.Model.AttributeRange()
.WithName("level")
.WithMin(3)
.WithMax(5),
})
.WithTimeOffsetToken(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.updateGatheringByUserId(
new Gs2Matchmaking.UpdateGatheringByUserIdRequest()
.withNamespaceName("namespace-0001")
.withGatheringName("gathering-0001")
.withUserId("user-0001")
.withAttributeRanges([
new Gs2Matchmaking.model.AttributeRange()
.withName("stage")
.withMin(1)
.withMax(2),
new Gs2Matchmaking.model.AttributeRange()
.withName("level")
.withMin(3)
.withMax(5),
])
.withTimeOffsetToken(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.update_gathering_by_user_id(
matchmaking.UpdateGatheringByUserIdRequest()
.with_namespace_name('namespace-0001')
.with_gathering_name('gathering-0001')
.with_user_id('user-0001')
.with_attribute_ranges([
matchmaking.AttributeRange()
.with_name('stage')
.with_min(1)
.with_max(2),
matchmaking.AttributeRange()
.with_name('level')
.with_min(3)
.with_max(5),
])
.with_time_offset_token(None)
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('matchmaking')
api_result = client.update_gathering_by_user_id({
namespaceName="namespace-0001",
gatheringName="gathering-0001",
userId="user-0001",
attributeRanges={
{
name="stage",
min=1,
max=2,
},
{
name="level",
min=3,
max=5,
}
},
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('matchmaking')
api_result_handler = client.update_gathering_by_user_id_async({
namespaceName="namespace-0001",
gatheringName="gathering-0001",
userId="user-0001",
attributeRanges={
{
name="stage",
min=1,
max=2,
},
{
name="level",
min=3,
max=5,
}
},
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;doMatchmakingByPlayer
Player が参加できるギャザリングを探して参加する
一定時間 検索を行い、対象が見つからなかったときには マッチメイキングの状態を保持するトークン を返す。
次回 マッチメイキングの状態を保持するトークン をつけて再度リクエストを出すことで、前回の続きから検索処理を再開できる。
すべてのギャザリングを検索したが、参加できるギャザリングが存在しなかった場合はギャザリングもトークンもどちらも null が応答される。
詳細
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 | ||
| player | Player | ✓ | プレイヤー情報 | |||
| matchmakingContextToken | string | ~ 5120文字 | 検索の再開に使用する マッチメイキングの状態を保持するトークン |
Result
| 型 | 説明 | |
|---|---|---|
| item | Gathering | 参加したギャザリング |
| matchmakingContextToken | string | マッチメイキングの状態を保持するトークン |
実装例
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("namespace-0001"),
Player: &matchmaking.Player{
UserId: pointy.String("user-0001"),
Attributes: []Matchmaking.Attribute{
Matchmaking.Attribute{
Name: pointy.String("attr1"),
Value: 1,
}
Matchmaking.Attribute{
Name: pointy.String("attr2"),
Value: 1,
}
},
},
MatchmakingContextToken: nil,
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
matchmakingContextToken := result.MatchmakingContextTokenuse 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 Gs2MatchmakingRestClient(
$session
);
try {
$result = $client->doMatchmakingByPlayer(
(new DoMatchmakingByPlayerRequest())
->withNamespaceName("namespace-0001")
->withPlayer((new Player())
->withUserId("user-0001")
->withAttributes([
(new \Gs2\Matchmaking\Model\Attribute())
->withName("attr1")
->withValue(1)
(new \Gs2\Matchmaking\Model\Attribute())
->withName("attr2")
->withValue(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("namespace-0001")
.withPlayer(new Player()
.withUserId("user-0001")
.withAttributes(Arrays.asList(
new io.gs2.matchmaking.model.Attribute()
.withName("attr1")
.withValue(1)
new io.gs2.matchmaking.model.Attribute()
.withName("attr2")
.withValue(1),
))
.withMatchmakingContextToken(null)
);
Gathering item = result.getItem();
String matchmakingContextToken = result.getMatchmakingContextToken();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);
AsyncResult<Gs2.Gs2Matchmaking.Result.DoMatchmakingByPlayerResult> asyncResult = null;
yield return client.DoMatchmakingByPlayer(
new Gs2.Gs2Matchmaking.Request.DoMatchmakingByPlayerRequest()
.WithNamespaceName("namespace-0001")
.WithPlayer(new Gs2.Gs2Matchmaking.Model.Player()
.WithUserId("user-0001")
.WithAttributes(new Gs2.Gs2Matchmaking.Model.Attribute[] {
.WithName("attr1")
.WithValue(1)
.WithName("attr2")
.WithValue(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("namespace-0001")
.withPlayer(new Gs2Matchmaking.model.Player()
.withUserId("user-0001")
.withAttributes([
new Gs2Matchmaking.model.Attribute()
.withName("attr1")
.withValue(1)
new Gs2Matchmaking.model.Attribute()
.withName("attr2")
.withValue(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('namespace-0001')
.with_player(matchmaking.Player()
.with_user_id('user-0001')
.with_attributes([
matchmaking.attribute()
.with_name('attr1')
.with_value(1),
matchmaking.attribute()
.with_name('attr2')
.with_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="namespace-0001",
player={
user_id="user-0001",
attributes={
attribute={
name="attr1",
value=1,
}attribute={
name="attr2",
value=1,
}
},
},
matchmakingContextToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;
matchmakingContextToken = result.matchmakingContextToken;client = gs2('matchmaking')
api_result_handler = client.do_matchmaking_by_player_async({
namespaceName="namespace-0001",
player={
user_id="user-0001",
attributes={
attribute={
name="attr1",
value=1,
}attribute={
name="attr2",
value=1,
}
},
},
matchmakingContextToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;
matchmakingContextToken = result.matchmakingContextToken;doMatchmaking
自分が参加できるギャザリングを探して参加する
一定時間 検索を行い、対象が見つからなかったときには マッチメイキングの状態を保持するトークン を返す。
次回 マッチメイキングの状態を保持するトークン をつけて再度リクエストを出すことで、前回の続きから検索処理を再開できる。
すべてのギャザリングを検索したが、参加できるギャザリングが存在しなかった場合はギャザリングもトークンもどちらも null が応答される。
詳細
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 | ||
| accessToken | string | ✓ | ~ 128文字 | アクセストークン | ||
| player | Player | ✓ | 自身のプレイヤー情報 | |||
| matchmakingContextToken | string | ~ 5120文字 | 検索の再開に使用する マッチメイキングの状態を保持するトークン |
Result
| 型 | 説明 | |
|---|---|---|
| item | Gathering | 参加したギャザリング |
| matchmakingContextToken | string | マッチメイキングの状態を保持するトークン |
実装例
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("namespace-0001"),
AccessToken: pointy.String("accessToken-0001"),
Player: &matchmaking.Player{
UserId: pointy.String("user-0001"),
Attributes: []Matchmaking.Attribute{
Matchmaking.Attribute{
Name: pointy.String("attr1"),
Value: 1,
}
Matchmaking.Attribute{
Name: pointy.String("attr2"),
Value: 1,
}
},
},
MatchmakingContextToken: nil,
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
matchmakingContextToken := result.MatchmakingContextTokenuse 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 Gs2MatchmakingRestClient(
$session
);
try {
$result = $client->doMatchmaking(
(new DoMatchmakingRequest())
->withNamespaceName("namespace-0001")
->withAccessToken("accessToken-0001")
->withPlayer((new Player())
->withUserId("user-0001")
->withAttributes([
(new \Gs2\Matchmaking\Model\Attribute())
->withName("attr1")
->withValue(1)
(new \Gs2\Matchmaking\Model\Attribute())
->withName("attr2")
->withValue(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("namespace-0001")
.withAccessToken("accessToken-0001")
.withPlayer(new Player()
.withUserId("user-0001")
.withAttributes(Arrays.asList(
new io.gs2.matchmaking.model.Attribute()
.withName("attr1")
.withValue(1)
new io.gs2.matchmaking.model.Attribute()
.withName("attr2")
.withValue(1),
))
.withMatchmakingContextToken(null)
);
Gathering item = result.getItem();
String matchmakingContextToken = result.getMatchmakingContextToken();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);
AsyncResult<Gs2.Gs2Matchmaking.Result.DoMatchmakingResult> asyncResult = null;
yield return client.DoMatchmaking(
new Gs2.Gs2Matchmaking.Request.DoMatchmakingRequest()
.WithNamespaceName("namespace-0001")
.WithAccessToken("accessToken-0001")
.WithPlayer(new Gs2.Gs2Matchmaking.Model.Player()
.WithUserId("user-0001")
.WithAttributes(new Gs2.Gs2Matchmaking.Model.Attribute[] {
.WithName("attr1")
.WithValue(1)
.WithName("attr2")
.WithValue(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("namespace-0001")
.withAccessToken("accessToken-0001")
.withPlayer(new Gs2Matchmaking.model.Player()
.withUserId("user-0001")
.withAttributes([
new Gs2Matchmaking.model.Attribute()
.withName("attr1")
.withValue(1)
new Gs2Matchmaking.model.Attribute()
.withName("attr2")
.withValue(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('namespace-0001')
.with_access_token('accessToken-0001')
.with_player(matchmaking.Player()
.with_user_id('user-0001')
.with_attributes([
matchmaking.attribute()
.with_name('attr1')
.with_value(1),
matchmaking.attribute()
.with_name('attr2')
.with_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="namespace-0001",
accessToken="accessToken-0001",
player={
user_id="user-0001",
attributes={
attribute={
name="attr1",
value=1,
}attribute={
name="attr2",
value=1,
}
},
},
matchmakingContextToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;
matchmakingContextToken = result.matchmakingContextToken;client = gs2('matchmaking')
api_result_handler = client.do_matchmaking_async({
namespaceName="namespace-0001",
accessToken="accessToken-0001",
player={
user_id="user-0001",
attributes={
attribute={
name="attr1",
value=1,
}attribute={
name="attr2",
value=1,
}
},
},
matchmakingContextToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;
matchmakingContextToken = result.matchmakingContextToken;doMatchmakingByUserId
自分が参加できるギャザリングを探して参加する
一定時間 検索を行い、対象が見つからなかったときには マッチメイキングの状態を保持するトークン を返す。
次回 マッチメイキングの状態を保持するトークン をつけて再度リクエストを出すことで、前回の続きから検索処理を再開できる。
すべてのギャザリングを検索したが、参加できるギャザリングが存在しなかった場合はギャザリングもトークンもどちらも null が応答される。
詳細
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 | ||
| userId | string | ✓ | ~ 128文字 | ユーザーID | ||
| player | Player | ✓ | 自身のプレイヤー情報 | |||
| matchmakingContextToken | string | ~ 5120文字 | 検索の再開に使用する マッチメイキングの状態を保持するトークン | |||
| timeOffsetToken | string | ~ 1024文字 | タイムオフセットトークン |
Result
| 型 | 説明 | |
|---|---|---|
| item | Gathering | 参加したギャザリング |
| matchmakingContextToken | string | マッチメイキングの状態を保持するトークン |
実装例
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("namespace-0001"),
UserId: pointy.String("user-0001"),
Player: nil,
MatchmakingContextToken: nil,
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
matchmakingContextToken := result.MatchmakingContextTokenuse 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 Gs2MatchmakingRestClient(
$session
);
try {
$result = $client->doMatchmakingByUserId(
(new DoMatchmakingByUserIdRequest())
->withNamespaceName("namespace-0001")
->withUserId("user-0001")
->withPlayer(null)
->withMatchmakingContextToken(null)
->withTimeOffsetToken(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("namespace-0001")
.withUserId("user-0001")
.withPlayer(null)
.withMatchmakingContextToken(null)
.withTimeOffsetToken(null)
);
Gathering item = result.getItem();
String matchmakingContextToken = result.getMatchmakingContextToken();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);
AsyncResult<Gs2.Gs2Matchmaking.Result.DoMatchmakingByUserIdResult> asyncResult = null;
yield return client.DoMatchmakingByUserId(
new Gs2.Gs2Matchmaking.Request.DoMatchmakingByUserIdRequest()
.WithNamespaceName("namespace-0001")
.WithUserId("user-0001")
.WithPlayer(null)
.WithMatchmakingContextToken(null)
.WithTimeOffsetToken(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("namespace-0001")
.withUserId("user-0001")
.withPlayer(null)
.withMatchmakingContextToken(null)
.withTimeOffsetToken(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('namespace-0001')
.with_user_id('user-0001')
.with_player(None)
.with_matchmaking_context_token(None)
.with_time_offset_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="namespace-0001",
userId="user-0001",
player=nil,
matchmakingContextToken=nil,
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;
matchmakingContextToken = result.matchmakingContextToken;client = gs2('matchmaking')
api_result_handler = client.do_matchmaking_by_user_id_async({
namespaceName="namespace-0001",
userId="user-0001",
player=nil,
matchmakingContextToken=nil,
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;
matchmakingContextToken = result.matchmakingContextToken;ping
マッチメイキング待機中であることを通知
プレイヤーがまだギャザリングで待機中であることを示すキープアライブ ping を送信します。
切断検知が有効な場合、設定されたタイムアウト期間内に ping を送信しなかったプレイヤーはギャザリングから自動的に削除されます。
タイムアウトしたプレイヤーのチェックと削除も行います。
詳細
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 | ||
| gatheringName | string | ✓ | UUID | ~ 128文字 | ギャザリング名 ギャザリングの一意な名前を保持します。 名前は UUID(Universally Unique Identifier)フォーマットで自動的に生成され、ギャザリングを識別するために使用されます。 | |
| accessToken | string | ✓ | ~ 128文字 | アクセストークン |
Result
| 型 | 説明 | |
|---|---|---|
| item | Gathering | 更新したギャザリング |
実装例
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.Ping(
&matchmaking.PingRequest {
NamespaceName: pointy.String("namespace-0001"),
GatheringName: pointy.String("gathering-0001"),
AccessToken: pointy.String("accessToken-0001"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse 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\PingRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2MatchmakingRestClient(
$session
);
try {
$result = $client->ping(
(new PingRequest())
->withNamespaceName("namespace-0001")
->withGatheringName("gathering-0001")
->withAccessToken("accessToken-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.PingRequest;
import io.gs2.matchmaking.result.PingResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);
try {
PingResult result = client.ping(
new PingRequest()
.withNamespaceName("namespace-0001")
.withGatheringName("gathering-0001")
.withAccessToken("accessToken-0001")
);
Gathering item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);
AsyncResult<Gs2.Gs2Matchmaking.Result.PingResult> asyncResult = null;
yield return client.Ping(
new Gs2.Gs2Matchmaking.Request.PingRequest()
.WithNamespaceName("namespace-0001")
.WithGatheringName("gathering-0001")
.WithAccessToken("accessToken-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.ping(
new Gs2Matchmaking.PingRequest()
.withNamespaceName("namespace-0001")
.withGatheringName("gathering-0001")
.withAccessToken("accessToken-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.ping(
matchmaking.PingRequest()
.with_namespace_name('namespace-0001')
.with_gathering_name('gathering-0001')
.with_access_token('accessToken-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('matchmaking')
api_result = client.ping({
namespaceName="namespace-0001",
gatheringName="gathering-0001",
accessToken="accessToken-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('matchmaking')
api_result_handler = client.ping_async({
namespaceName="namespace-0001",
gatheringName="gathering-0001",
accessToken="accessToken-0001",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;pingByUserId
ユーザーIDを指定してマッチメイキング待機中であることを通知
指定されたユーザーのキープアライブ ping を送信します。タイムアウトしたプレイヤーは自動的に削除されます。
詳細
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 | ||
| gatheringName | string | ✓ | UUID | ~ 128文字 | ギャザリング名 ギャザリングの一意な名前を保持します。 名前は UUID(Universally Unique Identifier)フォーマットで自動的に生成され、ギャザリングを識別するために使用されます。 | |
| userId | string | ✓ | ~ 128文字 | ユーザーID | ||
| timeOffsetToken | string | ~ 1024文字 | タイムオフセットトークン |
Result
| 型 | 説明 | |
|---|---|---|
| item | Gathering | 更新したギャザリング |
実装例
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.PingByUserId(
&matchmaking.PingByUserIdRequest {
NamespaceName: pointy.String("namespace-0001"),
GatheringName: pointy.String("gathering-0001"),
UserId: pointy.String("user-0001"),
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse 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\PingByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2MatchmakingRestClient(
$session
);
try {
$result = $client->pingByUserId(
(new PingByUserIdRequest())
->withNamespaceName("namespace-0001")
->withGatheringName("gathering-0001")
->withUserId("user-0001")
->withTimeOffsetToken(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.PingByUserIdRequest;
import io.gs2.matchmaking.result.PingByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);
try {
PingByUserIdResult result = client.pingByUserId(
new PingByUserIdRequest()
.withNamespaceName("namespace-0001")
.withGatheringName("gathering-0001")
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
Gathering item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);
AsyncResult<Gs2.Gs2Matchmaking.Result.PingByUserIdResult> asyncResult = null;
yield return client.PingByUserId(
new Gs2.Gs2Matchmaking.Request.PingByUserIdRequest()
.WithNamespaceName("namespace-0001")
.WithGatheringName("gathering-0001")
.WithUserId("user-0001")
.WithTimeOffsetToken(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.pingByUserId(
new Gs2Matchmaking.PingByUserIdRequest()
.withNamespaceName("namespace-0001")
.withGatheringName("gathering-0001")
.withUserId("user-0001")
.withTimeOffsetToken(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.ping_by_user_id(
matchmaking.PingByUserIdRequest()
.with_namespace_name('namespace-0001')
.with_gathering_name('gathering-0001')
.with_user_id('user-0001')
.with_time_offset_token(None)
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('matchmaking')
api_result = client.ping_by_user_id({
namespaceName="namespace-0001",
gatheringName="gathering-0001",
userId="user-0001",
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('matchmaking')
api_result_handler = client.ping_by_user_id_async({
namespaceName="namespace-0001",
gatheringName="gathering-0001",
userId="user-0001",
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;getGathering
ギャザリングを取得
指定されたギャザリングの現在の参加者、属性値の範囲、ロールの定員、有効期限設定を含む情報を取得します。
詳細
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 | ||
| gatheringName | string | ✓ | UUID | ~ 128文字 | ギャザリング名 ギャザリングの一意な名前を保持します。 名前は UUID(Universally Unique Identifier)フォーマットで自動的に生成され、ギャザリングを識別するために使用されます。 |
Result
| 型 | 説明 | |
|---|---|---|
| item | Gathering | ギャザリング |
実装例
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("namespace-0001"),
GatheringName: pointy.String("gathering-0001"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse 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 Gs2MatchmakingRestClient(
$session
);
try {
$result = $client->getGathering(
(new GetGatheringRequest())
->withNamespaceName("namespace-0001")
->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.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("namespace-0001")
.withGatheringName("gathering-0001")
);
Gathering item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);
AsyncResult<Gs2.Gs2Matchmaking.Result.GetGatheringResult> asyncResult = null;
yield return client.GetGathering(
new Gs2.Gs2Matchmaking.Request.GetGatheringRequest()
.WithNamespaceName("namespace-0001")
.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.getGathering(
new Gs2Matchmaking.GetGatheringRequest()
.withNamespaceName("namespace-0001")
.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.get_gathering(
matchmaking.GetGatheringRequest()
.with_namespace_name('namespace-0001')
.with_gathering_name('gathering-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('matchmaking')
api_result = client.get_gathering({
namespaceName="namespace-0001",
gatheringName="gathering-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('matchmaking')
api_result_handler = client.get_gathering_async({
namespaceName="namespace-0001",
gatheringName="gathering-0001",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;cancelMatchmaking
マッチメイキングをキャンセルする
ギャザリングから離脱する前にマッチメイキングが完了した場合は、NotFoundException(404エラー) が発生し失敗します
詳細
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 | ||
| gatheringName | string | ✓ | UUID | ~ 128文字 | ギャザリング名 ギャザリングの一意な名前を保持します。 名前は UUID(Universally Unique Identifier)フォーマットで自動的に生成され、ギャザリングを識別するために使用されます。 | |
| accessToken | string | ✓ | ~ 128文字 | アクセストークン |
Result
| 型 | 説明 | |
|---|---|---|
| item | Gathering | キャンセルしたギャザリング |
実装例
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("namespace-0001"),
GatheringName: pointy.String("gathering-0001"),
AccessToken: pointy.String("accessToken-0001"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse 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 Gs2MatchmakingRestClient(
$session
);
try {
$result = $client->cancelMatchmaking(
(new CancelMatchmakingRequest())
->withNamespaceName("namespace-0001")
->withGatheringName("gathering-0001")
->withAccessToken("accessToken-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.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("namespace-0001")
.withGatheringName("gathering-0001")
.withAccessToken("accessToken-0001")
);
Gathering item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);
AsyncResult<Gs2.Gs2Matchmaking.Result.CancelMatchmakingResult> asyncResult = null;
yield return client.CancelMatchmaking(
new Gs2.Gs2Matchmaking.Request.CancelMatchmakingRequest()
.WithNamespaceName("namespace-0001")
.WithGatheringName("gathering-0001")
.WithAccessToken("accessToken-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("namespace-0001")
.withGatheringName("gathering-0001")
.withAccessToken("accessToken-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('namespace-0001')
.with_gathering_name('gathering-0001')
.with_access_token('accessToken-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('matchmaking')
api_result = client.cancel_matchmaking({
namespaceName="namespace-0001",
gatheringName="gathering-0001",
accessToken="accessToken-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('matchmaking')
api_result_handler = client.cancel_matchmaking_async({
namespaceName="namespace-0001",
gatheringName="gathering-0001",
accessToken="accessToken-0001",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;cancelMatchmakingByUserId
ユーザーIDを指定してマッチメイキングをキャンセルする
ギャザリングから離脱する前にマッチメイキングが完了した場合は、NotFoundException(404エラー) が発生し失敗します
詳細
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 | ||
| gatheringName | string | ✓ | UUID | ~ 128文字 | ギャザリング名 ギャザリングの一意な名前を保持します。 名前は UUID(Universally Unique Identifier)フォーマットで自動的に生成され、ギャザリングを識別するために使用されます。 | |
| userId | string | ✓ | ~ 128文字 | ユーザーID | ||
| timeOffsetToken | string | ~ 1024文字 | タイムオフセットトークン |
Result
| 型 | 説明 | |
|---|---|---|
| item | Gathering | キャンセルしたギャザリング |
実装例
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("namespace-0001"),
GatheringName: pointy.String("gathering-0001"),
UserId: pointy.String("user-0001"),
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse 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 Gs2MatchmakingRestClient(
$session
);
try {
$result = $client->cancelMatchmakingByUserId(
(new CancelMatchmakingByUserIdRequest())
->withNamespaceName("namespace-0001")
->withGatheringName("gathering-0001")
->withUserId("user-0001")
->withTimeOffsetToken(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.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("namespace-0001")
.withGatheringName("gathering-0001")
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
Gathering item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);
AsyncResult<Gs2.Gs2Matchmaking.Result.CancelMatchmakingByUserIdResult> asyncResult = null;
yield return client.CancelMatchmakingByUserId(
new Gs2.Gs2Matchmaking.Request.CancelMatchmakingByUserIdRequest()
.WithNamespaceName("namespace-0001")
.WithGatheringName("gathering-0001")
.WithUserId("user-0001")
.WithTimeOffsetToken(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.cancelMatchmakingByUserId(
new Gs2Matchmaking.CancelMatchmakingByUserIdRequest()
.withNamespaceName("namespace-0001")
.withGatheringName("gathering-0001")
.withUserId("user-0001")
.withTimeOffsetToken(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.cancel_matchmaking_by_user_id(
matchmaking.CancelMatchmakingByUserIdRequest()
.with_namespace_name('namespace-0001')
.with_gathering_name('gathering-0001')
.with_user_id('user-0001')
.with_time_offset_token(None)
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('matchmaking')
api_result = client.cancel_matchmaking_by_user_id({
namespaceName="namespace-0001",
gatheringName="gathering-0001",
userId="user-0001",
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('matchmaking')
api_result_handler = client.cancel_matchmaking_by_user_id_async({
namespaceName="namespace-0001",
gatheringName="gathering-0001",
userId="user-0001",
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;earlyComplete
マッチメイキングを早期終了する
マッチメイキングが規定人数に達していない状態で、マッチメイキングを早期終了します。
早期終了が可能なのは、ギャザリングを作成したプレイヤーのみです。
詳細
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 | ||
| gatheringName | string | ✓ | UUID | ~ 128文字 | ギャザリング名 ギャザリングの一意な名前を保持します。 名前は UUID(Universally Unique Identifier)フォーマットで自動的に生成され、ギャザリングを識別するために使用されます。 | |
| accessToken | string | ✓ | ~ 128文字 | アクセストークン |
Result
| 型 | 説明 | |
|---|---|---|
| item | Gathering | キャンセルしたギャザリング |
実装例
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.EarlyComplete(
&matchmaking.EarlyCompleteRequest {
NamespaceName: pointy.String("namespace-0001"),
GatheringName: pointy.String("gathering-0001"),
AccessToken: pointy.String("accessToken-0001"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse 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\EarlyCompleteRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2MatchmakingRestClient(
$session
);
try {
$result = $client->earlyComplete(
(new EarlyCompleteRequest())
->withNamespaceName("namespace-0001")
->withGatheringName("gathering-0001")
->withAccessToken("accessToken-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.EarlyCompleteRequest;
import io.gs2.matchmaking.result.EarlyCompleteResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);
try {
EarlyCompleteResult result = client.earlyComplete(
new EarlyCompleteRequest()
.withNamespaceName("namespace-0001")
.withGatheringName("gathering-0001")
.withAccessToken("accessToken-0001")
);
Gathering item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);
AsyncResult<Gs2.Gs2Matchmaking.Result.EarlyCompleteResult> asyncResult = null;
yield return client.EarlyComplete(
new Gs2.Gs2Matchmaking.Request.EarlyCompleteRequest()
.WithNamespaceName("namespace-0001")
.WithGatheringName("gathering-0001")
.WithAccessToken("accessToken-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.earlyComplete(
new Gs2Matchmaking.EarlyCompleteRequest()
.withNamespaceName("namespace-0001")
.withGatheringName("gathering-0001")
.withAccessToken("accessToken-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.early_complete(
matchmaking.EarlyCompleteRequest()
.with_namespace_name('namespace-0001')
.with_gathering_name('gathering-0001')
.with_access_token('accessToken-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('matchmaking')
api_result = client.early_complete({
namespaceName="namespace-0001",
gatheringName="gathering-0001",
accessToken="accessToken-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('matchmaking')
api_result_handler = client.early_complete_async({
namespaceName="namespace-0001",
gatheringName="gathering-0001",
accessToken="accessToken-0001",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;earlyCompleteByUserId
ユーザーIDを指定してマッチメイキングを早期終了する
マッチメイキングが規定人数に達していない状態で、マッチメイキングを早期終了します。
早期終了が可能なのは、ギャザリングを作成したプレイヤーのみです。
詳細
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 | ||
| gatheringName | string | ✓ | UUID | ~ 128文字 | ギャザリング名 ギャザリングの一意な名前を保持します。 名前は UUID(Universally Unique Identifier)フォーマットで自動的に生成され、ギャザリングを識別するために使用されます。 | |
| userId | string | ✓ | ~ 128文字 | ユーザーID | ||
| timeOffsetToken | string | ~ 1024文字 | タイムオフセットトークン |
Result
| 型 | 説明 | |
|---|---|---|
| item | Gathering | キャンセルしたギャザリング |
実装例
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.EarlyCompleteByUserId(
&matchmaking.EarlyCompleteByUserIdRequest {
NamespaceName: pointy.String("namespace-0001"),
GatheringName: pointy.String("gathering-0001"),
UserId: pointy.String("user-0001"),
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse 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\EarlyCompleteByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2MatchmakingRestClient(
$session
);
try {
$result = $client->earlyCompleteByUserId(
(new EarlyCompleteByUserIdRequest())
->withNamespaceName("namespace-0001")
->withGatheringName("gathering-0001")
->withUserId("user-0001")
->withTimeOffsetToken(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.EarlyCompleteByUserIdRequest;
import io.gs2.matchmaking.result.EarlyCompleteByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);
try {
EarlyCompleteByUserIdResult result = client.earlyCompleteByUserId(
new EarlyCompleteByUserIdRequest()
.withNamespaceName("namespace-0001")
.withGatheringName("gathering-0001")
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
Gathering item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);
AsyncResult<Gs2.Gs2Matchmaking.Result.EarlyCompleteByUserIdResult> asyncResult = null;
yield return client.EarlyCompleteByUserId(
new Gs2.Gs2Matchmaking.Request.EarlyCompleteByUserIdRequest()
.WithNamespaceName("namespace-0001")
.WithGatheringName("gathering-0001")
.WithUserId("user-0001")
.WithTimeOffsetToken(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.earlyCompleteByUserId(
new Gs2Matchmaking.EarlyCompleteByUserIdRequest()
.withNamespaceName("namespace-0001")
.withGatheringName("gathering-0001")
.withUserId("user-0001")
.withTimeOffsetToken(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.early_complete_by_user_id(
matchmaking.EarlyCompleteByUserIdRequest()
.with_namespace_name('namespace-0001')
.with_gathering_name('gathering-0001')
.with_user_id('user-0001')
.with_time_offset_token(None)
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('matchmaking')
api_result = client.early_complete_by_user_id({
namespaceName="namespace-0001",
gatheringName="gathering-0001",
userId="user-0001",
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('matchmaking')
api_result_handler = client.early_complete_by_user_id_async({
namespaceName="namespace-0001",
gatheringName="gathering-0001",
userId="user-0001",
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;deleteGathering
ギャザリングを削除
指定されたギャザリングおよび関連するすべての参加者データを完全に削除します。
詳細
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 | ||
| gatheringName | string | ✓ | UUID | ~ 128文字 | ギャザリング名 ギャザリングの一意な名前を保持します。 名前は UUID(Universally Unique Identifier)フォーマットで自動的に生成され、ギャザリングを識別するために使用されます。 |
Result
| 型 | 説明 | |
|---|---|---|
| item | Gathering | 削除したギャザリング |
実装例
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("namespace-0001"),
GatheringName: pointy.String("gathering-0001"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse 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 Gs2MatchmakingRestClient(
$session
);
try {
$result = $client->deleteGathering(
(new DeleteGatheringRequest())
->withNamespaceName("namespace-0001")
->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("namespace-0001")
.withGatheringName("gathering-0001")
);
Gathering item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);
AsyncResult<Gs2.Gs2Matchmaking.Result.DeleteGatheringResult> asyncResult = null;
yield return client.DeleteGathering(
new Gs2.Gs2Matchmaking.Request.DeleteGatheringRequest()
.WithNamespaceName("namespace-0001")
.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("namespace-0001")
.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('namespace-0001')
.with_gathering_name('gathering-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('matchmaking')
api_result = client.delete_gathering({
namespaceName="namespace-0001",
gatheringName="gathering-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('matchmaking')
api_result_handler = client.delete_gathering_async({
namespaceName="namespace-0001",
gatheringName="gathering-0001",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;describeSeasonGatherings
シーズンギャザリングの一覧を取得
指定されたシーズンのシーズンギャザリングのページネーション付きリストを取得します。
ティアーでフィルタリングして、特定のスキルレベルのギャザリングのみを表示できます。
詳細
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 | ||
| seasonName | string | ✓ | ~ 128文字 | シーズンモデル名 シーズンモデル固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 | ||
| season | long | ✓ | 0 ~ 9223372036854775805 | シーズン | ||
| tier | long | 0 ~ 9223372036854775805 | ティアー | |||
| pageToken | string | ~ 1024文字 | データの取得を開始する位置を指定するトークン | |||
| limit | int | 30 | 1 ~ 1000 | データの取得件数 |
Result
| 型 | 説明 | |
|---|---|---|
| items | List<SeasonGathering> | シーズンギャザリングのリスト |
| nextPageToken | string | リストの続きを取得するためのページトークン |
実装例
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.DescribeSeasonGatherings(
&matchmaking.DescribeSeasonGatheringsRequest {
NamespaceName: pointy.String("namespace-0001"),
SeasonName: pointy.String("season-0001"),
Season: pointy.Int64(0),
Tier: pointy.Int64(0),
PageToken: nil,
Limit: nil,
}
)
if err != nil {
panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageTokenuse 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\DescribeSeasonGatheringsRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2MatchmakingRestClient(
$session
);
try {
$result = $client->describeSeasonGatherings(
(new DescribeSeasonGatheringsRequest())
->withNamespaceName("namespace-0001")
->withSeasonName("season-0001")
->withSeason(0)
->withTier(0)
->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.DescribeSeasonGatheringsRequest;
import io.gs2.matchmaking.result.DescribeSeasonGatheringsResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);
try {
DescribeSeasonGatheringsResult result = client.describeSeasonGatherings(
new DescribeSeasonGatheringsRequest()
.withNamespaceName("namespace-0001")
.withSeasonName("season-0001")
.withSeason(0L)
.withTier(0L)
.withPageToken(null)
.withLimit(null)
);
List<SeasonGathering> items = result.getItems();
String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);
AsyncResult<Gs2.Gs2Matchmaking.Result.DescribeSeasonGatheringsResult> asyncResult = null;
yield return client.DescribeSeasonGatherings(
new Gs2.Gs2Matchmaking.Request.DescribeSeasonGatheringsRequest()
.WithNamespaceName("namespace-0001")
.WithSeasonName("season-0001")
.WithSeason(0L)
.WithTier(0L)
.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.describeSeasonGatherings(
new Gs2Matchmaking.DescribeSeasonGatheringsRequest()
.withNamespaceName("namespace-0001")
.withSeasonName("season-0001")
.withSeason(0)
.withTier(0)
.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_season_gatherings(
matchmaking.DescribeSeasonGatheringsRequest()
.with_namespace_name('namespace-0001')
.with_season_name('season-0001')
.with_season(0)
.with_tier(0)
.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_season_gatherings({
namespaceName="namespace-0001",
seasonName="season-0001",
season=0,
tier=0,
pageToken=nil,
limit=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;client = gs2('matchmaking')
api_result_handler = client.describe_season_gatherings_async({
namespaceName="namespace-0001",
seasonName="season-0001",
season=0,
tier=0,
pageToken=nil,
limit=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;describeMatchmakingSeasonGatherings
マッチメイキング中のシーズンギャザリングの一覧を取得
現在マッチメイキング可能なシーズンギャザリングのページネーション付きリストを取得します。
ティアーでフィルタリングできます。最大参加人数に達していないギャザリングのみが返されます。
詳細
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 | ||
| seasonName | string | ✓ | ~ 128文字 | シーズンモデル名 シーズンモデル固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 | ||
| season | long | ✓ | 0 ~ 9223372036854775805 | シーズン | ||
| tier | long | 0 ~ 9223372036854775805 | ティアー | |||
| pageToken | string | ~ 1024文字 | データの取得を開始する位置を指定するトークン | |||
| limit | int | 30 | 1 ~ 1000 | データの取得件数 |
Result
| 型 | 説明 | |
|---|---|---|
| items | List<SeasonGathering> | シーズンギャザリングのリスト |
| nextPageToken | string | リストの続きを取得するためのページトークン |
実装例
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.DescribeMatchmakingSeasonGatherings(
&matchmaking.DescribeMatchmakingSeasonGatheringsRequest {
NamespaceName: pointy.String("namespace-0001"),
SeasonName: pointy.String("season-0001"),
Season: pointy.Int64(0),
Tier: nil,
PageToken: nil,
Limit: nil,
}
)
if err != nil {
panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageTokenuse 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\DescribeMatchmakingSeasonGatheringsRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2MatchmakingRestClient(
$session
);
try {
$result = $client->describeMatchmakingSeasonGatherings(
(new DescribeMatchmakingSeasonGatheringsRequest())
->withNamespaceName("namespace-0001")
->withSeasonName("season-0001")
->withSeason(0)
->withTier(null)
->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.DescribeMatchmakingSeasonGatheringsRequest;
import io.gs2.matchmaking.result.DescribeMatchmakingSeasonGatheringsResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);
try {
DescribeMatchmakingSeasonGatheringsResult result = client.describeMatchmakingSeasonGatherings(
new DescribeMatchmakingSeasonGatheringsRequest()
.withNamespaceName("namespace-0001")
.withSeasonName("season-0001")
.withSeason(0L)
.withTier(null)
.withPageToken(null)
.withLimit(null)
);
List<SeasonGathering> items = result.getItems();
String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);
AsyncResult<Gs2.Gs2Matchmaking.Result.DescribeMatchmakingSeasonGatheringsResult> asyncResult = null;
yield return client.DescribeMatchmakingSeasonGatherings(
new Gs2.Gs2Matchmaking.Request.DescribeMatchmakingSeasonGatheringsRequest()
.WithNamespaceName("namespace-0001")
.WithSeasonName("season-0001")
.WithSeason(0L)
.WithTier(null)
.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.describeMatchmakingSeasonGatherings(
new Gs2Matchmaking.DescribeMatchmakingSeasonGatheringsRequest()
.withNamespaceName("namespace-0001")
.withSeasonName("season-0001")
.withSeason(0)
.withTier(null)
.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_matchmaking_season_gatherings(
matchmaking.DescribeMatchmakingSeasonGatheringsRequest()
.with_namespace_name('namespace-0001')
.with_season_name('season-0001')
.with_season(0)
.with_tier(None)
.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_matchmaking_season_gatherings({
namespaceName="namespace-0001",
seasonName="season-0001",
season=0,
tier=nil,
pageToken=nil,
limit=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;client = gs2('matchmaking')
api_result_handler = client.describe_matchmaking_season_gatherings_async({
namespaceName="namespace-0001",
seasonName="season-0001",
season=0,
tier=nil,
pageToken=nil,
limit=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;doSeasonMatchmaking
自分が参加できるシーズンギャザリングを探して参加する
一定時間 検索を行い、対象が見つからなかったときには マッチメイキングの状態を保持するトークン を返す。
次回 マッチメイキングの状態を保持するトークン をつけて再度リクエストを出すことで、前回の続きから検索処理を再開できる。
すべてのシーズンギャザリングを検索したが、参加できるシーズンギャザリングが存在しなかった場合はシーズンギャザリングもトークンもどちらも null が応答される。
詳細
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 | ||
| seasonName | string | ✓ | ~ 128文字 | シーズンモデル名 シーズンモデル固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 | ||
| accessToken | string | ✓ | ~ 128文字 | アクセストークン | ||
| matchmakingContextToken | string | ~ 5120文字 | 検索の再開に使用する マッチメイキングの状態を保持するトークン |
Result
| 型 | 説明 | |
|---|---|---|
| item | SeasonGathering | 参加したシーズンギャザリング |
| matchmakingContextToken | string | マッチメイキングの状態を保持するトークン |
実装例
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.DoSeasonMatchmaking(
&matchmaking.DoSeasonMatchmakingRequest {
NamespaceName: pointy.String("namespace-0001"),
SeasonName: pointy.String("season-0001"),
AccessToken: pointy.String("accessToken-0001"),
MatchmakingContextToken: nil,
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
matchmakingContextToken := result.MatchmakingContextTokenuse 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\DoSeasonMatchmakingRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2MatchmakingRestClient(
$session
);
try {
$result = $client->doSeasonMatchmaking(
(new DoSeasonMatchmakingRequest())
->withNamespaceName("namespace-0001")
->withSeasonName("season-0001")
->withAccessToken("accessToken-0001")
->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.DoSeasonMatchmakingRequest;
import io.gs2.matchmaking.result.DoSeasonMatchmakingResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);
try {
DoSeasonMatchmakingResult result = client.doSeasonMatchmaking(
new DoSeasonMatchmakingRequest()
.withNamespaceName("namespace-0001")
.withSeasonName("season-0001")
.withAccessToken("accessToken-0001")
.withMatchmakingContextToken(null)
);
SeasonGathering item = result.getItem();
String matchmakingContextToken = result.getMatchmakingContextToken();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);
AsyncResult<Gs2.Gs2Matchmaking.Result.DoSeasonMatchmakingResult> asyncResult = null;
yield return client.DoSeasonMatchmaking(
new Gs2.Gs2Matchmaking.Request.DoSeasonMatchmakingRequest()
.WithNamespaceName("namespace-0001")
.WithSeasonName("season-0001")
.WithAccessToken("accessToken-0001")
.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.doSeasonMatchmaking(
new Gs2Matchmaking.DoSeasonMatchmakingRequest()
.withNamespaceName("namespace-0001")
.withSeasonName("season-0001")
.withAccessToken("accessToken-0001")
.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_season_matchmaking(
matchmaking.DoSeasonMatchmakingRequest()
.with_namespace_name('namespace-0001')
.with_season_name('season-0001')
.with_access_token('accessToken-0001')
.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_season_matchmaking({
namespaceName="namespace-0001",
seasonName="season-0001",
accessToken="accessToken-0001",
matchmakingContextToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;
matchmakingContextToken = result.matchmakingContextToken;client = gs2('matchmaking')
api_result_handler = client.do_season_matchmaking_async({
namespaceName="namespace-0001",
seasonName="season-0001",
accessToken="accessToken-0001",
matchmakingContextToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;
matchmakingContextToken = result.matchmakingContextToken;doSeasonMatchmakingByUserId
自分が参加できるシーズンギャザリングを探して参加する
一定時間 検索を行い、対象が見つからなかったときには マッチメイキングの状態を保持するトークン を返す。
次回 マッチメイキングの状態を保持するトークン をつけて再度リクエストを出すことで、前回の続きから検索処理を再開できる。
すべてのシーズンギャザリングを検索したが、参加できるシーズンギャザリングが存在しなかった場合はシーズンギャザリングもトークンもどちらも null が応答される。
詳細
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 | ||
| seasonName | string | ✓ | ~ 128文字 | シーズンモデル名 シーズンモデル固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 | ||
| userId | string | ✓ | ~ 128文字 | ユーザーID | ||
| matchmakingContextToken | string | ~ 5120文字 | 検索の再開に使用する マッチメイキングの状態を保持するトークン | |||
| timeOffsetToken | string | ~ 1024文字 | タイムオフセットトークン |
Result
| 型 | 説明 | |
|---|---|---|
| item | SeasonGathering | 参加したシーズンギャザリング |
| matchmakingContextToken | string | マッチメイキングの状態を保持するトークン |
実装例
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.DoSeasonMatchmakingByUserId(
&matchmaking.DoSeasonMatchmakingByUserIdRequest {
NamespaceName: pointy.String("namespace-0001"),
SeasonName: pointy.String("season-0001"),
UserId: pointy.String("user-0001"),
MatchmakingContextToken: nil,
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
matchmakingContextToken := result.MatchmakingContextTokenuse 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\DoSeasonMatchmakingByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2MatchmakingRestClient(
$session
);
try {
$result = $client->doSeasonMatchmakingByUserId(
(new DoSeasonMatchmakingByUserIdRequest())
->withNamespaceName("namespace-0001")
->withSeasonName("season-0001")
->withUserId("user-0001")
->withMatchmakingContextToken(null)
->withTimeOffsetToken(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.DoSeasonMatchmakingByUserIdRequest;
import io.gs2.matchmaking.result.DoSeasonMatchmakingByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);
try {
DoSeasonMatchmakingByUserIdResult result = client.doSeasonMatchmakingByUserId(
new DoSeasonMatchmakingByUserIdRequest()
.withNamespaceName("namespace-0001")
.withSeasonName("season-0001")
.withUserId("user-0001")
.withMatchmakingContextToken(null)
.withTimeOffsetToken(null)
);
SeasonGathering item = result.getItem();
String matchmakingContextToken = result.getMatchmakingContextToken();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);
AsyncResult<Gs2.Gs2Matchmaking.Result.DoSeasonMatchmakingByUserIdResult> asyncResult = null;
yield return client.DoSeasonMatchmakingByUserId(
new Gs2.Gs2Matchmaking.Request.DoSeasonMatchmakingByUserIdRequest()
.WithNamespaceName("namespace-0001")
.WithSeasonName("season-0001")
.WithUserId("user-0001")
.WithMatchmakingContextToken(null)
.WithTimeOffsetToken(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.doSeasonMatchmakingByUserId(
new Gs2Matchmaking.DoSeasonMatchmakingByUserIdRequest()
.withNamespaceName("namespace-0001")
.withSeasonName("season-0001")
.withUserId("user-0001")
.withMatchmakingContextToken(null)
.withTimeOffsetToken(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_season_matchmaking_by_user_id(
matchmaking.DoSeasonMatchmakingByUserIdRequest()
.with_namespace_name('namespace-0001')
.with_season_name('season-0001')
.with_user_id('user-0001')
.with_matchmaking_context_token(None)
.with_time_offset_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_season_matchmaking_by_user_id({
namespaceName="namespace-0001",
seasonName="season-0001",
userId="user-0001",
matchmakingContextToken=nil,
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;
matchmakingContextToken = result.matchmakingContextToken;client = gs2('matchmaking')
api_result_handler = client.do_season_matchmaking_by_user_id_async({
namespaceName="namespace-0001",
seasonName="season-0001",
userId="user-0001",
matchmakingContextToken=nil,
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;
matchmakingContextToken = result.matchmakingContextToken;getSeasonGathering
シーズンギャザリングを取得
指定されたシーズンギャザリングの参加者とティアー情報を含む詳細を取得します。
詳細
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 | ||
| seasonName | string | ✓ | ~ 128文字 | シーズンモデル名 シーズンモデル固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 | ||
| season | long | 0 ~ 9223372036854775805 | シーズン | |||
| tier | long | ✓ | 0 ~ 9223372036854775805 | ティアー 同程度のランクのプレイヤーをグルーピングするためのティアーレベル。 SeasonModel で指定された GS2-Experience モデルにおけるプレイヤーのランクによって決定されます。 プレイヤーは同じティアーのプレイヤーとのみマッチングされ、公平な対戦が保証されます。 | ||
| seasonGatheringName | string | ✓ | UUID | ~ 128文字 | シーズンギャザリング名 シーズンギャザリング固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
Result
| 型 | 説明 | |
|---|---|---|
| item | SeasonGathering | シーズンギャザリング |
実装例
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.GetSeasonGathering(
&matchmaking.GetSeasonGatheringRequest {
NamespaceName: pointy.String("namespace-0001"),
SeasonName: pointy.String("season-0001"),
Season: pointy.Int64(0),
Tier: pointy.Int64(0),
SeasonGatheringName: pointy.String("gathering-0001"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse 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\GetSeasonGatheringRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2MatchmakingRestClient(
$session
);
try {
$result = $client->getSeasonGathering(
(new GetSeasonGatheringRequest())
->withNamespaceName("namespace-0001")
->withSeasonName("season-0001")
->withSeason(0)
->withTier(0)
->withSeasonGatheringName("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.GetSeasonGatheringRequest;
import io.gs2.matchmaking.result.GetSeasonGatheringResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);
try {
GetSeasonGatheringResult result = client.getSeasonGathering(
new GetSeasonGatheringRequest()
.withNamespaceName("namespace-0001")
.withSeasonName("season-0001")
.withSeason(0L)
.withTier(0L)
.withSeasonGatheringName("gathering-0001")
);
SeasonGathering item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);
AsyncResult<Gs2.Gs2Matchmaking.Result.GetSeasonGatheringResult> asyncResult = null;
yield return client.GetSeasonGathering(
new Gs2.Gs2Matchmaking.Request.GetSeasonGatheringRequest()
.WithNamespaceName("namespace-0001")
.WithSeasonName("season-0001")
.WithSeason(0L)
.WithTier(0L)
.WithSeasonGatheringName("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.getSeasonGathering(
new Gs2Matchmaking.GetSeasonGatheringRequest()
.withNamespaceName("namespace-0001")
.withSeasonName("season-0001")
.withSeason(0)
.withTier(0)
.withSeasonGatheringName("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.get_season_gathering(
matchmaking.GetSeasonGatheringRequest()
.with_namespace_name('namespace-0001')
.with_season_name('season-0001')
.with_season(0)
.with_tier(0)
.with_season_gathering_name('gathering-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('matchmaking')
api_result = client.get_season_gathering({
namespaceName="namespace-0001",
seasonName="season-0001",
season=0,
tier=0,
seasonGatheringName="gathering-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('matchmaking')
api_result_handler = client.get_season_gathering_async({
namespaceName="namespace-0001",
seasonName="season-0001",
season=0,
tier=0,
seasonGatheringName="gathering-0001",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;verifyIncludeParticipant
永続ギャザリングにユーザーIDが含まれているかを検証
指定されたシーズンギャザリングにユーザーが参加しているかどうかを検証します。
検証タイプは ‘include’(ユーザーが参加者であることを確認)または ’notInclude’(ユーザーが参加者でないことを確認)を指定できます。
検証条件が満たされない場合はエラーが返されます。
詳細
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 | ||||||||
| seasonName | string | ✓ | ~ 128文字 | シーズンモデル名 シーズンモデル固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 | ||||||||
| season | long | ✓ | 0 ~ 9223372036854775805 | シーズン | ||||||||
| tier | long | ✓ | 0 ~ 9223372036854775805 | ティアー 同程度のランクのプレイヤーをグルーピングするためのティアーレベル。 SeasonModel で指定された GS2-Experience モデルにおけるプレイヤーのランクによって決定されます。 プレイヤーは同じティアーのプレイヤーとのみマッチングされ、公平な対戦が保証されます。 | ||||||||
| seasonGatheringName | string | ✓ | UUID | ~ 128文字 | シーズンギャザリング名 シーズンギャザリング固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 | |||||||
| accessToken | string | ✓ | ~ 128文字 | アクセストークン | ||||||||
| verifyType | 文字列列挙型 enum { “include”, “notInclude” } | ✓ | 検証の種類
|
Result
| 型 | 説明 | |
|---|---|---|
| item | SeasonGathering | シーズンギャザリング |
実装例
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.VerifyIncludeParticipant(
&matchmaking.VerifyIncludeParticipantRequest {
NamespaceName: pointy.String("namespace-0001"),
SeasonName: pointy.String("season-0001"),
Season: pointy.Int64(0),
Tier: pointy.Int64(0),
SeasonGatheringName: pointy.String("gathering-0001"),
AccessToken: pointy.String("accessToken-0001"),
VerifyType: pointy.String("include"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse 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\VerifyIncludeParticipantRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2MatchmakingRestClient(
$session
);
try {
$result = $client->verifyIncludeParticipant(
(new VerifyIncludeParticipantRequest())
->withNamespaceName("namespace-0001")
->withSeasonName("season-0001")
->withSeason(0)
->withTier(0)
->withSeasonGatheringName("gathering-0001")
->withAccessToken("accessToken-0001")
->withVerifyType("include")
);
$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.VerifyIncludeParticipantRequest;
import io.gs2.matchmaking.result.VerifyIncludeParticipantResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);
try {
VerifyIncludeParticipantResult result = client.verifyIncludeParticipant(
new VerifyIncludeParticipantRequest()
.withNamespaceName("namespace-0001")
.withSeasonName("season-0001")
.withSeason(0L)
.withTier(0L)
.withSeasonGatheringName("gathering-0001")
.withAccessToken("accessToken-0001")
.withVerifyType("include")
);
SeasonGathering item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);
AsyncResult<Gs2.Gs2Matchmaking.Result.VerifyIncludeParticipantResult> asyncResult = null;
yield return client.VerifyIncludeParticipant(
new Gs2.Gs2Matchmaking.Request.VerifyIncludeParticipantRequest()
.WithNamespaceName("namespace-0001")
.WithSeasonName("season-0001")
.WithSeason(0L)
.WithTier(0L)
.WithSeasonGatheringName("gathering-0001")
.WithAccessToken("accessToken-0001")
.WithVerifyType("include"),
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.verifyIncludeParticipant(
new Gs2Matchmaking.VerifyIncludeParticipantRequest()
.withNamespaceName("namespace-0001")
.withSeasonName("season-0001")
.withSeason(0)
.withTier(0)
.withSeasonGatheringName("gathering-0001")
.withAccessToken("accessToken-0001")
.withVerifyType("include")
);
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.verify_include_participant(
matchmaking.VerifyIncludeParticipantRequest()
.with_namespace_name('namespace-0001')
.with_season_name('season-0001')
.with_season(0)
.with_tier(0)
.with_season_gathering_name('gathering-0001')
.with_access_token('accessToken-0001')
.with_verify_type('include')
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('matchmaking')
api_result = client.verify_include_participant({
namespaceName="namespace-0001",
seasonName="season-0001",
season=0,
tier=0,
seasonGatheringName="gathering-0001",
accessToken="accessToken-0001",
verifyType="include",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('matchmaking')
api_result_handler = client.verify_include_participant_async({
namespaceName="namespace-0001",
seasonName="season-0001",
season=0,
tier=0,
seasonGatheringName="gathering-0001",
accessToken="accessToken-0001",
verifyType="include",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;verifyIncludeParticipantByUserId
ユーザーIDを指定して永続ギャザリングにユーザーIDが含まれているかを検証
指定されたユーザーがシーズンギャザリングに参加しているかどうかを検証します。
詳細
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 | ||||||||
| seasonName | string | ✓ | ~ 128文字 | シーズンモデル名 シーズンモデル固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 | ||||||||
| season | long | ✓ | 0 ~ 9223372036854775805 | シーズン | ||||||||
| tier | long | ✓ | 0 ~ 9223372036854775805 | ティアー 同程度のランクのプレイヤーをグルーピングするためのティアーレベル。 SeasonModel で指定された GS2-Experience モデルにおけるプレイヤーのランクによって決定されます。 プレイヤーは同じティアーのプレイヤーとのみマッチングされ、公平な対戦が保証されます。 | ||||||||
| seasonGatheringName | string | ✓ | UUID | ~ 128文字 | シーズンギャザリング名 シーズンギャザリング固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 | |||||||
| userId | string | ✓ | ~ 128文字 | ユーザーID | ||||||||
| verifyType | 文字列列挙型 enum { “include”, “notInclude” } | ✓ | 検証の種類
| |||||||||
| timeOffsetToken | string | ~ 1024文字 | タイムオフセットトークン |
Result
| 型 | 説明 | |
|---|---|---|
| item | SeasonGathering | シーズンギャザリング |
実装例
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.VerifyIncludeParticipantByUserId(
&matchmaking.VerifyIncludeParticipantByUserIdRequest {
NamespaceName: pointy.String("namespace-0001"),
SeasonName: pointy.String("season-0001"),
Season: pointy.Int64(0),
Tier: pointy.Int64(0),
SeasonGatheringName: pointy.String("gathering-0001"),
UserId: pointy.String("user-0001"),
VerifyType: pointy.String("include"),
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse 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\VerifyIncludeParticipantByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2MatchmakingRestClient(
$session
);
try {
$result = $client->verifyIncludeParticipantByUserId(
(new VerifyIncludeParticipantByUserIdRequest())
->withNamespaceName("namespace-0001")
->withSeasonName("season-0001")
->withSeason(0)
->withTier(0)
->withSeasonGatheringName("gathering-0001")
->withUserId("user-0001")
->withVerifyType("include")
->withTimeOffsetToken(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.VerifyIncludeParticipantByUserIdRequest;
import io.gs2.matchmaking.result.VerifyIncludeParticipantByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);
try {
VerifyIncludeParticipantByUserIdResult result = client.verifyIncludeParticipantByUserId(
new VerifyIncludeParticipantByUserIdRequest()
.withNamespaceName("namespace-0001")
.withSeasonName("season-0001")
.withSeason(0L)
.withTier(0L)
.withSeasonGatheringName("gathering-0001")
.withUserId("user-0001")
.withVerifyType("include")
.withTimeOffsetToken(null)
);
SeasonGathering item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);
AsyncResult<Gs2.Gs2Matchmaking.Result.VerifyIncludeParticipantByUserIdResult> asyncResult = null;
yield return client.VerifyIncludeParticipantByUserId(
new Gs2.Gs2Matchmaking.Request.VerifyIncludeParticipantByUserIdRequest()
.WithNamespaceName("namespace-0001")
.WithSeasonName("season-0001")
.WithSeason(0L)
.WithTier(0L)
.WithSeasonGatheringName("gathering-0001")
.WithUserId("user-0001")
.WithVerifyType("include")
.WithTimeOffsetToken(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.verifyIncludeParticipantByUserId(
new Gs2Matchmaking.VerifyIncludeParticipantByUserIdRequest()
.withNamespaceName("namespace-0001")
.withSeasonName("season-0001")
.withSeason(0)
.withTier(0)
.withSeasonGatheringName("gathering-0001")
.withUserId("user-0001")
.withVerifyType("include")
.withTimeOffsetToken(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.verify_include_participant_by_user_id(
matchmaking.VerifyIncludeParticipantByUserIdRequest()
.with_namespace_name('namespace-0001')
.with_season_name('season-0001')
.with_season(0)
.with_tier(0)
.with_season_gathering_name('gathering-0001')
.with_user_id('user-0001')
.with_verify_type('include')
.with_time_offset_token(None)
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('matchmaking')
api_result = client.verify_include_participant_by_user_id({
namespaceName="namespace-0001",
seasonName="season-0001",
season=0,
tier=0,
seasonGatheringName="gathering-0001",
userId="user-0001",
verifyType="include",
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('matchmaking')
api_result_handler = client.verify_include_participant_by_user_id_async({
namespaceName="namespace-0001",
seasonName="season-0001",
season=0,
tier=0,
seasonGatheringName="gathering-0001",
userId="user-0001",
verifyType="include",
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;deleteSeasonGathering
シーズンギャザリングを削除
指定されたシーズンギャザリングおよび関連するすべての参加者レコードを削除します。
詳細
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 | ||
| seasonName | string | ✓ | ~ 128文字 | シーズンモデル名 シーズンモデル固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 | ||
| season | long | ✓ | 0 ~ 9223372036854775805 | シーズン | ||
| tier | long | ✓ | 0 ~ 9223372036854775805 | ティアー 同程度のランクのプレイヤーをグルーピングするためのティアーレベル。 SeasonModel で指定された GS2-Experience モデルにおけるプレイヤーのランクによって決定されます。 プレイヤーは同じティアーのプレイヤーとのみマッチングされ、公平な対戦が保証されます。 | ||
| seasonGatheringName | string | ✓ | UUID | ~ 128文字 | シーズンギャザリング名 シーズンギャザリング固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
Result
| 型 | 説明 | |
|---|---|---|
| item | SeasonGathering | 削除したシーズンギャザリング |
実装例
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.DeleteSeasonGathering(
&matchmaking.DeleteSeasonGatheringRequest {
NamespaceName: pointy.String("namespace-0001"),
SeasonName: pointy.String("season-0001"),
Season: pointy.Int64(0),
Tier: pointy.Int64(0),
SeasonGatheringName: pointy.String("gathering-0001"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse 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\DeleteSeasonGatheringRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2MatchmakingRestClient(
$session
);
try {
$result = $client->deleteSeasonGathering(
(new DeleteSeasonGatheringRequest())
->withNamespaceName("namespace-0001")
->withSeasonName("season-0001")
->withSeason(0)
->withTier(0)
->withSeasonGatheringName("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.DeleteSeasonGatheringRequest;
import io.gs2.matchmaking.result.DeleteSeasonGatheringResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);
try {
DeleteSeasonGatheringResult result = client.deleteSeasonGathering(
new DeleteSeasonGatheringRequest()
.withNamespaceName("namespace-0001")
.withSeasonName("season-0001")
.withSeason(0L)
.withTier(0L)
.withSeasonGatheringName("gathering-0001")
);
SeasonGathering item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);
AsyncResult<Gs2.Gs2Matchmaking.Result.DeleteSeasonGatheringResult> asyncResult = null;
yield return client.DeleteSeasonGathering(
new Gs2.Gs2Matchmaking.Request.DeleteSeasonGatheringRequest()
.WithNamespaceName("namespace-0001")
.WithSeasonName("season-0001")
.WithSeason(0L)
.WithTier(0L)
.WithSeasonGatheringName("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.deleteSeasonGathering(
new Gs2Matchmaking.DeleteSeasonGatheringRequest()
.withNamespaceName("namespace-0001")
.withSeasonName("season-0001")
.withSeason(0)
.withTier(0)
.withSeasonGatheringName("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_season_gathering(
matchmaking.DeleteSeasonGatheringRequest()
.with_namespace_name('namespace-0001')
.with_season_name('season-0001')
.with_season(0)
.with_tier(0)
.with_season_gathering_name('gathering-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('matchmaking')
api_result = client.delete_season_gathering({
namespaceName="namespace-0001",
seasonName="season-0001",
season=0,
tier=0,
seasonGatheringName="gathering-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('matchmaking')
api_result_handler = client.delete_season_gathering_async({
namespaceName="namespace-0001",
seasonName="season-0001",
season=0,
tier=0,
seasonGatheringName="gathering-0001",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;describeJoinedSeasonGatherings
参加済みシーズンギャザリングの一覧を取得
リクエストしたユーザーが参加したシーズンギャザリングのページネーション付きリストを取得します。
シーズン名でフィルタリングできます。プレイヤーが所属するシーズンマッチメイキンググループを確認できます。
詳細
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 | ||
| accessToken | string | ✓ | ~ 128文字 | アクセストークン | ||
| seasonName | string | ~ 128文字 | シーズンモデル名 シーズンモデル固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 | |||
| pageToken | string | ~ 1024文字 | データの取得を開始する位置を指定するトークン | |||
| limit | int | 30 | 1 ~ 1000 | データの取得件数 |
Result
| 型 | 説明 | |
|---|---|---|
| items | List<JoinedSeasonGathering> | シーズンギャザリングのリスト |
| nextPageToken | string | リストの続きを取得するためのページトークン |
実装例
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.DescribeJoinedSeasonGatherings(
&matchmaking.DescribeJoinedSeasonGatheringsRequest {
NamespaceName: pointy.String("namespace-0001"),
AccessToken: pointy.String("accessToken-0001"),
SeasonName: pointy.String("season-0001"),
PageToken: nil,
Limit: nil,
}
)
if err != nil {
panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageTokenuse 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\DescribeJoinedSeasonGatheringsRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2MatchmakingRestClient(
$session
);
try {
$result = $client->describeJoinedSeasonGatherings(
(new DescribeJoinedSeasonGatheringsRequest())
->withNamespaceName("namespace-0001")
->withAccessToken("accessToken-0001")
->withSeasonName("season-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.DescribeJoinedSeasonGatheringsRequest;
import io.gs2.matchmaking.result.DescribeJoinedSeasonGatheringsResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);
try {
DescribeJoinedSeasonGatheringsResult result = client.describeJoinedSeasonGatherings(
new DescribeJoinedSeasonGatheringsRequest()
.withNamespaceName("namespace-0001")
.withAccessToken("accessToken-0001")
.withSeasonName("season-0001")
.withPageToken(null)
.withLimit(null)
);
List<JoinedSeasonGathering> items = result.getItems();
String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);
AsyncResult<Gs2.Gs2Matchmaking.Result.DescribeJoinedSeasonGatheringsResult> asyncResult = null;
yield return client.DescribeJoinedSeasonGatherings(
new Gs2.Gs2Matchmaking.Request.DescribeJoinedSeasonGatheringsRequest()
.WithNamespaceName("namespace-0001")
.WithAccessToken("accessToken-0001")
.WithSeasonName("season-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.describeJoinedSeasonGatherings(
new Gs2Matchmaking.DescribeJoinedSeasonGatheringsRequest()
.withNamespaceName("namespace-0001")
.withAccessToken("accessToken-0001")
.withSeasonName("season-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_joined_season_gatherings(
matchmaking.DescribeJoinedSeasonGatheringsRequest()
.with_namespace_name('namespace-0001')
.with_access_token('accessToken-0001')
.with_season_name('season-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_joined_season_gatherings({
namespaceName="namespace-0001",
accessToken="accessToken-0001",
seasonName="season-0001",
pageToken=nil,
limit=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;client = gs2('matchmaking')
api_result_handler = client.describe_joined_season_gatherings_async({
namespaceName="namespace-0001",
accessToken="accessToken-0001",
seasonName="season-0001",
pageToken=nil,
limit=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;describeJoinedSeasonGatheringsByUserId
ユーザーIDを指定して参加済みシーズンギャザリングの一覧を取得
指定されたユーザーが参加したシーズンギャザリングのページネーション付きリストを取得します。
詳細
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 | ||
| userId | string | ✓ | ~ 128文字 | ユーザーID | ||
| seasonName | string | ~ 128文字 | シーズンモデル名 シーズンモデル固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 | |||
| pageToken | string | ~ 1024文字 | データの取得を開始する位置を指定するトークン | |||
| limit | int | 30 | 1 ~ 1000 | データの取得件数 | ||
| timeOffsetToken | string | ~ 1024文字 | タイムオフセットトークン |
Result
| 型 | 説明 | |
|---|---|---|
| items | List<JoinedSeasonGathering> | シーズンギャザリングのリスト |
| nextPageToken | string | リストの続きを取得するためのページトークン |
実装例
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.DescribeJoinedSeasonGatheringsByUserId(
&matchmaking.DescribeJoinedSeasonGatheringsByUserIdRequest {
NamespaceName: pointy.String("namespace-0001"),
UserId: pointy.String("user-0001"),
SeasonName: pointy.String("season-0001"),
PageToken: nil,
Limit: nil,
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageTokenuse 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\DescribeJoinedSeasonGatheringsByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2MatchmakingRestClient(
$session
);
try {
$result = $client->describeJoinedSeasonGatheringsByUserId(
(new DescribeJoinedSeasonGatheringsByUserIdRequest())
->withNamespaceName("namespace-0001")
->withUserId("user-0001")
->withSeasonName("season-0001")
->withPageToken(null)
->withLimit(null)
->withTimeOffsetToken(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.DescribeJoinedSeasonGatheringsByUserIdRequest;
import io.gs2.matchmaking.result.DescribeJoinedSeasonGatheringsByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);
try {
DescribeJoinedSeasonGatheringsByUserIdResult result = client.describeJoinedSeasonGatheringsByUserId(
new DescribeJoinedSeasonGatheringsByUserIdRequest()
.withNamespaceName("namespace-0001")
.withUserId("user-0001")
.withSeasonName("season-0001")
.withPageToken(null)
.withLimit(null)
.withTimeOffsetToken(null)
);
List<JoinedSeasonGathering> items = result.getItems();
String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);
AsyncResult<Gs2.Gs2Matchmaking.Result.DescribeJoinedSeasonGatheringsByUserIdResult> asyncResult = null;
yield return client.DescribeJoinedSeasonGatheringsByUserId(
new Gs2.Gs2Matchmaking.Request.DescribeJoinedSeasonGatheringsByUserIdRequest()
.WithNamespaceName("namespace-0001")
.WithUserId("user-0001")
.WithSeasonName("season-0001")
.WithPageToken(null)
.WithLimit(null)
.WithTimeOffsetToken(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.describeJoinedSeasonGatheringsByUserId(
new Gs2Matchmaking.DescribeJoinedSeasonGatheringsByUserIdRequest()
.withNamespaceName("namespace-0001")
.withUserId("user-0001")
.withSeasonName("season-0001")
.withPageToken(null)
.withLimit(null)
.withTimeOffsetToken(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_joined_season_gatherings_by_user_id(
matchmaking.DescribeJoinedSeasonGatheringsByUserIdRequest()
.with_namespace_name('namespace-0001')
.with_user_id('user-0001')
.with_season_name('season-0001')
.with_page_token(None)
.with_limit(None)
.with_time_offset_token(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_joined_season_gatherings_by_user_id({
namespaceName="namespace-0001",
userId="user-0001",
seasonName="season-0001",
pageToken=nil,
limit=nil,
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;client = gs2('matchmaking')
api_result_handler = client.describe_joined_season_gatherings_by_user_id_async({
namespaceName="namespace-0001",
userId="user-0001",
seasonName="season-0001",
pageToken=nil,
limit=nil,
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;getJoinedSeasonGathering
参加済みシーズンギャザリングを取得
指定されたシーズンでリクエストしたユーザーが参加したシーズンギャザリングを取得します。
対象のギャザリングが既に存在しない場合、参加レコードは自動的にクリーンアップされます。
詳細
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 | ||
| accessToken | string | ✓ | ~ 128文字 | アクセストークン | ||
| seasonName | string | ✓ | ~ 128文字 | シーズンモデル名 シーズンモデル固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 | ||
| season | long | 0 ~ 9223372036854775805 | シーズン |
Result
| 型 | 説明 | |
|---|---|---|
| item | JoinedSeasonGathering | シーズンギャザリング |
実装例
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.GetJoinedSeasonGathering(
&matchmaking.GetJoinedSeasonGatheringRequest {
NamespaceName: pointy.String("namespace-0001"),
AccessToken: pointy.String("accessToken-0001"),
SeasonName: pointy.String("season-0001"),
Season: pointy.Int64(0),
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse 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\GetJoinedSeasonGatheringRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2MatchmakingRestClient(
$session
);
try {
$result = $client->getJoinedSeasonGathering(
(new GetJoinedSeasonGatheringRequest())
->withNamespaceName("namespace-0001")
->withAccessToken("accessToken-0001")
->withSeasonName("season-0001")
->withSeason(0)
);
$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.GetJoinedSeasonGatheringRequest;
import io.gs2.matchmaking.result.GetJoinedSeasonGatheringResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);
try {
GetJoinedSeasonGatheringResult result = client.getJoinedSeasonGathering(
new GetJoinedSeasonGatheringRequest()
.withNamespaceName("namespace-0001")
.withAccessToken("accessToken-0001")
.withSeasonName("season-0001")
.withSeason(0L)
);
JoinedSeasonGathering item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);
AsyncResult<Gs2.Gs2Matchmaking.Result.GetJoinedSeasonGatheringResult> asyncResult = null;
yield return client.GetJoinedSeasonGathering(
new Gs2.Gs2Matchmaking.Request.GetJoinedSeasonGatheringRequest()
.WithNamespaceName("namespace-0001")
.WithAccessToken("accessToken-0001")
.WithSeasonName("season-0001")
.WithSeason(0L),
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.getJoinedSeasonGathering(
new Gs2Matchmaking.GetJoinedSeasonGatheringRequest()
.withNamespaceName("namespace-0001")
.withAccessToken("accessToken-0001")
.withSeasonName("season-0001")
.withSeason(0)
);
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_joined_season_gathering(
matchmaking.GetJoinedSeasonGatheringRequest()
.with_namespace_name('namespace-0001')
.with_access_token('accessToken-0001')
.with_season_name('season-0001')
.with_season(0)
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('matchmaking')
api_result = client.get_joined_season_gathering({
namespaceName="namespace-0001",
accessToken="accessToken-0001",
seasonName="season-0001",
season=0,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('matchmaking')
api_result_handler = client.get_joined_season_gathering_async({
namespaceName="namespace-0001",
accessToken="accessToken-0001",
seasonName="season-0001",
season=0,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;getJoinedSeasonGatheringByUserId
ユーザーIDを指定して参加済みシーズンギャザリングを取得
指定されたユーザーが指定シーズンで参加したシーズンギャザリングを取得します。
詳細
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 | ||
| userId | string | ✓ | ~ 128文字 | ユーザーID | ||
| seasonName | string | ✓ | ~ 128文字 | シーズンモデル名 シーズンモデル固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 | ||
| season | long | 0 ~ 9223372036854775805 | シーズン | |||
| timeOffsetToken | string | ~ 1024文字 | タイムオフセットトークン |
Result
| 型 | 説明 | |
|---|---|---|
| item | JoinedSeasonGathering | シーズンギャザリング |
実装例
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.GetJoinedSeasonGatheringByUserId(
&matchmaking.GetJoinedSeasonGatheringByUserIdRequest {
NamespaceName: pointy.String("namespace-0001"),
UserId: pointy.String("user-0001"),
SeasonName: pointy.String("season-0001"),
Season: pointy.Int64(0),
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse 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\GetJoinedSeasonGatheringByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2MatchmakingRestClient(
$session
);
try {
$result = $client->getJoinedSeasonGatheringByUserId(
(new GetJoinedSeasonGatheringByUserIdRequest())
->withNamespaceName("namespace-0001")
->withUserId("user-0001")
->withSeasonName("season-0001")
->withSeason(0)
->withTimeOffsetToken(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.GetJoinedSeasonGatheringByUserIdRequest;
import io.gs2.matchmaking.result.GetJoinedSeasonGatheringByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);
try {
GetJoinedSeasonGatheringByUserIdResult result = client.getJoinedSeasonGatheringByUserId(
new GetJoinedSeasonGatheringByUserIdRequest()
.withNamespaceName("namespace-0001")
.withUserId("user-0001")
.withSeasonName("season-0001")
.withSeason(0L)
.withTimeOffsetToken(null)
);
JoinedSeasonGathering item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);
AsyncResult<Gs2.Gs2Matchmaking.Result.GetJoinedSeasonGatheringByUserIdResult> asyncResult = null;
yield return client.GetJoinedSeasonGatheringByUserId(
new Gs2.Gs2Matchmaking.Request.GetJoinedSeasonGatheringByUserIdRequest()
.WithNamespaceName("namespace-0001")
.WithUserId("user-0001")
.WithSeasonName("season-0001")
.WithSeason(0L)
.WithTimeOffsetToken(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.getJoinedSeasonGatheringByUserId(
new Gs2Matchmaking.GetJoinedSeasonGatheringByUserIdRequest()
.withNamespaceName("namespace-0001")
.withUserId("user-0001")
.withSeasonName("season-0001")
.withSeason(0)
.withTimeOffsetToken(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.get_joined_season_gathering_by_user_id(
matchmaking.GetJoinedSeasonGatheringByUserIdRequest()
.with_namespace_name('namespace-0001')
.with_user_id('user-0001')
.with_season_name('season-0001')
.with_season(0)
.with_time_offset_token(None)
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('matchmaking')
api_result = client.get_joined_season_gathering_by_user_id({
namespaceName="namespace-0001",
userId="user-0001",
seasonName="season-0001",
season=0,
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('matchmaking')
api_result_handler = client.get_joined_season_gathering_by_user_id_async({
namespaceName="namespace-0001",
userId="user-0001",
seasonName="season-0001",
season=0,
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;describeRatings
レーティングの一覧を取得
リクエストしたユーザーのすべてのレーティングエントリのページネーション付きリストを取得します。
各レーティングエントリには、Glicko-2 アルゴリズムに基づく現在のレーティング値とレーティング偏差(RD)が含まれます。
詳細
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 | ||
| accessToken | string | ✓ | ~ 128文字 | アクセストークン | ||
| pageToken | string | ~ 1024文字 | データの取得を開始する位置を指定するトークン | |||
| limit | int | 30 | 1 ~ 1000 | データの取得件数 |
Result
| 型 | 説明 | |
|---|---|---|
| items | List<Rating> | レーティングのリスト |
| nextPageToken | string | リストの続きを取得するためのページトークン |
実装例
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("namespace-0001"),
AccessToken: pointy.String("accessToken-0001"),
PageToken: nil,
Limit: nil,
}
)
if err != nil {
panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageTokenuse 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 Gs2MatchmakingRestClient(
$session
);
try {
$result = $client->describeRatings(
(new DescribeRatingsRequest())
->withNamespaceName("namespace-0001")
->withAccessToken("accessToken-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.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("namespace-0001")
.withAccessToken("accessToken-0001")
.withPageToken(null)
.withLimit(null)
);
List<Rating> items = result.getItems();
String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);
AsyncResult<Gs2.Gs2Matchmaking.Result.DescribeRatingsResult> asyncResult = null;
yield return client.DescribeRatings(
new Gs2.Gs2Matchmaking.Request.DescribeRatingsRequest()
.WithNamespaceName("namespace-0001")
.WithAccessToken("accessToken-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("namespace-0001")
.withAccessToken("accessToken-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('namespace-0001')
.with_access_token('accessToken-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="namespace-0001",
accessToken="accessToken-0001",
pageToken=nil,
limit=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;client = gs2('matchmaking')
api_result_handler = client.describe_ratings_async({
namespaceName="namespace-0001",
accessToken="accessToken-0001",
pageToken=nil,
limit=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;describeRatingsByUserId
ユーザーIDを指定してレーティングの一覧を取得
指定されたユーザーのすべてのレーティングエントリのページネーション付きリストを取得します。
詳細
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 | ||
| userId | string | ✓ | ~ 128文字 | ユーザーID | ||
| pageToken | string | ~ 1024文字 | データの取得を開始する位置を指定するトークン | |||
| limit | int | 30 | 1 ~ 1000 | データの取得件数 | ||
| timeOffsetToken | string | ~ 1024文字 | タイムオフセットトークン |
Result
| 型 | 説明 | |
|---|---|---|
| items | List<Rating> | レーティングのリスト |
| nextPageToken | string | リストの続きを取得するためのページトークン |
実装例
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("namespace-0001"),
UserId: pointy.String("user-0001"),
PageToken: nil,
Limit: nil,
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageTokenuse 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 Gs2MatchmakingRestClient(
$session
);
try {
$result = $client->describeRatingsByUserId(
(new DescribeRatingsByUserIdRequest())
->withNamespaceName("namespace-0001")
->withUserId("user-0001")
->withPageToken(null)
->withLimit(null)
->withTimeOffsetToken(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("namespace-0001")
.withUserId("user-0001")
.withPageToken(null)
.withLimit(null)
.withTimeOffsetToken(null)
);
List<Rating> items = result.getItems();
String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);
AsyncResult<Gs2.Gs2Matchmaking.Result.DescribeRatingsByUserIdResult> asyncResult = null;
yield return client.DescribeRatingsByUserId(
new Gs2.Gs2Matchmaking.Request.DescribeRatingsByUserIdRequest()
.WithNamespaceName("namespace-0001")
.WithUserId("user-0001")
.WithPageToken(null)
.WithLimit(null)
.WithTimeOffsetToken(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("namespace-0001")
.withUserId("user-0001")
.withPageToken(null)
.withLimit(null)
.withTimeOffsetToken(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('namespace-0001')
.with_user_id('user-0001')
.with_page_token(None)
.with_limit(None)
.with_time_offset_token(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="namespace-0001",
userId="user-0001",
pageToken=nil,
limit=nil,
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;client = gs2('matchmaking')
api_result_handler = client.describe_ratings_by_user_id_async({
namespaceName="namespace-0001",
userId="user-0001",
pageToken=nil,
limit=nil,
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;getRating
レーティングを取得
指定されたレーティングモデルの現在のレーティング値とレーティング偏差(RD)を取得します。
詳細
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 | ||
| accessToken | string | ✓ | ~ 128文字 | アクセストークン | ||
| ratingName | string | ✓ | ~ 128文字 | レーティング名 レーティング固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
Result
| 型 | 説明 | |
|---|---|---|
| item | Rating | レーティング |
実装例
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("namespace-0001"),
AccessToken: pointy.String("accessToken-0001"),
RatingName: pointy.String("rating-0001"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse 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 Gs2MatchmakingRestClient(
$session
);
try {
$result = $client->getRating(
(new GetRatingRequest())
->withNamespaceName("namespace-0001")
->withAccessToken("accessToken-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.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("namespace-0001")
.withAccessToken("accessToken-0001")
.withRatingName("rating-0001")
);
Rating item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);
AsyncResult<Gs2.Gs2Matchmaking.Result.GetRatingResult> asyncResult = null;
yield return client.GetRating(
new Gs2.Gs2Matchmaking.Request.GetRatingRequest()
.WithNamespaceName("namespace-0001")
.WithAccessToken("accessToken-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("namespace-0001")
.withAccessToken("accessToken-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('namespace-0001')
.with_access_token('accessToken-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="namespace-0001",
accessToken="accessToken-0001",
ratingName="rating-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('matchmaking')
api_result_handler = client.get_rating_async({
namespaceName="namespace-0001",
accessToken="accessToken-0001",
ratingName="rating-0001",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;getRatingByUserId
ユーザーIDを指定してレーティングを取得
指定されたユーザーとレーティングモデルの現在のレーティング値とレーティング偏差(RD)を取得します。
詳細
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 | ||
| userId | string | ✓ | ~ 128文字 | ユーザーID | ||
| ratingName | string | ✓ | ~ 128文字 | レーティング名 レーティング固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 | ||
| timeOffsetToken | string | ~ 1024文字 | タイムオフセットトークン |
Result
| 型 | 説明 | |
|---|---|---|
| item | Rating | レーティング |
実装例
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("namespace-0001"),
UserId: pointy.String("user-0001"),
RatingName: pointy.String("rating-0001"),
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse 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 Gs2MatchmakingRestClient(
$session
);
try {
$result = $client->getRatingByUserId(
(new GetRatingByUserIdRequest())
->withNamespaceName("namespace-0001")
->withUserId("user-0001")
->withRatingName("rating-0001")
->withTimeOffsetToken(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.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("namespace-0001")
.withUserId("user-0001")
.withRatingName("rating-0001")
.withTimeOffsetToken(null)
);
Rating item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);
AsyncResult<Gs2.Gs2Matchmaking.Result.GetRatingByUserIdResult> asyncResult = null;
yield return client.GetRatingByUserId(
new Gs2.Gs2Matchmaking.Request.GetRatingByUserIdRequest()
.WithNamespaceName("namespace-0001")
.WithUserId("user-0001")
.WithRatingName("rating-0001")
.WithTimeOffsetToken(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.getRatingByUserId(
new Gs2Matchmaking.GetRatingByUserIdRequest()
.withNamespaceName("namespace-0001")
.withUserId("user-0001")
.withRatingName("rating-0001")
.withTimeOffsetToken(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.get_rating_by_user_id(
matchmaking.GetRatingByUserIdRequest()
.with_namespace_name('namespace-0001')
.with_user_id('user-0001')
.with_rating_name('rating-0001')
.with_time_offset_token(None)
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('matchmaking')
api_result = client.get_rating_by_user_id({
namespaceName="namespace-0001",
userId="user-0001",
ratingName="rating-0001",
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('matchmaking')
api_result_handler = client.get_rating_by_user_id_async({
namespaceName="namespace-0001",
userId="user-0001",
ratingName="rating-0001",
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;putResult
レーティング値の再計算を実行
レーティングの計算処理には Glicko-2 rating system をベースとした計算アルゴリズムを採用しています。
レーティング値の初期値は1500で、レーティングの値が離れた相手に勝利するほど上昇幅は大きく、同じく負けた側は減少幅は大きくなります。
レーティングの計算には参加したユーザーIDのリストが必要となります。
そのため、クライアントから直接このAPIを呼び出すのは適切ではありません。ゲームの勝敗を判断できるゲームサーバから呼び出すようにしてください。
P2P 対戦など、クライアント主導で対戦を実現している場合は、投票機能を利用して勝敗を決定するようにしてください。
詳細
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 | ||
| ratingName | string | ✓ | ~ 128文字 | レーティング名 レーティング固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 | ||
| gameResults | List<GameResult> | 0 ~ 10 items | 対戦結果 |
Result
| 型 | 説明 | |
|---|---|---|
| items | List<Rating> | 更新後のレーティングの一覧 |
実装例
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("namespace-0001"),
RatingName: pointy.String("rating-0001"),
GameResults: []matchmaking.GameResult{
matchmaking.GameResult{
Rank: pointy.Int32(1),
UserId: pointy.String("user-0001"),
},
matchmaking.GameResult{
Rank: pointy.Int32(2),
UserId: pointy.String("user-0002"),
},
matchmaking.GameResult{
Rank: pointy.Int32(2),
UserId: pointy.String("user-0003"),
},
matchmaking.GameResult{
Rank: pointy.Int32(3),
UserId: pointy.String("user-0004"),
},
},
}
)
if err != nil {
panic("error occurred")
}
items := result.Itemsuse 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 Gs2MatchmakingRestClient(
$session
);
try {
$result = $client->putResult(
(new PutResultRequest())
->withNamespaceName("namespace-0001")
->withRatingName("rating-0001")
->withGameResults([
(new GameResult())
->withRank(1)
->withUserId("user-0001"),
(new GameResult())
->withRank(2)
->withUserId("user-0002"),
(new GameResult())
->withRank(2)
->withUserId("user-0003"),
(new GameResult())
->withRank(3)
->withUserId("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("namespace-0001")
.withRatingName("rating-0001")
.withGameResults(Arrays.asList(
new GameResult()
.withRank(1)
.withUserId("user-0001"),
new GameResult()
.withRank(2)
.withUserId("user-0002"),
new GameResult()
.withRank(2)
.withUserId("user-0003"),
new GameResult()
.withRank(3)
.withUserId("user-0004")
))
);
List<Rating> items = result.getItems();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);
AsyncResult<Gs2.Gs2Matchmaking.Result.PutResultResult> asyncResult = null;
yield return client.PutResult(
new Gs2.Gs2Matchmaking.Request.PutResultRequest()
.WithNamespaceName("namespace-0001")
.WithRatingName("rating-0001")
.WithGameResults(new Gs2.Gs2Matchmaking.Model.GameResult[] {
new Gs2.Gs2Matchmaking.Model.GameResult()
.WithRank(1)
.WithUserId("user-0001"),
new Gs2.Gs2Matchmaking.Model.GameResult()
.WithRank(2)
.WithUserId("user-0002"),
new Gs2.Gs2Matchmaking.Model.GameResult()
.WithRank(2)
.WithUserId("user-0003"),
new Gs2.Gs2Matchmaking.Model.GameResult()
.WithRank(3)
.WithUserId("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("namespace-0001")
.withRatingName("rating-0001")
.withGameResults([
new Gs2Matchmaking.model.GameResult()
.withRank(1)
.withUserId("user-0001"),
new Gs2Matchmaking.model.GameResult()
.withRank(2)
.withUserId("user-0002"),
new Gs2Matchmaking.model.GameResult()
.withRank(2)
.withUserId("user-0003"),
new Gs2Matchmaking.model.GameResult()
.withRank(3)
.withUserId("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('namespace-0001')
.with_rating_name('rating-0001')
.with_game_results([
matchmaking.GameResult()
.with_rank(1)
.with_user_id('user-0001'),
matchmaking.GameResult()
.with_rank(2)
.with_user_id('user-0002'),
matchmaking.GameResult()
.with_rank(2)
.with_user_id('user-0003'),
matchmaking.GameResult()
.with_rank(3)
.with_user_id('user-0004'),
])
)
items = result.items
except core.Gs2Exception as e:
exit(1)client = gs2('matchmaking')
api_result = client.put_result({
namespaceName="namespace-0001",
ratingName="rating-0001",
gameResults={
{
rank=1,
user_id="user-0001",
},
{
rank=2,
user_id="user-0002",
},
{
rank=2,
user_id="user-0003",
},
{
rank=3,
user_id="user-0004",
}
},
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;client = gs2('matchmaking')
api_result_handler = client.put_result_async({
namespaceName="namespace-0001",
ratingName="rating-0001",
gameResults={
{
rank=1,
user_id="user-0001",
},
{
rank=2,
user_id="user-0002",
},
{
rank=2,
user_id="user-0003",
},
{
rank=3,
user_id="user-0004",
}
},
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;deleteRating
レーティングを削除
指定されたユーザーのレーティングレコードを削除し、次回のレーティング計算時に初期値にリセットします。
詳細
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 | ||
| userId | string | ✓ | ~ 128文字 | ユーザーID | ||
| ratingName | string | ✓ | ~ 128文字 | レーティング名 レーティング固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 | ||
| timeOffsetToken | string | ~ 1024文字 | タイムオフセットトークン |
Result
| 型 | 説明 | |
|---|---|---|
| item | Rating | 削除されたレーティング |
実装例
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("namespace-0001"),
UserId: pointy.String("user-0001"),
RatingName: pointy.String("rating-0001"),
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse 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 Gs2MatchmakingRestClient(
$session
);
try {
$result = $client->deleteRating(
(new DeleteRatingRequest())
->withNamespaceName("namespace-0001")
->withUserId("user-0001")
->withRatingName("rating-0001")
->withTimeOffsetToken(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.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("namespace-0001")
.withUserId("user-0001")
.withRatingName("rating-0001")
.withTimeOffsetToken(null)
);
Rating item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);
AsyncResult<Gs2.Gs2Matchmaking.Result.DeleteRatingResult> asyncResult = null;
yield return client.DeleteRating(
new Gs2.Gs2Matchmaking.Request.DeleteRatingRequest()
.WithNamespaceName("namespace-0001")
.WithUserId("user-0001")
.WithRatingName("rating-0001")
.WithTimeOffsetToken(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.deleteRating(
new Gs2Matchmaking.DeleteRatingRequest()
.withNamespaceName("namespace-0001")
.withUserId("user-0001")
.withRatingName("rating-0001")
.withTimeOffsetToken(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.delete_rating(
matchmaking.DeleteRatingRequest()
.with_namespace_name('namespace-0001')
.with_user_id('user-0001')
.with_rating_name('rating-0001')
.with_time_offset_token(None)
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('matchmaking')
api_result = client.delete_rating({
namespaceName="namespace-0001",
userId="user-0001",
ratingName="rating-0001",
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('matchmaking')
api_result_handler = client.delete_rating_async({
namespaceName="namespace-0001",
userId="user-0001",
ratingName="rating-0001",
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;getBallot
署名と共に投票用紙を作成
投票プロセスで使用するための暗号署名付き投票用紙を生成します。
投票用紙にはレーティング名、ギャザリング名、ユーザーID、参加人数が含まれ、改ざん検出のために指定された GS2-Key で署名されます。
返されたボディと署名を Vote または VoteMultiple エンドポイントに送信してください。
詳細
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 | ||
| ratingName | string | ✓ | ~ 128文字 | レーティングモデル名 レーティングモデル固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 | ||
| gatheringName | string | ✓ | UUID | ~ 128文字 | ギャザリング名 ギャザリングの一意な名前を保持します。 名前は UUID(Universally Unique Identifier)フォーマットで自動的に生成され、ギャザリングを識別するために使用されます。 | |
| accessToken | string | ✓ | ~ 128文字 | アクセストークン | ||
| numberOfPlayer | int | ✓ | 2 ~ 10 | 参加人数 | ||
| keyId | string | “grn:gs2:{region}:{ownerId}:key:default:key:default” | ~ 1024文字 | 暗号鍵 GRN |
Result
| 型 | 説明 | |
|---|---|---|
| item | Ballot | 投票用紙 |
| body | string | 署名対象のデータ |
| signature | string | 署名データ |
実装例
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("namespace-0001"),
RatingName: pointy.String("rating-0001"),
GatheringName: pointy.String("gathering-0001"),
AccessToken: pointy.String("accessToken-0001"),
NumberOfPlayer: pointy.Int32(4),
KeyId: pointy.String("key-0001"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
body := result.Body
signature := result.Signatureuse 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 Gs2MatchmakingRestClient(
$session
);
try {
$result = $client->getBallot(
(new GetBallotRequest())
->withNamespaceName("namespace-0001")
->withRatingName("rating-0001")
->withGatheringName("gathering-0001")
->withAccessToken("accessToken-0001")
->withNumberOfPlayer(4)
->withKeyId("key-0001")
);
$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("namespace-0001")
.withRatingName("rating-0001")
.withGatheringName("gathering-0001")
.withAccessToken("accessToken-0001")
.withNumberOfPlayer(4)
.withKeyId("key-0001")
);
Ballot item = result.getItem();
String body = result.getBody();
String signature = result.getSignature();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);
AsyncResult<Gs2.Gs2Matchmaking.Result.GetBallotResult> asyncResult = null;
yield return client.GetBallot(
new Gs2.Gs2Matchmaking.Request.GetBallotRequest()
.WithNamespaceName("namespace-0001")
.WithRatingName("rating-0001")
.WithGatheringName("gathering-0001")
.WithAccessToken("accessToken-0001")
.WithNumberOfPlayer(4)
.WithKeyId("key-0001"),
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("namespace-0001")
.withRatingName("rating-0001")
.withGatheringName("gathering-0001")
.withAccessToken("accessToken-0001")
.withNumberOfPlayer(4)
.withKeyId("key-0001")
);
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('namespace-0001')
.with_rating_name('rating-0001')
.with_gathering_name('gathering-0001')
.with_access_token('accessToken-0001')
.with_number_of_player(4)
.with_key_id('key-0001')
)
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="namespace-0001",
ratingName="rating-0001",
gatheringName="gathering-0001",
accessToken="accessToken-0001",
numberOfPlayer=4,
keyId="key-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;
body = result.body;
signature = result.signature;client = gs2('matchmaking')
api_result_handler = client.get_ballot_async({
namespaceName="namespace-0001",
ratingName="rating-0001",
gatheringName="gathering-0001",
accessToken="accessToken-0001",
numberOfPlayer=4,
keyId="key-0001",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;
body = result.body;
signature = result.signature;getBallotByUserId
ユーザーIDを指定して署名と共に投票用紙を作成
指定されたユーザーの投票プロセスで使用するための暗号署名付き投票用紙を生成します。
詳細
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 | ||
| ratingName | string | ✓ | ~ 128文字 | レーティングモデル名 レーティングモデル固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 | ||
| gatheringName | string | ✓ | UUID | ~ 128文字 | ギャザリング名 ギャザリングの一意な名前を保持します。 名前は UUID(Universally Unique Identifier)フォーマットで自動的に生成され、ギャザリングを識別するために使用されます。 | |
| userId | string | ✓ | ~ 128文字 | ユーザーID | ||
| numberOfPlayer | int | ✓ | 2 ~ 10 | 参加人数 | ||
| keyId | string | “grn:gs2:{region}:{ownerId}:key:default:key:default” | ~ 1024文字 | 暗号鍵 GRN | ||
| timeOffsetToken | string | ~ 1024文字 | タイムオフセットトークン |
Result
| 型 | 説明 | |
|---|---|---|
| item | Ballot | 投票用紙 |
| body | string | 署名対象のデータ |
| signature | string | 署名データ |
実装例
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("namespace-0001"),
RatingName: pointy.String("rating-0001"),
GatheringName: pointy.String("gathering-0001"),
UserId: pointy.String("user-0001"),
NumberOfPlayer: pointy.Int32(4),
KeyId: pointy.String("key-0001"),
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
body := result.Body
signature := result.Signatureuse 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 Gs2MatchmakingRestClient(
$session
);
try {
$result = $client->getBallotByUserId(
(new GetBallotByUserIdRequest())
->withNamespaceName("namespace-0001")
->withRatingName("rating-0001")
->withGatheringName("gathering-0001")
->withUserId("user-0001")
->withNumberOfPlayer(4)
->withKeyId("key-0001")
->withTimeOffsetToken(null)
);
$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("namespace-0001")
.withRatingName("rating-0001")
.withGatheringName("gathering-0001")
.withUserId("user-0001")
.withNumberOfPlayer(4)
.withKeyId("key-0001")
.withTimeOffsetToken(null)
);
Ballot item = result.getItem();
String body = result.getBody();
String signature = result.getSignature();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);
AsyncResult<Gs2.Gs2Matchmaking.Result.GetBallotByUserIdResult> asyncResult = null;
yield return client.GetBallotByUserId(
new Gs2.Gs2Matchmaking.Request.GetBallotByUserIdRequest()
.WithNamespaceName("namespace-0001")
.WithRatingName("rating-0001")
.WithGatheringName("gathering-0001")
.WithUserId("user-0001")
.WithNumberOfPlayer(4)
.WithKeyId("key-0001")
.WithTimeOffsetToken(null),
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("namespace-0001")
.withRatingName("rating-0001")
.withGatheringName("gathering-0001")
.withUserId("user-0001")
.withNumberOfPlayer(4)
.withKeyId("key-0001")
.withTimeOffsetToken(null)
);
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('namespace-0001')
.with_rating_name('rating-0001')
.with_gathering_name('gathering-0001')
.with_user_id('user-0001')
.with_number_of_player(4)
.with_key_id('key-0001')
.with_time_offset_token(None)
)
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="namespace-0001",
ratingName="rating-0001",
gatheringName="gathering-0001",
userId="user-0001",
numberOfPlayer=4,
keyId="key-0001",
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;
body = result.body;
signature = result.signature;client = gs2('matchmaking')
api_result_handler = client.get_ballot_by_user_id_async({
namespaceName="namespace-0001",
ratingName="rating-0001",
gatheringName="gathering-0001",
userId="user-0001",
numberOfPlayer=4,
keyId="key-0001",
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;
body = result.body;
signature = result.signature;vote
対戦結果を投票
投票は最初の投票が行われてから5分以内に行う必要があります。
つまり、結果は即座に反映されず、投票開始からおよそ5分後または全てのプレイヤーが投票を行った際に結果が反映されます。
5分以内に全ての投票用紙を回収できなかった場合はその時点の投票内容で多数決をとって結果を決定します。
各結果の投票数が同一だった場合は結果は捨てられます(スクリプトで挙動を変更可)。
結果を即座に反映したい場合は、勝利した側の代表プレイヤーが投票用紙を各プレイヤーから集めて voteMultiple を呼び出すことで結果を即座に反映できます。
詳細
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 | ||
| ballotBody | string | ✓ | ~ 1024文字 | 投票用紙の署名対象のデータ | ||
| ballotSignature | string | ✓ | ~ 256文字 | 投票用紙の署名 | ||
| gameResults | List<GameResult> | 0 ~ 10 items | 投票内容。対戦を行ったプレイヤーグループ1に所属するユーザーIDのリスト | |||
| keyId | string | “grn:gs2:{region}:{ownerId}:key:default:key:default” | ~ 1024文字 | 暗号鍵 GRN |
Result
| 型 | 説明 | |
|---|---|---|
| item | Ballot | 投票用紙 |
実装例
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("namespace-0001"),
BallotBody: pointy.String("ballotBody..."),
BallotSignature: pointy.String("ballotSignature..."),
GameResults: []matchmaking.GameResult{
matchmaking.GameResult{
Rank: pointy.Int32(1),
UserId: pointy.String("user-0001"),
},
matchmaking.GameResult{
Rank: pointy.Int32(2),
UserId: pointy.String("user-0002"),
},
matchmaking.GameResult{
Rank: pointy.Int32(2),
UserId: pointy.String("user-0003"),
},
matchmaking.GameResult{
Rank: pointy.Int32(3),
UserId: pointy.String("user-0004"),
},
},
KeyId: pointy.String("key-0001"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\VoteRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2MatchmakingRestClient(
$session
);
try {
$result = $client->vote(
(new VoteRequest())
->withNamespaceName("namespace-0001")
->withBallotBody("ballotBody...")
->withBallotSignature("ballotSignature...")
->withGameResults([
(new GameResult())
->withRank(1)
->withUserId("user-0001"),
(new GameResult())
->withRank(2)
->withUserId("user-0002"),
(new GameResult())
->withRank(2)
->withUserId("user-0003"),
(new GameResult())
->withRank(3)
->withUserId("user-0004"),
])
->withKeyId("key-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.VoteRequest;
import io.gs2.matchmaking.result.VoteResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);
try {
VoteResult result = client.vote(
new VoteRequest()
.withNamespaceName("namespace-0001")
.withBallotBody("ballotBody...")
.withBallotSignature("ballotSignature...")
.withGameResults(Arrays.asList(
new GameResult()
.withRank(1)
.withUserId("user-0001"),
new GameResult()
.withRank(2)
.withUserId("user-0002"),
new GameResult()
.withRank(2)
.withUserId("user-0003"),
new GameResult()
.withRank(3)
.withUserId("user-0004")
))
.withKeyId("key-0001")
);
Ballot item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);
AsyncResult<Gs2.Gs2Matchmaking.Result.VoteResult> asyncResult = null;
yield return client.Vote(
new Gs2.Gs2Matchmaking.Request.VoteRequest()
.WithNamespaceName("namespace-0001")
.WithBallotBody("ballotBody...")
.WithBallotSignature("ballotSignature...")
.WithGameResults(new Gs2.Gs2Matchmaking.Model.GameResult[] {
new Gs2.Gs2Matchmaking.Model.GameResult()
.WithRank(1)
.WithUserId("user-0001"),
new Gs2.Gs2Matchmaking.Model.GameResult()
.WithRank(2)
.WithUserId("user-0002"),
new Gs2.Gs2Matchmaking.Model.GameResult()
.WithRank(2)
.WithUserId("user-0003"),
new Gs2.Gs2Matchmaking.Model.GameResult()
.WithRank(3)
.WithUserId("user-0004"),
})
.WithKeyId("key-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.vote(
new Gs2Matchmaking.VoteRequest()
.withNamespaceName("namespace-0001")
.withBallotBody("ballotBody...")
.withBallotSignature("ballotSignature...")
.withGameResults([
new Gs2Matchmaking.model.GameResult()
.withRank(1)
.withUserId("user-0001"),
new Gs2Matchmaking.model.GameResult()
.withRank(2)
.withUserId("user-0002"),
new Gs2Matchmaking.model.GameResult()
.withRank(2)
.withUserId("user-0003"),
new Gs2Matchmaking.model.GameResult()
.withRank(3)
.withUserId("user-0004"),
])
.withKeyId("key-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.vote(
matchmaking.VoteRequest()
.with_namespace_name('namespace-0001')
.with_ballot_body('ballotBody...')
.with_ballot_signature('ballotSignature...')
.with_game_results([
matchmaking.GameResult()
.with_rank(1)
.with_user_id('user-0001'),
matchmaking.GameResult()
.with_rank(2)
.with_user_id('user-0002'),
matchmaking.GameResult()
.with_rank(2)
.with_user_id('user-0003'),
matchmaking.GameResult()
.with_rank(3)
.with_user_id('user-0004'),
])
.with_key_id('key-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('matchmaking')
api_result = client.vote({
namespaceName="namespace-0001",
ballotBody="ballotBody...",
ballotSignature="ballotSignature...",
gameResults={
{
rank=1,
user_id="user-0001",
},
{
rank=2,
user_id="user-0002",
},
{
rank=2,
user_id="user-0003",
},
{
rank=3,
user_id="user-0004",
}
},
keyId="key-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('matchmaking')
api_result_handler = client.vote_async({
namespaceName="namespace-0001",
ballotBody="ballotBody...",
ballotSignature="ballotSignature...",
gameResults={
{
rank=1,
user_id="user-0001",
},
{
rank=2,
user_id="user-0002",
},
{
rank=2,
user_id="user-0003",
},
{
rank=3,
user_id="user-0004",
}
},
keyId="key-0001",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;voteMultiple
対戦結果をまとめて投票
ゲームに勝利した側が他プレイヤーの投票用紙を集めてまとめて投票するのに使用します。
『勝利した側』としているのは、敗北した側が自分たちが勝ったことにして報告することにインセンティブはありますが、その逆はないためです。
負けた側が投票用紙を渡してこない可能性がありますが、その場合も過半数の投票用紙があれば結果を通すことができます。
詳細
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 | ||
| signedBallots | List<SignedBallot> | 0 ~ 10 items | 署名付の投票用紙リスト | |||
| gameResults | List<GameResult> | 0 ~ 10 items | 投票内容。対戦を行ったプレイヤーグループ1に所属するユーザーIDのリスト | |||
| keyId | string | “grn:gs2:{region}:{ownerId}:key:default:key:default” | ~ 1024文字 | 暗号鍵 GRN |
Result
| 型 | 説明 | |
|---|---|---|
| item | Ballot | 投票用紙 |
実装例
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.VoteMultiple(
&matchmaking.VoteMultipleRequest {
NamespaceName: pointy.String("namespace-0001"),
SignedBallots: []matchmaking.SignedBallot{
matchmaking.SignedBallot{
Body: pointy.String("aaa"),
Signature: pointy.String("bbb"),
},
matchmaking.SignedBallot{
Body: pointy.String("aaa"),
Signature: pointy.String("bbb"),
},
matchmaking.SignedBallot{
Body: pointy.String("aaa"),
Signature: pointy.String("bbb"),
},
matchmaking.SignedBallot{
Body: pointy.String("aaa"),
Signature: pointy.String("bbb"),
},
},
GameResults: []matchmaking.GameResult{
matchmaking.GameResult{
Rank: pointy.Int32(1),
UserId: pointy.String("user-0001"),
},
matchmaking.GameResult{
Rank: pointy.Int32(2),
UserId: pointy.String("user-0002"),
},
matchmaking.GameResult{
Rank: pointy.Int32(2),
UserId: pointy.String("user-0003"),
},
matchmaking.GameResult{
Rank: pointy.Int32(3),
UserId: pointy.String("user-0004"),
},
},
KeyId: pointy.String("key-0001"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse 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\VoteMultipleRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2MatchmakingRestClient(
$session
);
try {
$result = $client->voteMultiple(
(new VoteMultipleRequest())
->withNamespaceName("namespace-0001")
->withSignedBallots([
(new SignedBallot())
->withBody("aaa")
->withSignature("bbb"),
(new SignedBallot())
->withBody("aaa")
->withSignature("bbb"),
(new SignedBallot())
->withBody("aaa")
->withSignature("bbb"),
(new SignedBallot())
->withBody("aaa")
->withSignature("bbb"),
])
->withGameResults([
(new GameResult())
->withRank(1)
->withUserId("user-0001"),
(new GameResult())
->withRank(2)
->withUserId("user-0002"),
(new GameResult())
->withRank(2)
->withUserId("user-0003"),
(new GameResult())
->withRank(3)
->withUserId("user-0004"),
])
->withKeyId("key-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.VoteMultipleRequest;
import io.gs2.matchmaking.result.VoteMultipleResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);
try {
VoteMultipleResult result = client.voteMultiple(
new VoteMultipleRequest()
.withNamespaceName("namespace-0001")
.withSignedBallots(Arrays.asList(
new SignedBallot()
.withBody("aaa")
.withSignature("bbb"),
new SignedBallot()
.withBody("aaa")
.withSignature("bbb"),
new SignedBallot()
.withBody("aaa")
.withSignature("bbb"),
new SignedBallot()
.withBody("aaa")
.withSignature("bbb")
))
.withGameResults(Arrays.asList(
new GameResult()
.withRank(1)
.withUserId("user-0001"),
new GameResult()
.withRank(2)
.withUserId("user-0002"),
new GameResult()
.withRank(2)
.withUserId("user-0003"),
new GameResult()
.withRank(3)
.withUserId("user-0004")
))
.withKeyId("key-0001")
);
Ballot item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);
AsyncResult<Gs2.Gs2Matchmaking.Result.VoteMultipleResult> asyncResult = null;
yield return client.VoteMultiple(
new Gs2.Gs2Matchmaking.Request.VoteMultipleRequest()
.WithNamespaceName("namespace-0001")
.WithSignedBallots(new Gs2.Gs2Matchmaking.Model.SignedBallot[] {
new Gs2.Gs2Matchmaking.Model.SignedBallot()
.WithBody("aaa")
.WithSignature("bbb"),
new Gs2.Gs2Matchmaking.Model.SignedBallot()
.WithBody("aaa")
.WithSignature("bbb"),
new Gs2.Gs2Matchmaking.Model.SignedBallot()
.WithBody("aaa")
.WithSignature("bbb"),
new Gs2.Gs2Matchmaking.Model.SignedBallot()
.WithBody("aaa")
.WithSignature("bbb"),
})
.WithGameResults(new Gs2.Gs2Matchmaking.Model.GameResult[] {
new Gs2.Gs2Matchmaking.Model.GameResult()
.WithRank(1)
.WithUserId("user-0001"),
new Gs2.Gs2Matchmaking.Model.GameResult()
.WithRank(2)
.WithUserId("user-0002"),
new Gs2.Gs2Matchmaking.Model.GameResult()
.WithRank(2)
.WithUserId("user-0003"),
new Gs2.Gs2Matchmaking.Model.GameResult()
.WithRank(3)
.WithUserId("user-0004"),
})
.WithKeyId("key-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.voteMultiple(
new Gs2Matchmaking.VoteMultipleRequest()
.withNamespaceName("namespace-0001")
.withSignedBallots([
new Gs2Matchmaking.model.SignedBallot()
.withBody("aaa")
.withSignature("bbb"),
new Gs2Matchmaking.model.SignedBallot()
.withBody("aaa")
.withSignature("bbb"),
new Gs2Matchmaking.model.SignedBallot()
.withBody("aaa")
.withSignature("bbb"),
new Gs2Matchmaking.model.SignedBallot()
.withBody("aaa")
.withSignature("bbb"),
])
.withGameResults([
new Gs2Matchmaking.model.GameResult()
.withRank(1)
.withUserId("user-0001"),
new Gs2Matchmaking.model.GameResult()
.withRank(2)
.withUserId("user-0002"),
new Gs2Matchmaking.model.GameResult()
.withRank(2)
.withUserId("user-0003"),
new Gs2Matchmaking.model.GameResult()
.withRank(3)
.withUserId("user-0004"),
])
.withKeyId("key-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.vote_multiple(
matchmaking.VoteMultipleRequest()
.with_namespace_name('namespace-0001')
.with_signed_ballots([
matchmaking.SignedBallot()
.with_body('aaa')
.with_signature('bbb'),
matchmaking.SignedBallot()
.with_body('aaa')
.with_signature('bbb'),
matchmaking.SignedBallot()
.with_body('aaa')
.with_signature('bbb'),
matchmaking.SignedBallot()
.with_body('aaa')
.with_signature('bbb'),
])
.with_game_results([
matchmaking.GameResult()
.with_rank(1)
.with_user_id('user-0001'),
matchmaking.GameResult()
.with_rank(2)
.with_user_id('user-0002'),
matchmaking.GameResult()
.with_rank(2)
.with_user_id('user-0003'),
matchmaking.GameResult()
.with_rank(3)
.with_user_id('user-0004'),
])
.with_key_id('key-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('matchmaking')
api_result = client.vote_multiple({
namespaceName="namespace-0001",
signedBallots={
{
body="aaa",
signature="bbb",
},
{
body="aaa",
signature="bbb",
},
{
body="aaa",
signature="bbb",
},
{
body="aaa",
signature="bbb",
}
},
gameResults={
{
rank=1,
user_id="user-0001",
},
{
rank=2,
user_id="user-0002",
},
{
rank=2,
user_id="user-0003",
},
{
rank=3,
user_id="user-0004",
}
},
keyId="key-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('matchmaking')
api_result_handler = client.vote_multiple_async({
namespaceName="namespace-0001",
signedBallots={
{
body="aaa",
signature="bbb",
},
{
body="aaa",
signature="bbb",
},
{
body="aaa",
signature="bbb",
},
{
body="aaa",
signature="bbb",
}
},
gameResults={
{
rank=1,
user_id="user-0001",
},
{
rank=2,
user_id="user-0002",
},
{
rank=2,
user_id="user-0003",
},
{
rank=3,
user_id="user-0004",
}
},
keyId="key-0001",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;commitVote
投票状況を強制確定
指定されたギャザリングの投票プロセスを強制的に完了します。
結果はこれまでに収集された投票用紙に基づいて多数決で決定されます。票が同数の場合、結果は破棄されます(スクリプトで挙動を変更可)。
詳細
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 | ||
| ratingName | string | ✓ | ~ 128文字 | レーティングモデル名 レーティングモデル固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 | ||
| gatheringName | string | ✓ | UUID | ~ 128文字 | ギャザリング名 ギャザリングの一意な名前を保持します。 名前は UUID(Universally Unique Identifier)フォーマットで自動的に生成され、ギャザリングを識別するために使用されます。 |
Result
| 型 | 説明 |
|---|
実装例
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.CommitVote(
&matchmaking.CommitVoteRequest {
NamespaceName: pointy.String("namespace-0001"),
RatingName: pointy.String("rating-0001"),
GatheringName: pointy.String("gathering-0001"),
}
)
if err != nil {
panic("error occurred")
}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\CommitVoteRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2MatchmakingRestClient(
$session
);
try {
$result = $client->commitVote(
(new CommitVoteRequest())
->withNamespaceName("namespace-0001")
->withRatingName("rating-0001")
->withGatheringName("gathering-0001")
);
} 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.CommitVoteRequest;
import io.gs2.matchmaking.result.CommitVoteResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);
try {
CommitVoteResult result = client.commitVote(
new CommitVoteRequest()
.withNamespaceName("namespace-0001")
.withRatingName("rating-0001")
.withGatheringName("gathering-0001")
);
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);
AsyncResult<Gs2.Gs2Matchmaking.Result.CommitVoteResult> asyncResult = null;
yield return client.CommitVote(
new Gs2.Gs2Matchmaking.Request.CommitVoteRequest()
.WithNamespaceName("namespace-0001")
.WithRatingName("rating-0001")
.WithGatheringName("gathering-0001"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;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.commitVote(
new Gs2Matchmaking.CommitVoteRequest()
.withNamespaceName("namespace-0001")
.withRatingName("rating-0001")
.withGatheringName("gathering-0001")
);
} 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.commit_vote(
matchmaking.CommitVoteRequest()
.with_namespace_name('namespace-0001')
.with_rating_name('rating-0001')
.with_gathering_name('gathering-0001')
)
except core.Gs2Exception as e:
exit(1)client = gs2('matchmaking')
api_result = client.commit_vote({
namespaceName="namespace-0001",
ratingName="rating-0001",
gatheringName="gathering-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.resultclient = gs2('matchmaking')
api_result_handler = client.commit_vote_async({
namespaceName="namespace-0001",
ratingName="rating-0001",
gatheringName="gathering-0001",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.resultdescribeRatingModels
レーティングモデルの一覧を取得
指定されたネームスペースの現在アクティブなレーティングモデルの一覧を取得します。
レーティングモデルは、初期値やボラティリティなどの Glicko-2 アルゴリズムのパラメータを定義します。
詳細
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
Result
| 型 | 説明 | |
|---|---|---|
| items | List<RatingModel> | レーティングモデルのリスト |
実装例
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("namespace-0001"),
}
)
if err != nil {
panic("error occurred")
}
items := result.Itemsuse 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 Gs2MatchmakingRestClient(
$session
);
try {
$result = $client->describeRatingModels(
(new DescribeRatingModelsRequest())
->withNamespaceName("namespace-0001")
);
$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("namespace-0001")
);
List<RatingModel> items = result.getItems();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);
AsyncResult<Gs2.Gs2Matchmaking.Result.DescribeRatingModelsResult> asyncResult = null;
yield return client.DescribeRatingModels(
new Gs2.Gs2Matchmaking.Request.DescribeRatingModelsRequest()
.WithNamespaceName("namespace-0001"),
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("namespace-0001")
);
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('namespace-0001')
)
items = result.items
except core.Gs2Exception as e:
exit(1)client = gs2('matchmaking')
api_result = client.describe_rating_models({
namespaceName="namespace-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;client = gs2('matchmaking')
api_result_handler = client.describe_rating_models_async({
namespaceName="namespace-0001",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;getRatingModel
レーティングモデルを取得
指定されたレーティングモデルの Glicko-2 アルゴリズムの初期値およびボラティリティ設定を含む情報を取得します。
詳細
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 | ||
| ratingName | string | ✓ | ~ 128文字 | レーティングモデル名 レーティングモデル固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
Result
| 型 | 説明 | |
|---|---|---|
| item | RatingModel | レーティングモデル |
実装例
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("namespace-0001"),
RatingName: pointy.String("mode1"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse 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 Gs2MatchmakingRestClient(
$session
);
try {
$result = $client->getRatingModel(
(new GetRatingModelRequest())
->withNamespaceName("namespace-0001")
->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("namespace-0001")
.withRatingName("mode1")
);
RatingModel item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);
AsyncResult<Gs2.Gs2Matchmaking.Result.GetRatingModelResult> asyncResult = null;
yield return client.GetRatingModel(
new Gs2.Gs2Matchmaking.Request.GetRatingModelRequest()
.WithNamespaceName("namespace-0001")
.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("namespace-0001")
.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('namespace-0001')
.with_rating_name('mode1')
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('matchmaking')
api_result = client.get_rating_model({
namespaceName="namespace-0001",
ratingName="mode1",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('matchmaking')
api_result_handler = client.get_rating_model_async({
namespaceName="namespace-0001",
ratingName="mode1",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;describeSeasonModels
シーズンモデルの一覧を取得
指定されたネームスペースの現在アクティブなシーズンモデルの一覧を取得します。
シーズンモデルは、最大参加人数、経験値モデルを使用したティアー計算、チャレンジ期間イベントを定義します。
詳細
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
Result
| 型 | 説明 | |
|---|---|---|
| items | List<SeasonModel> | シーズンモデルのリスト |
実装例
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.DescribeSeasonModels(
&matchmaking.DescribeSeasonModelsRequest {
NamespaceName: pointy.String("namespace-0001"),
}
)
if err != nil {
panic("error occurred")
}
items := result.Itemsuse 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\DescribeSeasonModelsRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2MatchmakingRestClient(
$session
);
try {
$result = $client->describeSeasonModels(
(new DescribeSeasonModelsRequest())
->withNamespaceName("namespace-0001")
);
$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.DescribeSeasonModelsRequest;
import io.gs2.matchmaking.result.DescribeSeasonModelsResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);
try {
DescribeSeasonModelsResult result = client.describeSeasonModels(
new DescribeSeasonModelsRequest()
.withNamespaceName("namespace-0001")
);
List<SeasonModel> items = result.getItems();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);
AsyncResult<Gs2.Gs2Matchmaking.Result.DescribeSeasonModelsResult> asyncResult = null;
yield return client.DescribeSeasonModels(
new Gs2.Gs2Matchmaking.Request.DescribeSeasonModelsRequest()
.WithNamespaceName("namespace-0001"),
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.describeSeasonModels(
new Gs2Matchmaking.DescribeSeasonModelsRequest()
.withNamespaceName("namespace-0001")
);
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_season_models(
matchmaking.DescribeSeasonModelsRequest()
.with_namespace_name('namespace-0001')
)
items = result.items
except core.Gs2Exception as e:
exit(1)client = gs2('matchmaking')
api_result = client.describe_season_models({
namespaceName="namespace-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;client = gs2('matchmaking')
api_result_handler = client.describe_season_models_async({
namespaceName="namespace-0001",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;getSeasonModel
シーズンモデルを取得
指定されたシーズンモデルの最大参加人数、ティアー計算用の経験値モデルID、チャレンジ期間イベントIDを含む情報を取得します。
詳細
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 | ||
| seasonName | string | ✓ | ~ 128文字 | シーズンモデル名 シーズンモデル固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
Result
| 型 | 説明 | |
|---|---|---|
| item | SeasonModel | シーズンモデル |
実装例
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.GetSeasonModel(
&matchmaking.GetSeasonModelRequest {
NamespaceName: pointy.String("namespace-0001"),
SeasonName: pointy.String("season-0001"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse 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\GetSeasonModelRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2MatchmakingRestClient(
$session
);
try {
$result = $client->getSeasonModel(
(new GetSeasonModelRequest())
->withNamespaceName("namespace-0001")
->withSeasonName("season-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.GetSeasonModelRequest;
import io.gs2.matchmaking.result.GetSeasonModelResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);
try {
GetSeasonModelResult result = client.getSeasonModel(
new GetSeasonModelRequest()
.withNamespaceName("namespace-0001")
.withSeasonName("season-0001")
);
SeasonModel item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);
AsyncResult<Gs2.Gs2Matchmaking.Result.GetSeasonModelResult> asyncResult = null;
yield return client.GetSeasonModel(
new Gs2.Gs2Matchmaking.Request.GetSeasonModelRequest()
.WithNamespaceName("namespace-0001")
.WithSeasonName("season-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.getSeasonModel(
new Gs2Matchmaking.GetSeasonModelRequest()
.withNamespaceName("namespace-0001")
.withSeasonName("season-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_season_model(
matchmaking.GetSeasonModelRequest()
.with_namespace_name('namespace-0001')
.with_season_name('season-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('matchmaking')
api_result = client.get_season_model({
namespaceName="namespace-0001",
seasonName="season-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('matchmaking')
api_result_handler = client.get_season_model_async({
namespaceName="namespace-0001",
seasonName="season-0001",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;exportMaster
モデルマスターを有効化可能なマスターデータ形式でエクスポート
現在アクティブなレーティングモデルマスターとシーズンモデルマスターを有効化可能な形式でエクスポートします。
エクスポートされたデータは、他のネームスペースのマスターデータ更新やバックアップとして使用できます。
詳細
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
Result
| 型 | 説明 | |
|---|---|---|
| item | CurrentModelMaster | 有効化可能なモデルのマスターデータ |
実装例
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("namespace-0001"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse 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 Gs2MatchmakingRestClient(
$session
);
try {
$result = $client->exportMaster(
(new ExportMasterRequest())
->withNamespaceName("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.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("namespace-0001")
);
CurrentModelMaster item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);
AsyncResult<Gs2.Gs2Matchmaking.Result.ExportMasterResult> asyncResult = null;
yield return client.ExportMaster(
new Gs2.Gs2Matchmaking.Request.ExportMasterRequest()
.WithNamespaceName("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.exportMaster(
new Gs2Matchmaking.ExportMasterRequest()
.withNamespaceName("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.export_master(
matchmaking.ExportMasterRequest()
.with_namespace_name('namespace-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('matchmaking')
api_result = client.export_master({
namespaceName="namespace-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('matchmaking')
api_result_handler = client.export_master_async({
namespaceName="namespace-0001",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;getCurrentModelMaster
現在アクティブなモデルのマスターデータを取得
指定されたネームスペースの現在アクティブなレーティングモデルおよびシーズンモデルのマスターデータを取得します。
詳細
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
Result
| 型 | 説明 | |
|---|---|---|
| item | CurrentModelMaster | 現在アクティブなモデルのマスターデータ |
実装例
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.GetCurrentModelMaster(
&matchmaking.GetCurrentModelMasterRequest {
NamespaceName: pointy.String("namespace-0001"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse 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\GetCurrentModelMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2MatchmakingRestClient(
$session
);
try {
$result = $client->getCurrentModelMaster(
(new GetCurrentModelMasterRequest())
->withNamespaceName("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.GetCurrentModelMasterRequest;
import io.gs2.matchmaking.result.GetCurrentModelMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);
try {
GetCurrentModelMasterResult result = client.getCurrentModelMaster(
new GetCurrentModelMasterRequest()
.withNamespaceName("namespace-0001")
);
CurrentModelMaster item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);
AsyncResult<Gs2.Gs2Matchmaking.Result.GetCurrentModelMasterResult> asyncResult = null;
yield return client.GetCurrentModelMaster(
new Gs2.Gs2Matchmaking.Request.GetCurrentModelMasterRequest()
.WithNamespaceName("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.getCurrentModelMaster(
new Gs2Matchmaking.GetCurrentModelMasterRequest()
.withNamespaceName("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.get_current_model_master(
matchmaking.GetCurrentModelMasterRequest()
.with_namespace_name('namespace-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('matchmaking')
api_result = client.get_current_model_master({
namespaceName="namespace-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('matchmaking')
api_result_handler = client.get_current_model_master_async({
namespaceName="namespace-0001",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;preUpdateCurrentModelMaster
現在アクティブなモデルのマスターデータを更新(3フェーズ版)
1MBを超えるマスターデータをアップロードする場合は、3フェーズで更新を行います。
- このAPIを実行し、アップロード用のトークンとURLを取得します。
- 取得したURLに対して、マスターデータをアップロードします。
- UpdateCurrentModelMaster にアップロードで取得したトークンを渡して実行し、マスターデータを反映します。
詳細
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
Result
| 型 | 説明 | |
|---|---|---|
| uploadToken | string | アップロード後に結果を反映する際に使用するトークン |
| uploadUrl | string | アップロード処理の実行に使用するURL |
実装例
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.PreUpdateCurrentModelMaster(
&matchmaking.PreUpdateCurrentModelMasterRequest {
NamespaceName: pointy.String("namespace-0001"),
}
)
if err != nil {
panic("error occurred")
}
uploadToken := result.UploadToken
uploadUrl := result.UploadUrluse 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\PreUpdateCurrentModelMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2MatchmakingRestClient(
$session
);
try {
$result = $client->preUpdateCurrentModelMaster(
(new PreUpdateCurrentModelMasterRequest())
->withNamespaceName("namespace-0001")
);
$uploadToken = $result->getUploadToken();
$uploadUrl = $result->getUploadUrl();
} 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.PreUpdateCurrentModelMasterRequest;
import io.gs2.matchmaking.result.PreUpdateCurrentModelMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);
try {
PreUpdateCurrentModelMasterResult result = client.preUpdateCurrentModelMaster(
new PreUpdateCurrentModelMasterRequest()
.withNamespaceName("namespace-0001")
);
String uploadToken = result.getUploadToken();
String uploadUrl = result.getUploadUrl();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);
AsyncResult<Gs2.Gs2Matchmaking.Result.PreUpdateCurrentModelMasterResult> asyncResult = null;
yield return client.PreUpdateCurrentModelMaster(
new Gs2.Gs2Matchmaking.Request.PreUpdateCurrentModelMasterRequest()
.WithNamespaceName("namespace-0001"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var uploadToken = result.UploadToken;
var uploadUrl = result.UploadUrl;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.preUpdateCurrentModelMaster(
new Gs2Matchmaking.PreUpdateCurrentModelMasterRequest()
.withNamespaceName("namespace-0001")
);
const uploadToken = result.getUploadToken();
const uploadUrl = result.getUploadUrl();
} 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.pre_update_current_model_master(
matchmaking.PreUpdateCurrentModelMasterRequest()
.with_namespace_name('namespace-0001')
)
upload_token = result.upload_token
upload_url = result.upload_url
except core.Gs2Exception as e:
exit(1)client = gs2('matchmaking')
api_result = client.pre_update_current_model_master({
namespaceName="namespace-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
uploadToken = result.uploadToken;
uploadUrl = result.uploadUrl;client = gs2('matchmaking')
api_result_handler = client.pre_update_current_model_master_async({
namespaceName="namespace-0001",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
uploadToken = result.uploadToken;
uploadUrl = result.uploadUrl;updateCurrentModelMaster
現在アクティブなモデルのマスターデータを更新
現在アクティブなモデルのマスターデータを更新します。
2つのモードをサポートします:インライン設定用の ‘direct’ モードと、3フェーズ更新プロセスで事前にアップロードした設定を適用する ‘preUpload’ モードです。
詳細
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 | ||||||||
| mode | 文字列列挙型 enum { “direct”, “preUpload” } | “direct” | 更新モード
| |||||||||
| settings | string | {mode} == “direct” | ✓※ | ~ 5242880文字 | マスターデータ ※ mode が “direct” であれば必須 | |||||||
| uploadToken | string | {mode} == “preUpload” | ✓※ | ~ 1024文字 | 事前アップロードで取得したトークン アップロードしたマスターデータを適用するために使用されます。 ※ mode が “preUpload” であれば必須 |
Result
| 型 | 説明 | |
|---|---|---|
| item | CurrentModelMaster | 更新された現在アクティブなモデルのマスターデータ |
実装例
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.UpdateCurrentModelMaster(
&matchmaking.UpdateCurrentModelMasterRequest {
NamespaceName: pointy.String("namespace-0001"),
Mode: pointy.String("direct"),
Settings: pointy.String("{\"version\": \"2020-06-24\", \"ratingModels\": [{\"name\": \"rating-0001\", \"metadata\": \"RATING_0001\", \"volatility\": 100, \"initialValue\": 1500}, {\"name\": \"rating-0002\", \"metadata\": \"RATING_0002\", \"volatility\": 150, \"initialValue\": 1500}], \"seasonModels\": [{\"name\": \"season-0001\", \"maximumParticipants\": 50, \"challengePeriodEventId\": \"grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0001\"}, {\"name\": \"season-0002\", \"maximumParticipants\": 100, \"challengePeriodEventId\": \"grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0002\"}]}"),
UploadToken: nil,
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse 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\UpdateCurrentModelMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2MatchmakingRestClient(
$session
);
try {
$result = $client->updateCurrentModelMaster(
(new UpdateCurrentModelMasterRequest())
->withNamespaceName("namespace-0001")
->withMode("direct")
->withSettings("{\"version\": \"2020-06-24\", \"ratingModels\": [{\"name\": \"rating-0001\", \"metadata\": \"RATING_0001\", \"volatility\": 100, \"initialValue\": 1500}, {\"name\": \"rating-0002\", \"metadata\": \"RATING_0002\", \"volatility\": 150, \"initialValue\": 1500}], \"seasonModels\": [{\"name\": \"season-0001\", \"maximumParticipants\": 50, \"challengePeriodEventId\": \"grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0001\"}, {\"name\": \"season-0002\", \"maximumParticipants\": 100, \"challengePeriodEventId\": \"grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0002\"}]}")
->withUploadToken(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.UpdateCurrentModelMasterRequest;
import io.gs2.matchmaking.result.UpdateCurrentModelMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);
try {
UpdateCurrentModelMasterResult result = client.updateCurrentModelMaster(
new UpdateCurrentModelMasterRequest()
.withNamespaceName("namespace-0001")
.withMode("direct")
.withSettings("{\"version\": \"2020-06-24\", \"ratingModels\": [{\"name\": \"rating-0001\", \"metadata\": \"RATING_0001\", \"volatility\": 100, \"initialValue\": 1500}, {\"name\": \"rating-0002\", \"metadata\": \"RATING_0002\", \"volatility\": 150, \"initialValue\": 1500}], \"seasonModels\": [{\"name\": \"season-0001\", \"maximumParticipants\": 50, \"challengePeriodEventId\": \"grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0001\"}, {\"name\": \"season-0002\", \"maximumParticipants\": 100, \"challengePeriodEventId\": \"grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0002\"}]}")
.withUploadToken(null)
);
CurrentModelMaster item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);
AsyncResult<Gs2.Gs2Matchmaking.Result.UpdateCurrentModelMasterResult> asyncResult = null;
yield return client.UpdateCurrentModelMaster(
new Gs2.Gs2Matchmaking.Request.UpdateCurrentModelMasterRequest()
.WithNamespaceName("namespace-0001")
.WithMode("direct")
.WithSettings("{\"version\": \"2020-06-24\", \"ratingModels\": [{\"name\": \"rating-0001\", \"metadata\": \"RATING_0001\", \"volatility\": 100, \"initialValue\": 1500}, {\"name\": \"rating-0002\", \"metadata\": \"RATING_0002\", \"volatility\": 150, \"initialValue\": 1500}], \"seasonModels\": [{\"name\": \"season-0001\", \"maximumParticipants\": 50, \"challengePeriodEventId\": \"grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0001\"}, {\"name\": \"season-0002\", \"maximumParticipants\": 100, \"challengePeriodEventId\": \"grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0002\"}]}")
.WithUploadToken(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.updateCurrentModelMaster(
new Gs2Matchmaking.UpdateCurrentModelMasterRequest()
.withNamespaceName("namespace-0001")
.withMode("direct")
.withSettings("{\"version\": \"2020-06-24\", \"ratingModels\": [{\"name\": \"rating-0001\", \"metadata\": \"RATING_0001\", \"volatility\": 100, \"initialValue\": 1500}, {\"name\": \"rating-0002\", \"metadata\": \"RATING_0002\", \"volatility\": 150, \"initialValue\": 1500}], \"seasonModels\": [{\"name\": \"season-0001\", \"maximumParticipants\": 50, \"challengePeriodEventId\": \"grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0001\"}, {\"name\": \"season-0002\", \"maximumParticipants\": 100, \"challengePeriodEventId\": \"grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0002\"}]}")
.withUploadToken(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.update_current_model_master(
matchmaking.UpdateCurrentModelMasterRequest()
.with_namespace_name('namespace-0001')
.with_mode('direct')
.with_settings('{"version": "2020-06-24", "ratingModels": [{"name": "rating-0001", "metadata": "RATING_0001", "volatility": 100, "initialValue": 1500}, {"name": "rating-0002", "metadata": "RATING_0002", "volatility": 150, "initialValue": 1500}], "seasonModels": [{"name": "season-0001", "maximumParticipants": 50, "challengePeriodEventId": "grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0001"}, {"name": "season-0002", "maximumParticipants": 100, "challengePeriodEventId": "grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0002"}]}')
.with_upload_token(None)
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('matchmaking')
api_result = client.update_current_model_master({
namespaceName="namespace-0001",
mode="direct",
settings="{\"version\": \"2020-06-24\", \"ratingModels\": [{\"name\": \"rating-0001\", \"metadata\": \"RATING_0001\", \"volatility\": 100, \"initialValue\": 1500}, {\"name\": \"rating-0002\", \"metadata\": \"RATING_0002\", \"volatility\": 150, \"initialValue\": 1500}], \"seasonModels\": [{\"name\": \"season-0001\", \"maximumParticipants\": 50, \"challengePeriodEventId\": \"grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0001\"}, {\"name\": \"season-0002\", \"maximumParticipants\": 100, \"challengePeriodEventId\": \"grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0002\"}]}",
uploadToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('matchmaking')
api_result_handler = client.update_current_model_master_async({
namespaceName="namespace-0001",
mode="direct",
settings="{\"version\": \"2020-06-24\", \"ratingModels\": [{\"name\": \"rating-0001\", \"metadata\": \"RATING_0001\", \"volatility\": 100, \"initialValue\": 1500}, {\"name\": \"rating-0002\", \"metadata\": \"RATING_0002\", \"volatility\": 150, \"initialValue\": 1500}], \"seasonModels\": [{\"name\": \"season-0001\", \"maximumParticipants\": 50, \"challengePeriodEventId\": \"grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0001\"}, {\"name\": \"season-0002\", \"maximumParticipants\": 100, \"challengePeriodEventId\": \"grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0002\"}]}",
uploadToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;updateCurrentModelMasterFromGitHub
現在アクティブなモデルのマスターデータをGitHubから更新
指定された GitHub リポジトリからマスターデータを取得して、現在アクティブなモデルのマスターデータを更新します。
GS2-Key に保存された API キーが認証に使用され、チェックアウトするブランチ、タグ、またはコミットハッシュを指定できます。
詳細
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 | ||
| checkoutSetting | GitHubCheckoutSetting | ✓ | GitHubからマスターデータをチェックアウトする設定 |
Result
| 型 | 説明 | |
|---|---|---|
| item | CurrentModelMaster | 更新された現在アクティブなモデルのマスターデータ |
実装例
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.UpdateCurrentModelMasterFromGitHub(
&matchmaking.UpdateCurrentModelMasterFromGitHubRequest {
NamespaceName: pointy.String("namespace-0001"),
CheckoutSetting: nil,
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse 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\UpdateCurrentModelMasterFromGitHubRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2MatchmakingRestClient(
$session
);
try {
$result = $client->updateCurrentModelMasterFromGitHub(
(new UpdateCurrentModelMasterFromGitHubRequest())
->withNamespaceName("namespace-0001")
->withCheckoutSetting(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.UpdateCurrentModelMasterFromGitHubRequest;
import io.gs2.matchmaking.result.UpdateCurrentModelMasterFromGitHubResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);
try {
UpdateCurrentModelMasterFromGitHubResult result = client.updateCurrentModelMasterFromGitHub(
new UpdateCurrentModelMasterFromGitHubRequest()
.withNamespaceName("namespace-0001")
.withCheckoutSetting(null)
);
CurrentModelMaster item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);
AsyncResult<Gs2.Gs2Matchmaking.Result.UpdateCurrentModelMasterFromGitHubResult> asyncResult = null;
yield return client.UpdateCurrentModelMasterFromGitHub(
new Gs2.Gs2Matchmaking.Request.UpdateCurrentModelMasterFromGitHubRequest()
.WithNamespaceName("namespace-0001")
.WithCheckoutSetting(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.updateCurrentModelMasterFromGitHub(
new Gs2Matchmaking.UpdateCurrentModelMasterFromGitHubRequest()
.withNamespaceName("namespace-0001")
.withCheckoutSetting(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.update_current_model_master_from_git_hub(
matchmaking.UpdateCurrentModelMasterFromGitHubRequest()
.with_namespace_name('namespace-0001')
.with_checkout_setting(None)
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('matchmaking')
api_result = client.update_current_model_master_from_git_hub({
namespaceName="namespace-0001",
checkoutSetting=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('matchmaking')
api_result_handler = client.update_current_model_master_from_git_hub_async({
namespaceName="namespace-0001",
checkoutSetting=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;describeRatingModelMasters
レーティングモデルマスターの一覧を取得
指定されたネームスペースのレーティングモデルマスターのページネーション付きリストを取得します。
名前の接頭辞でフィルタリングできます。
詳細
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 | ||
| namePrefix | string | ~ 64文字 | レーティングモデル名のフィルター接頭辞 | |||
| pageToken | string | ~ 1024文字 | データの取得を開始する位置を指定するトークン | |||
| limit | int | 30 | 1 ~ 1000 | データの取得件数 |
Result
| 型 | 説明 | |
|---|---|---|
| items | List<RatingModelMaster> | レーティングモデルマスターのリスト |
| nextPageToken | string | リストの続きを取得するためのページトークン |
実装例
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("namespace-0001"),
NamePrefix: nil,
PageToken: nil,
Limit: nil,
}
)
if err != nil {
panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageTokenuse 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 Gs2MatchmakingRestClient(
$session
);
try {
$result = $client->describeRatingModelMasters(
(new DescribeRatingModelMastersRequest())
->withNamespaceName("namespace-0001")
->withNamePrefix(null)
->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("namespace-0001")
.withNamePrefix(null)
.withPageToken(null)
.withLimit(null)
);
List<RatingModelMaster> items = result.getItems();
String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);
AsyncResult<Gs2.Gs2Matchmaking.Result.DescribeRatingModelMastersResult> asyncResult = null;
yield return client.DescribeRatingModelMasters(
new Gs2.Gs2Matchmaking.Request.DescribeRatingModelMastersRequest()
.WithNamespaceName("namespace-0001")
.WithNamePrefix(null)
.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("namespace-0001")
.withNamePrefix(null)
.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('namespace-0001')
.with_name_prefix(None)
.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="namespace-0001",
namePrefix=nil,
pageToken=nil,
limit=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;client = gs2('matchmaking')
api_result_handler = client.describe_rating_model_masters_async({
namespaceName="namespace-0001",
namePrefix=nil,
pageToken=nil,
limit=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;createRatingModelMaster
レーティングモデルマスターを新規作成
指定された Glicko-2 アルゴリズムパラメータで新しいレーティングモデルマスターを作成します。
レーティング計算の初期値(デフォルト: 1500)とボラティリティを設定できます。
詳細
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 | ||
| name | string | ✓ | ~ 128文字 | レーティングモデル名 レーティングモデル固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 | ||
| description | string | ~ 1024文字 | 説明文 | |||
| metadata | string | ~ 128文字 | メタデータ メタデータには任意の値を設定できます。 これらの値は GS2 の動作には影響しないため、ゲーム内で利用する情報の保存先として使用できます。 | |||
| initialValue | int | 1500 | 100 ~ 10000 | レート値の初期値 プレイヤーが初めてレーティング付きマッチメイキングに参加したときに割り当てられる開始レート値。 デフォルトは 1500 です。すべてのプレイヤーは同じレーティングから開始し、対戦結果に基づいて調整されます。 | ||
| volatility | int | 100 | 1 ~ 20000 | レーティングのボラティリティ 各対戦後にレート値がどの程度変動するかを制御する Glicko-2 のパラメータ。 値が大きいほどレーティングの変動幅が大きくなり、より早くレーティングが調整されます。 値が小さいほどレーティングが安定し、緩やかに変化します。デフォルトは 100 です。 |
Result
| 型 | 説明 | |
|---|---|---|
| item | RatingModelMaster | 作成したレーティングモデルマスター |
実装例
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("namespace-0001"),
Name: pointy.String("mode1"),
Description: nil,
Metadata: nil,
InitialValue: nil,
Volatility: nil,
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse 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 Gs2MatchmakingRestClient(
$session
);
try {
$result = $client->createRatingModelMaster(
(new CreateRatingModelMasterRequest())
->withNamespaceName("namespace-0001")
->withName("mode1")
->withDescription(null)
->withMetadata(null)
->withInitialValue(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("namespace-0001")
.withName("mode1")
.withDescription(null)
.withMetadata(null)
.withInitialValue(null)
.withVolatility(null)
);
RatingModelMaster item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);
AsyncResult<Gs2.Gs2Matchmaking.Result.CreateRatingModelMasterResult> asyncResult = null;
yield return client.CreateRatingModelMaster(
new Gs2.Gs2Matchmaking.Request.CreateRatingModelMasterRequest()
.WithNamespaceName("namespace-0001")
.WithName("mode1")
.WithDescription(null)
.WithMetadata(null)
.WithInitialValue(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("namespace-0001")
.withName("mode1")
.withDescription(null)
.withMetadata(null)
.withInitialValue(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('namespace-0001')
.with_name('mode1')
.with_description(None)
.with_metadata(None)
.with_initial_value(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="namespace-0001",
name="mode1",
description=nil,
metadata=nil,
initialValue=nil,
volatility=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('matchmaking')
api_result_handler = client.create_rating_model_master_async({
namespaceName="namespace-0001",
name="mode1",
description=nil,
metadata=nil,
initialValue=nil,
volatility=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;getRatingModelMaster
レーティングモデルマスターを取得
指定されたレーティングモデルマスターの初期値およびボラティリティ設定を含む情報を取得します。
詳細
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 | ||
| ratingName | string | ✓ | ~ 128文字 | レーティングモデル名 レーティングモデル固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
Result
| 型 | 説明 | |
|---|---|---|
| item | RatingModelMaster | レーティングモデルマスター |
実装例
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("namespace-0001"),
RatingName: pointy.String("mode1"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse 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 Gs2MatchmakingRestClient(
$session
);
try {
$result = $client->getRatingModelMaster(
(new GetRatingModelMasterRequest())
->withNamespaceName("namespace-0001")
->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("namespace-0001")
.withRatingName("mode1")
);
RatingModelMaster item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);
AsyncResult<Gs2.Gs2Matchmaking.Result.GetRatingModelMasterResult> asyncResult = null;
yield return client.GetRatingModelMaster(
new Gs2.Gs2Matchmaking.Request.GetRatingModelMasterRequest()
.WithNamespaceName("namespace-0001")
.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("namespace-0001")
.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('namespace-0001')
.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="namespace-0001",
ratingName="mode1",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('matchmaking')
api_result_handler = client.get_rating_model_master_async({
namespaceName="namespace-0001",
ratingName="mode1",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;updateRatingModelMaster
レーティングモデルマスターを更新
指定されたレーティングモデルマスターを更新します。説明、メタデータ、初期値、ボラティリティ設定を変更できます。
詳細
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 | ||
| ratingName | string | ✓ | ~ 128文字 | レーティングモデル名 レーティングモデル固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 | ||
| description | string | ~ 1024文字 | 説明文 | |||
| metadata | string | ~ 128文字 | メタデータ メタデータには任意の値を設定できます。 これらの値は GS2 の動作には影響しないため、ゲーム内で利用する情報の保存先として使用できます。 | |||
| initialValue | int | 1500 | 100 ~ 10000 | レート値の初期値 プレイヤーが初めてレーティング付きマッチメイキングに参加したときに割り当てられる開始レート値。 デフォルトは 1500 です。すべてのプレイヤーは同じレーティングから開始し、対戦結果に基づいて調整されます。 | ||
| volatility | int | 100 | 1 ~ 20000 | レーティングのボラティリティ 各対戦後にレート値がどの程度変動するかを制御する Glicko-2 のパラメータ。 値が大きいほどレーティングの変動幅が大きくなり、より早くレーティングが調整されます。 値が小さいほどレーティングが安定し、緩やかに変化します。デフォルトは 100 です。 |
Result
| 型 | 説明 | |
|---|---|---|
| item | RatingModelMaster | 更新したレーティングモデルマスター |
実装例
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("namespace-0001"),
RatingName: pointy.String("mode1"),
Description: pointy.String("description1"),
Metadata: nil,
InitialValue: nil,
Volatility: pointy.Int32(50),
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse 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 Gs2MatchmakingRestClient(
$session
);
try {
$result = $client->updateRatingModelMaster(
(new UpdateRatingModelMasterRequest())
->withNamespaceName("namespace-0001")
->withRatingName("mode1")
->withDescription("description1")
->withMetadata(null)
->withInitialValue(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("namespace-0001")
.withRatingName("mode1")
.withDescription("description1")
.withMetadata(null)
.withInitialValue(null)
.withVolatility(50)
);
RatingModelMaster item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);
AsyncResult<Gs2.Gs2Matchmaking.Result.UpdateRatingModelMasterResult> asyncResult = null;
yield return client.UpdateRatingModelMaster(
new Gs2.Gs2Matchmaking.Request.UpdateRatingModelMasterRequest()
.WithNamespaceName("namespace-0001")
.WithRatingName("mode1")
.WithDescription("description1")
.WithMetadata(null)
.WithInitialValue(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("namespace-0001")
.withRatingName("mode1")
.withDescription("description1")
.withMetadata(null)
.withInitialValue(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('namespace-0001')
.with_rating_name('mode1')
.with_description('description1')
.with_metadata(None)
.with_initial_value(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="namespace-0001",
ratingName="mode1",
description="description1",
metadata=nil,
initialValue=nil,
volatility=50,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('matchmaking')
api_result_handler = client.update_rating_model_master_async({
namespaceName="namespace-0001",
ratingName="mode1",
description="description1",
metadata=nil,
initialValue=nil,
volatility=50,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;deleteRatingModelMaster
レーティングモデルマスターを削除
指定されたレーティングモデルマスターを削除します。
次のマスターデータ更新まで、現在アクティブなマスターデータには影響しません。
詳細
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 | ||
| ratingName | string | ✓ | ~ 128文字 | レーティングモデル名 レーティングモデル固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
Result
| 型 | 説明 | |
|---|---|---|
| item | RatingModelMaster | 削除したレーティングモデルマスター |
実装例
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("namespace-0001"),
RatingName: pointy.String("mode1"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse 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 Gs2MatchmakingRestClient(
$session
);
try {
$result = $client->deleteRatingModelMaster(
(new DeleteRatingModelMasterRequest())
->withNamespaceName("namespace-0001")
->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("namespace-0001")
.withRatingName("mode1")
);
RatingModelMaster item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);
AsyncResult<Gs2.Gs2Matchmaking.Result.DeleteRatingModelMasterResult> asyncResult = null;
yield return client.DeleteRatingModelMaster(
new Gs2.Gs2Matchmaking.Request.DeleteRatingModelMasterRequest()
.WithNamespaceName("namespace-0001")
.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("namespace-0001")
.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('namespace-0001')
.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="namespace-0001",
ratingName="mode1",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('matchmaking')
api_result_handler = client.delete_rating_model_master_async({
namespaceName="namespace-0001",
ratingName="mode1",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;describeSeasonModelMasters
シーズンモデルマスターの一覧を取得
指定されたネームスペースのシーズンモデルマスターのページネーション付きリストを取得します。
名前の接頭辞でフィルタリングできます。
詳細
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 | ||
| namePrefix | string | ~ 64文字 | シーズンモデル名のフィルター接頭辞 | |||
| pageToken | string | ~ 1024文字 | データの取得を開始する位置を指定するトークン | |||
| limit | int | 30 | 1 ~ 1000 | データの取得件数 |
Result
| 型 | 説明 | |
|---|---|---|
| items | List<SeasonModelMaster> | シーズンモデルマスターのリスト |
| nextPageToken | string | リストの続きを取得するためのページトークン |
実装例
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.DescribeSeasonModelMasters(
&matchmaking.DescribeSeasonModelMastersRequest {
NamespaceName: pointy.String("namespace-0001"),
NamePrefix: nil,
PageToken: nil,
Limit: nil,
}
)
if err != nil {
panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageTokenuse 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\DescribeSeasonModelMastersRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2MatchmakingRestClient(
$session
);
try {
$result = $client->describeSeasonModelMasters(
(new DescribeSeasonModelMastersRequest())
->withNamespaceName("namespace-0001")
->withNamePrefix(null)
->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.DescribeSeasonModelMastersRequest;
import io.gs2.matchmaking.result.DescribeSeasonModelMastersResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);
try {
DescribeSeasonModelMastersResult result = client.describeSeasonModelMasters(
new DescribeSeasonModelMastersRequest()
.withNamespaceName("namespace-0001")
.withNamePrefix(null)
.withPageToken(null)
.withLimit(null)
);
List<SeasonModelMaster> items = result.getItems();
String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);
AsyncResult<Gs2.Gs2Matchmaking.Result.DescribeSeasonModelMastersResult> asyncResult = null;
yield return client.DescribeSeasonModelMasters(
new Gs2.Gs2Matchmaking.Request.DescribeSeasonModelMastersRequest()
.WithNamespaceName("namespace-0001")
.WithNamePrefix(null)
.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.describeSeasonModelMasters(
new Gs2Matchmaking.DescribeSeasonModelMastersRequest()
.withNamespaceName("namespace-0001")
.withNamePrefix(null)
.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_season_model_masters(
matchmaking.DescribeSeasonModelMastersRequest()
.with_namespace_name('namespace-0001')
.with_name_prefix(None)
.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_season_model_masters({
namespaceName="namespace-0001",
namePrefix=nil,
pageToken=nil,
limit=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;client = gs2('matchmaking')
api_result_handler = client.describe_season_model_masters_async({
namespaceName="namespace-0001",
namePrefix=nil,
pageToken=nil,
limit=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;createSeasonModelMaster
シーズンモデルマスターを新規作成
指定された設定で新しいシーズンモデルマスターを作成します。
ギャザリングあたりの最大参加人数、ティアーベースのマッチメイキング用の経験値モデル、マッチメイキングが利用可能な期間を制御するチャレンジ期間イベントを設定できます。
詳細
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 | ||
| name | string | ✓ | ~ 128文字 | シーズンモデル名 シーズンモデル固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 | ||
| description | string | ~ 1024文字 | 説明文 | |||
| metadata | string | ~ 128文字 | メタデータ メタデータには任意の値を設定できます。 これらの値は GS2 の動作には影響しないため、ゲーム内で利用する情報の保存先として使用できます。 | |||
| maximumParticipants | int | ✓ | 2 ~ 1000 | 最大参加人数 1つのシーズンギャザリングに参加可能なプレイヤーの最大人数。 この上限に達するとシーズンギャザリングは満員となり、それ以上のプレイヤーは参加できなくなります。 2 から 1000 の範囲で指定します。 | ||
| experienceModelId | string | ~ 1024文字 | ティアー管理用の経験値モデル GRN | |||
| challengePeriodEventId | string | ✓ | ~ 1024文字 | チャレンジ期間イベント GRN |
Result
| 型 | 説明 | |
|---|---|---|
| item | SeasonModelMaster | 作成したシーズンモデルマスター |
実装例
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.CreateSeasonModelMaster(
&matchmaking.CreateSeasonModelMasterRequest {
NamespaceName: pointy.String("namespace-0001"),
Name: pointy.String("season-0001"),
Description: nil,
Metadata: nil,
MaximumParticipants: pointy.Int32(50),
ExperienceModelId: nil,
ChallengePeriodEventId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0001"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse 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\CreateSeasonModelMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2MatchmakingRestClient(
$session
);
try {
$result = $client->createSeasonModelMaster(
(new CreateSeasonModelMasterRequest())
->withNamespaceName("namespace-0001")
->withName("season-0001")
->withDescription(null)
->withMetadata(null)
->withMaximumParticipants(50)
->withExperienceModelId(null)
->withChallengePeriodEventId("grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-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.CreateSeasonModelMasterRequest;
import io.gs2.matchmaking.result.CreateSeasonModelMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);
try {
CreateSeasonModelMasterResult result = client.createSeasonModelMaster(
new CreateSeasonModelMasterRequest()
.withNamespaceName("namespace-0001")
.withName("season-0001")
.withDescription(null)
.withMetadata(null)
.withMaximumParticipants(50)
.withExperienceModelId(null)
.withChallengePeriodEventId("grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0001")
);
SeasonModelMaster item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);
AsyncResult<Gs2.Gs2Matchmaking.Result.CreateSeasonModelMasterResult> asyncResult = null;
yield return client.CreateSeasonModelMaster(
new Gs2.Gs2Matchmaking.Request.CreateSeasonModelMasterRequest()
.WithNamespaceName("namespace-0001")
.WithName("season-0001")
.WithDescription(null)
.WithMetadata(null)
.WithMaximumParticipants(50)
.WithExperienceModelId(null)
.WithChallengePeriodEventId("grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-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.createSeasonModelMaster(
new Gs2Matchmaking.CreateSeasonModelMasterRequest()
.withNamespaceName("namespace-0001")
.withName("season-0001")
.withDescription(null)
.withMetadata(null)
.withMaximumParticipants(50)
.withExperienceModelId(null)
.withChallengePeriodEventId("grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-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_season_model_master(
matchmaking.CreateSeasonModelMasterRequest()
.with_namespace_name('namespace-0001')
.with_name('season-0001')
.with_description(None)
.with_metadata(None)
.with_maximum_participants(50)
.with_experience_model_id(None)
.with_challenge_period_event_id('grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('matchmaking')
api_result = client.create_season_model_master({
namespaceName="namespace-0001",
name="season-0001",
description=nil,
metadata=nil,
maximumParticipants=50,
experienceModelId=nil,
challengePeriodEventId="grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('matchmaking')
api_result_handler = client.create_season_model_master_async({
namespaceName="namespace-0001",
name="season-0001",
description=nil,
metadata=nil,
maximumParticipants=50,
experienceModelId=nil,
challengePeriodEventId="grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0001",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;getSeasonModelMaster
シーズンモデルマスターを取得
指定されたシーズンモデルマスターの最大参加人数、経験値モデルID、チャレンジ期間イベントIDを含む情報を取得します。
詳細
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 | ||
| seasonName | string | ✓ | ~ 128文字 | シーズンモデル名 シーズンモデル固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
Result
| 型 | 説明 | |
|---|---|---|
| item | SeasonModelMaster | シーズンモデルマスター |
実装例
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.GetSeasonModelMaster(
&matchmaking.GetSeasonModelMasterRequest {
NamespaceName: pointy.String("namespace-0001"),
SeasonName: pointy.String("season-0001"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse 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\GetSeasonModelMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2MatchmakingRestClient(
$session
);
try {
$result = $client->getSeasonModelMaster(
(new GetSeasonModelMasterRequest())
->withNamespaceName("namespace-0001")
->withSeasonName("season-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.GetSeasonModelMasterRequest;
import io.gs2.matchmaking.result.GetSeasonModelMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);
try {
GetSeasonModelMasterResult result = client.getSeasonModelMaster(
new GetSeasonModelMasterRequest()
.withNamespaceName("namespace-0001")
.withSeasonName("season-0001")
);
SeasonModelMaster item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);
AsyncResult<Gs2.Gs2Matchmaking.Result.GetSeasonModelMasterResult> asyncResult = null;
yield return client.GetSeasonModelMaster(
new Gs2.Gs2Matchmaking.Request.GetSeasonModelMasterRequest()
.WithNamespaceName("namespace-0001")
.WithSeasonName("season-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.getSeasonModelMaster(
new Gs2Matchmaking.GetSeasonModelMasterRequest()
.withNamespaceName("namespace-0001")
.withSeasonName("season-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_season_model_master(
matchmaking.GetSeasonModelMasterRequest()
.with_namespace_name('namespace-0001')
.with_season_name('season-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('matchmaking')
api_result = client.get_season_model_master({
namespaceName="namespace-0001",
seasonName="season-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('matchmaking')
api_result_handler = client.get_season_model_master_async({
namespaceName="namespace-0001",
seasonName="season-0001",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;updateSeasonModelMaster
シーズンモデルマスターを更新
指定されたシーズンモデルマスターを更新します。説明、メタデータ、最大参加人数、経験値モデルID、チャレンジ期間イベントIDを変更できます。
詳細
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 | ||
| seasonName | string | ✓ | ~ 128文字 | シーズンモデル名 シーズンモデル固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 | ||
| description | string | ~ 1024文字 | 説明文 | |||
| metadata | string | ~ 128文字 | メタデータ メタデータには任意の値を設定できます。 これらの値は GS2 の動作には影響しないため、ゲーム内で利用する情報の保存先として使用できます。 | |||
| maximumParticipants | int | ✓ | 2 ~ 1000 | 最大参加人数 1つのシーズンギャザリングに参加可能なプレイヤーの最大人数。 この上限に達するとシーズンギャザリングは満員となり、それ以上のプレイヤーは参加できなくなります。 2 から 1000 の範囲で指定します。 | ||
| experienceModelId | string | ~ 1024文字 | ティアー管理用の経験値モデル GRN | |||
| challengePeriodEventId | string | ✓ | ~ 1024文字 | チャレンジ期間イベント GRN |
Result
| 型 | 説明 | |
|---|---|---|
| item | SeasonModelMaster | 更新したシーズンモデルマスター |
実装例
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.UpdateSeasonModelMaster(
&matchmaking.UpdateSeasonModelMasterRequest {
NamespaceName: pointy.String("namespace-0001"),
SeasonName: pointy.String("season-0001"),
Description: pointy.String("description1"),
Metadata: nil,
MaximumParticipants: pointy.Int32(100),
ExperienceModelId: nil,
ChallengePeriodEventId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0002"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse 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\UpdateSeasonModelMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2MatchmakingRestClient(
$session
);
try {
$result = $client->updateSeasonModelMaster(
(new UpdateSeasonModelMasterRequest())
->withNamespaceName("namespace-0001")
->withSeasonName("season-0001")
->withDescription("description1")
->withMetadata(null)
->withMaximumParticipants(100)
->withExperienceModelId(null)
->withChallengePeriodEventId("grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0002")
);
$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.UpdateSeasonModelMasterRequest;
import io.gs2.matchmaking.result.UpdateSeasonModelMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);
try {
UpdateSeasonModelMasterResult result = client.updateSeasonModelMaster(
new UpdateSeasonModelMasterRequest()
.withNamespaceName("namespace-0001")
.withSeasonName("season-0001")
.withDescription("description1")
.withMetadata(null)
.withMaximumParticipants(100)
.withExperienceModelId(null)
.withChallengePeriodEventId("grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0002")
);
SeasonModelMaster item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);
AsyncResult<Gs2.Gs2Matchmaking.Result.UpdateSeasonModelMasterResult> asyncResult = null;
yield return client.UpdateSeasonModelMaster(
new Gs2.Gs2Matchmaking.Request.UpdateSeasonModelMasterRequest()
.WithNamespaceName("namespace-0001")
.WithSeasonName("season-0001")
.WithDescription("description1")
.WithMetadata(null)
.WithMaximumParticipants(100)
.WithExperienceModelId(null)
.WithChallengePeriodEventId("grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0002"),
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.updateSeasonModelMaster(
new Gs2Matchmaking.UpdateSeasonModelMasterRequest()
.withNamespaceName("namespace-0001")
.withSeasonName("season-0001")
.withDescription("description1")
.withMetadata(null)
.withMaximumParticipants(100)
.withExperienceModelId(null)
.withChallengePeriodEventId("grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0002")
);
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_season_model_master(
matchmaking.UpdateSeasonModelMasterRequest()
.with_namespace_name('namespace-0001')
.with_season_name('season-0001')
.with_description('description1')
.with_metadata(None)
.with_maximum_participants(100)
.with_experience_model_id(None)
.with_challenge_period_event_id('grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0002')
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('matchmaking')
api_result = client.update_season_model_master({
namespaceName="namespace-0001",
seasonName="season-0001",
description="description1",
metadata=nil,
maximumParticipants=100,
experienceModelId=nil,
challengePeriodEventId="grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0002",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('matchmaking')
api_result_handler = client.update_season_model_master_async({
namespaceName="namespace-0001",
seasonName="season-0001",
description="description1",
metadata=nil,
maximumParticipants=100,
experienceModelId=nil,
challengePeriodEventId="grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0002",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;deleteSeasonModelMaster
シーズンモデルマスターを削除
指定されたシーズンモデルマスターを削除します。
次のマスターデータ更新まで、現在アクティブなマスターデータには影響しません。
詳細
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 | ||
| seasonName | string | ✓ | ~ 128文字 | シーズンモデル名 シーズンモデル固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。 |
Result
| 型 | 説明 | |
|---|---|---|
| item | SeasonModelMaster | 削除したシーズンモデルマスター |
実装例
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.DeleteSeasonModelMaster(
&matchmaking.DeleteSeasonModelMasterRequest {
NamespaceName: pointy.String("namespace-0001"),
SeasonName: pointy.String("season-0001"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse 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\DeleteSeasonModelMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2MatchmakingRestClient(
$session
);
try {
$result = $client->deleteSeasonModelMaster(
(new DeleteSeasonModelMasterRequest())
->withNamespaceName("namespace-0001")
->withSeasonName("season-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.DeleteSeasonModelMasterRequest;
import io.gs2.matchmaking.result.DeleteSeasonModelMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);
try {
DeleteSeasonModelMasterResult result = client.deleteSeasonModelMaster(
new DeleteSeasonModelMasterRequest()
.withNamespaceName("namespace-0001")
.withSeasonName("season-0001")
);
SeasonModelMaster item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);
AsyncResult<Gs2.Gs2Matchmaking.Result.DeleteSeasonModelMasterResult> asyncResult = null;
yield return client.DeleteSeasonModelMaster(
new Gs2.Gs2Matchmaking.Request.DeleteSeasonModelMasterRequest()
.WithNamespaceName("namespace-0001")
.WithSeasonName("season-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.deleteSeasonModelMaster(
new Gs2Matchmaking.DeleteSeasonModelMasterRequest()
.withNamespaceName("namespace-0001")
.withSeasonName("season-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_season_model_master(
matchmaking.DeleteSeasonModelMasterRequest()
.with_namespace_name('namespace-0001')
.with_season_name('season-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('matchmaking')
api_result = client.delete_season_model_master({
namespaceName="namespace-0001",
seasonName="season-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('matchmaking')
api_result_handler = client.delete_season_model_master_async({
namespaceName="namespace-0001",
seasonName="season-0001",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;