mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 02:34:00 +00:00
Merge remote-tracking branch 'upstream/dev-freeze' into dev
Conflicts: code/game/objects/items/stacks/tiles/plasteel.dm code/game/objects/items/stacks/tiles/tile_types.dm code/modules/materials/materials.dm code/modules/mob/living/carbon/human/life.dm code/modules/mob/living/silicon/pai/pai.dm code/modules/surgery/implant.dm code/setup.dm
This commit is contained in:
@@ -178,6 +178,25 @@
|
||||
return ..()
|
||||
|
||||
|
||||
// here because it's similar to below
|
||||
|
||||
// Returns null if no DB connection can be established, or -1 if the requested key was not found in the database
|
||||
|
||||
/proc/get_player_age(key)
|
||||
establish_db_connection()
|
||||
if(!dbcon.IsConnected())
|
||||
return null
|
||||
|
||||
var/sql_ckey = sql_sanitize_text(ckey(key))
|
||||
|
||||
var/DBQuery/query = dbcon.NewQuery("SELECT datediff(Now(),firstseen) as age FROM erro_player WHERE ckey = '[sql_ckey]'")
|
||||
query.Execute()
|
||||
|
||||
if(query.NextRow())
|
||||
return text2num(query.item[1])
|
||||
else
|
||||
return -1
|
||||
|
||||
|
||||
/client/proc/log_client_to_db()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user