@akashic/akashic-engine
Advanced tools
Comparing version 3.0.1 to 3.0.2
# ChangeLog | ||
## 3.0.2 | ||
* @akashic/pdi-types@1.1.1 に更新 | ||
* `g.Player#id` の型を `string | undefined` に修正 | ||
## 3.0.1 | ||
@@ -4,0 +8,0 @@ |
@@ -20,3 +20,3 @@ import * as pl from "@akashic/playlog"; | ||
game: EventConverterParameterObejctGameLike; | ||
playerId: string; | ||
playerId?: string; | ||
} | ||
@@ -29,3 +29,3 @@ /** | ||
_game: EventConverterParameterObejctGameLike; | ||
_playerId: string; | ||
_playerId: string | null; | ||
_playerTable: { | ||
@@ -32,0 +32,0 @@ [key: string]: Player; |
@@ -14,4 +14,5 @@ "use strict"; | ||
function EventConverter(param) { | ||
var _a; | ||
this._game = param.game; | ||
this._playerId = param.playerId; | ||
this._playerId = (_a = param.playerId) !== null && _a !== void 0 ? _a : null; | ||
this._playerTable = {}; | ||
@@ -141,2 +142,3 @@ } | ||
EventConverter.prototype.toPlaylogEvent = function (e, preservePlayer) { | ||
var _a, _b, _c, _d, _e, _f, _g; | ||
var targetId; | ||
@@ -151,3 +153,3 @@ var playerId; | ||
var ts = e; | ||
playerId = preservePlayer ? ts.player.id : this._playerId; | ||
playerId = preservePlayer ? (_a = ts.player.id) !== null && _a !== void 0 ? _a : null : this._playerId; | ||
return [ | ||
@@ -161,3 +163,3 @@ 2 /* Timestamp */, | ||
var playerInfo = e; | ||
playerId = preservePlayer ? playerInfo.player.id : this._playerId; | ||
playerId = preservePlayer ? (_b = playerInfo.player.id) !== null && _b !== void 0 ? _b : null : this._playerId; | ||
return [ | ||
@@ -173,3 +175,3 @@ 3 /* PlayerInfo */, | ||
targetId = pointDown.target ? pointDown.target.id : null; | ||
playerId = preservePlayer && pointDown.player ? pointDown.player.id : this._playerId; | ||
playerId = preservePlayer && pointDown.player ? (_c = pointDown.player.id) !== null && _c !== void 0 ? _c : null : this._playerId; | ||
return [ | ||
@@ -188,3 +190,3 @@ 33 /* PointDown */, | ||
targetId = pointMove.target ? pointMove.target.id : null; | ||
playerId = preservePlayer && pointMove.player ? pointMove.player.id : this._playerId; | ||
playerId = preservePlayer && pointMove.player ? (_d = pointMove.player.id) !== null && _d !== void 0 ? _d : null : this._playerId; | ||
return [ | ||
@@ -207,3 +209,3 @@ 34 /* PointMove */, | ||
targetId = pointUp.target ? pointUp.target.id : null; | ||
playerId = preservePlayer && pointUp.player ? pointUp.player.id : this._playerId; | ||
playerId = preservePlayer && pointUp.player ? (_e = pointUp.player.id) !== null && _e !== void 0 ? _e : null : this._playerId; | ||
return [ | ||
@@ -225,3 +227,3 @@ 35 /* PointUp */, | ||
var message = e; | ||
playerId = preservePlayer && message.player ? message.player.id : this._playerId; | ||
playerId = preservePlayer && message.player ? (_f = message.player.id) !== null && _f !== void 0 ? _f : null : this._playerId; | ||
return [ | ||
@@ -236,3 +238,3 @@ 32 /* Message */, | ||
var op = e; | ||
playerId = preservePlayer && op.player ? op.player.id : this._playerId; | ||
playerId = preservePlayer && op.player ? (_g = op.player.id) !== null && _g !== void 0 ? _g : null : this._playerId; | ||
return [ | ||
@@ -239,0 +241,0 @@ 64 /* Operation */, |
@@ -374,2 +374,5 @@ import { Asset, CommonOffset, CommonSize, Renderer, ResourceFactory, ScriptAssetRuntimeValueBase, PlatformPointEvent, OperationPluginViewInfo } from "@akashic/pdi-types"; | ||
* ゲームにjoinしているプレイヤーIDの一覧。 | ||
* | ||
* 歴史的経緯により `undefined` は含まれないことに注意。 | ||
* `undefined` は特殊はプレイヤーIDであり通常 join しないため、ゲーム開発者がこの仕様を考慮する必要はない。 | ||
*/ | ||
@@ -376,0 +379,0 @@ joinedPlayerIds: string[]; |
@@ -889,4 +889,5 @@ "use strict"; | ||
Game.prototype._handleJoinEvent = function (event) { | ||
if (this.joinedPlayerIds.indexOf(event.player.id) !== -1) | ||
if (!event.player.id || this.joinedPlayerIds.indexOf(event.player.id) !== -1) { | ||
return; | ||
} | ||
this.joinedPlayerIds.push(event.player.id); | ||
@@ -893,0 +894,0 @@ }; |
@@ -5,5 +5,5 @@ /** | ||
export interface Player { | ||
id: string; | ||
id?: string; | ||
name?: string; | ||
userData?: any; | ||
} |
{ | ||
"name": "@akashic/akashic-engine", | ||
"version": "3.0.1", | ||
"version": "3.0.2", | ||
"description": "The core library of Akashic Engine", | ||
"main": "index.js", | ||
"dependencies": { | ||
"@akashic/pdi-types": "~1.1.0", | ||
"@akashic/pdi-types": "~1.1.1", | ||
"@akashic/playlog": "~3.1.0", | ||
@@ -9,0 +9,0 @@ "@akashic/trigger": "~1.0.0" |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
1230439
24709
Updated@akashic/pdi-types@~1.1.1