51 lines
1.3 KiB
C#
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/boobies", new Dictionary<object, object> {
|
|
{ "boobies", "yes" }
|
|
});
|
|
});
|
|
}
|
|
|
|
[OnExit]
|
|
public void OnApplicationQuit()
|
|
{
|
|
Log.Info("OnApplicationQuit");
|
|
}
|
|
|
|
}
|
|
}
|