From befd3653fcfb8010c11283586c38d892568cd43f Mon Sep 17 00:00:00 2001 From: Skull <86374920+skkuull@users.noreply.github.com> Date: Sun, 1 Jan 2023 07:12:40 +0300 Subject: [PATCH] use our online json data Co-Authored-By: Hosseinpourziyaie --- .../demonware/services/bdMarketingComms.cpp | 38 ++++--------------- 1 file changed, 7 insertions(+), 31 deletions(-) diff --git a/src/client/game/demonware/services/bdMarketingComms.cpp b/src/client/game/demonware/services/bdMarketingComms.cpp index 8e344444..655ba3a6 100644 --- a/src/client/game/demonware/services/bdMarketingComms.cpp +++ b/src/client/game/demonware/services/bdMarketingComms.cpp @@ -1,4 +1,5 @@ #include +#include #include "../services.hpp" namespace demonware @@ -12,50 +13,25 @@ namespace demonware void bdMarketingComms::getMessages(service_server* server, byte_buffer* /*buffer*/) const { + auto motd_content = utils::http::get_data("https://h1.gg/data/motd.json"); auto motd = new bdMarketingMessage; motd->m_messageID = 1; motd->m_languageCode = "en-US"; - motd->m_content = R"({ -"title": "

Message of the Day

", -"content_short": "", -"h3_header": "

^2Welcome to H1-Mod^7

", -"content_long": "Join our discord to stay tuned for latest updates and news: ^5https://discord.gg/RzzXu5EVnh^7

Visit ^2https://h1.gg^7 for further information!", -"popup_action_title": "Press 'Esc' or 'Enter' to close", -"popup_image": "h1_motd_template_1_2" -})"; + motd->m_content = motd_content.value().buffer.data(); motd->m_metadata = "{}"; + auto featured_content = utils::http::get_data("https://h1.gg/data/featured.json"); auto featured = new bdMarketingMessage; featured->m_messageID = 2; featured->m_languageCode = "en-US"; - featured->m_content = R"({ - "action_title": "v2.0.0", - "image": "h1_motd_360x200_mp_crash", - "title": "

v2.0.0

", - "content_short": "", - "h3_header": "

CHANGELOG:

", - "content_long": "- Added Wine/Proton compatibility
- Added custom zones/maps/weapons support
- Added usermap/mod downloading
- Added GSC support

You can check the whole changelog via: ^2https://docs.h1.gg/changelog^7.", - "popup_action_title": "Press 'Esc' or 'Enter' to close", - "popup_image": "h1_motd_620x580_mp_crash", - "action": "popup" -})"; + featured->m_content = featured_content.value().buffer.data(); featured->m_metadata = "{}"; + auto featured2_content = utils::http::get_data("https://h1.gg/data/featured2.json"); auto featured2 = new bdMarketingMessage; featured2->m_messageID = 3; featured2->m_languageCode = "en-US"; - featured2->m_content = R"({ - "action_title": "Custom Depot System", - "image": "h1_motd_dlc_360x200_ch_mtx6_kits", - "title": "

Custom Depot System

", - "content_short": "", - "h3_header": "

^3No COD Points!^7

", - "content_long": "We've added a new depot system to the game

Which you can now collect credits/parts from playing to be used with depots!", - "popup_action_title": "Press 'Esc' or 'Enter' to close", - "popup_action": "depot", - "popup_image": "h1_motd_dlc_620x580_ch_mtx6_kits", - "action": "popup" -})"; + featured2->m_content = featured2_content.value().buffer.data(); featured2->m_metadata = "{}"; auto reply = server->create_reply(this->task_id());