forked from ParadiseSS13/Paradise
-
Notifications
You must be signed in to change notification settings - Fork 124
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
<!-- Пишите **НИЖЕ** заголовков и **ВЫШЕ** комментариев, иначе что то может пойти не так. --> <!-- Вы можете прочитать Contributing.MD, если хотите узнать больше. --> ## Что этот PR делает Добавляем ксеномодерацию по приказу генерала Гавса. <!-- Вкратце опишите изменения, которые вносите. --> <!-- Опишите **все** изменения, так как противное может сказаться на рассмотрении этого PR'а! --> <!-- Если вы исправляете Issue, добавьте "Fixes #1234" (где 1234 - номер Issue) где-нибудь в описании PR'а. Это автоматически закроет Issue после принятия PR'а. --> ## Почему это хорошо для игры <!-- Опишите, почему, по вашему, следует добавить эти изменения в игру. --> ## Изображения изменений <!-- Если вы не меняли карту или спрайты, можете опустить эту секцию. Если хотите, можете вставить видео. --> ## Тестирование <!-- Как вы тестировали свой PR, если делали это вовсе? --> ## Changelog :cl: add: Добавлена возможность включить на сервере ксеномодерацию. (Пока что ксеномодерация отключена) /:cl: <!-- Оба :cl:'а должны быть на месте, что-бы чейнджлог работал! Вы можете написать свой ник справа от первого :cl:, если хотите. Иначе будет использован ваш ник на ГитХабе. --> <!-- Вы можете использовать несколько записей с одинаковым префиксом (Они используются только для иконки в игре) и удалить ненужные. Помните, что чейнджлог должен быть понятен обычным игроком. --> <!-- Если чейнджлог не влияет на игроков(например, это рефактор), вы можете исключить всю секцию. -->
- Loading branch information
Showing
10 changed files
with
79 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Updating DB from 53.220.5 to 53.220.6 | ||
# Adds species whitelist ~legendaxe | ||
|
||
ALTER TABLE `player` ADD `species_whitelist` LONGTEXT COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '["human"]'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
/datum/modpack/discord_link | ||
name = "Вайтлист на расы" | ||
desc = "Добавление вайтлиста на расы" | ||
author = "legendaxe" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#include "_species_whitelist.dm" | ||
|
||
#include "code/species_whitelist_configuration.dm" | ||
#include "code/species_whitelist_preferences.dm" |
14 changes: 14 additions & 0 deletions
14
modular_ss220/species_whitelist/code/species_whitelist_configuration.dm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/datum/server_configuration | ||
/// Holder for the gateway configuration datum | ||
var/datum/configuration_section/species_whitelist_configuration/species_whitelist | ||
|
||
/datum/server_configuration/load_all_sections() | ||
. = ..() | ||
species_whitelist = new() | ||
safe_load(species_whitelist, "species_whitelist_configuration") | ||
|
||
/datum/configuration_section/species_whitelist_configuration | ||
var/species_whitelist_enabled = FALSE | ||
|
||
/datum/configuration_section/species_whitelist_configuration/load_data(list/data) | ||
CONFIG_LOAD_BOOL(species_whitelist_enabled, data["species_whitelist_enabled"]) |
30 changes: 30 additions & 0 deletions
30
modular_ss220/species_whitelist/code/species_whitelist_preferences.dm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/datum/preferences | ||
var/species_whitelist | ||
|
||
/datum/preferences/proc/get_species_whitelist() | ||
. = TRUE | ||
|
||
if(species_whitelist) | ||
return | ||
|
||
var/datum/db_query/preferences_query = SSdbcore.NewQuery("SELECT species_whitelist FROM player WHERE ckey=:ckey", list( | ||
"ckey" = parent.ckey | ||
)) | ||
|
||
if(!preferences_query.warn_execute()) | ||
qdel(preferences_query) | ||
return FALSE | ||
|
||
while(preferences_query.NextRow()) | ||
var/species_whitelist_json = preferences_query.item[1] | ||
if(species_whitelist_json) | ||
species_whitelist = json_decode(preferences_query.item[1]) | ||
|
||
qdel(preferences_query) | ||
|
||
/datum/preferences/load_preferences(datum/db_query/query) | ||
. = ..() | ||
if(!.) | ||
return | ||
|
||
return get_species_whitelist() |