mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-22 12:29:46 +01:00
Pass 1
This commit is contained in:
@@ -117,11 +117,21 @@
|
||||
/datum/category_group/player_setup_category/proc/load_character(var/savefile/S)
|
||||
// Load all data, then sanitize it.
|
||||
// Need due to, for example, the 01_basic module relying on species having been loaded to sanitize correctly but that isn't loaded until module 03_body.
|
||||
for(var/datum/category_item/player_setup_item/PI in items)
|
||||
PI.load_character(S)
|
||||
if (!config.sql_saves && !establish_db_connection(dbcon))
|
||||
for(var/datum/category_item/player_setup_item/PI in items)
|
||||
PI.load_character(S)
|
||||
else
|
||||
src.load_character_sql()
|
||||
for(var/datum/category_item/player_setup_item/PI in items)
|
||||
PI.sanitize_character()
|
||||
|
||||
/datum/category_group/player_setup_category/proc/load_character_sql()
|
||||
var/static/list/query_cache = list()
|
||||
if (isnull(query_cache[type]))
|
||||
var/query = "FROM ss13_characters"
|
||||
for (var/datum/category_item/player_setup_item/PI in items)
|
||||
|
||||
|
||||
/datum/category_group/player_setup_category/proc/save_character(var/savefile/S)
|
||||
// Sanitize all data, then save it
|
||||
for(var/datum/category_item/player_setup_item/PI in items)
|
||||
|
||||
@@ -1,35 +0,0 @@
|
||||
/*
|
||||
* These procs manage the calling of savefile or SQL oriented save and load procs for characters and preference data.
|
||||
* This way of doing it is necessary for migration to be possible without a huge load of hacks.
|
||||
* Will also ensure in neat and modular compatibility between the two systems, and the potential introduction of further systems.
|
||||
*/
|
||||
|
||||
/datum/preferences/proc/handle_preferences_load(var/client/C)
|
||||
// if (config.sql_saves)
|
||||
// return load_preferences_sql(C)
|
||||
// else
|
||||
return load_preferences()
|
||||
|
||||
/datum/preferences/proc/handle_preferences_save(var/client/C)
|
||||
// if (config.sql_saves)
|
||||
// return save_preferences_sql(C)
|
||||
// else
|
||||
return save_preferences()
|
||||
|
||||
/datum/preferences/proc/handle_character_load(var/slot = 0, var/client/C)
|
||||
// if (config.sql_saves)
|
||||
// return load_character_sql(slot, C)
|
||||
// else
|
||||
return load_character(slot)
|
||||
|
||||
/datum/preferences/proc/handle_character_save(var/client/C)
|
||||
// if (config.sql_saves)
|
||||
// return save_character_sql(C)
|
||||
// else
|
||||
return save_character()
|
||||
|
||||
/datum/preferences/proc/get_default_character()
|
||||
// if (config.sql_saves)
|
||||
// return current_character
|
||||
// else
|
||||
return default_slot
|
||||
Reference in New Issue
Block a user