2021-12-26 06:53:36 +00:00
|
|
|
|
using OWML.Common;
|
|
|
|
|
using QSB.ClientServerStateSync;
|
2021-08-08 19:01:21 +00:00
|
|
|
|
using QSB.Messaging;
|
|
|
|
|
using QSB.Utility;
|
|
|
|
|
|
2021-12-23 10:17:56 +00:00
|
|
|
|
namespace QSB.DeathSync.Messages
|
2021-08-08 19:01:21 +00:00
|
|
|
|
{
|
2021-12-23 06:26:53 +00:00
|
|
|
|
internal class StartLoopMessage : QSBMessage
|
2021-08-08 19:01:21 +00:00
|
|
|
|
{
|
2021-12-23 06:26:53 +00:00
|
|
|
|
public override void OnReceiveLocal() => OnReceiveRemote();
|
2021-12-04 16:39:37 +00:00
|
|
|
|
|
2021-12-23 06:26:53 +00:00
|
|
|
|
public override void OnReceiveRemote()
|
2021-08-08 19:01:21 +00:00
|
|
|
|
{
|
|
|
|
|
DebugLog.DebugWrite($" ~~~ LOOP START ~~~");
|
2021-11-12 21:05:58 +00:00
|
|
|
|
if (QSBSceneManager.CurrentScene == OWScene.SolarSystem)
|
|
|
|
|
{
|
2021-12-23 02:37:24 +00:00
|
|
|
|
ClientStateManager.Instance.SendChangeClientStateMessage(ClientState.AliveInSolarSystem);
|
2021-11-12 21:05:58 +00:00
|
|
|
|
}
|
|
|
|
|
else if (QSBSceneManager.CurrentScene == OWScene.EyeOfTheUniverse)
|
|
|
|
|
{
|
2021-12-23 02:37:24 +00:00
|
|
|
|
ClientStateManager.Instance.SendChangeClientStateMessage(ClientState.AliveInEye);
|
2021-11-12 21:05:58 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2021-12-26 06:53:36 +00:00
|
|
|
|
DebugLog.ToConsole($"Error - Got StartLoop event when not in universe!", MessageType.Error);
|
2021-12-23 02:37:24 +00:00
|
|
|
|
ClientStateManager.Instance.SendChangeClientStateMessage(ClientState.NotLoaded);
|
2021-11-12 21:05:58 +00:00
|
|
|
|
}
|
2021-08-08 19:01:21 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2021-12-23 06:26:53 +00:00
|
|
|
|
}
|