This commit is contained in:
@ -1,6 +1,12 @@
|
||||
using IPA;
|
||||
using ScoreTracker.Common;
|
||||
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
|
||||
{
|
||||
@ -8,24 +14,36 @@ namespace ScoreTracker
|
||||
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)
|
||||
public Plugin(IPALogger logger, PluginMetadata metadata, Zenjector zenjector)
|
||||
{
|
||||
Instance = this;
|
||||
Logger.Log = logger; // Setup the logger
|
||||
Log = logger; // Setup the logger
|
||||
|
||||
// Install our Zenject bindings
|
||||
zenjector.Install<AppInstaller>(Location.App);
|
||||
}
|
||||
|
||||
[OnStart]
|
||||
public void OnApplicationStart()
|
||||
{
|
||||
Logger.Log.Info("OnApplicationStart");
|
||||
Log.Info("OnApplicationStart");
|
||||
|
||||
Task.Run(async () =>
|
||||
{
|
||||
await Request.PostJsonAsync("http://localhost:7500/boobies", new Dictionary<object, object> {
|
||||
{ "boobies", "yes" }
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
[OnExit]
|
||||
public void OnApplicationQuit()
|
||||
{
|
||||
Logger.Log.Info("OnApplicationQuit");
|
||||
Log.Info("OnApplicationQuit");
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user