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 () {
};
GameManager.prototype._timeOut = function () {
var seconds = Math.floor(this._game_duration / 1000);
return this._totalTime - seconds <= 0;
return this._totalTime - this._game_duration <= 0;
};
GameManager.prototype._allDronesFinished = function () {
......@@ -1227,7 +1226,7 @@ var GameManager = /** @class */ (function () {
_this.finish_deferred = RSVP.defer();
console.log("Simulation started.");
this._game_duration = Date.now();
this._totalTime = GAMEPARAMETERS.gameTime + this._game_duration;
this._totalTime = GAMEPARAMETERS.gameTime * 1000 + this._game_duration;
return new RSVP.Queue()
.push(function () {
......
......@@ -246,7 +246,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>1014.65026.25145.27272</string> </value>
<value> <string>1015.15557.49327.13158</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -266,7 +266,7 @@
</tuple>
<state>
<tuple>
<float>1709560433.33</float>
<float>1710511088.86</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -763,8 +763,7 @@ var GameManager = /** @class */ (function () {
};
GameManager.prototype._timeOut = function () {
var seconds = Math.floor(this._game_duration / 1000);
return this._totalTime - seconds <= 0;
return this._totalTime - this._game_duration <= 0;
};
GameManager.prototype._allDronesFinished = function () {
......@@ -904,7 +903,7 @@ var GameManager = /** @class */ (function () {
_this.finish_deferred = RSVP.defer();
console.log("Simulation started.");
this._game_duration = Date.now();
this._totalTime = GAMEPARAMETERS.gameTime + this._game_duration;
this._totalTime = GAMEPARAMETERS.gameTime * 1000 + this._game_duration;
return new RSVP.Queue()
.push(function () {
......
......@@ -240,7 +240,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>1014.65027.38618.31573</string> </value>
<value> <string>1015.15533.18317.53657</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -260,7 +260,7 @@
</tuple>
<state>
<tuple>
<float>1709560536.57</float>
<float>1710509638.96</float>
<string>UTC</string>
</tuple>
</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