Merge pull request #1 from Danielv123/master

update
This commit is contained in:
TheAIBot authored and GitHub committed 2016-08-21 10:48:03 +02:00
commit f2f832333c
15 files changed
+80 -3912

No files matched your search

-20
View File
@@ -1,20 +0,0 @@
Copyright (c) 2012, Tiiffi <tiiffi_at_gmail_dot_com>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source
distribution.
+23 -1
View File
@@ -1 +1,23 @@
factorioClusterio
#factorioClusterio
- The first ever mod allowing you to transfer items between worlds
#Windows setup
git clone
npm install
edit config.json
node master.js on the master
start the server on the client, using the right rcon configs
node client.js
connect to server
???
profit!
-111
View File
@@ -1,111 +0,0 @@
Name: mcrcon (minecraft rcon)
Version: 0.0.5
Date: 31.08.2012
License: zlib/libpng License
Contact:
WWW: http://sourceforge.net/projects/mcrcon/
MAIL: tiiffi_at_gmail_dot_com
IRC: tiiffi @ quakenet
Description:
Mcrcon is powerful IPv6 compliant minecraft rcon client with bukkit coloring support.
It is well suited for remote administration and to be used as part of automated server maintenance scripts.
Does not cause "IO: Broken pipe" or "IO: Connection reset" spam in server console.
Features:
- Interacive terminal mode. Keeps the connection alive.
- Send multiple commands in one command line.
- Silent mode. Does not print rcon output.
- Support for bukkit coloring on Windows and Linux (sh compatible shells).
- Multiplatform code. Compiles on many platforms with only minor changes.
Version history:
0.0.5
- IPv6 support!
* Thanks to 'Tanja84dk' for addressing the real need of IPv6.
- Fixed bug causing crash / segmentation fault (invalid write) when receiving malformed rcon packet.
- Program makes use of C99 feature (variable-length arrays) so "-std=gnu99" flag on
GCC-compiler must be used to avoid unecessary warnings.
- Rcon receive buffer is now bigger (2048 bytes -> 10240 bytes).
* Thanks to 'gman_ftw' @ Bukkit forums.
- Fixed invalid error message when receiving empty rcon packet (10 bytes).
* Thanks to 'pkmnfrk' @ bukkit forums.
- Terminal mode now closes automatically when rcon socket is closed by server
or if packet size cannot be retrieved correctly.
- Client now tries to clean the incoming socket data if last package was out of spec.
0.0.4
- Reverted back to default getopts options error handler (opterr = 1).
Custom error handler requires rewriting.
- Some comestic fixes in program output strings.
- Program usage(); function now waits for enter before exiting on Windows.
0.0.3
- Colors are now supported on Windows too!
- Terminal mode is now triggered with "-t" flag. "-i" flag still works for
backwards compatibility.
- Bug fixes (Packet size check always evaluating false and color validity
check always evaluating true).
0.0.2
- License changed from 'ISC License' to 'zlib/libpng License'.
- Bug fixes & code cleanups
- Interactive mode (-i flag). Client acts as interactive terminal.
- Program return value is now the number of rcon commmands sent successfully.
If connecting or authentication fails, the return value is -1.
- Colors are now enabled by default. Now '-c' flag disables the color support.
0.0.1
- Added experimental support for bukkit colors.
Should work with any sh compatible shell.
- Packet string data limited to max 2048 (DATA_BUFFSIZE) bytes.
No idea how Minecraft handles multiple rcon packets.
If someone knows, please mail me so I can implement it.
===================================================================================
Batch (.bat) scripts included in Windows binary package:
launch.bat:
Prompts user for server information and starts mcrcon.exe in terminal mode.
create_shortcut.bat:
Prompts user for server infromation and creates .bat launch script.
This launch (shortcut) script can be used for connecting to the server fast and easily.
===================================================================================
Usage: mcrcon [OPTIONS]... [COMMANDS]...
Sends rcon commands to minecraft server.
Option:
-h Prints usage.
-s Silent mode. Do not print data received from rcon.
-t Terminal mode. Acts as interactive terminal.
-p Rcon password. Default: "".
-H Host address or ip.
-P Port. Default: 25575.
-c Do not print colors. Disables bukkit color printing.
Invidual commands must be separated with spaces.
Example:
mcrcon -c -H 192.168.1.42 -P 9999 -p password cmd1 "cmd2 with spaces"
minecraft rcon (mcrcon) 0.0.5.
Report bugs to tiiffi_at_gmail_dot_com.
-11
View File
@@ -1,11 +0,0 @@
{
"name": "c-inv",
"title": "CreativeInventory",
"version": "0.0.2",
"date": "2015-11-30",
"author": "CNR_Thunder",
"dependencies": ["base >= 0.13"],
"factorio_version": "0.13",
"description": "Adds a Creative Chest/ Tank and a Void Chest/ Tank to the game"
}
+20 -19
View File
@@ -1,35 +1,36 @@
var fs = require('fs');
var needle = require("needle")
var needle = require("needle");
// require config.json
var config = require('./config');
// connect us to the server with rcon
// IP, port, password
var Rcon = require('simple-rcon');
var client = new Rcon({
host: '81.167.2.56',
port: '12345',
password: '123',
timeout: 0
host: config.clientIP,
port: config.clientPort,
password: config.clientPassword,
timeout: 0
}).connect();
client.on('authenticated', function() {
console.log('Authenticated!');
console.log('Authenticated!');
}).on('connected', function() {
console.log('Connected!');
console.log('Connected!');
}).on('disconnected', function() {
console.log('Disconnected!');
// now reconnect
client.connect();
console.log('Disconnected!');
// now reconnect
client.connect();
});
// trigger when something happens to output.txt
fs.watch("Factorio 0.13.9/script-output/output.txt", "utf8", function(eventType, filename) {
fs.watch(config.factorioDirectory + "/script-output/output.txt", "utf8", function(eventType, filename) {
console.log('hit output')
// get array of lines in file
items = fs.readFileSync("Factorio 0.13.9/script-output/output.txt", "utf8").split("\n");
items = fs.readFileSync(config.factorioDirectory + "/script-output/output.txt", "utf8").split("\n");
// if you found anything, reset the file
if(items[0]) {
fs.writeFileSync("Factorio 0.13.9/script-output/output.txt", "")
fs.writeFileSync(config.factorioDirectory + "/script-output/output.txt", "")
}
for(i = 0;i < items.length; i++) {
if(items[i]) {
@@ -37,7 +38,7 @@ fs.watch("Factorio 0.13.9/script-output/output.txt", "utf8", function(eventType,
g[0] = g[0].replace("\u0000", "");
console.log(g);
// send our entity and count to the master for him to keep track of
needle.post('localhost:8080/place', {name:g[0], count:g[1]},
needle.post(config.masterIP + ":" + config.masterPort + '/place', {name:g[0], count:g[1]},
function(err, resp, body){
console.log(body);
});
@@ -45,12 +46,12 @@ fs.watch("Factorio 0.13.9/script-output/output.txt", "utf8", function(eventType,
}
})
fs.watch("Factorio 0.13.9/script-output/orders.txt", "utf8", function(eventType, filename) {
fs.watch(config.factorioDirectory + "/script-output/orders.txt", "utf8", function(eventType, filename) {
// get array of lines in file
items = fs.readFileSync("Factorio 0.13.9/script-output/orders.txt", "utf8").split("\n");
items = fs.readFileSync(config.factorioDirectory + "/script-output/orders.txt", "utf8").split("\n");
// if you found anything, reset the file
if(items[0]) {
fs.writeFileSync("Factorio 0.13.9/script-output/orders.txt", "")
fs.writeFileSync(config.factorioDirectory + "/script-output/orders.txt", "")
}
for(i = 0;i < items.length; i++) {
if(items[i]) {
@@ -59,7 +60,7 @@ fs.watch("Factorio 0.13.9/script-output/orders.txt", "utf8", function(eventType,
g[0] = g[0].replace(",", "");
console.log(g);
// send our entity and count to the master for him to keep track of
needle.post('localhost:8080/remove', {name:g[0], count:g[1]}, function(err, resp, body){
needle.post(config.masterIP + ":" + config.masterPort + '/remove', {name:g[0], count:g[1]}, function(err, resp, body){
console.log(body);
if(body == "success"){
client.exec("/c remote.call('clusterio', 'import', '" + g[0] + "', " + g[1] + ")")
File renamed without changes.
File renamed without changes.
File renamed without changes.
+11
View File
@@ -0,0 +1,11 @@
{
"name": "clusterio",
"title": "Clusterio",
"version": "0.0.2",
"date": "19-08-2016",
"author": "Danielv123 & Keyboardhack",
"dependencies": ["base >= 0.13"],
"factorio_version": "0.13",
"description": "Adds 2 chests to transfer items between saves and servers over the internet."
}
+12
View File
@@ -0,0 +1,12 @@
{
"__comment": "",
"__comment": "IP and port and password the factorio server runs at for rcon connection",
"clientIP": "81.167.2.56",
"clientPort": "12345",
"clientPassword": "123",
"__comment": "Where factorio folder. Should be in the same folder as this config file.",
"factorioDirectory": "factorio 0.13.9",
"__comment": "IP the master web server runs at, can be ignored on the master system",
"masterIP": "localhost",
"masterPort": 8080
}
+9 -3747
View File
File diff suppressed because it is too large. Load diff
+4 -2
View File
@@ -2,6 +2,8 @@
var mkdirp = require("mkdirp");
var nedb = require("nedb")
var fs = require("fs");
// require config.json
var config = require('./config');
var express = require("express");
// Required for express post requests
@@ -44,6 +46,7 @@ db.items.removeitem = function(object, res) {
if (doc) {
// Update existing items if item name already exists
if(Number(doc.count) > Number(object.count)) {
console.log("removed: " + object.name + " " + object.count);
object.count = Number(doc.count) - Number(object.count);
db.items.update(doc, object, {multi:true}, function (err, numReplaced) {});
res.send("success");
@@ -73,11 +76,10 @@ app.post("/place", function(req, res) {
app.post("/remove", function(req, res) {
res.header("Access-Control-Allow-Origin", "*");
res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
console.log("removed: " + req.body.name + " " + req.body.count);
// save items we get
db.items.removeitem(req.body, res);
});
var server = app.listen(8080, function () {
var server = app.listen(config.masterPort || 8080, function () {
console.log("Listening on port %s...", server.address().port);
});
BIN
View File
Binary file not shown.
+1 -1
View File
@@ -18,6 +18,6 @@
"mkdirp": "^0.5.1",
"nedb": "^1.8.0",
"needle": "^1.1.0",
"rcon": "^1.0.2"
"simple-rcon": "^0.3.1"
}
}