From ecd9121e60b3106b0ac9ebe69d8c9b40af9c437b Mon Sep 17 00:00:00 2001 From: Lzimann Date: Sat, 6 May 2017 21:20:36 -0300 Subject: [PATCH] Shows the actual date instead of number of days for byond/player age in player panel --- code/modules/admin/admin.dm | 2 +- code/modules/client/client_defines.dm | 1 + code/modules/client/client_procs.dm | 9 +++++---- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/code/modules/admin/admin.dm b/code/modules/admin/admin.dm index 13f7c799a5b..dd6eb90c6f6 100644 --- a/code/modules/admin/admin.dm +++ b/code/modules/admin/admin.dm @@ -38,7 +38,7 @@ body += " \[Heal\] " if(M.client) - body += "
\[Player Age: [M.client.player_age]\]\[Byond Age: [M.client.account_age]\]" + body += "
\[Player Age: [M.client.player_join_date]\]\[Byond Age: [M.client.account_join_date]\]" body += "

\[ " diff --git a/code/modules/client/client_defines.dm b/code/modules/client/client_defines.dm index 05db74f859c..a4de2086895 100644 --- a/code/modules/client/client_defines.dm +++ b/code/modules/client/client_defines.dm @@ -40,6 +40,7 @@ //things that require the database// //////////////////////////////////// var/player_age = -1 //Used to determine how old the account is - in days. + var/player_join_date = null //Date that this account was first seen in the server var/related_accounts_ip = "Requires database" //So admins know why it isn't working - Used to determine what other accounts previously logged in from this ip var/related_accounts_cid = "Requires database" //So admins know why it isn't working - Used to determine what other accounts previously logged in from this computer id var/account_join_date = null //Date of byond account creation in ISO 8601 format diff --git a/code/modules/client/client_procs.dm b/code/modules/client/client_procs.dm index 1859909cf09..bb8ccea1379 100644 --- a/code/modules/client/client_procs.dm +++ b/code/modules/client/client_procs.dm @@ -409,14 +409,15 @@ GLOBAL_LIST(external_rsc_urls) if(!account_join_date) account_join_date = "Error" account_age = -1 - var/datum/DBQuery/query_get_client_age = SSdbcore.NewQuery("SELECT DATEDIFF(Now(),firstseen), accountjoindate, DATEDIFF(Now(),accountjoindate) FROM [format_table_name("player")] WHERE ckey = '[sql_ckey]'") + var/datum/DBQuery/query_get_client_age = SSdbcore.NewQuery("SELECT firstseen, DATEDIFF(Now(),firstseen), accountjoindate, DATEDIFF(Now(),accountjoindate) FROM [format_table_name("player")] WHERE ckey = '[sql_ckey]'") if(!query_get_client_age.Execute()) return if(query_get_client_age.NextRow()) - player_age = text2num(query_get_client_age.item[1]) + player_join_date = query_get_client_age.item[1] + player_age = text2num(query_get_client_age.item[2]) if(!account_join_date) - account_join_date = query_get_client_age.item[2] - account_age = text2num(query_get_client_age.item[3]) + account_join_date = query_get_client_age.item[3] + account_age = text2num(query_get_client_age.item[4]) if(!account_age) account_join_date = sanitizeSQL(findJoinDate()) if(!account_join_date)