기능 안의 부가 기능:라이브 스트리밍
라이브 PK
두 라이브 방송 사이의 배틀: 두 호스트가 경쟁하고, 배틀 중에 보낸 선물이 각 쪽의 포인트가 되며, 모든 배틀이 기록됩니다. 호스트는 라이브 화면에서 PK를 시작합니다.
مروان القحطاني 제작최초 게시 2026. 12. 1.
이 부가 기능에 대하여
두 라이브 방송 사이의 배틀: 두 호스트가 경쟁하고, 배틀 중에 보낸 선물이 각 쪽의 포인트가 되며, 모든 배틀이 기록됩니다. 호스트는 라이브 화면에서 PK를 시작합니다.
하는 일
- 하는 일: 두 호스트가 라이브로 서로에게 도전합니다. 영상 엔진(UTD Stream)이 배틀 자체를 진행하고, 서버는 이를 기록하고 포인트를 셉니다.
- PK 시작하기: 호스트는 라이브 화면에 PK 버튼이 있으며, 이를 누르면 PK 시트와 짝을 이루는 대화상자가 열리고, PK 로고와 무언가 실패했을 때의 전용 메시지가 표시됩니다.
- 선물에서 얻는 포인트: 진행 중인 배틀 동안 방에 보낸 모든 선물(일반 선물 또는 럭키 선물)은 PK 선물로 표시되며, 그 포인트는 자체 큐의 백그라운드 작업을 통해 엔진으로 보내집니다. 그래서 선물이 느려지지 않고 점수가 갱신됩니다. 하나의 결정이 표시와 작업 모두를 결정하므로 둘이 어긋날 수 없습니다. 럭키 선물의 경우 포인트는 실제로 호스트에게 도달한 것입니다.
- 기록: 엔진이 배틀이 시작되었거나 끝났다고 알리면, 서버는 이를 배틀로 기록합니다(시작, 종료, 방). 시작이나 종료 알림이 유실되면, 서버는 그 방에 대해 엔진에 물어보고 기록을 스스로 복구합니다.
- 관리하는 항목: 하나의 스위치(라이브 기능 카드의 PK 챌린지). 꺼져 있으면 새 배틀이 기록되지 않아 진행 중인 배틀이 없고, 선물은 일반 선물로 처리됩니다. 관리 패널에는 화면이 없습니다: 배틀은 읽을 수 있는 테이블에 보관됩니다.
- 일회성 도구: 과거 배틀 중에 보내진 오래된 선물을 표시하는 명령이 있으며, 자신의 기록을 바로잡고 싶은 서버를 위한 것입니다(먼저 드라이 런으로 실행됩니다).
- 음성 룸 PK와 별개: 음성 룸 사이의 PK는 자체 스위치를 가진 다른 애드온이며, 둘 사이에 공유되는 것은 없습니다.
- 모든 테마와 호환: PK 버튼, 시트, 대화상자는 활성 테마의 색을 따릅니다.
- 이 기능의 가치: PK는 라이브에서 선물을 보내는 가장 흥미로운 이유입니다. 시청자는 자기 호스트를 상대편 앞으로 밀어붙이려고 더 많이 보내므로, 배틀은 선물 수익을 높이고 두 시청자 집단을 모두 방에 붙잡아 둡니다.
의존 대상
Live Streaming(이 추가 기능이 이를 확장함)과 기본 사용자, UTD Stream 엔진(배틀을 진행함), 그리고 Gifts(포인트는 선물에서 옴).
앱 화면
옆으로 넘겨 더 보기
설치 및 제거
구매 후에는 “내 구매 내역”에서도 이 명령어를 확인할 수 있습니다.
설치
php artisan feature:install pk_live --apply기능이 설치되어 있지 않다면 이 명령어가 기능도 함께 설치합니다.
제거(데이터는 그대로 남음)
명령 하나로 기본 설정에서 추가 기능을 끕니다(이 페이지에 표시됨). 기록된 배틀은 보존됩니다. 선물은 일반 선물로 계속 작동합니다. 두 배틀 사이에 제거하세요: 그 순간 진행 중인 배틀은 엔진에서 끝나지만, 그 포인트는 더 이상 기록되지 않습니다.
php artisan feature:remove pk_live필요한 기능
먼저 이 기능 중 하나를 설치하세요. 이 애드온은 그 안에서 작동합니다.
설치 및 제거
이 명령어가 기능의 테이블, 관리자 패널 페이지, 권한, 설정, 기본 데이터를 준비해 줍니다. 앱에서는 기능이 알아서 제자리에 나타납니다. 기능이 앱과 관리자 패널에서 사라지지만 데이터는 그대로 남습니다. 다시 설치하면 모든 것이 이전 그대로 돌아옵니다.
구매 후에는 “내 구매 내역”에서도 이 명령어를 확인할 수 있습니다.
설치
php artisan feature:install pk_live --apply기능이 설치되어 있지 않다면 이 명령어가 기능도 함께 설치합니다.
제거(데이터는 그대로 남음)
명령 하나로 기본 설정에서 추가 기능을 끕니다(이 페이지에 표시됨). 기록된 배틀은 보존됩니다. 선물은 일반 선물로 계속 작동합니다. 두 배틀 사이에 제거하세요: 그 순간 진행 중인 배틀은 엔진에서 끝나지만, 그 포인트는 더 이상 기록되지 않습니다.
php artisan feature:remove pk_live이 기능을 내 기능 안에서 사용하기
The short truth: broadcast PK offers other features one port (StreamPkBattles) that whoever sends gifts asks, and emits no event. Never call a class inside Modules/LivePk directly.
Install and remove
- Install:
php artisan feature:install pk_live --apply(the broadcast must be installed). Remove:php artisan feature:remove pk_live --apply. - Requires:
live@^1,voice_rooms@^1,base:users@1.
The port (server)
Modules\VoiceRooms\Contracts\StreamPkBattles (base). The add-on binds the implementation from LivePkServiceProvider::register().
| Method | What it returns or does | Without the add-on |
|---|---|---|
resolveForGift(roomId) | [hasBattle, battleId]: local only, no network and no side effect. roomId is the id the gift names: a stream id for a broadcast, a rooms.id for a voice room | [false, null] |
shouldSpeculativelyRecover(roomId) | use it only if you are about to dispatch a job that can repair the row; it spends the shared recovery token | false |
activeBattleId(roomId) / activeBattleById(id) | the id of the fresh battle, or null | null |
dispatchScore(...) | puts the points job on the queue updatePk | nothing |
Rule: ask resolveForGift once in the gift path and build both the mark and the job on that answer (never ask twice: it can return two different battles).
Events
- What the add-on listens to:
Modules\Live\Events\LiveStreamWebhookReceived(pk_started,pk_ended). What it emits: none.
Data you may read
pk_battles: read through the port, not the table.
Slots (app)
It registers in the broadcast places: liveControlSlot (the PK button for the host) and livePkConfigSlot (the PK setup for the kit).
Server example: a feature that sends a gift in a room
use Modules\VoiceRooms\Contracts\StreamPkBattles;
$pk = app(StreamPkBattles::class);
[$hasBattle, $battleId] = $pk->resolveForGift($roomId); // once
$giftLog->pk = $hasBattle ? 1 : 0;
if ($hasBattle || $pk->shouldSpeculativelyRecover($roomId)) {
$pk->dispatchScore($roomId, $points, $uid, $senderId, $senderName, $senderAvatar, $battleId, time(), $receiverIds);
}Make an add-on inside this feature
pk_live is itself an add-on of the broadcast (kind: addon, parent: live, requires: ["base:users@1", "live@^1", "voice_rooms@^1"]; it declares no add-on of its own). To widen the broadcast itself, the way (the feature.json, the files and the commands) is explained in Modules/Live/FEATURE.md; do not declare parent: pk_live. If your add-on needs PK, put it of: live, add pk_live@^1 to requires, and ask StreamPkBattles as above (it answers as Null without pk_live). Install and remove: php artisan feature:install pk_live --apply / feature:remove pk_live --apply; in the app python tools/apply_features.py --set pk_live on|off (features.yaml: of: live, components: [room_core]).
Settings, permissions and menu
- The switch: the row
app_features.pk_live(the app readsfeatures.pk_live); the migrationsettle_the_pk_live_switch_rowcloses it only when the server has never seen a battle. - Settings, permissions and menu: none. The add-on has no panel screen; the battles are read from
pk_battlesthrough the port. - Table:
pk_battles(additive, grandfathered). The queueupdatePkcarries the points.
변경 내역
1.0.372026. 12. 1. 출시مروان القحطاني 제작