feat(spectator): support save replays

This commit is contained in:
MingxuanGame
2025-07-27 09:03:23 +00:00
parent 19895789ac
commit 3ee95b0e7c
10 changed files with 600 additions and 243 deletions

View File

@@ -27,7 +27,11 @@ class ResultKind(IntEnum):
def parse_packet(data: bytes) -> tuple[PacketType, list[Any]]:
length, offset = decode_varint(data)
message_data = data[offset : offset + length]
unpacked = msgpack.unpackb(message_data, raw=False)
# FIXME: custom deserializer for APIMod
# https://github.com/ppy/osu/blob/master/osu.Game/Online/API/ModSettingsDictionaryFormatter.cs
unpacked = msgpack.unpackb(
message_data, raw=False, strict_map_key=False, use_list=True
)
return PacketType(unpacked[0]), unpacked[1:]