Disable job buttons when they aren't available or late join is disallowed (#2251)
* Disable job buttons when they aren't available In real time too, the technology is overwhelming * Jobs are all unavailable when late join is disallowed. * Better ToggleDisallowLateJoin command parsing * Add togglelatejoin to groups. Co-authored-by: Víctor Aguilera Puerto <zddm@outlook.es>
This commit is contained in:
@@ -231,6 +231,42 @@ namespace Content.Shared.GameTicking
|
||||
}
|
||||
}
|
||||
|
||||
protected class MsgTickerJobsAvailable : NetMessage
|
||||
{
|
||||
#region REQUIRED
|
||||
|
||||
public const MsgGroups GROUP = MsgGroups.Command;
|
||||
public const string NAME = nameof(MsgTickerJobsAvailable);
|
||||
public MsgTickerJobsAvailable(INetChannel channel) : base(NAME, GROUP) { }
|
||||
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// The Status of the Player in the lobby (ready, observer, ...)
|
||||
/// </summary>
|
||||
public string[] JobsAvailable { get; set; } = Array.Empty<string>();
|
||||
|
||||
public override void ReadFromBuffer(NetIncomingMessage buffer)
|
||||
{
|
||||
var amount = buffer.ReadInt32();
|
||||
JobsAvailable = new string[amount];
|
||||
|
||||
for (var i = 0; i < amount; i++)
|
||||
{
|
||||
JobsAvailable[i] = buffer.ReadString();
|
||||
}
|
||||
}
|
||||
|
||||
public override void WriteToBuffer(NetOutgoingMessage buffer)
|
||||
{
|
||||
buffer.Write(JobsAvailable.Length);
|
||||
|
||||
foreach (var job in JobsAvailable)
|
||||
{
|
||||
buffer.Write(job);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public struct RoundEndPlayerInfo
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user