diff --git a/README.md b/README.md index be57532..cda8e75 100644 --- a/README.md +++ b/README.md @@ -44,6 +44,11 @@ You can find FFmpeg builds [here](https://github.com/BtbN/FFmpeg-Builds/releases - renderOnInactivityOnly: connect to the o!rdr server once the computer is idle (check every 60 seconds if mouse or keyboard hasn't been touched for 30 seconds). To use this, you need to install the desktop-idle package with "npm install --save desktop-idle". On Windows, it needs Python and VS > 2016 to compile what it needs to work correctly. Check [this](https://github.com/bithavoc/node-desktop-idle) for more informations about this package. Won't work on precompiled builds for the moment. - customSongsFolderPath: use a custom path to store songs downloaded instead of the default (files/danser/Songs). Can be useful if you want new maps on osu! for example. - logTimestamps: add a timestamp before every log line. +- customization: (to use with the official o!rdr instance only) with textColor and backgroundType - change the way your renderer name looks on the website! Changes made to this field are hotswappable and changes are effective almost instantly. + +Available options for textColor: `salmon`, `azure`, `emerald`, `pear`, `pumpkin`, `red`, `teal-blue`, `cream`, `silver-coin`, `botany`, `calm-gold`, `limestone`, `alpine-morning-blue`, `transluscent-white`, `yellow-orange`, `algae-green`. Empty string for default white. + +Available options for backgroundType: from 0 (none) to 6 included. ## Build diff --git a/files/server.js b/files/server.js index fb19cbc..14ddb02 100644 --- a/files/server.js +++ b/files/server.js @@ -20,6 +20,8 @@ exports.startServer = async () => { console.log("Server started!") + let customization = config.customization + setTimeout(() => { if (!ioClient.connected) { console.log("Cannot connect to the o!rdr server. Trying to connect...") @@ -42,7 +44,7 @@ exports.startServer = async () => { ioClient.on("connect", () => { console.log("Connected to the o!rdr server!") - ioClient.emit("id", config.id, version, config.usingOsuApi, config.motionBlurCapable, config.uhdCapable, isRendering()) + ioClient.emit("id", config.id, version, config.usingOsuApi, config.motionBlurCapable, config.uhdCapable, isRendering(), customization) }) ioClient.on("disconnect", () => { @@ -58,6 +60,10 @@ exports.startServer = async () => { dataProcessor(data) }) + ioClient.on("cool_message", message => { + console.log(`The o!rdr server says: ${message}`) + }) + ioClient.on("version_too_old", () => { console.log("This version of the client is too old! Restart it to apply the update.") config.needUpdate = true @@ -80,6 +86,13 @@ exports.startServer = async () => { console.log(`Connection error: ${err.message}`) } }) + + fs.watchFile(process.cwd() + "/config.json", { interval: 1000 }, () => { + console.log("Detected change in the config file, telling changes to the server.") + let newConfig = JSON.parse(fs.readFileSync(process.cwd() + "/config.json", { encoding: "utf-8" })) + customization = newConfig.customization + ioClient.emit("customization_change", newConfig.customization) + }) } exports.sendProgression = data => { diff --git a/main.js b/main.js index abddba4..f160598 100644 --- a/main.js +++ b/main.js @@ -74,6 +74,14 @@ if (typeof config.discordPresence === "undefined") { writeConfig() } +if (typeof config.customization === "undefined") { + config.customization = { + textColor: "", + backgroundType: 0 + } + writeConfig() +} + if (config.logTimestamps) { require("log-timestamp") }