- Makes it so that log_client_to_db is called before mob/Login()
- Makes it so can_vote() doesn't runtime if the player_age isn't a number
This commit is contained in:
monster860
2017-04-04 18:50:24 -04:00
parent f23cf99031
commit 7d0f5cb400
2 changed files with 4 additions and 3 deletions
+3 -2
View File
@@ -389,7 +389,6 @@
prefs.last_ip = address //these are gonna be used for banning
prefs.last_id = computer_id //these are gonna be used for banning
. = ..() //calls mob.Login()
spawn() // Goonchat does some non-instant checks in start()
chatOutput.start()
@@ -416,6 +415,8 @@
winset(src, null, "command=\".configure graphics-hwmode on\"")
log_client_to_db(tdata)
. = ..() //calls mob.Login()
if(ckey in clientmessages)
for(var/message in clientmessages[ckey])
@@ -487,7 +488,7 @@
var/DBQuery/query = dbcon.NewQuery("SELECT id, datediff(Now(),firstseen) as age FROM [format_table_name("player")] WHERE ckey = '[ckey]'")
query.Execute()
var/sql_id = 0
player_age = 0 // New players won't have an entry so knowing we have a connection we set this to zero to be updated if their is a record.
player_age = 0 // New players won't have an entry so knowing we have a connection we set this to zero to be updated if there is a record.
while(query.NextRow())
sql_id = query.item[1]
player_age = text2num(query.item[2])
+1 -1
View File
@@ -8,7 +8,7 @@
handle_player_polling()
/client/proc/can_vote()
return player_age >= 30
return istext(player_age) || player_age >= 30
/client/proc/handle_player_polling()
establish_db_connection()