영상 캐시 기능 추가: 시작 시 미리받기 + 동적 재생 + FIFO 축출 + 주소 / 자동제거
- config 에 preload(미리받기 갯수)/keep(유지 갯수) 추가 - 시작 시 1..preload 캐시 미리받기, 재생 중에도 preload 개 앞까지 롤링 prefetch - 재생 시 캐시 있으면 video_N, 없으면 전체 URL 로 동적 선택(데이터팩 self-tracking) - keep 초과 시 가장 먼저 받은 캐시부터 삭제(FIFO) - namespace 끝 / 자동 제거(normalize) - command_block 한 tick 1회 발동 제약 회피: cache add/remove 직접 실행, clear 는 schedule Co-Authored-By: Claude Opus 4 <noreply@anthropic.com>
This commit is contained in:
7
music_quiz/data/mq/function/videos/cache/macro/add_one.mcfunction
vendored
Normal file
7
music_quiz/data/mq/function/videos/cache/macro/add_one.mcfunction
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
# 이미 받은 영상이면(추적 목록에 {i:num} 존재) 건너뜀.
|
||||
$execute if data storage mq:main video.cached[{i:$(num)}] run return 0
|
||||
# videoCache add 는 서버 소스(또는 OP)에서 직접 실행. preload/select 모두 서버
|
||||
# 소스이므로 command_block 우회 없이 바로 호출 가능.
|
||||
$videoCache add video_$(num) $(namespace)/$(num)
|
||||
$data modify storage mq:main video.cached append value {i:$(num)}
|
||||
function mq:videos/cache/evict
|
||||
1
music_quiz/data/mq/function/videos/cache/macro/evict_one.mcfunction
vendored
Normal file
1
music_quiz/data/mq/function/videos/cache/macro/evict_one.mcfunction
vendored
Normal file
@@ -0,0 +1 @@
|
||||
$videoCache remove video_$(evict_num)
|
||||
Reference in New Issue
Block a user