diff --git a/code/_helpers/logging.dm b/code/_helpers/logging.dm
index 3bef9b4f15..154349c217 100644
--- a/code/_helpers/logging.dm
+++ b/code/_helpers/logging.dm
@@ -67,43 +67,77 @@
//Log the message to in-game dialogue logs, as well.
if(speaker.client)
- speaker.dialogue_log += "([time_stamp()]) ([speaker]/[speaker.client]) SAY: - [text]"
- GLOB.round_text_log += "([time_stamp()]) ([speaker]/[speaker.client]) SAY: - [text]"
+ //speaker.dialogue_log += "([time_stamp()]) ([speaker]/[speaker.client]) SAY: - [text]"
+ if(!dbcon.IsConnected())
+ establish_db_connection()
+ if(!dbcon.IsConnected())
+ return null
+ var/DBQuery/query_insert = dbcon.NewQuery("INSERT INTO erro_dialog (mid, time, ckey, mob, type, message) VALUES (null, Now(), '[speaker.ckey]', '[speaker.real_name]', 'say', '[html_decode(text)]')")
+ query_insert.Execute()
+ //GLOB.round_text_log += "([time_stamp()]) ([speaker]/[speaker.client]) SAY: - [text]"
/proc/log_ooc(text, client/user)
if (config.log_ooc)
WRITE_LOG(diary, "OOC: [user.simple_info_line()]: [html_decode(text)]")
-
- GLOB.round_text_log += "([time_stamp()]) ([user]) OOC: - [text]"
+ if(!dbcon.IsConnected())
+ establish_db_connection()
+ if(!dbcon.IsConnected())
+ return null
+ var/DBQuery/query_insert = dbcon.NewQuery("INSERT INTO erro_dialog (mid, time, ckey, mob, type, message) VALUES (null, Now(), '[user.ckey]', '[user.mob.real_name]', 'ooc', '[html_decode(text)]')")
+ query_insert.Execute()
+ //GLOB.round_text_log += "([time_stamp()]) ([user]) OOC: - [text]"
/proc/log_aooc(text, client/user)
if (config.log_ooc)
WRITE_LOG(diary, "AOOC: [user.simple_info_line()]: [html_decode(text)]")
-
- GLOB.round_text_log += "([time_stamp()]) ([user]) AOOC: - [text]"
+ if(!dbcon.IsConnected())
+ establish_db_connection()
+ if(!dbcon.IsConnected())
+ return null
+ var/DBQuery/query_insert =dbcon.NewQuery("INSERT INTO erro_dialog (mid, time, ckey, mob, type, message) VALUES (null, Now(), '[user.ckey]', '[user.mob.real_name]', 'aooc', '[html_decode(text)]')")
+ query_insert.Execute()
+ //GLOB.round_text_log += "([time_stamp()]) ([user]) AOOC: - [text]"
/proc/log_looc(text, client/user)
if (config.log_ooc)
WRITE_LOG(diary, "LOOC: [user.simple_info_line()]: [html_decode(text)]")
-
- GLOB.round_text_log += "([time_stamp()]) ([user]) LOOC: - [text]"
+ if(!dbcon.IsConnected())
+ establish_db_connection()
+ if(!dbcon.IsConnected())
+ return null
+ var/DBQuery/query_insert = dbcon.NewQuery("INSERT INTO erro_dialog (mid, time, ckey, mob, type, message) VALUES (null, Now(), '[user.ckey]', '[user.mob.real_name]', 'looc', '[html_decode(text)]')")
+ query_insert.Execute()
+ //GLOB.round_text_log += "([time_stamp()]) ([user]) LOOC: - [text]"
/proc/log_whisper(text, mob/speaker)
if (config.log_whisper)
WRITE_LOG(diary, "WHISPER: [speaker.simple_info_line()]: [html_decode(text)]")
if(speaker.client)
- speaker.dialogue_log += "([time_stamp()]) ([speaker]/[speaker.client]) SAY: - [text]"
- GLOB.round_text_log += "([time_stamp()]) ([speaker]/[speaker.client]) SAY: - [text]"
+ //speaker.dialogue_log += "([time_stamp()]) ([speaker]/[speaker.client]) SAY: - [text]"
+ //GLOB.round_text_log += "([time_stamp()]) ([speaker]/[speaker.client]) SAY: - [text]"
+ if(!dbcon.IsConnected())
+ establish_db_connection()
+ if(!dbcon.IsConnected())
+ return null
+ var/DBQuery/query_insert = dbcon.NewQuery("INSERT INTO erro_dialog (mid, time, ckey, mob, type, message) VALUES (null, Now(), '[speaker.ckey]', '[speaker.real_name]', 'whisper', '[html_decode(text)]')")
+ query_insert.Execute()
/proc/log_emote(text, mob/speaker)
if (config.log_emote)
WRITE_LOG(diary, "EMOTE: [speaker.simple_info_line()]: [html_decode(text)]")
-
+ //CHOMPEdit Begin
if(speaker.client)
- speaker.dialogue_log += "([time_stamp()]) ([speaker]/[speaker.client]) EMOTE: - [text]"
- GLOB.round_text_log += "([time_stamp()]) ([speaker]/[speaker.client]) EMOTE: - [text]"
+ //speaker.dialogue_log += "([time_stamp()]) ([speaker]/[speaker.client]) EMOTE: - [text]"
+ //GLOB.round_text_log += "([time_stamp()]) ([speaker]/[speaker.client]) EMOTE: - [text]"
+ if(!dbcon.IsConnected())
+ establish_db_connection()
+ if(!dbcon.IsConnected())
+ return null
+ var/DBQuery/query_insert = dbcon.NewQuery("INSERT INTO erro_dialog (mid, time, ckey, mob, type, message) VALUES (null, Now(), '[speaker.ckey]', '[speaker.real_name]', 'emote', '[html_decode(text)]')")
+ query_insert.Execute()
+ //CHOMPEdit End
/proc/log_attack(attacker, defender, message)
if (config.log_attack)
@@ -124,14 +158,30 @@
/proc/log_ghostsay(text, mob/speaker)
if (config.log_say)
WRITE_LOG(diary, "DEADCHAT: [speaker.simple_info_line()]: [html_decode(text)]")
-
- speaker.dialogue_log += "([time_stamp()]) ([speaker]/[speaker.client]) DEADSAY: - [text]"
- GLOB.round_text_log += "([time_stamp()]) ([src]/[speaker.client]) DEADSAY: - [text]"
-
+ //CHOMPEdit Begin
+ if(speaker.client)
+ if(!dbcon.IsConnected())
+ establish_db_connection()
+ if(!dbcon.IsConnected())
+ return null
+ var/DBQuery/query_insert = dbcon.NewQuery("INSERT INTO erro_dialog (mid, time, ckey, mob, type, message) VALUES (null, Now(), '[speaker.ckey]', '[speaker.real_name]', 'deadsay', '[html_decode(text)]')")
+ query_insert.Execute()
+ //speaker.dialogue_log += "([time_stamp()]) ([speaker]/[speaker.client]) DEADSAY: - [text]"
+ //GLOB.round_text_log += "([time_stamp()]) ([src]/[speaker.client]) DEADSAY: - [text]"
+ //CHOMPEdit End
/proc/log_ghostemote(text, mob/speaker)
if (config.log_emote)
WRITE_LOG(diary, "DEADEMOTE: [speaker.simple_info_line()]: [html_decode(text)]")
+ //CHOMPEdit Begin
+ if(speaker.client)
+ if(!dbcon.IsConnected())
+ establish_db_connection()
+ if(!dbcon.IsConnected())
+ return null
+ var/DBQuery/query_insert = dbcon.NewQuery("INSERT INTO erro_dialog (mid, time, ckey, mob, type, message) VALUES (null, Now(), '[speaker.ckey]', '[speaker.real_name]', 'deademote', '[html_decode(text)]')")
+ query_insert.Execute()
+ //CHOMPEdit End
/proc/log_adminwarn(text)
if (config.log_adminwarn)
@@ -140,10 +190,18 @@
/proc/log_pda(text, mob/speaker)
if (config.log_pda)
WRITE_LOG(diary, "PDA: [speaker.simple_info_line()]: [html_decode(text)]")
+ //CHOMPEdit Begin
+ if(speaker.client)
+ if(!dbcon.IsConnected())
+ establish_db_connection()
+ if(!dbcon.IsConnected())
+ return null
+ var/DBQuery/query_insert = dbcon.NewQuery("INSERT INTO erro_dialog (mid, time, ckey, mob, type, message) VALUES (null, Now(), '[speaker.ckey]', '[speaker.real_name]', 'pda', '[html_decode(text)]')")
+ query_insert.Execute()
- speaker.dialogue_log += "([time_stamp()]) ([speaker]/[speaker.client]) MSG: - [text]"
- GLOB.round_text_log += "([time_stamp()]) ([speaker]/[speaker.client]) MSG: - [text]"
-
+ //speaker.dialogue_log += "([time_stamp()]) ([speaker]/[speaker.client]) MSG: - [text]"
+ //GLOB.round_text_log += "([time_stamp()]) ([speaker]/[speaker.client]) MSG: - [text]"
+ //CHOMPEdit End
/proc/log_to_dd(text)
to_world_log(text) //this comes before the config check because it can't possibly runtime
diff --git a/code/_helpers/logging_vr.dm b/code/_helpers/logging_vr.dm
index aa117125dc..0b4b2a447c 100644
--- a/code/_helpers/logging_vr.dm
+++ b/code/_helpers/logging_vr.dm
@@ -1,11 +1,38 @@
/proc/log_nsay(text, inside, mob/speaker)
if (config.log_say)
WRITE_LOG(diary, "NSAY (NIF:[inside]): [speaker.simple_info_line()]: [html_decode(text)]")
+ //CHOMPEdit Begin
+ if(speaker.client)
+ if(!dbcon.IsConnected())
+ establish_db_connection()
+ if(!dbcon.IsConnected())
+ return null
+ var/DBQuery/query_insert = dbcon.NewQuery("INSERT INTO erro_dialog (mid, time, ckey, mob, type, message) VALUES (null, Now(), '[speaker.ckey]', '[speaker.real_name]', 'nsay', '[html_decode(text)]')")
+ query_insert.ErrorMsg()
+ //CHOMPEdit End
/proc/log_nme(text, inside, mob/speaker)
if (config.log_emote)
WRITE_LOG(diary, "NME (NIF:[inside]): [speaker.simple_info_line()]: [html_decode(text)]")
+ //CHOMPEdit Begin
+ if(speaker.client)
+ if(!dbcon.IsConnected())
+ establish_db_connection()
+ if(!dbcon.IsConnected())
+ return null
+ var/DBQuery/query_insert = dbcon.NewQuery("INSERT INTO erro_dialog (mid, time, ckey, mob, type, message) VALUES (null, Now(), '[speaker.ckey]', '[speaker.real_name]', 'nme', '[html_decode(text)]')")
+ query_insert.Execute()
+ //CHOMPEdit End
/proc/log_subtle(text, mob/speaker)
if (config.log_emote)
WRITE_LOG(diary, "SUBTLE: [speaker.simple_info_line()]: [html_decode(text)]")
+ //CHOMPEdit Begin
+ if(speaker.client)
+ if(!dbcon.IsConnected())
+ establish_db_connection()
+ if(!dbcon.IsConnected())
+ return null
+ var/DBQuery/query_insert = dbcon.NewQuery("INSERT INTO erro_dialog (mid, time, ckey, mob, type, message) VALUES (null, Now(), '[speaker.ckey]', '[speaker.real_name]', 'subtle', '[html_decode(text)]')")
+ query_insert.Execute()
+ //CHOMPEdit End
diff --git a/code/game/world.dm b/code/game/world.dm
index 5c5eaff9e5..45ca1567e1 100644
--- a/code/game/world.dm
+++ b/code/game/world.dm
@@ -588,6 +588,15 @@ proc/setup_database_connection()
. = dbcon.IsConnected()
if ( . )
failed_db_connections = 0 //If this connection succeeded, reset the failed connections counter.
+ //CHOMPEdit Begin
+ var/DBQuery/query_truncate = dbcon.NewQuery("TRUNCATE erro_dialog")
+ var/num_tries = 0
+ while(!query_truncate.Execute() && num_tries<5)
+ num_tries++
+
+ if(num_tries==5)
+ log_admin("ERROR TRYING TO CLEAR erro_dialog")
+ //CHOMPEdit End
else
failed_db_connections++ //If it failed, increase the failed connections counter.
to_world_log(dbcon.ErrorMsg())
diff --git a/code/modules/admin/admin_tools.dm b/code/modules/admin/admin_tools.dm
index 8b4e1ae44c..c1b5eb8dc6 100644
--- a/code/modules/admin/admin_tools.dm
+++ b/code/modules/admin/admin_tools.dm
@@ -41,15 +41,25 @@
dat += "Current Antag?: [(M.mind.special_role)?"Yes":"No"]
"
dat += "
Note: This is arranged from earliest to latest.
"
- if(!isemptylist(M.dialogue_log))
- dat += "