mirror of
https://github.com/Pax1601/DCSOlympus.git
synced 2025-10-29 16:56:34 +00:00
Fixed excessively high CPU load
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -19,3 +19,4 @@ hgt
|
|||||||
/client/public/databases/units/old
|
/client/public/databases/units/old
|
||||||
/client/plugins/databasemanager/index.js
|
/client/plugins/databasemanager/index.js
|
||||||
|
|
||||||
|
*.aps
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ Source: "..\scripts\OlympusCommand.lua"; DestDir: "{app}\Mods\Services\Olympus\S
|
|||||||
Source: "..\scripts\unitPayloads.lua"; DestDir: "{app}\Mods\Services\Olympus\Scripts"; Flags: ignoreversion
|
Source: "..\scripts\unitPayloads.lua"; DestDir: "{app}\Mods\Services\Olympus\Scripts"; Flags: ignoreversion
|
||||||
Source: "..\scripts\templates.lua"; DestDir: "{app}\Mods\Services\Olympus\Scripts"; Flags: ignoreversion
|
Source: "..\scripts\templates.lua"; DestDir: "{app}\Mods\Services\Olympus\Scripts"; Flags: ignoreversion
|
||||||
Source: "..\scripts\mist.lua"; DestDir: "{app}\Mods\Services\Olympus\Scripts"; Flags: ignoreversion
|
Source: "..\scripts\mist.lua"; DestDir: "{app}\Mods\Services\Olympus\Scripts"; Flags: ignoreversion
|
||||||
|
Source: "..\scripts\mods.lua"; DestDir: "{app}\Mods\Services\Olympus\Scripts"; Flags: ignoreversion
|
||||||
|
|
||||||
Source: "..\mod\*"; DestDir: "{app}\Mods\Services\Olympus"; Flags: ignoreversion recursesubdirs;
|
Source: "..\mod\*"; DestDir: "{app}\Mods\Services\Olympus"; Flags: ignoreversion recursesubdirs;
|
||||||
|
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ extern "C" DllExport int coreFrame(lua_State* L)
|
|||||||
frameCounter++;
|
frameCounter++;
|
||||||
|
|
||||||
const std::chrono::duration<double> executionDuration = std::chrono::system_clock::now() - lastExecution;
|
const std::chrono::duration<double> executionDuration = std::chrono::system_clock::now() - lastExecution;
|
||||||
if (executionDuration.count() > FRAMERATE_TIME_INTERVAL) {
|
if (executionDuration.count() > (20 * FRAMERATE_TIME_INTERVAL)) {
|
||||||
if (executionDuration.count() > 0) {
|
if (executionDuration.count() > 0) {
|
||||||
scheduler->setFrameRate(frameCounter / executionDuration.count());
|
scheduler->setFrameRate(frameCounter / executionDuration.count());
|
||||||
frameCounter = 0;
|
frameCounter = 0;
|
||||||
|
|||||||
@@ -330,7 +330,7 @@ void Server::task()
|
|||||||
.then([&listener]() {log("RESTServer starting to listen"); })
|
.then([&listener]() {log("RESTServer starting to listen"); })
|
||||||
.wait();
|
.wait();
|
||||||
|
|
||||||
while (runListener);
|
while (runListener) { Sleep(1000); };
|
||||||
|
|
||||||
listener.close()
|
listener.close()
|
||||||
.then([&listener]() {log("RESTServer stopping connections"); })
|
.then([&listener]() {log("RESTServer stopping connections"); })
|
||||||
|
|||||||
Reference in New Issue
Block a user