Adds additional logging to figure out what causes NULL job entries in the db (#5494)

Adds additional logging to figure out what causes NULL job entries in the db
Adds logging of the alt_titles the chars join with.
This commit is contained in:
Werner
2018-11-01 10:42:48 +01:00
committed by Erki
parent 7e2fdf2013
commit 2447da3d6e
2 changed files with 11 additions and 2 deletions
+5 -2
View File
@@ -458,8 +458,11 @@ datum/preferences
if (!config.sql_saves || !config.sql_stats || !establish_db_connection(dbcon) || !H)
return
var/DBQuery/query = dbcon.NewQuery("INSERT INTO ss13_characters_log (char_id, game_id, datetime, job_name, special_role) VALUES (:char_id:, :game_id:, NOW(), :job:, :special_role:)")
query.Execute(list("char_id" = current_character, "game_id" = game_id, "job" = H.mind.assigned_role, "special_role" = H.mind.special_role))
if(!H.mind.assigned_role)
log_debug("Char-Log: Char [current_character] - [H.name] has joined with mind.assigned_role set to NULL")
var/DBQuery/query = dbcon.NewQuery("INSERT INTO ss13_characters_log (char_id, game_id, datetime, job_name, special_role, alt_title) VALUES (:char_id:, :game_id:, NOW(), :job:, :special_role:, :alt_title:)")
query.Execute(list("char_id" = current_character, "game_id" = game_id, "job" = H.mind.assigned_role, "special_role" = H.mind.special_role, "alt_title" = H.mind.role_alt_title))
// Turned into a proc so we could reuse it for SQL shenanigans.
/datum/preferences/proc/new_setup(var/re_initialize = 0)