createNewGame.php 485 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. require_once realpath(dirname(__FILE__)) . '/../common.php';
  3. $objGame = new Game();
  4. $row = $objGame->objTable->getRow([
  5. 'game_state' => 0,
  6. ]);
  7. if (!$row) {
  8. $objEos = new Eos();
  9. $data = $objEos->createGame();
  10. $msg = "create game:{$data['gameid']}";
  11. CallLog::logSelfCall(CODE_SUCCESS, $msg);
  12. global $startTime;
  13. $startTime = microtime(true);
  14. } else {
  15. $msg = "exist game:{$row['id']}, game_state: {$row['game_state']}";
  16. }
  17. Eos::log($msg);