diff --git a/Godot Project/addons/match_maker/MatchMakerRequest.cs b/Godot Project/addons/match_maker/MatchMakerRequest.cs index bed3e43..8c33142 100644 --- a/Godot Project/addons/match_maker/MatchMakerRequest.cs +++ b/Godot Project/addons/match_maker/MatchMakerRequest.cs @@ -1,9 +1,6 @@ -using System.Text.Json.Serialization; - /// /// An outgoing packet send to the Match Maker Server to request a queue to be created or joined. /// -[JsonSerializable(typeof(MatchMakerRequest))] public class MatchMakerRequest { public string name { get; set; } diff --git a/Godot Project/addons/match_maker/MatchMakerResponse.cs b/Godot Project/addons/match_maker/MatchMakerResponse.cs index d6ec64d..e8beaa1 100644 --- a/Godot Project/addons/match_maker/MatchMakerResponse.cs +++ b/Godot Project/addons/match_maker/MatchMakerResponse.cs @@ -1,10 +1,7 @@ -using System.Text.Json.Serialization; - /// /// An incoming response received from the Match Maker Server once a queue filled. /// Contains all the necessary information to make a P2P connection via WebRTC possible. /// -[JsonSerializable(typeof(MatchMakerResponse))] public class MatchMakerResponse { public string ownUUID { get; set; } diff --git a/Godot Project/addons/match_maker/MatchMakierUpdate.cs b/Godot Project/addons/match_maker/MatchMakierUpdate.cs index 270cce5..3e66566 100644 --- a/Godot Project/addons/match_maker/MatchMakierUpdate.cs +++ b/Godot Project/addons/match_maker/MatchMakierUpdate.cs @@ -1,10 +1,7 @@ -using System.Text.Json.Serialization; - /// /// An incoming response received from the Match Maker Server once a queue filled. /// Contains all the necessary information to make a P2P connection via WebRTC possible. /// -[JsonSerializable(typeof(MatchMakerUpdate))] public class MatchMakerUpdate { public uint currentPeerCount { get; set; } diff --git a/Godot Project/addons/match_maker/Packet.cs b/Godot Project/addons/match_maker/Packet.cs index 41e7789..4734ea2 100644 --- a/Godot Project/addons/match_maker/Packet.cs +++ b/Godot Project/addons/match_maker/Packet.cs @@ -6,7 +6,6 @@ /// /// The general packet/package send and received to and from the Match Maker Server. /// -[JsonSerializable(typeof(Packet))] public class Packet { /// @@ -96,12 +95,7 @@ public MatchMakerRequest ParseMatchMakerRequest() return null; } - var result = JsonSerializer.Deserialize(json, new JsonSerializerOptions() - { - IncludeFields = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull, - }); - return result; + return JsonSerializer.Deserialize(json, typeof(MatchMakerRequest), JsonSourceGenContext.Default) as MatchMakerRequest; } /// @@ -118,12 +112,7 @@ public MatchMakerResponse ParseMatchMakerResponse() return null; } - var result = JsonSerializer.Deserialize(json, new JsonSerializerOptions() - { - IncludeFields = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull, - }); - return result; + return JsonSerializer.Deserialize(json, typeof(MatchMakerResponse), JsonSourceGenContext.Default) as MatchMakerResponse; } /// @@ -140,11 +129,6 @@ public MatchMakerUpdate ParseMatchMakerUpdate() return null; } - var result = JsonSerializer.Deserialize(json, new JsonSerializerOptions() - { - IncludeFields = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull, - }); - return result; + return JsonSerializer.Deserialize(json, typeof(MatchMakerUpdate), JsonSourceGenContext.Default) as MatchMakerUpdate; } }