Update airship constants

This commit is contained in:
js6pak committed 2021-04-03 00:12:15 +02:00
1 parent b90e5b2c88
commit 11e87e51db
7 files changed
+26 -10

No files matched your search

+15
View File
@@ -0,0 +1,15 @@
namespace Impostor.Api.Innersloth
{
public enum Platforms
{
Unknown,
StandaloneEpicPC,
StandaloneSteamPC,
StandaloneMac,
StandaloneWin10,
StandaloneItch,
IPhone,
Android,
Switch,
}
}
@@ -1,6 +1,6 @@
namespace Impostor.Api.Innersloth
{
public enum ChatType
public enum QuickChatModes
{
FreeChatOrQuickChat = 1,
QuickChatOnly = 2,
@@ -15,12 +15,12 @@ namespace Impostor.Api.Net.Messages.C2S
/// Deserialize a packet.
/// </summary>
/// <param name="reader"><see cref="IMessageReader" /> with <see cref="IMessageReader.Tag" /> 0.</param>
/// <param name="chatType">The chat type selected in the client of the player.</param>
/// <param name="chatMode">The chat type selected in the client of the player.</param>
/// <returns>Deserialized <see cref="GameOptionsData" />.</returns>
public static GameOptionsData Deserialize(IMessageReader reader, out ChatType chatType)
public static GameOptionsData Deserialize(IMessageReader reader, out QuickChatModes chatMode)
{
var gameOptionsData = GameOptionsData.DeserializeCreate(reader);
chatType = (ChatType)reader.ReadByte();
chatMode = (QuickChatModes)reader.ReadByte();
return gameOptionsData;
}
@@ -10,11 +10,11 @@ namespace Impostor.Api.Net.Messages.C2S
throw new NotImplementedException();
}
public static void Deserialize(IMessageReader reader, out GameOptionsData options, out ChatType chatType)
public static void Deserialize(IMessageReader reader, out GameOptionsData options, out QuickChatModes chatMode)
{
reader.ReadPackedInt32(); // Hardcoded 0.
options = GameOptionsData.DeserializeCreate(reader);
chatType = (ChatType)reader.ReadByte();
chatMode = (QuickChatModes)reader.ReadByte();
}
}
}
+2 -1
View File
@@ -9,6 +9,7 @@
public const byte SceneChangeFlag = 6;
public const byte ReadyFlag = 7;
public const byte ChangeSettingsFlag = 8;
public const byte ClientInfoFlag = 205;
public const byte ConsoleDeclareClientPlatformFlag = 205;
public const byte PS4RoomRequest = 206;
}
}
@@ -20,7 +20,7 @@ namespace Impostor.Server.Net.Manager
{
private static readonly HashSet<int> SupportedVersions = new HashSet<int>
{
GameVersion.GetVersion(2021, 3, 5), // 2021.3.5
GameVersion.GetVersion(2021, 3, 25), // 2021.3.31s
};
private static readonly string ServerBrand = $"Impostor {DotnetUtils.GetVersion()}";
+2 -2
View File
@@ -254,14 +254,14 @@ namespace Impostor.Server.Net.State
break;
}
case GameDataTag.ClientInfoFlag:
case GameDataTag.ConsoleDeclareClientPlatformFlag:
{
var clientId = reader.ReadPackedInt32();
var platform = (RuntimePlatform)reader.ReadPackedInt32();
if (clientId != sender.Client.Id)
{
if (await sender.Client.ReportCheatAsync(new CheatContext(nameof(GameDataTag.ClientInfoFlag)), "Client sent info with wrong client id"))
if (await sender.Client.ReportCheatAsync(new CheatContext(nameof(GameDataTag.ConsoleDeclareClientPlatformFlag)), "Client sent info with wrong client id"))
{
return false;
}