Bundle mission speech with an admin mute option and fix live audio downloads
This commit is contained in:
@@ -26,6 +26,7 @@ PROJECTS = {'core': ('ERR_Core', '2528466DE220D91C', ())}
|
||||
|
||||
DIRECTORIES = {'Scripts', 'Prefabs', 'Configs', 'Missions', 'Worlds', 'UI', 'Materials', 'AI'}
|
||||
SUFFIXES = {'.c', '.et', '.conf', '.ent', '.layer', '.layout', '.emat', '.bt', '.meta', '.gproj', '.imageset', '.png', '.edds'}
|
||||
BUNDLED_SPEECH = re.compile(r'addons/core/Sounds/ERR/Speech/(?:welcome|soldier_[a-z0-9_]+|radio_[0-9]{2})\.(?:wav|acp)(?:\.meta)?$')
|
||||
# Locally authored atlas, with its editable FBX and native import result.
|
||||
# Keep binary-model admission scoped to this reviewed asset, not arbitrary Assets/.
|
||||
ATLAS_ROOT = 'addons/core/Assets/Items/ERR_Atlas/'
|
||||
@@ -118,6 +119,8 @@ def inventory(root):
|
||||
pass
|
||||
elif name.startswith(ATLAS_ROOT) and name[len(ATLAS_ROOT):] in ATLAS_FILES:
|
||||
pass
|
||||
elif BUNDLED_SPEECH.fullmatch(name):
|
||||
pass
|
||||
elif len(parts) < 4 or parts[2] not in DIRECTORIES or path.suffix not in SUFFIXES - {'.gproj'}:
|
||||
raise ValueError(f'unreviewed addon source/resource format: {name}')
|
||||
result[name] = digest
|
||||
@@ -156,6 +159,12 @@ def validate(payload, root):
|
||||
suffix = PurePosixPath(name).suffix
|
||||
if suffix == '.meta':
|
||||
continue
|
||||
if suffix == '.wav':
|
||||
from welcome_voice import validate_wav
|
||||
if not BUNDLED_SPEECH.fullmatch(name) or name + '.meta' not in payload:
|
||||
raise ValueError(f'unregistered bundled speech: {name}')
|
||||
validate_wav(data)
|
||||
continue
|
||||
if name.startswith(ATLAS_ROOT) and suffix in {'.fbx', '.xob', '.txo'}:
|
||||
stem = str(PurePosixPath(name).with_suffix(''))
|
||||
if any(stem + required not in payload for required in ('.xob', '.xob.meta', '.fbx')):
|
||||
|
||||
Reference in New Issue
Block a user