mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-13 19:33:46 +00:00
Merge pull request #4 from cpvalente/fix/osc
Fix/osc: fixed issue where process would crash when receiving unknown OSC datatypes
This commit is contained in:
@@ -5,6 +5,9 @@ const initiateOSC = (config) => {
|
||||
console.log(`OSC Server is listening on port ${config.port}`);
|
||||
});
|
||||
|
||||
// error
|
||||
oscServer.on('error', console.error);
|
||||
|
||||
oscServer.on('message', function (msg) {
|
||||
// message should look like /ontime/{path}/{args} where
|
||||
// ontime: fixed message for app
|
||||
@@ -62,8 +65,8 @@ const initiateOSC = (config) => {
|
||||
console.log('calling goto with', args);
|
||||
try {
|
||||
let eventIndex = parseInt(args);
|
||||
if (isNaN(eventIndex) || eventIndex <= 0) return;
|
||||
global.timer.pause();
|
||||
if (isNaN(eventIndex) || eventIndex <= 0 || eventIndex == null)
|
||||
return;
|
||||
global.timer.loadEvent(eventIndex - 1, undefined, true);
|
||||
} catch (error) {
|
||||
console.log('error calling goto: ', error);
|
||||
@@ -71,6 +74,7 @@ const initiateOSC = (config) => {
|
||||
break;
|
||||
case 'gotoid':
|
||||
console.log('calling gotoid with', args);
|
||||
if (args == null) return;
|
||||
try {
|
||||
global.timer.loadEventById(args.toString().toLowerCase());
|
||||
} catch (error) {
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@
|
||||
"express-session": "~1.17.1",
|
||||
"lowdb": "^1.0.0",
|
||||
"nanoid": "^3.1.22",
|
||||
"node-osc": "^6.0.1",
|
||||
"node-osc": "6.0.2",
|
||||
"passport": "~0.4.1",
|
||||
"passport-local": "~1.0.0",
|
||||
"socket.io": "^4.0.0"
|
||||
|
||||
+4
-4
@@ -380,10 +380,10 @@ negotiator@0.6.2:
|
||||
resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.2.tgz#feacf7ccf525a77ae9634436a64883ffeca346fb"
|
||||
integrity sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw==
|
||||
|
||||
node-osc@^6.0.1:
|
||||
version "6.0.1"
|
||||
resolved "https://registry.yarnpkg.com/node-osc/-/node-osc-6.0.1.tgz#6f2c39996c64460435b678dc91c128d3a9711031"
|
||||
integrity sha512-UZBQGH4vVTw3Ub5/xcnhlrhL6bpaYz3hhNjO4eup4tknyP5qOi2GVVnEmEn/qaTgTvs7SVyytj3OHg9JWRD4Aw==
|
||||
node-osc@6.0.2:
|
||||
version "6.0.2"
|
||||
resolved "https://registry.yarnpkg.com/node-osc/-/node-osc-6.0.2.tgz#185d387928b186a84e8d0eebcae9e54a8bf50729"
|
||||
integrity sha512-RW8PRLMh4H14veC5gZVUTcRkrk5pXd+b4vmitWL55c9ZI+5yEvMXkrokfnRH0u7DYveqw4h+uCPIUDifY/vjfA==
|
||||
dependencies:
|
||||
osc-min "^1.1.1"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user