From 6a96c7de3c8aeb390e57af19655bf781d1e1a70c Mon Sep 17 00:00:00 2001 From: lopar Date: Mon, 1 Feb 2021 01:42:34 +0200 Subject: [PATCH] =?UTF-8?q?=D0=9C=D0=B5=D1=81=D1=82=D0=BE=D0=BD=D0=B0?= =?UTF-8?q?=D1=85=D0=BE=D0=B6=D0=B4=D0=B5=D0=BD=D0=B8=D0=B5=20sqlite-?= =?UTF-8?q?=D0=B1=D0=B0=D0=B7=D1=8B=20=D1=82=D1=8F=D0=BD=D0=B5=D1=82=D1=81?= =?UTF-8?q?=D1=8F=20=D0=B8=D0=B7=20=D0=BA=D0=BE=D0=BD=D1=84=D0=B8=D0=B3?= =?UTF-8?q?=D0=B0.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- classes/Battles/GameLogs.php | 5 +++-- config.php | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/classes/Battles/GameLogs.php b/classes/Battles/GameLogs.php index fd91a19..d4c1b3b 100644 --- a/classes/Battles/GameLogs.php +++ b/classes/Battles/GameLogs.php @@ -2,6 +2,7 @@ namespace Battles; +use Config; use SQLite3; class GameLogs @@ -16,7 +17,7 @@ class GameLogs */ public static function addBankLog(int $senderId, int $receiverId, int $amount, string $type, string $text) { - $db = new SQLite3('databases/logs.sqlite'); + $db = new SQLite3(Config::$db_sqlite); $row = $db->prepare("INSERT INTO bank_logs (sender_id, receiver_id, amount, type, text) VALUES (?, ?, ?, ?, ?)"); $row->bindParam(1, $senderId, SQLITE3_INTEGER); $row->bindParam(2, $receiverId, SQLITE3_INTEGER); @@ -42,7 +43,7 @@ class GameLogs if (empty($type)) { $type = "system"; } - $db = new SQLite3('databases/logs.sqlite'); + $db = new SQLite3(Config::$db_sqlite); $row = $db->prepare("INSERT INTO users_logs (user_id, author_id, type, text) VALUES (?,?,?,?)"); $row->bindParam(1, $userId, SQLITE3_INTEGER); $row->bindParam(2, $authorId, SQLITE3_INTEGER); diff --git a/config.php b/config.php index 172bc5e..231ee33 100644 --- a/config.php +++ b/config.php @@ -37,6 +37,7 @@ spl_autoload_register(function ($className) { trait Config { + public static $db_sqlite = '/volume2/web/battles/databases/logs.sqlite'; // Для нападалок. Сперва комнаты в которых нельзя напасть, потом персонажи на которых нельзя напасть. public static $unkilable = [ 'rooms' => [620, 621, 1051, 1052],