mirror of
https://github.com/Aurorastation/Aurora-Old.git
synced 2026-08-30 16:16:17 +01:00
Merge pull request #330 from skull132/development
Skull's Fixes, 24DEC2014
This commit is contained in:
@@ -15,7 +15,6 @@ proc/sql_poll_players()
|
||||
var/err = query.ErrorMsg()
|
||||
log_game("SQL ERROR during player polling. Error : \[[err]\]\n")
|
||||
|
||||
|
||||
proc/sql_poll_admins()
|
||||
if(!sqllogging)
|
||||
return
|
||||
@@ -30,6 +29,31 @@ proc/sql_poll_admins()
|
||||
var/err = query.ErrorMsg()
|
||||
log_game("SQL ERROR during admin polling. Error : \[[err]\]\n")
|
||||
|
||||
//////////////////////////////////////////
|
||||
//Skull here, can someone explain to me why these are two different procs?
|
||||
//Constructing a table with it rigged lie this is terrible, absoloutely terrible. The null values leave empty holes :l
|
||||
//Sooo, let's do this. Merge them!
|
||||
//Leaving them here for posterity's sake.
|
||||
//////////////////////////////////////////
|
||||
|
||||
proc/sql_poll_population()
|
||||
if(!sqllogging)
|
||||
return
|
||||
var/playercount = 0
|
||||
for(var/mob/M in player_list)
|
||||
if(M.client)
|
||||
playercount += 1
|
||||
var/admincount = admins.len
|
||||
establish_db_connection()
|
||||
if(!dbcon.IsConnected())
|
||||
log_game("SQL ERROR during population polling. Failed to connect.")
|
||||
else
|
||||
var/sqltime = time2text(world.realtime, "YYYY-MM-DD hh:mm:ss")
|
||||
var/DBQuery/query = dbcon_old.NewQuery("INSERT INTO population (playercount, admincount, time) VALUES ([playercount], [admincount], '[sqltime]')")
|
||||
if(!query.Execute())
|
||||
var/err = query.ErrorMsg()
|
||||
log_game("SQL ERROR during population polling. Error: \[[err]\]\n")
|
||||
|
||||
proc/sql_report_round_start()
|
||||
// TODO
|
||||
if(!sqllogging)
|
||||
@@ -116,9 +140,7 @@ proc/statistic_cycle()
|
||||
if(!sqllogging)
|
||||
return
|
||||
while(1)
|
||||
sql_poll_players()
|
||||
sleep(600)
|
||||
sql_poll_admins()
|
||||
sql_poll_population()
|
||||
sleep(6000) // Poll every ten minutes
|
||||
|
||||
//This proc is used for feedback. It is executed at round end.
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 14 KiB |
Reference in New Issue
Block a user