コード例 #1
0
ファイル: RRRest.php プロジェクト: ChaseHQ/RegRoll
 public function genRoll($serialAgainst = '')
 {
     $rollId = $this->_appInstance->generateRoll($serialAgainst);
     $result = new RESTResult();
     $result->Data['RollID'] = $rollId;
     $result->Data['RollURL'] = 'http://' . RRApplication::getHost() . RRApplication::getWebApplicationDirectory() . 'roll/' . $rollId;
     echo json_encode($result, JSON_PRETTY_PRINT);
 }
コード例 #2
0
ファイル: EoEDice.php プロジェクト: ChaseHQ/RegRoll
 public function getJsonArray()
 {
     $dieArray = array();
     $dieArray['dieAbbr'] = $this->getDieAbbrev();
     $dieArray['dieType'] = $this->getDieName();
     $dieArray['dieLogo'] = 'http://' . RRApplication::getDiceImgPath() . $this->getDieLogo();
     $dieArray['dieSide'] = $this->getCurrentSide();
     $dieArray['dieSImg'] = 'http://' . RRApplication::getDiceImgPath() . $this->getCurrentSideDieLogo();
     return $dieArray;
 }
コード例 #3
0
ファイル: RRApplication.php プロジェクト: ChaseHQ/RegRoll
 public function showRollURL($rollId)
 {
     $this->renderArray['RollURL'] = 'http://' . RRApplication::getHost() . RRApplication::getWebApplicationDirectory() . 'roll/' . $rollId;
     $this->renderTemplate = $this->twigObj->loadTemplate('URLGet.html');
 }
コード例 #4
0
ファイル: index.php プロジェクト: ChaseHQ/RegRoll
<?php

require_once 'config.php';
require RRConfig::ComposerAutoload;
require 'lib/EoEDice.php';
require 'lib/RollTable.php';
require 'lib/RRApplication.php';
require 'lib/RRRest.php';
// ------------------------------------------------------- App Bootloader Below
$rrApp = new RRApplication();
$appRoute = new \Slim\Slim();
$appRoute->get('/', function () use($rrApp) {
    // Generate Roll - Homepage
    $rrApp->showMain();
});
$appRoute->get('/roll/:rollid', function ($rollid) use($rrApp) {
    // Get Roll
    $rrApp->showRoll($rollid);
});
$appRoute->get('/roll/:rollid/:serialdice', function ($rollid, $serialdice) use($rrApp) {
    // Get Roll
    $rrApp->executeRoll($rollid, $serialdice);
    $rrApp->showExecuteRoll($rollid);
});
$appRoute->get('/generate', function () use($rrApp) {
    // Generate Roll - selection screen
    $rrApp->showGenerateMain();
});
$appRoute->get('/generate/:dd', function ($dd) use($rrApp) {
    // Generate Roll - with difficulty dice
    $rrApp->showRollURL($rrApp->generateRoll($dd));