Beispiel #1
0
 public function addZone(Zone $zone)
 {
     $position = $zone->getPosition();
     $name = $this->database->escape_string($zone->getName());
     $player = $this->database->escape_string($zone->getOwner());
     $level = $zone->getLevelName();
     $minx = $position[0];
     $miny = $position[1];
     $minz = $position[2];
     $maxx = $position[3];
     $maxy = $position[4];
     $maxz = $position[5];
     return $this->database->query("INSERT INTO izone_zones (name, player_owner, level_name, minX, minY, minZ, maxX, maxY, maxZ, pvpAvailable) VALUES ({$name}, {$player}, {$level}, {$minx}, {$miny}, {$minz}, {$maxx}, {$maxy}, {$maxz}, {$zone->pvpAvailable})");
 }
Beispiel #2
0
 public function addZone(Zone $zone)
 {
     $position = $zone->getPosition();
     $prepare = $this->database->prepare("INSERT INTO Zones (name, player_owner, level_name, minX, minY, minZ, maxX, maxY, maxZ, pvpAvailable) VALUES (:name, :player, :level, :minx, :miny, :minz, :maxx, :maxy, :maxz, :pvp)");
     $prepare->bindValue(":name", \SQLite3::escapeString($zone->getName()), SQLITE3_TEXT);
     $prepare->bindValue(":player", \SQLite3::escapeString($zone->getOwner()), SQLITE3_TEXT);
     $prepare->bindValue(":level", $zone->getLevelName(), SQLITE3_TEXT);
     $prepare->bindValue(":minx", $position[0], SQLITE3_INTEGER);
     $prepare->bindValue(":miny", $position[1], SQLITE3_INTEGER);
     $prepare->bindValue(":minz", $position[2], SQLITE3_INTEGER);
     $prepare->bindValue(":maxx", $position[3], SQLITE3_INTEGER);
     $prepare->bindValue(":maxy", $position[4], SQLITE3_INTEGER);
     $prepare->bindValue(":maxz", $position[5], SQLITE3_INTEGER);
     $prepare->bindValue(":pvp", $zone->pvpAvailable);
     $prepare->execute();
 }
Beispiel #3
0
 public function addZone(Zone $zone)
 {
     $this->zonesConfig->set($zone->getName(), [$zone->getName(), $zone->getOwner(), $zone->getLevelName(), $zone->getPosition(), $zone->pvpAvailable]);
 }