using System.IO;
using Lidgren.Network;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Serialization;
using Robust.Shared.Utility;
using Robust.Shared.ViewVariables;
#nullable disable
namespace Robust.Shared.Network.Messages
{
public sealed class MsgViewVariablesModifyRemote : NetMessage
{
public override MsgGroups MsgGroup => MsgGroups.Command;
///
/// The session ID of the session to modify.
///
public uint SessionId { get; set; }
///
/// Whether the value is meant to be "reinterpreted" on the server.
///
///
/// Modifying a remote prototype needs that we send an object of type .
/// Setting this flag to true will make the server index and use the actual prototype the refers to.
///
public bool ReinterpretValue { get; set; }
///
/// Same deal as .
///
public object[] PropertyIndex { get; set; }
///
/// The new value of the property.
///
public object Value { get; set; }
public override void ReadFromBuffer(NetIncomingMessage buffer, IRobustSerializer serializer)
{
SessionId = buffer.ReadUInt32();
{
var length = buffer.ReadInt32();
using var stream = RobustMemoryManager.GetMemoryStream(length);
buffer.ReadAlignedMemory(stream, length);
PropertyIndex = serializer.Deserialize