Ejemplo n.º 1
0
 /**
  * Create a clean new game to apply the test to
  *
  * @var string $testID The test ID
  */
 function __construct($testID)
 {
     global $DB, $Game, $Variant;
     /*
      * Create a clean new game to apply the test to
      */
     $this->testID = $testID;
     list($id) = $DB->sql_row("SELECT id FROM wD_Games WHERE name='DATC-Adjudicator-Test'");
     if ($id) {
         $DB->sql_put("UPDATE wD_Games SET phase = 'Diplomacy', turn = " . $testID . ", gameOver = 'No' WHERE id = " . $id);
     } else {
         $Game = processGame::create(1, 'DATC-Adjudicator-Test', '', 5, 'Winner-takes-all', 30, 30, 'No', 'Regular');
         $id = $Game->id;
         $DB->sql_put("UPDATE wD_Games SET phase = 'Diplomacy', turn = " . $testID . " WHERE id = " . $id);
     }
     if (!isset($_REQUEST['DATCResults'])) {
         self::wipe($id);
         $countries = array();
         for ($i = 1; $i <= count($Variant->countries); $i++) {
             $countries[] = $i;
         }
         $DB->sql_put("INSERT INTO wD_Members (gameID, userID, countryID, bet, timeLoggedIn)\r\n\t\t\t\t\tVALUES " . Database::packArray("(" . $id . ", 2, ", $countries, ", 5, " . time() . ")", ","));
     }
     parent::__construct($id);
     $GLOBALS['Game'] = $this;
     $Game = $this;
 }
Ejemplo n.º 2
0
 public function __construct($id)
 {
     parent::__construct($id);
 }