示例#1
0
 public function removeZone(Zone $zone)
 {
     if (isset($this->zones[$zone->getType()][$zone->getId()])) {
         unset($this->zones[$zone->getType()][$zone->getId()]);
         $this->removeZoneImpl($zone);
     }
 }
示例#2
0
 protected function addZoneImpl(Zone $zone)
 {
     $zone->setId($this->nextId());
     $this->getMain()->getServer()->getScheduler()->scheduleAsyncTask(new FileWriteTask($this->dir . "zones/" . $zone->getId() . ".weaz", json_encode(["Id" => $zone->getId(), "Space" => serialize($zone->getSpace()), "Type" => $zone->getType()])));
 }
 protected function addZoneImpl(Zone $zone)
 {
     $this->stream->addQuery(new QueryRequest($this->getMain(), "INSERT INTO wea_zones (type, space)" . "VALUES ({$zone->getType()}, {$this->esc(serialize($zone->getSpace()))})", new InsertZoneListener($zone)));
 }