Ejemplo n.º 1
0
 public function savePlayer(IPlayer $player, array $config)
 {
     $name = trim(strtolower($player->getName()));
     $data = new Config($this->plugin->getDataFolder() . "players/" . $name[0] . "/{$name}.yml", Config::YAML);
     $data->setAll($config);
     $data->save();
 }
Ejemplo n.º 2
0
 public function __construct(EmailAuth $plugin)
 {
     $this->plugin = $plugin;
     if (!file_exists($this->plugin->getDataFolder() . "players.db")) {
         $this->database = new \SQLite3($this->plugin->getDataFolder() . "players.db", SQLITE3_OPEN_READWRITE | SQLITE3_OPEN_CREATE);
         $resource = $this->plugin->getResource("sqlite3.sql");
         $this->database->exec(stream_get_contents($resource));
         fclose($resource);
     } else {
         $this->database = new \SQLite3($this->plugin->getDataFolder() . "players.db", SQLITE3_OPEN_READWRITE);
     }
 }