Skip to content

Commit

Permalink
Update Team Defaults and TeamConfig Docs
Browse files Browse the repository at this point in the history
  • Loading branch information
TheR00st3r committed Nov 11, 2024
1 parent 7e9de93 commit 7b14a24
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 5 deletions.
18 changes: 18 additions & 0 deletions Docs/source/admin/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,22 @@ Matchconfig Fields
| team_mode | 0 | Change how teams are defined. 0: Default (Teams are fix defined) 1: Scramble (Teams are scrambled when all players are ready) |
+--------------------------+-----------------+-------------------------------------------------------------------------------------------------------------------------------+

Team Fields
'''''''''''''''''''''
+---------+-----------------+---------------------------------------------------------------------------------------------------+
| Field | DefaultValue | Description |
+=========+=================+===================================================================================================+
| id | ULID | Id for the Team, if not defined a new ULID will be generated |
+---------+-----------------+---------------------------------------------------------------------------------------------------+
| name | none (required) | The Teamname |
+---------+-----------------+---------------------------------------------------------------------------------------------------+
| tag | none (required) | Currently not used |
+---------+-----------------+---------------------------------------------------------------------------------------------------+
| flag | DE (required) | The flag that is displayed |
+---------+-----------------+---------------------------------------------------------------------------------------------------+
| players | none | The List of Players (SteamID and Username). If defined only the given players can join the match. |
+---------+-----------------+---------------------------------------------------------------------------------------------------+

Matchconfig Example
'''''''''''''''''''''

Expand All @@ -68,6 +84,7 @@ Matchconfig Example
{
"maplist": ["de_vertigo", "de_dust2", "de_inferno", "de_mirage", "de_nuke", "de_overpass", "de_ancient"],
"team1": {
"id": "1",
"name": "hallo",
"tag": "hallo",
"flag": "DE",
Expand All @@ -77,6 +94,7 @@ Matchconfig Example
}
},
"team2": {
"id": "2",
"name": "asd",
"tag": "asd",
"flag": "DE",
Expand Down
1 change: 1 addition & 0 deletions PugSharp.Config/PugSharp.Config.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<PackageReference Include="Microsoft.Extensions.Logging" Version="8.0.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.2" />
<PackageReference Include="OneOf" Version="3.0.271" />
<PackageReference Include="Ulid" Version="1.3.4" />
</ItemGroup>

<ItemGroup>
Expand Down
6 changes: 3 additions & 3 deletions PugSharp.Config/Team.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ namespace PugSharp.Config;
public class Team
{
[JsonPropertyName("id")]
public required string Id { get; set; }
public required string Id { get; set; } = Ulid.NewUlid().ToString();

[JsonPropertyName("name")]
public required string Name { get; set; }
public required string Name { get; set; } = string.Empty;

[JsonPropertyName("tag")]
public string Tag { get; init; } = string.Empty;

[JsonPropertyName("flag")]
public string Flag { get; init; } = string.Empty;
public string Flag { get; init; } = "DE";

[JsonPropertyName("players")]
public IDictionary<ulong, string> Players { get; init; } = new Dictionary<ulong, string>();
Expand Down
4 changes: 2 additions & 2 deletions PugSharp.Match/MatchInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ public class MatchInfo
{
public MatchInfo(MatchConfig config)
{
MatchMaps = Enumerable.Range(0, config.NumMaps).Select(n => new MatchMap(n)).ToList();
CurrentMap = MatchMaps[0];
Config = config;
MatchMaps = Enumerable.Range(0, Config.NumMaps).Select(n => new MatchMap(n)).ToList();
CurrentMap = MatchMaps[0];

MatchTeam1 = new MatchTeam(Config.Team1) { CurrentTeamSide = Contract.Team.Terrorist };
MatchTeam2 = new MatchTeam(Config.Team2) { CurrentTeamSide = Contract.Team.CounterTerrorist };
Expand Down

0 comments on commit 7b14a24

Please sign in to comment.