forked from ppy/osu
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSignalRWorkaroundTypes.cs
More file actions
75 lines (70 loc) · 3.99 KB
/
Copy pathSignalRWorkaroundTypes.cs
File metadata and controls
75 lines (70 loc) · 3.99 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System;
using System.Collections.Generic;
using osu.Game.Online.Matchmaking;
using osu.Game.Online.Matchmaking.Events;
using osu.Game.Online.Multiplayer;
using osu.Game.Online.Multiplayer.Countdown;
using osu.Game.Online.Multiplayer.MatchTypes.Matchmaking;
using osu.Game.Online.Multiplayer.MatchTypes.RankedPlay;
using osu.Game.Online.Multiplayer.MatchTypes.TeamVersus;
using osu.Game.Online.RankedPlay;
using osu.Game.Users;
namespace osu.Game.Online
{
/// <summary>
/// A static class providing the list of types requiring workarounds for serialisation in SignalR.
/// </summary>
/// <seealso cref="SignalRUnionWorkaroundResolver"/>
internal static class SignalRWorkaroundTypes
{
internal static readonly IReadOnlyList<(Type derivedType, Type baseType)> BASE_TYPE_MAPPING = new[]
{
// multiplayer
(typeof(ChangeSlotRequest), typeof(MatchUserRequest)),
(typeof(ChangeTeamRequest), typeof(MatchUserRequest)),
(typeof(StartMatchCountdownRequest), typeof(MatchUserRequest)),
(typeof(StopCountdownRequest), typeof(MatchUserRequest)),
(typeof(SetLockStateRequest), typeof(MatchUserRequest)),
(typeof(RollRequest), typeof(MatchUserRequest)),
(typeof(CountdownStartedEvent), typeof(MatchServerEvent)),
(typeof(CountdownStoppedEvent), typeof(MatchServerEvent)),
(typeof(RollEvent), typeof(MatchServerEvent)),
(typeof(StandardMatchRoomState), typeof(MatchRoomState)),
(typeof(TeamVersusRoomState), typeof(MatchRoomState)),
(typeof(TeamVersusUserState), typeof(MatchUserState)),
(typeof(MatchStartCountdown), typeof(MultiplayerCountdown)),
(typeof(ForceGameplayStartCountdown), typeof(MultiplayerCountdown)),
(typeof(ServerShuttingDownCountdown), typeof(MultiplayerCountdown)),
// metadata
(typeof(UserActivity.ChoosingBeatmap), typeof(UserActivity)),
(typeof(UserActivity.InSoloGame), typeof(UserActivity)),
(typeof(UserActivity.WatchingReplay), typeof(UserActivity)),
(typeof(UserActivity.SpectatingUser), typeof(UserActivity)),
(typeof(UserActivity.SearchingForLobby), typeof(UserActivity)),
(typeof(UserActivity.InLobby), typeof(UserActivity)),
(typeof(UserActivity.InMultiplayerGame), typeof(UserActivity)),
(typeof(UserActivity.SpectatingMultiplayerGame), typeof(UserActivity)),
(typeof(UserActivity.InPlaylistGame), typeof(UserActivity)),
(typeof(UserActivity.EditingBeatmap), typeof(UserActivity)),
(typeof(UserActivity.ModdingBeatmap), typeof(UserActivity)),
(typeof(UserActivity.TestingBeatmap), typeof(UserActivity)),
(typeof(UserActivity.InDailyChallengeLobby), typeof(UserActivity)),
(typeof(UserActivity.PlayingDailyChallenge), typeof(UserActivity)),
// matchmaking
(typeof(MatchmakingQueueStatus.Searching), typeof(MatchmakingQueueStatus)),
(typeof(MatchmakingQueueStatus.MatchFound), typeof(MatchmakingQueueStatus)),
(typeof(MatchmakingQueueStatus.JoiningMatch), typeof(MatchmakingQueueStatus)),
(typeof(MatchmakingRoomState), typeof(MatchRoomState)),
(typeof(MatchmakingStageCountdown), typeof(MultiplayerCountdown)),
(typeof(MatchmakingAvatarActionRequest), typeof(MatchUserRequest)),
(typeof(MatchmakingAvatarActionEvent), typeof(MatchServerEvent)),
// ranked play
(typeof(RankedPlayRoomState), typeof(MatchRoomState)),
(typeof(RankedPlayStageCountdown), typeof(MultiplayerCountdown)),
(typeof(RankedPlayCardHandReplayRequest), typeof(MatchUserRequest)),
(typeof(RankedPlayCardHandReplayEvent), typeof(MatchServerEvent)),
};
}
}