@gbraver-burst-network/browser-sdk 1.17.2 → 1.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/src/browser-sdk/battle-sdk-impl.d.ts +41 -0
- package/lib/src/browser-sdk/battle-sdk-impl.js +74 -0
- package/lib/src/browser-sdk/battle-sdk.d.ts +17 -33
- package/lib/src/browser-sdk/battle-sdk.js +0 -72
- package/lib/src/browser-sdk/casual-match.d.ts +2 -2
- package/lib/src/browser-sdk/create-battle-sdk-from-battle-start.js +2 -2
- package/lib/src/browser-sdk/private-match-room-sdk.d.ts +2 -2
- package/lib/src/browser-sdk/private-match.d.ts +3 -3
- package/lib/src/index.d.ts +1 -1
- package/package.json +7 -7
- package/lib/src/browser-sdk/battle.d.ts +0 -27
- package/lib/src/browser-sdk/battle.js +0 -2
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Command, GameState, Player } from "gbraver-burst-core";
|
|
2
|
+
import { Observable } from "rxjs";
|
|
3
|
+
import { BattleSDK } from "./battle-sdk";
|
|
4
|
+
/** コンストラクタのパラメータ */
|
|
5
|
+
type Param = {
|
|
6
|
+
/** プレイヤー情報 */
|
|
7
|
+
player: Player;
|
|
8
|
+
/** 敵情報 */
|
|
9
|
+
enemy: Player;
|
|
10
|
+
/** 初期ステート */
|
|
11
|
+
initialState: GameState[];
|
|
12
|
+
/** バトルID */
|
|
13
|
+
battleID: string;
|
|
14
|
+
/** 初期フローID */
|
|
15
|
+
initialFlowID: string;
|
|
16
|
+
/** ポーリング担当か否か、trueでポーリング担当 */
|
|
17
|
+
isPoller: boolean;
|
|
18
|
+
/** websocketクライアント */
|
|
19
|
+
websocket: WebSocket;
|
|
20
|
+
};
|
|
21
|
+
/** バトルSDKの実装 */
|
|
22
|
+
export declare class BattleSDKImpl implements BattleSDK {
|
|
23
|
+
#private;
|
|
24
|
+
/** @override */
|
|
25
|
+
readonly player: Player;
|
|
26
|
+
/** @override */
|
|
27
|
+
readonly enemy: Player;
|
|
28
|
+
/** @override */
|
|
29
|
+
readonly initialState: GameState[];
|
|
30
|
+
/**
|
|
31
|
+
* コンストラクタ
|
|
32
|
+
*
|
|
33
|
+
* @param param パラメータ
|
|
34
|
+
*/
|
|
35
|
+
constructor(param: Param);
|
|
36
|
+
/** @override */
|
|
37
|
+
progress(command: Command): Promise<GameState[]>;
|
|
38
|
+
/** @override */
|
|
39
|
+
suddenlyBattleEndNotifier(): Observable<unknown>;
|
|
40
|
+
}
|
|
41
|
+
export {};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
12
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
13
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
14
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
15
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
16
|
+
};
|
|
17
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
18
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
19
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
20
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
21
|
+
};
|
|
22
|
+
var _BattleSDKImpl_websocket, _BattleSDKImpl_battleID, _BattleSDKImpl_flowID, _BattleSDKImpl_isPoller, _BattleSDKImpl_suddenlyBattleEnd;
|
|
23
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
+
exports.BattleSDKImpl = void 0;
|
|
25
|
+
const rxjs_1 = require("rxjs");
|
|
26
|
+
const parse_1 = require("../json/parse");
|
|
27
|
+
const suddenly_battle_end_1 = require("../response/suddenly-battle-end");
|
|
28
|
+
const send_command_1 = require("../websocket/send-command");
|
|
29
|
+
/** バトルSDKの実装 */
|
|
30
|
+
class BattleSDKImpl {
|
|
31
|
+
/**
|
|
32
|
+
* コンストラクタ
|
|
33
|
+
*
|
|
34
|
+
* @param param パラメータ
|
|
35
|
+
*/
|
|
36
|
+
constructor(param) {
|
|
37
|
+
/** websocketクライアント */
|
|
38
|
+
_BattleSDKImpl_websocket.set(this, void 0);
|
|
39
|
+
/** バトルID */
|
|
40
|
+
_BattleSDKImpl_battleID.set(this, void 0);
|
|
41
|
+
/** フローID */
|
|
42
|
+
_BattleSDKImpl_flowID.set(this, void 0);
|
|
43
|
+
/** ポーリング実行プレイヤーであるか否か、trueでポーリングする */
|
|
44
|
+
_BattleSDKImpl_isPoller.set(this, void 0);
|
|
45
|
+
/** バトル突然終了通知ストリーム */
|
|
46
|
+
_BattleSDKImpl_suddenlyBattleEnd.set(this, void 0);
|
|
47
|
+
this.player = param.player;
|
|
48
|
+
this.enemy = param.enemy;
|
|
49
|
+
this.initialState = param.initialState;
|
|
50
|
+
__classPrivateFieldSet(this, _BattleSDKImpl_websocket, param.websocket, "f");
|
|
51
|
+
__classPrivateFieldSet(this, _BattleSDKImpl_battleID, param.battleID, "f");
|
|
52
|
+
__classPrivateFieldSet(this, _BattleSDKImpl_flowID, param.initialFlowID, "f");
|
|
53
|
+
__classPrivateFieldSet(this, _BattleSDKImpl_isPoller, param.isPoller, "f");
|
|
54
|
+
__classPrivateFieldSet(this, _BattleSDKImpl_suddenlyBattleEnd, (0, rxjs_1.fromEvent)(__classPrivateFieldGet(this, _BattleSDKImpl_websocket, "f"), "message").pipe((0, rxjs_1.map)((e) => e), (0, rxjs_1.map)((e) => (0, parse_1.parseJSON)(e.data)), (0, rxjs_1.filter)((data) => data), (0, rxjs_1.map)((data) => (0, suddenly_battle_end_1.parseSuddenlyBattleEnd)(data)), (0, rxjs_1.filter)((sudenlyBattleEnd) => !!sudenlyBattleEnd)), "f");
|
|
55
|
+
}
|
|
56
|
+
/** @override */
|
|
57
|
+
progress(command) {
|
|
58
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
59
|
+
const result = __classPrivateFieldGet(this, _BattleSDKImpl_isPoller, "f")
|
|
60
|
+
? yield (0, send_command_1.sendCommandWithPolling)(__classPrivateFieldGet(this, _BattleSDKImpl_websocket, "f"), __classPrivateFieldGet(this, _BattleSDKImpl_battleID, "f"), __classPrivateFieldGet(this, _BattleSDKImpl_flowID, "f"), command)
|
|
61
|
+
: yield (0, send_command_1.sendCommand)(__classPrivateFieldGet(this, _BattleSDKImpl_websocket, "f"), __classPrivateFieldGet(this, _BattleSDKImpl_battleID, "f"), __classPrivateFieldGet(this, _BattleSDKImpl_flowID, "f"), command);
|
|
62
|
+
if (result.action === "battle-progressed") {
|
|
63
|
+
__classPrivateFieldSet(this, _BattleSDKImpl_flowID, result.flowID, "f");
|
|
64
|
+
}
|
|
65
|
+
return result.update;
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
/** @override */
|
|
69
|
+
suddenlyBattleEndNotifier() {
|
|
70
|
+
return __classPrivateFieldGet(this, _BattleSDKImpl_suddenlyBattleEnd, "f");
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
exports.BattleSDKImpl = BattleSDKImpl;
|
|
74
|
+
_BattleSDKImpl_websocket = new WeakMap(), _BattleSDKImpl_battleID = new WeakMap(), _BattleSDKImpl_flowID = new WeakMap(), _BattleSDKImpl_isPoller = new WeakMap(), _BattleSDKImpl_suddenlyBattleEnd = new WeakMap();
|
|
@@ -1,41 +1,25 @@
|
|
|
1
|
-
import { Command, GameState, Player } from "gbraver-burst-core";
|
|
1
|
+
import type { Command, GameState, Player } from "gbraver-burst-core";
|
|
2
2
|
import { Observable } from "rxjs";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
/**
|
|
4
|
+
* バトルSDK
|
|
5
|
+
* 本操作はログイン後に実行することを想定している
|
|
6
|
+
*/
|
|
7
|
+
export interface BattleSDK {
|
|
8
|
+
/** プレイヤーの情報 */
|
|
7
9
|
player: Player;
|
|
8
|
-
/**
|
|
10
|
+
/** 対戦相手の情報 */
|
|
9
11
|
enemy: Player;
|
|
10
|
-
/**
|
|
12
|
+
/** ゲームの初期状態 */
|
|
11
13
|
initialState: GameState[];
|
|
12
|
-
/** バトルID */
|
|
13
|
-
battleID: string;
|
|
14
|
-
/** 初期フローID */
|
|
15
|
-
initialFlowID: string;
|
|
16
|
-
/** ポーリング担当か否か、trueでポーリング担当 */
|
|
17
|
-
isPoller: boolean;
|
|
18
|
-
/** websocketクライアント */
|
|
19
|
-
websocket: WebSocket;
|
|
20
|
-
};
|
|
21
|
-
/** バトルSDK */
|
|
22
|
-
export declare class BattleSDK implements Battle {
|
|
23
|
-
#private;
|
|
24
|
-
/** @override */
|
|
25
|
-
readonly player: Player;
|
|
26
|
-
/** @override */
|
|
27
|
-
readonly enemy: Player;
|
|
28
|
-
/** @override */
|
|
29
|
-
readonly initialState: GameState[];
|
|
30
14
|
/**
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
* @
|
|
15
|
+
* バトルを進行させる
|
|
16
|
+
* @param command プレイヤーが入力するコマンド
|
|
17
|
+
* @returns ゲーム結果
|
|
34
18
|
*/
|
|
35
|
-
constructor(param: Param);
|
|
36
|
-
/** @override */
|
|
37
19
|
progress(command: Command): Promise<GameState[]>;
|
|
38
|
-
/**
|
|
39
|
-
|
|
20
|
+
/**
|
|
21
|
+
* バトル強制終了の通知ストリーム
|
|
22
|
+
* @returns 通知ストリーム
|
|
23
|
+
*/
|
|
24
|
+
suddenlyBattleEndNotifier(): Observable<unknown>;
|
|
40
25
|
}
|
|
41
|
-
export {};
|
|
@@ -1,74 +1,2 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
12
|
-
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
13
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
14
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
15
|
-
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
16
|
-
};
|
|
17
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
18
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
19
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
20
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
21
|
-
};
|
|
22
|
-
var _BattleSDK_websocket, _BattleSDK_battleID, _BattleSDK_flowID, _BattleSDK_isPoller, _BattleSDK_suddenlyBattleEnd;
|
|
23
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
-
exports.BattleSDK = void 0;
|
|
25
|
-
const rxjs_1 = require("rxjs");
|
|
26
|
-
const parse_1 = require("../json/parse");
|
|
27
|
-
const suddenly_battle_end_1 = require("../response/suddenly-battle-end");
|
|
28
|
-
const send_command_1 = require("../websocket/send-command");
|
|
29
|
-
/** バトルSDK */
|
|
30
|
-
class BattleSDK {
|
|
31
|
-
/**
|
|
32
|
-
* コンストラクタ
|
|
33
|
-
*
|
|
34
|
-
* @param param パラメータ
|
|
35
|
-
*/
|
|
36
|
-
constructor(param) {
|
|
37
|
-
/** websocketクライアント */
|
|
38
|
-
_BattleSDK_websocket.set(this, void 0);
|
|
39
|
-
/** バトルID */
|
|
40
|
-
_BattleSDK_battleID.set(this, void 0);
|
|
41
|
-
/** フローID */
|
|
42
|
-
_BattleSDK_flowID.set(this, void 0);
|
|
43
|
-
/** ポーリング実行プレイヤーであるか否か、trueでポーリングする */
|
|
44
|
-
_BattleSDK_isPoller.set(this, void 0);
|
|
45
|
-
/** バトル突然終了通知ストリーム */
|
|
46
|
-
_BattleSDK_suddenlyBattleEnd.set(this, void 0);
|
|
47
|
-
this.player = param.player;
|
|
48
|
-
this.enemy = param.enemy;
|
|
49
|
-
this.initialState = param.initialState;
|
|
50
|
-
__classPrivateFieldSet(this, _BattleSDK_websocket, param.websocket, "f");
|
|
51
|
-
__classPrivateFieldSet(this, _BattleSDK_battleID, param.battleID, "f");
|
|
52
|
-
__classPrivateFieldSet(this, _BattleSDK_flowID, param.initialFlowID, "f");
|
|
53
|
-
__classPrivateFieldSet(this, _BattleSDK_isPoller, param.isPoller, "f");
|
|
54
|
-
__classPrivateFieldSet(this, _BattleSDK_suddenlyBattleEnd, (0, rxjs_1.fromEvent)(__classPrivateFieldGet(this, _BattleSDK_websocket, "f"), "message").pipe((0, rxjs_1.map)((e) => e), (0, rxjs_1.map)((e) => (0, parse_1.parseJSON)(e.data)), (0, rxjs_1.filter)((data) => data), (0, rxjs_1.map)((data) => (0, suddenly_battle_end_1.parseSuddenlyBattleEnd)(data)), (0, rxjs_1.filter)((sudenlyBattleEnd) => !!sudenlyBattleEnd)), "f");
|
|
55
|
-
}
|
|
56
|
-
/** @override */
|
|
57
|
-
progress(command) {
|
|
58
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
59
|
-
const result = __classPrivateFieldGet(this, _BattleSDK_isPoller, "f")
|
|
60
|
-
? yield (0, send_command_1.sendCommandWithPolling)(__classPrivateFieldGet(this, _BattleSDK_websocket, "f"), __classPrivateFieldGet(this, _BattleSDK_battleID, "f"), __classPrivateFieldGet(this, _BattleSDK_flowID, "f"), command)
|
|
61
|
-
: yield (0, send_command_1.sendCommand)(__classPrivateFieldGet(this, _BattleSDK_websocket, "f"), __classPrivateFieldGet(this, _BattleSDK_battleID, "f"), __classPrivateFieldGet(this, _BattleSDK_flowID, "f"), command);
|
|
62
|
-
if (result.action === "battle-progressed") {
|
|
63
|
-
__classPrivateFieldSet(this, _BattleSDK_flowID, result.flowID, "f");
|
|
64
|
-
}
|
|
65
|
-
return result.update;
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
/** @override */
|
|
69
|
-
suddenlyBattleNotifier() {
|
|
70
|
-
return __classPrivateFieldGet(this, _BattleSDK_suddenlyBattleEnd, "f");
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
exports.BattleSDK = BattleSDK;
|
|
74
|
-
_BattleSDK_websocket = new WeakMap(), _BattleSDK_battleID = new WeakMap(), _BattleSDK_flowID = new WeakMap(), _BattleSDK_isPoller = new WeakMap(), _BattleSDK_suddenlyBattleEnd = new WeakMap();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ArmdozerId, PilotId } from "gbraver-burst-core";
|
|
2
|
-
import type {
|
|
2
|
+
import type { BattleSDK } from "./battle-sdk";
|
|
3
3
|
/**
|
|
4
4
|
* カジュアルマッチ
|
|
5
5
|
* 本操作はログイン後に実行することを想定している
|
|
@@ -12,5 +12,5 @@ export interface CasualMatch {
|
|
|
12
12
|
* @param pilotId 選択したパイロットID
|
|
13
13
|
* @returns バトル
|
|
14
14
|
*/
|
|
15
|
-
startCasualMatch(armdozerId: ArmdozerId, pilotId: PilotId): Promise<
|
|
15
|
+
startCasualMatch(armdozerId: ArmdozerId, pilotId: PilotId): Promise<BattleSDK>;
|
|
16
16
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createBattleSDKFromBattleStart = createBattleSDKFromBattleStart;
|
|
4
|
-
const
|
|
4
|
+
const battle_sdk_impl_1 = require("./battle-sdk-impl");
|
|
5
5
|
/**
|
|
6
6
|
* BattleStartからBattleSDKを生成する
|
|
7
7
|
* @param battleStart BattleStartのデータ
|
|
@@ -9,7 +9,7 @@ const battle_sdk_1 = require("./battle-sdk");
|
|
|
9
9
|
* @returns 生成結果
|
|
10
10
|
*/
|
|
11
11
|
function createBattleSDKFromBattleStart(battleStart, websocket) {
|
|
12
|
-
return new
|
|
12
|
+
return new battle_sdk_impl_1.BattleSDKImpl({
|
|
13
13
|
player: battleStart.player,
|
|
14
14
|
enemy: battleStart.enemy,
|
|
15
15
|
initialState: battleStart.stateHistory,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BattleSDK } from "./battle-sdk";
|
|
2
2
|
import { PrivateMatchRoom, PrivateMatchRoomID } from "./private-match";
|
|
3
3
|
/** プライベートマッチSDK */
|
|
4
4
|
export declare class PrivateMatchRoomSDK implements PrivateMatchRoom {
|
|
@@ -12,5 +12,5 @@ export declare class PrivateMatchRoomSDK implements PrivateMatchRoom {
|
|
|
12
12
|
*/
|
|
13
13
|
constructor(roomID: PrivateMatchRoomID, websocket: WebSocket);
|
|
14
14
|
/** @override */
|
|
15
|
-
waitUntilMatching(): Promise<
|
|
15
|
+
waitUntilMatching(): Promise<BattleSDK>;
|
|
16
16
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ArmdozerId, PilotId } from "gbraver-burst-core";
|
|
2
|
-
import {
|
|
2
|
+
import { BattleSDK } from "./battle-sdk";
|
|
3
3
|
/** プライベートマッチルーム生成 */
|
|
4
4
|
export interface PrivateMatchCreate {
|
|
5
5
|
/**
|
|
@@ -20,7 +20,7 @@ export interface PrivateMatchRoom {
|
|
|
20
20
|
* マッチングが成立するまで待機する
|
|
21
21
|
* @returns バトル
|
|
22
22
|
*/
|
|
23
|
-
waitUntilMatching(): Promise<
|
|
23
|
+
waitUntilMatching(): Promise<BattleSDK>;
|
|
24
24
|
}
|
|
25
25
|
/** プライベートマッチルーム入室 */
|
|
26
26
|
export interface PrivateMatchRoomEnter {
|
|
@@ -32,5 +32,5 @@ export interface PrivateMatchRoomEnter {
|
|
|
32
32
|
* @param pilotId 選択したパイロット
|
|
33
33
|
* @returns マッチング結果
|
|
34
34
|
*/
|
|
35
|
-
enterPrivateMatchRoom(roomID: PrivateMatchRoomID, armdozerId: ArmdozerId, pilotId: PilotId): Promise<
|
|
35
|
+
enterPrivateMatchRoom(roomID: PrivateMatchRoomID, armdozerId: ArmdozerId, pilotId: PilotId): Promise<BattleSDK | null>;
|
|
36
36
|
}
|
package/lib/src/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { BrowserSDK, createBrowserSDK } from "./browser-sdk";
|
|
2
|
-
export {
|
|
2
|
+
export { BattleSDK } from "./browser-sdk/battle-sdk";
|
|
3
3
|
export { CasualMatch } from "./browser-sdk/casual-match";
|
|
4
4
|
export { LoginCheck, Logout, UniversalLogin } from "./browser-sdk/login";
|
|
5
5
|
export { Ping } from "./browser-sdk/ping";
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gbraver-burst-network/browser-sdk",
|
|
3
3
|
"description": "gbraver burst browser sdk",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.19.0",
|
|
5
5
|
"author": "Y.Takeuchi",
|
|
6
6
|
"bugs": {
|
|
7
7
|
"url": "https://github.com/kaidouji85/gbraver-burst-network/issues",
|
|
@@ -14,19 +14,19 @@
|
|
|
14
14
|
"devDependencies": {
|
|
15
15
|
"@types/jest": "^30.0.0",
|
|
16
16
|
"dependency-cruiser": "^17.0.1",
|
|
17
|
-
"eslint": "^9.
|
|
17
|
+
"eslint": "^9.36.0",
|
|
18
18
|
"eslint-plugin-jest": "^29.0.1",
|
|
19
19
|
"eslint-plugin-simple-import-sort": "^12.1.1",
|
|
20
20
|
"gbraver-burst-core": "*",
|
|
21
|
-
"jest": "^30.
|
|
21
|
+
"jest": "^30.2.0",
|
|
22
22
|
"npm-run-all": "^4.1.5",
|
|
23
23
|
"prettier": "3.6.2",
|
|
24
24
|
"rimraf": "^6.0.1",
|
|
25
|
-
"ts-jest": "^29.4.
|
|
26
|
-
"typescript-eslint": "^8.44.
|
|
25
|
+
"ts-jest": "^29.4.4",
|
|
26
|
+
"typescript-eslint": "^8.44.1",
|
|
27
27
|
"webpack": "^5.101.3",
|
|
28
28
|
"webpack-cli": "^6.0.1",
|
|
29
|
-
"zod": "^4.1.
|
|
29
|
+
"zod": "^4.1.11"
|
|
30
30
|
},
|
|
31
31
|
"files": [
|
|
32
32
|
"lib"
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"main": "lib/src/index.js",
|
|
43
43
|
"peerDependencies": {
|
|
44
44
|
"gbraver-burst-core": "^1.41.0",
|
|
45
|
-
"zod": "^4.1.
|
|
45
|
+
"zod": "^4.1.11"
|
|
46
46
|
},
|
|
47
47
|
"repository": "https://github.com/kaidouji85/gbraver-burst-network/tree/develop/packages/browser-sdk",
|
|
48
48
|
"scripts": {
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import type { Command, GameState, Player } from "gbraver-burst-core";
|
|
2
|
-
import { Observable } from "rxjs";
|
|
3
|
-
/**
|
|
4
|
-
* バトル
|
|
5
|
-
* 本操作はログイン後に実行することを想定している
|
|
6
|
-
*/
|
|
7
|
-
export interface Battle {
|
|
8
|
-
/** プレイヤーの情報 */
|
|
9
|
-
player: Player;
|
|
10
|
-
/** 対戦相手の情報 */
|
|
11
|
-
enemy: Player;
|
|
12
|
-
/** ゲームの初期状態 */
|
|
13
|
-
initialState: GameState[];
|
|
14
|
-
/**
|
|
15
|
-
* バトルを進行させる
|
|
16
|
-
*
|
|
17
|
-
* @param command プレイヤーが入力するコマンド
|
|
18
|
-
* @returns ゲーム結果
|
|
19
|
-
*/
|
|
20
|
-
progress(command: Command): Promise<GameState[]>;
|
|
21
|
-
/**
|
|
22
|
-
* バトル強制終了の通知ストリーム
|
|
23
|
-
*
|
|
24
|
-
* @returns 通知ストリーム
|
|
25
|
-
*/
|
|
26
|
-
suddenlyBattleNotifier(): Observable<unknown>;
|
|
27
|
-
}
|