Пример #1
0
 /**
  * @param Bean $obj
  * @return void
  */
 public static function store(Bean $obj)
 {
     /** @var Riviere $obj */
     parent::store($obj);
     $index = min($obj->getIdHexa1(), $obj->getIdHexa2()) . '_' . max($obj->getIdHexa1(), $obj->getIdHexa2());
     if (!isset(self::$indexByHexas[$index])) {
         self::$indexByHexas[$index] = $obj;
     }
 }
Пример #2
0
 /**
  * @return void
  */
 public function main()
 {
     $ret = array('error' => 0, 'errorMsg' => '');
     while (true) {
         if (is_null($this->getHttp()->getPost('password'))) {
             $ret['error'] = 1;
             $ret['errorMsg'] = "Password obligatoire";
             break;
         }
         if ($this->getHttp()->getPost('password') != Conf::common()['server']['passwordAdmin']) {
             $ret['error'] = 2;
             $ret['errorMsg'] = "Mauvais password";
             break;
         }
         BaseStore::reset();
         JsonServer::getIntance()->setPartie(PartieBusiness::GetById(JsonServer::getIntance()->getPartie()->getId()));
         JsonServer::getIntance()->getPartie()->warm();
         CacheCarte::reset();
         break;
     }
     $this->output(json_encode($ret));
 }
Пример #3
0
 /**
  * @param int $id
  * @return Partie
  */
 public static function getById($id)
 {
     return parent::getById($id);
 }