-
Notifications
You must be signed in to change notification settings - Fork 0
/
GameSaver.cs
49 lines (41 loc) · 1.54 KB
/
GameSaver.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
47
48
49
using BepInEx;
using GameSaver.Network;
using GameSaver.Util;
using HarmonyLib;
using UnboundLib.GameModes;
namespace GameSaver;
[BepInDependency("com.willis.rounds.unbound")]
[BepInDependency("pykess.rounds.plugins.moddingutils")]
[BepInDependency("io.olavim.rounds.rwf")]
[BepInPlugin(ModId, CompatibilityModName, Version)]
[BepInProcess("Rounds.exe")]
public class GameSaver : BaseUnityPlugin
{
private const string ModId = "ot.dan.rounds.gamesaver";
private const string ModName = "Game Saver";
public const string Version = "1.0.7";
public const string ModInitials = "GS";
private const string CompatibilityModName = "GameSaver";
public static GameSaver Instance { get; private set; }
internal void Awake()
{
Instance = this;
var harmony = new Harmony(ModId);
harmony.PatchAll();
SaveManager.Initialize();
}
internal void Start()
{
GameModeManager.AddHook(GameModeHooks.HookGameStart, SaveManager.GameStart, 0);
GameModeManager.AddHook(GameModeHooks.HookGameEnd, SaveManager.GameEnd);
GameModeManager.AddHook(GameModeHooks.HookRoundStart, SaveManager.RoundStart);
GameModeManager.AddHook(GameModeHooks.HookRoundEnd, SaveManager.RoundEnd);
GameModeManager.AddHook(GameModeHooks.HookPickStart, SaveManager.PickStart);
// GameModeManager.AddHook(GameModeHooks.HookPickEnd, SaveManager.PickEnd);
gameObject.AddComponent<LobbyMonitor>();
}
public void Log(string debug)
{
Logger.LogInfo(debug);
}
}