Porting TG's SQL

This commit is contained in:
Cadyn
2021-01-25 23:37:49 -08:00
parent b379c65606
commit 76ed115e37
24 changed files with 545 additions and 174 deletions

View File

@@ -346,10 +346,10 @@ var/obj/machinery/blackbox_recorder/blackbox
round_end_data_gathering() //round_end time logging and some other data processing
establish_db_connection()
if(!dbcon.IsConnected()) return
if(!SSdbcore.IsConnected()) return //CHOMPEdit TGSQL
var/round_id
var/DBQuery/query = dbcon.NewQuery("SELECT MAX(round_id) AS round_id FROM erro_feedback")
var/DBQuery/query = SSdbcore.NewQuery("SELECT MAX(round_id) AS round_id FROM erro_feedback") //CHOMPEdit TGSQL
query.Execute()
while(query.NextRow())
round_id = query.item[1]
@@ -360,7 +360,7 @@ var/obj/machinery/blackbox_recorder/blackbox
for(var/datum/feedback_variable/FV in feedback)
var/sql = "INSERT INTO erro_feedback VALUES (null, Now(), [round_id], \"[FV.get_variable()]\", [FV.get_value()], \"[FV.get_details()]\")"
var/DBQuery/query_insert = dbcon.NewQuery(sql)
var/DBQuery/query_insert = SSdbcore.NewQuery(sql) //CHOMPEdit TGSQL
query_insert.Execute()
// Sanitize inputs to avoid SQL injection attacks