diff --git a/actions.js b/actions.js index 493a2e9..2abd8a0 100755 --- a/actions.js +++ b/actions.js @@ -44,12 +44,12 @@ function Process(d, file) { var oldRes = CheckData(oldFile); if (newRes.count > 0) - logger.Log("[NLOD]: new file result: " + newRes.count); + logger.Log("[NLOD]: new file result: " + newRes.count, logger.GetColor("blue")); else logger.Log("[NLOD]: new file NLOD error, " + newRes.log, logger.GetColor("redbg"), true); if (oldRes.count > 0) - logger.Log("[NLOD]: old public result: " + oldRes.count); + logger.Log("[NLOD]: old public result: " + oldRes.count, logger.GetColor("blue")); else logger.Log("[NLOD]: old public NLOD error, " + oldRes.log, logger.GetColor("redbg"), true); @@ -60,11 +60,13 @@ function Process(d, file) { } else logger.Log("[PCES]: No new data."); + } catch (e) { Beep(); logger.Log("[ERR ]: Error at processing data! File: " + file, logger.GetColor("redbg")); logger.Log(e.toString(), logger.GetColor("redbg")); } + return -1; } function ProcessIncomingRequest(data) { @@ -93,6 +95,14 @@ function ProcessIncomingRequest(data) { Process(d, publicFile); Process(d, staticFile); }*/ + try { + var splitted = d.alldata.split("\n"); + var count = 0; + for (var i = 0; i < splitted.length; i++) + if (splitted[i][0] == '?') + count ++; + logger.Log("[PCES]: Test all question count: " + count, logger.GetColor("blue")); + } catch (e) {console.log("Error :c"); console.log(e);} var newPubItems = Process(d, publicFile); var newStatItems = Process(d, staticFile); diff --git a/server.js b/server.js index 8e13604..1987b66 100755 --- a/server.js +++ b/server.js @@ -243,7 +243,7 @@ app.post('*', function(req, res) { stat.Load(); app.listen(port); -logger.Log("[START]: Server listening on port " + port + "..."); +logger.Log("[START]: Server listening on port " + port + "...", logger.GetColor("yellow")); function Log(req, toFile) { try { diff --git a/views/main.ejs b/views/main.ejs index 7cc4ca3..d5bee92 100755 --- a/views/main.ejs +++ b/views/main.ejs @@ -21,9 +21,9 @@ greasyforkon | Manual | -Szerver repó +Szerver repó | -Userscript repó +Userscript repó