Skip to content
This repository was archived by the owner on Jul 18, 2020. It is now read-only.

Commit 0c2346d

Browse files
committed
Version 0.1.8, protocol 7
Fix sound sustainers
1 parent f81ee99 commit 0c2346d

File tree

6 files changed

+14
-52
lines changed

6 files changed

+14
-52
lines changed

About/Manifest.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<Manifest>
44
<identifier>Multiplayer</identifier>
5-
<version>0.1.7</version>
5+
<version>0.1.8</version>
66
<manifestUri>https://github.com/Zetrith/Multiplayer/master/About/Manifest.xml</manifestUri>
77
<downloadUri>https://github.com/Zetrith/Multiplayer/releases/latest</downloadUri>
88
</Manifest>

Languages/English/Keyed/Multiplayer.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<MpArbiterDesc>A game instance which runs in the background and helps with desync solving.</MpArbiterDesc>
2222

2323
<MpReplayOutdated>(Outdated)</MpReplayOutdated>
24-
<MpReplayOutdatedDesc>This replay was made for protocol version {0}, but you are running version {1}.\n\nThe replay might not play correctly.</MpReplayOutdatedDesc>
24+
<MpReplayOutdatedDesc>This replay was made for protocol version {0}, but you are running version {1}.\n\nThe replay might not play correctly.\nPossible incompatibilities are listed with the release history.</MpReplayOutdatedDesc>
2525

2626
<MpServerCloseConfirmation>Are you sure you want to close the server? Unsaved progress will be lost.</MpServerCloseConfirmation>
2727

Source/Client/Designators.cs

-25
Original file line numberDiff line numberDiff line change
@@ -132,29 +132,4 @@ static void Postfix(ref Thing __result)
132132
}
133133
}
134134

135-
[HarmonyPatch(typeof(Game))]
136-
[HarmonyPatch(nameof(Game.CurrentMap), MethodType.Getter)]
137-
public static class CurrentMapGetPatch
138-
{
139-
public static Map currentMap;
140-
141-
static void Postfix(ref Map __result)
142-
{
143-
if (currentMap != null)
144-
__result = currentMap;
145-
}
146-
}
147-
148-
[HarmonyPatch(typeof(Game))]
149-
[HarmonyPatch(nameof(Game.CurrentMap), MethodType.Setter)]
150-
[HarmonyPriority(Priority.First)]
151-
public static class CurrentMapSetPatch
152-
{
153-
public static bool ignore;
154-
155-
static bool Prefix()
156-
{
157-
return !ignore;
158-
}
159-
}
160135
}

Source/Client/Multiplayer.cs

-22
Original file line numberDiff line numberDiff line change
@@ -455,18 +455,6 @@ private static void DoPatches()
455455
var setMapTimePrefix = new HarmonyMethod(AccessTools.Method(typeof(SetMapTimeForUI), "Prefix"));
456456
var setMapTimePostfix = new HarmonyMethod(AccessTools.Method(typeof(SetMapTimeForUI), "Postfix"));
457457

458-
var mapInterfaceMethods = new[]
459-
{
460-
nameof(MapInterface.MapInterfaceOnGUI_BeforeMainTabs),
461-
nameof(MapInterface.MapInterfaceOnGUI_AfterMainTabs),
462-
nameof(MapInterface.HandleMapClicks),
463-
nameof(MapInterface.HandleLowPriorityInput),
464-
nameof(MapInterface.MapInterfaceUpdate)
465-
};
466-
467-
foreach (string m in mapInterfaceMethods)
468-
harmony.Patch(AccessTools.Method(typeof(MapInterface), m), setMapTimePrefix, setMapTimePostfix);
469-
470458
var windowMethods = new[] { "DoWindowContents", "WindowUpdate" };
471459
foreach (string m in windowMethods)
472460
harmony.Patch(typeof(MainTabWindow_Inspect).GetMethod(m), setMapTimePrefix, setMapTimePostfix);
@@ -477,16 +465,6 @@ private static void DoPatches()
477465
if (method != null && !method.IsAbstract)
478466
harmony.Patch(method, setMapTimePrefix, setMapTimePostfix);
479467
}
480-
481-
harmony.Patch(
482-
AccessTools.Method(typeof(SoundRoot), nameof(SoundRoot.Update)),
483-
setMapTimePrefix, setMapTimePostfix
484-
);
485-
486-
harmony.Patch(
487-
AccessTools.Method(typeof(FloatMenuMakerMap), nameof(FloatMenuMakerMap.ChoicesAtFor)),
488-
setMapTimePrefix, setMapTimePostfix
489-
);
490468
}
491469
}
492470

Source/Client/SetMapTime.cs

+10-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,14 @@
1010

1111
namespace Multiplayer.Client
1212
{
13+
// Set the map time for GUI methods depending on it
14+
[MpPatch(typeof(MapInterface), nameof(MapInterface.MapInterfaceOnGUI_BeforeMainTabs))]
15+
[MpPatch(typeof(MapInterface), nameof(MapInterface.MapInterfaceOnGUI_AfterMainTabs))]
16+
[MpPatch(typeof(MapInterface), nameof(MapInterface.HandleMapClicks))]
17+
[MpPatch(typeof(MapInterface), nameof(MapInterface.HandleLowPriorityInput))]
18+
[MpPatch(typeof(MapInterface), nameof(MapInterface.MapInterfaceUpdate))]
19+
[MpPatch(typeof(SoundRoot), nameof(SoundRoot.Update))]
20+
[MpPatch(typeof(FloatMenuMakerMap), nameof(FloatMenuMakerMap.ChoicesAtFor))]
1321
static class SetMapTimeForUI
1422
{
1523
static void Prefix(ref PrevTime? __state)
@@ -81,7 +89,8 @@ static void Prefix(DangerWatcher __instance, ref PrevTime? __state)
8189
static void Postfix(PrevTime? __state) => __state?.Set();
8290
}
8391

84-
[HarmonyPatch(typeof(Sustainer), nameof(Sustainer.SustainerUpdate))]
92+
[MpPatch(typeof(Sustainer), nameof(Sustainer.SustainerUpdate))]
93+
[MpPatch(typeof(Sustainer), "<Sustainer>m__0")]
8594
static class SustainerUpdateMapTime
8695
{
8796
static void Prefix(Sustainer __instance, ref PrevTime? __state)

Source/Common/Version.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
{
33
public static class MpVersion
44
{
5-
public const string Version = "0.1.7";
6-
public const int Protocol = 6;
5+
public const string Version = "0.1.8";
6+
public const int Protocol = 7;
77

88
#if DEBUG
99
public const bool IsDebug = true;

0 commit comments

Comments
 (0)