mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-17 23:33:12 +09:00
#61 start of map store/retrieve, communication channel using websockets
This commit is contained in:
1 parent
2bcacb2513
commit
7ece1af073
9 files changed
+422
-4
No files matched your search
@@ -603,8 +603,21 @@ app.get("/api/getFactorioLocale", function(req,res){
|
||||
getFactorioLocale.asObject(config.factorioDirectory, "en", (err, factorioLocale) => res.send(factorioLocale));
|
||||
});
|
||||
|
||||
var server = app.listen(config.masterPort || 8080, function () {
|
||||
var server = require("http").Server(app);
|
||||
server.listen(config.masterPort || 8080, function () {
|
||||
console.log("Listening on port %s...", server.address().port);
|
||||
});
|
||||
/* Websockets for remoteMap */
|
||||
var io = require("socket.io")(server);
|
||||
var slaveMappers = {};
|
||||
io.on('connection', function (socket) {
|
||||
socket.emit('hello', { hello: 'world' });
|
||||
socket.on('registerSlaveMapper', function (data) {
|
||||
console.log(data);
|
||||
slaveMappers[data.instanceID].getChunk = function getChunk(x,y){
|
||||
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
module.exports = app;
|
||||
Reference in new issue
Block a user