mirror of
https://github.com/Impostor/Impostor.git
synced 2026-10-20 01:46:11 +00:00
Implement GameData 205
This commit is contained in:
1 parent
3090cea768
commit
0901be56f5
4 files changed
+62
-4
No files matched your search
@@ -0,0 +1,42 @@
|
||||
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,
|
||||
}
|
||||
}
|
||||
@@ -9,5 +9,6 @@
|
||||
public const byte SceneChangeFlag = 6;
|
||||
public const byte ReadyFlag = 7;
|
||||
public const byte ChangeSettingsFlag = 8;
|
||||
public const byte ClientInfoFlag = 205;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,7 @@ using System.Threading;
|
||||
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;
|
||||
|
||||
@@ -36,6 +37,8 @@ namespace Impostor.Server.Net.State
|
||||
|
||||
public string Scene { get; internal set; }
|
||||
|
||||
public RuntimePlatform? Platform { get; internal set; }
|
||||
|
||||
public void InitializeSpawnTimeout()
|
||||
{
|
||||
_spawnTimeout.Change(Constants.SpawnTimeout, -1);
|
||||
|
||||
@@ -7,6 +7,7 @@ using Impostor.Api.Innersloth;
|
||||
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;
|
||||
@@ -357,10 +358,21 @@ namespace Impostor.Server.Net.State
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user