dev #38

Merged
lopar merged 22 commits from dev into master 2021-02-03 08:56:49 +00:00
2 changed files with 4 additions and 2 deletions
Showing only changes of commit 6a96c7de3c - Show all commits

View File

@ -2,6 +2,7 @@
namespace Battles; namespace Battles;
use Config;
use SQLite3; use SQLite3;
class GameLogs class GameLogs
@ -16,7 +17,7 @@ class GameLogs
*/ */
public static function addBankLog(int $senderId, int $receiverId, int $amount, string $type, string $text) 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 = $db->prepare("INSERT INTO bank_logs (sender_id, receiver_id, amount, type, text) VALUES (?, ?, ?, ?, ?)");
$row->bindParam(1, $senderId, SQLITE3_INTEGER); $row->bindParam(1, $senderId, SQLITE3_INTEGER);
$row->bindParam(2, $receiverId, SQLITE3_INTEGER); $row->bindParam(2, $receiverId, SQLITE3_INTEGER);
@ -42,7 +43,7 @@ class GameLogs
if (empty($type)) { if (empty($type)) {
$type = "system"; $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 = $db->prepare("INSERT INTO users_logs (user_id, author_id, type, text) VALUES (?,?,?,?)");
$row->bindParam(1, $userId, SQLITE3_INTEGER); $row->bindParam(1, $userId, SQLITE3_INTEGER);
$row->bindParam(2, $authorId, SQLITE3_INTEGER); $row->bindParam(2, $authorId, SQLITE3_INTEGER);

View File

@ -37,6 +37,7 @@ spl_autoload_register(function ($className) {
trait Config trait Config
{ {
public static $db_sqlite = '/volume2/web/battles/databases/logs.sqlite';
// Для нападалок. Сперва комнаты в которых нельзя напасть, потом персонажи на которых нельзя напасть. // Для нападалок. Сперва комнаты в которых нельзя напасть, потом персонажи на которых нельзя напасть.
public static $unkilable = [ public static $unkilable = [
'rooms' => [620, 621, 1051, 1052], 'rooms' => [620, 621, 1051, 1052],