Skip to content

Commit

Permalink
Merge pull request #115 from Lan2Play/feature/CommandAliases
Browse files Browse the repository at this point in the history
Fix team score
  • Loading branch information
TheR00st3r authored Dec 13, 2023
2 parents 1c034b5 + 5b4b35e commit a1c32be
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 33 deletions.
27 changes: 24 additions & 3 deletions Docs/source/admin/commands.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ If you want to use them from your console, remove the ``!`` in front of them.
Player Commands
----------------------------------------

``<requiredParameter>`` marks parameters that are required for commands

+---------------+--------------+-----------------------------------------------------------------------------------+
| Command | Alias | Description |
+===============+==============+===================================================================================+
Expand All @@ -22,7 +24,7 @@ Player Commands
+---------------+--------------+-----------------------------------------------------------------------------------+
| ``!kill`` | ``!suicide`` | Kill the current player if allowed by the :ref:`admin/configuration:matchconfig`. |
+---------------+--------------+-----------------------------------------------------------------------------------+
| ``![number]`` | | Select something in the current menu. |
| ``!<number>`` | | Select something in the current menu. |
+---------------+--------------+-----------------------------------------------------------------------------------+
| ``!stay`` | | Vote to stay at the current team. |
+---------------+--------------+-----------------------------------------------------------------------------------+
Expand Down Expand Up @@ -90,7 +92,26 @@ These commands are available through rcon or to users with the required permissi
+----------------------------------------+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
| ``!css_team2_seriesscore`` | | Returns the seriesscore of team 2 |
+----------------------------------------+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
| ``!ps_mapscore_json`` | | Returns the current map score as json **TODO Example** |
| ``!ps_mapscore_json`` | | Returns the current map score as json (:ref:`Example<admin/commands:mapscore_json Example>`) |
+----------------------------------------+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
| ``!ps_seriesscore_json`` | | Returns the seriesscore as json **TODO Example** |
+----------------------------------------+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
+----------------------------------------+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+

mapscore_json Example
'''''''''''''''''''''
.. code-block:: json
{
"Team1": {
"Name": "Team 1",
"Score": 1,
"StartingSide": 3,
"CurrentSide": 3
},
"Team2": {
"Name": "Team 2",
"Score": 2,
"StartingSide": 2,
"CurrentSide": 2
}
}
60 changes: 30 additions & 30 deletions Docs/source/develop/makefile.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ A few of the Commands have optional parameters that can be set via either a prom
So for example if you had the available parameter ``STEAMUSER`` on the make command ``init-all``, that you want to set to ``username`` your finalized Make command would look like:

.. code-block:: bash
make init-all STEAMUSER="username"
Expand All @@ -29,9 +29,9 @@ Publishes a debug build of Pugsharp with the locally installed .Net SDK and copi

**Group Command**

- :ref:`develop/makefile:git-pull`
- :ref:`develop/makefile:build-debug`
- :ref:`develop/makefile:copy-pugsharp`
- :ref:`develop/makefile:git-pull`
- :ref:`develop/makefile:build-debug`
- :ref:`develop/makefile:copy-pugsharp`

**Parameters:**

Expand All @@ -43,9 +43,9 @@ Publishes a debug build of Pugsharp with .Net SDK inside of docker and copies it

**Group Command**

- :ref:`develop/makefile:git-pull`
- :ref:`develop/makefile:build-debug-docker`
- :ref:`develop/makefile:copy-pugsharp`
- :ref:`develop/makefile:git-pull`
- :ref:`develop/makefile:build-debug-docker`
- :ref:`develop/makefile:copy-pugsharp`

**Parameters:**

Expand All @@ -57,12 +57,12 @@ Prepares the gameserver folder, initializes the .env file for the cs2 server, co

**Group Command**

- :ref:`develop/makefile:prepare-folders`
- :ref:`develop/makefile:init-env`
- :ref:`develop/makefile:install-deps`
- :ref:`develop/makefile:copy-pugsharp-sample-configs`
- :ref:`develop/makefile:pull-csserver`
- :ref:`develop/makefile:start-csserver`
- :ref:`develop/makefile:prepare-folders`
- :ref:`develop/makefile:init-env`
- :ref:`develop/makefile:install-deps`
- :ref:`develop/makefile:copy-pugsharp-sample-configs`
- :ref:`develop/makefile:pull-csserver`
- :ref:`develop/makefile:start-csserver`

**Parameters:**

Expand All @@ -74,12 +74,12 @@ Prepares the gameserver folder, initializes the .env file for the cs2 server, co

**Group Command**

- :ref:`develop/makefile:prepare-folders`
- :ref:`develop/makefile:init-env`
- :ref:`develop/makefile:install-deps-docker`
- :ref:`develop/makefile:copy-pugsharp-sample-configs`
- :ref:`develop/makefile:pull-csserver`
- :ref:`develop/makefile:start-csserver`
- :ref:`develop/makefile:prepare-folders`
- :ref:`develop/makefile:init-env`
- :ref:`develop/makefile:install-deps-docker`
- :ref:`develop/makefile:copy-pugsharp-sample-configs`
- :ref:`develop/makefile:pull-csserver`
- :ref:`develop/makefile:start-csserver`

**Parameters:**

Expand All @@ -91,7 +91,7 @@ Installs counterstrikesharp and metamod to your local cs2 server

**Group Command**

- :ref:`develop/makefile:install-counterstrikesharp`
- :ref:`develop/makefile:install-counterstrikesharp`
- :ref:`develop/makefile:install-metamod`

**Parameters:**
Expand All @@ -104,7 +104,7 @@ Installs counterstrikesharp and metamod to your local cs2 server

**Group Command**

- :ref:`develop/makefile:install-counterstrikesharp-docker`
- :ref:`develop/makefile:install-counterstrikesharp-docker`
- :ref:`develop/makefile:install-metamod`

**Parameters:**
Expand All @@ -117,9 +117,9 @@ Cleans the CS2 server including all plugins, the build folders and the local .en

**Group Command**

- :ref:`develop/makefile:clean-csserver`
- :ref:`develop/makefile:clean-env`
- :ref:`develop/makefile:clean-build`
- :ref:`develop/makefile:clean-csserver`
- :ref:`develop/makefile:clean-env`
- :ref:`develop/makefile:clean-build`

**Parameters:**

Expand All @@ -131,8 +131,8 @@ starts a local deattached cs2 server and attaches to it

**Group Command**

- :ref:`develop/makefile:start-csserver`
- :ref:`develop/makefile:attach-csserver`
- :ref:`develop/makefile:start-csserver`
- :ref:`develop/makefile:attach-csserver`

**Parameters:**

Expand Down Expand Up @@ -238,15 +238,15 @@ No Parameters

build-debug
........................
Publishes a debug build of Pugsharp with the locally installed .Net SDK
Publishes a debug build of Pugsharp with the locally installed .Net SDK

**Parameters:**

No Parameters

build-release
........................
Publishes a release build of Pugsharp with the locally installed .Net SDK
Publishes a release build of Pugsharp with the locally installed .Net SDK

**Parameters:**

Expand Down Expand Up @@ -277,15 +277,15 @@ copies pugsharp debug build in to the local cs2 server
No Parameters

copy-pugsharp-sample-configs
........................
............................
copies pugsharp sample configs in to the local cs2 server

**Parameters:**

No Parameters

git-pull
........................
............................
pulls the repository

**Parameters:**
Expand Down
3 changes: 3 additions & 0 deletions PugSharp.Match/Match.cs
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,9 @@ public void SendRoundResults(IRoundResults roundResults)
var team1Results = MatchInfo.MatchTeam1.CurrentTeamSite == Team.Terrorist ? roundResults.TRoundResult : roundResults.CTRoundResult;
var team2Results = MatchInfo.MatchTeam2.CurrentTeamSite == Team.Terrorist ? roundResults.TRoundResult : roundResults.CTRoundResult;

MatchInfo.CurrentMap.Team1Points = team1Results.Score;
MatchInfo.CurrentMap.Team2Points = team2Results.Score;

_Logger.LogInformation("Team 1: {teamSite} : {teamScore}", MatchInfo.MatchTeam1.CurrentTeamSite, team1Results.Score);
_Logger.LogInformation("Team 2: {teamSite} : {teamScore}", MatchInfo.MatchTeam2.CurrentTeamSite, team2Results.Score);

Expand Down

0 comments on commit a1c32be

Please sign in to comment.