mirror of https://github.com/ppy/osu
Add JsonConstructor specs to allow for correct deserialization of readonly fields
This commit is contained in:
parent
bef52af1da
commit
ab00a15555
|
@ -5,6 +5,7 @@
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
namespace osu.Game.Online.RealtimeMultiplayer
|
namespace osu.Game.Online.RealtimeMultiplayer
|
||||||
{
|
{
|
||||||
|
@ -41,6 +42,7 @@ public class MultiplayerRoom
|
||||||
|
|
||||||
private object writeLock = new object();
|
private object writeLock = new object();
|
||||||
|
|
||||||
|
[JsonConstructor]
|
||||||
public MultiplayerRoom(in long roomId)
|
public MultiplayerRoom(in long roomId)
|
||||||
{
|
{
|
||||||
RoomID = roomId;
|
RoomID = roomId;
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
#nullable enable
|
#nullable enable
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
using Newtonsoft.Json;
|
||||||
using osu.Game.Users;
|
using osu.Game.Users;
|
||||||
|
|
||||||
namespace osu.Game.Online.RealtimeMultiplayer
|
namespace osu.Game.Online.RealtimeMultiplayer
|
||||||
|
@ -17,6 +18,7 @@ public class MultiplayerRoomUser : IEquatable<MultiplayerRoomUser>
|
||||||
|
|
||||||
public User? User { get; set; }
|
public User? User { get; set; }
|
||||||
|
|
||||||
|
[JsonConstructor]
|
||||||
public MultiplayerRoomUser(in int userId)
|
public MultiplayerRoomUser(in int userId)
|
||||||
{
|
{
|
||||||
UserID = userId;
|
UserID = userId;
|
||||||
|
|
Loading…
Reference in New Issue