src/Controller/DefaultController.php line 87
<?php
namespace App\Controller;
use App\Entity\CrateActionLog;
use App\Entity\NftHub;
use App\Entity\NftMetadata;
use App\Entity\Template;
use App\Entity\UserRecord;
use Doctrine\Persistence\ManagerRegistry;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
class DefaultController extends AbstractController
{
public function __construct(private ManagerRegistry $doctrine) {}
#[Route('/', name: 'default', requirements: ['domain' => 'tinyknightgames.com|tinyknightgames.wip|tkgstage.com'], host: '{domain}')]
public function index(): Response
{
return $this->render('tinyknightgames/index.html.twig');
}
#[Route('/', name: 'fishers_quest_default', requirements: ['subdomain' => 'fishersquest', 'domain' => 'tinyknightgames.com|tinyknightgames.wip|tkgstage.com'], host: '{subdomain}.{domain}')]
public function indexFishersQuest(): Response
{
$em = $this->doctrine->getManager();
$recentNftMetadatas = $em->getRepository(NftMetadata::class)->findLatestCreated();
$catchableRecords = $em->getRepository(UserRecord::class)->findRecordCatchableCountByTier();
$totalCaught = $em->getRepository(UserRecord::class)->getTotalCaught();
$nextCatchableRelease = $em->getRepository(Template::class)->findNextCatchableRelease();
$prevCatchableRelease = $em->getRepository(Template::class)->findPrevCatchableRelease();
return $this->render('fishersquest/index.html.twig', [
'controller_name' => 'DefaultController',
'recentNftMetadatas' => $recentNftMetadatas,
'catchableRecords' => $catchableRecords,
'totalCaught' => $totalCaught,
'nextCatchableRelease' => $nextCatchableRelease,
'prevCatchableRelease' => $prevCatchableRelease
]);
}
#[Route('/game', name: 'fishers_quest_game', requirements: ['subdomain' => 'fishersquest', 'domain' => 'tinyknightgames.com|tinyknightgames.wip|tkgstage.com'], host: '{subdomain}.{domain}')]
public function gameFishersQuest(): Response
{
return $this->render('fishersquest/game.html.twig');
}
#[Route('/', name: 'occult_of_the_oculi_default', requirements: ['subdomain' => 'occultoftheoculi', 'domain' => 'tinyknightgames.com|tinyknightgames.wip|tkgstage.com'], host: '{subdomain}.{domain}')]
public function indexOccultOfTheOculi(): Response
{
$em = $this->doctrine->getManager();
$cratesRemaining = $em->getRepository(NftHub::class)->getCratesRemaining(5);
$crateDiscoveryLog = $em->getRepository(CrateActionLog::class)->getLatestDiscovered();
$recentlyOpened = $em->getRepository(NftHub::class)->findRecentlyOpened();
return $this->render('occultoftheoculi/index.html.twig', [
'cratesRemaining' => $cratesRemaining,
'crateDiscoveryLog' => $crateDiscoveryLog,
'recentlyOpened' => $recentlyOpened,
]);
}
#[Route('/game', name: 'occult_of_the_oculi_game', requirements: ['subdomain' => 'occultoftheoculi', 'domain' => 'tinyknightgames.com|tinyknightgames.wip|tkgstage.com'], host: '{subdomain}.{domain}')]
public function gameOccultOfTheOculi(): Response
{
return $this->render('occultoftheoculi/game.html.twig');
}
#[Route('/support', name: 'support', requirements: ['domain' => 'tinyknightgames.com|tinyknightgames.wip|tkgstage.com'], host: '{domain}')]
public function support(): Response
{
return $this->render('tinyknightgames/support.html.twig');
}
#[Route('/patch-notes', name: 'patch_notes', requirements: ['domain' => 'tinyknightgames.com|tinyknightgames.wip|tkgstage.com'], host: '{domain}')]
public function patchNotes(): Response
{
return $this->render('tinyknightgames/patchnotes.html.twig');
}
#[Route('/privacy', name: 'privacy', requirements: ['domain' => 'tinyknightgames.com|tinyknightgames.wip|tkgstage.com'], host: '{domain}')]
public function privacy(): Response
{
return $this->render('tinyknightgames/privacy.html.twig');
}
#[Route('/maintenance', name: 'maintenance', requirements: ['domain' => 'tinyknightgames.com|tinyknightgames.wip|tkgstage.com'], host: '{domain}')]
public function maintenance(): Response
{
return $this->render('tinyknightgames/maintenance.html.twig');
}
#[Route('/thetadrop-connect-success', name: 'thetadrop_connect_success', requirements: ['domain' => 'tinyknightgames.com|tinyknightgames.wip|tkgstage.com'], host: '{domain}')]
public function thetaDropConnectSuccess(): Response
{
return $this->render('tinyknightgames/thetadrop-connect-success.html.twig');
}
}