@uzuhq/code-cli 0.4.1 → 0.5.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.
@@ -209,14 +209,17 @@ export class GameRoom {
209
209
  const tickNow = Date.now();
210
210
  const tickDraft = new ScheduleDraft(tickNow, (a) => this.hasAction(a));
211
211
  try {
212
- this.logic.update(this.gameState, {
213
- random: this.random,
214
- tick: this.tickCount,
215
- now: tickNow,
216
- schedule: (o) => tickDraft.schedule(o),
217
- unschedule: (k) => tickDraft.unschedule(k),
218
- emit,
219
- playerInputs: this.playerInputs,
212
+ this.logic.update({
213
+ state: this.gameState,
214
+ ctx: {
215
+ random: this.random,
216
+ tick: this.tickCount,
217
+ now: tickNow,
218
+ schedule: (o) => tickDraft.schedule(o),
219
+ unschedule: (k) => tickDraft.unschedule(k),
220
+ emit,
221
+ playerInputs: this.playerInputs,
222
+ },
220
223
  });
221
224
  }
222
225
  catch (err) {
@@ -385,14 +388,25 @@ export class GameRoom {
385
388
  try {
386
389
  // 決定的な部分を先に走らせ、serverActions がその結果を見られるようにする。
387
390
  if (plain && !legacyServerOnly) {
388
- plain(this.gameState, payload ?? {}, senderId, emit, { now, ...scheduleCtx });
391
+ plain({
392
+ state: this.gameState,
393
+ payload: payload ?? {},
394
+ playerId: senderId,
395
+ ctx: { now, emit, ...scheduleCtx },
396
+ });
389
397
  }
390
398
  if (serverHandler) {
391
- await serverHandler(this.gameState, payload ?? {}, senderId, serverEmit, {
392
- tick: this.tickCount,
393
- random: this.random ?? new SeededRandomImpl(this.seed),
394
- now,
395
- ...scheduleCtx,
399
+ await serverHandler({
400
+ state: this.gameState,
401
+ payload: payload ?? {},
402
+ playerId: senderId,
403
+ ctx: {
404
+ tick: this.tickCount,
405
+ random: this.random ?? new SeededRandomImpl(this.seed),
406
+ now,
407
+ emit: serverEmit,
408
+ ...scheduleCtx,
409
+ },
396
410
  });
397
411
  }
398
412
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uzuhq/code-cli",
3
- "version": "0.4.1",
3
+ "version": "0.5.0",
4
4
  "description": "UZU ゲーム開発 CLI - ビルド・パブリッシュ・プロジェクト作成ツール",
5
5
  "type": "module",
6
6
  "bin": {