Merge pull request #32 from EnhancedNetwork/dev

v1.1.3 hotfix 1
This commit is contained in:
D1GQ authored and GitHub committed 2024-09-17 17:55:31 -05:00
commit 275c7dc576
11 files changed
+67 -13

No files matched your search

+2 -2
View File
@@ -264,10 +264,10 @@ class AntiCheat
Logger.LogCheat($"{player.BetterData().RealName} {Enum.GetName((RpcCalls)callId)}: {level > BetterGameSettings.DetectedLevelAbove.GetInt()}");
}
if (level + 1 <= 0)
if (level > 1000000)
{
var betterData = player.BetterData();
player.Kick(false, "{0}" + $" due to {level + 1} being invalid level", bypassDataCheck: true);
player.Kick(false, "{0}" + $" due to {level} being invalid level", bypassDataCheck: true);
betterData.AntiCheatInfo.BannedByAntiCheat = true;
}
}
+1 -1
View File
@@ -120,7 +120,7 @@ static class ExtendedPlayerControl
if (setReasonInfo != "")
{
GameDataShowNotificationPatch.BetterShowNotification(player.Data, forceReasonText: string.Format(setReasonInfo, ban ? "banned" : "kicked"));
GameDataShowNotificationPatch.BetterShowNotification(player.Data, forceReasonText: string.Format(setReasonInfo, Ban ? "banned" : "kicked"));
}
AmongUsClient.Instance.KickPlayer(player.GetClientId(), Ban);
+1 -1
View File
@@ -153,7 +153,7 @@ 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);
var flag = Enum.IsDefined(typeof(CustomRPC), unchecked(callId)) || Enum.IsDefined(typeof(RpcCalls), callId);
if (!flag && player.IsHost())
{
+37 -3
View File
@@ -12,9 +12,17 @@ namespace BetterAmongUs.Patches;
// Thanks: https://github.com/0xDrMoe/TownofHost-Enhanced
public enum NewsTypes
{
None,
BAU,
TEN
}
[HarmonyPatch]
public class ModNews
{
public NewsTypes NewsType;
public int Number;
public string Title;
public string SubTitle;
@@ -41,8 +49,9 @@ public class ModNews
public static List<ModNews> AllModNews = new List<ModNews>();
public ModNews(int number, string title, string subTitle, string shortTitle, string text, string date)
public ModNews(NewsTypes type, int number, string title, string subTitle, string shortTitle, string text, string date)
{
NewsType = type;
Number = number;
Title = title;
SubTitle = subTitle;
@@ -69,6 +78,8 @@ public class ModNews
private static void ProcessModNewsFiles()
{
AllModNews.Clear();
var assembly = Assembly.GetExecutingAssembly();
var resourceNames = assembly.GetManifestResourceNames()
.Where(name => name.StartsWith("BetterAmongUs.Resources.ModNews") && name.EndsWith(".txt"));
@@ -85,10 +96,23 @@ public class ModNews
var lines = content.Split(new[] { '\r', '\n' }, StringSplitOptions.RemoveEmptyEntries);
int number = 0;
string title = "", subTitle = "", shortTitle = "", text = "", date = "";
NewsTypes type = NewsTypes.None;
foreach (var line in lines)
{
if (line.StartsWith("#Skip")) return;
else if (line.StartsWith("#Type:"))
{
switch (line[6..])
{
case "BAU":
type = NewsTypes.BAU;
break;
case "TEN":
type = NewsTypes.TEN;
break;
}
}
else if (line.StartsWith("#Number:")) number = int.Parse(line[8..]);
else if (line.StartsWith("#Title:")) title = line[7..];
else if (line.StartsWith("#SubTitle:")) subTitle = line[10..];
@@ -101,7 +125,7 @@ public class ModNews
if (number != 0)
{
new ModNews(number, title, subTitle, shortTitle, text, date);
new ModNews(type, number, title, subTitle, shortTitle, text, date);
}
}
@@ -146,7 +170,17 @@ public class ModNews
obj.transform.localPosition = new Vector3(-0.8f, 0.13f, 0.5f);
obj.transform.localScale = new Vector3(0.9f, 0.9f, 0.9f);
var renderer = obj.AddComponent<SpriteRenderer>();
renderer.sprite = Utils.LoadSprite($"BetterAmongUs.Resources.Images.BetterAmongUs-Icon.png", 650f);
switch (AllModNews.Find(a => a.Number == announcement.Number).NewsType)
{
case NewsTypes.BAU:
renderer.sprite = Utils.LoadSprite($"BetterAmongUs.Resources.Images.BetterAmongUs-Icon.png", 650f);
break;
case NewsTypes.TEN:
renderer.sprite = Utils.LoadSprite($"BetterAmongUs.Resources.Images.TENCreditsButton.png", 365f);
break;
default:
break;
}
renderer.maskInteraction = SpriteMaskInteraction.VisibleInsideMask;
}
}
+1 -1
View File
@@ -93,7 +93,7 @@ public class ClientPatch
{
if (!GameStates.IsHost)
{
if (__instance.PlayerLevel == unchecked((uint)0 - 1))
if (__instance.PlayerLevel > 1000000)
{
__instance.PlayerLevel = 0;
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

@@ -1,4 +1,5 @@
#Skip
#Type:BAU
#Number:110000
#Title:Main Header
#SubTitle:Main Header SubText
+2 -1
View File
@@ -1,4 +1,5 @@
#Number:110001
#Type:BAU
#Number:110001
#Title:Better Among Us v1.0.0
#SubTitle:<color=#4d4d4d>Is it truly better though?</color>
#ShortTitle:BAU v1.0.0
+2 -1
View File
@@ -1,4 +1,5 @@
#Number:110002
#Type:BAU
#Number:110002
#Title:Better Among Us v1.1.0
#SubTitle:<color=#4d4d4d>Settings Galore!</color>
#ShortTitle:BAU v1.1.0
+17
View File
@@ -0,0 +1,17 @@
#Type:TEN
#Number:110003
#Title:Better Among Us X The Enhanced Network
#SubTitle:<color=#4d4d4d>Things are getting more enhanced!</color>
#ShortTitle:TEN
#Date:2024-9-16T00:00:00Z
#-----------------------------
We are excited to announce that <b>BetterAmongUs</b> is now collaborating with <b>The Enhanced Network (TEN)</b>!
#
This collaboration brings a lot of exciting changes to <b>BetterAmongUs</b>, including:
- <b>Improved Online Safety:</b> With TEN’s focus on cybersecurity, we aim to make your gaming experience safer and more enjoyable.
- <b>Larger Community:</b> By merging with TEN, we’re expanding our player base and community support, opening up more opportunities for community-driven content and events.
- <b>Cross-Mod Compatibility:</b> We’re working with TEN to ensure <b>BetterAmongUs</b> remains compatible with other mods, including their host-only Among Us mod.
#
Stay tuned for a detailed change log and updates coming soon!
#
<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>
+3 -3
View File
@@ -24,11 +24,11 @@ public class Main : BasePlugin
{
public const ReleaseTypes ReleaseBuildType = ReleaseTypes.Release;
public const string BetaNum = "0";
public const string HotfixNum = "0";
public const bool IsHotFix = false;
public const string HotfixNum = "1";
public const bool IsHotFix = true;
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 ReleaseDate = "09.17.2024"; // mm/dd/yyyy
public const string Github = "https://github.com/EnhancedNetwork/BetterAmongUs-Public";
public const string Discord = "https://discord.gg/ten";