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

Материал из 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) и соединитесь с базой данных.
    • Нажмите на кнопку Создать в левом нижнем углу, заполните данные для входа на сервер.
    • Нажмите Сохранить, затем Открыть для входа под заданным пользователем и паролем, выставленным при установке.
  • Выберите базу данных которую вы только что создали и затемнажмите Файл -> Load SQL File, and open the paradise_schema.sql file found in the \SQL directory of the game. You can also find it here, but it may be newer than the version you are using.
  • Press the blue play icon in the topic bar of icon hieroglyphs and pray. If the schema imported correctly you should have no errors in the message box on the bottom.
    • Refresh the panel on the left 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.
  • Make sure that these settings are changed:
    • sql_enabled is set to true.
    • sql_address is set to "127.0.0.1". (Replace with the database server's IP if not hosted locally)
    • sql_port is set to whatever port was selected during the MariaDB install, usually 3306.
    • sql_database is set to the name of your database, usually "paradise_gamedb".
    • sql_username is set to the 'User name' of the user you created above.
    • 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 для опытных программистов, Форматирование текста, Как делать перевод игры
Маппинг Руководство по маппингу
Спрайтинг Руководство по спрайтингу
Вики Руководство по редактированию вики