コード例 #1
0
 /**
  * @param $timerId
  * @return float
  */
 public function getTimer($timerId)
 {
     if ($this->isTimer($timerId)) {
         return $this->_player["timers"][$timerId];
     }
     return DateHelper::microtimeFloat(microtime());
 }
コード例 #2
0
ファイル: View.php プロジェクト: mbabenko21/likedimion-game
    public static function footerBlock()
    {
        $currentTime = DateHelper::microtimeFloat(microtime());
        $tmn = $currentTime - START_TIME;
        $page = <<<EOT
    <div id="footer">
        <p class="strong">&copy; Created by babenoff, 2015</p>
        <p class="text-muted strong">%01.4f сек.</p>
    </div>
EOT;
        return sprintf($page, $tmn);
    }
コード例 #3
0
ファイル: index.php プロジェクト: mbabenko21/likedimion-game
<?php

//error_reporting(E_WARNING|E_ERROR);
define("ROOT", __DIR__);
require "../vendor/autoload.php";
require "config.php";
require ROOT . "/../data/lang.php";
$magic = (require ROOT . "/../data/magic.php");
//set_error_handler('\\Likedimion\\Helper\\View::errorHandler');
require "dispatcher.php";
define("START_TIME", \Likedimion\Helper\DateHelper::microtimeFloat(microtime()));
//session_start();
$l_info = [];
$l_timers = [];
if (session_status() != PHP_SESSION_ACTIVE) {
    session_start();
}
$addr = $_ENV["ENV"] && $_ENV["ENV"] == "production" ? $config["game"]["mongodb"]["production"] : $config["game"]["mongodb"]["development"];
$mongoClient = new MongoClient($addr);
$ld = $mongoClient->likedimion;
$admin = "*****@*****.**";
//\Likedimion\Helper\View::display("Hello!!!", "World");
if (isset($_SESSION["aid"]) and isset($_SESSION["pid"])) {
    require "./game/main.php";
} elseif (isset($_SESSION["aid"]) and !isset($_SESSION["pid"])) {
    require "./cabinet.php";
} else {
    require "./site.php";
}
//session_destroy();