mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-23 20:16:55 +01:00
Cleans up some awful code from the ticker
This commit is contained in:
@@ -1,35 +1,3 @@
|
||||
/proc/sql_poll_players()
|
||||
if(!config.sql_enabled)
|
||||
return
|
||||
var/playercount = 0
|
||||
for(var/mob/M in GLOB.player_list)
|
||||
if(M.client)
|
||||
playercount += 1
|
||||
establish_db_connection()
|
||||
if(!GLOB.dbcon.IsConnected())
|
||||
log_game("SQL ERROR during player polling. Failed to connect.")
|
||||
else
|
||||
var/sqltime = time2text(world.realtime, "YYYY-MM-DD hh:mm:ss")
|
||||
var/DBQuery/query = GLOB.dbcon.NewQuery("INSERT INTO [format_table_name("legacy_population")] (playercount, time) VALUES ([playercount], '[sqltime]')")
|
||||
if(!query.Execute())
|
||||
var/err = query.ErrorMsg()
|
||||
log_game("SQL ERROR during player polling. Error : \[[err]\]\n")
|
||||
|
||||
|
||||
/proc/sql_poll_admins()
|
||||
if(!config.sql_enabled)
|
||||
return
|
||||
var/admincount = GLOB.admins.len
|
||||
establish_db_connection()
|
||||
if(!GLOB.dbcon.IsConnected())
|
||||
log_game("SQL ERROR during admin polling. Failed to connect.")
|
||||
else
|
||||
var/sqltime = time2text(world.realtime, "YYYY-MM-DD hh:mm:ss")
|
||||
var/DBQuery/query = GLOB.dbcon.NewQuery("INSERT INTO [format_table_name("legacy_population")] (admincount, time) VALUES ([admincount], '[sqltime]')")
|
||||
if(!query.Execute())
|
||||
var/err = query.ErrorMsg()
|
||||
log_game("SQL ERROR during admin polling. Error : \[[err]\]\n")
|
||||
|
||||
/proc/sql_report_round_start()
|
||||
// TODO
|
||||
if(!config.sql_enabled)
|
||||
@@ -110,15 +78,6 @@
|
||||
var/err = query.ErrorMsg()
|
||||
log_game("SQL ERROR during death reporting. Error : \[[err]\]\n")
|
||||
|
||||
/proc/statistic_cycle()
|
||||
if(!config.sql_enabled)
|
||||
return
|
||||
while(1)
|
||||
sql_poll_players()
|
||||
sleep(600)
|
||||
sql_poll_admins()
|
||||
sleep(6000) //Poll every ten minutes
|
||||
|
||||
//This proc is used for feedback. It is executed at round end.
|
||||
/proc/sql_commit_feedback()
|
||||
if(!GLOB.blackbox)
|
||||
|
||||
Reference in New Issue
Block a user