feat: 实现 AI 钓鱼与百家乐游戏的参与逻辑,并支持后台面板配置开关
This commit is contained in:
@@ -89,6 +89,13 @@ class OpenBaccaratRoundJob implements ShouldQueue
|
||||
broadcast(new MessageSent(1, $msg));
|
||||
SaveMessageJob::dispatch($msg);
|
||||
|
||||
// 如果允许 AI 参与,延迟一定时间派发 AI 下注任务
|
||||
$baccaratEnabled = \App\Models\Sysparam::getValue('chatbot_baccarat_enabled', '0') === '1';
|
||||
if (\App\Models\Sysparam::getValue('chatbot_enabled', '0') === '1' && $baccaratEnabled) {
|
||||
$aiDelay = rand(10, min(40, max(10, $betSeconds - 5))); // 随机在 10 ~ (倒数前5秒) 之间下注
|
||||
\App\Jobs\AiBaccaratBetJob::dispatch($round)->delay(now()->addSeconds($aiDelay));
|
||||
}
|
||||
|
||||
// 在下注截止时安排结算任务
|
||||
CloseBaccaratRoundJob::dispatch($round)->delay($closesAt);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user