Skip to content

Commit

Permalink
TwitchChatVotingProxy: Fix incorrect serialization of OverlayMessages
Browse files Browse the repository at this point in the history
  • Loading branch information
pongo1231 committed Feb 7, 2024
1 parent 33d55f2 commit 47e7ead
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion TwitchChatVotingProxy/OverlayServer/OverlayServer.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Fleck;
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;
using Serilog;

// TODO: fix voting mode
Expand Down Expand Up @@ -126,7 +127,9 @@ private void Request(string request, List<IVoteOption> 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()
}));
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion TwitchChatVotingProxy/OverlayServer/OverlayVoteOption.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{
/// <summary>
/// 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.
/// </summary>
class OverlayVoteOption
{
Expand Down

0 comments on commit 47e7ead

Please sign in to comment.