Fixed export statistics being logged under "unknown"

This commit is contained in:
Danielv123 committed 2017-10-29 23:37:46 +01:00
1 parent bfbe7e7d1c
commit 0dd6315abc
2 files changed
+3 -6

No files matched your search

+1 -1
View File
@@ -545,7 +545,7 @@ function instanceManagement() {
name: g[0],
count: g[1],
instanceName: instance, // name of instance
unique: instanceconfig.unique, // a hash computed from the randomly generated rcon password
instanceID: instanceconfig.unique, // a hash computed from the randomly generated rcon password
}, function (err, resp, body) {
if(body == "failure") console.error("#### Export failed! Lost: "+g[1]+" "+g[0]);
});
+2 -5
View File
@@ -231,15 +231,12 @@ app.post("/api/place", function(req, res) {
if(!x.instanceID) {
x.instanceID = "unknown";
}
if(!x.unique) {
x.unique = "unknown";
}
if( x.unique
if( x.instanceID
&& x.instanceName
&& !isNaN(Number(x.count))// This is in no way a proper authentication or anything, its just to make sure everybody are registered as slaves before modifying the cluster (or not, to maintain backwards compat)
/*&& stringUtils.hashCode(slaves[x.unique].rconPassword) == x.unique*/){
console.log("added: " + req.body.name + " " + req.body.count+" from "+x.instanceName+" ("+x.unique+")");
console.log("added: " + req.body.name + " " + req.body.count+" from "+x.instanceName+" ("+x.instanceID+")");
// gather statistics
let recievedItemStatistics = recievedItemStatisticsBySlaveID[x.instanceID];
if(recievedItemStatistics === undefined){