cortico-world-parlor 0.36.7 → 0.36.8

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/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## 0.36.8(2026-11-05)
2
+
3
+ - 修复五子棋引擎让扩展在 Node 的类型剥离(`--experimental-strip-types`,strip-only)下无法加载:`GomokuTable` 的构造函数原来用了参数属性 `constructor(host, private readonly turnMs = 60_000)`,strip-only 抛出 `ERR_UNSUPPORTED_TYPESCRIPT_SYNTAX`,`serve-world` 一起进程就退出。改为先声明 `private readonly turnMs`,再在构造函数体内赋值,与原 `storage/sqlite.ts` 的写法一致。行为、超时数值与对外接口均未变。
4
+ - 0.36.7 在 npm 上带着这个问题,用 `--experimental-strip-types` 起的网关(包括本项目自带的 `serve:world` 脚本与线上 systemd 单元)会起不来;请直接用 0.36.8。0.36.7 已 deprecate。
5
+ - 包版本、客户端版本与网页资源 `?v=` 三处统一为 0.36.8;发布内容以 npm tarball 为准。
6
+
1
7
  ## 0.36.7(2026-11-05)
2
8
 
3
9
  - 修复换厅后旧 SSE 连接迟到 401 导致重复入座、替换有效新令牌的竞态:换厅先停止旧流并等待退出,成功或失败后按当前身份恢复连接;迟到事件、打开回调和错误按连接身份隔离。并发换厅/匹配互斥,正常席位失效仍会重新入座。五子棋旁观者显示「观战」及真实赢家,不再被标为执黑或判为本人输棋。
package/README.md CHANGED
@@ -79,6 +79,12 @@ state 的 availableActions 只根据本人私视图生成;旁观者得到公
79
79
  - 两款玩法都走 `parlor.game.v1`:`parlor_game_info {op:"state"}` 取本人桌面与可用动作,
80
80
  `parlor_game_action` 提交;网页棋盘子包按需加载(五子棋约 4.5 KB、大富翁约 9.1 KB,gzip 前)。
81
81
 
82
+ ## 0.36.8:修复 strip-only 启动崩溃
83
+
84
+ 0.36.7 里 `GomokuTable` 的构造函数用了参数属性(`constructor(host, private readonly turnMs = 60_000)`),Node 的 `--experimental-strip-types`(strip-only)不支持这段语法,会抛 `ERR_UNSUPPORTED_TYPESCRIPT_SYNTAX`。结果是任何用 strip-types 起的网关(本包的 `pnpm serve:world`、线上 systemd 单元)一启动就退出。这一版改成字段先声明、构造函数体内赋值,行为与超时数值都没变。
85
+
86
+ **请用 0.36.8,不要用 0.36.7**(已在 npm deprecate)。其余内容与 0.36.7 相同。
87
+
82
88
  ## 0.36.7:五子棋、快局大富翁与通用游戏接口
83
89
 
84
90
  客厅新增两款玩法:**五子棋**(两席、15×15、桌主执黑先行、每手 60 秒、超时按建议代下、私视图给三个推荐点)和**快局大富翁**(四席、16 格环形地图、6 轮 24 手、掷骰 60 秒与购地 20 秒两个阶段、终局按「现金 + 地产原价 85%」排名)。两款都只用局内金币,不接受押注。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cortico-world-parlor",
3
- "version": "0.36.7",
3
+ "version": "0.36.8",
4
4
  "type": "module",
5
5
  "author": {
6
6
  "name": "筆離嘢"
@@ -28,7 +28,7 @@ export interface ReplayResponse {
28
28
  * 能不能玩需要新能力的游戏(狼人杀要 ≥ 0.29.0)。
29
29
  * 它跟 npm 包版本解耦——发新版时在这里抬一格即可(有测试盯着别忘)。
30
30
  */
31
- export const PARLOR_CLIENT_VERSION = '0.36.7';
31
+ export const PARLOR_CLIENT_VERSION = '0.36.8';
32
32
 
33
33
  export class ParlorHttpError extends Error {
34
34
  readonly status: number;
@@ -70,10 +70,14 @@ export class GomokuTable implements TableEngine {
70
70
  private board = Array<number>(CAPACITY).fill(0);
71
71
  private winningLine: Point[] = [];
72
72
  private deadline = 0;
73
+ private readonly turnMs: number;
73
74
 
74
- constructor(host: TableSeat, private readonly turnMs = 60_000) {
75
+ // 不用参数属性(`constructor(private readonly x)`):那段语法过不了 Node 的
76
+ // --experimental-strip-types(strip-only),线上 serve-world 就是这么起的。
77
+ constructor(host: TableSeat, turnMs = 60_000) {
75
78
  this.host = host.id;
76
79
  this.seats = [{ ...host }];
80
+ this.turnMs = turnMs;
77
81
  }
78
82
 
79
83
  private get color(): Color { return this.moves.length % 2 === 0 ? 1 : 2; }
@@ -5,8 +5,8 @@
5
5
  */
6
6
  import { el, btn, icon } from './common.js';
7
7
  /* 内部模块统一带同一个版本号:版本不一致会让浏览器当成两份,订阅会各记各的。 */
8
- import { onAnnouncements } from './announcements.js?v=0.36.7';
9
- import { pickAnnouncement, rememberDismissed, excerpt } from './announcement-rules.js?v=0.36.7';
8
+ import { onAnnouncements } from './announcements.js?v=0.36.8';
9
+ import { pickAnnouncement, rememberDismissed, excerpt } from './announcement-rules.js?v=0.36.8';
10
10
 
11
11
  const DISMISSED_KEY = 'parlor-announcements-dismissed';
12
12
  const SEEN_KEY = 'parlor-announcements-seen';
@@ -10,9 +10,9 @@
10
10
  * - `blurb` / `foot` / `guide` 是大厅卡片的文案与玩法说明。
11
11
  */
12
12
  import { mountDice } from './dice.js';
13
- import { mountDdz } from './ddz.js?v=0.36.7';
13
+ import { mountDdz } from './ddz.js?v=0.36.8';
14
14
  import { mountMonopoly } from './monopoly.js';
15
- import { mountWerewolf } from './werewolf.js?v=0.36.7';
15
+ import { mountWerewolf } from './werewolf.js?v=0.36.8';
16
16
 
17
17
  export const GAMES = {
18
18
  dice: {
@@ -7,7 +7,7 @@
7
7
  <meta name="color-scheme" content="light">
8
8
  <meta name="referrer" content="no-referrer">
9
9
  <title>客厅 · 家长</title>
10
- <link rel="stylesheet" href="/parent/assets/parent.css?v=0.36.7">
10
+ <link rel="stylesheet" href="/parent/assets/parent.css?v=0.36.8">
11
11
  </head>
12
12
  <body class="theme-cozy">
13
13
  <a class="skip-link" href="#main">跳到主要内容</a>
@@ -76,6 +76,6 @@
76
76
  </main>
77
77
 
78
78
  <div id="toast" class="toast" role="status" aria-live="polite" hidden></div>
79
- <script type="module" src="/parent/assets/parent.js?v=0.36.7"></script>
79
+ <script type="module" src="/parent/assets/parent.js?v=0.36.8"></script>
80
80
  </body>
81
81
  </html>
package/src/web/play.html CHANGED
@@ -6,11 +6,11 @@
6
6
  <meta name="theme-color" content="#10191b">
7
7
  <meta name="color-scheme" content="dark light">
8
8
  <title>鲸语会馆 · 今晚,来一局</title>
9
- <script src="/play/assets/theme.js?v=0.36.7"></script>
9
+ <script src="/play/assets/theme.js?v=0.36.8"></script>
10
10
  <link rel="stylesheet" href="/play/assets/play.css">
11
- <link rel="stylesheet" href="/play/assets/club.css?v=0.36.7">
12
- <link rel="stylesheet" href="/play/assets/appearance.css?v=0.36.7">
13
- <link rel="stylesheet" href="/play/assets/night.css?v=0.36.7">
11
+ <link rel="stylesheet" href="/play/assets/club.css?v=0.36.8">
12
+ <link rel="stylesheet" href="/play/assets/appearance.css?v=0.36.8">
13
+ <link rel="stylesheet" href="/play/assets/night.css?v=0.36.8">
14
14
  </head>
15
15
  <body class="theme-club">
16
16
  <svg class="sprite" aria-hidden="true" width="0" height="0" focusable="false">
@@ -106,6 +106,6 @@
106
106
  <div id="app" class="app"><div class="booting" id="boot-note">正在打开客厅…</div></div>
107
107
  <div id="toast" class="toast" role="status" aria-live="polite" hidden></div>
108
108
  <noscript><p class="noscript">这个页面要开 JavaScript 才能玩。</p></noscript>
109
- <script type="module" src="/play/assets/vue-loader.js?v=0.36.7"></script>
109
+ <script type="module" src="/play/assets/vue-loader.js?v=0.36.8"></script>
110
110
  </body>
111
111
  </html>
package/src/web/play.js CHANGED
@@ -5,12 +5,12 @@ import {
5
5
  el, clear, icon, initialOf, fmtClock, fmtDateTime, fmtLeft, clockSpan, btn, playerClass,
6
6
  isNearBottom, readable, GAME_LABELS, STATUS_LABELS, KIND_LABELS,
7
7
  } from './common.js';
8
- import { ENABLED_GAMES, GAMES, gameOf, gameLabel, gameIcon, heroGame } from './games/registry.js?v=0.36.7';
8
+ import { ENABLED_GAMES, GAMES, gameOf, gameLabel, gameIcon, heroGame } from './games/registry.js?v=0.36.8';
9
9
  import { createClubState, conversationKey, readRoute, routeUrl } from './club-state.js';
10
10
  import { createRoomCarousel } from './room-carousel.js';
11
- import { supportLink } from './support-link.js?v=0.36.7';
12
- import { mountAnnouncementBanner } from './announcement-banner.js?v=0.36.7';
13
- import { startAnnouncementWatch } from './announcements.js?v=0.36.7';
11
+ import { supportLink } from './support-link.js?v=0.36.8';
12
+ import { mountAnnouncementBanner } from './announcement-banner.js?v=0.36.8';
13
+ import { startAnnouncementWatch } from './announcements.js?v=0.36.8';
14
14
 
15
15
  const club = createClubState({
16
16
  getItem: key => sessionStorage.getItem(key),
@@ -1,5 +1,5 @@
1
1
  /** 公告入口独立刷新,避免打断牌桌和聊天草稿。取数在 announcements.js,首屏横幅用的是同一份。 */
2
- import { onAnnouncements } from './announcements.js?v=0.36.7';
2
+ import { onAnnouncements } from './announcements.js?v=0.36.8';
3
3
 
4
4
  export function supportLink(getToken) {
5
5
  const link = document.createElement('a');