mirror of
https://github.com/space-syndicate/space-station-14.git
synced 2026-10-10 02:41:18 +03:00
36 lines
No EOL
984 B
C#
36 lines
No EOL
984 B
C#
using Lidgren.Network;
|
|
using Robust.Shared.Network;
|
|
using Robust.Shared.Serialization;
|
|
|
|
namespace Content.Shared.Corvax.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);
|
|
}
|
|
} |