From: js6pak Date: Sat, 13 Nov 2021 18:51:52 +0000 (+0100) Subject: Fix ServerReplay X-Git-Tag: v1.7.0~17^2~10 X-Git-Url: https://git.deb.at/?a=commitdiff_plain;h=afb705121821d06def61df7f2c520cf8805d743c;p=rhonda%2Fimpostor.git Fix ServerReplay --- 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)) {