This commit is contained in:
Robert Richter 2020-01-18 10:40:30 +01:00
parent 3cfd48a807
commit 6f6fd88e67
7 changed files with 24406 additions and 15 deletions

13
.foreverignore Normal file
View File

@ -0,0 +1,13 @@
node_modules/*
public/*
views/*
misc/*
*.html
*.jpeg
*.png
*.mp3
*.wav
*.md
*.sqlite3
*-journal
sessions

3
.gitignore vendored
View File

@ -75,9 +75,6 @@ typings/
# FuseBox cache # FuseBox cache
.fusebox/ .fusebox/
# Forever
.foreverignore
# old Scripts # old Scripts
_old/ _old/

24378
misc/hexagon_brb_2km.geojson Executable file

File diff suppressed because it is too large Load Diff

View File

@ -5,8 +5,8 @@ var app = express();
var http = require('http') //.Server(app); var http = require('http') //.Server(app);
var https = require('https'); //.Server(app); var https = require('https'); //.Server(app);
var webserver = https.createServer({ var webserver = https.createServer({
key: fs.readFileSync('./server/server.key', 'utf8'), key: fs.readFileSync('./misc/server.key', 'utf8'),
cert: fs.readFileSync('./server/server.cert', 'utf8') cert: fs.readFileSync('./misc/server.cert', 'utf8')
}, app); }, app);
var io = require('socket.io').listen(webserver); var io = require('socket.io').listen(webserver);
var async = require('async'); var async = require('async');

View File

@ -54,9 +54,11 @@ module.exports = function(io, sql, async, app_cfg) {
sql.db_update_client_status(io.sockets.sockets[socket_id], waip_id); sql.db_update_client_status(io.sockets.sockets[socket_id], waip_id);
// Sound erstellen // Sound erstellen
tts_erstellen(app_cfg, socket_id, einsatzdaten, function(tts) { tts_erstellen(app_cfg, socket_id, einsatzdaten, function(tts) {
// Sound senden if (tts) {
sql.db_log('WAIP', 'ttsfile: ' + tts); // Sound senden
io.sockets.to(socket_id).emit('io.playtts', tts); sql.db_log('WAIP', 'ttsfile: ' + tts);
io.sockets.to(socket_id).emit('io.playtts', tts);
};
}); });
}); });
} else { } else {
@ -179,12 +181,13 @@ module.exports = function(io, sql, async, app_cfg) {
var childD = proc.spawn('/bin/sh', commands); var childD = proc.spawn('/bin/sh', commands);
childD.stdin.setEncoding('ascii'); childD.stdin.setEncoding('ascii');
childD.stderr.setEncoding('ascii'); childD.stderr.setEncoding('ascii');
childD.stderr.on('data', function(data) { childD.on('exit', function(code, signal) {
sql.db_log('Fehler-TTS', data); if (code > 0) {
callback && callback(null); sql.db_log('Fehler-TTS', 'Exit-Code '+ code +'; Fehler beim erstellen der TTS-Datei');
}); callback && callback(null);
childD.on('exit', function() { } else {
callback && callback(mp3_url); callback && callback(mp3_url);
};
}); });
childD.stdin.end(); childD.stdin.end();
break; break;