patch shit properly

This commit is contained in:
Soph :3 2024-11-25 17:25:15 +02:00
parent 5c0c24a170
commit 09436dfdb7
Signed by: sophie
GPG key ID: EDA5D222A0C270F2
8 changed files with 190 additions and 24 deletions

View file

@ -0,0 +1,25 @@
def downloadScript [] {
rm -f bundle.js
print $"(ansi yellow)Downloading the script.."
wget -q https://pianoverse.net/bundle.js
}
def applyPatches [] {
print $"(ansi yellow)Applying patches!.."
let patches = (ls build | find .patch | each { |i| $i.name })
$patches
| each {|i|
let splitted = open $i | split row -r '\n';
let needle = $splitted | get 0;
let haystack = $splitted | skip 1 | str join "";
open bundle.js | str replace $needle $haystack| save -f bundle.js
print $"(ansi green)Applied patch ($i)!"
}
}
downloadScript
applyPatches
print $"(ansi green)Happy hacking!"

16
build/downloadSounds.nu Normal file
View file

@ -0,0 +1,16 @@
mkdir sounds
cd sounds
mkdir grand
mkdir salamander
mkdir soft
mkdir electric
cd salamander
for $x in 21..108 {wget $"https://pianoverse.net/sounds/salamander/($x).mp3"}
cd grand
for $x in 21..108 {wget $"https://pianoverse.net/sounds/grand/($x).mp3"}
cd soft
for $x in 21..108 {wget $"https://pianoverse.net/sounds/soft/($x).mp3"}
cd electric
for $x in 21..108 {wget $"https://pianoverse.net/sounds/electric/($x).mp3"}

7
build/internal.patch Normal file

File diff suppressed because one or more lines are too long

10
build/ws.patch Normal file
View file

@ -0,0 +1,10 @@
this._ws=new WebSocket("wss://pianoverse.net","pianoverse")
let wsurl="";
if(!localStorage.host) {
wsurl = "wss://api.pianoverse.me";
} else if(localStorage.host=="mainline") {
wsurl = "wss://pianoverse.net"
} else if(localStorage.host == "dev") {
wsurl = "ws://127.0.0.1:8081"
};
this._ws = new WebSocket(wsurl,"pianoverse")