Merge pull request #13 from D1GQ/dev

Canary 5 hotfix 3
This commit is contained in:
D1GQ authored and GitHub committed 2024-08-03 22:08:41 -05:00
commit 4e91089f39
4 files changed
+15 -14

No files matched your search

+5 -7
View File
@@ -206,8 +206,6 @@ class AntiCheat
RoleTypes? Role = player?.Data?.RoleType;
Role ??= RoleTypes.Crewmate;
bool IsImpostor = player.IsImpostorTeam();
bool IsCrewmate = !player.IsImpostorTeam();
string hashPuid = Utils.GetHashPuid(player);
if (callId is (byte)RpcCalls.SendChat or (byte)RpcCalls.SendQuickChat)
@@ -220,7 +218,7 @@ class AntiCheat
if (callId is (byte)RpcCalls.EnterVent or (byte)RpcCalls.ExitVent)
{
if ((IsCrewmate && Role != RoleTypes.Engineer) || player.Data.IsDead)
if ((!player.IsImpostorTeam() && Role != RoleTypes.Engineer) || player.Data.IsDead)
BetterNotificationManager.NotifyCheat(player, $"Invalid Action RPC: {Enum.GetName((RpcCalls)callId)}");
return;
@@ -242,8 +240,8 @@ class AntiCheat
if (target != null)
{
if (IsCrewmate || !player.IsAlive() || player.IsInVanish() || !target.IsAlive() || target.IsImpostorTeam()
/*|| ExtendedPlayerInfo.TimeSinceKill.TryGetValue(player, out var value) && value < (float)GameOptionsManager.Instance.currentNormalGameOptions.KillCooldown - 1.5f*/)
if (!player.IsImpostorTeam() || !player.IsAlive() || player.IsInVanish() || !target.IsAlive() || target.IsImpostorTeam()
|| ExtendedPlayerInfo.TimeSinceKill.TryGetValue(player, out var value) && value < (float)GameOptionsManager.Instance.currentNormalGameOptions.KillCooldown)
{
BetterNotificationManager.NotifyCheat(player, $"Invalid Action RPC: {Enum.GetName((RpcCalls)callId)}");
}
@@ -267,7 +265,7 @@ class AntiCheat
return;
}
if (IsCrewmate)
if (!player.IsImpostorTeam())
{
if (GameStates.IsInGamePlay)
{
@@ -296,7 +294,7 @@ class AntiCheat
}
}
if (IsImpostor)
if (player.IsImpostorTeam())
{
if (callId is (byte)RpcCalls.CompleteTask or (byte)RpcCalls.BootFromVent)
{
+1 -1
View File
@@ -107,7 +107,7 @@ class BetterHostManager
&& !player.shapeshifting
&& !player.onLadder
&& !player.MyPhysics.Animations.IsPlayingAnyLadderAnimation()
&& ExtendedPlayerInfo.TimeSinceKill.TryGetValue(player, out var value) && value >= (float)GameOptionsManager.Instance.currentNormalGameOptions.KillCooldown - 1.5f
&& ExtendedPlayerInfo.TimeSinceKill.TryGetValue(player, out var value) && value >= (float)GameOptionsManager.Instance.currentNormalGameOptions.KillCooldown
&& CheckRange(player.GetCustomPosition(), target.GetCustomPosition(), 3f))
{
if (target.IsAlive()
+8 -5
View File
@@ -34,13 +34,16 @@ internal class RPCHandlerPatch
}
var canceled = false;
if (GameStates.IsHost && BetterHostManager.CheckRPCAsHost(__instance, callId, reader, ref canceled) != true)
if (GameStates.IsHost)
{
if (canceled)
if (BetterHostManager.CheckRPCAsHost(__instance, callId, reader, ref canceled) != true)
{
Logger.LogCheat($"RPC canceled by Host: {Enum.GetName((RpcCalls)callId)}{Enum.GetName((CustomRPC)callId)} - {callId}");
}
return false;
if (canceled)
{
Logger.LogCheat($"RPC canceled by Host: {Enum.GetName((RpcCalls)callId)}{Enum.GetName((CustomRPC)callId)} - {callId}");
}
return false;
}
}
AntiCheat.CheckRPC(__instance, callId, reader);
+1 -1
View File
@@ -23,7 +23,7 @@ public class Main : BasePlugin
{
public const ReleaseTypes ReleaseBuildType = ReleaseTypes.Canary;
public const string CanaryNum = "5";
public const string HotfixNum = "2";
public const string HotfixNum = "3";
public const bool IsHotFix = true;
public const string PluginGuid = "com.d1gq.betteramongus";
public const string PluginVersion = "1.0.0";