Skip to content

Commit 21b16a1

Browse files
committed
Added bool which lets u disable gld mods
1 parent e77df1f commit 21b16a1

1 file changed

Lines changed: 4 additions & 12 deletions

File tree

src/Managers/Multiplayer.cs

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using System.Linq;
4-
using System.Threading.Tasks;
5-
using BepInEx.Logging;
61
using HarmonyLib;
72
using Polytopia.Data;
83

@@ -12,6 +7,7 @@ public static class Multiplayer
127
{
138
internal const string DEFAULT_SERVER_URL = "https://dev.polydystopia.xyz";
149
private const string GldMarker = "##GLD:";
10+
internal static bool allowGldMods = false;
1511

1612
// Cache parsed GLD by game Seed to handle rewinds/reloads
1713
private static readonly Dictionary<int, GameLogicData> _gldCache = new();
@@ -35,13 +31,6 @@ public static void MultiplayerScreen_Show(MultiplayerScreen __instance)
3531
__instance.multiplayerSelectionScreen.TournamentsButton.gameObject.SetActive(false);
3632
}
3733

38-
39-
[HarmonyPostfix]
40-
[HarmonyPatch(typeof(ProfileScreen), nameof(ProfileScreen.Start))]
41-
public static void ProfileScreen_Start(ProfileScreen __instance)
42-
{
43-
}
44-
4534
[HarmonyPostfix]
4635
[HarmonyPatch(typeof(StartScreen), nameof(StartScreen.Start))]
4736
private static void StartScreen_Start(StartScreen __instance)
@@ -58,6 +47,8 @@ private static void StartScreen_Start(StartScreen __instance)
5847
[HarmonyPatch(typeof(GameState), nameof(GameState.Deserialize))]
5948
private static void Deserialize_Postfix(GameState __instance, BinaryReader __0)
6049
{
50+
if(!allowGldMods) return;
51+
6152
Plugin.logger?.LogDebug("Deserialize_Postfix: Entered");
6253

6354
try
@@ -143,6 +134,7 @@ private static void Deserialize_Postfix(GameState __instance, BinaryReader __0)
143134
/// </summary>
144135
private static string? FetchGldById(int modGldVersion)
145136
{
137+
if(!allowGldMods) return null;
146138
try
147139
{
148140
using var client = new HttpClient();

0 commit comments

Comments
 (0)