mirror of
https://github.com/Gurge44/EndlessHostRoles.git
synced 2026-10-25 22:46:54 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
81e2d4e2d5 | ||
|
|
2c05cd6b99 | ||
|
|
c458d15c02 | ||
|
|
4ba0049bf3 | ||
|
|
a962374eeb |
No files matched your search
+1
-1
@@ -1,5 +1,5 @@
|
||||
# Thank you so much for finding and using EHR!
|
||||
|
||||
- Another attempt at fixing the host getting kicked on vanilla regions
|
||||
- ACTUALLY FIXED THE HOST GETTING KICKED ON VANILLA SERVERS
|
||||
|
||||
---
|
||||
@@ -42,8 +42,8 @@ public class Main : BasePlugin
|
||||
private const string DebugKeyHash = "c0fd562955ba56af3ae20d7ec9e64c664f0facecef4b3e366e109306adeae29d";
|
||||
private const string DebugKeySalt = "59687b";
|
||||
private const string PluginGuid = "com.gurge44.endlesshostroles";
|
||||
public const string PluginVersion = "7.1.2";
|
||||
public const string PluginDisplayVersion = "7.1.2";
|
||||
public const string PluginVersion = "7.1.3";
|
||||
public const string PluginDisplayVersion = "7.1.3";
|
||||
public const bool TestBuild = false;
|
||||
|
||||
public const string NeutralColor = "#ffab1b";
|
||||
|
||||
@@ -103,8 +103,9 @@ internal static class CustomRoleSelector
|
||||
|
||||
switch (role)
|
||||
{
|
||||
case CustomRoles.Ventriloquist when GameStates.CurrentServerType == GameStates.ServerType.Vanilla:
|
||||
case CustomRoles.Weatherman when Main.LIMap || GameStates.CurrentServerType == GameStates.ServerType.Vanilla:
|
||||
case CustomRoles.RoomRusher when Main.LIMap:
|
||||
case CustomRoles.Weatherman when Main.LIMap:
|
||||
case CustomRoles.Doctor when Options.EveryoneSeesDeathReasons.GetBool():
|
||||
case CustomRoles.LovingCrewmate or CustomRoles.LovingImpostor when !loversData.Spawning:
|
||||
case CustomRoles.Commander when optImpNum <= 1 && Commander.CannotSpawnAsSoloImp.GetBool():
|
||||
|
||||
+31
-1
@@ -1796,6 +1796,9 @@ public static class Utils
|
||||
catch (Exception e) { ThrowException(e); }
|
||||
}
|
||||
|
||||
public static bool TempReviveHostRunning;
|
||||
private static Stopwatch TempReviveHostStopwatch;
|
||||
|
||||
public static void SendMultipleMessages(this IEnumerable<Message> messages, SendOption sendOption = SendOption.Reliable)
|
||||
{
|
||||
var sender = CustomRpcSender.Create("Utils.SendMultipleMessages", sendOption);
|
||||
@@ -1838,7 +1841,34 @@ public static class Utils
|
||||
text = text.Replace("color=", string.Empty);
|
||||
title = title.Replace("color=", string.Empty);
|
||||
|
||||
PlayerControl sender = !addtoHistory ? PlayerControl.LocalPlayer : Main.AllAlivePlayerControls.MinBy(x => x.PlayerId) ?? Main.AllPlayerControls.MinBy(x => x.PlayerId) ?? PlayerControl.LocalPlayer;
|
||||
PlayerControl sender = !addtoHistory || GameStates.CurrentServerType == GameStates.ServerType.Vanilla ? PlayerControl.LocalPlayer : Main.AllAlivePlayerControls.MinBy(x => x.PlayerId) ?? Main.AllPlayerControls.MinBy(x => x.PlayerId) ?? PlayerControl.LocalPlayer;
|
||||
|
||||
if (sender.AmOwner && (!sender.IsAlive() || sender.Data.IsDead))
|
||||
{
|
||||
if (!TempReviveHostRunning)
|
||||
Main.Instance.StartCoroutine(TempReviveHost());
|
||||
else
|
||||
TempReviveHostStopwatch?.Restart();
|
||||
|
||||
IEnumerator TempReviveHost()
|
||||
{
|
||||
TempReviveHostRunning = true;
|
||||
TempReviveHostStopwatch = Stopwatch.StartNew();
|
||||
|
||||
sender.Data.IsDead = false;
|
||||
sender.Data.SendGameData();
|
||||
|
||||
while (TempReviveHostStopwatch.ElapsedMilliseconds < 1000)
|
||||
yield return null;
|
||||
|
||||
if (!AmongUsClient.Instance.AmHost || GameStates.IsEnded || GameStates.IsLobby) yield break;
|
||||
|
||||
sender.Data.IsDead = true;
|
||||
sender.Data.SendGameData();
|
||||
|
||||
TempReviveHostRunning = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (sendTo != byte.MaxValue && receiver.AmOwner)
|
||||
{
|
||||
|
||||
@@ -125,6 +125,8 @@ internal static class ChatCommands
|
||||
|
||||
public static bool HasMessageDuringEjectionScreen;
|
||||
|
||||
private static bool WaitingToSend;
|
||||
|
||||
public static void LoadCommands()
|
||||
{
|
||||
Command.AllCommands = new Dictionary<string, Command>
|
||||
@@ -466,6 +468,22 @@ internal static class ChatCommands
|
||||
if (text.Contains("666") && PlayerControl.LocalPlayer.Is(CustomRoles.Demon))
|
||||
Achievements.Type.WhatTheHell.Complete();
|
||||
|
||||
if (!canceled && AmongUsClient.Instance.AmHost && Utils.TempReviveHostRunning)
|
||||
{
|
||||
if (!WaitingToSend) Main.Instance.StartCoroutine(Wait());
|
||||
return false;
|
||||
|
||||
IEnumerator Wait()
|
||||
{
|
||||
WaitingToSend = true;
|
||||
while (Utils.TempReviveHostRunning && AmongUsClient.Instance.AmHost) yield return null;
|
||||
yield return new WaitForSeconds(0.5f);
|
||||
if (GameStates.IsEnded || GameStates.IsLobby) yield break;
|
||||
WaitingToSend = false;
|
||||
if (HudManager.InstanceExists) HudManager.Instance.Chat.SendChat();
|
||||
}
|
||||
}
|
||||
|
||||
return !canceled;
|
||||
}
|
||||
|
||||
|
||||
@@ -72,10 +72,10 @@ internal static class GameEndChecker
|
||||
Ended = true;
|
||||
LoadingEndScreen = true;
|
||||
|
||||
//Main.AllPlayerControls.Do(pc => Camouflage.RpcSetSkin(pc, true, true, true));
|
||||
Main.AllPlayerControls.Do(pc => Camouflage.RpcSetSkin(pc, true, true, true));
|
||||
|
||||
NameNotifyManager.Reset();
|
||||
//NotifyRoles(ForceLoop: true);
|
||||
NotifyRoles(ForceLoop: true);
|
||||
|
||||
CustomSabotage.Reset();
|
||||
|
||||
@@ -359,13 +359,6 @@ internal static class GameEndChecker
|
||||
try { LobbySharingAPI.NotifyLobbyStatusChanged(LobbyStatus.Ended); }
|
||||
catch (Exception e) { ThrowException(e); }
|
||||
|
||||
string msg = GetString("NotifyGameEnding");
|
||||
|
||||
Main.AllPlayerControls
|
||||
.Where(x => x.GetClient() != null && !x.Data.Disconnected)
|
||||
.Select(x => new Message("\n", x.PlayerId, msg))
|
||||
.SendMultipleMessages();
|
||||
|
||||
SetEverythingUpPatch.LastWinsReason = WinnerTeam is CustomWinner.Crewmate or CustomWinner.Impostor ? GetString($"GameOverReason.{reason}") : string.Empty;
|
||||
var self = AmongUsClient.Instance;
|
||||
self.StartCoroutine(CoEndGame(self, reason).WrapToIl2Cpp());
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"LanguageID": "0",
|
||||
"TextBelowVersionText": "",
|
||||
"HostText": "مضيف - EHR",
|
||||
"IconColor": "",
|
||||
"IconColor": "00a5ff",
|
||||
"HostColor": "#00ffa5",
|
||||
"Icon": " | ",
|
||||
"NameColor": "#00ffff",
|
||||
@@ -59,19 +59,19 @@
|
||||
"ROT.Impostor_Killing": "★ الأدوار القاتلة",
|
||||
"ROT.Impostor_Support": "★ الأدوار الداعمة",
|
||||
"ROT.Impostor_Concealing": "أدوار الإخفاء",
|
||||
"ROT.Impostor_Miscellaneous": "★ Miscellaneous Roles",
|
||||
"ROT.Impostor_Miscellaneous": "أدوار متنوعة",
|
||||
"ROT.Impostor_Madmate": "ادوار الطاقم الغاضب",
|
||||
"ROT.Crewmate_Investigate": "★ أدوار التحقق",
|
||||
"ROT.Crewmate_Support": "★ أدوار الدعم",
|
||||
"ROT.Crewmate_Power": "★ أدوار القوة",
|
||||
"ROT.Crewmate_Killing": "★ الأدوار القاتلة",
|
||||
"ROT.Crewmate_Chaos": "★ أدوار الفوضى",
|
||||
"ROT.Crewmate_Miscellaneous": "★ Miscellaneous Roles",
|
||||
"ROT.Crewmate_Miscellaneous": "أدوار متنوعة",
|
||||
"ROT.Neutral_Evil": "★ الأدوار الشريرة",
|
||||
"ROT.Neutral_Pariah": "★ Pariah Roles",
|
||||
"ROT.Neutral_Benign": "★ Benign Roles",
|
||||
"ROT.Neutral_Killing": "★ الأدوار القاتلة",
|
||||
"ROT.Coven_Miscellaneous": "★ Miscellaneous Roles",
|
||||
"ROT.Coven_Miscellaneous": "أدوار متنوعة",
|
||||
"ROT.Vanilla": "★ Vanilla Roles",
|
||||
"ROT.Basic": "★ الأدوار العادية",
|
||||
"ROT.AddonType.ImpOnly": "★ زوائد المحتال-فقط",
|
||||
@@ -121,8 +121,8 @@
|
||||
"RoleSubCategoryLimitOptions.Neutral_Pariah.Max": "Maximum Neutral Pariah Roles",
|
||||
"RoleSubCategoryLimitOptions.Neutral_Benign.Min": "Minimum Neutral Benign Roles",
|
||||
"RoleSubCategoryLimitOptions.Neutral_Benign.Max": "Maximum Neutral Benign Roles",
|
||||
"RoleSubCategoryLimitOptions.Neutral_Killing.Min": "Minimum Neutral Killing Roles",
|
||||
"RoleSubCategoryLimitOptions.Neutral_Killing.Max": "Maximum Neutral Killing Roles",
|
||||
"RoleSubCategoryLimitOptions.Neutral_Killing.Min": "أدنى حد للأدوار القاتلين المحايدين",
|
||||
"RoleSubCategoryLimitOptions.Neutral_Killing.Max": "أقصى حد للأدوار القاتلين المحايدين",
|
||||
"FactionLimits.Impostor.Min": "<#00ffa5>Minimum</color> <#ffffff>amount of</color> Impostor Roles",
|
||||
"FactionLimits.Impostor.Max": "<#00a5ff>Maximum</color> <#ffffff>amount of</color> Impostor Roles",
|
||||
"FactionLimits.Neutral.Min": "<#00ffa5>Minimum</color> <#ffffff>amount of</color> Neutral Roles",
|
||||
@@ -10232,7 +10232,7 @@
|
||||
"EnableAutoFactionMinMaxSettings": "Enable Automatic Team Size Adjustment Based on Player Count",
|
||||
"AutoFactionMinMaxSettings.PlayerCap": "Minimum Player Threshold for These Settings to Apply (0 = unused)",
|
||||
"AutoFactionMinMaxSettings.Applied": "[Auto Team Sizes] {0} players (>={1}) = {2} (<#ffff00>NNK</color>: <#ffffff>{3}-{4}</color>)",
|
||||
"GMPoll.Allow": "Show {gm} in /gmpoll choices",
|
||||
"GMPoll.Allow": "عرض {gm} في خيارات /gmpoll",
|
||||
"MPoll.Allow": "Show {m} in /mpoll choices",
|
||||
"MenuTitle.GMPoll": "Game Mode Poll",
|
||||
"MenuTitle.MPoll": "Map Poll",
|
||||
@@ -10268,6 +10268,6 @@
|
||||
"Hungarian": "Hungarian",
|
||||
"Polish": "Polish",
|
||||
"Indonesian": "Indonesian",
|
||||
"Persian": "Persian",
|
||||
"Persian": "الفارسية",
|
||||
"NotAssigned": "-"
|
||||
}
|
||||
Reference in new issue
Block a user