영상 모드 명령을 전부 command_block 큐로 우회 — 모드 없이도 게임 동작
videoCache add/remove/clear 까지 모든 모드 명령을 mcfunction 에서 직접 실행하지 않고 큐(mq:main video.cmdq)에 문자열로 적재한 뒤, 매 tick videos/drain 이 공용 command_block 으로 하나씩 실행(auto 0→1, 1회 실행 후 off)한다. 데이터팩 로드 시 모드 명령을 파싱하지 않으므로 영상 모드 미설치 상태에서도 데이터팩이 정상 로드/플레이된다. - preload/FIFO 축출 다건도 큐를 tick 당 1개씩 소진해 순서 보장 - cache 캐시 추적/dedup/src 결정(video_N vs 전체 URL)을 macro/cmd 로 통합 - 캐시 관련 파일 정리: add_one/preload_loop/evict_one/clear_run/ macro/add_one/macro/evict_one/resolve_src 제거, fill/drain/drain_off 도입 (videos 15→12 파일, cache/macro 폴더 제거) Co-Authored-By: Claude Opus 4 <noreply@anthropic.com>
This commit is contained in:
@@ -1,12 +1,8 @@
|
||||
# 재생 진행에 맞춰 항상 preload 개 앞까지 캐시를 채운다.
|
||||
# 현재 index 에서 (preload-1) 만큼 앞선 영상을 받아두면 시작 시 preload(1..N)
|
||||
# 와 합쳐져 N개 버퍼가 굴러간다.
|
||||
execute store result score cache_preload func.temp run data get storage mq:main video.preload
|
||||
execute if score cache_preload func.temp matches ..0 run return 0
|
||||
|
||||
scoreboard players operation cache_target func.temp = index main
|
||||
scoreboard players operation cache_target func.temp += cache_preload func.temp
|
||||
scoreboard players remove cache_target func.temp 1
|
||||
execute if score cache_target func.temp > max_index main run return 0
|
||||
|
||||
function mq:videos/cache/add_one
|
||||
# 라운드 진행 시 preload 윈도우의 맨 앞(index+preload-1) 한 개를 캐시에 추가.
|
||||
# 시작 preload 와 합쳐 항상 preload 개 버퍼가 굴러간다.
|
||||
execute store result score cache_lo func.temp run data get storage mq:main video.preload
|
||||
execute if score cache_lo func.temp matches ..0 run return 0
|
||||
scoreboard players operation cache_lo func.temp += index main
|
||||
scoreboard players remove cache_lo func.temp 1
|
||||
scoreboard players operation cache_hi func.temp = cache_lo func.temp
|
||||
function mq:videos/cache/fill
|
||||
|
||||
Reference in New Issue
Block a user