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'а! --> <!-- Если вы исправляете Issue, добавьте "Fixes #1234" (где 1234 - номер Issue) где-нибудь в описании PR'а. Это автоматически закроет Issue после принятия PR'а. --> <!-- Опишите, почему, по вашему, следует добавить эти изменения в игру. --> <!-- Если вы не меняли карту или спрайты, можете опустить эту секцию. Если хотите, можете вставить видео. --> <!-- Как вы тестировали свой PR, если делали это вовсе? --> :cl: add: Поддержка нашей системы донатов через бусти /:cl: <!-- Оба :cl:'а должны быть на месте, что-бы чейнджлог работал! Вы можете написать свой ник справа от первого :cl:, если хотите. Иначе будет использован ваш ник на ГитХабе. --> <!-- Вы можете использовать несколько записей с одинаковым префиксом (Они используются только для иконки в игре) и удалить ненужные. Помните, что чейнджлог должен быть понятен обычным игроком. --> <!-- Если чейнджлог не влияет на игроков(например, это рефактор), вы можете исключить всю секцию. -->
- Loading branch information
Showing
7 changed files
with
58 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
CREATE TABLE `budget` ( | ||
`id` INT(11) NOT NULL AUTO_INCREMENT, | ||
`date` DATETIME NOT NULL DEFAULT current_timestamp(), | ||
`ckey` VARCHAR(32) NULL DEFAULT NULL COLLATE 'utf8mb4_unicode_ci', | ||
`amount` INT(10) UNSIGNED NOT NULL, | ||
`source` VARCHAR(32) NOT NULL COLLATE 'utf8mb4_general_ci', | ||
`date_start` DATETIME NOT NULL DEFAULT current_timestamp(), | ||
`date_end` DATETIME NULL DEFAULT (current_timestamp() + interval 1 month), | ||
`is_valid` TINYINT(1) NOT NULL DEFAULT '1', | ||
`discord_id` bigint(20) DEFAULT NULL, | ||
PRIMARY KEY (`id`) USING BTREE | ||
) COLLATE='utf8mb4_general_ci' ENGINE=InnoDB; |
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/donor | ||
name = "Донат" | ||
desc = "Поддержка старой системы донатов" | ||
author = "furior" |
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,3 @@ | ||
#include "_donor.dm" | ||
|
||
#include "code/client_procs.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,35 @@ | ||
/datum/client_login_processor/donator_check/process_result(datum/db_query/Q, client/C) | ||
if(IsGuestKey(C.ckey)) | ||
return | ||
|
||
if(check_rights_client(R_ADMIN, FALSE, C)) | ||
C.donator_level = DONATOR_LEVEL_MAX | ||
C.donor_loadout_points() | ||
return | ||
|
||
while(Q.NextRow()) | ||
var/total = Q.item[1] | ||
switch(total) | ||
if(220 to 439) | ||
C.donator_level = 1 | ||
if(440 to 999) | ||
C.donator_level = 2 | ||
if(1000 to 2219) | ||
C.donator_level = 3 | ||
if(2220 to 9999) | ||
C.donator_level = 4 | ||
if(1000 to INFINITY) | ||
C.donator_level = DONATOR_LEVEL_MAX | ||
C.donor_loadout_points() | ||
|
||
/datum/client_login_processor/donator_check/get_query(client/C) | ||
var/datum/db_query/query = SSdbcore.NewQuery({" | ||
SELECT CAST(SUM(amount) as UNSIGNED INTEGER) FROM budget | ||
WHERE ckey=:ckey | ||
AND is_valid=true | ||
AND date_start <= NOW() | ||
AND (NOW() < date_end OR date_end IS NULL) | ||
GROUP BY ckey | ||
"}, list("ckey" = C.ckey)) | ||
|
||
return query |
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