mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-24 08:23:12 +09:00
Added setting disableFairItemDistribution to disable dole division factor
This commit is contained in:
1 parent
7e0b131557
commit
103409b0cd
2 files changed
+22
No files matched your search
@@ -47,6 +47,7 @@
|
|||||||
"entriesPerSecond": 0.01666666667
|
"entriesPerSecond": 0.01666666667
|
||||||
},
|
},
|
||||||
"logItemTransfers": false,
|
"logItemTransfers": false,
|
||||||
|
"disableFairItemDistribution": false,
|
||||||
"uploadModsToMaster": true,
|
"uploadModsToMaster": true,
|
||||||
"msBetweenCommands": 10,
|
"msBetweenCommands": 10,
|
||||||
"allowRemoteCommandExecution": true,
|
"allowRemoteCommandExecution": true,
|
||||||
|
|||||||
@@ -566,6 +566,27 @@ app.post("/api/remove", authenticate.middleware, function(req, res) {
|
|||||||
console.log('failure could not find ' + object.name);
|
console.log('failure could not find ' + object.name);
|
||||||
}
|
}
|
||||||
res.send({name:object.name, count:0});
|
res.send({name:object.name, count:0});
|
||||||
|
} else if(config.disableFairItemDistribution){
|
||||||
|
let numberToRemove = Math.min(Math.abs(Number(object.count)),Number(item));
|
||||||
|
db.items.removeItem({count: numberToRemove, name: object.name});
|
||||||
|
res.send({count: numberToRemove, name: object.name});
|
||||||
|
|
||||||
|
// track statistics and do graphing things
|
||||||
|
prometheusImportGauge.labels(object.instanceID, object.name).inc(Number(numberToRemove) || 0);
|
||||||
|
let sentItemStatistics = sentItemStatisticsBySlaveID[object.instanceID];
|
||||||
|
if(sentItemStatistics === undefined){
|
||||||
|
sentItemStatistics = new averagedTimeSeries({
|
||||||
|
maxEntries: config.itemStats.maxEntries,
|
||||||
|
entriesPerSecond: config.itemStats.entriesPerSecond,
|
||||||
|
mergeMode: "add",
|
||||||
|
}, console.log);
|
||||||
|
}
|
||||||
|
sentItemStatistics.add({
|
||||||
|
key:object.name,
|
||||||
|
value:numberToRemove,
|
||||||
|
});
|
||||||
|
//console.log(sentItemStatistics.data)
|
||||||
|
sentItemStatisticsBySlaveID[object.instanceID] = sentItemStatistics;
|
||||||
} else {
|
} else {
|
||||||
const originalCount = Number(object.count) || 0;
|
const originalCount = Number(object.count) || 0;
|
||||||
object.count /= ((_doleDivisionFactor[object.name]||0)+doleDivisionRetardation)/doleDivisionRetardation;
|
object.count /= ((_doleDivisionFactor[object.name]||0)+doleDivisionRetardation)/doleDivisionRetardation;
|
||||||
|
|||||||
Reference in new issue
Block a user