From: AeonLucid Date: Fri, 23 Oct 2020 21:47:08 +0000 (+0200) Subject: Add PlayAnimation checks X-Git-Tag: v1.2.2~96^2~36 X-Git-Url: https://git.deb.at/?a=commitdiff_plain;h=7c946525fc72952c0210b6e7e483e404cf62af05;p=rhonda%2Fimpostor.git Add PlayAnimation checks --- diff --git a/src/Impostor.Api/Innersloth/Net/Objects/InnerPlayerControl.cs b/src/Impostor.Api/Innersloth/Net/Objects/InnerPlayerControl.cs index 018fbc0..103ea06 100644 --- a/src/Impostor.Api/Innersloth/Net/Objects/InnerPlayerControl.cs +++ b/src/Impostor.Api/Innersloth/Net/Objects/InnerPlayerControl.cs @@ -36,9 +36,19 @@ namespace Impostor.Api.Innersloth.Net.Objects { switch (call) { + // Play an animation. case RpcCalls.PlayAnimation: { - // TODO: Figure out checks + if (!sender.IsOwner(this)) + { + throw new ImpostorCheatException($"Client sent {nameof(RpcCalls.PlayAnimation)} to an unowned {nameof(InnerPlayerControl)}."); + } + + if (target != null) + { + throw new ImpostorCheatException($"Client sent {nameof(RpcCalls.PlayAnimation)} to a specific player instead of broadcast."); + } + var animation = reader.ReadByte(); break; }