支持所有游戏按房间范围配置和运行

This commit is contained in:
pllx
2026-04-29 14:37:28 +08:00
parent 3672140987
commit 1607f57e3c
37 changed files with 1033 additions and 255 deletions
+9 -6
View File
@@ -28,6 +28,9 @@ use Illuminate\Foundation\Queue\Queueable;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Redis;
/**
* 类功能:完成一局百家乐的开奖、派奖与通知。
*/
class CloseBaccaratRoundJob implements ShouldQueue
{
use Queueable;
@@ -227,7 +230,7 @@ class CloseBaccaratRoundJob implements ShouldQueue
return;
}
$roomId = 1;
$roomId = (int) $round->room_id;
$roundResultLabel = $round->resultLabel();
foreach ($participantSettlements as $settlement) {
@@ -309,11 +312,11 @@ class CloseBaccaratRoundJob implements ShouldQueue
$detail = $detailParts ? ' '.implode(' ', $detailParts) : '';
$content = "🎲 【百家乐】第 #{$round->id} 局开奖!{$diceStr} 总点 {$round->total_points} {$resultText}{$payoutText}{$detail}";
$content = "🎲 {$diceStr} {$round->total_points} 点,{$resultText}{$payoutText}{$detail}";
$msg = [
'id' => $chatState->nextMessageId(1),
'room_id' => 1,
'id' => $chatState->nextMessageId((int) $round->room_id),
'room_id' => (int) $round->room_id,
'from_user' => '系统传音',
'to_user' => '大家',
'content' => $content,
@@ -322,8 +325,8 @@ class CloseBaccaratRoundJob implements ShouldQueue
'action' => '大声宣告',
'sent_at' => now()->toDateTimeString(),
];
$chatState->pushMessage(1, $msg);
broadcast(new MessageSent(1, $msg));
$chatState->pushMessage((int) $round->room_id, $msg);
broadcast(new MessageSent((int) $round->room_id, $msg));
SaveMessageJob::dispatch($msg);
// 触发微信机器人消息推送 (百家乐结果,无人参与时不推送微信群防止刷屏)