1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-18 11:02:57 +08:00

Appease message pack new inspections

This commit is contained in:
Dean Herbert 2025-01-08 02:54:13 +09:00
parent 6f42b59e31
commit d5f2bdf6cd
No known key found for this signature in database
4 changed files with 13 additions and 3 deletions

View File

@ -51,8 +51,11 @@ dotnet_diagnostic.IDE1006.severity = warning
# Too many noisy warnings for parsing/formatting numbers
dotnet_diagnostic.CA1305.severity = none
# messagepack complains about "osu" not being title cased due to reserved words
dotnet_diagnostic.CS8981.severity = none
# CA1507: Use nameof to express symbol names
# Flaggs serialization name attributes
# Flags serialization name attributes
dotnet_diagnostic.CA1507.severity = suggestion
# CA1806: Do not ignore method results

View File

@ -10,10 +10,12 @@ using osu.Game.Configuration;
namespace osu.Game.Online.API
{
public class ModSettingsDictionaryFormatter : IMessagePackFormatter<Dictionary<string, object>>
public class ModSettingsDictionaryFormatter : IMessagePackFormatter<Dictionary<string, object>?>
{
public void Serialize(ref MessagePackWriter writer, Dictionary<string, object> value, MessagePackSerializerOptions options)
public void Serialize(ref MessagePackWriter writer, Dictionary<string, object>? value, MessagePackSerializerOptions options)
{
if (value == null) return;
var primitiveFormatter = PrimitiveObjectFormatter.Instance;
writer.WriteArrayHeader(value.Count);

View File

@ -5,6 +5,7 @@ using MessagePack;
namespace osu.Game.Online.Multiplayer.MatchTypes.TeamVersus
{
[MessagePackObject]
public class TeamVersusUserState : MatchUserState
{
[Key(0)]

View File

@ -54,6 +54,10 @@ namespace osu.Game.Users
}
[MessagePackObject]
[Union(12, typeof(InSoloGame))]
[Union(23, typeof(InMultiplayerGame))]
[Union(24, typeof(SpectatingMultiplayerGame))]
[Union(31, typeof(InPlaylistGame))]
public abstract class InGame : UserActivity
{
[Key(0)]