2021-12-25 22:53:36 -08:00
|
|
|
|
using OWML.Common;
|
|
|
|
|
using QSB.ClientServerStateSync;
|
2022-02-05 02:50:13 -08:00
|
|
|
|
using QSB.ClientServerStateSync.Messages;
|
2021-08-08 20:01:21 +01:00
|
|
|
|
using QSB.Messaging;
|
|
|
|
|
using QSB.Utility;
|
|
|
|
|
|
2022-03-02 19:46:33 -08:00
|
|
|
|
namespace QSB.DeathSync.Messages;
|
|
|
|
|
|
2023-07-28 19:30:57 +01:00
|
|
|
|
public class StartLoopMessage : QSBMessage
|
2021-08-08 20:01:21 +01:00
|
|
|
|
{
|
2022-03-02 19:46:33 -08:00
|
|
|
|
public override void OnReceiveLocal() => OnReceiveRemote();
|
2022-02-27 04:40:44 -08:00
|
|
|
|
|
2022-03-02 19:46:33 -08:00
|
|
|
|
public override void OnReceiveRemote()
|
|
|
|
|
{
|
|
|
|
|
DebugLog.DebugWrite($" ~~~ LOOP START ~~~");
|
|
|
|
|
if (QSBSceneManager.CurrentScene == OWScene.SolarSystem)
|
|
|
|
|
{
|
|
|
|
|
new ClientStateMessage(ClientState.AliveInSolarSystem).Send();
|
|
|
|
|
}
|
|
|
|
|
else if (QSBSceneManager.CurrentScene == OWScene.EyeOfTheUniverse)
|
|
|
|
|
{
|
|
|
|
|
new ClientStateMessage(ClientState.AliveInEye).Send();
|
|
|
|
|
}
|
|
|
|
|
else
|
2021-08-08 20:01:21 +01:00
|
|
|
|
{
|
2022-03-02 19:46:33 -08:00
|
|
|
|
DebugLog.ToConsole($"Error - Got StartLoop event when not in universe!", MessageType.Error);
|
|
|
|
|
new ClientStateMessage(ClientState.NotLoaded).Send();
|
2021-08-08 20:01:21 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
2021-12-22 22:26:53 -08:00
|
|
|
|
}
|