Skip to content

Commit d5f2bdf

Browse files
committed
Appease message pack new inspections
1 parent 6f42b59 commit d5f2bdf

File tree

4 files changed

+13
-3
lines changed

4 files changed

+13
-3
lines changed

CodeAnalysis/osu.globalconfig

+4-1
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,11 @@ dotnet_diagnostic.IDE1006.severity = warning
5151
# Too many noisy warnings for parsing/formatting numbers
5252
dotnet_diagnostic.CA1305.severity = none
5353

54+
# messagepack complains about "osu" not being title cased due to reserved words
55+
dotnet_diagnostic.CS8981.severity = none
56+
5457
# CA1507: Use nameof to express symbol names
55-
# Flaggs serialization name attributes
58+
# Flags serialization name attributes
5659
dotnet_diagnostic.CA1507.severity = suggestion
5760

5861
# CA1806: Do not ignore method results

osu.Game/Online/API/ModSettingsDictionaryFormatter.cs

+4-2
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,12 @@
1010

1111
namespace osu.Game.Online.API
1212
{
13-
public class ModSettingsDictionaryFormatter : IMessagePackFormatter<Dictionary<string, object>>
13+
public class ModSettingsDictionaryFormatter : IMessagePackFormatter<Dictionary<string, object>?>
1414
{
15-
public void Serialize(ref MessagePackWriter writer, Dictionary<string, object> value, MessagePackSerializerOptions options)
15+
public void Serialize(ref MessagePackWriter writer, Dictionary<string, object>? value, MessagePackSerializerOptions options)
1616
{
17+
if (value == null) return;
18+
1719
var primitiveFormatter = PrimitiveObjectFormatter.Instance;
1820

1921
writer.WriteArrayHeader(value.Count);

osu.Game/Online/Multiplayer/MatchTypes/TeamVersus/TeamVersusUserState.cs

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
namespace osu.Game.Online.Multiplayer.MatchTypes.TeamVersus
77
{
8+
[MessagePackObject]
89
public class TeamVersusUserState : MatchUserState
910
{
1011
[Key(0)]

osu.Game/Users/UserActivity.cs

+4
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ public class ChoosingBeatmap : UserActivity
5454
}
5555

5656
[MessagePackObject]
57+
[Union(12, typeof(InSoloGame))]
58+
[Union(23, typeof(InMultiplayerGame))]
59+
[Union(24, typeof(SpectatingMultiplayerGame))]
60+
[Union(31, typeof(InPlaylistGame))]
5761
public abstract class InGame : UserActivity
5862
{
5963
[Key(0)]

0 commit comments

Comments
 (0)