Makes map vote and roundstart smart about player count. (#5418)

* Makes map vote and roundstart smart about player count.
No more Saltern with 30 players, or Knight Ship with 50.

* a typo

* Address reviews.

* Localized.
This commit is contained in:
Moony
2021-11-20 12:32:07 -06:00
committed by GitHub
parent 6487cd6d79
commit eb6d24abd0
18 changed files with 298 additions and 19 deletions

View File

@@ -0,0 +1,53 @@
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.ViewVariables;
namespace Content.Server.Maps
{
/// <summary>
/// Prototype data for a game map.
/// </summary>
[Prototype("gameMap")]
public class GameMapPrototype : IPrototype
{
/// <inheritdoc/>
[ViewVariables, DataField("id", required: true)]
public string ID { get; } = default!;
/// <summary>
/// Minimum players for the given map.
/// </summary>
[ViewVariables, DataField("minPlayers", required: true)]
public uint MinPlayers { get; }
/// <summary>
/// Maximum players for the given map.
/// </summary>
[ViewVariables, DataField("maxPlayers")]
public uint MaxPlayers { get; } = uint.MaxValue;
/// <summary>
/// Name of the given map.
/// </summary>
[ViewVariables, DataField("mapName", required: true)]
public string MapName { get; } = default!;
/// <summary>
/// Relative directory path to the given map, i.e. `Maps/saltern.yml`
/// </summary>
[ViewVariables, DataField("mapPath", required: true)]
public string MapPath { get; } = default!;
/// <summary>
/// Controls if the map can be used as a fallback if no maps are eligible.
/// </summary>
[ViewVariables, DataField("fallback")]
public bool Fallback { get; }
/// <summary>
/// Controls if the map can be voted for.
/// </summary>
[ViewVariables, DataField("votable")]
public bool Votable { get; } = true;
}
}