Merge branch 'master' into admin_interact

This commit is contained in:
Mark van Alphen
2017-02-18 15:41:16 +01:00
committed by GitHub
248 changed files with 5406 additions and 1928 deletions
+18 -2
View File
@@ -335,6 +335,7 @@
world.update_status()
if(holder)
on_holder_add()
add_admin_verbs()
admin_memo_output("Show", 0, 1)
@@ -408,10 +409,12 @@
if(IsGuestKey(key))
return
establish_db_connection()
if(!dbcon.IsConnected())
return
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
@@ -421,6 +424,7 @@
player_age = text2num(query.item[2])
break
var/DBQuery/query_ip = dbcon.NewQuery("SELECT ckey FROM [format_table_name("player")] WHERE ip = '[address]'")
query_ip.Execute()
related_accounts_ip = list()
@@ -428,6 +432,7 @@
if(ckey != query_ip.item[1])
related_accounts_ip.Add("[query_ip.item[1]]")
var/DBQuery/query_cid = dbcon.NewQuery("SELECT ckey FROM [format_table_name("player")] WHERE computerid = '[computer_id]'")
query_cid.Execute()
related_accounts_cid = list()
@@ -435,6 +440,7 @@
if(ckey != query_cid.item[1])
related_accounts_cid.Add("[query_cid.item[1]]")
var/admin_rank = "Player"
if(holder)
admin_rank = holder.rank
@@ -443,15 +449,18 @@
if(check_randomizer(connectiontopic))
return
//Log all the alts
if(related_accounts_cid.len)
log_access("Alts: [key_name(src)]:[jointext(related_accounts_cid, " - ")]")
var/watchreason = check_watchlist(ckey)
if(watchreason)
message_admins("<font color='red'><B>Notice: </B></font><font color='blue'>[key_name_admin(src)] is on the watchlist and has just connected - Reason: [watchreason]</font>")
send2irc(config.admin_notify_irc, "Watchlist - [key_name(src)] is on the watchlist and has just connected - Reason: [watchreason]")
//Just the standard check to see if it's actually a number
if(sql_id)
if(istext(sql_id))
@@ -467,17 +476,24 @@
if(sql_id)
//Player already identified previously, we need to just update the 'lastseen', 'ip' and 'computer_id' variables
var/DBQuery/query_update = dbcon.NewQuery("UPDATE [format_table_name("player")] SET lastseen = Now(), ip = '[sql_ip]', computerid = '[sql_computerid]', lastadminrank = '[sql_admin_rank]' WHERE id = [sql_id]")
query_update.Execute()
if(!query_update.Execute())
var/err = query_update.ErrorMsg()
log_game("SQL ERROR during log_client_to_db (update). Error : \[[err]\]\n")
message_admins("SQL ERROR during log_client_to_db (update). Error : \[[err]\]\n")
else
//New player!! Need to insert all the stuff
var/DBQuery/query_insert = dbcon.NewQuery("INSERT INTO [format_table_name("player")] (id, ckey, firstseen, lastseen, ip, computerid, lastadminrank) VALUES (null, '[ckey]', Now(), Now(), '[sql_ip]', '[sql_computerid]', '[sql_admin_rank]')")
query_insert.Execute()
if(!query_insert.Execute())
var/err = query_insert.ErrorMsg()
log_game("SQL ERROR during log_client_to_db (insert). Error : \[[err]\]\n")
message_admins("SQL ERROR during log_client_to_db (insert). Error : \[[err]\]\n")
//Logging player access
var/serverip = "[world.internet_address]:[world.port]"
var/DBQuery/query_accesslog = dbcon.NewQuery("INSERT INTO `[format_table_name("connection_log")]`(`id`,`datetime`,`serverip`,`ckey`,`ip`,`computerid`) VALUES(null,Now(),'[serverip]','[ckey]','[sql_ip]','[sql_computerid]');")
query_accesslog.Execute()
#undef TOPIC_SPAM_DELAY
#undef UPLOAD_LIMIT
#undef MIN_CLIENT_VERSION
@@ -95,6 +95,8 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts
var/UI_style_alpha = 255
var/windowflashing = TRUE
//ghostly preferences
var/ghost_anonsay = 0
//character preferences
var/real_name //our character's name
@@ -283,6 +285,8 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts
dat += "<b>Species:</b> <a href='?_src_=prefs;preference=species;task=input'>[species]</a><br>"
if(species == "Vox")
dat += "<b>N2 Tank:</b> <a href='?_src_=prefs;preference=speciesprefs;task=input'>[speciesprefs ? "Large N2 Tank" : "Specialized N2 Tank"]</a><br>"
if(species == "Grey")
dat += "<b>Voice:</b> <a href ='?_src_=prefs;preference=speciesprefs;task=input'>[speciesprefs ? "Wingdings" : "Normal"]</a><BR>"
dat += "<b>Secondary Language:</b> <a href='?_src_=prefs;preference=language;task=input'>[language]</a><br>"
dat += "<b>Blood Type:</b> <a href='?_src_=prefs;preference=b_type;task=input'>[b_type]</a><br>"
if(species in list("Human", "Drask", "Vox"))
@@ -444,6 +448,7 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts
dat += "<b>Ghost ears:</b> <a href='?_src_=prefs;preference=ghost_ears'><b>[(toggles & CHAT_GHOSTEARS) ? "Nearest Creatures" : "All Speech"]</b></a><br>"
dat += "<b>Ghost sight:</b> <a href='?_src_=prefs;preference=ghost_sight'><b>[(toggles & CHAT_GHOSTSIGHT) ? "Nearest Creatures" : "All Emotes"]</b></a><br>"
dat += "<b>Ghost radio:</b> <a href='?_src_=prefs;preference=ghost_radio'><b>[(toggles & CHAT_GHOSTRADIO) ? "Nearest Speakers" : "All Chatter"]</b></a><br>"
dat += "<b>Deadchat anonymity:</b> <a href='?_src_=prefs;preference=ghost_anonsay'><b>[ghost_anonsay ? "Anonymous" : "Not Anonymous"]</b></a><br>"
dat += "</td><td width='300px' height='300px' valign='top'>"
dat += "<h2>Special Role Settings</h2>"
@@ -1334,6 +1339,7 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts
b_skin = 0
alt_head = "None" //No alt heads on species that don't have them.
speciesprefs = 0 //My Vox tank shouldn't change how my future Grey talks.
body_accessory = null //no vulptail on humans damnit
@@ -1994,6 +2000,9 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts
if("ghost_radio")
toggles ^= CHAT_GHOSTRADIO
if("ghost_anonsay")
ghost_anonsay = !ghost_anonsay
if("save")
save_preferences(user)
save_character(user)
@@ -2040,6 +2049,7 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts
character.add_language(language)
character.real_name = real_name
character.dna.real_name = real_name
character.name = character.real_name
@@ -14,8 +14,9 @@
nanoui_fancy,
show_ghostitem_attack,
lastchangelog,
exp,
windowflashing
windowflashing,
ghost_anonsay,
exp
FROM [format_table_name("player")]
WHERE ckey='[C.ckey]'"}
)
@@ -42,8 +43,9 @@
nanoui_fancy = text2num(query.item[11])
show_ghostitem_attack = text2num(query.item[12])
lastchangelog = query.item[13]
exp = query.item[14]
windowflashing = text2num(query.item[15])
windowflashing = text2num(query.item[14])
ghost_anonsay = text2num(query.item[15])
exp = query.item[16]
//Sanitize
ooccolor = sanitize_hexcolor(ooccolor, initial(ooccolor))
@@ -58,8 +60,9 @@
nanoui_fancy = sanitize_integer(nanoui_fancy, 0, 1, initial(nanoui_fancy))
show_ghostitem_attack = sanitize_integer(show_ghostitem_attack, 0, 1, initial(show_ghostitem_attack))
lastchangelog = sanitize_text(lastchangelog, initial(lastchangelog))
exp = sanitize_text(exp, initial(exp))
windowflashing = sanitize_integer(windowflashing, 0, 1, initial(windowflashing))
ghost_anonsay = sanitize_integer(ghost_anonsay, 0, 1, initial(ghost_anonsay))
exp = sanitize_text(exp, initial(exp))
return 1
/datum/preferences/proc/save_preferences(client/C)
@@ -84,7 +87,9 @@
volume='[volume]',
nanoui_fancy='[nanoui_fancy]',
show_ghostitem_attack='[show_ghostitem_attack]',
lastchangelog='[lastchangelog]'
lastchangelog='[lastchangelog]',
windowflashing='[windowflashing]',
ghost_anonsay='[ghost_anonsay]'
WHERE ckey='[C.ckey]'"}
)