Pixel-Composer/scripts/patreon_email_check/patreon_email_check.gml

40 lines
944 B
Text
Raw Normal View History

2023-11-14 14:29:11 +01:00
globalvar PATREON_MAIL_CHECK, PATREON_MAIL_CALLBACK;
globalvar IS_PATREON;
#macro FIRESTORE_ID "pixelcomposer-f9cef"
function patreon_email_check(mail, callback) {
PATREON_MAIL_CHECK = FirebaseFirestore("memberships").Where("email", "==", mail).Query();
PATREON_MAIL_CALLBACK = callback;
}
function patreon_create_verification_key(mail, code) {
var _path = DIRECTORY + "patreon";
var _map = ds_map_create();
_map[? "mail"] = mail;
_map[? "code"] = code;
ds_map_secure_save(_map, _path);
}
2024-11-14 07:45:26 +01:00
function patreon_create_verification_code(code) {
var _path = DIRECTORY + "patreon";
var _map = ds_map_create();
_map[? "code"] = code;
ds_map_secure_save(_map, _path);
}
2023-11-14 14:29:11 +01:00
function __initPatreon() {
IS_PATREON = false;
var _path = DIRECTORY + "patreon";
2023-12-08 03:50:09 +01:00
if(!file_exists_empty(_path)) return;
2024-11-14 07:45:26 +01:00
var _load = ds_map_secure_load(_path);
var _code = ds_map_try_get(_load, "code")
2023-11-14 14:29:11 +01:00
2024-11-14 07:45:26 +01:00
IS_PATREON = string_starts_with(_code, "pxc");
2023-11-14 14:29:11 +01:00
}