src/Controller/DefaultController.php line 87

  1. <?php
  2. namespace App\Controller;
  3. use App\Entity\CrateActionLog;
  4. use App\Entity\NftHub;
  5. use App\Entity\NftMetadata;
  6. use App\Entity\Template;
  7. use App\Entity\UserRecord;
  8. use Doctrine\Persistence\ManagerRegistry;
  9. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  10. use Symfony\Component\HttpFoundation\Response;
  11. use Symfony\Component\Routing\Annotation\Route;
  12. class DefaultController extends AbstractController
  13. {
  14.     public function __construct(private ManagerRegistry $doctrine) {}
  15.     #[Route('/'name'default'requirements: ['domain' => 'tinyknightgames.com|tinyknightgames.wip|tkgstage.com'], host'{domain}')]
  16.     public function index(): Response
  17.     {
  18.         return $this->render('tinyknightgames/index.html.twig');
  19.     }
  20.     #[Route('/'name'fishers_quest_default'requirements: ['subdomain' => 'fishersquest''domain' => 'tinyknightgames.com|tinyknightgames.wip|tkgstage.com'], host'{subdomain}.{domain}')]
  21.     public function indexFishersQuest(): Response
  22.     {
  23.         $em $this->doctrine->getManager();
  24.         $recentNftMetadatas $em->getRepository(NftMetadata::class)->findLatestCreated();
  25.         $catchableRecords $em->getRepository(UserRecord::class)->findRecordCatchableCountByTier();
  26.         $totalCaught $em->getRepository(UserRecord::class)->getTotalCaught();
  27.         $nextCatchableRelease $em->getRepository(Template::class)->findNextCatchableRelease();
  28.         $prevCatchableRelease $em->getRepository(Template::class)->findPrevCatchableRelease();
  29.         return $this->render('fishersquest/index.html.twig', [
  30.             'controller_name' => 'DefaultController',
  31.             'recentNftMetadatas' => $recentNftMetadatas,
  32.             'catchableRecords' => $catchableRecords,
  33.             'totalCaught' => $totalCaught,
  34.             'nextCatchableRelease' => $nextCatchableRelease,
  35.             'prevCatchableRelease' => $prevCatchableRelease
  36.         ]);
  37.     }
  38.     #[Route('/game'name'fishers_quest_game'requirements: ['subdomain' => 'fishersquest''domain' => 'tinyknightgames.com|tinyknightgames.wip|tkgstage.com'], host'{subdomain}.{domain}')]
  39.     public function gameFishersQuest(): Response
  40.     {
  41.         return $this->render('fishersquest/game.html.twig');
  42.     }
  43.     #[Route('/'name'occult_of_the_oculi_default'requirements: ['subdomain' => 'occultoftheoculi''domain' => 'tinyknightgames.com|tinyknightgames.wip|tkgstage.com'], host'{subdomain}.{domain}')]
  44.     public function indexOccultOfTheOculi(): Response
  45.     {
  46.         $em $this->doctrine->getManager();
  47.         $cratesRemaining $em->getRepository(NftHub::class)->getCratesRemaining(5);
  48.         $crateDiscoveryLog $em->getRepository(CrateActionLog::class)->getLatestDiscovered();
  49.         $recentlyOpened $em->getRepository(NftHub::class)->findRecentlyOpened();
  50.         return $this->render('occultoftheoculi/index.html.twig', [
  51.             'cratesRemaining' => $cratesRemaining,
  52.             'crateDiscoveryLog' => $crateDiscoveryLog,
  53.             'recentlyOpened' => $recentlyOpened,
  54.         ]);
  55.     }
  56.     #[Route('/game'name'occult_of_the_oculi_game'requirements: ['subdomain' => 'occultoftheoculi''domain' => 'tinyknightgames.com|tinyknightgames.wip|tkgstage.com'], host'{subdomain}.{domain}')]
  57.     public function gameOccultOfTheOculi(): Response
  58.     {
  59.         return $this->render('occultoftheoculi/game.html.twig');
  60.     }
  61.     #[Route('/support'name'support'requirements: ['domain' => 'tinyknightgames.com|tinyknightgames.wip|tkgstage.com'], host'{domain}')]
  62.     public function support(): Response
  63.     {
  64.         return $this->render('tinyknightgames/support.html.twig');
  65.     }
  66.     #[Route('/patch-notes'name'patch_notes'requirements: ['domain' => 'tinyknightgames.com|tinyknightgames.wip|tkgstage.com'], host'{domain}')]
  67.     public function patchNotes(): Response
  68.     {
  69.         return $this->render('tinyknightgames/patchnotes.html.twig');
  70.     }
  71.     #[Route('/privacy'name'privacy'requirements: ['domain' => 'tinyknightgames.com|tinyknightgames.wip|tkgstage.com'], host'{domain}')]
  72.     public function privacy(): Response
  73.     {
  74.         return $this->render('tinyknightgames/privacy.html.twig');
  75.     }
  76.     #[Route('/maintenance'name'maintenance'requirements: ['domain' => 'tinyknightgames.com|tinyknightgames.wip|tkgstage.com'], host'{domain}')]
  77.     public function maintenance(): Response
  78.     {
  79.         return $this->render('tinyknightgames/maintenance.html.twig');
  80.     }
  81.     #[Route('/thetadrop-connect-success'name'thetadrop_connect_success'requirements: ['domain' => 'tinyknightgames.com|tinyknightgames.wip|tkgstage.com'], host'{domain}')]
  82.     public function thetaDropConnectSuccess(): Response
  83.     {
  84.         return $this->render('tinyknightgames/thetadrop-connect-success.html.twig');
  85.     }
  86. }