forked from DanielHeEGG/SmartEjectors
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPlugin.cs
46 lines (37 loc) · 1.27 KB
/
Plugin.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using NebulaAPI;
using System.IO;
namespace SmartEjectors
{
[BepInPlugin(GUID, PluginInfo.PLUGIN_NAME, PluginInfo.PLUGIN_VERSION)]
[BepInProcess("DSPGAME.exe")]
[BepInDependency(NebulaModAPI.API_GUID)]
public class Plugin : BaseUnityPlugin, IMultiplayerModWithSettings
{
private const string GUID = "com.daniel-egg." + PluginInfo.PLUGIN_NAME;
private Harmony harmony = new Harmony(GUID);
public static new ManualLogSource Logger;
public string Version { get { return PluginInfo.PLUGIN_VERSION; } }
public bool CheckVersion(string hostVersion, string clientVersion)
{
return hostVersion.Equals(clientVersion);
}
public void Export(BinaryWriter w)
{
SmartEjectors.Config.Export(w);
}
public void Import(BinaryReader r)
{
SmartEjectors.Config.Import(r);
}
private void Awake()
{
Plugin.Logger = base.Logger;
SmartEjectors.Config.Init(Path.Combine(Paths.ConfigPath, PluginInfo.PLUGIN_NAME + ".cfg"));
harmony.PatchAll(typeof(Patch.LockEjectors));
harmony.PatchAll(typeof(Patch.DefaultOrbit));
}
}
}