@zhuweiyou/dsh-holdem 0.1.4 → 0.1.5
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/LICENSE +32 -32
- package/README.md +84 -84
- package/cordis.patch.yml +6 -6
- package/icon.svg +25 -25
- package/lib/client.js +234 -234
- package/lib/client.js.map +1 -1
- package/lib/index.js +83 -55
- package/lib/index.js.map +1 -1
- package/lib/types/net/cloudflare.d.ts +27 -0
- package/lib/types/net/cloudflare.d.ts.map +1 -1
- package/lib/worker.js.map +1 -1
- package/locale/en.json +6 -6
- package/locale/zh.json +6 -6
- package/package.json +99 -99
- package/worker/index.ts +300 -300
- package/worker/tsconfig.json +10 -10
- package/wrangler.toml +15 -15
package/LICENSE
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 zhuweiyou
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
22
|
-
|
|
23
|
-
---
|
|
24
|
-
|
|
25
|
-
Portions of the poker rules engine (hand ranking, side-pot layering, betting
|
|
26
|
-
semantics, heads-up blind order) are adapted from BubblePtr/dsh-holdem
|
|
27
|
-
(https://github.com/BubblePtr/dsh-holdem), MIT License.
|
|
28
|
-
|
|
29
|
-
Portions of the host-as-server room architecture (HTTP command transport,
|
|
30
|
-
invite tokens, spectator model, storage domain wiring) are adapted from
|
|
31
|
-
lifefloating/dsh-doudizhu (https://github.com/lifefloating/dsh-doudizhu),
|
|
32
|
-
MIT License.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 zhuweiyou
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
Portions of the poker rules engine (hand ranking, side-pot layering, betting
|
|
26
|
+
semantics, heads-up blind order) are adapted from BubblePtr/dsh-holdem
|
|
27
|
+
(https://github.com/BubblePtr/dsh-holdem), MIT License.
|
|
28
|
+
|
|
29
|
+
Portions of the host-as-server room architecture (HTTP command transport,
|
|
30
|
+
invite tokens, spectator model, storage domain wiring) are adapted from
|
|
31
|
+
lifefloating/dsh-doudizhu (https://github.com/lifefloating/dsh-doudizhu),
|
|
32
|
+
MIT License.
|
package/README.md
CHANGED
|
@@ -1,84 +1,84 @@
|
|
|
1
|
-
# 德州扑克 · dsh-holdem
|
|
2
|
-
|
|
3
|
-
DeepSeek Harness 的德州扑克面板插件:6 人无限注德州,超员自动观战,多局累计排行榜。
|
|
4
|
-
|
|
5
|
-
牌桌有两种跑法,建房时选一个:
|
|
6
|
-
|
|
7
|
-
| 开桌位置 | 说明 |
|
|
8
|
-
| --- | --- |
|
|
9
|
-
| **公网 · Cloudflare**(默认) | 牌桌跑在 Cloudflare Worker + Durable Object 上,**关掉你的电脑也能玩**。点一次「授权 Cloudflare」→ 自动部署,地址自动拿到 |
|
|
10
|
-
| **本机** | 牌桌跑在你自己的 dsh 进程里,同一 Wi-Fi 的朋友用局域网链接加入 |
|
|
11
|
-
|
|
12
|
-
加入牌桌**只认邀请链接**:链接里带着房号、邀请凭证和这桌在哪里(本机 / 局域网 / Cloudflare),
|
|
13
|
-
把链接发给朋友,用浏览器打开就能玩——对方不需要安装这个插件。
|
|
14
|
-
|
|
15
|
-
## 安装
|
|
16
|
-
|
|
17
|
-
### Desktop 版
|
|
18
|
-
|
|
19
|
-
在 DSH 桌面端的插件安装入口里**直接填写插件名称** `@zhuweiyou/dsh-holdem` 即可。
|
|
20
|
-
|
|
21
|
-
### Web 版
|
|
22
|
-
|
|
23
|
-
```sh
|
|
24
|
-
dsh plugin --profile web add @zhuweiyou/dsh-holdem
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
包内已包含编译产物(`lib/`),装完即用,不需要再构建。升级同样是再执行一次 `add`。
|
|
28
|
-
|
|
29
|
-
两版装完都刷新页面,「德州扑克」图标会出现在侧栏面板栏里。
|
|
30
|
-
|
|
31
|
-
## 界面
|
|
32
|
-
|
|
33
|
-

|
|
34
|
-
|
|
35
|
-

|
|
36
|
-
|
|
37
|
-

|
|
38
|
-
|
|
39
|
-
## 怎么玩
|
|
40
|
-
|
|
41
|
-
1. 点侧栏的德州扑克图标 → 选「开桌位置」→ 填昵称、房间名、盲注 → 开一桌。
|
|
42
|
-
2. 弹出来的邀请面板里复制链接,发给朋友。
|
|
43
|
-
3. 大家「准备」,房主点「开始」;每手结束会自动开下一手。
|
|
44
|
-
4. 房主点「解散并结算」(或离开)后,所有人看到本场结算:名次、手数、胜局、净赢、BB/100、摊牌胜率。
|
|
45
|
-
|
|
46
|
-
房间规则:
|
|
47
|
-
|
|
48
|
-
- 6 人上限,坐满后新来的人自动观战;观战者可以在等待阶段补位。
|
|
49
|
-
- 一手进行中离开等于弃牌,**这手牌会照常打完**,只是不再开新局。
|
|
50
|
-
- 每个行动 30 秒(可调 15–90 秒),超时自动过牌/弃牌;连续三次超时进入托管。
|
|
51
|
-
- 有人掉线不影响其他人:轮到他会照常走计时,回来还能接上原来的座位和牌。
|
|
52
|
-
- 房主离开或失联(默认 10 分钟)会结算整场。
|
|
53
|
-
|
|
54
|
-
## 设置
|
|
55
|
-
|
|
56
|
-
`Settings → Plugins → 德州扑克`:
|
|
57
|
-
|
|
58
|
-
| 字段 | 说明 | 默认 |
|
|
59
|
-
| --- | --- | --- |
|
|
60
|
-
| `defaultBlindLevel` | 新房间的默认盲注档位 | `25/50` |
|
|
61
|
-
| `turnTimeoutSec` | 每个行动的时限(15–90 秒) | 30 |
|
|
62
|
-
| `autoAdvanceSec` | 一手结束后自动开下一手(2–30 秒) | 6 |
|
|
63
|
-
| `allowSpectators` | 是否允许观战 | 开 |
|
|
64
|
-
| `maxSpectators` | 每桌观战席位上限(0–64,`0` 等于不接观战) | 16 |
|
|
65
|
-
| `chatEnabled` | 是否允许桌边聊天 | 开 |
|
|
66
|
-
| `maxRooms` | 同时存在的房间上限 | 8 |
|
|
67
|
-
| `hostIdleDissolveMin` | 房主失联多久后自动结算(分钟) | 10 |
|
|
68
|
-
| `routePrefix` | HTTP 前缀 | `/holdem` |
|
|
69
|
-
|
|
70
|
-
## 规则细节
|
|
71
|
-
|
|
72
|
-
- 盲注档位 `10/20`、`25/50`、`100/200`,带入固定 100BB,每手重置。
|
|
73
|
-
- 单挑时按钮位下小盲、翻前先行动,翻后大盲先行动。
|
|
74
|
-
- 最小加注为「上一次满额加注量」;短筹码全下**不会**重新开放加注。
|
|
75
|
-
- 边池按投入分层,弃牌者的钱留在池里但没有资格;未被跟注的部分原路退回。
|
|
76
|
-
- 奇数筹码从按钮左手第一个赢家开始逐个分配。
|
|
77
|
-
- 全员全下时按 1.2 秒间隔逐街发完公共牌再摊牌。
|
|
78
|
-
|
|
79
|
-
## 已知限制
|
|
80
|
-
|
|
81
|
-
- 房主进程天然可信(能改自己的代码),不承诺防作弊。
|
|
82
|
-
- 牌桌状态在内存里:重启 dsh(本机模式)或 Durable Object 被回收(Cloudflare 模式)后房间消失。
|
|
83
|
-
- 筹码是娱乐分,没有真实价值,也没有跨房间钱包。
|
|
84
|
-
- 观战席位默认 16,可用 `maxSpectators` 调整;房间上限见设置。
|
|
1
|
+
# 德州扑克 · dsh-holdem
|
|
2
|
+
|
|
3
|
+
DeepSeek Harness 的德州扑克面板插件:6 人无限注德州,超员自动观战,多局累计排行榜。
|
|
4
|
+
|
|
5
|
+
牌桌有两种跑法,建房时选一个:
|
|
6
|
+
|
|
7
|
+
| 开桌位置 | 说明 |
|
|
8
|
+
| --- | --- |
|
|
9
|
+
| **公网 · Cloudflare**(默认) | 牌桌跑在 Cloudflare Worker + Durable Object 上,**关掉你的电脑也能玩**。点一次「授权 Cloudflare」→ 自动部署,地址自动拿到 |
|
|
10
|
+
| **本机** | 牌桌跑在你自己的 dsh 进程里,同一 Wi-Fi 的朋友用局域网链接加入 |
|
|
11
|
+
|
|
12
|
+
加入牌桌**只认邀请链接**:链接里带着房号、邀请凭证和这桌在哪里(本机 / 局域网 / Cloudflare),
|
|
13
|
+
把链接发给朋友,用浏览器打开就能玩——对方不需要安装这个插件。
|
|
14
|
+
|
|
15
|
+
## 安装
|
|
16
|
+
|
|
17
|
+
### Desktop 版
|
|
18
|
+
|
|
19
|
+
在 DSH 桌面端的插件安装入口里**直接填写插件名称** `@zhuweiyou/dsh-holdem` 即可。
|
|
20
|
+
|
|
21
|
+
### Web 版
|
|
22
|
+
|
|
23
|
+
```sh
|
|
24
|
+
dsh plugin --profile web add @zhuweiyou/dsh-holdem
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
包内已包含编译产物(`lib/`),装完即用,不需要再构建。升级同样是再执行一次 `add`。
|
|
28
|
+
|
|
29
|
+
两版装完都刷新页面,「德州扑克」图标会出现在侧栏面板栏里。
|
|
30
|
+
|
|
31
|
+
## 界面
|
|
32
|
+
|
|
33
|
+

|
|
34
|
+
|
|
35
|
+

|
|
36
|
+
|
|
37
|
+

|
|
38
|
+
|
|
39
|
+
## 怎么玩
|
|
40
|
+
|
|
41
|
+
1. 点侧栏的德州扑克图标 → 选「开桌位置」→ 填昵称、房间名、盲注 → 开一桌。
|
|
42
|
+
2. 弹出来的邀请面板里复制链接,发给朋友。
|
|
43
|
+
3. 大家「准备」,房主点「开始」;每手结束会自动开下一手。
|
|
44
|
+
4. 房主点「解散并结算」(或离开)后,所有人看到本场结算:名次、手数、胜局、净赢、BB/100、摊牌胜率。
|
|
45
|
+
|
|
46
|
+
房间规则:
|
|
47
|
+
|
|
48
|
+
- 6 人上限,坐满后新来的人自动观战;观战者可以在等待阶段补位。
|
|
49
|
+
- 一手进行中离开等于弃牌,**这手牌会照常打完**,只是不再开新局。
|
|
50
|
+
- 每个行动 30 秒(可调 15–90 秒),超时自动过牌/弃牌;连续三次超时进入托管。
|
|
51
|
+
- 有人掉线不影响其他人:轮到他会照常走计时,回来还能接上原来的座位和牌。
|
|
52
|
+
- 房主离开或失联(默认 10 分钟)会结算整场。
|
|
53
|
+
|
|
54
|
+
## 设置
|
|
55
|
+
|
|
56
|
+
`Settings → Plugins → 德州扑克`:
|
|
57
|
+
|
|
58
|
+
| 字段 | 说明 | 默认 |
|
|
59
|
+
| --- | --- | --- |
|
|
60
|
+
| `defaultBlindLevel` | 新房间的默认盲注档位 | `25/50` |
|
|
61
|
+
| `turnTimeoutSec` | 每个行动的时限(15–90 秒) | 30 |
|
|
62
|
+
| `autoAdvanceSec` | 一手结束后自动开下一手(2–30 秒) | 6 |
|
|
63
|
+
| `allowSpectators` | 是否允许观战 | 开 |
|
|
64
|
+
| `maxSpectators` | 每桌观战席位上限(0–64,`0` 等于不接观战) | 16 |
|
|
65
|
+
| `chatEnabled` | 是否允许桌边聊天 | 开 |
|
|
66
|
+
| `maxRooms` | 同时存在的房间上限 | 8 |
|
|
67
|
+
| `hostIdleDissolveMin` | 房主失联多久后自动结算(分钟) | 10 |
|
|
68
|
+
| `routePrefix` | HTTP 前缀 | `/holdem` |
|
|
69
|
+
|
|
70
|
+
## 规则细节
|
|
71
|
+
|
|
72
|
+
- 盲注档位 `10/20`、`25/50`、`100/200`,带入固定 100BB,每手重置。
|
|
73
|
+
- 单挑时按钮位下小盲、翻前先行动,翻后大盲先行动。
|
|
74
|
+
- 最小加注为「上一次满额加注量」;短筹码全下**不会**重新开放加注。
|
|
75
|
+
- 边池按投入分层,弃牌者的钱留在池里但没有资格;未被跟注的部分原路退回。
|
|
76
|
+
- 奇数筹码从按钮左手第一个赢家开始逐个分配。
|
|
77
|
+
- 全员全下时按 1.2 秒间隔逐街发完公共牌再摊牌。
|
|
78
|
+
|
|
79
|
+
## 已知限制
|
|
80
|
+
|
|
81
|
+
- 房主进程天然可信(能改自己的代码),不承诺防作弊。
|
|
82
|
+
- 牌桌状态在内存里:重启 dsh(本机模式)或 Durable Object 被回收(Cloudflare 模式)后房间消失。
|
|
83
|
+
- 筹码是娱乐分,没有真实价值,也没有跨房间钱包。
|
|
84
|
+
- 观战席位默认 16,可用 `maxSpectators` 调整;房间上限见设置。
|
package/cordis.patch.yml
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
# @zhuweiyou/dsh-holdem — 德州扑克牌桌。
|
|
2
|
-
# 插入一条 Host 插件行:注册 /holdem 路由、WebSocket 与房间管理;
|
|
3
|
-
# 同一包的 Web Client 半边注册侧栏面板与牌桌。
|
|
4
|
-
- insert:
|
|
5
|
-
- id: dsh-holdem
|
|
6
|
-
name: "@zhuweiyou/dsh-holdem"
|
|
1
|
+
# @zhuweiyou/dsh-holdem — 德州扑克牌桌。
|
|
2
|
+
# 插入一条 Host 插件行:注册 /holdem 路由、WebSocket 与房间管理;
|
|
3
|
+
# 同一包的 Web Client 半边注册侧栏面板与牌桌。
|
|
4
|
+
- insert:
|
|
5
|
+
- id: dsh-holdem
|
|
6
|
+
name: "@zhuweiyou/dsh-holdem"
|
package/icon.svg
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" width="64" height="64" role="img" aria-label="Hold'em">
|
|
2
|
-
<defs>
|
|
3
|
-
<linearGradient id="felt" x1="0" y1="0" x2="0" y2="1">
|
|
4
|
-
<stop offset="0" stop-color="#1f7a5a"/>
|
|
5
|
-
<stop offset="1" stop-color="#0e4a37"/>
|
|
6
|
-
</linearGradient>
|
|
7
|
-
</defs>
|
|
8
|
-
<rect width="64" height="64" rx="14" fill="#12161c"/>
|
|
9
|
-
<ellipse cx="32" cy="33" rx="25" ry="18" fill="url(#felt)" stroke="#2f9c76" stroke-width="1.6"/>
|
|
10
|
-
<ellipse cx="32" cy="33" rx="19" ry="12.5" fill="none" stroke="#3fbf93" stroke-width="0.9" stroke-dasharray="2.4 2.6" opacity="0.7"/>
|
|
11
|
-
<g transform="rotate(-11 25 27)">
|
|
12
|
-
<rect x="18.5" y="17.5" width="13" height="18" rx="2.6" fill="#f4f0e6" stroke="#c9c2b2" stroke-width="0.9"/>
|
|
13
|
-
<text x="22" y="28" font-family="Georgia, serif" font-size="9" fill="#c0392b">A</text>
|
|
14
|
-
<text x="22.6" y="33.4" font-family="Georgia, serif" font-size="6.4" fill="#c0392b">♥</text>
|
|
15
|
-
</g>
|
|
16
|
-
<g transform="rotate(9 39 30)">
|
|
17
|
-
<rect x="33" y="19.5" width="13" height="18" rx="2.6" fill="#f4f0e6" stroke="#c9c2b2" stroke-width="0.9"/>
|
|
18
|
-
<text x="36.4" y="30" font-family="Georgia, serif" font-size="9" fill="#1b1b1b">K</text>
|
|
19
|
-
<text x="37" y="35.4" font-family="Georgia, serif" font-size="6.4" fill="#1b1b1b">♠</text>
|
|
20
|
-
</g>
|
|
21
|
-
<g transform="translate(32 51.5)">
|
|
22
|
-
<circle r="4.4" fill="#e8c15a" stroke="#8a6b1f" stroke-width="1"/>
|
|
23
|
-
<circle r="2.5" fill="none" stroke="#8a6b1f" stroke-width="0.9" stroke-dasharray="1.4 1.6"/>
|
|
24
|
-
</g>
|
|
25
|
-
</svg>
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" width="64" height="64" role="img" aria-label="Hold'em">
|
|
2
|
+
<defs>
|
|
3
|
+
<linearGradient id="felt" x1="0" y1="0" x2="0" y2="1">
|
|
4
|
+
<stop offset="0" stop-color="#1f7a5a"/>
|
|
5
|
+
<stop offset="1" stop-color="#0e4a37"/>
|
|
6
|
+
</linearGradient>
|
|
7
|
+
</defs>
|
|
8
|
+
<rect width="64" height="64" rx="14" fill="#12161c"/>
|
|
9
|
+
<ellipse cx="32" cy="33" rx="25" ry="18" fill="url(#felt)" stroke="#2f9c76" stroke-width="1.6"/>
|
|
10
|
+
<ellipse cx="32" cy="33" rx="19" ry="12.5" fill="none" stroke="#3fbf93" stroke-width="0.9" stroke-dasharray="2.4 2.6" opacity="0.7"/>
|
|
11
|
+
<g transform="rotate(-11 25 27)">
|
|
12
|
+
<rect x="18.5" y="17.5" width="13" height="18" rx="2.6" fill="#f4f0e6" stroke="#c9c2b2" stroke-width="0.9"/>
|
|
13
|
+
<text x="22" y="28" font-family="Georgia, serif" font-size="9" fill="#c0392b">A</text>
|
|
14
|
+
<text x="22.6" y="33.4" font-family="Georgia, serif" font-size="6.4" fill="#c0392b">♥</text>
|
|
15
|
+
</g>
|
|
16
|
+
<g transform="rotate(9 39 30)">
|
|
17
|
+
<rect x="33" y="19.5" width="13" height="18" rx="2.6" fill="#f4f0e6" stroke="#c9c2b2" stroke-width="0.9"/>
|
|
18
|
+
<text x="36.4" y="30" font-family="Georgia, serif" font-size="9" fill="#1b1b1b">K</text>
|
|
19
|
+
<text x="37" y="35.4" font-family="Georgia, serif" font-size="6.4" fill="#1b1b1b">♠</text>
|
|
20
|
+
</g>
|
|
21
|
+
<g transform="translate(32 51.5)">
|
|
22
|
+
<circle r="4.4" fill="#e8c15a" stroke="#8a6b1f" stroke-width="1"/>
|
|
23
|
+
<circle r="2.5" fill="none" stroke="#8a6b1f" stroke-width="0.9" stroke-dasharray="1.4 1.6"/>
|
|
24
|
+
</g>
|
|
25
|
+
</svg>
|