Private
Public Access
1
0

chg: dev: refactor classes and reformat some layout #3

This commit is contained in:
2019-10-27 18:51:03 +01:00
parent c909c036a3
commit 8355cc90ed
17 changed files with 265 additions and 48 deletions

View File

@@ -90,13 +90,8 @@ header section div.buttons > a {
padding: 25px 150px; padding: 25px 150px;
margin-bottom: 20px; margin-bottom: 20px;
-webkit-box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3); box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
-webkit-border-radius: 3px; border-radius: 20px;
border-radius: 3px;
-webkit-transition: all 250ms ease-in-out;
-moz-transition: all 250ms ease-in-out;
-o-transition: all 250ms ease-in-out;
transition: all 250ms ease-in-out; transition: all 250ms ease-in-out;
} }

View File

@@ -3,7 +3,7 @@ monolog:
main: main:
type: stream type: stream
path: "%kernel.logs_dir%/%kernel.environment%.log" path: "%kernel.logs_dir%/%kernel.environment%.log"
level: debug level: error
channels: ["!event"] channels: ["!event"]
# uncomment to get logging in your browser # uncomment to get logging in your browser
# you may have to allow bigger header sizes in your Web server configuration # you may have to allow bigger header sizes in your Web server configuration

View File

@@ -40,24 +40,16 @@ services:
arguments: arguments:
- '@gos_web_socket.pdo.periodic_ping' - '@gos_web_socket.pdo.periodic_ping'
# mineseeker.topic_sample_service: mineseeker.topic_sample_service:
# class: App\Topic\MineseekerTopic class: App\Topic\MineseekerTopic
# tags: tags:
# - { name: gos_web_socket.topic } - { name: gos_web_socket.topic }
# arguments:
# - "@gos_web_socket.websocket.client_manipulator" mineseeker.rpc_sample_service:
# - '@doctrine.orm.entity_manager' class: App\Rpc\MineseekerRpc
# - '@request_stack' public: true
# - '@logger' tags:
# - { name: gos_web_socket.rpc }
# mineseeker.rpc_sample_service:
# class: App\Rpc\MineseekerRpc
# public: true
# tags:
# - { name: gos_web_socket.rpc }
# arguments:
# - '@doctrine.orm.entity_manager'
# - '@logger'
gos_web_socket_server.client_event.listener: gos_web_socket_server.client_event.listener:
class: App\EventListener\MineseekerClientEventListener class: App\EventListener\MineseekerClientEventListener

View File

@@ -1,41 +1,88 @@
<?php <?php
/**
* This file is part of the SplendidBear Websites' projects.
*
* Copyright (c) 2019 @ www.splendidbear.org
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace App\Controller; namespace App\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
class GameController extends Controller /**
* Class GameController
*
* @package App\Controller
* @author system7 <https://www.splendidbear.org>
*/
class GameController extends AbstractController
{ {
public function index() /**
* It is the homepage
*
* @return Response
*/
public function index(): Response
{ {
return $this->render('Game/index.html.twig'); return $this->render('Game/index.html.twig');
} }
public function play(Request $request) /**
* It is the game itself
*
* @param Request $request
*
* @return Response
*/
public function play(Request $request): Response
{ {
return $this->render('Game/play.html.twig', array( return $this->render('Game/play.html.twig', array(
'env' => $this->container->getParameter('kernel.environment'), 'env' => getenv('APP_ENV'),
'ssl' => $request->isSecure() ? 'true' : 'false' 'ssl' => $request->isSecure() ? 'true' : 'false'
)); ));
} }
public function privacy() /**
* It is the Privacy & Policy
*
* @return Response
*/
public function privacy(): Response
{ {
return $this->render('Official/privacy.html.twig'); return $this->render('Official/privacy.html.twig');
} }
public function terms() /**
* It is the Terms of Use
*
* @return Response
*/
public function terms(): Response
{ {
return $this->render('Official/terms.html.twig'); return $this->render('Official/terms.html.twig');
} }
public function contact() /**
* It is the contact informations
*
* @return Response
*/
public function contact(): Response
{ {
return $this->render('Official/contact.html.twig'); return $this->render('Official/contact.html.twig');
} }
public function landing() /**
* It is a landing page
*
* @return Response
*/
public function landing(): Response
{ {
return $this->render('Official/landing.html.twig'); return $this->render('Official/landing.html.twig');
} }

View File

@@ -1,10 +1,23 @@
<?php <?php
/**
* This file is part of the SplendidBear Websites' projects.
*
* Copyright (c) 2019 @ www.splendidbear.org
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace App\Entity; namespace App\Entity;
use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
/** /**
* Class Gamer
*
* @package App\Entity
* @author system7 <https://www.splendidbear.org>
*
* @ORM\Entity(repositoryClass="App\Repository\GamerRepository") * @ORM\Entity(repositoryClass="App\Repository\GamerRepository")
*/ */
class Gamer class Gamer

View File

@@ -1,10 +1,23 @@
<?php <?php
/**
* This file is part of the SplendidBear Websites' projects.
*
* Copyright (c) 2019 @ www.splendidbear.org
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace App\Entity; namespace App\Entity;
use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
/** /**
* Class Grid
*
* @package App\Entity
* @author system7 <https://www.splendidbear.org>
*
* @ORM\Entity(repositoryClass="App\Repository\GridRepository") * @ORM\Entity(repositoryClass="App\Repository\GridRepository")
*/ */
class Grid class Grid

View File

@@ -1,10 +1,23 @@
<?php <?php
/**
* This file is part of the SplendidBear Websites' projects.
*
* Copyright (c) 2019 @ www.splendidbear.org
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace App\Entity; namespace App\Entity;
use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
/** /**
* Class GridRow
*
* @package App\Entity
* @author system7 <https://www.splendidbear.org>
*
* @ORM\Entity(repositoryClass="App\Repository\GridRowRepository") * @ORM\Entity(repositoryClass="App\Repository\GridRowRepository")
*/ */
class GridRow class GridRow

View File

@@ -1,4 +1,12 @@
<?php <?php
/**
* This file is part of the SplendidBear Websites' projects.
*
* Copyright (c) 2019 @ www.splendidbear.org
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace App\Entity; namespace App\Entity;
@@ -6,6 +14,11 @@ use App\Application\Sonata\UserBundle\Entity\User;
use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
/** /**
* Class PlayedGame
*
* @package App\Entity
* @author system7 <https://www.splendidbear.org>
*
* @ORM\Entity(repositoryClass="App\Repository\PlayedGameRepository") * @ORM\Entity(repositoryClass="App\Repository\PlayedGameRepository")
*/ */
class PlayedGame class PlayedGame

View File

@@ -1,10 +1,23 @@
<?php <?php
/**
* This file is part of the SplendidBear Websites' projects.
*
* Copyright (c) 2019 @ www.splendidbear.org
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace App\Entity; namespace App\Entity;
use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
/** /**
* Class Step
*
* @package App\Entity
* @author system7 <https://www.splendidbear.org>
*
* @ORM\Entity(repositoryClass="App\Repository\StepRepository") * @ORM\Entity(repositoryClass="App\Repository\StepRepository")
*/ */
class Step class Step

View File

@@ -1,4 +1,12 @@
<?php <?php
/**
* This file is part of the SplendidBear Websites' projects.
*
* Copyright (c) 2019 @ www.splendidbear.org
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace App\EventListener; namespace App\EventListener;
@@ -7,6 +15,12 @@ use Gos\Bundle\WebSocketBundle\Event\ClientErrorEvent;
use Gos\Bundle\WebSocketBundle\Event\ServerEvent; use Gos\Bundle\WebSocketBundle\Event\ServerEvent;
use Gos\Bundle\WebSocketBundle\Event\ClientRejectedEvent; use Gos\Bundle\WebSocketBundle\Event\ClientRejectedEvent;
/**
* Class MineseekerClientEventListener
*
* @package App\EventListener
* @author system7 <https://www.splendidbear.org>
*/
class MineseekerClientEventListener class MineseekerClientEventListener
{ {
/** /**
@@ -14,7 +28,7 @@ class MineseekerClientEventListener
* *
* @param ClientEvent $event * @param ClientEvent $event
*/ */
public function onClientConnect(ClientEvent $event) public function onClientConnect(ClientEvent $event): void
{ {
$conn = $event->getConnection(); $conn = $event->getConnection();
@@ -26,7 +40,7 @@ class MineseekerClientEventListener
* *
* @param ClientEvent $event * @param ClientEvent $event
*/ */
public function onClientDisconnect(ClientEvent $event) public function onClientDisconnect(ClientEvent $event): void
{ {
$conn = $event->getConnection(); $conn = $event->getConnection();
@@ -38,7 +52,7 @@ class MineseekerClientEventListener
* *
* @param ClientErrorEvent $event * @param ClientErrorEvent $event
*/ */
public function onClientError(ClientErrorEvent $event) public function onClientError(ClientErrorEvent $event): void
{ {
$conn = $event->getConnection(); $conn = $event->getConnection();
$e = $event->getException(); $e = $event->getException();
@@ -51,7 +65,7 @@ class MineseekerClientEventListener
* *
* @param ServerEvent $event * @param ServerEvent $event
*/ */
public function onServerStart(ServerEvent $event) public function onServerStart(ServerEvent $event): void
{ {
$event = $event->getEventLoop(); $event = $event->getEventLoop();
@@ -63,7 +77,7 @@ class MineseekerClientEventListener
* *
* @param ClientRejectedEvent $event * @param ClientRejectedEvent $event
*/ */
public function onClientRejected(ClientRejectedEvent $event) public function onClientRejected(ClientRejectedEvent $event): void
{ {
$origin = $event->getOrigin; $origin = $event->getOrigin;

View File

@@ -1,15 +1,34 @@
<?php <?php
/**
* This file is part of the SplendidBear Websites' projects.
*
* Copyright (c) 2019 @ www.splendidbear.org
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace App\Periodic; namespace App\Periodic;
use Gos\Bundle\WebSocketBundle\Periodic\PdoPeriodicPing; use Gos\Bundle\WebSocketBundle\Periodic\PdoPeriodicPing;
use Gos\Bundle\WebSocketBundle\Periodic\PeriodicInterface; use Gos\Bundle\WebSocketBundle\Periodic\PeriodicInterface;
/**
* Class MinePeriodic
*
* @package App\Periodic
* @author system7 <https://www.splendidbear.org>
*/
class MinePeriodic implements PeriodicInterface class MinePeriodic implements PeriodicInterface
{ {
/** @var PdoPeriodicPing */ /** @var PdoPeriodicPing */
private $ping; private $ping;
/**
* MinePeriodic constructor.
*
* @param PdoPeriodicPing $ping
*/
public function __construct(PdoPeriodicPing $ping) public function __construct(PdoPeriodicPing $ping)
{ {
$this->ping = $ping; $this->ping = $ping;

View File

@@ -1,4 +1,12 @@
<?php <?php
/**
* This file is part of the SplendidBear Websites' projects.
*
* Copyright (c) 2019 @ www.splendidbear.org
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace App\Repository; namespace App\Repository;
@@ -7,13 +15,18 @@ use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\Common\Persistence\ManagerRegistry; use Doctrine\Common\Persistence\ManagerRegistry;
/** /**
* @method Gamer|null find($id, $lockMode = null, $lockVersion = null) * Class GamerRepository
* @method Gamer|null findOneBy(array $criteria, array $orderBy = null) *
* @method Gamer[] findAll() * @package App\Repository
* @method Gamer[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) * @author system7 <https://www.splendidbear.org>
*/ */
class GamerRepository extends ServiceEntityRepository class GamerRepository extends ServiceEntityRepository
{ {
/**
* GamerRepository constructor.
*
* @param ManagerRegistry $registry
*/
public function __construct(ManagerRegistry $registry) public function __construct(ManagerRegistry $registry)
{ {
parent::__construct($registry, Gamer::class); parent::__construct($registry, Gamer::class);

View File

@@ -1,4 +1,12 @@
<?php <?php
/**
* This file is part of the SplendidBear Websites' projects.
*
* Copyright (c) 2019 @ www.splendidbear.org
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace App\Repository; namespace App\Repository;
@@ -7,6 +15,11 @@ use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\Common\Persistence\ManagerRegistry; use Doctrine\Common\Persistence\ManagerRegistry;
/** /**
* Class GridRepository
*
* @package App\Repository
* @author system7 <https://www.splendidbear.org>
*
* @method Grid|null find($id, $lockMode = null, $lockVersion = null) * @method Grid|null find($id, $lockMode = null, $lockVersion = null)
* @method Grid|null findOneBy(array $criteria, array $orderBy = null) * @method Grid|null findOneBy(array $criteria, array $orderBy = null)
* @method Grid[] findAll() * @method Grid[] findAll()
@@ -14,6 +27,11 @@ use Doctrine\Common\Persistence\ManagerRegistry;
*/ */
class GridRepository extends ServiceEntityRepository class GridRepository extends ServiceEntityRepository
{ {
/**
* GridRepository constructor.
*
* @param ManagerRegistry $registry
*/
public function __construct(ManagerRegistry $registry) public function __construct(ManagerRegistry $registry)
{ {
parent::__construct($registry, Grid::class); parent::__construct($registry, Grid::class);

View File

@@ -1,4 +1,12 @@
<?php <?php
/**
* This file is part of the SplendidBear Websites' projects.
*
* Copyright (c) 2019 @ www.splendidbear.org
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace App\Repository; namespace App\Repository;
@@ -7,6 +15,11 @@ use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\Common\Persistence\ManagerRegistry; use Doctrine\Common\Persistence\ManagerRegistry;
/** /**
* Class GridRowRepository
*
* @package App\Repository
* @author system7 <https://www.splendidbear.org>
*
* @method GridRow|null find($id, $lockMode = null, $lockVersion = null) * @method GridRow|null find($id, $lockMode = null, $lockVersion = null)
* @method GridRow|null findOneBy(array $criteria, array $orderBy = null) * @method GridRow|null findOneBy(array $criteria, array $orderBy = null)
* @method GridRow[] findAll() * @method GridRow[] findAll()
@@ -14,6 +27,11 @@ use Doctrine\Common\Persistence\ManagerRegistry;
*/ */
class GridRowRepository extends ServiceEntityRepository class GridRowRepository extends ServiceEntityRepository
{ {
/**
* GridRowRepository constructor.
*
* @param ManagerRegistry $registry
*/
public function __construct(ManagerRegistry $registry) public function __construct(ManagerRegistry $registry)
{ {
parent::__construct($registry, GridRow::class); parent::__construct($registry, GridRow::class);

View File

@@ -1,4 +1,12 @@
<?php <?php
/**
* This file is part of the SplendidBear Websites' projects.
*
* Copyright (c) 2019 @ www.splendidbear.org
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace App\Repository; namespace App\Repository;
@@ -7,6 +15,11 @@ use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\Common\Persistence\ManagerRegistry; use Doctrine\Common\Persistence\ManagerRegistry;
/** /**
* Class PlayedGameRepository
*
* @package App\Repository
* @author system7 <https://www.splendidbear.org>
*
* @method PlayedGame|null find($id, $lockMode = null, $lockVersion = null) * @method PlayedGame|null find($id, $lockMode = null, $lockVersion = null)
* @method PlayedGame|null findOneBy(array $criteria, array $orderBy = null) * @method PlayedGame|null findOneBy(array $criteria, array $orderBy = null)
* @method PlayedGame[] findAll() * @method PlayedGame[] findAll()
@@ -14,6 +27,11 @@ use Doctrine\Common\Persistence\ManagerRegistry;
*/ */
class PlayedGameRepository extends ServiceEntityRepository class PlayedGameRepository extends ServiceEntityRepository
{ {
/**
* PlayedGameRepository constructor.
*
* @param ManagerRegistry $registry
*/
public function __construct(ManagerRegistry $registry) public function __construct(ManagerRegistry $registry)
{ {
parent::__construct($registry, PlayedGame::class); parent::__construct($registry, PlayedGame::class);

View File

@@ -1,4 +1,12 @@
<?php <?php
/**
* This file is part of the SplendidBear Websites' projects.
*
* Copyright (c) 2019 @ www.splendidbear.org
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace App\Repository; namespace App\Repository;
@@ -7,6 +15,11 @@ use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\Common\Persistence\ManagerRegistry; use Doctrine\Common\Persistence\ManagerRegistry;
/** /**
* Class StepRepository
*
* @package App\Repository
* @author system7 <https://www.splendidbear.org>
*
* @method Step|null find($id, $lockMode = null, $lockVersion = null) * @method Step|null find($id, $lockMode = null, $lockVersion = null)
* @method Step|null findOneBy(array $criteria, array $orderBy = null) * @method Step|null findOneBy(array $criteria, array $orderBy = null)
* @method Step[] findAll() * @method Step[] findAll()
@@ -14,6 +27,11 @@ use Doctrine\Common\Persistence\ManagerRegistry;
*/ */
class StepRepository extends ServiceEntityRepository class StepRepository extends ServiceEntityRepository
{ {
/**
* StepRepository constructor.
*
* @param ManagerRegistry $registry
*/
public function __construct(ManagerRegistry $registry) public function __construct(ManagerRegistry $registry)
{ {
parent::__construct($registry, Step::class); parent::__construct($registry, Step::class);

View File

@@ -54,8 +54,8 @@
#} #}
</div> </div>
<h3> <h3>
version {{ version }} &middot; MineSeeker&copy;{{ "now"|date("Y") }} &middot; <a version {{ version }} &bull; MineSeeker &copy; {{ "now"|date("Y") }} &bull;
href="http://www.laszlolang.com">www.laszlolang.com</a> <a href="https://www.splendidbear.org">www.splendidbear.org</a>
</h3> </h3>
</div> </div>
<img src="{{ asset('images/mine-logo-logo.png') }}" alt="MineSeeker Logo"/> <img src="{{ asset('images/mine-logo-logo.png') }}" alt="MineSeeker Logo"/>
@@ -79,11 +79,11 @@
<nav> <nav>
<ul> <ul>
<li><a href="{{ path('MineSeekerBundle_homepage') }}">Homepage</a></li> <li><a href="{{ path('MineSeekerBundle_homepage') }}">Homepage</a></li>
<li>&middot;</li> <li>&bull;</li>
<li><a href="{{ path('MineSeekerBundle_terms') }}">Terms of Use</a></li> <li><a href="{{ path('MineSeekerBundle_terms') }}">Terms of Use</a></li>
<li>&middot;</li> <li>&bull;</li>
<li><a href="{{ path('MineSeekerBundle_privacy') }}">Privacy Policy</a></li> <li><a href="{{ path('MineSeekerBundle_privacy') }}">Privacy Policy</a></li>
<li>&middot;</li> <li>&bull;</li>
<li><a href="{{ path('MineSeekerBundle_contact') }}">Contact</a></li> <li><a href="{{ path('MineSeekerBundle_contact') }}">Contact</a></li>
</ul> </ul>
</nav> </nav>