Skip to content

Commit

Permalink
Merge pull request #691 from Lan2Play/dev
Browse files Browse the repository at this point in the history
Bump dependencies + fix demo deletion
  • Loading branch information
Apfelwurm committed Dec 7, 2023
2 parents a87abf9 + 4841f19 commit 2c8281f
Show file tree
Hide file tree
Showing 21 changed files with 808 additions and 586 deletions.
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ APPEAR_DISABLE_ADMIN_APPEARANCE_CSS_SETTINGS=false
##################

# mail driver, usualy smtp
MAIL_DRIVER=smtp
MAIL_DRIVER=log
# mail server host
MAIL_HOST=
# mail server port
Expand Down
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,14 @@ generate-testuser:
generate-event:
docker exec eventula_manager_app php artisan db:seed --class=EventsSeeder

# Generate test cs2 matchmaking match with a demo - This will generate a sample cs2 matchmaking match with a demo (needs the generate-games command before running)! example: make generate-cs2mm playeroneid=useridhere playertwoid=useridhere democount=democounthere status=statushere
generate-cs2mm:
docker exec -e playeroneid=$(playeroneid) -e playertwoid=$(playertwoid) -e democount=$(democount) -e status=$(status) eventula_manager_app php artisan db:seed --class=TestCs2MatchMakingSeeder

# Generate demo(s) into existing challonge matches (needs the generate-games command before running)! example: make generate-demos-tournament democount=democounthere challongematchid=challongematchidhere
generate-demos-tournament:
docker exec -e democount=$(democount) -e challongematchid=$(challongematchid) eventula_manager_app php artisan db:seed --class=TestTournamentDemoSeeder

# Generate event - This will generate a sample event!
generate-games:
docker exec eventula_manager_app php artisan db:seed --class=GamesTableSeeder
Expand Down
128 changes: 94 additions & 34 deletions docs/source/admin/games/basic.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,53 +2,91 @@
Games
==================================================

Basic
-----
Introduction
---------------
You can create games which will be available in your event, your tournaments and your matchmaking.
You are then able to add gameservers for each game and for a few games you can show serverstats / remote control the servers from eventula or even automate your matchmaking or tournament.

Add Game
.........
.. note::
If you are planning to use the full featureset for the supported games, we recommend to use the :ref:`admin/games/basic:Add Game from Template` feature to add the game.

Add Game from Template
.........................

Lets create a game from a template, which depending on the game comes with preconfigured settings for it.

Go to your Admin Panel to the ``Games`` Section.

Over the right you can find the ``Add Game from Template`` Button. Kick it.

.. image:: ../../images/games_add_template_01.png
:scale: 50 %
:alt: eventula game addition from template first step
:align: center


You will now get a list of all supported games with their :ref:`admin/games/basic:Game Commandhandler` and :ref:`admin/games/basic:Game Match Api handler` (and a few parameters), where you can click ``Deploy`` on the one you want to deploy:

.. image:: ../../images/games_add_template_02.png
:scale: 50 %
:alt: eventula game addition from template second step
:align: center


You will get a success message / error message on the bottom of the page.

.. note::
The Game Templates are designed to not overwrite your already existing games.
If you removed or renamed some of the :ref:`admin/games/basic:GameCommands` or :ref:`admin/games/basic:GameCommandParameters` inside the game, they will be added to your existing game, if deployed again.
If you want to deploy an additional copy of the game, change the name of your existing game to something else than in the template and deploy it again.


Your Game should now appear in the ``Games`` Section of your admin menu, where you can edit the settings and :ref:`add gameservers<admin/games/basic:Add Gameserver>` to it which you have to do, to fully use the available features.

.. note::
By default it is intended that the games public visibillity is disabled, but this is currently not working (https://github.com/Lan2Play/eventula-manager/issues/620)

.. image:: ../../images/games_add_template_03.png
:scale: 50 %
:alt: eventula game addition from template second step
:align: center


Add Game Manually
..................
Lets create a game! go to your Admin Panel to the ``Games`` Section and you can add your game in the ``Add Game`` area.
To use the basic features like manual tournaments you have to fill in a name and you can add a description, a version if you want to.
Its recommended to add a ``Thumbnail Image`` and a ``Header Image``, they will be shown on the tournaments / matches.


.. image:: ../../images/games_add_01.png
:scale: 50 %
:alt: eventula event deletion
:alt: eventula game addition first step
:align: center

If you want to enable the possibilities to show the status of the later created gameservers on either the events page or the public page or you want to remotly control the gamservers via eventula you have to select a ``Game Commandhandler``
If you want to enable the possibilities to show the status of the later created gameservers on either the events page or the public page or you want to remotly control the gamservers via eventula you have to select a :ref:`admin/games/basic:Game Commandhandler`

The currently available Commandhandlers are:

- SourceQuery GoldSource (supported games: full support for all HL1/HL2 games and mods )
- SourceQuery Source (supported games: CS:GO, Minecraft only commands | no status support)
- Maniaplanet XRPC (supported games: Trackmania nations, and all new maniaplanet games )
You can find the available ones :ref:`here<admin/games/basic:Game Commandhandler>`

.. image:: ../../images/games_add_02.png
:scale: 50 %
:alt: eventula event deletion
:alt: eventula game addition second step
:align: center

If you want to enable the possibilities to manage fully automated tournaments or fully automated matchmaking you have to set ``Game Match Api handler`` as well as the corresponding ``Game Commandhandler``.
If you want to enable the possibilities to manage fully automated tournaments or fully automated matchmaking you have to set :ref:`admin/games/basic:Game Match Api handler` as well as the corresponding :ref:`admin/games/basic:Game Commandhandler`.

The currently available APIhandlers are:

- Get5 (supported games: CS:GO with the `Get5 Plugin from Splewis <https://github.com/splewis/get5>`_ and the `get5_eventula_apistats plugin <https://github.com/Lan2Play/get5_eventula_apistats>`_)
You can find the available Game Match Api handlers ones :ref:`here<admin/games/basic:Game Match Api handler>`

.. image:: ../../images/games_add_03.png
:scale: 50 %
:alt: eventula event deletion
:alt: eventula game addition third step
:align: center


For an explanation of the fields ``Connect Game URL``, ``Connect Game Command`` and ``Connect Stream URL`` take a look on the ``Frontend Gameserver Features`` section of the documentation.

For a fully working example of the automated Tournament / Matchmaking take a look on the ``Tutorials`` section of the documentation.

For an explanation of the fields ``Connect Game URL``, ``Connect Game Command`` and ``Connect Stream URL`` take a look on the :ref:`admin/games/basic:Frontend Gameserver Features` section of the documentation.

.. note::
For fully configured examples of the automated Tournament / Matchmaking take a look on the :ref:`admin/games/basic:Add Game from Template` section.


Press ``Submit`` to add the Category.
Expand All @@ -62,18 +100,18 @@ To edit a game, go to your Admin Panel to the ``Games`` Section and klick on ``E

.. image:: ../../images/games_edit_01.png
:scale: 50 %
:alt: eventula event deletion
:alt: eventula game editing first step
:align: center

You will then be redirected to the detailed / editing /upload view of the game.

You can edit the games parameters in the ``Edit Game`` Section. Additionally to the parameters you had available in the Add Game step, you can set the public visibillity of a game (Currently not working!) and a ``Match start command`` that is needed for the automatic tournament / matchmaking (see the ``Add Game`` section of the documentation or for a fully working example of the automated Tournament / Matchmaking take a look on the ``Tutorials`` section of the documentation.)
You can edit the games parameters in the ``Edit Game`` Section. Additionally to the parameters you had available in the Add Game step, you can set the public visibillity of a game (Currently not working!) and a ``Match start command`` that is needed for the automatic tournament / matchmaking (see the :ref:`admin/games/basic:Add Game Manually` section of the documentation or for a fully working example of the automated Tournament / Matchmaking take a look on the :ref:`admin/games/basic:Add Game from Template` section of the documentation.)

For an explanation of the fields ``Connect Game URL``, ``Connect Game Command`` and ``Connect Stream URL`` take a look on the ``Frontend Gameserver Features`` section of the documentation.
For an explanation of the fields ``Connect Game URL``, ``Connect Game Command`` and ``Connect Stream URL`` take a look on the :ref:`admin/games/basic:Frontend Gameserver Features` section of the documentation.

The changes can be saved with a click on the ``Submit`` Button in the ``Edit Game`` Section.

In the bottom you can now add Game Servers to the game. Please look into the following ``Gameservers`` section of the documentation.
In the bottom you can now add Game Servers to the game. Please look into the following :ref:`admin/games/basic:Gameservers` section of the documentation.

Gameservers
-----------
Expand All @@ -86,7 +124,7 @@ In the bottom you can now add Game Servers to the game in the ``Add Game Server`

.. image:: ../../images/games_gameserver_add_01.png
:scale: 50 %
:alt: eventula event deletion
:alt: eventula gameserver addition first step
:align: center

- You have to specify at least the ``Name``, the ``Adress`` (or ip), the ``Type`` and the ``Game Port``.
Expand All @@ -95,7 +133,7 @@ In the bottom you can now add Game Servers to the game in the ``Add Game Server`
- If you select the ``Type`` ``Match`` and ``Server is Enabled`` the Server will be used for Matchmaking and tournaments if you enable it on the game itself.
- If your Server needs a connection password, you can specify it in ``Game Password``.
- Some games support streaming (like CS:GO). To enable your users to stream the game, you can enter the streaming port (eg. Sourcetv) in the ``Stream Port`` field.
- If you use a game with a supported Commandhandlers (See the ``Add Game`` section in the documentation), you should add the ``RCON Port`` (mostly same as the game port) and the ``RCON Password`` to enable status checking or (automatic) remote controlling of the Gameserver.
- If you use a game with a supported Commandhandlers (See the :ref:`admin/games/basic:Add Game Manually` section in the documentation), you should add the ``RCON Port`` (mostly same as the game port) and the ``RCON Password`` to enable status checking or (automatic) remote controlling of the Gameserver.

Edit Gameserver
..................
Expand All @@ -108,14 +146,14 @@ The basic view of a Gameserver with no Commandhandler selected looks like this o

.. image:: ../../images/games_gameserver_01.png
:scale: 50 %
:alt: eventula event deletion
:alt: eventula gameserver view in the event live page
:align: center

and like this on the Homepage:

.. image:: ../../images/games_gameserver_02.png
:scale: 50 %
:alt: eventula event deletion
:alt: eventula gameserver view in the event Homepage
:align: center


Expand Down Expand Up @@ -148,31 +186,31 @@ If you set everything, your Server looks like this in the event live view:

.. image:: ../../images/games_gameserver_03.png
:scale: 50 %
:alt: eventula event deletion
:alt: eventula gameserver view in the event live page
:align: center

And like this on your Homepage:

.. image:: ../../images/games_gameserver_04.png
:scale: 50 %
:alt: eventula event deletion
:alt: eventula gameserver view in the homepage
:align: center

if you set the ``Commandhandler`` and the ``RCON password`` and the ``RCON Port`` on your game the status of your Server is shown in both views and in the Admin Area:

.. image:: ../../images/games_gameserver_06.png
:scale: 50 %
:alt: eventula event deletion
:alt: eventula gameserver statistics
:align: center

.. image:: ../../images/games_gameserver_05.png
:scale: 50 %
:alt: eventula event deletion
:alt: eventula gameserver statistics
:align: center

.. image:: ../../images/games_gameserver_07.png
:scale: 50 %
:alt: eventula event deletion
:alt: eventula gameserver statistics
:align: center


Expand All @@ -184,3 +222,25 @@ GameCommands

GameCommandParameters
---------------------


Details
---------------------

Game Commandhandler
....................................

The currently available Commandhandlers are:

- SourceQuery GoldSource (supported games: full support for all HL1/HL2 games and mods )
- SourceQuery Source (supported games: CS:GO, Minecraft only commands | no status support)
- Maniaplanet XRPC (supported games: Trackmania nations, and all new maniaplanet games )


Game Match Api handler
....................................

The currently available APIhandlers are:

- Get5 (supported games: CS:GO with the `Get5 Plugin from Splewis <https://github.com/splewis/get5>`_ and the `get5_eventula_apistats plugin <https://github.com/Lan2Play/get5_eventula_apistats>`_)
- PugSharp (supported games: CS2 with the `PugSharp Plugin <https://github.com/Lan2Play/PugSharp>`_)
Binary file added docs/source/images/games_add_template_01.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/images/games_add_template_02.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/images/games_add_template_03.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions resources/ci/.drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ steps:
- composer install --ignore-platform-reqs --no-scripts

- name: build-npm
image: node:20.9
image: node:20.10
commands:
- cd src/
- npm install && npm run production
Expand Down Expand Up @@ -109,7 +109,7 @@ steps:
- push

- name: build-npm
image: node:20.9
image: node:20.10
commands:
- cd src/
- npm install && npm run production
Expand Down Expand Up @@ -288,7 +288,7 @@ steps:
- tag

- name: build-npm
image: node:20.9
image: node:20.10
commands:
- cd src/
- npm install && npm run production
Expand Down
23 changes: 13 additions & 10 deletions src/app/EventTournament.php
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,14 @@ public static function boot()
}
}

foreach ($matches as $key => $match) {
$replays = MatchReplay::where('challonge_match_id', $match->id)->get();
foreach ($replays as $matchReplay) {
$matchReplay->deleteReplayFile($model->game);
$matchReplay->delete();
}
}

$response = retry(5, function () use ($challonge, $model) {
return $challonge->fetchTournament($model->challonge_tournament_id);
}, 100);
Expand Down Expand Up @@ -514,7 +522,7 @@ public function getMatch(int $challongeMatchId, $obj = false)
* @return Array|Object
*/
public function getMatchReplays(int $challongeMatchId, $obj = false)
{
{
return MatchReplay::where('challonge_match_id', $challongeMatchId)->get();
}

Expand Down Expand Up @@ -644,8 +652,7 @@ public function getNextMatches($limit = 0, $obj = false)
*/
public function updateMatch($matchId, $player1Score, $player2Score, $playerWinnerVerify = null)
{
if ($player1Score == 0 && $player2Score == 0)
{
if ($player1Score == 0 && $player2Score == 0) {
return false;
}

Expand Down Expand Up @@ -685,16 +692,12 @@ public function updateMatch($matchId, $player1Score, $player2Score, $playerWinne
$this->getStandings();

# queue next matches
if (isset($this->game) && $this->match_autostart)
{

if (isset($this->game) && $this->match_autostart) {
$nextmatches = $this->getNextMatches();

foreach ($nextmatches as $nextmatch)
{
foreach ($nextmatches as $nextmatch) {
$matchserver = EventTournamentMatchServer::getTournamentMatchServer($nextmatch->id);
if (!isset($matchserver)) {
GameServerAsign::dispatch(null,$this,$nextmatch->id)->onQueue('gameserver');
GameServerAsign::dispatch(null, $this, $nextmatch->id)->onQueue('gameserver');
}
}
}
Expand Down
14 changes: 13 additions & 1 deletion src/app/Http/Controllers/Admin/MatchMakingController.php
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,19 @@ public function deleteuserfrommatch(MatchMaking $match, MatchMakingTeam $team, M
*/
public function destroy(MatchMaking $match)
{

foreach ($match->matchReplays as $matchReplay)
{
if(!$matchReplay->deleteReplayFile())
{
Session::flash('alert-danger', 'Cannot delete Replay files!');
return Redirect::back();
}
if(!$matchReplay->delete())
{
Session::flash('alert-danger', 'Cannot delete Replays!');
return Redirect::back();
}
}
if (!$match->players()->delete()) {
Session::flash('alert-danger', 'Cannot delete Players!');
return Redirect::back();
Expand Down
17 changes: 16 additions & 1 deletion src/app/Http/Controllers/Admin/MatchReplayController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace App\Http\Controllers\Admin;

use App\Game;
use DB;
use Auth;
use Session;
Expand All @@ -24,8 +25,22 @@ class MatchReplayController extends Controller
* @param MatchReplay $matchReplay
* @return Redirect
*/
public function destroy(MatchReplay $matchReplay)
public function destroy(Request $request, MatchReplay $matchReplay)
{
if (isset($request->game) && intval($request->game) > 0)
{
if (!$matchReplay->deleteReplayFile(Game::where('id', intval($request->game))->first())) {
Session::flash('alert-danger', 'Cannot delete matchReplay file!');
return Redirect::back();
}
}
else
{
if (!$matchReplay->deleteReplayFile()) {
Session::flash('alert-danger', 'Cannot delete matchReplay file!');
return Redirect::back();
}
}
if (!$matchReplay->delete()) {
Session::flash('alert-danger', 'Cannot delete matchReplay!');
return Redirect::back();
Expand Down
Loading

0 comments on commit 2c8281f

Please sign in to comment.