mirror of
https://github.com/D1GQ/BetterAmongUs.git
synced 2026-10-19 15:51:52 +00:00
21 files changed
+162
-75
No files matched your search
+36
-18
@@ -3,6 +3,7 @@ using BetterAmongUs.Patches;
|
||||
using HarmonyLib;
|
||||
using Hazel;
|
||||
using InnerNet;
|
||||
using Sentry.Internal.Extensions;
|
||||
|
||||
namespace BetterAmongUs;
|
||||
|
||||
@@ -89,6 +90,11 @@ class AntiCheat
|
||||
Logger.LogCheat($"{player.BetterData().RealName} Platform Spoofer: {__instance.PsnPlatformId}");
|
||||
}
|
||||
}
|
||||
|
||||
if (__instance.Platform is Platforms.Unknown || !Enum.IsDefined(__instance.Platform))
|
||||
{
|
||||
BetterNotificationManager.NotifyCheat(player, $"Platform Spoofer", newText: "Has been detected with a cheat");
|
||||
}
|
||||
}
|
||||
}, 3.5f, shoudLog: false);
|
||||
}
|
||||
@@ -111,7 +117,7 @@ class AntiCheat
|
||||
if (reader.BytesRemaining == 0 && !flag)
|
||||
{
|
||||
player.ReportPlayer(ReportReasons.Cheating_Hacking);
|
||||
SickoData[Utils.GetHashPuid(player)] = player.FriendCode;
|
||||
SickoData[Utils.GetHashPuid(player)] = player.Data.FriendCode;
|
||||
BetterDataManager.SaveCheatData(Utils.GetHashPuid(player), player.Data.FriendCode, player.Data.PlayerName, "sickoData", "Sicko Menu RPC");
|
||||
BetterNotificationManager.NotifyCheat(player, $"Sicko Menu", newText: "Has been detected with a cheat client");
|
||||
}
|
||||
@@ -133,7 +139,7 @@ class AntiCheat
|
||||
if (!flag)
|
||||
{
|
||||
player.ReportPlayer(ReportReasons.Cheating_Hacking);
|
||||
AUMData[Utils.GetHashPuid(player)] = player.FriendCode;
|
||||
AUMData[Utils.GetHashPuid(player)] = player.Data.FriendCode;
|
||||
BetterDataManager.SaveCheatData(Utils.GetHashPuid(player), player.Data.FriendCode, player.Data.PlayerName, "aumData", "AUM RPC");
|
||||
BetterNotificationManager.NotifyCheat(player, $"AUM", newText: "Has been detected with a cheat client");
|
||||
}
|
||||
@@ -152,21 +158,26 @@ class AntiCheat
|
||||
var msgString = reader.ReadString();
|
||||
var colorId = reader.ReadInt32();
|
||||
|
||||
Utils.AddChatPrivate($"{msgString}", overrideName: $"<b><color=#870000>AUM Chat</color> - <color={Utils.Color32ToHex(Palette.PlayerColors[colorId])}>{nameString}</color></b>");
|
||||
var flag3 = player.BetterData().AntiCheatInfo.AUMChats.Count > 0 && player.BetterData().AntiCheatInfo.AUMChats.Last() == msgString;
|
||||
if (!flag3)
|
||||
{
|
||||
Utils.AddChatPrivate($"{msgString}", overrideName: $"<b><color=#870000>AUM Chat</color> - {player.GetPlayerNameAndColor()}</b>");
|
||||
player.BetterData().AntiCheatInfo.AUMChats.Add(msgString);
|
||||
}
|
||||
|
||||
PlayerControl AUMPlayer = Main.AllPlayerControls.First(pc => pc.Data.PlayerName == nameString && pc.CurrentOutfit.ColorId == colorId);
|
||||
Logger.Log($"{player.Data.PlayerName} -> {msgString}", "AUMChatLog");
|
||||
|
||||
if (AUMPlayer == null || !Main.AntiCheat.Value || !BetterGameSettings.DetectCheatClients.GetBool()) return;
|
||||
if (!Main.AntiCheat.Value || !BetterGameSettings.DetectCheatClients.GetBool()) return;
|
||||
|
||||
var flag = string.IsNullOrEmpty(nameString) && string.IsNullOrEmpty(msgString);
|
||||
var flag2 = AUMData.ContainsKey(Utils.GetHashPuid(AUMPlayer));
|
||||
var flag2 = AUMData.ContainsKey(Utils.GetHashPuid(player));
|
||||
|
||||
if (!flag && !flag2)
|
||||
{
|
||||
player.ReportPlayer(ReportReasons.Cheating_Hacking);
|
||||
AUMData[Utils.GetHashPuid(AUMPlayer)] = AUMPlayer.FriendCode;
|
||||
AUMData[Utils.GetHashPuid(player)] = player.Data.FriendCode;
|
||||
BetterDataManager.SaveCheatData(Utils.GetHashPuid(player), player.Data.FriendCode, player.Data.PlayerName, "aumData", "AUM Chat RPC");
|
||||
BetterNotificationManager.NotifyCheat(AUMPlayer, $"AUM", newText: "Has been detected with a cheat client");
|
||||
BetterNotificationManager.NotifyCheat(player, $"AUM", newText: "Has been detected with a cheat client");
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
@@ -174,7 +185,6 @@ class AntiCheat
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Check and notify for invalid rpcs
|
||||
public static void CheckRPC(PlayerControl player, byte callId, MessageReader Oldreader)
|
||||
{
|
||||
@@ -202,10 +212,10 @@ class AntiCheat
|
||||
|
||||
if (callId is (byte)RpcCalls.EnterVent or (byte)RpcCalls.ExitVent)
|
||||
{
|
||||
if ((!player.IsImpostorTeam() && Role != RoleTypes.Engineer) || player.Data.IsDead)
|
||||
if ((!player.IsImpostorTeam() && Role != RoleTypes.Engineer) && player.IsAlive())
|
||||
{
|
||||
BetterNotificationManager.NotifyCheat(player, $"Invalid Action RPC: {Enum.GetName((RpcCalls)callId)}");
|
||||
Logger.LogCheat($"{player.BetterData().RealName} {Enum.GetName((RpcCalls)callId)}: {player.IsImpostorTeam()} && {Role != RoleTypes.Engineer} || {player.Data.IsDead}");
|
||||
Logger.LogCheat($"{player.BetterData().RealName} {Enum.GetName((RpcCalls)callId)}: {player.IsImpostorTeam()} && {Role != RoleTypes.Engineer} && {player.IsAlive()}");
|
||||
}
|
||||
|
||||
return;
|
||||
@@ -247,10 +257,18 @@ class AntiCheat
|
||||
if (reader.BytesRemaining > 0)
|
||||
{
|
||||
uint level = reader.ReadPackedUInt32();
|
||||
if (level > BetterGameSettings.DetectedLevelAbove.GetInt())
|
||||
|
||||
if (level + 1 > BetterGameSettings.DetectedLevelAbove.GetInt())
|
||||
{
|
||||
BetterNotificationManager.NotifyCheat(player, $"Invalid Level: {level}");
|
||||
Logger.LogCheat($"{player.BetterData().RealName} {Enum.GetName((RpcCalls)callId)}: {level >= 200}");
|
||||
Logger.LogCheat($"{player.BetterData().RealName} {Enum.GetName((RpcCalls)callId)}: {level > BetterGameSettings.DetectedLevelAbove.GetInt()}");
|
||||
}
|
||||
|
||||
if (level + 1 <= 0)
|
||||
{
|
||||
var betterData = player.BetterData();
|
||||
player.Kick(false, "{0}" + $" due to {level + 1} being invalid level", bypassDataCheck: true);
|
||||
betterData.AntiCheatInfo.BannedByAntiCheat = true;
|
||||
}
|
||||
}
|
||||
return;
|
||||
@@ -315,7 +333,7 @@ class AntiCheat
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.Error(ex.ToString());
|
||||
Logger.Error(ex);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -364,7 +382,7 @@ class AntiCheat
|
||||
// Fix 2: 17
|
||||
// Panel 1: Open/Hold 64 - Close/Release 32
|
||||
// Panel 2: Open/Hold 65 - Close/Release 33
|
||||
// Cheat Sabo: 128
|
||||
// Host: 128
|
||||
|
||||
// Activate sabotage
|
||||
if (systemType == SystemTypes.Sabotage)
|
||||
@@ -516,9 +534,9 @@ class AntiCheat
|
||||
bool IsImpostor = player.IsImpostorTeam();
|
||||
bool IsCrewmate = !player.IsImpostorTeam();
|
||||
|
||||
if (TrustedRPCs(callId) != true)
|
||||
if (TrustedRPCs(callId) != true && !player.IsHost())
|
||||
{
|
||||
BetterNotificationManager.NotifyCheat(player, $"Untrusted RPC received: {callId}");
|
||||
BetterNotificationManager.NotifyCheat(player, $"Unregistered RPC received: {callId}");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -702,7 +720,7 @@ class AntiCheat
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.Error(ex.ToString());
|
||||
Logger.Error(ex);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -78,6 +78,20 @@ class BetterDataManager
|
||||
{
|
||||
// Load the existing JSON data
|
||||
string json = File.ReadAllText(filePath);
|
||||
|
||||
try
|
||||
{
|
||||
using (JsonDocument.Parse(json))
|
||||
{
|
||||
}
|
||||
}
|
||||
catch (JsonException)
|
||||
{
|
||||
// JSON is invalid, reformat by writing an empty JSON object.
|
||||
json = "{}";
|
||||
|
||||
}
|
||||
|
||||
var jsonData = JsonSerializer.Deserialize<Dictionary<string, Dictionary<string, Dictionary<string, string>>>>(json) ?? new Dictionary<string, Dictionary<string, Dictionary<string, string>>>();
|
||||
|
||||
// Check and add missing categories
|
||||
@@ -138,7 +152,7 @@ class BetterDataManager
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.Error(ex.ToString());
|
||||
Logger.Error(ex);
|
||||
}
|
||||
|
||||
return string.Empty;
|
||||
@@ -461,7 +475,7 @@ class BetterDataManager
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.Error(ex.ToString());
|
||||
Logger.Error(ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -37,27 +37,32 @@ class BetterNotificationManager
|
||||
|
||||
public static void NotifyCheat(PlayerControl player, string reason, string newText = "", bool kickPlayer = true)
|
||||
{
|
||||
string text = $"Player: <color=#0097b5>{player?.BetterData().RealName}</color> Has been detected doing an unauthorized action: <b><color=#fc0000>{reason}</color></b>";
|
||||
if (newText != "")
|
||||
text = $"Player: <color=#0097b5>{player?.BetterData().RealName}</color> " + newText + $": <b><color=#fc0000>{reason}</color></b>";
|
||||
|
||||
var Reason = reason;
|
||||
if (BetterGameSettings.CensorDetectionReason.GetBool())
|
||||
{
|
||||
reason = string.Concat('*').Repeat(reason.Length);
|
||||
Reason = string.Concat('*').Repeat(reason.Length);
|
||||
}
|
||||
|
||||
string text = $"Player: <color=#0097b5>{player?.BetterData().RealName}</color> Has been detected doing an unauthorized action: <b><color=#fc0000>{Reason}</color></b>";
|
||||
string rawText = $"Player: <color=#0097b5>{player?.BetterData().RealName}</color> Has been detected doing an unauthorized action: <b><color=#fc0000>{reason}</color></b>";
|
||||
if (newText != "")
|
||||
{
|
||||
text = $"Player: <color=#0097b5>{player?.BetterData().RealName}</color> " + newText + $": <b><color=#fc0000>{Reason}</color></b>";
|
||||
rawText = $"Player: <color=#0097b5>{player?.BetterData().RealName}</color> " + newText + $": <b><color=#fc0000>{reason}</color></b>";
|
||||
}
|
||||
|
||||
if (!AntiCheat.PlayerData.ContainsKey(Utils.GetHashPuid(player)))
|
||||
{
|
||||
AntiCheat.PlayerData[Utils.GetHashPuid(player)] = player.Data.FriendCode;
|
||||
BetterDataManager.SaveCheatData(Utils.GetHashPuid(player), player.Data.FriendCode, player?.BetterData().RealName, "cheatData", reason);
|
||||
BetterDataManager.SaveCheatData(Utils.GetHashPuid(player), player.Data.FriendCode, player?.BetterData().RealName, "cheatData", Reason);
|
||||
Notify(text, Time: 8f);
|
||||
}
|
||||
|
||||
Logger.LogCheat(Utils.RemoveHtmlText(text));
|
||||
Logger.LogCheat(Utils.RemoveHtmlText(rawText));
|
||||
|
||||
if (GameStates.IsHost && kickPlayer)
|
||||
{
|
||||
player.Kick(true, "{0} " + $"by <color=#4f92ff>Anti-Cheat</color>!\n Reason: <color=#fc0000>{reason}</color>", true);
|
||||
player.Kick(true, "{0} " + $"by <color=#4f92ff>Anti-Cheat</color>!\n Reason: <color=#fc0000>{Reason}</color>", true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -99,9 +99,11 @@ static class ExtendedPlayerControl
|
||||
return true;
|
||||
}
|
||||
// Kick player
|
||||
public static void Kick(this PlayerControl player, bool ban = false, string setReasonInfo = "", bool AntiCheatBan = false)
|
||||
public static void Kick(this PlayerControl player, bool ban = false, string setReasonInfo = "", bool AntiCheatBan = false, bool bypassDataCheck = false)
|
||||
{
|
||||
if (!GameStates.IsHost || PlayerControl.LocalPlayer == player || !player.DataIsCollected() || player.IsHost() || player.isDummy)
|
||||
var Ban = ban;
|
||||
|
||||
if (!GameStates.IsHost || PlayerControl.LocalPlayer == player || !player.DataIsCollected() && !bypassDataCheck || player.IsHost() || player.isDummy)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -113,7 +115,7 @@ static class ExtendedPlayerControl
|
||||
return;
|
||||
}
|
||||
|
||||
ban = ban && BetterGameSettings.WhenCheating.GetValue() == 2;
|
||||
Ban = Ban && BetterGameSettings.WhenCheating.GetValue() == 2;
|
||||
}
|
||||
|
||||
if (setReasonInfo != "")
|
||||
@@ -121,7 +123,7 @@ static class ExtendedPlayerControl
|
||||
GameDataShowNotificationPatch.BetterShowNotification(player.Data, forceReasonText: string.Format(setReasonInfo, ban ? "banned" : "kicked"));
|
||||
}
|
||||
|
||||
AmongUsClient.Instance.KickPlayer(player.GetClientId(), ban);
|
||||
AmongUsClient.Instance.KickPlayer(player.GetClientId(), Ban);
|
||||
|
||||
player.BetterData().AntiCheatInfo.BannedByAntiCheat = AntiCheatBan;
|
||||
}
|
||||
|
||||
@@ -26,6 +26,7 @@ public static class PlayerControlDataExtension
|
||||
public class ExtendedAntiCheatInfo
|
||||
{
|
||||
public bool BannedByAntiCheat { get; set; } = false;
|
||||
public List<string> AUMChats { get; set; } = [];
|
||||
public int TimesAttemptedKilled { get; set; } = 0;
|
||||
public int OpenSabotageNum { get; set; } = 0;
|
||||
public bool IsFixingPanelSabotage => OpenSabotageNum != 0;
|
||||
@@ -53,6 +54,8 @@ public static class PlayerControlDataExtension
|
||||
// Reset info when needed
|
||||
public static void ResetPlayerData(PlayerControl player)
|
||||
{
|
||||
if (player == null) return;
|
||||
|
||||
if (GameStates.IsLobby)
|
||||
{
|
||||
player.BetterData().AntiCheatInfo.TimesCalledMeeting = 0;
|
||||
|
||||
+1
-1
@@ -45,7 +45,7 @@ class LateTask
|
||||
catch (Exception ex)
|
||||
{
|
||||
TasksToRemove.Add(task);
|
||||
Logger.Error(ex.ToString());
|
||||
Logger.Error(ex);
|
||||
}
|
||||
}
|
||||
TasksToRemove.ForEach(task => Tasks.Remove(task));
|
||||
|
||||
@@ -90,7 +90,7 @@ public class BetterOptionPlayerItem : BetterOptionItem
|
||||
|
||||
if (CurrentIndex >= 0)
|
||||
{
|
||||
ThisOption.ValueText.text = Utils.PlayerFromId(CurrentIndex).GetPlayerNameAndColor();
|
||||
ThisOption.ValueText.text = Utils.PlayerFromPlayerId(CurrentIndex).GetPlayerNameAndColor();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -140,7 +140,7 @@ public class BetterOptionPlayerItem : BetterOptionItem
|
||||
{
|
||||
var saveindex = TempPlayerOptionData[Id];
|
||||
|
||||
if (saveindex != -1 && Utils.PlayerFromId(saveindex) == null)
|
||||
if (saveindex != -1 && Utils.PlayerFromPlayerId(saveindex) == null)
|
||||
saveindex = Main.AllPlayerControls.Length - 1;
|
||||
|
||||
CurrentIndex = saveindex;
|
||||
|
||||
@@ -153,6 +153,14 @@ internal static class RPC
|
||||
{
|
||||
if (player == null || player.IsLocalPlayer() || player.Data == null) return;
|
||||
|
||||
var flag = Enum.IsDefined(typeof(CustomRPC), (int)unchecked(callId)) || Enum.IsDefined(typeof(RpcCalls), callId);
|
||||
|
||||
if (!flag && player.IsHost())
|
||||
{
|
||||
var BAU = "<color=#278720>♻</color><color=#0ed400><b>BetterAmongUs</b></color><color=#278720>♻</color>";
|
||||
Utils.DisconnectSelf($"{BAU} does not support\n<b>Modded Lobbies</b>!");
|
||||
}
|
||||
|
||||
if (!Enum.IsDefined(typeof(CustomRPC), (int)unchecked(callId))) return;
|
||||
|
||||
MessageReader reader = MessageReader.Get(oldReader);
|
||||
@@ -196,6 +204,7 @@ internal static class RPC
|
||||
SyncAllNames(force: true);
|
||||
}
|
||||
break;
|
||||
/*
|
||||
case (byte)CustomRPC.VersionCheck or (byte)CustomRPC.RequestRetryVersionCheck:
|
||||
if (player.IsHost())
|
||||
{
|
||||
@@ -204,6 +213,7 @@ internal static class RPC
|
||||
Utils.DisconnectSelf($"{BAU} does not support <color=#ff9cdc><b>TOHE</b></color>");
|
||||
}
|
||||
break;
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+18
-7
@@ -1,5 +1,6 @@
|
||||
using AmongUs.GameOptions;
|
||||
using InnerNet;
|
||||
using Sentry.Internal.Extensions;
|
||||
using System.Reflection;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
@@ -11,9 +12,15 @@ namespace BetterAmongUs;
|
||||
public static class Utils
|
||||
{
|
||||
// Get player by client id
|
||||
public static ClientData? ClientFromId(int id) => AmongUsClient.Instance.allClients.ToArray().FirstOrDefault(cd => cd.Id == id) ?? null;
|
||||
public static ClientData? ClientFromClientId(int clientId) => AmongUsClient.Instance.allClients.ToArray().FirstOrDefault(cd => cd.Id == clientId) ?? null;
|
||||
// Get player data from player id
|
||||
public static NetworkedPlayerInfo? PlayerDataFromPlayerId(int playerId) => GameData.Instance.AllPlayers.ToArray().FirstOrDefault(data => data.PlayerId == playerId);
|
||||
// Get player data from client id
|
||||
public static NetworkedPlayerInfo? PlayerDataFromClientId(int clientId) => GameData.Instance.AllPlayers.ToArray().FirstOrDefault(data => data.ClientId == clientId);
|
||||
// Get player data from friend code
|
||||
public static NetworkedPlayerInfo? PlayerDataFromFriendCode(string friendCode) => GameData.Instance.AllPlayers.ToArray().FirstOrDefault(data => data.FriendCode == friendCode);
|
||||
// Get player from player id
|
||||
public static PlayerControl? PlayerFromId(int playerId) => Main.AllPlayerControls.FirstOrDefault(player => player.PlayerId == playerId) ?? null;
|
||||
public static PlayerControl? PlayerFromPlayerId(int playerId) => Main.AllPlayerControls.FirstOrDefault(player => player.PlayerId == playerId) ?? null;
|
||||
// Get player from client id
|
||||
public static PlayerControl? PlayerFromClientId(int clientId) => Main.AllPlayerControls.FirstOrDefault(player => player.GetClientId() == clientId) ?? null;
|
||||
// Get player from net id
|
||||
@@ -59,7 +66,7 @@ public static class Utils
|
||||
catch (Exception ex)
|
||||
{
|
||||
chat.chatBubblePool.Reclaim(pooledBubble);
|
||||
Logger.Error(ex.ToString());
|
||||
Logger.Error(ex);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
@@ -208,7 +215,7 @@ public static class Utils
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.Error(ex.ToString());
|
||||
Logger.Error(ex);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -234,7 +241,7 @@ public static class Utils
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.Error(ex.ToString());
|
||||
Logger.Error(ex);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -292,11 +299,15 @@ public static class Utils
|
||||
PlatformName = "IPhone";
|
||||
Tag = "Mobile";
|
||||
break;
|
||||
case Platforms p when !Enum.IsDefined(p):
|
||||
case Platforms.Unknown:
|
||||
PlatformName = "None";
|
||||
PlatformName = "Unknown";
|
||||
useTag = false;
|
||||
break;
|
||||
default:
|
||||
return string.Empty;
|
||||
PlatformName = "None";
|
||||
useTag = false;
|
||||
break;
|
||||
}
|
||||
|
||||
if (useTag == false)
|
||||
|
||||
@@ -84,6 +84,22 @@ public class ClientPatch
|
||||
}
|
||||
}
|
||||
}
|
||||
[HarmonyPatch(typeof(NetworkedPlayerInfo))]
|
||||
public class NetworkedPlayerInfoPatch
|
||||
{
|
||||
[HarmonyPatch(nameof(NetworkedPlayerInfo.Deserialize))]
|
||||
[HarmonyPostfix]
|
||||
public static void Deserialize_Postfix(NetworkedPlayerInfo __instance)
|
||||
{
|
||||
if (!GameStates.IsHost)
|
||||
{
|
||||
if (__instance.PlayerLevel == unchecked((uint)0 - 1))
|
||||
{
|
||||
__instance.PlayerLevel = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// Set text color
|
||||
[HarmonyPatch(typeof(CosmeticsLayer))]
|
||||
public class CosmeticsLayerPatch
|
||||
|
||||
@@ -456,7 +456,7 @@ class CommandsPatch
|
||||
|
||||
if (flag3 == true)
|
||||
{
|
||||
cmdTarget = Utils.PlayerFromId(int.Parse(subArg));
|
||||
cmdTarget = Utils.PlayerFromPlayerId(int.Parse(subArg));
|
||||
return true;
|
||||
}
|
||||
else
|
||||
|
||||
@@ -58,6 +58,7 @@ internal class MainMenuPatch
|
||||
string creditsTextTitle = "<size=150%><color=#0dff00><b>-=Mod Credits=-</b></color></size>\n";
|
||||
string creditsText = "<size=75%>◆ <color=#0088ff>Head Developer</color>: <b>D1GQ</b></size>";
|
||||
|
||||
/*
|
||||
if (creditsButton == null)
|
||||
{
|
||||
creditsButton = CreateButton(
|
||||
@@ -70,6 +71,7 @@ internal class MainMenuPatch
|
||||
},
|
||||
"Mod Credits"); //"Credits"
|
||||
}
|
||||
*/
|
||||
|
||||
if (gitHubButton == null)
|
||||
{
|
||||
|
||||
@@ -113,7 +113,7 @@ class MeetingHudUpdatePatch
|
||||
}
|
||||
else if (TopText != null && InfoText != null)
|
||||
{
|
||||
var target = Utils.PlayerFromId(pva.TargetPlayerId);
|
||||
var target = Utils.PlayerFromPlayerId(pva.TargetPlayerId);
|
||||
if (target == null) return;
|
||||
string hashPuid = Utils.GetHashPuid(target);
|
||||
string friendCode = target.Data.FriendCode;
|
||||
|
||||
@@ -31,8 +31,8 @@ public class PingTrackerPatch
|
||||
}
|
||||
|
||||
sb.Append($"<color=#00dbdb><size=75%>BetterAmongUs {Main.GetVersionText(true)}</size></color>\n");
|
||||
// sb.Append("<size=68%><color=#8040bf>By</color> <color=#bc4345>The Enhanced Network</color></size>\n");
|
||||
sb.Append($"<size=50%><color=#b5b5b5>{Main.Github}</color></size>\n");
|
||||
sb.Append("<size=68%><color=#8040bf>By</color> <color=#bc4345>The Enhanced Network</color></size>\n");
|
||||
// sb.Append($"<size=50%><color=#b5b5b5>{Main.Github}</color></size>\n");
|
||||
|
||||
if (Main.BetterHost.Value && GameStates.IsHost)
|
||||
{
|
||||
|
||||
@@ -227,10 +227,13 @@ class PlayerControlPatch
|
||||
}
|
||||
else
|
||||
{
|
||||
var target = Utils.PlayerFromId(player.shapeshiftTargetPlayerId);
|
||||
if (target != null)
|
||||
if (!player.shapeshifting)
|
||||
{
|
||||
player.RawSetName(target.Data.PlayerName);
|
||||
var targetData = Utils.PlayerDataFromPlayerId(player.shapeshiftTargetPlayerId);
|
||||
if (targetData != null)
|
||||
{
|
||||
player.RawSetName(targetData.PlayerName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -268,7 +271,7 @@ class PlayerControlPatch
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.Error(ex.ToString());
|
||||
Logger.Error(ex);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -295,7 +295,7 @@ public class RoleManagerPatch
|
||||
|
||||
if (tempSetImpostor >= 0)
|
||||
{
|
||||
var player = Utils.PlayerFromId(tempSetImpostor);
|
||||
var player = Utils.PlayerFromPlayerId(tempSetImpostor);
|
||||
if (player != null)
|
||||
{
|
||||
if (Impostors.Count < NumImpostors)
|
||||
|
||||
@@ -31,18 +31,20 @@ class SplashIntroPatch
|
||||
UnityEngine.Object.Destroy(__instance.logoAnimFinish.GetComponent<AudioSource>());
|
||||
}
|
||||
|
||||
/*
|
||||
if (Input.GetKeyDown(KeyCode.Mouse0) || Input.GetKeyDown(KeyCode.Mouse1))
|
||||
{
|
||||
if (ShowTime > 1.5f)
|
||||
if (ShowTime > 2.5f && !IsReallyDoneLoading)
|
||||
{
|
||||
__instance.StopAllCoroutines();
|
||||
UnityEngine.Object.Destroy(__instance.logoAnimFinish.gameObject);
|
||||
__instance.sceneChanger.AllowFinishLoadingScene();
|
||||
__instance.startedSceneLoad = true;
|
||||
__instance.loadingObject.SetActive(true);
|
||||
IsReallyDoneLoading = true;
|
||||
__instance.startedSceneLoad = true;
|
||||
__instance.sceneChanger.BeginLoadingScene();
|
||||
__instance.sceneChanger.AllowFinishLoadingScene();
|
||||
__instance.logoAnimFinish.gameObject.SetActive(false);
|
||||
__instance.loadingObject.SetActive(true);
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
if (__instance.doneLoadingRefdata && !__instance.startedSceneLoad && Time.time - __instance.startTime > __instance.minimumSecondsBeforeSceneChange)
|
||||
{
|
||||
@@ -55,8 +57,9 @@ class SplashIntroPatch
|
||||
BetterLogo = UnityEngine.Object.Instantiate(InnerLogo, InnerLogo.transform.parent);
|
||||
GameObject.Destroy(InnerLogo);
|
||||
BetterLogo.name = "BetterLogo";
|
||||
BetterLogo.GetComponent<SpriteRenderer>().sprite = Utils.LoadSprite("BetterAmongUs.Resources.Images.BetterAmongUs-Logo.png", 150f);
|
||||
BetterLogo.GetComponent<SpriteRenderer>().sprite = Utils.LoadSprite("BetterAmongUs.Resources.Images.BetterAmongUs-By-The-Enhanced-Network-Logo.png", 150f);
|
||||
__instance.logoAnimFinish.transform.Find("BlackOverlay").transform.SetLocalY(0f);
|
||||
__instance.loadingObject.SetActive(false);
|
||||
}
|
||||
|
||||
__instance.startedSceneLoad = BetterIntro;
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 215 KiB |
@@ -18,8 +18,8 @@ BetterAmongUs comes packed with a variety of features designed to improve your g
|
||||
#
|
||||
<size=150%>Issues & Bugs</size>
|
||||
#
|
||||
- If you encounter any issues or have feedback, please report them on our <nobr><link="https://github.com/D1GQ/BetterAmongUs-Public/issues">Github Issues Page</nobr></link> or Bug Reports channel in the <nobr><link="https://discord.gg/a3eVJHp9p5">BAU Discord Server</nobr></link>.
|
||||
- If you encounter any issues or have feedback, please report them on our <nobr><link="https://github.com/EnhancedNetwork/BetterAmongUs-Public/issues">Github Issues Page</nobr></link> or Bug Reports channel in the <nobr><link="https://discord.gg/ten">TEN Discord Server</nobr></link>.
|
||||
#
|
||||
Thank you for your support, and we hope you enjoy the new features of <b>BetterAmongUs</b>!
|
||||
#
|
||||
<size=150%><nobr><link="https://discord.gg/vjYrXpzNAn">Discord</nobr></link> </size> <size=150%><nobr><link="https://github.com/D1GQ/BetterAmongUs-Public">Github</nobr></link> </size>
|
||||
<size=150%><nobr><link="https://discord.gg/ten">Discord</nobr></link> </size> <size=150%><nobr><link="https://github.com/EnhancedNetwork/BetterAmongUs-Public">Github</nobr></link> </size>
|
||||
@@ -40,8 +40,8 @@ Added list of Better Settings
|
||||
#
|
||||
<size=150%>Issues & Bugs</size>
|
||||
#
|
||||
- If you encounter any issues or have feedback, please report them on our <nobr><link="https://github.com/D1GQ/BetterAmongUs-Public/issues">Github Issues Page</nobr></link> or Bug Reports channel in the <nobr><link="https://discord.gg/a3eVJHp9p5">BAU Discord Server</nobr></link>.
|
||||
- If you encounter any issues or have feedback, please report them on our <nobr><link="https://github.com/EnhancedNetwork/BetterAmongUs-Public/issues">Github Issues Page</nobr></link> or Bug Reports channel in the <nobr><link="https://discord.gg/ten">TEN Discord Server</nobr></link>.
|
||||
#
|
||||
Thank you for your support, and we hope you enjoy the new features of <b>BetterAmongUs</b>!
|
||||
#
|
||||
<size=150%><nobr><link="https://discord.gg/vjYrXpzNAn">Discord</nobr></link> </size> <size=150%><nobr><link="https://github.com/D1GQ/BetterAmongUs-Public">Github</nobr></link> </size>
|
||||
<size=150%><nobr><link="https://discord.gg/ten">Discord</nobr></link> </size> <size=150%><nobr><link="https://github.com/EnhancedNetwork/BetterAmongUs-Public">Github</nobr></link> </size>
|
||||
@@ -14,7 +14,7 @@ namespace BetterAmongUs;
|
||||
public enum ReleaseTypes : int
|
||||
{
|
||||
Release,
|
||||
Canary,
|
||||
Beta,
|
||||
Dev,
|
||||
}
|
||||
|
||||
@@ -23,14 +23,14 @@ public enum ReleaseTypes : int
|
||||
public class Main : BasePlugin
|
||||
{
|
||||
public const ReleaseTypes ReleaseBuildType = ReleaseTypes.Release;
|
||||
public const string CanaryNum = "0";
|
||||
public const string HotfixNum = "1";
|
||||
public const bool IsHotFix = true;
|
||||
public const string PluginGuid = "com.d1gq.betteramongus";
|
||||
public const string PluginVersion = "1.1.2";
|
||||
public const string ReleaseDate = "09.8.2024"; // mm/dd/yyyy
|
||||
public const string Github = "https://github.com/D1GQ/BetterAmongUs-Public";
|
||||
public const string Discord = "https://discord.gg/vjYrXpzNAn";
|
||||
public const string BetaNum = "0";
|
||||
public const string HotfixNum = "0";
|
||||
public const bool IsHotFix = false;
|
||||
public const string PluginGuid = "com.ten.betteramongus";
|
||||
public const string PluginVersion = "1.1.3";
|
||||
public const string ReleaseDate = "09.16.2024"; // mm/dd/yyyy
|
||||
public const string Github = "https://github.com/EnhancedNetwork/BetterAmongUs-Public";
|
||||
public const string Discord = "https://discord.gg/ten";
|
||||
|
||||
public static string modSignature
|
||||
{
|
||||
@@ -46,7 +46,7 @@ public class Main : BasePlugin
|
||||
|
||||
var versionData = new StringBuilder()
|
||||
.Append(Enum.GetName(typeof(ReleaseTypes), ReleaseBuildType))
|
||||
.Append(CanaryNum)
|
||||
.Append(BetaNum)
|
||||
.Append(HotfixNum)
|
||||
.Append(PluginGuid)
|
||||
.Append(GetVersionText().Replace(" ", "."))
|
||||
@@ -70,8 +70,8 @@ public class Main : BasePlugin
|
||||
|
||||
if (ReleaseBuildType == ReleaseTypes.Release)
|
||||
text = $"v{BetterAmongUsVersion}";
|
||||
else if (ReleaseBuildType == ReleaseTypes.Canary)
|
||||
text = $"v{BetterAmongUsVersion}{newLineText}Canary {Main.CanaryNum}";
|
||||
else if (ReleaseBuildType == ReleaseTypes.Beta)
|
||||
text = $"v{BetterAmongUsVersion}{newLineText}Beta {Main.BetaNum}";
|
||||
else if (Main.ReleaseBuildType == ReleaseTypes.Dev)
|
||||
text = $"v{BetterAmongUsVersion}{newLineText}Dev {Main.ReleaseDate}";
|
||||
|
||||
@@ -174,7 +174,7 @@ public class Main : BasePlugin
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
BetterAmongUs.Logger.Error(ex.ToString());
|
||||
BetterAmongUs.Logger.Error(ex);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user