Commit 59a85a73 authored by Léo-Paul Géneau's avatar Léo-Paul Géneau 👾

erp5_officejs_drone_simulator: fix timeout

Timeout feature was broken by 2f7689d1 .
parent ef735f9b
...@@ -1043,8 +1043,7 @@ var GameManager = /** @class */ (function () { ...@@ -1043,8 +1043,7 @@ var GameManager = /** @class */ (function () {
}; };
GameManager.prototype._timeOut = function () { GameManager.prototype._timeOut = function () {
var seconds = Math.floor(this._game_duration / 1000); return this._totalTime - this._game_duration <= 0;
return this._totalTime - seconds <= 0;
}; };
GameManager.prototype._allDronesFinished = function () { GameManager.prototype._allDronesFinished = function () {
...@@ -1227,7 +1226,7 @@ var GameManager = /** @class */ (function () { ...@@ -1227,7 +1226,7 @@ var GameManager = /** @class */ (function () {
_this.finish_deferred = RSVP.defer(); _this.finish_deferred = RSVP.defer();
console.log("Simulation started."); console.log("Simulation started.");
this._game_duration = Date.now(); this._game_duration = Date.now();
this._totalTime = GAMEPARAMETERS.gameTime + this._game_duration; this._totalTime = GAMEPARAMETERS.gameTime * 1000 + this._game_duration;
return new RSVP.Queue() return new RSVP.Queue()
.push(function () { .push(function () {
......
...@@ -246,7 +246,7 @@ ...@@ -246,7 +246,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>1014.65026.25145.27272</string> </value> <value> <string>1015.15557.49327.13158</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -266,7 +266,7 @@ ...@@ -266,7 +266,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1709560433.33</float> <float>1710511088.86</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -763,8 +763,7 @@ var GameManager = /** @class */ (function () { ...@@ -763,8 +763,7 @@ var GameManager = /** @class */ (function () {
}; };
GameManager.prototype._timeOut = function () { GameManager.prototype._timeOut = function () {
var seconds = Math.floor(this._game_duration / 1000); return this._totalTime - this._game_duration <= 0;
return this._totalTime - seconds <= 0;
}; };
GameManager.prototype._allDronesFinished = function () { GameManager.prototype._allDronesFinished = function () {
...@@ -904,7 +903,7 @@ var GameManager = /** @class */ (function () { ...@@ -904,7 +903,7 @@ var GameManager = /** @class */ (function () {
_this.finish_deferred = RSVP.defer(); _this.finish_deferred = RSVP.defer();
console.log("Simulation started."); console.log("Simulation started.");
this._game_duration = Date.now(); this._game_duration = Date.now();
this._totalTime = GAMEPARAMETERS.gameTime + this._game_duration; this._totalTime = GAMEPARAMETERS.gameTime * 1000 + this._game_duration;
return new RSVP.Queue() return new RSVP.Queue()
.push(function () { .push(function () {
......
...@@ -240,7 +240,7 @@ ...@@ -240,7 +240,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>1014.65027.38618.31573</string> </value> <value> <string>1015.15533.18317.53657</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -260,7 +260,7 @@ ...@@ -260,7 +260,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1709560536.57</float> <float>1710509638.96</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment