mirror of
https://gitlab.com/MrFry/mrfrys-node-server
synced 2025-04-01 20:24:18 +02:00
Motd/version fixes, some logging improvements, manual update
This commit is contained in:
parent
c53c181a5b
commit
e0f7027b26
5 changed files with 22 additions and 98 deletions
11
actions.js
11
actions.js
|
@ -26,10 +26,11 @@ module.exports = {
|
|||
ProcessQA: ProcessQA
|
||||
};
|
||||
|
||||
var recievedFile = "stats/recieved";
|
||||
var staticFile = "public/data/static";
|
||||
var manFile = "public/man.html";
|
||||
var dataFile = "public/data.json";
|
||||
const versionFile = "public/version";
|
||||
const motdFile = "public/motd";
|
||||
const qaFile = "public/qa";
|
||||
|
||||
var logger = require('./logger.js');
|
||||
|
@ -285,6 +286,13 @@ function ProcessIncomingRequest(data) {
|
|||
msg += ". Version: " + d.version;
|
||||
var color = logger.GetColor("green");
|
||||
|
||||
try {
|
||||
data.version = utils.ReadFile(versionFile);
|
||||
data.motd = utils.ReadFile(motdFile);
|
||||
} catch (e) {
|
||||
Log("MOTD/Version writing/reading error!");
|
||||
}
|
||||
|
||||
if (data != undefined && d.data.length > 0){
|
||||
utils.WriteBackup();
|
||||
utils.WriteFile(JSON.stringify(data), dataFile);
|
||||
|
@ -317,7 +325,6 @@ function ProcessIncomingRequest(data) {
|
|||
|
||||
var newStatItems = Process(d, staticFile);
|
||||
|
||||
utils.AppendToFile(logger.GetDateString() + "\n" + d.data, recievedFile);
|
||||
PrintNewCount(d, newStatItems, staticFile);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue