mirror of
https://github.com/Gurge44/EndlessHostRoles.git
synced 2026-10-19 15:51:58 +00:00
fix compile errors
This commit is contained in:
1 parent
945474e9fc
commit
aa8391c542
8 files changed
+27
-27
No files matched your search
+1
-1
@@ -43,7 +43,7 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup Condition="'$(Configuration)' == 'IL2CPP'">
|
<ItemGroup Condition="'$(Configuration)' == 'IL2CPP'">
|
||||||
<PackageReference Include="AmongUs.GameLibs.Steam" Version="2026.8.18" PrivateAssets="all" />
|
<PackageReference Include="AmongUs.GameLibs.Steam" Version="2026.9.29" PrivateAssets="all" />
|
||||||
<PackageReference Include="BepInEx.IL2CPP.MSBuild" Version="2.1.0-rc.1"/>
|
<PackageReference Include="BepInEx.IL2CPP.MSBuild" Version="2.1.0-rc.1"/>
|
||||||
<PackageReference Include="BepInEx.Unity.IL2CPP" Version="6.0.0-be.735" Private="false" ExcludeAssets="runtime;native" />
|
<PackageReference Include="BepInEx.Unity.IL2CPP" Version="6.0.0-be.735" Private="false" ExcludeAssets="runtime;native" />
|
||||||
<PackageReference Include="Samboy063.Cpp2IL.Core" Version="2022.1.0-pre-release.21" />
|
<PackageReference Include="Samboy063.Cpp2IL.Core" Version="2022.1.0-pre-release.21" />
|
||||||
|
|||||||
Binary file not shown.
@@ -213,7 +213,7 @@ public class Main : BaseUnityPlugin
|
|||||||
|
|
||||||
public Harmony Harmony { get; } = new(PluginGuid);
|
public Harmony Harmony { get; } = new(PluginGuid);
|
||||||
|
|
||||||
public static NormalGameOptionsV11 NormalOptions => GameOptionsManager.Instance != null ? GameOptionsManager.Instance.currentNormalGameOptions : null;
|
public static NormalGameOptionsV12 NormalOptions => GameOptionsManager.Instance != null ? GameOptionsManager.Instance.currentNormalGameOptions : null;
|
||||||
|
|
||||||
// Client Options
|
// Client Options
|
||||||
public static ConfigEntry<string> HideName { get; private set; }
|
public static ConfigEntry<string> HideName { get; private set; }
|
||||||
@@ -979,9 +979,9 @@ public class Main : BaseUnityPlugin
|
|||||||
handler.Info($"{nameof(ThisAssembly.Git.Tag)}: {ThisAssembly.Git.Tag}");
|
handler.Info($"{nameof(ThisAssembly.Git.Tag)}: {ThisAssembly.Git.Tag}");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
NormalGameOptionsV11.RecommendedImpostors = NormalGameOptionsV11.MaxImpostors = Enumerable.Repeat(128, 128).ToArray();
|
NormalGameOptionsV12.RecommendedImpostors = NormalGameOptionsV12.MaxImpostors = Enumerable.Repeat(128, 128).ToArray();
|
||||||
NormalGameOptionsV11.MinPlayers = Enumerable.Repeat(4, 128).ToArray();
|
NormalGameOptionsV12.MinPlayers = Enumerable.Repeat(4, 128).ToArray();
|
||||||
HideNSeekGameOptionsV11.MinPlayers = Enumerable.Repeat(4, 128).ToArray();
|
HideNSeekGameOptionsV12.MinPlayers = Enumerable.Repeat(4, 128).ToArray();
|
||||||
*/
|
*/
|
||||||
|
|
||||||
PrivateTagManager.LoadTagsFromFile();
|
PrivateTagManager.LoadTagsFromFile();
|
||||||
|
|||||||
@@ -11,13 +11,13 @@ public static class IGameManagerEx
|
|||||||
opt.SetBool(name, value);
|
opt.SetBool(name, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Set(bool value, NormalGameOptionsV11 opt)
|
public void Set(bool value, NormalGameOptionsV12 opt)
|
||||||
{
|
{
|
||||||
if (name is not BoolOptionNames.GhostsDoTasks and not BoolOptionNames.Roles)
|
if (name is not BoolOptionNames.GhostsDoTasks and not BoolOptionNames.Roles)
|
||||||
opt.SetBool(name, value);
|
opt.SetBool(name, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Set(bool value, HideNSeekGameOptionsV11 opt)
|
public void Set(bool value, HideNSeekGameOptionsV12 opt)
|
||||||
{
|
{
|
||||||
opt.SetBool(name, value);
|
opt.SetBool(name, value);
|
||||||
}
|
}
|
||||||
@@ -30,12 +30,12 @@ public static class IGameManagerEx
|
|||||||
opt.SetInt(name, value);
|
opt.SetInt(name, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Set(int value, NormalGameOptionsV11 opt)
|
public void Set(int value, NormalGameOptionsV12 opt)
|
||||||
{
|
{
|
||||||
opt.SetInt(name, value);
|
opt.SetInt(name, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Set(int value, HideNSeekGameOptionsV11 opt)
|
public void Set(int value, HideNSeekGameOptionsV12 opt)
|
||||||
{
|
{
|
||||||
opt.SetInt(name, value);
|
opt.SetInt(name, value);
|
||||||
}
|
}
|
||||||
@@ -48,12 +48,12 @@ public static class IGameManagerEx
|
|||||||
opt.SetFloat(name, value);
|
opt.SetFloat(name, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Set(float value, NormalGameOptionsV11 opt)
|
public void Set(float value, NormalGameOptionsV12 opt)
|
||||||
{
|
{
|
||||||
opt.SetFloat(name, value);
|
opt.SetFloat(name, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Set(float value, HideNSeekGameOptionsV11 opt)
|
public void Set(float value, HideNSeekGameOptionsV12 opt)
|
||||||
{
|
{
|
||||||
opt.SetFloat(name, value);
|
opt.SetFloat(name, value);
|
||||||
}
|
}
|
||||||
@@ -66,12 +66,12 @@ public static class IGameManagerEx
|
|||||||
opt.SetByte(name, value);
|
opt.SetByte(name, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Set(byte value, NormalGameOptionsV11 opt)
|
public void Set(byte value, NormalGameOptionsV12 opt)
|
||||||
{
|
{
|
||||||
opt.SetByte(name, value);
|
opt.SetByte(name, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Set(byte value, HideNSeekGameOptionsV11 opt)
|
public void Set(byte value, HideNSeekGameOptionsV12 opt)
|
||||||
{
|
{
|
||||||
opt.SetByte(name, value);
|
opt.SetByte(name, value);
|
||||||
}
|
}
|
||||||
@@ -84,12 +84,12 @@ public static class IGameManagerEx
|
|||||||
opt.SetUInt(name, value);
|
opt.SetUInt(name, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Set(uint value, NormalGameOptionsV11 opt)
|
public void Set(uint value, NormalGameOptionsV12 opt)
|
||||||
{
|
{
|
||||||
opt.SetUInt(name, value);
|
opt.SetUInt(name, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Set(uint value, HideNSeekGameOptionsV11 opt)
|
public void Set(uint value, HideNSeekGameOptionsV12 opt)
|
||||||
{
|
{
|
||||||
opt.SetUInt(name, value);
|
opt.SetUInt(name, value);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,15 +23,15 @@ public abstract class GameOptionsSender
|
|||||||
writer.Write((byte)currentGameMode);
|
writer.Write((byte)currentGameMode);
|
||||||
|
|
||||||
#if IL2CPP
|
#if IL2CPP
|
||||||
if (opt.TryCastFast(out NormalGameOptionsV11 normalOpt))
|
if (opt.TryCastFast(out NormalGameOptionsV12 normalOpt))
|
||||||
NormalGameOptionsV11.Serialize(writer, normalOpt);
|
NormalGameOptionsV12.Serialize(writer, normalOpt);
|
||||||
else if (opt.TryCastFast(out HideNSeekGameOptionsV11 hnsOpt))
|
else if (opt.TryCastFast(out HideNSeekGameOptionsV12 hnsOpt))
|
||||||
#else
|
#else
|
||||||
if (opt is NormalGameOptionsV11 normalOpt)
|
if (opt is NormalGameOptionsV12 normalOpt)
|
||||||
NormalGameOptionsV11.Serialize(writer, normalOpt);
|
NormalGameOptionsV12.Serialize(writer, normalOpt);
|
||||||
else if (opt is HideNSeekGameOptionsV11 hnsOpt)
|
else if (opt is HideNSeekGameOptionsV12 hnsOpt)
|
||||||
#endif
|
#endif
|
||||||
HideNSeekGameOptionsV11.Serialize(writer, hnsOpt);
|
HideNSeekGameOptionsV12.Serialize(writer, hnsOpt);
|
||||||
else
|
else
|
||||||
Logger.Error("Option cast failed", ToString());
|
Logger.Error("Option cast failed", ToString());
|
||||||
|
|
||||||
|
|||||||
@@ -19,9 +19,9 @@ public sealed class PlayerGameOptionsSender(PlayerControl player) : GameOptionsS
|
|||||||
|
|
||||||
private static IGameOptions BasedGameOptions =>
|
private static IGameOptions BasedGameOptions =>
|
||||||
#if IL2CPP
|
#if IL2CPP
|
||||||
Main.RealOptionsData.Restore(new NormalGameOptionsV11(new UnityLogger().CastFast<ILogger>()).CastFast<IGameOptions>());
|
Main.RealOptionsData.Restore(new NormalGameOptionsV12(new UnityLogger().CastFast<ILogger>()).CastFast<IGameOptions>());
|
||||||
#else
|
#else
|
||||||
Main.RealOptionsData.Restore(new NormalGameOptionsV11(new UnityLogger()));
|
Main.RealOptionsData.Restore(new NormalGameOptionsV12(new UnityLogger()));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
protected override bool IsDirty { get; set; }
|
protected override bool IsDirty { get; set; }
|
||||||
|
|||||||
+2
-2
@@ -266,11 +266,11 @@ internal static class Crowded
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[HarmonyPatch(typeof(NormalGameOptionsV11), nameof(NormalGameOptionsV11.AreInvalid))]
|
[HarmonyPatch(typeof(NormalGameOptionsV12), nameof(NormalGameOptionsV12.AreInvalid))]
|
||||||
public static class InvalidOptionsPatches
|
public static class InvalidOptionsPatches
|
||||||
{
|
{
|
||||||
[SuppressMessage("ReSharper", "UnusedMember.Global")]
|
[SuppressMessage("ReSharper", "UnusedMember.Global")]
|
||||||
public static bool Prefix(NormalGameOptionsV11 __instance, [HarmonyArgument(0)] int maxExpectedPlayers)
|
public static bool Prefix(NormalGameOptionsV12 __instance, [HarmonyArgument(0)] int maxExpectedPlayers)
|
||||||
{
|
{
|
||||||
return __instance.MaxPlayers > maxExpectedPlayers ||
|
return __instance.MaxPlayers > maxExpectedPlayers ||
|
||||||
__instance.NumImpostors < 1 ||
|
__instance.NumImpostors < 1 ||
|
||||||
|
|||||||
@@ -384,7 +384,7 @@ internal static class StartGameHostPatch
|
|||||||
|
|
||||||
public static readonly Dictionary<CustomRoles, List<byte>> BasisChangingAddons = [];
|
public static readonly Dictionary<CustomRoles, List<byte>> BasisChangingAddons = [];
|
||||||
|
|
||||||
private static RoleOptionsCollectionV11 RoleOpt => Main.NormalOptions.roleOptions;
|
private static RoleOptionsCollectionV12 RoleOpt => Main.NormalOptions.roleOptions;
|
||||||
|
|
||||||
private static IEnumerator WaitAndSmoothlyUpdate(this LoadingBarManager loadingBarManager, float startPercent, float targetPercent, float duration, string loadingText)
|
private static IEnumerator WaitAndSmoothlyUpdate(this LoadingBarManager loadingBarManager, float startPercent, float targetPercent, float duration, string loadingText)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in new issue
Block a user