Skip to content

Commit

Permalink
Further AoT x JSON warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
SakulFlee committed Dec 10, 2024
1 parent 5552fd5 commit 12d2e3c
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 28 deletions.
3 changes: 0 additions & 3 deletions Godot Project/addons/match_maker/MatchMakerRequest.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
using System.Text.Json.Serialization;

/// <summary>
/// An outgoing packet send to the Match Maker Server to request a queue to be created or joined.
/// </summary>
[JsonSerializable(typeof(MatchMakerRequest))]
public class MatchMakerRequest
{
public string name { get; set; }
Expand Down
3 changes: 0 additions & 3 deletions Godot Project/addons/match_maker/MatchMakerResponse.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
using System.Text.Json.Serialization;

/// <summary>
/// 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.
/// </summary>
[JsonSerializable(typeof(MatchMakerResponse))]
public class MatchMakerResponse
{
public string ownUUID { get; set; }
Expand Down
3 changes: 0 additions & 3 deletions Godot Project/addons/match_maker/MatchMakierUpdate.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
using System.Text.Json.Serialization;

/// <summary>
/// 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.
/// </summary>
[JsonSerializable(typeof(MatchMakerUpdate))]
public class MatchMakerUpdate
{
public uint currentPeerCount { get; set; }
Expand Down
22 changes: 3 additions & 19 deletions Godot Project/addons/match_maker/Packet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
/// <summary>
/// The general packet/package send and received to and from the Match Maker Server.
/// </summary>
[JsonSerializable(typeof(Packet))]
public class Packet
{
/// <summary>
Expand Down Expand Up @@ -96,12 +95,7 @@ public MatchMakerRequest ParseMatchMakerRequest()
return null;
}

var result = JsonSerializer.Deserialize<MatchMakerRequest>(json, new JsonSerializerOptions()
{
IncludeFields = true,
DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull,
});
return result;
return JsonSerializer.Deserialize(json, typeof(MatchMakerRequest), JsonSourceGenContext.Default) as MatchMakerRequest;
}

/// <summary>
Expand All @@ -118,12 +112,7 @@ public MatchMakerResponse ParseMatchMakerResponse()
return null;
}

var result = JsonSerializer.Deserialize<MatchMakerResponse>(json, new JsonSerializerOptions()
{
IncludeFields = true,
DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull,
});
return result;
return JsonSerializer.Deserialize(json, typeof(MatchMakerResponse), JsonSourceGenContext.Default) as MatchMakerResponse;
}

/// <summary>
Expand All @@ -140,11 +129,6 @@ public MatchMakerUpdate ParseMatchMakerUpdate()
return null;
}

var result = JsonSerializer.Deserialize<MatchMakerUpdate>(json, new JsonSerializerOptions()
{
IncludeFields = true,
DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull,
});
return result;
return JsonSerializer.Deserialize(json, typeof(MatchMakerUpdate), JsonSourceGenContext.Default) as MatchMakerUpdate;
}
}

0 comments on commit 12d2e3c

Please sign in to comment.