mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-03-22 10:24:29 -05:00
* initial * wip * wip * wip * pr comment * remove todo * add a few placeholders * todos done
2.8 KiB
2.8 KiB
Scripts
Note: These are mostly useful if you are running the site in production as an admin, not typically for development.
Add new badge to the database
npx tsx scripts/add-badge.ts fire_green "Octofin Eliteboard"
Rename display name of a badge
npx tsx scripts/rename-badge.ts 10 "New 4v4 Sundaes"
Add many badge owners
npx tsx scripts/add-badge-winners.ts 10 "750705955909664791,79237403620945920"
Converting gifs (badges) to thumbnail (.png)
sips -s format png ./sundae.gif --out .
Convert many .png files to .avif
While in the folder with the images:
for i in *.png; do npx @squoosh/cli --avif '{"cqLevel":33,"cqAlphaLevel":-1,"denoiseLevel":0,"tileColsLog2":0,"tileRowsLog2":0,"speed":6,"subsample":1,"chromaDeltaQ":false,"sharpness":0,"tune":0}' $i; done
Note: it only works with Node 16.
Doing monthly update
- Fill /scripts/dicts with new data from leanny repository:
- weapon = contents of
weaponfolder - langs = contents of
languagefolder - Couple of others at the root:
GearInfoClothes.json,GearInfoHead.json,GearInfoShoes.json,spl__DamageRateInfoConfig.pp__CombinationDataTableData.json,SplPlayer.game__GameParameterTable.json,WeaponInfoMain.json,WeaponInfoSpecial.jsonandWeaponInfoSub.json
- weapon = contents of
- Update all
CURRENT_SEASONconstants - Update
CURRENT_PATCHconstants - Update
PATCHESconstant with the late patch + remove the oldest - Update the stage list in
stage-ids.tsandcreate-misc-json.ts. Add images from Lean's repository and avify them. npx tsx scripts/create-misc-json.tsnpx tsx scripts/create-gear-json.tsnpx tsx scripts/create-analyzer-json.ts8a. Double check that no hard-coded special damages changednpx tsx scripts/create-object-dmg-json.ts- Fill new weapon IDs by category to
weapon-ids.ts(easy to take from the diff of English weapons.json) - Get gear IDs for each slot from /output folder and update
gear-ids.ts. - Replace
object-dmg.jsonwith theobject-dmg.jsonin /output folder - Replace
weapon-params.tswith theparams.jsonin /output folder - Delete all images inside
main-weapons,main-weapons-outlined,main-weapons-outlined-2andgearfolders. - Replace with images from Lean's repository.
- Run the
npx tsx scripts/replace-img-names.tscommand - Run the
npx tsx scripts/replace-weapon-names.tscommand - Run the .avif generating command in each image folder.
- Update manually any languages that use English
gear.jsonandweapons.jsonfiles
Download the production database from Render.com
Note: This is only useful if you have access to a production running on Render.com
- Access the "Shell" tab
cd /var/datacp db.sqlite3 db-copy.sqlite3wormhole send db-copy.sqlite3- On the receiving computer use the command shown.