From 3d01b39079593606344a9ed3b23bae165ff095f2 Mon Sep 17 00:00:00 2001 From: albertywang Date: Wed, 19 Mar 2025 23:02:08 -0500 Subject: [PATCH] Add initiator values to GamechangerPollData --- .github/CODEOWNERS | 4 ++-- .gitignore | 5 +++++ include/gateway.h | 6 +++++- test/gateway_matches.cpp | 4 ++++ 4 files changed, 16 insertions(+), 3 deletions(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 93f93a8..98e462d 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,5 +1,5 @@ # About this file: https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners -* @albert-wang @camr +* @albert-wang -.github/ @albert-wang @camr +.github/ @albert-wang diff --git a/.gitignore b/.gitignore index bbbc068..3047a91 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,10 @@ *.swp *.swo +.DS_Store +*.tar.gz +*.zip +*.dylib +*.so Session.vim CMakeCache.txt diff --git a/include/gateway.h b/include/gateway.h index ee1bc0c..8b3f4c1 100644 --- a/include/gateway.h +++ b/include/gateway.h @@ -178,13 +178,17 @@ namespace gateway struct GamechangerPollData { string Name; + string InitiatorID; + string InitiatorUsername; std::vector Tiers; // Shouldn't need to be changed, a marker to signal for special-case handling string Type = string("gamechanger"); - MUXY_GAMELINK_SERIALIZE_INTRUSIVE_3(GamechangerPollData, + MUXY_GAMELINK_SERIALIZE_INTRUSIVE_5(GamechangerPollData, "name", Name, + "initiator_id", InitiatorID, + "initiator_username", InitiatorUsername, "type", Type, "tiers", Tiers ); diff --git a/test/gateway_matches.cpp b/test/gateway_matches.cpp index 11d66ff..128fd10 100644 --- a/test/gateway_matches.cpp +++ b/test/gateway_matches.cpp @@ -17,6 +17,8 @@ TEST_CASE("Create a gamechanger", "[gateway][matches]") cfg.Mode = gateway::PollMode::Chaos; cfg.UserData.Name = "Delivery Budget"; + cfg.UserData.InitiatorID = "0001234"; + cfg.UserData.InitiatorUsername = "DeliveryDude"; cfg.UserData.Tiers = { gateway::GamechangerTier{ .IncrementalText = "Spend $1 more", @@ -128,6 +130,8 @@ TEST_CASE("Create a gamechanger", "[gateway][matches]") "prompt": "Empower my snacks", "user_data": { "name": "Delivery Budget", + "initiator_id": "0001234", + "initiator_username": "DeliveryDude", "type": "gamechanger", "tiers": [ {