quantum-space-buddies/QSB/DeathSync/Messages/StartLoopMessage.cs
2021-12-25 22:53:36 -08:00

30 lines
874 B
C#

using OWML.Common;
using QSB.ClientServerStateSync;
using QSB.Messaging;
using QSB.Utility;
namespace QSB.DeathSync.Messages
{
internal class StartLoopMessage : QSBMessage
{
public override void OnReceiveLocal() => OnReceiveRemote();
public override void OnReceiveRemote()
{
DebugLog.DebugWrite($" ~~~ LOOP START ~~~");
if (QSBSceneManager.CurrentScene == OWScene.SolarSystem)
{
ClientStateManager.Instance.SendChangeClientStateMessage(ClientState.AliveInSolarSystem);
}
else if (QSBSceneManager.CurrentScene == OWScene.EyeOfTheUniverse)
{
ClientStateManager.Instance.SendChangeClientStateMessage(ClientState.AliveInEye);
}
else
{
DebugLog.ToConsole($"Error - Got StartLoop event when not in universe!", MessageType.Error);
ClientStateManager.Instance.SendChangeClientStateMessage(ClientState.NotLoaded);
}
}
}
}