quantum-space-buddies/QSB/Events/LeaveMessage.cs
AmazingAlek 485698e93b
Alek/simplify name messages (#88)
* Showing player markers

* Marker above head

* Use player name on marker

* Sync full state on init

* Sync game state on start

* removed name from death and leave message

Co-authored-by: Ricardo Lopes <raicuparta@gmail.com>
2020-05-19 20:05:15 +02:00

27 lines
718 B
C#

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