34 lines
681 B
C#
Raw Normal View History

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