@zhin.js/plugin-blackjack 0.0.1 → 0.0.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/commands/bj/[action:string=].ts +23 -0
- package/lib/bj-command.d.ts +4 -3
- package/lib/bj-command.js +4 -0
- package/lib/bj-command.js.map +1 -1
- package/lib/engine.d.ts +0 -1
- package/lib/engine.js +1 -1
- package/lib/engine.js.map +1 -1
- package/lib/game-flow.d.ts +4 -5
- package/lib/game-flow.js +19 -15
- package/lib/game-flow.js.map +1 -1
- package/lib/index.d.ts +8 -2
- package/lib/index.js +8 -25
- package/lib/index.js.map +1 -1
- package/lib/memory-db.d.ts +6 -0
- package/lib/memory-db.js +18 -0
- package/lib/memory-db.js.map +1 -0
- package/lib/models.d.ts +5 -4
- package/lib/models.js +2 -2
- package/lib/models.js.map +1 -1
- package/lib/runtime-store.d.ts +6 -0
- package/lib/runtime-store.js +7 -0
- package/lib/runtime-store.js.map +1 -0
- package/lib/session-service.d.ts +1 -3
- package/lib/session-service.js +1 -4
- package/lib/session-service.js.map +1 -1
- package/lib/view.d.ts +1 -2
- package/lib/view.js +1 -1
- package/lib/view.js.map +1 -1
- package/middlewares/bj-alias.ts +22 -0
- package/middlewares/bj-choice.ts +80 -0
- package/package.json +36 -10
- package/plugin.ts +62 -0
- package/schema.json +6 -0
- package/src/bj-command.ts +12 -3
- package/src/engine.ts +1 -1
- package/src/game-flow.ts +26 -23
- package/src/index.ts +9 -34
- package/src/memory-db.ts +22 -0
- package/src/models.ts +7 -4
- package/src/runtime-store.ts +9 -0
- package/src/session-service.ts +2 -5
- package/src/view.ts +2 -2
- package/lib/bj-command.d.ts.map +0 -1
- package/lib/commands.d.ts +0 -6
- package/lib/commands.d.ts.map +0 -1
- package/lib/commands.js +0 -98
- package/lib/commands.js.map +0 -1
- package/lib/engine.d.ts.map +0 -1
- package/lib/game-flow.d.ts.map +0 -1
- package/lib/hub-register.d.ts +0 -3
- package/lib/hub-register.d.ts.map +0 -1
- package/lib/hub-register.js +0 -29
- package/lib/hub-register.js.map +0 -1
- package/lib/index.d.ts.map +0 -1
- package/lib/models.d.ts.map +0 -1
- package/lib/session-service.d.ts.map +0 -1
- package/lib/view.d.ts.map +0 -1
- package/plugin.yml +0 -2
- package/src/commands.ts +0 -117
- package/src/hub-register.ts +0 -28
package/plugin.ts
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { definePlugin, databaseHostToken, scheduleHostToken } from '@zhin.js/plugin-runtime';
|
|
2
|
+
import {
|
|
3
|
+
registerRuntimeGame,
|
|
4
|
+
initGameRecordHost,
|
|
5
|
+
DEFAULT_GAME_STALE_CRON,
|
|
6
|
+
DEFAULT_GAME_STALE_IDLE_MS,
|
|
7
|
+
} from '@zhin.js/game-kit';
|
|
8
|
+
import { mountBjHostServices, mountBjMemoryServices } from './src/memory-db.js';
|
|
9
|
+
import { gameServicesToken } from './src/runtime-store.js';
|
|
10
|
+
import type { SessionService } from './src/session-service.js';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Plugin Runtime:
|
|
14
|
+
* - Commands under `commands/` are authoritative (help + start/continue via in-memory DB).
|
|
15
|
+
* - DB: prefer databaseHostToken; else in-memory SessionService.
|
|
16
|
+
* - Choice middleware under `middlewares/` handles hit/stand payloads (Sandbox action→text).
|
|
17
|
+
*/
|
|
18
|
+
export default definePlugin({
|
|
19
|
+
name: 'blackjack',
|
|
20
|
+
metadata: {
|
|
21
|
+
displayName: 'Blackjack',
|
|
22
|
+
},
|
|
23
|
+
setup(context) {
|
|
24
|
+
let services: SessionService;
|
|
25
|
+
if (context.resources.has(databaseHostToken)) {
|
|
26
|
+
const host = context.resources.use(databaseHostToken);
|
|
27
|
+
services = mountBjHostServices(host);
|
|
28
|
+
context.lifecycle.add(initGameRecordHost(host));
|
|
29
|
+
} else {
|
|
30
|
+
services = mountBjMemoryServices();
|
|
31
|
+
}
|
|
32
|
+
context.resources.provide(gameServicesToken, services);
|
|
33
|
+
const disposeHub = registerRuntimeGame({
|
|
34
|
+
id: 'blackjack',
|
|
35
|
+
title: '21 点',
|
|
36
|
+
icon: '🃏',
|
|
37
|
+
description: '经典 Blackjack,要牌或停牌挑战庄家',
|
|
38
|
+
commandPrefix: '/21点',
|
|
39
|
+
quickStart: '开始',
|
|
40
|
+
aliases: ['bj', '21点'],
|
|
41
|
+
menus: [
|
|
42
|
+
{ id: 'start', label: '🎮 开始新局' },
|
|
43
|
+
{ id: 'help', label: '📖 玩法说明' },
|
|
44
|
+
],
|
|
45
|
+
});
|
|
46
|
+
context.lifecycle.add(disposeHub);
|
|
47
|
+
|
|
48
|
+
if (context.resources.has(scheduleHostToken)) {
|
|
49
|
+
const schedule = context.resources.use(scheduleHostToken);
|
|
50
|
+
const disposeCron = schedule.register({
|
|
51
|
+
id: 'blackjack/abort-stale',
|
|
52
|
+
cron: DEFAULT_GAME_STALE_CRON,
|
|
53
|
+
description: 'Abort stale blackjack sessions',
|
|
54
|
+
async execute() {
|
|
55
|
+
if (!services.abortStale) return;
|
|
56
|
+
await services.abortStale(DEFAULT_GAME_STALE_IDLE_MS);
|
|
57
|
+
},
|
|
58
|
+
});
|
|
59
|
+
context.lifecycle.add(disposeCron);
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
});
|
package/schema.json
ADDED
package/src/bj-command.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Message, Plugin } from 'zhin.js';
|
|
2
|
-
import { continueGame,
|
|
1
|
+
import type { Message, Plugin } from '@zhin.js/core';
|
|
2
|
+
import { continueGame, startGame } from './game-flow.js';
|
|
3
3
|
import type { SessionService } from './session-service.js';
|
|
4
4
|
|
|
5
5
|
export const BJ_HELP = [
|
|
@@ -13,7 +13,7 @@ export const BJ_HELP = [
|
|
|
13
13
|
].join('\n');
|
|
14
14
|
|
|
15
15
|
export async function runBjCommand(
|
|
16
|
-
plugin: Plugin,
|
|
16
|
+
plugin: Plugin | null,
|
|
17
17
|
services: SessionService,
|
|
18
18
|
message: Message<any>,
|
|
19
19
|
action: string,
|
|
@@ -24,3 +24,12 @@ export async function runBjCommand(
|
|
|
24
24
|
if (a === 'continue' || a === '继续') return continueGame(plugin, services, message);
|
|
25
25
|
return `未知操作「${action}」。发送 \`/21点 帮助\`。`;
|
|
26
26
|
}
|
|
27
|
+
|
|
28
|
+
/** Plugin Runtime / smoke: text-only, no Adapter.editMessage. */
|
|
29
|
+
export async function runBjCommandText(
|
|
30
|
+
services: SessionService,
|
|
31
|
+
message: Message<any>,
|
|
32
|
+
action: string,
|
|
33
|
+
): Promise<string> {
|
|
34
|
+
return (await runBjCommand(null, services, message, action)) ?? '';
|
|
35
|
+
}
|
package/src/engine.ts
CHANGED
package/src/game-flow.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Adapter, Message, Plugin } from 'zhin.js';
|
|
2
|
-
import { recordGameOutcome } from '@zhin.js/game-
|
|
1
|
+
import type { Adapter, Message, Plugin } from '@zhin.js/core';
|
|
2
|
+
import { plainTextFromSendContent, recordGameOutcome } from '@zhin.js/game-kit';
|
|
3
3
|
import {
|
|
4
4
|
BJ_PREFIX,
|
|
5
5
|
compareHands,
|
|
@@ -13,14 +13,16 @@ import { parseCards, parseDeck, type SessionService } from './session-service.js
|
|
|
13
13
|
import { buildBjView, naturalOutcome, playerBust } from './view.js';
|
|
14
14
|
|
|
15
15
|
async function sendOrEditView(
|
|
16
|
-
plugin: Plugin,
|
|
16
|
+
plugin: Plugin | null,
|
|
17
17
|
services: SessionService,
|
|
18
18
|
message: Message<any>,
|
|
19
19
|
session: BjSessionRow,
|
|
20
20
|
terminal = false,
|
|
21
21
|
revealDealer = false,
|
|
22
|
-
): Promise<void> {
|
|
22
|
+
): Promise<string | void> {
|
|
23
23
|
const content = buildBjView(session, terminal, revealDealer, message.$channel.type);
|
|
24
|
+
if (!plugin) return plainTextFromSendContent(content);
|
|
25
|
+
|
|
24
26
|
const adapter = plugin.root.inject(message.$adapter) as Adapter;
|
|
25
27
|
|
|
26
28
|
if (session.board_message_id) {
|
|
@@ -43,18 +45,18 @@ async function sendOrEditView(
|
|
|
43
45
|
}
|
|
44
46
|
|
|
45
47
|
async function finishRound(
|
|
46
|
-
plugin: Plugin,
|
|
48
|
+
plugin: Plugin | null,
|
|
47
49
|
services: SessionService,
|
|
48
50
|
message: Message<any>,
|
|
49
51
|
session: BjSessionRow,
|
|
50
52
|
status: BjSessionRow['status'],
|
|
51
|
-
): Promise<void> {
|
|
53
|
+
): Promise<string | void> {
|
|
52
54
|
await services.updateSession(session.id, { status });
|
|
53
55
|
const updated = (await services.getById(session.id))!;
|
|
54
56
|
if (status === 'won') void recordGameOutcome(message, 'blackjack', 'won', 30);
|
|
55
57
|
else if (status === 'lost') void recordGameOutcome(message, 'blackjack', 'lost');
|
|
56
58
|
else if (status === 'draw') void recordGameOutcome(message, 'blackjack', 'draw');
|
|
57
|
-
|
|
59
|
+
return sendOrEditView(plugin, services, message, updated, true, true);
|
|
58
60
|
}
|
|
59
61
|
|
|
60
62
|
async function dealerPlay(
|
|
@@ -71,7 +73,7 @@ async function dealerPlay(
|
|
|
71
73
|
}
|
|
72
74
|
|
|
73
75
|
export async function startGame(
|
|
74
|
-
plugin: Plugin,
|
|
76
|
+
plugin: Plugin | null,
|
|
75
77
|
services: SessionService,
|
|
76
78
|
message: Message<any>,
|
|
77
79
|
): Promise<string | undefined> {
|
|
@@ -86,15 +88,15 @@ export async function startGame(
|
|
|
86
88
|
const session = await services.createSession(message);
|
|
87
89
|
const natural = naturalOutcome(session);
|
|
88
90
|
if (natural) {
|
|
89
|
-
await finishRound(plugin, services, message, session, natural);
|
|
90
|
-
return undefined;
|
|
91
|
+
const text = await finishRound(plugin, services, message, session, natural);
|
|
92
|
+
return typeof text === 'string' ? text : undefined;
|
|
91
93
|
}
|
|
92
|
-
await sendOrEditView(plugin, services, message, session);
|
|
93
|
-
return undefined;
|
|
94
|
+
const text = await sendOrEditView(plugin, services, message, session);
|
|
95
|
+
return typeof text === 'string' ? text : undefined;
|
|
94
96
|
}
|
|
95
97
|
|
|
96
98
|
export async function continueGame(
|
|
97
|
-
plugin: Plugin,
|
|
99
|
+
plugin: Plugin | null,
|
|
98
100
|
services: SessionService,
|
|
99
101
|
message: Message<any>,
|
|
100
102
|
): Promise<string> {
|
|
@@ -103,12 +105,13 @@ export async function continueGame(
|
|
|
103
105
|
message.$sender.id,
|
|
104
106
|
);
|
|
105
107
|
if (!session) return '你没有进行中的 21 点,发送「21点 开始」。';
|
|
106
|
-
await sendOrEditView(plugin, services, message, session);
|
|
108
|
+
const text = await sendOrEditView(plugin, services, message, session);
|
|
109
|
+
if (typeof text === 'string') return text;
|
|
107
110
|
return '已刷新 21 点界面。';
|
|
108
111
|
}
|
|
109
112
|
|
|
110
113
|
export async function handleChoice(
|
|
111
|
-
plugin: Plugin,
|
|
114
|
+
plugin: Plugin | null,
|
|
112
115
|
services: SessionService,
|
|
113
116
|
message: Message<any>,
|
|
114
117
|
sessionId: string,
|
|
@@ -120,8 +123,8 @@ export async function handleChoice(
|
|
|
120
123
|
|
|
121
124
|
if (session.status !== 'active' && choiceId === 'restart') {
|
|
122
125
|
await services.updateSession(session.id, { status: 'aborted' });
|
|
123
|
-
|
|
124
|
-
return null;
|
|
126
|
+
// text-only 模式(plugin===null)下 startGame 的唯一输出就是返回文本
|
|
127
|
+
return (await startGame(plugin, services, message)) ?? null;
|
|
125
128
|
}
|
|
126
129
|
|
|
127
130
|
if (session.status !== 'active') return '对局已结束,请点击再来一局。';
|
|
@@ -139,12 +142,12 @@ export async function handleChoice(
|
|
|
139
142
|
player_cards_json: JSON.stringify(player),
|
|
140
143
|
});
|
|
141
144
|
if (playerBust({ ...session, player_cards_json: JSON.stringify(player) })) {
|
|
142
|
-
await finishRound(plugin, services, message, session, 'lost');
|
|
143
|
-
return null;
|
|
145
|
+
const text = await finishRound(plugin, services, message, session, 'lost');
|
|
146
|
+
return typeof text === 'string' ? text : null;
|
|
144
147
|
}
|
|
145
148
|
const updated = (await services.getById(session.id))!;
|
|
146
|
-
await sendOrEditView(plugin, services, message, updated);
|
|
147
|
-
return null;
|
|
149
|
+
const text = await sendOrEditView(plugin, services, message, updated);
|
|
150
|
+
return typeof text === 'string' ? text : null;
|
|
148
151
|
}
|
|
149
152
|
|
|
150
153
|
if (choiceId !== 'stand') return '无效操作。';
|
|
@@ -157,8 +160,8 @@ export async function handleChoice(
|
|
|
157
160
|
const outcome = compareHands(player, dealer);
|
|
158
161
|
const status: BjSessionRow['status'] =
|
|
159
162
|
outcome === 'won' ? 'won' : outcome === 'lost' ? 'lost' : 'draw';
|
|
160
|
-
await finishRound(plugin, services, message, session, status);
|
|
161
|
-
return null;
|
|
163
|
+
const text = await finishRound(plugin, services, message, session, status);
|
|
164
|
+
return typeof text === 'string' ? text : null;
|
|
162
165
|
}
|
|
163
166
|
|
|
164
167
|
export { BJ_PREFIX, handValue, TARGET };
|
package/src/index.ts
CHANGED
|
@@ -1,34 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const plugin = usePlugin();
|
|
12
|
-
const { logger, useContext, addSchedule } = plugin;
|
|
13
|
-
|
|
14
|
-
registerModels(plugin);
|
|
15
|
-
|
|
16
|
-
let services: SessionService | null = null;
|
|
17
|
-
|
|
18
|
-
useContext('database', (dbFeature: DatabaseFeature) => {
|
|
19
|
-
services = createServices(resolveGameDatabase(dbFeature));
|
|
20
|
-
logger.debug(formatCompact({ 模块: '21点', 数据模型: '已就绪' }));
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
registerBjHub(() => services);
|
|
24
|
-
registerCommands(plugin, () => services);
|
|
25
|
-
registerInteractive(plugin, () => services);
|
|
26
|
-
registerTextFallback(plugin, () => services);
|
|
27
|
-
|
|
28
|
-
addSchedule({ kind: 'solar', cron: '0 */15 * * * *' }, async () => {
|
|
29
|
-
if (!services) return;
|
|
30
|
-
const n = await services.abortStale(30 * 60 * 1000);
|
|
31
|
-
if (n > 0) logger.debug(formatCompact({ '21点': '清理超时局', count: n }));
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
logger.debug(formatCompact({ 模块: '21点', 状态: '已加载' }));
|
|
1
|
+
export { BJ_HELP } from './bj-command.js';
|
|
2
|
+
export { gameServicesToken, resolveGameServices } from './runtime-store.js';
|
|
3
|
+
export { createInMemoryBjDb, mountBjMemoryServices } from './memory-db.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* 已由 plugin.ts 接线:commands/ 命令、middlewares/ 文本与选项中间件、
|
|
7
|
+
* 游戏大厅注册(registerRuntimeGame)、过期会话 cron(scheduleHostToken)、
|
|
8
|
+
* host DatabaseHost(databaseHostToken)。仍未接:interactive 按钮回调。
|
|
9
|
+
*/
|
package/src/memory-db.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { createHostGameDb, createInMemoryGameDb } from '@zhin.js/game-kit';
|
|
2
|
+
import type { DatabaseHost } from '@zhin.js/plugin-runtime';
|
|
3
|
+
import { defineHostTables } from './models.js';
|
|
4
|
+
import { createServices, type BjDatabase, type SessionService } from './session-service.js';
|
|
5
|
+
|
|
6
|
+
const BJ_TABLES = ['bj_sessions'] as const;
|
|
7
|
+
|
|
8
|
+
/** In-memory bj_sessions for Plugin Runtime slice-2 (no DatabaseFeature). */
|
|
9
|
+
export function createInMemoryBjDb(): BjDatabase {
|
|
10
|
+
return createInMemoryGameDb(BJ_TABLES) as unknown as BjDatabase;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export function mountBjMemoryServices(): SessionService {
|
|
14
|
+
const services = createServices(createInMemoryBjDb());
|
|
15
|
+
return services;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export function mountBjHostServices(host: DatabaseHost): SessionService {
|
|
19
|
+
defineHostTables(host);
|
|
20
|
+
const services = createServices(createHostGameDb(host, BJ_TABLES) as unknown as BjDatabase);
|
|
21
|
+
return services;
|
|
22
|
+
}
|
package/src/models.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { Models
|
|
1
|
+
import type { Models } from '@zhin.js/core';
|
|
2
2
|
|
|
3
3
|
export type BjSessionStatus = 'active' | 'won' | 'lost' | 'draw' | 'aborted';
|
|
4
4
|
|
|
5
|
-
declare module 'zhin.js' {
|
|
5
|
+
declare module '@zhin.js/core' {
|
|
6
6
|
interface Models {
|
|
7
7
|
bj_sessions: {
|
|
8
8
|
id: string;
|
|
@@ -26,8 +26,11 @@ declare module 'zhin.js' {
|
|
|
26
26
|
|
|
27
27
|
export type BjSessionRow = Models['bj_sessions'];
|
|
28
28
|
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
|
|
30
|
+
export function defineHostTables(
|
|
31
|
+
db: { define: (name: string, definition: Record<string, unknown>) => void },
|
|
32
|
+
): void {
|
|
33
|
+
db.define('bj_sessions', {
|
|
31
34
|
id: { type: 'text', primary: true },
|
|
32
35
|
adapter: { type: 'text', nullable: false },
|
|
33
36
|
endpoint: { type: 'text', nullable: false },
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { createToken } from '@zhin.js/plugin-runtime';
|
|
2
|
+
import type { SessionService } from './session-service.js';
|
|
3
|
+
|
|
4
|
+
/** Owner-scoped service consumed by discovered commands and middleware. */
|
|
5
|
+
export const gameServicesToken = createToken<SessionService>('zhin.game.blackjack.services');
|
|
6
|
+
|
|
7
|
+
export function resolveGameServices(context: { use<T>(token: typeof gameServicesToken): T }): SessionService {
|
|
8
|
+
return context.use(gameServicesToken) as SessionService;
|
|
9
|
+
}
|
package/src/session-service.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Database,
|
|
2
|
-
import { channelKey, generateSessionId } from '@zhin.js/game-
|
|
1
|
+
import type { Database, Message, Models, RelatedModel } from '@zhin.js/core';
|
|
2
|
+
import { channelKey, generateSessionId } from '@zhin.js/game-kit';
|
|
3
3
|
import type { BjSessionRow } from './models.js';
|
|
4
4
|
import { freshDeck } from './engine.js';
|
|
5
5
|
|
|
@@ -11,9 +11,6 @@ function getModel(db: BjDatabase): RelatedModel<unknown, Models, 'bj_sessions'>
|
|
|
11
11
|
return model as RelatedModel<unknown, Models, 'bj_sessions'>;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
export function resolveGameDatabase(feature: DatabaseFeature): BjDatabase {
|
|
15
|
-
return feature.db;
|
|
16
|
-
}
|
|
17
14
|
|
|
18
15
|
export class SessionService {
|
|
19
16
|
constructor(private readonly db: BjDatabase) {}
|
package/src/view.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { buildChoiceKeyboard } from '@zhin.js/game-
|
|
2
|
-
import type { SendContent } from 'zhin.js';
|
|
1
|
+
import { buildChoiceKeyboard } from '@zhin.js/game-kit';
|
|
2
|
+
import type { SendContent } from '@zhin.js/core';
|
|
3
3
|
import { BJ_PREFIX, formatHand, handValue, isBlackjack, TARGET } from './engine.js';
|
|
4
4
|
import type { BjSessionRow } from './models.js';
|
|
5
5
|
import { parseCards } from './session-service.js';
|
package/lib/bj-command.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bj-command.d.ts","sourceRoot":"","sources":["../src/bj-command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAE/C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAE3D,eAAO,MAAM,OAAO,QAQR,CAAC;AAEb,wBAAsB,YAAY,CAChC,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,cAAc,EACxB,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,EACrB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAM7B"}
|
package/lib/commands.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { type Plugin } from 'zhin.js';
|
|
2
|
-
import type { SessionService } from './session-service.js';
|
|
3
|
-
export declare function registerCommands(plugin: Plugin, getServices: () => SessionService | null): void;
|
|
4
|
-
export declare function registerInteractive(plugin: Plugin, getServices: () => SessionService | null): void;
|
|
5
|
-
export declare function registerTextFallback(plugin: Plugin, getServices: () => SessionService | null): void;
|
|
6
|
-
//# sourceMappingURL=commands.d.ts.map
|
package/lib/commands.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../src/commands.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiD,KAAK,MAAM,EAAE,MAAM,SAAS,CAAC;AAWrF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAsB3D,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,cAAc,GAAG,IAAI,GAAG,IAAI,CAG/F;AAgBD,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,cAAc,GAAG,IAAI,GAAG,IAAI,CAUlG;AAED,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,cAAc,GAAG,IAAI,GAAG,IAAI,CAoDnG"}
|
package/lib/commands.js
DELETED
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
import { MessageCommand, getActionFromMessage } from 'zhin.js';
|
|
2
|
-
import { buildChoiceFallbackMap, channelKey, parseChoicePayload, registerGameTextMiddleware, resolveGameChoice, resolveGameTextPayload, } from '@zhin.js/game-shared';
|
|
3
|
-
import { BJ_PREFIX, handleChoice } from './game-flow.js';
|
|
4
|
-
import { runBjCommand } from './bj-command.js';
|
|
5
|
-
const VALID_CHOICES = ['hit', 'stand', 'restart'];
|
|
6
|
-
function registerPattern(plugin, pattern, desc, getServices) {
|
|
7
|
-
plugin.addCommand(new MessageCommand(pattern)
|
|
8
|
-
.desc(desc)
|
|
9
|
-
.action(async (message, result) => {
|
|
10
|
-
const services = getServices();
|
|
11
|
-
if (!services)
|
|
12
|
-
return '21 点需要启用 database 配置。';
|
|
13
|
-
const raw = result.params.action ?? '';
|
|
14
|
-
return runBjCommand(plugin, services, message, raw);
|
|
15
|
-
}));
|
|
16
|
-
}
|
|
17
|
-
export function registerCommands(plugin, getServices) {
|
|
18
|
-
registerPattern(plugin, '/21点 [action:word]', '21 点(中文)', getServices);
|
|
19
|
-
registerPattern(plugin, '/bj [action:word]', 'Blackjack (English)', getServices);
|
|
20
|
-
}
|
|
21
|
-
async function resolveChoice(message, services) {
|
|
22
|
-
return resolveGameChoice({
|
|
23
|
-
message,
|
|
24
|
-
gamePrefix: BJ_PREFIX,
|
|
25
|
-
validChoiceIds: VALID_CHOICES,
|
|
26
|
-
getById: (id) => services.getById(id),
|
|
27
|
-
getActiveForUser: (ch, uid) => services.getActiveForUser(ch, uid),
|
|
28
|
-
getByBoardMessageId: (mid) => services.getActiveByBoardMessageId(mid),
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
export function registerInteractive(plugin, getServices) {
|
|
32
|
-
plugin.registerInteractiveHandler(`${BJ_PREFIX}:`, async (message) => {
|
|
33
|
-
const services = getServices();
|
|
34
|
-
if (!services)
|
|
35
|
-
return false;
|
|
36
|
-
const choice = await resolveChoice(message, services);
|
|
37
|
-
if (!choice)
|
|
38
|
-
return false;
|
|
39
|
-
const err = await handleChoice(plugin, services, message, choice.sessionId, choice.choiceId);
|
|
40
|
-
if (err)
|
|
41
|
-
await message.$reply?.(err);
|
|
42
|
-
return true;
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
export function registerTextFallback(plugin, getServices) {
|
|
46
|
-
registerGameTextMiddleware(plugin, async (message, next) => {
|
|
47
|
-
const services = getServices();
|
|
48
|
-
if (!services)
|
|
49
|
-
return next();
|
|
50
|
-
const action = getActionFromMessage(message);
|
|
51
|
-
if (action?.payload.startsWith(`${BJ_PREFIX}:`))
|
|
52
|
-
return next();
|
|
53
|
-
const raw = message.$raw?.trim() ?? '';
|
|
54
|
-
const ch = channelKey(message);
|
|
55
|
-
const payloadFromText = resolveGameTextPayload(raw);
|
|
56
|
-
if (payloadFromText?.startsWith(`${BJ_PREFIX}:`)) {
|
|
57
|
-
const parsed = parseChoicePayload(payloadFromText, BJ_PREFIX);
|
|
58
|
-
if (parsed) {
|
|
59
|
-
const session = await services.getById(parsed.sessionId);
|
|
60
|
-
if (session?.channel_key === ch) {
|
|
61
|
-
const err = await handleChoice(plugin, services, message, parsed.sessionId, parsed.choiceId);
|
|
62
|
-
if (err)
|
|
63
|
-
await message.$reply?.(err);
|
|
64
|
-
return;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
const session = await services.getActiveForUser(ch, message.$sender.id);
|
|
69
|
-
if (!session)
|
|
70
|
-
return next();
|
|
71
|
-
if (session.status !== 'active') {
|
|
72
|
-
const map = buildChoiceFallbackMap(BJ_PREFIX, session.id, [
|
|
73
|
-
{ id: 'restart', label: '再来一局', keepEnabledWhenTerminal: true },
|
|
74
|
-
]);
|
|
75
|
-
const payload = resolveGameTextPayload(raw, map);
|
|
76
|
-
const parsed = payload ? parseChoicePayload(payload, BJ_PREFIX) : null;
|
|
77
|
-
if (parsed?.choiceId === 'restart') {
|
|
78
|
-
const err = await handleChoice(plugin, services, message, parsed.sessionId, 'restart');
|
|
79
|
-
if (err)
|
|
80
|
-
await message.$reply?.(err);
|
|
81
|
-
return;
|
|
82
|
-
}
|
|
83
|
-
return next();
|
|
84
|
-
}
|
|
85
|
-
const map = buildChoiceFallbackMap(BJ_PREFIX, session.id, [
|
|
86
|
-
{ id: 'hit', label: '要牌' },
|
|
87
|
-
{ id: 'stand', label: '停牌' },
|
|
88
|
-
]);
|
|
89
|
-
const payload = resolveGameTextPayload(raw, map);
|
|
90
|
-
const parsed = payload ? parseChoicePayload(payload, BJ_PREFIX) : null;
|
|
91
|
-
if (!parsed || parsed.sessionId !== session.id)
|
|
92
|
-
return next();
|
|
93
|
-
const err = await handleChoice(plugin, services, message, session.id, parsed.choiceId);
|
|
94
|
-
if (err)
|
|
95
|
-
await message.$reply?.(err);
|
|
96
|
-
}, 'bj:text');
|
|
97
|
-
}
|
|
98
|
-
//# sourceMappingURL=commands.js.map
|
package/lib/commands.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"commands.js","sourceRoot":"","sources":["../src/commands.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,cAAc,EAAE,oBAAoB,EAAe,MAAM,SAAS,CAAC;AACrF,OAAO,EACL,sBAAsB,EACtB,UAAU,EACV,kBAAkB,EAClB,0BAA0B,EAC1B,iBAAiB,EACjB,sBAAsB,GACvB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAG/C,MAAM,aAAa,GAAG,CAAC,KAAK,EAAE,OAAO,EAAE,SAAS,CAAU,CAAC;AAE3D,SAAS,eAAe,CACtB,MAAc,EACd,OAAe,EACf,IAAY,EACZ,WAAwC;IAExC,MAAM,CAAC,UAAU,CACf,IAAI,cAAc,CAAC,OAAO,CAAC;SACxB,IAAI,CAAC,IAAI,CAAC;SACV,MAAM,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE;QAChC,MAAM,QAAQ,GAAG,WAAW,EAAE,CAAC;QAC/B,IAAI,CAAC,QAAQ;YAAE,OAAO,uBAAuB,CAAC;QAC9C,MAAM,GAAG,GAAI,MAAM,CAAC,MAAM,CAAC,MAA6B,IAAI,EAAE,CAAC;QAC/D,OAAO,YAAY,CAAC,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,CAAC,CAAC;IACtD,CAAC,CAA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,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAEjE;AAED,wBAAgB,YAAY,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,EAAE,MAAM,EAAE,SAAS,MAAM,EAAE,GAAG,KAAK,GAAG,MAAM,GAAG,MAAM,CAQ1G"}
|
package/lib/game-flow.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"game-flow.d.ts","sourceRoot":"","sources":["../src/game-flow.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAW,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAExD,OAAO,EACL,SAAS,EAGT,SAAS,EACT,MAAM,EACP,MAAM,aAAa,CAAC;AAErB,OAAO,EAAyB,KAAK,cAAc,EAAE,MAAM,sBAAsB,CAAC;AA8DlF,wBAAsB,SAAS,CAC7B,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,cAAc,EACxB,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,GACpB,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAiB7B;AAED,wBAAsB,YAAY,CAChC,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,cAAc,EACxB,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,GACpB,OAAO,CAAC,MAAM,CAAC,CAQjB;AAED,wBAAsB,YAAY,CAChC,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,cAAc,EACxB,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,EACrB,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CA8CxB;AAED,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC"}
|
package/lib/hub-register.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hub-register.d.ts","sourceRoot":"","sources":["../src/hub-register.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAE3D,wBAAgB,aAAa,CAAC,WAAW,EAAE,MAAM,cAAc,GAAG,IAAI,GAAG,MAAM,IAAI,CAsBlF"}
|
package/lib/hub-register.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { getPlugin } from 'zhin.js';
|
|
2
|
-
import { ensureGameHubService } from '@zhin.js/game-shared';
|
|
3
|
-
import { runBjCommand, BJ_HELP } from './bj-command.js';
|
|
4
|
-
export function registerBjHub(getServices) {
|
|
5
|
-
const plugin = getPlugin();
|
|
6
|
-
ensureGameHubService(plugin);
|
|
7
|
-
return plugin.registerGame({
|
|
8
|
-
id: 'blackjack',
|
|
9
|
-
title: '21 点',
|
|
10
|
-
icon: '🃏',
|
|
11
|
-
description: '经典 Blackjack,要牌或停牌挑战庄家',
|
|
12
|
-
commandPrefix: '/21点',
|
|
13
|
-
quickStart: '开始',
|
|
14
|
-
aliases: ['bj', '21点'],
|
|
15
|
-
menus: [
|
|
16
|
-
{ id: 'start', label: '🎮 开始新局', style: 'primary' },
|
|
17
|
-
{ id: 'help', label: '📖 玩法说明' },
|
|
18
|
-
],
|
|
19
|
-
runAction: async (actionId, ctx) => {
|
|
20
|
-
const services = getServices();
|
|
21
|
-
if (!services)
|
|
22
|
-
return '21 点需要启用 database 配置。';
|
|
23
|
-
if (actionId === 'help')
|
|
24
|
-
return BJ_HELP;
|
|
25
|
-
return runBjCommand(plugin, services, ctx.message, actionId === 'start' ? '开始' : actionId);
|
|
26
|
-
},
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
//# sourceMappingURL=hub-register.js.map
|
package/lib/hub-register.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hub-register.js","sourceRoot":"","sources":["../src/hub-register.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAGxD,MAAM,UAAU,aAAa,CAAC,WAAwC;IACpE,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;IAC3B,oBAAoB,CAAC,MAAM,CAAC,CAAC;IAC7B,OAAO,MAAM,CAAC,YAAY,CAAC;QACzB,EAAE,EAAE,WAAW;QACf,KAAK,EAAE,MAAM;QACb,IAAI,EAAE,IAAI;QACV,WAAW,EAAE,wBAAwB;QACrC,aAAa,EAAE,MAAM;QACrB,UAAU,EAAE,IAAI;QAChB,OAAO,EAAE,CAAC,IAAI,EAAE,KAAK,CAAC;QACtB,KAAK,EAAE;YACL,EAAE,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE;YACnD,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE;SACjC;QACD,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,EAAE,EAAE;YACjC,MAAM,QAAQ,GAAG,WAAW,EAAE,CAAC;YAC/B,IAAI,CAAC,QAAQ;gBAAE,OAAO,uBAAuB,CAAC;YAC9C,IAAI,QAAQ,KAAK,MAAM;gBAAE,OAAO,OAAO,CAAC;YACxC,OAAO,YAAY,CAAC,MAAM,EAAE,QAAQ,EAAE,GAAG,CAAC,OAAO,EAAE,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;QAC7F,CAAC;KACF,CAAC,CAAC;AACL,CAAC"}
|
package/lib/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
|
package/lib/models.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../src/models.ts"],"names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