From 913cef4342712ee17a5c2bb9c98593c30f16ee78 Mon Sep 17 00:00:00 2001 From: Henry Winkel Date: Thu, 14 Mar 2024 18:28:43 +0100 Subject: [PATCH] Changed to get tracklist from CMS --- src/SimControl/SimControl.cpp | 42 ++++++++++++++++++++--------------- 1 file changed, 24 insertions(+), 18 deletions(-) diff --git a/src/SimControl/SimControl.cpp b/src/SimControl/SimControl.cpp index b9be24d..ce5417b 100644 --- a/src/SimControl/SimControl.cpp +++ b/src/SimControl/SimControl.cpp @@ -11,6 +11,7 @@ #include "SimCore/UtilFunctions.hpp" #include "WHISPER/InternalUDPListener.hpp" #include "WHISPER/Messages/Message.hpp" +#include "WHISPER/Messages/stringData.hpp" #include "crossguid/guid.hpp" #include "ixwebsocket/IXConnectionState.h" #include "ixwebsocket/IXWebSocket.h" @@ -141,7 +142,7 @@ namespace SimControl { void SimControl::HandleBroadcastMessage(std::string msg) { - LOG_S(INFO)<IP; + IP = cmsPod->IP; LOG_S(INFO)<<"PODS Info: " <IP; @@ -502,25 +503,30 @@ namespace SimControl { client.disconnect(); if (response != "NULL") { - auto update = SimCore::TracklistUpdate::unpack(WHISPER::Message(response)); - if(update == nullptr) - { - LOG_S(INFO)<<"no update received"; - return; - } try { + LOG_S(INFO)<<"raw data"<< response; + auto message = WHISPER::StringData(response); + LOG_S(INFO)<<"message from cms: "<< message.data_; + j["Tracks"] = nlohmann::json::parse(message.data_); - nlohmann::json Jsontracks; - auto tracks = update->getTracks(); - LOG_S(INFO)<<"Tracklist Update Size: " <getTracks(); + // LOG_S(INFO)<<"Tracklist Update Size: " <