Small bugfix

This commit is contained in:
2025-10-24 16:21:04 +02:00
parent 02391f813b
commit 7ce9003621
21 changed files with 601 additions and 10 deletions

View File

@@ -54,6 +54,7 @@ var LOG_OUTPUT = !process.argv.includes('--no-output-log');
var UnityRunner = /** @class */ (function () {
function UnityRunner(Main) {
this.message = 'Awaiting startup delay...';
this.bootTime = Date.now();
this.startTime = null;
this.output = { current: [], last: [] };
this.restartTriggered = false;
@@ -98,6 +99,8 @@ var UnityRunner = /** @class */ (function () {
this.error = error;
this.state = state;
this.broadcastState();
if (error != null)
this._Main.Twilio.sendError('UnityRunner', error);
this.output.current.push("[".concat(new Date().toLocaleTimeString('nl-NL'), "] [System] [").concat(state, "] ").concat(message !== null && message !== void 0 ? message : error));
if (state == 'PROBLEM' || state == 'STOPPED')
console.warn(PREFIX, message !== null && message !== void 0 ? message : error);
@@ -300,6 +303,7 @@ var UnityRunner = /** @class */ (function () {
((_b = _this.process) === null || _b === void 0 ? void 0 : _b.exitCode) != null ||
_this.restartTriggered)
return;
_this._Main.Twilio.resetError('UnityRunner');
_this.setInfo('Running', '', 'RUNNING');
_this._Main.UnityWebSocket.connect();
}, 5000);

File diff suppressed because one or more lines are too long

View File

@@ -1,4 +1,15 @@
"use strict";
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
@@ -44,6 +55,7 @@ var UnityWebSocket = /** @class */ (function () {
function UnityWebSocket(Main) {
this.state = 'DISCONNECTED';
this.message = 'Waiting for process...';
this.errorTriggerStartupDelay = 1000;
this.parameters = {
timelineWatching: false,
timelineStanding: false,
@@ -125,6 +137,8 @@ var UnityWebSocket = /** @class */ (function () {
this.error = error;
this.state = state;
this.broadcastState();
if (error != null)
this._Main.Twilio.sendError('UnityWebSocket', error);
if (state == 'FAILED' || state == 'DISCONNECTED')
console.warn(PREFIX, message !== null && message !== void 0 ? message : error);
else
@@ -158,7 +172,9 @@ var UnityWebSocket = /** @class */ (function () {
this.parameters.outOfService =
(_a = message.heartbeat.showOutOfService) !== null && _a !== void 0 ? _a : false;
this.parameters.sensors = message.heartbeat.dataSensors;
this.parameters.sliders = message.heartbeat.dataSliders;
this.parameters.sliders = message.heartbeat.dataSliders.map(function (slider) {
return __assign(__assign({}, slider), { decimalPlaces: slider.min == 0 && slider.max == 1 ? 2 : null });
});
this.broadcastState();
break;
case 'response_camera_frame':
@@ -238,6 +254,7 @@ var UnityWebSocket = /** @class */ (function () {
});
this.socket.on('open', function () {
_this.startFetchClocks();
_this._Main.Twilio.resetError('UnityWebSocket');
_this.setInfo('Connected', null, 'CONNECTED');
});
this.socket.on('close', function () {

File diff suppressed because one or more lines are too long