mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-11 23:04:52 +09:00
NPM5.0.1, housekeeping
This commit is contained in:
1 parent
fdf8a4b4b1
commit
8ee3109fbc
5 files changed
+1578
-27
No files matched your search
Generated
+1573
File diff suppressed because it is too large.
Load diff
+3
-1
@@ -2,6 +2,7 @@
|
||||
"name": "clusterio",
|
||||
"version": "1.0.0",
|
||||
"description": "Interserver communication for factorio",
|
||||
"repository": "https://github.com/Danielv123/factorioClusterio",
|
||||
"main": "master.js",
|
||||
"scripts": {
|
||||
"test": "npm run test-unit",
|
||||
@@ -44,6 +45,7 @@
|
||||
"chai": "^3.5.0",
|
||||
"istanbul": "^0.4.5",
|
||||
"mocha": "^3.4.1",
|
||||
"mock-fs": "^4.3.0"
|
||||
"mock-fs": "^4.3.0",
|
||||
"nock": "^9.0.13"
|
||||
}
|
||||
}
|
||||
@@ -18,20 +18,7 @@ process.stdin.on('readable', () => {
|
||||
functions.handleInventory(inventory, config);
|
||||
} else if(isJson(chunk) && JSON.parse(chunk).factorioPort){
|
||||
config = JSON.parse(chunk);
|
||||
// if its a LUA table message returning with the exports send em off to master
|
||||
}/* else if(!isJson(chunk) && !!chunk && config){
|
||||
let thing = functions.parseJsString(chunk.replace(/=/g, ":"));
|
||||
Object.keys(thing).forEach(function(playerName){
|
||||
Object.keys(thing[playerName]).forEach(function(itemName){
|
||||
needle.post(config.masterIP + ":" + config.masterPort + '/api/place', {
|
||||
name: itemName,
|
||||
count: thing[playerName][itemName]
|
||||
}, function (err, resp, body) {
|
||||
// console.log(body);
|
||||
});
|
||||
});
|
||||
});
|
||||
}*/
|
||||
}
|
||||
});
|
||||
process.stdin.on('end', () => {
|
||||
process.stdout.write('end');
|
||||
|
||||
@@ -17,17 +17,6 @@ function parseJsString(string){
|
||||
/*console.log(string)
|
||||
console.log(inventory)*/
|
||||
return inventory;
|
||||
/* Example output:
|
||||
{'1':{
|
||||
inventory: {
|
||||
'raw-wood': 4
|
||||
},
|
||||
requestSlots:{
|
||||
'underground-belt': 50,
|
||||
'fast-transport-belt': 50,
|
||||
'express-underground-belt': 50
|
||||
}}}
|
||||
*/
|
||||
}
|
||||
function handleInventory(json, config){
|
||||
/*
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
const isJson = require("./isJson");
|
||||
const assert = require("assert");
|
||||
|
||||
describe("isJson.js()", function(){
|
||||
describe("inventoryImports/isJson.js()", function(){
|
||||
it("checks if a thing is valid JSON", function(){
|
||||
assert(isJson("string") === false);
|
||||
assert(isJson("{js_object_notation='very false'}") === false);
|
||||
|
||||
Reference in new issue
Block a user