2022-03-26 02:34:21 +00:00
|
|
|
|
using QSB.Messaging;
|
2022-03-26 01:54:07 +00:00
|
|
|
|
using QSB.Player;
|
|
|
|
|
using QSB.Player.TransformSync;
|
|
|
|
|
|
|
|
|
|
namespace QSB.EchoesOfTheEye.DreamWorld.Messages;
|
|
|
|
|
|
2022-03-26 01:57:26 +00:00
|
|
|
|
/// <summary>
|
2022-03-26 02:34:21 +00:00
|
|
|
|
/// todo SendInitialState
|
2022-03-26 01:57:26 +00:00
|
|
|
|
/// </summary>
|
2022-03-26 01:54:07 +00:00
|
|
|
|
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;
|
|
|
|
|
}
|
|
|
|
|
}
|