Add Votekick functionality (#32005)
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
using Lidgren.Network;
|
||||
using Lidgren.Network;
|
||||
using Robust.Shared.Network;
|
||||
using Robust.Shared.Serialization;
|
||||
|
||||
@@ -17,6 +17,8 @@ namespace Content.Shared.Voting
|
||||
public (ushort votes, string name)[] Options = default!;
|
||||
public bool IsYourVoteDirty;
|
||||
public byte? YourVote;
|
||||
public bool DisplayVotes;
|
||||
public int TargetEntity;
|
||||
|
||||
public override void ReadFromBuffer(NetIncomingMessage buffer, IRobustSerializer serializer)
|
||||
{
|
||||
@@ -31,6 +33,8 @@ namespace Content.Shared.Voting
|
||||
VoteInitiator = buffer.ReadString();
|
||||
StartTime = TimeSpan.FromTicks(buffer.ReadInt64());
|
||||
EndTime = TimeSpan.FromTicks(buffer.ReadInt64());
|
||||
DisplayVotes = buffer.ReadBoolean();
|
||||
TargetEntity = buffer.ReadVariableInt32();
|
||||
|
||||
Options = new (ushort votes, string name)[buffer.ReadByte()];
|
||||
for (var i = 0; i < Options.Length; i++)
|
||||
@@ -58,6 +62,8 @@ namespace Content.Shared.Voting
|
||||
buffer.Write(VoteInitiator);
|
||||
buffer.Write(StartTime.Ticks);
|
||||
buffer.Write(EndTime.Ticks);
|
||||
buffer.Write(DisplayVotes);
|
||||
buffer.WriteVariableInt32(TargetEntity);
|
||||
|
||||
buffer.Write((byte) Options.Length);
|
||||
foreach (var (votes, name) in Options)
|
||||
|
||||
Reference in New Issue
Block a user