diff options
Diffstat (limited to 'AnodyneArchipelago/Plugin.cs')
| -rw-r--r-- | AnodyneArchipelago/Plugin.cs | 24 |
1 files changed, 24 insertions, 0 deletions
| diff --git a/AnodyneArchipelago/Plugin.cs b/AnodyneArchipelago/Plugin.cs index 411a2a4..7375503 100644 --- a/AnodyneArchipelago/Plugin.cs +++ b/AnodyneArchipelago/Plugin.cs | |||
| @@ -1,15 +1,39 @@ | |||
| 1 | using BepInEx; | 1 | using BepInEx; |
| 2 | using BepInEx.NET.Common; | 2 | using BepInEx.NET.Common; |
| 3 | using HarmonyLib; | ||
| 4 | using HarmonyLib.Tools; | ||
| 5 | using System.Reflection; | ||
| 3 | 6 | ||
| 4 | namespace AnodyneArchipelago | 7 | namespace AnodyneArchipelago |
| 5 | { | 8 | { |
| 6 | [BepInPlugin("com.fourisland.plugins.anodyne.archipelago", "Anodyne Archipelago", "1.0.0.0")] | 9 | [BepInPlugin("com.fourisland.plugins.anodyne.archipelago", "Anodyne Archipelago", "1.0.0.0")] |
| 7 | public class Plugin : BasePlugin | 10 | public class Plugin : BasePlugin |
| 8 | { | 11 | { |
| 12 | public static Plugin Instance = null; | ||
| 13 | |||
| 9 | public override void Load() | 14 | public override void Load() |
| 10 | { | 15 | { |
| 16 | Instance = this; | ||
| 17 | |||
| 11 | // Plugin startup logic | 18 | // Plugin startup logic |
| 12 | Log.LogInfo($"Plugin {PluginInfo.PLUGIN_GUID} is loaded!"); | 19 | Log.LogInfo($"Plugin {PluginInfo.PLUGIN_GUID} is loaded!"); |
| 20 | |||
| 21 | // Make patches | ||
| 22 | HarmonyFileLog.Enabled = true; | ||
| 23 | HarmonyFileLog.FileWriterPath = "HarmonyLog.txt"; | ||
| 24 | |||
| 25 | Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly()); | ||
| 26 | } | ||
| 27 | } | ||
| 28 | |||
| 29 | [HarmonyPatch(typeof(AnodyneSharp.States.PlayState), nameof(AnodyneSharp.States.PlayState.Create))] | ||
| 30 | class PlayStateCreatePatch | ||
| 31 | { | ||
| 32 | static void Prefix() | ||
| 33 | { | ||
| 34 | Plugin.Instance.Log.LogInfo("Connecting to Archipelago!"); | ||
| 35 | |||
| 36 | ArchipelagoManager.Connect("localhost:38281", "Anodyne", ""); | ||
| 13 | } | 37 | } |
| 14 | } | 38 | } |
| 15 | } | 39 | } |
