Completed first iteration of drawings management on v2

This commit is contained in:
Davide Passoni
2025-02-26 09:39:30 +01:00
parent 1a93ee68d0
commit b2477112b1
17 changed files with 1041 additions and 17 deletions

View File

@@ -17,6 +17,7 @@ extern UnitsManager* unitsManager;
extern WeaponsManager* weaponsManager;
extern Scheduler* scheduler;
extern json::value missionData;
extern json::value drawingsByLayer;
extern mutex mutexLock;
extern string sessionHash;
extern string instancePath;
@@ -149,6 +150,11 @@ void Server::handle_get(http_request request)
else if (URI.compare(COMMANDS_URI) == 0 && query.find(L"commandHash") != query.end()) {
answer[L"commandExecuted"] = json::value(scheduler->isCommandExecuted(to_string(query[L"commandHash"])));
}
/* Drawings data*/
else if (URI.compare(DRAWINGS_URI) == 0 && drawingsByLayer.has_object_field(L"drawings")) {
log("Trying to answer with drawings...");
answer[L"drawings"] = drawingsByLayer[L"drawings"];
}
/* Common data */
answer[L"time"] = json::value::string(to_wstring(ms.count()));