@uzuhq/code-sdk 0.8.1 → 0.8.2
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/dist/dev-globals.d.ts
CHANGED
|
@@ -125,6 +125,16 @@ declare const plus: (t: GameTime, d: Duration) => GameTime;
|
|
|
125
125
|
declare const sub: (t: GameTime, d: Duration) => GameTime;
|
|
126
126
|
/** 2 つの `GameTime` の差 (ms)。 */
|
|
127
127
|
declare const minus: (a: GameTime, b: GameTime) => Duration;
|
|
128
|
+
/**
|
|
129
|
+
* ゲーム内時計の原点。ゲーム開始の瞬間で、`setup()` の `ctx.time` と同じ値。
|
|
130
|
+
*
|
|
131
|
+
* `minus(t, GAME_START)` がゲーム開始からの経過 ms になる。表示やログのために
|
|
132
|
+
* 素の数値が要る場面は、これを使えば cast を書かずに済む。
|
|
133
|
+
*
|
|
134
|
+
* `toMs` を公開しないのは `toMs(a) - toMs(b)` と書けて保護が丸ごと消えるためだが、
|
|
135
|
+
* `GAME_START` にその使い方は無い。差を取るには結局 `minus` を通る。
|
|
136
|
+
*/
|
|
137
|
+
declare const GAME_START: GameTime;
|
|
128
138
|
//#endregion
|
|
129
139
|
//#region ../engine-core/src/types.d.ts
|
|
130
140
|
/**
|
|
@@ -728,4 +738,4 @@ interface DevHooksCtx<S = unknown> {
|
|
|
728
738
|
declare function createDevHooks<S>(ctx: DevHooksCtx<S>): UzuDevHooks<S>;
|
|
729
739
|
declare function attachDevHooks<S>(ctx: DevHooksCtx<S>): void;
|
|
730
740
|
//#endregion
|
|
731
|
-
export {
|
|
741
|
+
export { GameTime as $, DEFAULT_ICON_URLS as A, ServerActionContext as B, SetFn as C, ActionContext as D, ActionArgs as E, GameLogic as F, ServerOnlyActionContext as G, ServerActionMap as H, SERVER_TIME as I, SetupContext as J, ServerOnlyActionHandlerFn as K, Seat as L, DeadlineArgs as M, DeadlineContext as N, ActionHandler as O, Emit as P, GAME_START as Q, SeededRandom as R, SendAction as S, Operation as T, ServerEvent as U, ServerActionHandler as V, ServerOnlyAction as W, UpdateContext as X, UpdateArgs as Y, Duration as Z, PayloadMap as _, attachDevHooks as a, applyJsonMergePatch as at, PlayersChangedMessage as b, getPredictionWarnings as c, ConnectionCallbacks as d, minus as et, ConnectionState as f, PatchFn as g, GameConfig as h, UzuDevHooks as i, JsonPatchOp as it, Deadline as j, ActionMap as k, BridgeChannel as l, EventSubscription as m, RunHandle as n, sub as nt, createDevHooks as o, applyJsonPatch as ot, EventHandler as p, SetupArgs as q, SyncHandle as r, JsonMergePatch as rt, PredictionWarning as s, DevHooksCtx as t, plus as tt, BridgeMessage as u, PlayScreenMessage as v, SyncConfig as w, SeatKind as x, PlayerVoiceState as y, ServerActionArgs as z };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as GameTime, A as DEFAULT_ICON_URLS, B as ServerActionContext, C as SetFn, D as ActionContext, E as ActionArgs, F as GameLogic, G as ServerOnlyActionContext, H as ServerActionMap, I as SERVER_TIME, J as SetupContext, K as ServerOnlyActionHandlerFn, L as Seat, M as DeadlineArgs, N as DeadlineContext, O as ActionHandler, P as Emit, Q as GAME_START, R as SeededRandom, S as SendAction, T as Operation, U as ServerEvent, V as ServerActionHandler, W as ServerOnlyAction, X as UpdateContext, Y as UpdateArgs, Z as Duration, _ as PayloadMap, a as attachDevHooks, at as applyJsonMergePatch, b as PlayersChangedMessage, c as getPredictionWarnings, d as ConnectionCallbacks, et as minus, f as ConnectionState, g as PatchFn, h as GameConfig, i as UzuDevHooks, it as JsonPatchOp, j as Deadline, k as ActionMap, l as BridgeChannel, m as EventSubscription, n as RunHandle, nt as sub, o as createDevHooks, ot as applyJsonPatch, p as EventHandler, q as SetupArgs, r as SyncHandle, rt as JsonMergePatch, s as PredictionWarning, t as DevHooksCtx, tt as plus, u as BridgeMessage, v as PlayScreenMessage, w as SyncConfig, x as SeatKind, y as PlayerVoiceState, z as ServerActionArgs } from "./dev-hooks-DOtJHP55.js";
|
|
2
2
|
//#region ../engine-core/src/random.d.ts
|
|
3
3
|
declare class SeededRandomImpl implements SeededRandom {
|
|
4
4
|
private _state;
|
|
@@ -205,4 +205,4 @@ declare function onPlayersChanged(handler: PlayersChangedHandler): void;
|
|
|
205
205
|
declare function run<S, A extends ActionMap<S> = ActionMap<S>, SA extends ServerActionMap<S> = Record<never, never>>(config: GameConfig<S, A, SA>): void;
|
|
206
206
|
declare function sync<S>(config: SyncConfig<S>): void;
|
|
207
207
|
//#endregion
|
|
208
|
-
export { type ActionArgs, type ActionContext, type ActionHandler, type ActionMap, type BridgeChannel, type BridgeMessage, type ConnectionCallbacks, type ConnectionState, DEFAULT_ICON_URLS, type Deadline, type DeadlineArgs, type DeadlineContext, type DevHooksCtx, type Duration, type Emit, type EventHandler, type EventSubscription, type GameConfig, type GameLogic, type GameTime, type JsonMergePatch, type JsonPatchOp, type Operation, type PatchFn, type PayloadMap, type PlayScreenMessage, type PlayerVoiceState, type PlayersChangedMessage, type PredictionWarning, type ReconnectableWSOptions, ReconnectableWebSocket, Room, type RoomLike, type RunHandle, SERVER_TIME, type Seat, type SeatKind, type SeededRandom, SeededRandomImpl, type SendAction, type ServerActionArgs, type ServerActionContext, type ServerActionHandler, type ServerActionMap, type ServerEvent, type ServerOnlyAction, type ServerOnlyActionContext, type ServerOnlyActionHandlerFn, type SetFn, type SetupArgs, type SetupContext, type SyncConfig, type SyncHandle, type UpdateArgs, type UpdateContext, type UzuDevHooks, applyJsonMergePatch, applyJsonPatch, attachDevHooks, changeRoom, createDevHooks, firstFrameReady, gameReady, gameTime, getPredictionWarnings, getRoom, init, isHosted, isPaused, isServerOnlyAction, minus, on, onPauseChange, onPlayersChanged, onRoom, playBgm, playSound, plus, run, send, serverOnly, setMicEnabled, stopBgm, sub, sync };
|
|
208
|
+
export { type ActionArgs, type ActionContext, type ActionHandler, type ActionMap, type BridgeChannel, type BridgeMessage, type ConnectionCallbacks, type ConnectionState, DEFAULT_ICON_URLS, type Deadline, type DeadlineArgs, type DeadlineContext, type DevHooksCtx, type Duration, type Emit, type EventHandler, type EventSubscription, GAME_START, type GameConfig, type GameLogic, type GameTime, type JsonMergePatch, type JsonPatchOp, type Operation, type PatchFn, type PayloadMap, type PlayScreenMessage, type PlayerVoiceState, type PlayersChangedMessage, type PredictionWarning, type ReconnectableWSOptions, ReconnectableWebSocket, Room, type RoomLike, type RunHandle, SERVER_TIME, type Seat, type SeatKind, type SeededRandom, SeededRandomImpl, type SendAction, type ServerActionArgs, type ServerActionContext, type ServerActionHandler, type ServerActionMap, type ServerEvent, type ServerOnlyAction, type ServerOnlyActionContext, type ServerOnlyActionHandlerFn, type SetFn, type SetupArgs, type SetupContext, type SyncConfig, type SyncHandle, type UpdateArgs, type UpdateContext, type UzuDevHooks, applyJsonMergePatch, applyJsonPatch, attachDevHooks, changeRoom, createDevHooks, firstFrameReady, gameReady, gameTime, getPredictionWarnings, getRoom, init, isHosted, isPaused, isServerOnlyAction, minus, on, onPauseChange, onPlayersChanged, onRoom, playBgm, playSound, plus, run, send, serverOnly, setMicEnabled, stopBgm, sub, sync };
|
package/dist/index.js
CHANGED
|
@@ -33,6 +33,16 @@ const minus = (a, b) => toMs(a) - toMs(b);
|
|
|
33
33
|
* 時計の実装 (play-server の facet / dev-server / ソロ / SDK の補間) だけがここを通る。
|
|
34
34
|
*/
|
|
35
35
|
const asGameTime = (ms) => ms;
|
|
36
|
+
/**
|
|
37
|
+
* ゲーム内時計の原点。ゲーム開始の瞬間で、`setup()` の `ctx.time` と同じ値。
|
|
38
|
+
*
|
|
39
|
+
* `minus(t, GAME_START)` がゲーム開始からの経過 ms になる。表示やログのために
|
|
40
|
+
* 素の数値が要る場面は、これを使えば cast を書かずに済む。
|
|
41
|
+
*
|
|
42
|
+
* `toMs` を公開しないのは `toMs(a) - toMs(b)` と書けて保護が丸ごと消えるためだが、
|
|
43
|
+
* `GAME_START` にその使い方は無い。差を取るには結局 `minus` を通る。
|
|
44
|
+
*/
|
|
45
|
+
const GAME_START = asGameTime(0);
|
|
36
46
|
//#endregion
|
|
37
47
|
//#region ../engine-core/src/game-clock.ts
|
|
38
48
|
/**
|
|
@@ -2237,4 +2247,4 @@ function calcHudInsets(params) {
|
|
|
2237
2247
|
};
|
|
2238
2248
|
}
|
|
2239
2249
|
//#endregion
|
|
2240
|
-
export { DEFAULT_ICON_URLS, ReconnectableWebSocket, Room, SERVER_TIME, SeededRandomImpl, applyJsonMergePatch, applyJsonPatch, attachDevHooks, changeRoom, createDevHooks, firstFrameReady, gameReady, gameTime, getPredictionWarnings, getRoom, init, isHosted, isPaused, isServerOnlyAction, minus, on, onPauseChange, onPlayersChanged, onRoom, playBgm, playSound, plus, run, send, serverOnly, setMicEnabled, stopBgm, sub, sync };
|
|
2250
|
+
export { DEFAULT_ICON_URLS, GAME_START, ReconnectableWebSocket, Room, SERVER_TIME, SeededRandomImpl, applyJsonMergePatch, applyJsonPatch, attachDevHooks, changeRoom, createDevHooks, firstFrameReady, gameReady, gameTime, getPredictionWarnings, getRoom, init, isHosted, isPaused, isServerOnlyAction, minus, on, onPauseChange, onPlayersChanged, onRoom, playBgm, playSound, plus, run, send, serverOnly, setMicEnabled, stopBgm, sub, sync };
|