quantum-space-buddies/QSB/Events/LeaveMessage.cs

27 lines
718 B
C#
Raw Normal View History

using System;
using System.Linq;
using QSB.Messaging;
using UnityEngine.Networking;
2020-03-06 19:03:35 +01:00
namespace QSB.Events
{
public class LeaveMessage : PlayerMessage
2020-03-06 19:03:35 +01:00
{
public override MessageType MessageType => MessageType.Leave;
public uint[] ObjectIds { get; set; }
public override void Deserialize(NetworkReader reader)
{
base.Deserialize(reader);
ObjectIds = reader.ReadString().Split(',').Select(x => Convert.ToUInt32(x)).ToArray();
}
public override void Serialize(NetworkWriter writer)
{
base.Serialize(writer);
writer.Write(string.Join(",", ObjectIds.Select(x => x.ToString()).ToArray()));
}
2020-03-06 19:03:35 +01:00
}
}