Настройка базы данных

Материал из SS220 Paradise Wiki (SS13)
Перейти к навигации Перейти к поиску
MakeshiftGarrote.PNGЭтой странице требуется переводMakeshiftGarrote.PNG
Эта статья содержит непереведенную информацию.


Первоначальная настройка и установка

  • Скачайте и установите MariaDB.
    • (настроек по умолчанию достаточно, вам нужно включить tcp и выставить пароль root. Если он предложит, do not set it up to use windows authentication)
      • Если вы выбрали флажек Install as a Windows Service (Установить как службу Windows, по умолчанию он включен), сервер базы данных будет запускатся при старте системы, не нужно будет каждый раз запускать его вручную.
  • Откройте HeidiSQL (идет вместе с Mariadb) и соединитесь с базой данных.
    • Нажмите на кнопку Создать в левом нижнем углу, заполните данные для входа на сервер.
    • Нажмите Сохранить, затем Открыть для входа под заданным пользователем и паролем, выставленным при установке.
  • Выберите базу данных которую вы только что создали и затем нажмите Файл -> Загрузить SQL файл, и откройте paradise_schema.sql файл, который находится в папке \SQL билда. Так же вы можете найти его тут, но он может быть новее чем версия которую вы используете.
  • Press the blue play icon in the topic bar of icon hieroglyphs and pray. Если схема импортирована корректно, внизу в окошке не появится никаких ошибок.
    • Обновите панель слева by right clicking it and ensure there's a new database called "paradise_gamedb" created.
  • Create a new user account for the server by going to Tools -> User manager.
    • 'From host' should be 127.0.0.1, not localhost if hosted locally, otherwise use the IP of the game server.
    • For permissions, do not give it any global permissions, instead click 'Add object', and then select the database you created for the server, hit ok, then give it SELECT, DELETE, INSERT, and UPDATE permissions on that database.
    • You can click the arrow on the password field to get a randomly generated password of certain lengths, copy the password before saving as it will be cleared the moment you hit save.
  • Open the file: \config\config.toml in notepad, notepad++, VSCode, or your favourite text editor, and scroll down to the [database_configuration] section. You should've copied the file over from the \example folder beforehand.
  • Убедитесь что эти настройки изменились:
    • sql_enabled выставлена в true.
    • sql_address выставлена в "127.0.0.1". (Измените на IP сервера базы данных если он установлен на другой машине)
    • sql_port выставлен тот порт, который вы задали при установке MariaDB, обычно это 3306.
    • sql_database выставлено название вашей базы данных, обычно это "paradise_gamedb".
    • sql_username выставлено имя пользователя которого вы создали выше.
    • sql_password is set to the randomly generated 'Password' of the user you created above.
  • The database is now set up for death logging, population logging, polls, library, privacy poll, connection logging and player logging. There are two more features which you should consider. And it's best to do so now, since adopting them later can be a pain.

Database based administration

Offers a changelog for changes done to admins, which increases accountability (adding/removing admins, adding/removing permissions, changing ranks); allows admins with +PERMISSIONS to edit other admins' permissions ingame, meaning they don't need remote desktop access to edit admins; Allows for custom ranks, with permissions not being tied to ranks, offering a better ability for the removal or addition of permissions to certain admins, if they need to be punished, or need extra permissions. Enabling this can be done any time, it's just a bit tedious the first time you do it, if you don't have direct access to the database.

To enable database based administration:

  • Open \config\config.toml and scroll to the [admin_configuration] section.
  • Set use_database_admins to true.
  • Add a database entry for the first administrator (likely yourself).
  • Done! Note that anyone set in the admin_assignments list will no longer be counted.
  • If your database ever dies, your server will revert to the old admin system, so it is a good idea to have admin_assignments and admin_ranks set up with some admins too, just so that the loss of the database doesn't completely destroy everything.
Как внести свой вклад?
Общее Руководство по разработке
Сервер Настройка базы данных, Запуск локального сервера
Код Структура кода SS13, SS13 для опытных программистов, Форматирование текста, Как делать перевод игры
Маппинг Руководство по маппингу
Спрайтинг Руководство по спрайтингу
Вики Руководство по редактированию вики