Skip to content

Commit

Permalink
Fix cheatcontext in ValidateImpostor calls
Browse files Browse the repository at this point in the history
  • Loading branch information
js6pak committed Apr 4, 2021
1 parent 60bf6b5 commit 225b56e
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public override async ValueTask<bool> HandleRpcAsync(ClientPlayer sender, Client
{
if (call == RpcCalls.SnapTo)
{
if (!await ValidateOwnership(call, sender) || !await ValidateImpostor(RpcCalls.MurderPlayer, sender, _playerControl.PlayerInfo))
if (!await ValidateOwnership(call, sender) || !await ValidateImpostor(call, sender, _playerControl.PlayerInfo))
{
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public override ValueTask DeserializeAsync(IClientPlayer sender, IClientPlayer?

public override async ValueTask<bool> HandleRpcAsync(ClientPlayer sender, ClientPlayer? target, RpcCalls call, IMessageReader reader)
{
if (!await ValidateOwnership(call, sender) || !await ValidateImpostor(RpcCalls.MurderPlayer, sender, _playerControl.PlayerInfo))
if (!await ValidateOwnership(call, sender) || !await ValidateImpostor(call, sender, _playerControl.PlayerInfo))
{
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ public override async ValueTask<bool> HandleRpcAsync(ClientPlayer sender, Client

case RpcCalls.MurderPlayer:
{
if (!await ValidateOwnership(call, sender) || !await ValidateImpostor(RpcCalls.MurderPlayer, sender, PlayerInfo))
if (!await ValidateOwnership(call, sender) || !await ValidateImpostor(call, sender, PlayerInfo))
{
return false;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Impostor.Server/Net/Inner/Objects/InnerShipStatus.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public override async ValueTask<bool> HandleRpcAsync(ClientPlayer sender, Client
{
case RpcCalls.CloseDoorsOfType:
{
if (!await ValidateImpostor(RpcCalls.MurderPlayer, sender, sender.Character!.PlayerInfo))
if (!await ValidateImpostor(call, sender, sender.Character!.PlayerInfo))
{
return false;
}
Expand Down

0 comments on commit 225b56e

Please sign in to comment.