Skip to content

Commit

Permalink
feat(db): GigaChadDB
Browse files Browse the repository at this point in the history
  • Loading branch information
igorsaux committed Jul 4, 2024
1 parent e3d3756 commit 4742a12
Show file tree
Hide file tree
Showing 47 changed files with 355 additions and 743 deletions.
38 changes: 0 additions & 38 deletions .travis.yml

This file was deleted.

17 changes: 0 additions & 17 deletions Dockerfile

This file was deleted.

6 changes: 2 additions & 4 deletions baystation12.dme
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@
#include "code\controllers\autotransfer.dm"
#include "code\controllers\configuration.dm"
#include "code\controllers\controller.dm"
#include "code\controllers\db.dm"
#include "code\controllers\failsafe.dm"
#include "code\controllers\globals.dm"
#include "code\controllers\hooks-defs.dm"
Expand Down Expand Up @@ -370,7 +371,7 @@
#include "code\datums\configuration\character_setup_section.dm"
#include "code\datums\configuration\configuration_section.dm"
#include "code\datums\configuration\custom_section.dm"
#include "code\datums\configuration\database_section.dm"
#include "code\datums\configuration\db_section.dm"
#include "code\datums\configuration\donations_section.dm"
#include "code\datums\configuration\error_section.dm"
#include "code\datums\configuration\events_section.dm"
Expand All @@ -393,7 +394,6 @@
#include "code\datums\configuration\server_configuration.dm"
#include "code\datums\configuration\texts_section.dm"
#include "code\datums\configuration\vote_section.dm"
#include "code\datums\configuration\whitelist_section.dm"
#include "code\datums\elements\_element.dm"
#include "code\datums\elements\connect_loc.dm"
#include "code\datums\elements\debris.dm"
Expand Down Expand Up @@ -1527,7 +1527,6 @@
#include "code\modules\admin\player_notes.dm"
#include "code\modules\admin\player_panel.dm"
#include "code\modules\admin\regular_announcement.dm"
#include "code\modules\admin\species_ingame_whitelist.dm"
#include "code\modules\admin\ticket.dm"
#include "code\modules\admin\topic.dm"
#include "code\modules\admin\watchlist.dm"
Expand Down Expand Up @@ -3247,7 +3246,6 @@
#include "code\procs\dbcore.dm"
#include "code\procs\hud.dm"
#include "code\procs\radio.dm"
#include "code\procs\statistics.dm"
#include "interface\interface.dm"
#include "interface\skin.dmf"
#include "maps\_map_include.dm"
Expand Down
24 changes: 23 additions & 1 deletion code/__defines/rust_g.dm
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
/// Add files that match the glob pattern, for example: `config/*`Add the file with the specified path. The extension is optional.
#define rustg_cfg_add_source_file(name) RUSTG_CALL(RUST_G, "cfg_add_source_file")(name)

/// Use environment variables. The prefix is optional.
/// Use environment variables. The prefix and the separator are optional.
#define rustg_cfg_add_source_env(prefix, separator) RUSTG_CALL(RUST_G, "cfg_add_source_env")(isnull(prefix) ? "" : prefix, isnull(separator) ? "" : separator)

#define rustg_cfg_end_builder(...) RUSTG_CALL(RUST_G, "cfg_end_builder")()
Expand Down Expand Up @@ -479,6 +479,28 @@
/// https://en.wikipedia.org/wiki/Normal-inverse_Gaussian_distribution
#define rustg_rand_normal_inverse_gaussian(alpha, beta) text2num(RUSTG_CALL(RUST_G, "rand_normal_inverse_gaussian")(istext(alpha) ? alpha : num2text(alpha), istext(beta) ? beta : num2text(beta)))

/// addr - A folder path or an IP address.
/// ns - Namespace.
/// db - Database name.
/// login - Root login. Optional.
/// pass - Root password. Optional.
#define rustg_sdb_connect(addr, ns, db, login, pass) RUSTG_CALL(RUST_G, "sdb_connect")(addr, ns, db, isnull(login) ? "" : login, isnull(pass) ? "" : pass)

/// Executes a query.
/// query - The query itself.
/// binds - a JSON encoded string, for example: `"{ \"some_arg\": \"Value\" }"`. Optional.
#define rustg_sdb_query(query, binds) RUSTG_CALL(RUST_G, "sdb_query")(query, isnull(binds) ? "" : binds)

/// Import an SQL file.
/// path - Path to the SQL file.
#define rustg_sdb_import(path) RUSTG_CALL(RUST_G, "sdb_import")(path)

/// Dumps the database into the SQL file.
/// path - Path to the file where to save the dump.
#define rustg_sdb_export(path) RUSTG_CALL(RUST_G, "sdb_export")(path)

#define rustg_sdb_disconnect(...) RUSTG_CALL(RUST_G, "sdb_disconnect")()

#define rustg_raw_read_toml_file(path) json_decode(RUSTG_CALL(RUST_G, "toml_file_to_json")(path) || "null")

/proc/rustg_read_toml_file(path)
Expand Down
20 changes: 0 additions & 20 deletions code/_helpers/global_access.dm
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,6 @@
return global.air_alarm_topic;
if("air_blocked")
return global.air_blocked;
if("alien_whitelist")
return global.alien_whitelist;
if("allCasters")
return global.allCasters;
if("allConsoles")
Expand Down Expand Up @@ -269,8 +267,6 @@
return global.damage_icon_parts;
if("dbcon")
return global.dbcon;
if("dbcon_old")
return global.dbcon_old;
if("dbcon_don")
return global.dbcon_don;
if("debug_verbs")
Expand Down Expand Up @@ -319,8 +315,6 @@
return global.explosion_turfs;
if("failed_db_connections")
return global.failed_db_connections;
if("failed_old_db_connections")
return global.failed_old_db_connections;
if("file_uid")
return global.file_uid;
if("fileaccess_timer")
Expand Down Expand Up @@ -757,8 +751,6 @@
return global.weighted_mundaneevent_locations;
if("weighted_randomevent_locations")
return global.weighted_randomevent_locations;
if("whitelisted_species")
return global.whitelisted_species;
if("wireColours")
return global.wireColours;
if("world_topic_spam_protect_time")
Expand Down Expand Up @@ -932,8 +924,6 @@
global.air_alarm_topic=newval;
if("air_blocked")
global.air_blocked=newval;
if("alien_whitelist")
global.alien_whitelist=newval;
if("allCasters")
global.allCasters=newval;
if("allConsoles")
Expand Down Expand Up @@ -1046,8 +1036,6 @@
global.damage_icon_parts=newval;
if("dbcon")
global.dbcon=newval;
if("dbcon_old")
global.dbcon_old=newval;
if("dbcon_don")
global.dbcon_don=newval
if("debug_verbs")
Expand Down Expand Up @@ -1096,8 +1084,6 @@
global.explosion_turfs=newval;
if("failed_db_connections")
global.failed_db_connections=newval;
if("failed_old_db_connections")
global.failed_old_db_connections=newval;
if("file_uid")
global.file_uid=newval;
if("fileaccess_timer")
Expand Down Expand Up @@ -1532,8 +1518,6 @@
global.weighted_mundaneevent_locations=newval;
if("weighted_randomevent_locations")
global.weighted_randomevent_locations=newval;
if("whitelisted_species")
global.whitelisted_species=newval;
if("wireColours")
global.wireColours=newval;
if("world_topic_spam_protect_time")
Expand Down Expand Up @@ -1635,7 +1619,6 @@
"ai_verbs_default",
"air_alarm_topic",
"air_blocked",
"alien_whitelist",
"allCasters",
"allConsoles",
"all_grabobjects",
Expand Down Expand Up @@ -1733,7 +1716,6 @@
"explosion_in_progress",
"explosion_turfs",
"failed_db_connections",
"failed_old_db_connections",
"file_uid",
"fileaccess_timer",
"finds_as_strings",
Expand Down Expand Up @@ -2000,8 +1982,6 @@
"wax_recipes",
"weighted_mundaneevent_locations",
"weighted_randomevent_locations",
"whitelist",
"whitelisted_species",
"wireColours",
"world_topic_spam_protect_time",
"worths",
Expand Down
3 changes: 0 additions & 3 deletions code/_helpers/global_lists.dm
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ GLOBAL_LIST_EMPTY(atmos_machinery)
var/global/list/all_species[0]
var/global/list/all_languages[0]
var/global/list/language_keys[0] // Table of say codes for all languages
var/global/list/whitelisted_species = list(SPECIES_HUMAN) // Species that require a whitelist check.
var/global/list/playable_species = list(SPECIES_HUMAN) // A list of ALL playable species, whitelisted, latejoin or otherwise.

var/list/mannequins_
Expand Down Expand Up @@ -240,8 +239,6 @@ var/global/list/string_slot_flags = list(

if(!(S.spawn_flags & SPECIES_IS_RESTRICTED))
playable_species += S.name
if(S.spawn_flags & SPECIES_IS_WHITELISTED)
whitelisted_species += S.name

//Posters
paths = typesof(/datum/poster) - /datum/poster
Expand Down
Loading

0 comments on commit 4742a12

Please sign in to comment.