feat(chat): 完善五子棋功能,包含AI对战、PvP邀请、断线重连及界面美化
This commit is contained in:
@@ -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);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user