From afb705121821d06def61df7f2c520cf8805d743c Mon Sep 17 00:00:00 2001 From: js6pak Date: Sat, 13 Nov 2021 19:51:52 +0100 Subject: [PATCH] Fix ServerReplay --- src/Impostor.Api/Innersloth/PlatformSpecificData.cs | 8 ++++++++ src/Impostor.Tools.ServerReplay/Program.cs | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/Impostor.Api/Innersloth/PlatformSpecificData.cs b/src/Impostor.Api/Innersloth/PlatformSpecificData.cs index 807f626..61f1aeb 100644 --- a/src/Impostor.Api/Innersloth/PlatformSpecificData.cs +++ b/src/Impostor.Api/Innersloth/PlatformSpecificData.cs @@ -5,6 +5,14 @@ namespace Impostor.Api.Innersloth { public class PlatformSpecificData { + public PlatformSpecificData(Platforms platform, string platformName, ulong? xboxPlatformId = null, ulong? psnPlatformId = null) + { + Platform = platform; + PlatformName = platformName; + XboxPlatformId = xboxPlatformId; + PsnPlatformId = psnPlatformId; + } + public PlatformSpecificData(IMessageReader reader) { Platform = (Platforms)reader.Tag; diff --git a/src/Impostor.Tools.ServerReplay/Program.cs b/src/Impostor.Tools.ServerReplay/Program.cs index 78c5b78..c55b193 100644 --- a/src/Impostor.Tools.ServerReplay/Program.cs +++ b/src/Impostor.Tools.ServerReplay/Program.cs @@ -170,7 +170,7 @@ namespace Impostor.Tools.ServerReplay // Create and register connection. var connection = new MockHazelConnection(address); - await _clientManager.RegisterConnectionAsync(connection, name, gameVersion, Language.English, QuickChatModes.FreeChatOrQuickChat); + await _clientManager.RegisterConnectionAsync(connection, name, gameVersion, Language.English, QuickChatModes.FreeChatOrQuickChat, new PlatformSpecificData(Platforms.Unknown, "ServerReplay")); // Store reference for ourselfs. Connections.Add(clientId, connection); @@ -200,7 +200,7 @@ namespace Impostor.Tools.ServerReplay if (tag == MessageFlags.HostGame) { - GameOptions.Add(clientId, Message00HostGameC2S.Deserialize(message, out _)); + GameOptions.Add(clientId, Message00HostGameC2S.Deserialize(message)); } else if (Connections.TryGetValue(clientId, out var client)) { -- 2.39.5