Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
iSrDxv authored Feb 22, 2022
1 parent b3785dd commit 83fd3ca
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions src/hcf/provider/SQLite3Provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class SQLite3Provider

protected SQLite3 $connection;

public static function init(): void
public function init(): void
{
$sql = new SQLite3(Loader::getInstance()->getDataFolder() . "factions.db");
$sql->exec("CREATE TABLE IF NOT EXISTS claims(factionName TEXT PRIMARY KEY, x_1 INT, y_1 INT, z_1 INT, x_2 INT, y_2 INT, z_2 INT, level TEXT);");
Expand All @@ -23,18 +23,18 @@ public static function init(): void
$sql->exec("CREATE TABLE IF NOT EXISTS tops(factionName TEXT PRIMARY KEY, points INT);");
$sql->exec("CREATE TABLE IF NOT EXISTS members(factionName TEXT PRIMARY KEY, members TEXT);");
$sql->exec("CREATE TABLE IF NOT EXISTS players(username TEXT PRIMARY KEY, factionName TEXT, factionRank TEXT);");
$this->connection = ($sql instanceof SQLite3) ? $sql : null;
$this->connection = $sql;
Loader::getInstance()->getLogger()->notice(Text::GREEN . "SQLite3Provider ⋙ uploaded successfully");
}

public static function closeConnection(): void
public function closeConnection(): void
{
$this->connection->close();
}

public static function getDatabase()
public function getDatabase()
{
return $this->connection ?? null;
}

}
}
4 changes: 2 additions & 2 deletions src/hcf/provider/YAMLProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace hcf\provider;

use pocketmine\utils\Config;
use pocketmine\utils\{Config,TextFormat as Text};

use hcf\Loader;

Expand All @@ -26,4 +26,4 @@ public static function init(): void
}

}
?>
?>

0 comments on commit 83fd3ca

Please sign in to comment.