From 47e7ead47922ae460a8ac93bc5c35b0625eb6555 Mon Sep 17 00:00:00 2001 From: pongo1231 Date: Wed, 7 Feb 2024 19:21:20 +0000 Subject: [PATCH] TwitchChatVotingProxy: Fix incorrect serialization of OverlayMessages --- TwitchChatVotingProxy/OverlayServer/OverlayServer.cs | 5 ++++- TwitchChatVotingProxy/OverlayServer/OverlayVoteOption.cs | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/TwitchChatVotingProxy/OverlayServer/OverlayServer.cs b/TwitchChatVotingProxy/OverlayServer/OverlayServer.cs index dc2b548e1..2a3ab52a9 100644 --- a/TwitchChatVotingProxy/OverlayServer/OverlayServer.cs +++ b/TwitchChatVotingProxy/OverlayServer/OverlayServer.cs @@ -1,5 +1,6 @@ using Fleck; using Newtonsoft.Json; +using Newtonsoft.Json.Serialization; using Serilog; // TODO: fix voting mode @@ -126,7 +127,9 @@ private void Request(string request, List voteOptions) msg.TotalVotes = 0; voteOptions.ForEach(_ => msg.TotalVotes += _.Votes); // Send the message to all clients - Broadcast(JsonConvert.SerializeObject(msg)); + Broadcast(JsonConvert.SerializeObject(msg, new JsonSerializerSettings { + ContractResolver = new CamelCasePropertyNamesContractResolver() + })); } } } diff --git a/TwitchChatVotingProxy/OverlayServer/OverlayVoteOption.cs b/TwitchChatVotingProxy/OverlayServer/OverlayVoteOption.cs index 758f796e7..b634c70c4 100644 --- a/TwitchChatVotingProxy/OverlayServer/OverlayVoteOption.cs +++ b/TwitchChatVotingProxy/OverlayServer/OverlayVoteOption.cs @@ -2,7 +2,7 @@ { /// /// Represents how the vote options are being sent to the client after - /// JSON serializing them. + /// JSON serializing them with properties converted to lower case after the fact. /// class OverlayVoteOption {