From 0df7ea6f9b3e02c3d68ff0ade75cafb31354c10e Mon Sep 17 00:00:00 2001 From: Verkister Date: Tue, 16 Nov 2021 00:18:24 +0200 Subject: [PATCH] Probably fixes the constant crashing. Attack log query cleanups had had their cleanup part snipped out a while ago, and later sneakily reimplemented as a part of the cleanup subsystem that got untestmerged. Reverts the old guesswork PR that castrated the original attack log query cleanup. --- code/_helpers/mobs.dm | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/code/_helpers/mobs.dm b/code/_helpers/mobs.dm index 225363c884..ae6b5c15f3 100644 --- a/code/_helpers/mobs.dm +++ b/code/_helpers/mobs.dm @@ -121,19 +121,21 @@ Proc for attack log creation, because really why not var/target_str = key_name(target) if(ismob(user)) //CHOMPEdit Begin - //user.attack_log += text("\[[time_stamp()]\] Attacked [target_str]: [what_done]") - //var/DBQuery/query_insert = SSdbcore.NewQuery("INSERT INTO erro_attacklog (id, time, ckey, mob, message) VALUES (null, NOW(), :t_ckey, :t_mob, :t_content)", list("t_ckey" = user.ckey, "t_mob" = user.real_name, "t_content" = "Attacked [target_str]: [what_done]")) - //query_insert.Execute(async=use_async) - //qdel(query_insert) if(SSdbcore.Connect()) - rustg_sql_query_async(SSdbcore.connection, "INSERT INTO erro_attacklog (id, time, ckey, mob, message) VALUES (null, NOW(), :t_ckey, :t_mob, :t_content)", json_encode(list("t_ckey" = user.ckey, "t_mob" = user.real_name, "t_content" = "Attacked [target_str]: [what_done]"))) + user.attack_log += text("\[[time_stamp()]\] Attacked [target_str]: [what_done]") + var/DBQuery/query_insert = SSdbcore.NewQuery("INSERT INTO erro_attacklog (id, time, ckey, mob, message) VALUES (null, NOW(), :t_ckey, :t_mob, :t_content)", list("t_ckey" = user.ckey, "t_mob" = user.real_name, "t_content" = "Attacked [target_str]: [what_done]")) + query_insert.Execute(async=use_async) + qdel(query_insert) + //if(SSdbcore.Connect()) + // rustg_sql_query_async(SSdbcore.connection, "INSERT INTO erro_attacklog (id, time, ckey, mob, message) VALUES (null, NOW(), :t_ckey, :t_mob, :t_content)", json_encode(list("t_ckey" = user.ckey, "t_mob" = user.real_name, "t_content" = "Attacked [target_str]: [what_done]"))) if(ismob(target)) - //target.attack_log += text("\[[time_stamp()]\] Attacked by [user_str]: [what_done]") - //var/DBQuery/query_insert = SSdbcore.NewQuery("INSERT INTO erro_attacklog (id, time, ckey, mob, message) VALUES (null, NOW(), :t_ckey, :t_mob, :t_content)", list("t_ckey" = target.ckey, "t_mob" = target.real_name, "t_content" = "Attacked by [user_str]: [what_done]")) - //query_insert.Execute(async=use_async) - //qdel(query_insert) if(SSdbcore.Connect()) - rustg_sql_query_async(SSdbcore.connection, "INSERT INTO erro_attacklog (id, time, ckey, mob, message) VALUES (null, NOW(), :t_ckey, :t_mob, :t_content)", json_encode(list("t_ckey" = target.ckey, "t_mob" = target.real_name, "t_content" = "Attacked by [user_str]: [what_done]"))) + target.attack_log += text("\[[time_stamp()]\] Attacked by [user_str]: [what_done]") + var/DBQuery/query_insert = SSdbcore.NewQuery("INSERT INTO erro_attacklog (id, time, ckey, mob, message) VALUES (null, NOW(), :t_ckey, :t_mob, :t_content)", list("t_ckey" = target.ckey, "t_mob" = target.real_name, "t_content" = "Attacked by [user_str]: [what_done]")) + query_insert.Execute(async=use_async) + qdel(query_insert) + //if(SSdbcore.Connect()) + // rustg_sql_query_async(SSdbcore.connection, "INSERT INTO erro_attacklog (id, time, ckey, mob, message) VALUES (null, NOW(), :t_ckey, :t_mob, :t_content)", json_encode(list("t_ckey" = target.ckey, "t_mob" = target.real_name, "t_content" = "Attacked by [user_str]: [what_done]"))) //CHOMPEdit End log_attack(user_str,target_str,what_done) if(admin_notify)