Security News
38% of CISOs Fear They’re Not Moving Fast Enough on AI
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
@akashic/playlog
Advanced tools
The interface definition of Playlog, the serialization format of Akashic game execution
Akashicのゲームの実行ログの仕様及び、TypeScriptの型定義を提供します。 本リポジトリは型の定義のみを提供しています。 Akashic Engineの詳細な利用方法については、 公式ページ を参照してください。
Event
、 Tick
の仕様を定義します。
これらは、通信路を流れる際のオーバヘッドを少なくするため、配列型のデータとなっています。
オプショナル が YES となっているものは、 null
又は配列末尾のデータであれば省略することができます。
numberは数値型、stringは文字列型を表します。
Event
はゲームに発生した出来事を表すデータです。
EventCode | イベント |
---|---|
0x0 | プレイヤー参加 |
0x1 | プレイヤー離脱 |
0x2 | 時間の記録 |
0x3 | プレイヤー情報 |
0x20 | 汎用的なデータ |
0x21 | ポイントダウン |
0x22 | ポイントムーブ |
0x23 | ポイントアップ |
0x40 | 操作プラグイン |
Event
共通のデータ・フォーマットは以下のようになります。
Index | 型 | オプショナル | 説明 |
---|---|---|---|
0 | number | NO | EventCode |
1 | number | NO | イベントフラグ |
2 | string | NO | プレイヤーID |
インデックス2番以降は各イベントのデータがセットされます。
EventFlags
は以下のビットフラグをからなる数値を表します。
下位ビット | 説明 |
---|---|
0 | プライオリティ |
1 | プライオリティ |
2 | 予約フィールド |
3 | 非永続化フラグ |
4 | 省略可能フラグ |
下位0ビット目と1ビット目はプライオリティを表します。
下位3ビット目は非永続化フラグを表します。このビットが1の場合、対象のイベントは永続化されないことを許容します。
下位4ビット目は省略可能フラグを表します。このビットが1の場合、対象のイベントは任意のタイミングで欠落しうること許容します。
プレイヤーの参加イベントを表します。
Index | 型 | オプショナル | 説明 |
---|---|---|---|
3 | string | NO | プレイヤー名 |
4 | StorageData[] | YES | ストレージデータ |
StorageData[]
は 参加したプレイヤーに紐づくデータを表します。
StorageData
のデータ・フォーマットは TypeScriptの型定義 を参照してください。
プレイヤーの離脱イベントを表します。
時間の記録を表すイベントです。
Index | 型 | オプショナル | 説明 |
---|---|---|---|
3 | number | NO | 時間を示す値 |
時間を示す値同士を比較したときに、大きい値が未来の時間を表します。
プレイヤーの情報を表すイベントです。
Index | 型 | オプショナル | 説明 |
---|---|---|---|
3 | string | NO | プレイヤー名 |
4 | any | YES | ユーザ定義データ |
汎用的なデータを表すイベントを表します。
Index | 型 | オプショナル | 説明 |
---|---|---|---|
3 | any | NO | 汎用的なデータ |
ポイントダウンイベントを表します。
Index | 型 | オプショナル | 説明 |
---|---|---|---|
3 | number | NO | ポインターID |
4 | number | NO | X座標 |
5 | number | NO | Y座標 |
6 | number | YES | エンティティID |
7 | button | YES | ボタンの種類 |
ポイントムーブイベントを表します。
Index | 型 | オプショナル | 説明 |
---|---|---|---|
3 | number | NO | ポインターID |
4 | number | NO | X座標 |
5 | number | NO | Y座標 |
6 | number | NO | ポイントダウンイベントからのX座標の差 |
7 | number | NO | ポイントダウンイベントからのY座標の差 |
8 | number | NO | 直前のポイントムーブイベントからのX座標の差 |
9 | number | NO | 直前のポイントムーブイベントからのY座標の差 |
10 | number | YES | エンティティID |
ポイントアップイベントを表します。
Index | 型 | オプショナル | 説明 |
---|---|---|---|
3 | number | NO | ポインターID |
4 | number | NO | X座標 |
5 | number | NO | Y座標 |
6 | number | NO | ポイントダウンイベントからのX座標の差 |
7 | number | NO | ポイントダウンイベントからのY座標の差 |
8 | number | NO | 直前のポイントムーブイベントからのX座標の差 |
9 | number | NO | 直前のポイントムーブイベントからのY座標の差 |
10 | number | YES | エンティティID |
操作プラグインイベントを表します。
Index | 型 | オプショナル | 説明 |
---|---|---|---|
3 | number | NO | 操作プラグインコード |
4 | (number|string)[] | NO | 操作プラグインデータ |
Tick
はゲームの1フレームを実行するために必要なデータです。
Index | 型 | オプショナル | 説明 |
---|---|---|---|
0 | number | NO | フレーム番号 |
1 | Event[] | YES | イベント |
2 | StorageData[] | YES | ストレージデータ |
StorageData
のデータ・フォーマットは TypeScriptの型定義 を参照してください。
Tick
は通信路を流れる際に、以下のような最適化を実施することが望まれます。
Tick
にフレーム番号しか含まない場合は、配列ではなくフレーム番号(number)のみを送信します。
TickList
はフレーム番号の続く複数の Tick
を表します。
Index | 型 | オプショナル | 説明 |
---|---|---|---|
0 | number | NO | 開始フレーム番号 |
1 | number | NO | 終了フレーム番号 |
2 | Tick[] | YES | Tick[1]又はTick[2]が存在するTick |
npm install @akashic/playlog
import * as playlog from "@akashic/playlog";
cd test
tsc
本リポジトリは MIT License の元で公開されています。 詳しくは LICENSE をご覧ください。
ただし、画像ファイルおよび音声ファイルは CC BY 2.1 JP の元で公開されています。
3.2.0
FAQs
The interface definition of Playlog, the serialization format of Akashic game execution
The npm package @akashic/playlog receives a total of 0 weekly downloads. As such, @akashic/playlog popularity was classified as not popular.
We found that @akashic/playlog demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.
Security News
Company News
Socket is joining TC54 to help develop standards for software supply chain security, contributing to the evolution of SBOMs, CycloneDX, and Package URL specifications.