Finished upgrade logic

This commit is contained in:
rainbow napkin 2026-07-06 01:06:33 -04:00
parent d03e221891
commit 0dda73cd14
8 changed files with 230 additions and 32 deletions

View file

@ -142,12 +142,20 @@ module.exports.socketCriticalExceptionHandler = function(socket, err){
return socket.disconnect();
}
/**
* Shouts into the server console
* @param {String} string - String to shout into to the console
*/
module.exports.consoleShout = function(string){
console.warn('\x1b[31m\x1b[4m%s\x1b[0m',string);
}
/**
* Prints warning text to server console
* @param {String} string - String to print to console
*/
module.exports.consoleWarn = function(string){
console.warn('\x1b[31m\x1b[4m%s\x1b[0m',string);
console.warn('\x1b[33m%s\x1b[0m',string);
}
/**
@ -208,7 +216,7 @@ module.exports.dumpLog = async function(content, name, subDir = '/', muzzle = fa
}catch(err){
if(!muzzle){
//Shout about it
module.exports.consoleWarn("Log folder missing, mking dir!")
module.exports.consoleShout("Log folder missing, mking dir!")
}
//Make it if doesn't
@ -223,17 +231,17 @@ module.exports.dumpLog = async function(content, name, subDir = '/', muzzle = fa
if(!muzzle){
//Whine about the error
module.exports.consoleWarn(`Warning: Unexpected Server Crash gracefully dumped to '${path}'... SOMETHING MAY BE VERY BROKEN!!!!`);
module.exports.consoleShout(`Warning: Unexpected Server Crash gracefully dumped to '${path}'... SOMETHING MAY BE VERY BROKEN!!!!`);
}
//If somethine went really really wrong
}catch(doubleErr){
if(!muzzle){
//Use humor to cope with the pain
module.exports.consoleWarn("Yo Dawg, I herd you like errors, so I put an error in your error dump, so you can dump while you dump:");
module.exports.consoleShout("Yo Dawg, I herd you like errors, so I put an error in your error dump, so you can dump while you dump:");
//Dump the original error to console
module.exports.consoleWarn(err);
module.exports.consoleShout(err);
//Dump the error we had saving that error to file to console
module.exports.consoleWarn(doubleErr);
module.exports.consoleShout(doubleErr);
}
}
}