Social非同期イベントについて


ソーシャルゲーミング

Social非同期イベントについて

Socail非同期イベントとは、SocailAPIのコールバックによってトリガされたサブインベントです

このイベントは、様々なSocial API関数によってトリガし、そのコールバックにより変数"sync_load"に格納されたds_map(キー・値のペア)を返します。

The ds_map will contain a number of keys, the most important of which is the "id" key. This will return a constant which can then be checked in code to determine which of the many callbacks the event has received. Once you have parsed this key and compared the value returned with the available constants, you can then continue to extract the rest of the information from the map.

The function pages on Social Gaming - Achievements and Leaderboards in the Reference section detail the functions and callbacks as well as the constants used to trigger this event, but there are also certain circumstances in which it will be triggered without a function call from the game that is running:

  • when your game is launched from the OS dashboard
  • when you complete a challenge
  • when another player completes a challenge
  • when the game is started from the OS dashboard by selecting a challenge

Any of the above callbacks will trigger the Social Event and an async_load map will be generated with the following details (note that there is a different "id" key value to define each of the different reasons that the event was called, but all other contents of the map are the same):

  • id - このキーの値はイベントをトリガするコールバックのタイプに依存します。タイプは以下の定数のいずれかです:
    • achievement_challenge_received - チャレンジを受信した
    • achievement_challenge_completed - チャレンジを達成した
    • achievement_challenge_completed_by_remote - チャレンジを他のプレイヤーが達成した
    • achievement_challenge_launched - ゲームは指定のチャレンジからOSのダッシュボードを起動した
  • playerid - チャレンジしているプレイヤーID
  • issuerid - チャレンジを発行した人のID
  • state - チャレンジ状態。0〜3の文字列。0:無効 / 1:保留中 / 2:達成 / 3:減少
  • message - チャレンジを表現するテキストメッセージ
  • issueddate - チャレンジ発行日
  • completeddate - チャレンジ達成日
  • type - チャレンジの種別。以下の2つの定数のいずれか
    • achievement_type_score_challenge - スコアのチャレンジ
    • achievement_type_achievement_challenge - アチーブメントのチャレンジ
  • identifier - チャレンジの識別文字列
  • score - チャレンジのスコア

var ident = ds_map_find_value(async_load, "id" );
if ident == achievement_challenge_completed;
{
  player_id = ds_map_find_value(async_load, "playerid");
  issuer_id = ds_map_find_value(async_load, "issuerid");
  state = ds_map_find_value(async_load, "state");
  date_completed = ds_map_find_value(async_load, "completeddate");
  date_issued = ds_map_find_value(async_load, "issueddate");
  ach_type = ds_map_find_value(async_load, "type");
  ach_ident = ds_map_find_value(async_load, "identifier");
  ach_score = ds_map_find_value(async_load, "score");
}

注意

変数"async_load"は非同期イベントのみ有効です。 そしてds_mapはイベント開始時に作成され、イベント終了後-1にリセットされます。 ただしイベントにより作成されたすべてのデータ構造は、適切にクリーンアップ(削除)する必要があります。そうでないとメモリリークの原因となり、ゲームをクラッシュさせる可能性があります

Wiki内検索

#search(): You already view a search box

MENU

ドキュメント

GMLリファレンス

2ch

その他



最新の30件

2024-03-07 2023-08-09 2023-05-21 2023-05-20 2023-05-04 2022-10-13 2022-07-21 2022-07-02 2022-04-06 2021-11-30 2021-11-26 2021-10-03 2021-09-23 2021-08-15 2021-06-02 2021-01-23 2021-01-21 2021-01-19 2021-01-18 2021-01-16 2021-01-15

人気の10件

今日の10件



これまでの訪問者: 813
今日の訪問者: 2
昨日の訪問者: 1
閲覧者: 2