quantum-space-buddies/QSB/EchoesOfTheEye/DreamWorld/Messages/ExitDreamWorldMessage.cs
JohnCorby 0c5d230454 guh
2022-03-25 19:34:44 -07:00

32 lines
619 B
C#

using QSB.Messaging;
using QSB.Player;
using QSB.Player.TransformSync;
namespace QSB.EchoesOfTheEye.DreamWorld.Messages;
/// <summary>
/// todo SendInitialState
/// </summary>
internal class ExitDreamWorldMessage : QSBMessage
{
static ExitDreamWorldMessage()
{
GlobalMessenger.AddListener(OWEvents.ExitDreamWorld, () =>
{
if (!PlayerTransformSync.LocalInstance)
{
return;
}
new ExitDreamWorldMessage().Send();
});
}
public override void OnReceiveRemote()
{
var player = QSBPlayerManager.GetPlayer(From);
player.InDreamWorld = false;
player.AssignedSimulationLantern = null;
}
}