quantum-space-buddies/QSB/Messaging/PlayerLeaveMessage.cs
Mister_Nebula 9b98a2fff5 Refactor
2020-08-09 12:19:51 +01:00

23 lines
631 B
C#

using System;
using System.Linq;
using UnityEngine.Networking;
namespace QSB.Events
{
public class PlayerLeaveMessage : PlayerMessage
{
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()));
}
}
}