Add union attributes for derived class deserialisation

This commit is contained in:
Dean Herbert 2021-07-30 19:37:47 +09:00
parent ce92a47ec6
commit 4cf2c6188d
3 changed files with 7 additions and 2 deletions

View File

@ -3,6 +3,7 @@
using System;
using MessagePack;
using osu.Game.Online.Multiplayer.MatchRulesets.TeamVs;
#nullable enable
@ -14,7 +15,8 @@ namespace osu.Game.Online.Multiplayer
/// </summary>
[Serializable]
[MessagePackObject]
public class MatchRulesetRoomState
[Union(0, typeof(TeamVsMatchRoomState))]
public abstract class MatchRulesetRoomState
{
}
}

View File

@ -3,6 +3,7 @@
using System;
using MessagePack;
using osu.Game.Online.Multiplayer.MatchRulesets.TeamVs;
#nullable enable
@ -14,7 +15,8 @@ namespace osu.Game.Online.Multiplayer
/// </summary>
[Serializable]
[MessagePackObject]
public class MatchRulesetUserState
[Union(0, typeof(TeamVsMatchUserState))]
public abstract class MatchRulesetUserState
{
}
}

View File

@ -8,6 +8,7 @@ using MessagePack;
namespace osu.Game.Online.Multiplayer.MatchRulesets.TeamVs
{
[MessagePackObject]
public class TeamVsMatchRoomState : MatchRulesetRoomState
{
[Key(0)]