3d-interface/socket.js

21 lines
413 B
JavaScript
Raw Normal View History

2015-06-09 17:40:58 +02:00
var fs = require('fs');
2015-06-29 15:41:18 +02:00
var geo = require('./lib/geo.min.js');
2015-06-09 17:40:58 +02:00
2015-07-03 13:27:05 +02:00
var Log = require('./lib/NodeLog.js');
2015-07-03 11:57:45 +02:00
2015-06-09 17:40:58 +02:00
module.exports = function(io) {
io.on('connection', function(socket) {
2015-06-10 11:24:59 +02:00
2015-07-03 13:27:05 +02:00
Log.socket.connection(socket);
2015-07-02 14:42:54 +02:00
socket.on('disconnect', function() {
2015-07-03 13:27:05 +02:00
Log.socket.disconnect(socket);
2015-07-02 14:42:54 +02:00
});
2015-07-02 14:37:07 +02:00
2015-06-15 17:04:19 +02:00
var streamer = new geo.MeshStreamer();
2015-06-10 11:24:59 +02:00
2015-06-15 17:04:19 +02:00
streamer.start(socket);
2015-06-09 17:40:58 +02:00
});
};