quantum-space-buddies/QSB/DeathSync/Messages/StartLoopMessage.cs

31 lines
835 B
C#
Raw Normal View History

2021-12-26 06:53:36 +00:00
using OWML.Common;
using QSB.ClientServerStateSync;
using QSB.ClientServerStateSync.Messages;
2021-08-08 19:01:21 +00:00
using QSB.Messaging;
using QSB.Utility;
namespace QSB.DeathSync.Messages
2021-08-08 19:01:21 +00:00
{
internal class StartLoopMessage : QSBMessage
{
public override void OnReceiveLocal() => OnReceiveRemote();
public override void OnReceiveRemote()
2021-08-08 19:01:21 +00:00
{
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
{
DebugLog.ToConsole($"Error - Got StartLoop event when not in universe!", MessageType.Error);
new ClientStateMessage(ClientState.NotLoaded).Send();
}
2021-08-08 19:01:21 +00:00
}
}
2021-12-23 06:26:53 +00:00
}