This repository has been archived on 2024-10-29. You can view files and clone it, but cannot push or open issues or pull requests.
beatsaber-scoretracker/Mod/Plugin.cs
Liam e397c86963
Some checks failed
Release Mod / Build (push) Failing after 32s
yes
2024-08-07 06:03:46 +01:00

51 lines
1.3 KiB
C#

using IPA;
using IPALogger = IPA.Logging.Logger;
using SiraUtil.Zenject;
using IPA.Loader;
using Zenject;
using ScoreTracker.Core;
using System.Threading.Tasks;
using ScoreTracker.API;
using System.Collections.Generic;
namespace ScoreTracker
{
[Plugin(RuntimeOptions.SingleStartInit)]
public class Plugin
{
internal static Plugin Instance { get; private set; }
internal static IPALogger Log { get; private set; }
internal static DiContainer Container; // Workaround to access the Zenject container in SceneLoaded
[Init]
public Plugin(IPALogger logger, PluginMetadata metadata, Zenjector zenjector)
{
Instance = this;
Log = logger; // Setup the logger
// Install our Zenject bindings
zenjector.Install<AppInstaller>(Location.App);
}
[OnStart]
public void OnApplicationStart()
{
Log.Info("OnApplicationStart");
Task.Run(async () =>
{
await Request.PostJsonAsync("http://localhost:7500/test", new Dictionary<object, object> {
{ "boobies", "yes" }
});
});
}
[OnExit]
public void OnApplicationQuit()
{
Log.Info("OnApplicationQuit");
}
}
}