about summary refs log tree commit diff
path: root/LibMatrix/StateEvent.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--LibMatrix/StateEvent.cs8
1 files changed, 7 insertions, 1 deletions
diff --git a/LibMatrix/StateEvent.cs b/LibMatrix/StateEvent.cs
index e846811..fb4dd71 100644
--- a/LibMatrix/StateEvent.cs
+++ b/LibMatrix/StateEvent.cs
@@ -5,6 +5,7 @@ using System.Text.Json.Serialization;
 using ArcaneLibs;
 using ArcaneLibs.Extensions;
 using LibMatrix.EventTypes;
+using LibMatrix.Extensions;
 using LibMatrix.Interfaces;
 
 namespace LibMatrix;
@@ -41,7 +42,12 @@ public class StateEvent {
                 return null!;
             }
             try {
-                return (EventContent)RawContent.Deserialize(GetType)!;
+                var jse = new JsonSerializerOptions();
+                jse ??= new JsonSerializerOptions();
+                jse.Converters.Add(new JsonFloatStringConverter());
+                jse.Converters.Add(new JsonDoubleStringConverter());
+                jse.Converters.Add(new JsonDecimalStringConverter());
+                return (EventContent)RawContent.Deserialize(GetType, jse)!;
             }
             catch (JsonException e) {
                 Console.WriteLine(e);