37 lines
974 B
C#
37 lines
974 B
C#
using Lidgren.Network;
|
|
using Robust.Shared.Network;
|
|
using Robust.Shared.Serialization;
|
|
|
|
namespace Content.Shared._White.JoinQueue;
|
|
|
|
/// <summary>
|
|
/// Sent from server to client with queue state for player
|
|
/// Also initiates queue state on client
|
|
/// </summary>
|
|
public sealed class MsgQueueUpdate : NetMessage
|
|
{
|
|
public override MsgGroups MsgGroup => MsgGroups.Command;
|
|
|
|
/// <summary>
|
|
/// Total players in queue
|
|
/// </summary>
|
|
public int Total { get; set; }
|
|
|
|
/// <summary>
|
|
/// Player current position in queue (starts from 1)
|
|
/// </summary>
|
|
public int Position { get; set; }
|
|
|
|
public override void ReadFromBuffer(NetIncomingMessage buffer, IRobustSerializer serializer)
|
|
{
|
|
Total = buffer.ReadInt32();
|
|
Position = buffer.ReadInt32();
|
|
}
|
|
|
|
public override void WriteToBuffer(NetOutgoingMessage buffer, IRobustSerializer serializer)
|
|
{
|
|
buffer.Write(Total);
|
|
buffer.Write(Position);
|
|
}
|
|
}
|