-
-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
55509e3
commit 789e23e
Showing
17 changed files
with
195 additions
and
156 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
34 changes: 0 additions & 34 deletions
34
src/RustServerMetrics/Harmony/TimeWarning/Dispose_Patch.cs
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
13 changes: 7 additions & 6 deletions
13
...armony/BasePlayer/OnDisconnected_Patch.cs → ...atches/BasePlayer_OnDisconnected_Patch.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 6 additions & 6 deletions
12
...cs/Harmony/BasePlayer/PlayerInit_Patch.cs → ...onyPatches/BasePlayer_PlayerInit_Patch.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 6 additions & 9 deletions
15
...rMetrics/Harmony/Bootstrap/StartServer.cs → ...onyPatches/Bootstrap_StartServer_Patch.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 8 additions & 6 deletions
14
...etrics/Harmony/NetWrite/PacketID_Patch.cs → ...HarmonyPatches/NetWrite_PacketID_Patch.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 8 additions & 6 deletions
14
...verMetrics/Harmony/NetWrite/Send_Patch.cs → ...ics/HarmonyPatches/NetWrite_Send_Patch.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 7 additions & 6 deletions
13
...ics/Harmony/Performance/FPSTimer_Patch.cs → ...monyPatches/Performance_FPSTimer_Patch.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
src/RustServerMetrics/HarmonyPatches/TimeWarning_Dispose_Patch.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
using HarmonyLib; | ||
using System.Collections.Generic; | ||
using System.Reflection; | ||
using System.Reflection.Emit; | ||
|
||
namespace RustServerMetrics.HarmonyPatches | ||
{ | ||
[HarmonyPatch(typeof(TimeWarning), nameof(TimeWarning.Dispose))] | ||
public static class TimeWarning_Dispose_Patch | ||
{ | ||
[HarmonyTranspiler] | ||
public static IEnumerable<CodeInstruction> Transpile(IEnumerable<CodeInstruction> originalInstructions) | ||
{ | ||
var methodInfo = typeof(MetricsTimeWarning) | ||
.GetMethod(nameof(MetricsTimeWarning.DisposeTimeWarning), BindingFlags.Static | BindingFlags.Public); | ||
|
||
return new CodeInstruction[] | ||
{ | ||
new CodeInstruction(OpCodes.Ldarg_0), | ||
new CodeInstruction(OpCodes.Call, methodInfo), | ||
new CodeInstruction(OpCodes.Ret) | ||
}; | ||
} | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
src/RustServerMetrics/HarmonyPatches/TimeWarning_New_Patch.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
using HarmonyLib; | ||
using System.Collections.Generic; | ||
using System.Reflection; | ||
using System.Reflection.Emit; | ||
|
||
namespace RustServerMetrics.HarmonyPatches | ||
{ | ||
[HarmonyPatch(typeof(TimeWarning), nameof(TimeWarning.New))] | ||
public static class TimeWarning_New_Patch | ||
{ | ||
[HarmonyTranspiler] | ||
public static IEnumerable<CodeInstruction> Transpile(IEnumerable<CodeInstruction> originalInstructions) | ||
{ | ||
var methodInfo = typeof(MetricsTimeWarning) | ||
.GetMethod(nameof(MetricsTimeWarning.GetTimeWarning), BindingFlags.Static | BindingFlags.Public); | ||
|
||
return new List<CodeInstruction> | ||
{ | ||
new CodeInstruction(OpCodes.Ldarg_0), | ||
new CodeInstruction(OpCodes.Ldarg_1), | ||
new CodeInstruction(OpCodes.Call, methodInfo), | ||
new CodeInstruction(OpCodes.Ret) | ||
}; | ||
} | ||
} | ||
} |
Oops, something went wrong.