2022-05-28 20:57:32 +00:00
|
|
|
|
using QSB.EchoesOfTheEye.DreamLantern.WorldObjects;
|
|
|
|
|
using QSB.Messaging;
|
|
|
|
|
using QSB.Player;
|
|
|
|
|
using QSB.WorldSync;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
|
|
|
|
namespace QSB.EchoesOfTheEye.LightSensorSync.Messages;
|
|
|
|
|
|
2023-07-28 18:30:57 +00:00
|
|
|
|
public class PlayerIlluminatingLanternsMessage : QSBMessage<(uint playerId, int[] lanterns)>
|
2022-05-28 20:57:32 +00:00
|
|
|
|
{
|
|
|
|
|
public PlayerIlluminatingLanternsMessage(uint playerId, IEnumerable<DreamLanternController> lanterns) :
|
|
|
|
|
base((
|
|
|
|
|
playerId,
|
2022-10-05 02:52:29 +00:00
|
|
|
|
lanterns.Select(x => x.GetWorldObject<QSBDreamLanternController>().ObjectId).ToArray()
|
2022-05-28 20:57:32 +00:00
|
|
|
|
)) { }
|
|
|
|
|
|
|
|
|
|
public override void OnReceiveRemote()
|
|
|
|
|
{
|
|
|
|
|
var lightSensor = (SingleLightSensor)QSBPlayerManager.GetPlayer(Data.playerId).LightSensor;
|
|
|
|
|
|
|
|
|
|
lightSensor._illuminatingDreamLanternList.Clear();
|
|
|
|
|
lightSensor._illuminatingDreamLanternList.AddRange(
|
2022-10-05 02:52:29 +00:00
|
|
|
|
Data.lanterns.Select(x => x.GetWorldObject<QSBDreamLanternController>().AttachedObject));
|
2022-05-28 20:57:32 +00:00
|
|
|
|
}
|
|
|
|
|
}
|