feat(chat): 完善五子棋功能,包含AI对战、PvP邀请、断线重连及界面美化

This commit is contained in:
2026-03-12 08:35:21 +08:00
parent b9c703b755
commit 1c42f05e20
17 changed files with 2740 additions and 6 deletions
+10
View File
@@ -32,3 +32,13 @@ Broadcast::channel('room.{roomId}', function ($user, $roomId) {
Broadcast::channel('user.{id}', function ($user, $id) {
return (int) $user->id === (int) $id;
});
// 五子棋对局私有频道(仅对局双方可订阅,用于实时同步落子)
Broadcast::channel('gomoku.{gameId}', function ($user, $gameId) {
$game = \App\Models\GomokuGame::find($gameId);
if (! $game) {
return false;
}
return $game->belongsToUser($user->id);
});