Compare commits

...

6 Commits

9 changed files with 88 additions and 3 deletions

4
.env
View File

@ -27,3 +27,7 @@ AVATAR_FIGUREMAP_URL=http://assets/assets/gamedata/FigureMap.json
AVATAR_EFFECTMAP_URL=http://assets/assets/gamedata/EffectMap.json
AVATAR_ASSET_URL=http://assets/assets/bundled/figure/%libname%.nitro
AVATAR_ASSET_EFFECT_URL=http://assets/assets/bundled/effect/%libname%.nitro
IMAGEPROXY_USER_AGENT="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36"
IMAGEPROXY_ADDR=0.0.0.0:8080
IMAGEPROXY_CACHE=/tmp/imageproxy

4
.gitignore vendored
View File

@ -5,7 +5,9 @@ assets/translation/gamedata/
assets/translation/*.sql
!assets/translation/update_crackable.sql
!assets/translation/fix_room_items.sql
!assets/translation/fix_song_disks.sql
assets/swf
assets/usercontent/**/*.png
~$*.xlsx
export/
export/
assets/usercontent/imageproxy/

View File

@ -76,10 +76,12 @@ UPDATE emulator_settings SET `value`='/app/assets/usercontent/camera/' WHERE `k
UPDATE emulator_settings SET `value`='/app/assets/usercontent/camera/thumbnail/' WHERE `key`='imager.location.output.thumbnail';
UPDATE emulator_settings SET `value`='/app/assets/usercontent/badgeparts/' WHERE `key`='imager.location.output.badges';
UPDATE emulator_settings SET `value`='/app/assets/usercontent/badgeparts/generated/' WHERE `key`='imager.location.output.badges';
UPDATE emulator_settings SET `value`='/app/assets/swf/c_images/Badgeparts' WHERE `key`='imager.location.badgeparts';
UPDATE emulator_settings SET `value`='http://127.0.0.1:8080/api/imageproxy/0x0/http://img.youtube.com/vi/%video%/default.jpg' WHERE `key`='imager.url.youtube';
UPDATE emulator_settings SET `value`='0' WHERE `key`='console.mode';
```

View File

@ -35,6 +35,10 @@ server {
return 403;
}
location ^~ /api/imageproxy/ {
proxy_pass http://imgproxy:8080/;
}
location ~* (.*/thumbnail)/(.+\.png)$ {
# kill cache
expires -1;

View File

@ -22,6 +22,8 @@ with open('gamedata/furnidata.json', 'r', encoding='utf-8') as f:
"description": furnitype['description'],
"specialtype": furnitype['specialtype'],
}
if str(furniture_dict[classname]['description']).endswith("desc"):
furniture_dict[classname]['description'] = ""
with open('gamedata/productdata.json', 'r', encoding='utf-8') as f:
product_data = json.load(f)
@ -31,6 +33,8 @@ with open('gamedata/productdata.json', 'r', encoding='utf-8') as f:
"name": product['name'],
"description": product['description'],
}
if str(furniture_dict[classname]['description']).endswith("desc"):
furniture_dict[classname]['description'] = ""
orig_furniture_data = {}
# Load the JSON file

View File

@ -0,0 +1,56 @@
import json
import glob
import os
from fuzzywuzzy import process, fuzz
def normalize_classnames(classname):
return str(classname).replace("_", "").replace(" ", "")
todo_types = ["roomitemtypes", "wallitemtypes"]
orig_furniture_data = {}
# Load the JSON file
with open('../assets/gamedata/FurnitureData.json', 'r', encoding='utf-8') as f:
orig_furniture_data = json.load(f)
orig_product_dict = {}
# Load the JSON file
with open('../assets/gamedata/ProductData.json', 'r', encoding='utf-8') as f:
orig_product_dict = json.load(f)
classnames = set()
for todo_type in todo_types:
for furnitype in orig_furniture_data[todo_type]["furnitype"]:
classnames.add(normalize_classnames(furnitype['classname']))
for product in orig_product_dict["productdata"]["product"]:
classnames.add(normalize_classnames(product['code']))
not_matched = set()
nitro_files = glob.glob("../assets/bundled/furniture/*.nitro")
nitro_files_len = float(len(nitro_files))
for index, nitro in enumerate(nitro_files):
f_name = os.path.basename(nitro)
normalized = normalize_classnames(f_name.rstrip(".nitro"))
matched = False
perc = str(round((float(index + 1) / nitro_files_len) * 100.0, 2)) + "%"
for clazz in classnames.copy():
string_matched = fuzz.ratio(clazz, normalized)
if string_matched > 75:
matched = True
print("Matched", f_name, clazz, perc)
break
if not matched:
not_matched.add(nitro)
print("Unmatched delete", f_name, perc)
os.remove(nitro)
print()
print()
print("-------------------------------")
print(f"Known Classes: {len(classnames)}")
print(f"Unused Files: {len(not_matched)} this result in {int(nitro_files_len - len(not_matched))} remaining files")

View File

@ -0,0 +1 @@
UPDATE catalog_items SET catalog_items.catalog_name = 'SONG song_disk' WHERE catalog_items.song_id > 0;

View File

@ -104,5 +104,17 @@ services:
restart: unless-stopped
networks: [nitro]
imgproxy:
image: ghcr.io/willnorris/imageproxy
depends_on:
# proxied through nginx of assets
- assets
volumes:
- "./assets/usercontent/imageproxy/cache:/tmp/imageproxy"
env_file:
- .env
restart: unless-stopped
networks: [nitro]
networks:
nitro:

View File

@ -1,7 +1,7 @@
FROM node:lts-alpine as builder
ARG BRANCH=main
ARG COMMIT=16475d5
ARG COMMIT=9a88668
WORKDIR /build