Compare commits
No commits in common. "c02f5956069fb52b8ce1c7ed745fc4d587673470" and "75bea7c05c82075f9688eedc4af96b240f7d3411" have entirely different histories.
c02f595606
...
75bea7c05c
@ -20,4 +20,3 @@ MULTI_INTERNAL_HOST=multi
|
|||||||
MULTI_INTERNAL_PORT=5000
|
MULTI_INTERNAL_PORT=5000
|
||||||
MULTI_WS_URL=mapguesser-dev.ch:8090
|
MULTI_WS_URL=mapguesser-dev.ch:8090
|
||||||
MULTI_WS_PORT=8090
|
MULTI_WS_PORT=8090
|
||||||
ENABLE_GAME_FOR_GUESTS=0
|
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
use DateTime;
|
use DateTime;
|
||||||
use Faker\Factory;
|
use Faker\Factory;
|
||||||
use MapGuesser\Interfaces\Authorization\ISecured;
|
|
||||||
use MapGuesser\Interfaces\Request\IRequest;
|
use MapGuesser\Interfaces\Request\IRequest;
|
||||||
use MapGuesser\Response\HtmlContent;
|
use MapGuesser\Response\HtmlContent;
|
||||||
use MapGuesser\Response\JsonContent;
|
use MapGuesser\Response\JsonContent;
|
||||||
@ -15,7 +14,7 @@ use MapGuesser\Repository\MapRepository;
|
|||||||
use MapGuesser\Repository\MultiRoomRepository;
|
use MapGuesser\Repository\MultiRoomRepository;
|
||||||
use MapGuesser\Response\Redirect;
|
use MapGuesser\Response\Redirect;
|
||||||
|
|
||||||
class GameController implements ISecured
|
class GameController
|
||||||
{
|
{
|
||||||
private IRequest $request;
|
private IRequest $request;
|
||||||
|
|
||||||
@ -36,11 +35,6 @@ class GameController implements ISecured
|
|||||||
$this->mapRepository = new MapRepository();
|
$this->mapRepository = new MapRepository();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function authorize(): bool
|
|
||||||
{
|
|
||||||
return !empty($_ENV['ENABLE_GAME_FOR_GUESTS']) || $this->request->user() !== null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getGame(): IContent
|
public function getGame(): IContent
|
||||||
{
|
{
|
||||||
$mapId = (int) $this->request->query('mapId');
|
$mapId = (int) $this->request->query('mapId');
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
<?php namespace MapGuesser\Controller;
|
<?php namespace MapGuesser\Controller;
|
||||||
|
|
||||||
use DateTime;
|
use DateTime;
|
||||||
use MapGuesser\Interfaces\Authorization\ISecured;
|
|
||||||
use MapGuesser\Interfaces\Request\IRequest;
|
use MapGuesser\Interfaces\Request\IRequest;
|
||||||
use MapGuesser\Util\Geo\Position;
|
use MapGuesser\Util\Geo\Position;
|
||||||
use MapGuesser\Response\JsonContent;
|
use MapGuesser\Response\JsonContent;
|
||||||
@ -13,7 +12,7 @@ use MapGuesser\Repository\MultiRoomRepository;
|
|||||||
use MapGuesser\Repository\PlaceRepository;
|
use MapGuesser\Repository\PlaceRepository;
|
||||||
use MapGuesser\Repository\UserPlayedPlaceRepository;
|
use MapGuesser\Repository\UserPlayedPlaceRepository;
|
||||||
|
|
||||||
class GameFlowController implements ISecured
|
class GameFlowController
|
||||||
{
|
{
|
||||||
const NUMBER_OF_ROUNDS = 5;
|
const NUMBER_OF_ROUNDS = 5;
|
||||||
const MAX_SCORE = 1000;
|
const MAX_SCORE = 1000;
|
||||||
@ -40,11 +39,6 @@ class GameFlowController implements ISecured
|
|||||||
$this->userPlayedPlaceRepository = new UserPlayedPlaceRepository();
|
$this->userPlayedPlaceRepository = new UserPlayedPlaceRepository();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function authorize(): bool
|
|
||||||
{
|
|
||||||
return !empty($_ENV['ENABLE_GAME_FOR_GUESTS']) || $this->request->user() !== null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function initialData(): IContent
|
public function initialData(): IContent
|
||||||
{
|
{
|
||||||
$mapId = (int) $this->request->query('mapId');
|
$mapId = (int) $this->request->query('mapId');
|
||||||
|
@ -62,7 +62,6 @@ TODO: condition!
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="buttonContainer">
|
<div class="buttonContainer">
|
||||||
<?php if (!empty($_ENV['ENABLE_GAME_FOR_GUESTS']) || Container::$request->user()): ?>
|
|
||||||
<?php if ($isAdmin): ?>
|
<?php if ($isAdmin): ?>
|
||||||
<button class="button fullWidth noRightRadius playButton" data-map-id="<?= $map['id'] ?>" data-map-name="<?= htmlspecialchars($map['name']) ?>" title="Play map '<?= $map['name'] ?>'">Play this map</button>
|
<button class="button fullWidth noRightRadius playButton" data-map-id="<?= $map['id'] ?>" data-map-name="<?= htmlspecialchars($map['name']) ?>" title="Play map '<?= $map['name'] ?>'">Play this map</button>
|
||||||
<a class="button yellow fullWidth noLeftRadius noRightRadius" href="/admin/mapEditor/<?= $map['id']; ?>" title="Edit map '<?= $map['name'] ?>'">Edit</a>
|
<a class="button yellow fullWidth noLeftRadius noRightRadius" href="/admin/mapEditor/<?= $map['id']; ?>" title="Edit map '<?= $map['name'] ?>'">Edit</a>
|
||||||
@ -70,9 +69,6 @@ TODO: condition!
|
|||||||
<?php else: ?>
|
<?php else: ?>
|
||||||
<button class="button fullWidth playButton" data-map-id="<?= $map['id'] ?>" data-map-name="<?= htmlspecialchars($map['name']) ?>" title="Play map '<?= $map['name'] ?>'">Play this map</button>
|
<button class="button fullWidth playButton" data-map-id="<?= $map['id'] ?>" data-map-name="<?= htmlspecialchars($map['name']) ?>" title="Play map '<?= $map['name'] ?>'">Play this map</button>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<?php else: ?>
|
|
||||||
<a href="/login" class="button fullWidth" title="Play map '<?= $map['name'] ?>'">Play this map</a>
|
|
||||||
<?php endif; ?>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
|
Loading…
Reference in New Issue
Block a user