2020-02-10 23:03:28 +01:00
|
|
|
|
using OWML.Common;
|
|
|
|
|
using OWML.ModHelper;
|
2020-07-28 00:13:43 +01:00
|
|
|
|
using QSB.Events;
|
2020-07-30 22:27:14 +02:00
|
|
|
|
using QSB.Utility;
|
2020-02-10 23:03:28 +01:00
|
|
|
|
using UnityEngine;
|
|
|
|
|
using UnityEngine.Networking;
|
|
|
|
|
|
2020-02-15 20:48:02 +01:00
|
|
|
|
namespace QSB
|
|
|
|
|
{
|
|
|
|
|
public class QSB : ModBehaviour
|
|
|
|
|
{
|
2020-02-13 20:34:51 +01:00
|
|
|
|
public static IModHelper Helper;
|
2020-03-02 17:34:01 +01:00
|
|
|
|
public static string DefaultServerIP;
|
2020-03-14 21:42:43 +01:00
|
|
|
|
public static bool DebugMode;
|
2020-08-10 11:45:24 +01:00
|
|
|
|
public static bool WokenUp;
|
2020-02-10 23:03:28 +01:00
|
|
|
|
|
2020-02-15 20:48:02 +01:00
|
|
|
|
private void Awake()
|
|
|
|
|
{
|
2020-02-10 23:03:28 +01:00
|
|
|
|
Application.runInBackground = true;
|
|
|
|
|
}
|
|
|
|
|
|
2020-02-15 20:48:02 +01:00
|
|
|
|
private void Start()
|
|
|
|
|
{
|
2020-02-13 20:34:51 +01:00
|
|
|
|
Helper = ModHelper;
|
2020-02-10 23:03:28 +01:00
|
|
|
|
|
2020-02-14 22:14:24 +01:00
|
|
|
|
gameObject.AddComponent<DebugLog>();
|
2020-02-13 20:34:51 +01:00
|
|
|
|
gameObject.AddComponent<QSBNetworkManager>();
|
2020-03-02 17:34:01 +01:00
|
|
|
|
gameObject.AddComponent<NetworkManagerHUD>();
|
2020-03-14 21:42:43 +01:00
|
|
|
|
gameObject.AddComponent<DebugActions>();
|
2020-08-09 21:46:51 +01:00
|
|
|
|
gameObject.AddComponent<PlayerStatesRequest>();
|
2020-08-09 09:17:00 +02:00
|
|
|
|
gameObject.AddComponent<UnityHelper>();
|
2020-08-10 11:45:24 +01:00
|
|
|
|
|
|
|
|
|
GlobalMessenger.AddListener("RestartTimeLoop", OnLoopStart);
|
|
|
|
|
GlobalMessenger.AddListener("WakeUp", OnWakeUp);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void OnWakeUp()
|
|
|
|
|
{
|
|
|
|
|
WokenUp = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void OnLoopStart()
|
|
|
|
|
{
|
|
|
|
|
WokenUp = false;
|
2020-03-02 17:34:01 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override void Configure(IModConfig config)
|
|
|
|
|
{
|
|
|
|
|
DefaultServerIP = config.GetSettingsValue<string>("defaultServerIP");
|
2020-03-14 21:42:43 +01:00
|
|
|
|
DebugMode = config.GetSettingsValue<bool>("debugMode");
|
2020-02-10 23:03:28 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|