--- /dev/null
+namespace Impostor.Api.Unity
+{
+ public enum RuntimePlatform
+ {
+ OSXEditor = 0,
+ OSXPlayer = 1,
+ WindowsPlayer = 2,
+ OSXWebPlayer = 3,
+ OSXDashboardPlayer = 4,
+ WindowsWebPlayer = 5,
+ WindowsEditor = 7,
+ IPhonePlayer = 8,
+ PS3 = 9,
+ XBOX360 = 10,
+ Android = 11,
+ NaCl = 12,
+ LinuxPlayer = 13,
+ FlashPlayer = 15,
+ LinuxEditor = 16,
+ WebGLPlayer = 17,
+ MetroPlayerX86 = 18,
+ WSAPlayerX86 = 18,
+ MetroPlayerX64 = 19,
+ WSAPlayerX64 = 19,
+ MetroPlayerARM = 20,
+ WSAPlayerARM = 20,
+ WP8Player = 21,
+ BlackBerryPlayer = 22,
+ TizenPlayer = 23,
+ PSP2 = 24,
+ PS4 = 25,
+ PSM = 26,
+ XboxOne = 27,
+ SamsungTVPlayer = 28,
+ WiiU = 30,
+ TvOs = 31,
+ Switch = 32,
+ Lumin = 33,
+ Stadia = 34,
+ CloudRendering = 35,
+ }
+}
public const byte SceneChangeFlag = 6;
public const byte ReadyFlag = 7;
public const byte ChangeSettingsFlag = 8;
+ public const byte ClientInfoFlag = 205;
}
-}
\ No newline at end of file
+}
using System.Threading.Tasks;
using Impostor.Api.Net;
using Impostor.Api.Net.Inner;
+using Impostor.Api.Unity;
using Impostor.Server.Net.Inner.Objects;
using Microsoft.Extensions.Logging;
public string Scene { get; internal set; }
+ public RuntimePlatform? Platform { get; internal set; }
+
public void InitializeSpawnTimeout()
{
_spawnTimeout.Change(Constants.SpawnTimeout, -1);
using Impostor.Api.Net.Inner;
using Impostor.Api.Net.Messages;
using Impostor.Api.Net.Messages.S2C;
+using Impostor.Api.Unity;
using Impostor.Hazel;
using Impostor.Server.Events.Meeting;
using Impostor.Server.Events.Player;
break;
}
- case 205:
- case 206:
+ case GameDataTag.ClientInfoFlag:
{
- // TODO figure out what the hell is going on here
+ 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"))
+ {
+ return false;
+ }
+ }
+
+ sender.Platform = platform;
+
break;
}