1
0
mirror of https://github.com/ppy/osu.git synced 2026-05-19 05:49:52 +08:00

Add JsonConstructor specs to allow for correct deserialization of readonly fields

This commit is contained in:
Dean Herbert
2020-12-09 15:05:57 +09:00
Unverified
parent bef52af1da
commit ab00a15555
2 changed files with 4 additions and 0 deletions
@@ -5,6 +5,7 @@
using System;
using System.Collections.Generic;
using Newtonsoft.Json;
namespace osu.Game.Online.RealtimeMultiplayer
{
@@ -41,6 +42,7 @@ namespace osu.Game.Online.RealtimeMultiplayer
private object writeLock = new object();
[JsonConstructor]
public MultiplayerRoom(in long roomId)
{
RoomID = roomId;
@@ -4,6 +4,7 @@
#nullable enable
using System;
using Newtonsoft.Json;
using osu.Game.Users;
namespace osu.Game.Online.RealtimeMultiplayer
@@ -17,6 +18,7 @@ namespace osu.Game.Online.RealtimeMultiplayer
public User? User { get; set; }
[JsonConstructor]
public MultiplayerRoomUser(in int userId)
{
UserID = userId;