Moves pAI saves to the DB

This commit is contained in:
AffectedArc07
2021-10-04 19:15:53 +01:00
parent 2aa0abde72
commit c358a20498
12 changed files with 273 additions and 114 deletions
+3
View File
@@ -114,6 +114,9 @@
/// Is the client watchlisted
var/watchlisted = FALSE
/// Client's pAI save
var/datum/pai_save/pai_save
/client/vv_edit_var(var_name, var_value)
switch(var_name)
// I know we will never be in a world where admins are editing client vars to let people bypass TOS
+3
View File
@@ -287,6 +287,8 @@
log_client_to_db(tdata) // Make sure our client exists in the DB
pai_save = new(src)
// This is where we load all of the clients stuff from the DB
if(SSdbcore.IsConnected())
// Load in all our client data from the DB
@@ -449,6 +451,7 @@
GLOB.directory -= ckey
GLOB.clients -= src
QDEL_NULL(chatOutput)
QDEL_NULL(pai_save)
if(movingmob)
movingmob.client_mobs_in_contents -= mob
UNSETEMPTY(movingmob.client_mobs_in_contents)
@@ -0,0 +1,8 @@
/datum/client_login_processor/pai_save
priority = 40
/datum/client_login_processor/pai_save/get_query(client/C)
return C.pai_save.get_query()
/datum/client_login_processor/pai_save/process_result(datum/db_query/Q, client/C)
C.pai_save.load_data(Q)