diff --git a/libs/database/init.js b/libs/database/init.js index 7aa1573..4498804 100644 --- a/libs/database/init.js +++ b/libs/database/init.js @@ -5,14 +5,14 @@ import initLog from '../utils/log.js' export let sqlite = undefined export let skinDB = undefined -const log = initLog("DB Init") +const log = initLog("Database") /** * This initalizes the ddnet.sqlite and skindata.sqlite DB... * @module db/dbInit */ export function dbInit() { - console.log("Starting up databases...") + log("Starting up databases...") /* load in db using better-sqlite3 */ sqlite = new Database('ddnet.sqlite', { verbose: console.log }); @@ -24,6 +24,6 @@ export function dbInit() { /* Unsafe mode */ sqlite.unsafeMode() - log("Loaded in ddnet.sqlite...") - log("Loaded in skindata.sqlite...") + log("Loaded in 'ddnet.sqlite'!") + log("Loaded in 'skindata.sqlite'!") } diff --git a/libs/ddnss/handler.js b/libs/ddnss/handler.js index 5e215aa..d18f1af 100644 --- a/libs/ddnss/handler.js +++ b/libs/ddnss/handler.js @@ -9,6 +9,8 @@ export async function ddnssStart() { const getServers = await fetch('https://ddnet.tw/status/index.json'); const servers = await getServers.json(); + log(`Found ${servers.length} online servers!`) + for (const server of servers) { const connection = `${server.ip}:${server.port}` @@ -25,11 +27,13 @@ export async function ddnssStart() { await scrapeServer(`${connection}`) } + // PLEASE!! exec(`pkill -9 -f ddnss`) } function scrapeServer(server) { - + // TODO: Maybe fix the paths to be dynamic? Or have some sort of buildscript... + // -- BurnyLlama const command = `./ddnss/build/DDNet "ui_server_address ${server}" -f ddnss/build/config.conf` return new Promise((resolve, reject) => {