feat(bunsik): 직접 만든 효과음 4개, 게임 아이콘·썸네일
- tools/sfx.py: 동전·구매·확장·조리음 합성, 오디오 에셋으로 업로드(Sounds.luau) - 구매·확장 소리는 클라이언트에서 2D로, 동전 소리는 손님 자리에서 재생 - tools/art.py: 게임 아이콘(512)과 썸네일(1920x1080) 그림 추가 - cloud.py: 오디오 업로드·에셋 상태 조회 명령, 통합 테스트에 효과음 소유 확인(526개 통과) - DECISIONS: 에셋은 없으면 직접 만든다는 원칙과 현황 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
python3 tools/cloud.py run script.luau [--version N] [--out file] # 기본: 가장 최근 저장 버전
|
||||
python3 tools/cloud.py products # 게임패스·개발자 상품 만들기(이미 있으면 건너뜀)
|
||||
python3 tools/cloud.py place # 서버 인원 6명, 설명 설정
|
||||
python3 tools/cloud.py audio sfx/coin.ogg "이름" # 효과음 업로드, 에셋 ID 출력
|
||||
|
||||
API 키는 ~/.config/ejclaw/secrets.json 의 roblox.opencloud/bunsik-tycoon 에서 읽습니다.
|
||||
"""
|
||||
@@ -16,6 +17,7 @@ import urllib.error
|
||||
import urllib.request
|
||||
|
||||
UNIVERSE = 10770390863
|
||||
CREATOR_USER = 4054147118 # tkrmagid
|
||||
PLACE = 98118751156219
|
||||
SECRETS = os.path.expanduser("~/.config/ejclaw/secrets.json")
|
||||
|
||||
@@ -143,7 +145,43 @@ def place():
|
||||
return request("PATCH", url, body)
|
||||
|
||||
|
||||
def upload_audio(path, name):
|
||||
meta = {
|
||||
"assetType": "Audio",
|
||||
"displayName": name,
|
||||
"description": "Bunsik Tycoon sound effect (synthesized, original).",
|
||||
"creationContext": {"creator": {"userId": str(CREATOR_USER)}},
|
||||
}
|
||||
boundary = "----bunsik" + str(int(time.time() * 1000))
|
||||
with open(path, "rb") as f:
|
||||
data = f.read()
|
||||
body = (f"--{boundary}\r\nContent-Disposition: form-data; name=\"request\"\r\n"
|
||||
f"Content-Type: application/json\r\n\r\n{json.dumps(meta)}\r\n").encode()
|
||||
body += (f"--{boundary}\r\nContent-Disposition: form-data; name=\"fileContent\"; "
|
||||
f"filename=\"{os.path.basename(path)}\"\r\nContent-Type: audio/ogg\r\n\r\n").encode()
|
||||
body += data + f"\r\n--{boundary}--\r\n".encode()
|
||||
op = request("POST", "https://apis.roblox.com/assets/v1/assets", body, f"multipart/form-data; boundary={boundary}")
|
||||
for _ in range(60):
|
||||
if op.get("done"):
|
||||
break
|
||||
time.sleep(3)
|
||||
op = request("GET", f"https://apis.roblox.com/assets/v1/{op['path']}")
|
||||
if op.get("error"):
|
||||
raise SystemExit(f"업로드 실패: {op['error']}")
|
||||
return op.get("response", {}).get("assetId")
|
||||
|
||||
|
||||
def asset_status(asset_id):
|
||||
return request("GET", f"https://apis.roblox.com/assets/v1/assets/{asset_id}?readMask=moderationResult,state")
|
||||
|
||||
|
||||
def main(argv):
|
||||
if argv[:1] == ["audio"]:
|
||||
print(upload_audio(argv[1], argv[2]))
|
||||
return 0
|
||||
if argv[:1] == ["asset"]:
|
||||
print(json.dumps(asset_status(argv[1]), ensure_ascii=False))
|
||||
return 0
|
||||
if argv[:1] == ["products"]:
|
||||
print(json.dumps(products()))
|
||||
return 0
|
||||
|
||||
Reference in New Issue
Block a user