diff --git a/Modules/AntiCheat.cs b/Modules/AntiCheat.cs index 1fccf3c..5808df8 100644 --- a/Modules/AntiCheat.cs +++ b/Modules/AntiCheat.cs @@ -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: $"AUM Chat - {nameString}"); + var flag3 = player.BetterData().AntiCheatInfo.AUMChats.Count > 0 && player.BetterData().AntiCheatInfo.AUMChats.Last() == msgString; + if (!flag3) + { + Utils.AddChatPrivate($"{msgString}", overrideName: $"AUM Chat - {player.GetPlayerNameAndColor()}"); + 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; } } diff --git a/Modules/BetterDataManager.cs b/Modules/BetterDataManager.cs index 18c3fb9..5c9c522 100644 --- a/Modules/BetterDataManager.cs +++ b/Modules/BetterDataManager.cs @@ -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>>>(json) ?? new Dictionary>>(); // 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); } } } diff --git a/Modules/BetterNotificationManager.cs b/Modules/BetterNotificationManager.cs index 1eb207d..0b814ea 100644 --- a/Modules/BetterNotificationManager.cs +++ b/Modules/BetterNotificationManager.cs @@ -37,27 +37,32 @@ class BetterNotificationManager public static void NotifyCheat(PlayerControl player, string reason, string newText = "", bool kickPlayer = true) { - string text = $"Player: {player?.BetterData().RealName} Has been detected doing an unauthorized action: {reason}"; - if (newText != "") - text = $"Player: {player?.BetterData().RealName} " + newText + $": {reason}"; - + var Reason = reason; if (BetterGameSettings.CensorDetectionReason.GetBool()) { - reason = string.Concat('*').Repeat(reason.Length); + Reason = string.Concat('*').Repeat(reason.Length); + } + + string text = $"Player: {player?.BetterData().RealName} Has been detected doing an unauthorized action: {Reason}"; + string rawText = $"Player: {player?.BetterData().RealName} Has been detected doing an unauthorized action: {reason}"; + if (newText != "") + { + text = $"Player: {player?.BetterData().RealName} " + newText + $": {Reason}"; + rawText = $"Player: {player?.BetterData().RealName} " + newText + $": {reason}"; } 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 Anti-Cheat!\n Reason: {reason}", true); + player.Kick(true, "{0} " + $"by Anti-Cheat!\n Reason: {Reason}", true); } } diff --git a/Modules/ExtendedPlayerControl.cs b/Modules/ExtendedPlayerControl.cs index 25c7015..6007e7a 100644 --- a/Modules/ExtendedPlayerControl.cs +++ b/Modules/ExtendedPlayerControl.cs @@ -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; } diff --git a/Modules/ExtendedPlayerInfo.cs b/Modules/ExtendedPlayerInfo.cs index 07f61aa..968d2a2 100644 --- a/Modules/ExtendedPlayerInfo.cs +++ b/Modules/ExtendedPlayerInfo.cs @@ -26,6 +26,7 @@ public static class PlayerControlDataExtension public class ExtendedAntiCheatInfo { public bool BannedByAntiCheat { get; set; } = false; + public List 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; diff --git a/Modules/LateTask.cs b/Modules/LateTask.cs index 74a0959..5a5a389 100644 --- a/Modules/LateTask.cs +++ b/Modules/LateTask.cs @@ -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)); diff --git a/Modules/OptionItems/BetterOptionPlayerItem.cs b/Modules/OptionItems/BetterOptionPlayerItem.cs index a270a5c..8fb9193 100644 --- a/Modules/OptionItems/BetterOptionPlayerItem.cs +++ b/Modules/OptionItems/BetterOptionPlayerItem.cs @@ -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; diff --git a/Modules/RPC.cs b/Modules/RPC.cs index aca33d2..671a722 100644 --- a/Modules/RPC.cs +++ b/Modules/RPC.cs @@ -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 = "♻BetterAmongUs♻"; + Utils.DisconnectSelf($"{BAU} does not support\nModded Lobbies!"); + } + 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 TOHE"); } break; + */ } } diff --git a/Modules/Utils.cs b/Modules/Utils.cs index 2d12789..518ef6b 100644 --- a/Modules/Utils.cs +++ b/Modules/Utils.cs @@ -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) diff --git a/Patches/ClientPatch.cs b/Patches/ClientPatch.cs index c97c6a0..0de4165 100644 --- a/Patches/ClientPatch.cs +++ b/Patches/ClientPatch.cs @@ -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 diff --git a/Patches/CommandsPatch.cs b/Patches/CommandsPatch.cs index 3334463..5fecb07 100644 --- a/Patches/CommandsPatch.cs +++ b/Patches/CommandsPatch.cs @@ -456,7 +456,7 @@ class CommandsPatch if (flag3 == true) { - cmdTarget = Utils.PlayerFromId(int.Parse(subArg)); + cmdTarget = Utils.PlayerFromPlayerId(int.Parse(subArg)); return true; } else diff --git a/Patches/MainMenuPatch.cs b/Patches/MainMenuPatch.cs index c54a34e..cfd3d1a 100644 --- a/Patches/MainMenuPatch.cs +++ b/Patches/MainMenuPatch.cs @@ -58,6 +58,7 @@ internal class MainMenuPatch string creditsTextTitle = "-=Mod Credits=-\n"; string creditsText = "◆ Head Developer: D1GQ"; + /* if (creditsButton == null) { creditsButton = CreateButton( @@ -70,6 +71,7 @@ internal class MainMenuPatch }, "Mod Credits"); //"Credits" } + */ if (gitHubButton == null) { diff --git a/Patches/MeetingHudPatch.cs b/Patches/MeetingHudPatch.cs index 71ef7dc..eb00b71 100644 --- a/Patches/MeetingHudPatch.cs +++ b/Patches/MeetingHudPatch.cs @@ -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; diff --git a/Patches/PingTrackerPatch.cs b/Patches/PingTrackerPatch.cs index 4a64ef4..022b68b 100644 --- a/Patches/PingTrackerPatch.cs +++ b/Patches/PingTrackerPatch.cs @@ -31,8 +31,8 @@ public class PingTrackerPatch } sb.Append($"BetterAmongUs {Main.GetVersionText(true)}\n"); - // sb.Append("By The Enhanced Network\n"); - sb.Append($"{Main.Github}\n"); + sb.Append("By The Enhanced Network\n"); + // sb.Append($"{Main.Github}\n"); if (Main.BetterHost.Value && GameStates.IsHost) { diff --git a/Patches/PlayerControlPatch.cs b/Patches/PlayerControlPatch.cs index 53950ef..36d3718 100644 --- a/Patches/PlayerControlPatch.cs +++ b/Patches/PlayerControlPatch.cs @@ -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); } } diff --git a/Patches/RoleManagerPatch.cs b/Patches/RoleManagerPatch.cs index 01f8183..ba67d76 100644 --- a/Patches/RoleManagerPatch.cs +++ b/Patches/RoleManagerPatch.cs @@ -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) diff --git a/Patches/SplashIntroPatch.cs b/Patches/SplashIntroPatch.cs index 2e1482c..145bd1d 100644 --- a/Patches/SplashIntroPatch.cs +++ b/Patches/SplashIntroPatch.cs @@ -31,18 +31,20 @@ class SplashIntroPatch UnityEngine.Object.Destroy(__instance.logoAnimFinish.GetComponent()); } + /* 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().sprite = Utils.LoadSprite("BetterAmongUs.Resources.Images.BetterAmongUs-Logo.png", 150f); + BetterLogo.GetComponent().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; diff --git a/Resources/Images/BetterAmongUs-By-The-Enhanced-Network-Logo.png b/Resources/Images/BetterAmongUs-By-The-Enhanced-Network-Logo.png new file mode 100644 index 0000000..174ecc1 Binary files /dev/null and b/Resources/Images/BetterAmongUs-By-The-Enhanced-Network-Logo.png differ diff --git a/Resources/ModNews/BAU.v.1.0.0.txt b/Resources/ModNews/BAU.v.1.0.0.txt index 828a9e8..a409a50 100644 --- a/Resources/ModNews/BAU.v.1.0.0.txt +++ b/Resources/ModNews/BAU.v.1.0.0.txt @@ -18,8 +18,8 @@ BetterAmongUs comes packed with a variety of features designed to improve your g # Issues & Bugs # -- If you encounter any issues or have feedback, please report them on our Github Issues Page or Bug Reports channel in the BAU Discord Server. +- If you encounter any issues or have feedback, please report them on our Github Issues Page or Bug Reports channel in the TEN Discord Server. # Thank you for your support, and we hope you enjoy the new features of BetterAmongUs! # -Discord Github +Discord Github diff --git a/Resources/ModNews/BAU.v1.1.0.txt b/Resources/ModNews/BAU.v1.1.0.txt index 629eab0..feb0777 100644 --- a/Resources/ModNews/BAU.v1.1.0.txt +++ b/Resources/ModNews/BAU.v1.1.0.txt @@ -40,8 +40,8 @@ Added list of Better Settings # Issues & Bugs # -- If you encounter any issues or have feedback, please report them on our Github Issues Page or Bug Reports channel in the BAU Discord Server. +- If you encounter any issues or have feedback, please report them on our Github Issues Page or Bug Reports channel in the TEN Discord Server. # Thank you for your support, and we hope you enjoy the new features of BetterAmongUs! # -Discord Github +Discord Github diff --git a/main.cs b/main.cs index 7cd264b..f8b8a98 100644 --- a/main.cs +++ b/main.cs @@ -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); } }