public function __construct($orderID, $gameID, $countryID) { parent::__construct($orderID, $gameID, $countryID); $this->fixed = array('unitID'); $this->requirements = array('type'); }
public function __construct($orderID, $gameID, $countryID) { parent::__construct($orderID, $gameID, $countryID); }
public function load() { global $DB; $DB->sql_put("SELECT * FROM wD_Members WHERE gameID = " . $this->gameID . " AND countryID=" . $this->countryID . " " . UPDATE); $tabl = $DB->sql_tabl("SELECT id, type, unitID, toTerrID, fromTerrID, viaConvoy\r\n\t\t\tFROM wD_Orders WHERE gameID = " . $this->gameID . " AND countryID=" . $this->countryID); $this->Orders = array(); $maxOrderID = 0; while ($row = $DB->tabl_hash($tabl)) { if ($row['id'] > $maxOrderID) { $maxOrderID = $row['id']; } $Order = userOrder::load($this->phase, $row['id'], $this->gameID, $this->countryID); $Order->loadFromDB($row); $this->Orders[] = $Order; } list($checkTurn, $checkPhase) = $DB->sql_row("SELECT turn, phase FROM wD_Games WHERE id=" . $this->gameID); if ($checkTurn != $this->turn || $checkPhase != $this->phase) { throw new Exception(l_t("The game has moved on, you can no longer alter these orders, please refresh.")); } if ($this->maxOrderID == false) { $this->maxOrderID = $maxOrderID; } //elseif( $this->maxOrderID < $maxOrderID ) //if( $this->tokenExpireTime < time() ) throw new Exception("The game has moved on, you can no longer alter these orders, please refresh."); }