"
diff --git a/code/modules/admin/IsBanned.dm b/code/modules/admin/IsBanned.dm
index f00a2339a1..7d9e50d070 100644
--- a/code/modules/admin/IsBanned.dm
+++ b/code/modules/admin/IsBanned.dm
@@ -23,7 +23,7 @@
//Whitelist
if(CONFIG_GET(flag/usewhitelist))
- if(!check_whitelist(ckey(key)))
+ if(!check_whitelist(ckey))
if (admin)
log_admin("The admin [key] has been allowed to bypass the whitelist")
message_admins("The admin [key] has been allowed to bypass the whitelist")
@@ -39,7 +39,7 @@
return list("reason"="guest", "desc"="\nReason: Guests not allowed. Please sign in with a byond account.")
if (CONFIG_GET(flag/panic_bunker) && SSdbcore.Connect())
log_access("Failed Login: [key] - Guests not allowed during panic bunker")
- return list("reason"="guest", "desc"="\nReason: You must first join the Discord to verify your account before joining this server. To do so, read the rules and post a request in the #station-access-requests channel under the \"Main server\" category in the Discord server linked here: https://discord.gg/E6SQuhz")
+ return list("reason"="guest", "desc"="\nReason: Sorry but the server is currently not accepting connections from never before seen players or guests. If you have played on this server with a byond account before, please log in to the byond account you have played from.")
//Population Cap Checking
var/extreme_popcap = CONFIG_GET(number/extreme_popcap)
@@ -50,7 +50,7 @@
if(CONFIG_GET(flag/ban_legacy_system))
//Ban Checking
- . = CheckBan( ckey(key), computer_id, address )
+ . = CheckBan(ckey, computer_id, address )
if(.)
if (admin)
log_admin("The admin [key] has been allowed to bypass a matching ban on [.["key"]]")
@@ -61,11 +61,8 @@
return .
else
-
- var/ckeytext = ckey(key)
-
if(!SSdbcore.Connect())
- var/msg = "Ban database connection failure. Key [ckeytext] not checked"
+ var/msg = "Ban database connection failure. Key [ckey] not checked"
log_world(msg)
message_admins(msg)
return
@@ -78,13 +75,13 @@
if(computer_id)
cidquery = " OR computerid = '[computer_id]' "
- var/datum/DBQuery/query_ban_check = SSdbcore.NewQuery("SELECT ckey, a_ckey, reason, expiration_time, duration, bantime, bantype, id, round_id FROM [format_table_name("ban")] WHERE (ckey = '[ckeytext]' [ipquery] [cidquery]) AND (bantype = 'PERMABAN' OR bantype = 'ADMIN_PERMABAN' OR ((bantype = 'TEMPBAN' OR bantype = 'ADMIN_TEMPBAN') AND expiration_time > Now())) AND isnull(unbanned)")
- if(!query_ban_check.Execute())
+ var/datum/DBQuery/query_ban_check = SSdbcore.NewQuery("SELECT (SELECT byond_key FROM [format_table_name("player")] WHERE [format_table_name("player")].ckey = [format_table_name("ban")].ckey), (SELECT byond_key FROM [format_table_name("player")] WHERE [format_table_name("player")].ckey = [format_table_name("ban")].a_ckey), reason, expiration_time, duration, bantime, bantype, id, round_id FROM [format_table_name("ban")] WHERE (ckey = '[ckey]' [ipquery] [cidquery]) AND (bantype = 'PERMABAN' OR bantype = 'ADMIN_PERMABAN' OR ((bantype = 'TEMPBAN' OR bantype = 'ADMIN_TEMPBAN') AND expiration_time > Now())) AND isnull(unbanned)")
+ if(!query_ban_check.Execute(async = TRUE))
qdel(query_ban_check)
return
while(query_ban_check.NextRow())
- var/pckey = query_ban_check.item[1]
- var/ackey = query_ban_check.item[2]
+ var/pkey = query_ban_check.item[1]
+ var/akey = query_ban_check.item[2]
var/reason = query_ban_check.item[3]
var/expiration = query_ban_check.item[4]
var/duration = query_ban_check.item[5]
@@ -95,16 +92,16 @@
if (bantype == "ADMIN_PERMABAN" || bantype == "ADMIN_TEMPBAN")
//admin bans MUST match on ckey to prevent cid-spoofing attacks
// as well as dynamic ip abuse
- if (pckey != ckey)
+ if (ckey(pkey) != ckey)
continue
if (admin)
if (bantype == "ADMIN_PERMABAN" || bantype == "ADMIN_TEMPBAN")
log_admin("The admin [key] is admin banned (#[banid]), and has been disallowed access")
message_admins("The admin [key] is admin banned (#[banid]), and has been disallowed access")
else
- log_admin("The admin [key] has been allowed to bypass a matching ban on [pckey] (#[banid])")
- message_admins("The admin [key] has been allowed to bypass a matching ban on [pckey] (#[banid])")
- addclientmessage(ckey,"You have been allowed to bypass a matching ban on [pckey] (#[banid])")
+ log_admin("The admin [key] has been allowed to bypass a matching ban on [pkey] (#[banid])")
+ message_admins("The admin [key] has been allowed to bypass a matching ban on [pkey] (#[banid])")
+ addclientmessage(ckey,"You have been allowed to bypass a matching ban on [pkey] (#[banid])")
continue
var/expires = ""
if(text2num(duration) > 0)
@@ -112,7 +109,7 @@
else
expires = " The is a permanent ban."
- var/desc = "\nReason: You, or another user of this computer or connection ([pckey]) is banned from playing here. The ban reason is:\n[reason]\nThis ban (BanID #[banid]) was applied by [ackey] on [bantime] during round ID [ban_round_id], [expires]"
+ var/desc = "\nReason: You, or another user of this computer or connection ([pkey]) is banned from playing here. The ban reason is:\n[reason]\nThis ban (BanID #[banid]) was applied by [akey] on [bantime] during round ID [ban_round_id], [expires]"
. = list("reason"="[bantype]", "desc"="[desc]")
diff --git a/code/modules/admin/NewBan.dm b/code/modules/admin/NewBan.dm
index 1e092a16e9..d81d037c50 100644
--- a/code/modules/admin/NewBan.dm
+++ b/code/modules/admin/NewBan.dm
@@ -98,22 +98,22 @@ GLOBAL_PROTECT(Banlist)
return 1
-/proc/AddBan(ckey, computerid, reason, bannedby, temp, minutes, address)
+/proc/AddBan(key, computerid, reason, bannedby, temp, minutes, address)
var/bantimestamp
-
+ var/ban_ckey = ckey(key)
if (temp)
UpdateTime()
bantimestamp = GLOB.CMinutes + minutes
GLOB.Banlist.cd = "/base"
- if ( GLOB.Banlist.dir.Find("[ckey][computerid]") )
+ if ( GLOB.Banlist.dir.Find("[ban_ckey][computerid]") )
to_chat(usr, text("Ban already exists."))
return 0
else
- GLOB.Banlist.dir.Add("[ckey][computerid]")
- GLOB.Banlist.cd = "/base/[ckey][computerid]"
- WRITE_FILE(GLOB.Banlist["key"], ckey)
+ GLOB.Banlist.dir.Add("[ban_ckey][computerid]")
+ GLOB.Banlist.cd = "/base/[ban_ckey][computerid]"
+ WRITE_FILE(GLOB.Banlist["key"], ban_ckey)
WRITE_FILE(GLOB.Banlist["id"], computerid)
WRITE_FILE(GLOB.Banlist["ip"], address)
WRITE_FILE(GLOB.Banlist["reason"], reason)
@@ -123,9 +123,9 @@ GLOBAL_PROTECT(Banlist)
if (temp)
WRITE_FILE(GLOB.Banlist["minutes"], bantimestamp)
if(!temp)
- create_message("note", ckey, bannedby, "Permanently banned - [reason]", null, null, 0, 0)
+ create_message("note", key, bannedby, "Permanently banned - [reason]", null, null, 0, 0)
else
- create_message("note", ckey, bannedby, "Banned for [minutes] minutes - [reason]", null, null, 0, 0)
+ create_message("note", key, bannedby, "Banned for [minutes] minutes - [reason]", null, null, 0, 0)
return 1
/proc/RemoveBan(foldername)
diff --git a/code/modules/admin/admin.dm b/code/modules/admin/admin.dm
index 3e9c95573f..d280f5040e 100644
--- a/code/modules/admin/admin.dm
+++ b/code/modules/admin/admin.dm
@@ -29,7 +29,7 @@
body += "Options panel for [M]"
if(M.client)
body += " played by [M.client] "
- body += "\[[M.client.holder ? M.client.holder.rank : "Player"]\]"
+ body += "\[[M.client.holder ? M.client.holder.rank : "Player"]\]"
if(CONFIG_GET(flag/use_exp_tracking))
body += "\[" + M.client.get_exp_living() + "\]"
@@ -834,7 +834,7 @@
continue
if(message)
to_chat(C, message)
- kicked_client_names.Add("[C.ckey]")
+ kicked_client_names.Add("[C.key]")
qdel(C)
return kicked_client_names
@@ -863,8 +863,8 @@
tomob.ghostize(0)
- message_admins("[key_name_admin(usr)] has put [frommob.ckey] in control of [tomob.name].")
- log_admin("[key_name(usr)] stuffed [frommob.ckey] into [tomob.name].")
+ message_admins("[key_name_admin(usr)] has put [frommob.key] in control of [tomob.name].")
+ log_admin("[key_name(usr)] stuffed [frommob.key] into [tomob.name].")
SSblackbox.record_feedback("tally", "admin_verb", 1, "Ghost Drag Control")
tomob.ckey = frommob.ckey
diff --git a/code/modules/admin/permissionedit.dm b/code/modules/admin/permissionedit.dm
index ac55eac872..c962aaac41 100644
--- a/code/modules/admin/permissionedit.dm
+++ b/code/modules/admin/permissionedit.dm
@@ -44,29 +44,29 @@
pagecount++
output += "|"
var/limit = " LIMIT [logssperpage * page], [logssperpage]"
- var/datum/DBQuery/query_search_admin_logs = SSdbcore.NewQuery("SELECT datetime, round_id, adminckey, operation, target, log FROM [format_table_name("admin_log")][search] ORDER BY datetime DESC[limit]")
+ var/datum/DBQuery/query_search_admin_logs = SSdbcore.NewQuery("SELECT datetime, round_id, (SELECT byond_key FROM [format_table_name("player")] WHERE ckey = adminckey), operation, IF(ckey IS NULL, target, byond_key), log FROM [format_table_name("admin_log")] LEFT JOIN [format_table_name("player")] ON target = ckey[search] ORDER BY datetime DESC[limit]")
if(!query_search_admin_logs.warn_execute())
qdel(query_search_admin_logs)
return
while(query_search_admin_logs.NextRow())
var/datetime = query_search_admin_logs.item[1]
var/round_id = query_search_admin_logs.item[2]
- var/admin_ckey = query_search_admin_logs.item[3]
+ var/admin_key = query_search_admin_logs.item[3]
operation = query_search_admin_logs.item[4]
target = query_search_admin_logs.item[5]
var/log = query_search_admin_logs.item[6]
- output += "
[datetime] | Round ID [round_id] | Admin [admin_ckey] | Operation [operation] on [target] [log]
"
+ output += "
[datetime] | Round ID [round_id] | Admin [admin_key] | Operation [operation] on [target] [log]
[timestamp] | [server] | [admin_key]")
if(!linkless)
data += " \[Delete\]"
if(type == "note")
data += " [secret ? "\[Secret\]" : "\[Not secret\]"]"
if(type == "message sent")
data += " Message has been sent"
- if(editor_ckey)
+ if(editor_key)
data += "|"
else
data += " \[Edit\]"
- if(editor_ckey)
- data += " Last edit by [editor_ckey] (Click here to see edit log)"
+ if(editor_key)
+ data += " Last edit by [editor_key] (Click here to see edit log)"
data += " [text]
"
@@ -352,7 +365,7 @@
var/output
if(target_ckey)
target_ckey = sanitizeSQL(target_ckey)
- var/query = "SELECT id, adminckey, text, timestamp, lasteditor FROM [format_table_name("messages")] WHERE type = '[type]' AND deleted = 0"
+ var/query = "SELECT id, (SELECT byond_key FROM [format_table_name("player")] WHERE ckey = adminckey), text, timestamp, (SELECT byond_key FROM [format_table_name("player")] WHERE ckey = lasteditor) FROM [format_table_name("messages")] WHERE type = '[type]' AND deleted = 0"
if(type == "message" || type == "watchlist entry")
query += " AND targetckey = '[target_ckey]'"
var/datum/DBQuery/query_get_message_output = SSdbcore.NewQuery(query)
@@ -361,13 +374,13 @@
return
while(query_get_message_output.NextRow())
var/message_id = query_get_message_output.item[1]
- var/admin_ckey = query_get_message_output.item[2]
+ var/admin_key = query_get_message_output.item[2]
var/text = query_get_message_output.item[3]
var/timestamp = query_get_message_output.item[4]
- var/editor_ckey = query_get_message_output.item[5]
+ var/editor_key = query_get_message_output.item[5]
switch(type)
if("message")
- output += "Admin message left by [admin_ckey] on [timestamp]"
+ output += "Admin message left by [admin_key] on [timestamp]"
output += " [text] "
var/datum/DBQuery/query_message_read = SSdbcore.NewQuery("UPDATE [format_table_name("messages")] SET type = 'message sent' WHERE id = [message_id]")
if(!query_message_read.warn_execute())
@@ -379,9 +392,9 @@
message_admins("Notice: [key_name_admin(target_ckey)] has been on the watchlist since [timestamp] and has just connected - Reason: [text]")
send2irc_adminless_only("Watchlist", "[key_name(target_ckey)] is on the watchlist and has just connected - Reason: [text]")
if("memo")
- output += "Memo by [admin_ckey] on [timestamp]"
- if(editor_ckey)
- output += " Last edit by [editor_ckey] (Click here to see edit log)"
+ output += "Memo by [admin_key] on [timestamp]"
+ if(editor_key)
+ output += " Last edit by [editor_key] (Click here to see edit log)"
output += " [text] "
qdel(query_get_message_output)
return output
diff --git a/code/modules/admin/topic.dm b/code/modules/admin/topic.dm
index 7cba469019..745328ab13 100644
--- a/code/modules/admin/topic.dm
+++ b/code/modules/admin/topic.dm
@@ -21,9 +21,9 @@
if(!CheckAdminHref(href, href_list))
return
-
+
citaTopic(href, href_list) //CITADEL EDIT, MENTORS
-
+
if(href_list["ahelp"])
if(!check_rights(R_ADMIN, TRUE))
return
@@ -208,15 +208,14 @@
if(!check_rights(R_BAN))
return
var/bantype = text2num(href_list["dbbanaddtype"])
- var/banckey = href_list["dbbanaddckey"]
+ var/bankey = href_list["dbbanaddkey"]
+ var/banckey = ckey(bankey)
var/banip = href_list["dbbanaddip"]
var/bancid = href_list["dbbanaddcid"]
var/banduration = text2num(href_list["dbbaddduration"])
var/banjob = href_list["dbbanaddjob"]
var/banreason = href_list["dbbanreason"]
- banckey = ckey(banckey)
-
switch(bantype)
if(BANTYPE_PERMA)
if(!banckey || !banreason)
@@ -266,12 +265,12 @@
if(bancid)
banreason = "[banreason] (CUSTOM CID)"
else
- message_admins("Ban process: A mob matching [playermob.ckey] was found at location [playermob.x], [playermob.y], [playermob.z]. Custom ip and computer id fields replaced with the ip and computer id from the located mob.")
+ message_admins("Ban process: A mob matching [playermob.key] was found at location [playermob.x], [playermob.y], [playermob.z]. Custom ip and computer id fields replaced with the ip and computer id from the located mob.")
- if(!DB_ban_record(bantype, playermob, banduration, banreason, banjob, banckey, banip, bancid ))
+ if(!DB_ban_record(bantype, playermob, banduration, banreason, banjob, bankey, banip, bancid ))
to_chat(usr, "Failed to apply ban.")
return
- create_message("note", banckey, null, banreason, null, null, 0, 0)
+ create_message("note", bankey, null, banreason, null, null, 0, 0)
else if(href_list["editrightsbrowser"])
edit_admin_permissions(0)
@@ -281,9 +280,9 @@
if(href_list["editrightsbrowsermanage"])
if(href_list["editrightschange"])
- change_admin_rank(href_list["editrightschange"], TRUE)
+ change_admin_rank(ckey(href_list["editrightschange"]), href_list["editrightschange"], TRUE)
else if(href_list["editrightsremove"])
- remove_admin(href_list["editrightsremove"], TRUE)
+ remove_admin(ckey(href_list["editrightsremove"]), href_list["editrightsremove"], TRUE)
else if(href_list["editrightsremoverank"])
remove_rank(href_list["editrightsremoverank"])
edit_admin_permissions(2)
@@ -593,9 +592,9 @@
if(M.client)
jobban_buildcache(M.client)
message_admins("[key_name_admin(usr)] removed [key_name_admin(M)]'s appearance ban.")
- to_chat(M, "[usr.client.ckey] has removed your appearance ban.")
+ to_chat(M, "[usr.client.key] has removed your appearance ban.")
- else switch(alert("Appearance ban [M.ckey]?",,"Yes","No", "Cancel"))
+ else switch(alert("Appearance ban [M.key]?",,"Yes","No", "Cancel"))
if("Yes")
var/reason = input(usr,"Please State Reason.","Reason") as message|null
if(!reason)
@@ -607,9 +606,9 @@
jobban_buildcache(M.client)
ban_unban_log_save("[key_name(usr)] appearance banned [key_name(M)]. reason: [reason]")
log_admin_private("[key_name(usr)] appearance banned [key_name(M)]. \nReason: [reason]")
- create_message("note", M.ckey, null, "Appearance banned - [reason]", null, null, 0, 0)
+ create_message("note", M.key, null, "Appearance banned - [reason]", null, null, 0, 0)
message_admins("[key_name_admin(usr)] appearance banned [key_name_admin(M)].")
- to_chat(M, "You have been appearance banned by [usr.client.ckey].")
+ to_chat(M, "You have been appearance banned by [usr.client.key].")
to_chat(M, "The reason is: [reason]")
to_chat(M, "Appearance ban can be lifted only upon request.")
var/bran = CONFIG_GET(string/banappeals)
@@ -970,13 +969,13 @@
//Banning comes first
if(notbannedlist.len) //at least 1 unbanned job exists in joblist so we have stuff to ban.
- switch(alert("Temporary Ban for [M.ckey]?",,"Yes","No", "Cancel"))
+ switch(alert("Temporary Ban for [M.key]?",,"Yes","No", "Cancel"))
if("Yes")
var/mins = input(usr,"How long (in minutes)?","Ban time",1440) as num|null
if(mins <= 0)
to_chat(usr, "[mins] is not a valid duration.")
return
- var/reason = input(usr,"Please State Reason For Banning [M.ckey].","Reason") as message|null
+ var/reason = input(usr,"Please State Reason For Banning [M.key].","Reason") as message|null
if(!reason)
return
@@ -993,15 +992,15 @@
msg = job
else
msg += ", [job]"
- create_message("note", M.ckey, null, "Banned from [msg] - [reason]", null, null, 0, 0)
+ create_message("note", M.key, null, "Banned from [msg] - [reason]", null, null, 0, 0)
message_admins("[key_name_admin(usr)] banned [key_name_admin(M)] from [msg] for [mins] minutes.")
- to_chat(M, "You have been [(msg == ("ooc" || "appearance")) ? "banned" : "jobbanned"] by [usr.client.ckey] from: [msg].")
+ to_chat(M, "You have been [(msg == ("ooc" || "appearance")) ? "banned" : "jobbanned"] by [usr.client.key] from: [msg].")
to_chat(M, "The reason is: [reason]")
to_chat(M, "This jobban will be lifted in [mins] minutes.")
href_list["jobban2"] = 1 // lets it fall through and refresh
return 1
if("No")
- var/reason = input(usr,"Please State Reason For Banning [M.ckey].","Reason") as message|null
+ var/reason = input(usr,"Please State Reason For Banning [M.key].","Reason") as message|null
if(reason)
var/msg
for(var/job in notbannedlist)
@@ -1016,9 +1015,9 @@
msg = job
else
msg += ", [job]"
- create_message("note", M.ckey, null, "Banned from [msg] - [reason]", null, null, 0, 0)
+ create_message("note", M.key, null, "Banned from [msg] - [reason]", null, null, 0, 0)
message_admins("[key_name_admin(usr)] banned [key_name_admin(M)] from [msg].")
- to_chat(M, "You have been [(msg == ("ooc" || "appearance")) ? "banned" : "jobbanned"] by [usr.client.ckey] from: [msg].")
+ to_chat(M, "You have been [(msg == ("ooc" || "appearance")) ? "banned" : "jobbanned"] by [usr.client.key] from: [msg].")
to_chat(M, "The reason is: [reason]")
to_chat(M, "Jobban can be lifted only upon request.")
href_list["jobban2"] = 1 // lets it fall through and refresh
@@ -1049,7 +1048,7 @@
continue
if(msg)
message_admins("[key_name_admin(usr)] unbanned [key_name_admin(M)] from [msg].")
- to_chat(M, "You have been un-jobbanned by [usr.client.ckey] from [msg].")
+ to_chat(M, "You have been un-jobbanned by [usr.client.key] from [msg].")
href_list["jobban2"] = 1 // lets it fall through and refresh
return 1
return 0 //we didn't do anything!
@@ -1070,7 +1069,7 @@
if(!M.client)
to_chat(usr, "Error: [M] no longer has a client!")
return
- to_chat(M, "You have been kicked from the server by [usr.client.holder.fakekey ? "an Administrator" : "[usr.client.ckey]"].")
+ to_chat(M, "You have been kicked from the server by [usr.client.holder.fakekey ? "an Administrator" : "[usr.client.key]"].")
log_admin("[key_name(usr)] kicked [key_name(M)].")
message_admins("[key_name_admin(usr)] kicked [key_name_admin(M)].")
qdel(M.client)
@@ -1078,20 +1077,20 @@
else if(href_list["addmessage"])
if(!check_rights(R_ADMIN))
return
- var/target_ckey = href_list["addmessage"]
- create_message("message", target_ckey, secret = 0)
+ var/target_key = href_list["addmessage"]
+ create_message("message", target_key, secret = 0)
else if(href_list["addnote"])
if(!check_rights(R_ADMIN))
return
- var/target_ckey = href_list["addnote"]
- create_message("note", target_ckey)
+ var/target_key = href_list["addnote"]
+ create_message("note", target_key)
else if(href_list["addwatch"])
if(!check_rights(R_ADMIN))
return
- var/target_ckey = href_list["addwatch"]
- create_message("watchlist entry", target_ckey, secret = 1)
+ var/target_key = href_list["addwatch"]
+ create_message("watchlist entry", target_key, secret = 1)
else if(href_list["addmemo"])
if(!check_rights(R_ADMIN))
@@ -1219,13 +1218,13 @@
if(M.client && M.client.holder)
return //admins cannot be banned. Even if they could, the ban doesn't affect them anyway
- switch(alert("Temporary Ban for [M.ckey]?",,"Yes","No", "Cancel"))
+ switch(alert("Temporary Ban for [M.key]?",,"Yes","No", "Cancel"))
if("Yes")
var/mins = input(usr,"How long (in minutes)?","Ban time",1440) as num|null
if(mins <= 0)
to_chat(usr, "[mins] is not a valid duration.")
return
- var/reason = input(usr,"Please State Reason For Banning [M.ckey].","Reason") as message|null
+ var/reason = input(usr,"Please State Reason For Banning [M.key].","Reason") as message|null
if(!reason)
return
if(!DB_ban_record(BANTYPE_TEMP, M, mins, reason))
@@ -1233,14 +1232,14 @@
return
AddBan(M.ckey, M.computer_id, reason, usr.ckey, 1, mins)
ban_unban_log_save("[key_name(usr)] has banned [key_name(M)]. - Reason: [reason] - This will be removed in [mins] minutes.")
- to_chat(M, "You have been banned by [usr.client.ckey].\nReason: [reason]")
+ to_chat(M, "You have been banned by [usr.client.key].\nReason: [reason]")
to_chat(M, "This is a temporary ban, it will be removed in [mins] minutes. The round ID is [GLOB.round_id].")
var/bran = CONFIG_GET(string/banappeals)
if(bran)
to_chat(M, "To try to resolve this matter head to [bran]")
else
to_chat(M, "No ban appeals URL has been set.")
- log_admin_private("[key_name(usr)] has banned [M.ckey].\nReason: [key_name(M)]\nThis will be removed in [mins] minutes.")
+ log_admin_private("[key_name(usr)] has banned [key_name(M)].\nReason: [key_name(M)]\nThis will be removed in [mins] minutes.")
var/msg = "[key_name_admin(usr)] has banned [key_name_admin(M)].\nReason: [reason]\nThis will be removed in [mins] minutes."
message_admins(msg)
var/datum/admin_help/AH = M.client ? M.client.current_ticket : null
@@ -1248,7 +1247,7 @@
AH.Resolve()
qdel(M.client)
if("No")
- var/reason = input(usr,"Please State Reason For Banning [M.ckey].","Reason") as message|null
+ var/reason = input(usr,"Please State Reason For Banning [M.key].","Reason") as message|null
if(!reason)
return
switch(alert(usr,"IP ban?",,"Yes","No","Cancel"))
@@ -1258,7 +1257,7 @@
AddBan(M.ckey, M.computer_id, reason, usr.ckey, 0, 0, M.lastKnownIP)
if("No")
AddBan(M.ckey, M.computer_id, reason, usr.ckey, 0, 0)
- to_chat(M, "You have been banned by [usr.client.ckey].\nReason: [reason]")
+ to_chat(M, "You have been banned by [usr.client.key].\nReason: [reason]")
to_chat(M, "This is a permanent ban. The round ID is [GLOB.round_id].")
var/bran = CONFIG_GET(string/banappeals)
if(bran)
@@ -2351,7 +2350,7 @@
if(alert("Are you sure you want to kick all [afkonly ? "AFK" : ""] clients from the lobby??","Message","Yes","Cancel") != "Yes")
to_chat(usr, "Kick clients from lobby aborted")
return
- var/list/listkicked = kick_clients_in_lobby("You were kicked from the lobby by [usr.client.holder.fakekey ? "an Administrator" : "[usr.client.ckey]"].", afkonly)
+ var/list/listkicked = kick_clients_in_lobby("You were kicked from the lobby by [usr.client.holder.fakekey ? "an Administrator" : "[usr.client.key]"].", afkonly)
var/strkicked = ""
for(var/name in listkicked)
diff --git a/code/modules/admin/verbs/SDQL2/SDQL_2.dm b/code/modules/admin/verbs/SDQL2/SDQL_2.dm
index 54af4b5167..68aafde8b0 100644
--- a/code/modules/admin/verbs/SDQL2/SDQL_2.dm
+++ b/code/modules/admin/verbs/SDQL2/SDQL_2.dm
@@ -21,12 +21,13 @@
/client/proc/SDQL2_query(query_text as message)
set category = "Debug"
if(!check_rights(R_DEBUG)) //Shouldn't happen... but just to be safe.
- message_admins("ERROR: Non-admin [key_name(usr, usr.client)] attempted to execute a SDQL query!")
- log_admin("Non-admin [usr.ckey]([usr]) attempted to execute a SDQL query!")
+ message_admins("ERROR: Non-admin [key_name(usr)] attempted to execute a SDQL query!")
+ log_admin("Non-admin [key_name(usr)] attempted to execute a SDQL query!")
return FALSE
- var/list/results = world.SDQL2_query(query_text, key_name_admin(usr), "[usr.ckey]([usr])")
+ var/list/results = world.SDQL2_query(query_text, key_name_admin(usr), "[key_name(usr)]")
for(var/I in 1 to 3)
to_chat(usr, results[I])
+ SSblackbox.record_feedback("nested tally", "SDQL query", 1, list(ckey, query_text))
/world/proc/SDQL2_query(query_text, log_entry1, log_entry2)
var/query_log = "executed SDQL query: \"[query_text]\"."
diff --git a/code/modules/admin/verbs/adminhelp.dm b/code/modules/admin/verbs/adminhelp.dm
index bef39c29ca..03d58c8e90 100644
--- a/code/modules/admin/verbs/adminhelp.dm
+++ b/code/modules/admin/verbs/adminhelp.dm
@@ -398,7 +398,7 @@ GLOBAL_DATUM_INIT(ahelp_tickets, /datum/admin_help_tickets, new)
message_admins(msg)
log_admin_private(msg)
AddInteraction("Being handled by [key_name]")
-
+
//Show the ticket panel
/datum/admin_help/proc/TicketPanel()
var/list/dat = list("Ticket #[id]")
@@ -686,7 +686,7 @@ GLOBAL_DATUM_INIT(ahelp_tickets, /datum/admin_help_tickets, new)
var/is_antag = 0
if(found.mind && found.mind.special_role)
is_antag = 1
- founds += "Name: [found.name]([found.real_name]) Ckey: [found.ckey] [is_antag ? "(Antag)" : null] "
+ founds += "Name: [found.name]([found.real_name]) Ckey: [found.key] [is_antag ? "(Antag)" : null] "
msg += "[original_word](?|F) "
continue
msg += "[original_word] "
diff --git a/code/modules/admin/verbs/debug.dm b/code/modules/admin/verbs/debug.dm
index d34e1ebd42..4ba3c94711 100644
--- a/code/modules/admin/verbs/debug.dm
+++ b/code/modules/admin/verbs/debug.dm
@@ -494,7 +494,7 @@ GLOBAL_PROTECT(AdminProcCallSpamPrevention)
set desc = "Direct intervention"
if(M.ckey)
- if(alert("This mob is being controlled by [M.ckey]. Are you sure you wish to assume control of it? [M.ckey] will be made a ghost.",,"Yes","No") != "Yes")
+ if(alert("This mob is being controlled by [M.key]. Are you sure you wish to assume control of it? [M.key] will be made a ghost.",,"Yes","No") != "Yes")
return
else
var/mob/dead/observer/ghost = new/mob/dead/observer(M,1)
diff --git a/code/modules/admin/verbs/mapping.dm b/code/modules/admin/verbs/mapping.dm
index 8c8b599862..f2df21c988 100644
--- a/code/modules/admin/verbs/mapping.dm
+++ b/code/modules/admin/verbs/mapping.dm
@@ -264,9 +264,9 @@ GLOBAL_VAR_INIT(say_disabled, FALSE)
GLOB.say_disabled = !GLOB.say_disabled
if(GLOB.say_disabled)
- message_admins("[src.ckey] used 'Disable all communication verbs', killing all communication methods.")
+ message_admins("[key] used 'Disable all communication verbs', killing all communication methods.")
else
- message_admins("[src.ckey] used 'Disable all communication verbs', restoring all communication methods.")
+ message_admins("[key] used 'Disable all communication verbs', restoring all communication methods.")
//This generates the icon states for job starting location landmarks.
/client/proc/create_mapping_job_icons()
diff --git a/code/modules/assembly/doorcontrol.dm b/code/modules/assembly/doorcontrol.dm
index 6780f23677..51b0be95b6 100644
--- a/code/modules/assembly/doorcontrol.dm
+++ b/code/modules/assembly/doorcontrol.dm
@@ -55,7 +55,7 @@
if(specialfunctions & SHOCK)
if(D.secondsElectrified)
D.secondsElectrified = -1
- LAZYADD(D.shockedby, "\[[time_stamp()]\][usr](ckey:[usr.ckey])")
+ LAZYADD(D.shockedby, "\[[time_stamp()]\] [key_name(usr)]")
add_logs(usr, D, "electrified")
else
D.secondsElectrified = 0
diff --git a/code/modules/client/client_procs.dm b/code/modules/client/client_procs.dm
index 5399aa375e..60a1f6c589 100644
--- a/code/modules/client/client_procs.dm
+++ b/code/modules/client/client_procs.dm
@@ -360,6 +360,7 @@ GLOBAL_LIST_EMPTY(external_rsc_urls)
send2irc_adminless_only("new_byond_user", "[key_name(src)] (IP: [address], ID: [computer_id]) is a new BYOND account [account_age] day[(account_age==1?"":"s")] old, created on [account_join_date].")
get_message_output("watchlist entry", ckey)
check_ip_intel()
+ validate_key_in_db()
send_resources()
@@ -507,7 +508,8 @@ GLOBAL_LIST_EMPTY(external_rsc_urls)
new_player = 1
account_join_date = sanitizeSQL(findJoinDate())
- var/datum/DBQuery/query_add_player = SSdbcore.NewQuery("INSERT INTO [format_table_name("player")] (`ckey`, `firstseen`, `firstseen_round_id`, `lastseen`, `lastseen_round_id`, `ip`, `computerid`, `lastadminrank`, `accountjoindate`) VALUES ('[sql_ckey]', Now(), '[GLOB.round_id]', Now(), '[GLOB.round_id]', INET_ATON('[sql_ip]'), '[sql_computerid]', '[sql_admin_rank]', [account_join_date ? "'[account_join_date]'" : "NULL"])")
+ var/sql_key = sanitizeSQL(key)
+ var/datum/DBQuery/query_add_player = SSdbcore.NewQuery("INSERT INTO [format_table_name("player")] (`ckey`, `byond_key`, `firstseen`, `firstseen_round_id`, `lastseen`, `lastseen_round_id`, `ip`, `computerid`, `lastadminrank`, `accountjoindate`) VALUES ('[sql_ckey]', '[sql_key]', Now(), '[GLOB.round_id]', Now(), '[GLOB.round_id]', INET_ATON('[sql_ip]'), '[sql_computerid]', '[sql_admin_rank]', [account_join_date ? "'[account_join_date]'" : "NULL"])")
if(!query_add_player.Execute())
qdel(query_client_in_db)
qdel(query_add_player)
@@ -558,7 +560,7 @@ GLOBAL_LIST_EMPTY(external_rsc_urls)
/client/proc/findJoinDate()
var/list/http = world.Export("http://byond.com/members/[ckey]?format=text")
if(!http)
- log_world("Failed to connect to byond age check for [ckey]")
+ log_world("Failed to connect to byond member page to age check [ckey]")
return
var/F = file2text(http["CONTENT"])
if(F)
@@ -568,6 +570,33 @@ GLOBAL_LIST_EMPTY(external_rsc_urls)
else
CRASH("Age check regex failed for [src.ckey]")
+/client/proc/validate_key_in_db()
+ var/sql_ckey = sanitizeSQL(ckey)
+ var/sql_key
+ var/datum/DBQuery/query_check_byond_key = SSdbcore.NewQuery("SELECT byond_key FROM [format_table_name("player")] WHERE ckey = '[sql_ckey]'")
+ if(!query_check_byond_key.Execute())
+ qdel(query_check_byond_key)
+ return
+ if(query_check_byond_key.NextRow())
+ sql_key = query_check_byond_key.item[1]
+ qdel(query_check_byond_key)
+ if(key != sql_key)
+ var/list/http = world.Export("http://byond.com/members/[ckey]?format=text")
+ if(!http)
+ log_world("Failed to connect to byond member page to get changed key for [ckey]")
+ return
+ var/F = file2text(http["CONTENT"])
+ if(F)
+ var/regex/R = regex("\\tkey = \"(.+)\"")
+ if(R.Find(F))
+ var/web_key = sanitizeSQL(R.group[1])
+ var/datum/DBQuery/query_update_byond_key = SSdbcore.NewQuery("UPDATE [format_table_name("player")] SET byond_key = '[web_key]' WHERE ckey = '[sql_ckey]'")
+ query_update_byond_key.Execute()
+ qdel(query_update_byond_key)
+ else
+ CRASH("Key check regex failed for [ckey]")
+
+
/client/proc/check_randomizer(topic)
. = FALSE
if (connection != "seeker")
@@ -676,7 +705,7 @@ GLOBAL_LIST_EMPTY(external_rsc_urls)
qdel(query_get_notes)
return
qdel(query_get_notes)
- create_message("note", ckey, system_ckey, message, null, null, 0, 0)
+ create_message("note", key, system_ckey, message, null, null, 0, 0)
/client/proc/check_ip_intel()
diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm
index 088c75a1b5..239a574d94 100644
--- a/code/modules/client/preferences.dm
+++ b/code/modules/client/preferences.dm
@@ -372,7 +372,7 @@ GLOBAL_LIST_EMPTY(preferences_datums)
dat += ""
-
+
if(CONFIG_GET(flag/join_with_mutant_humans))
@@ -525,7 +525,7 @@ GLOBAL_LIST_EMPTY(preferences_datums)
else
dat += "Be [capitalize(i)]:[(i in be_special) ? "Yes" : "No"] "
dat += "
"
- dat += "
Citadel Preferences
" //Because fuck me if preferences can't be fucking modularized and expected to update in a reasonable timeframe.
+ dat += "
Citadel Preferences
" //Because fuck me if preferences can't be fucking modularized and expected to update in a reasonable timeframe.
dat += "Arousal:[arousable == TRUE ? "Enabled" : "Disabled"] "
dat += "Exhibitionist:[features["exhibitionist"] == TRUE ? "Yes" : "No"] "
dat += "Allow MediHound sleeper:[(cit_toggles & MEDIHOUND_SLEEPER) ? "Yes" : "No"] "
@@ -939,7 +939,7 @@ GLOBAL_LIST_EMPTY(preferences_datums)
if(href_list["jobbancheck"])
var/job = sanitizeSQL(href_list["jobbancheck"])
var/sql_ckey = sanitizeSQL(user.ckey)
- var/datum/DBQuery/query_get_jobban = SSdbcore.NewQuery("SELECT reason, bantime, duration, expiration_time, a_ckey FROM [format_table_name("ban")] WHERE ckey = '[sql_ckey]' AND (bantype = 'JOB_PERMABAN' OR (bantype = 'JOB_TEMPBAN' AND expiration_time > Now())) AND isnull(unbanned) AND job = '[job]'")
+ var/datum/DBQuery/query_get_jobban = SSdbcore.NewQuery("SELECT reason, bantime, duration, expiration_time, (SELECT byond_key FROM [format_table_name("player")] WHERE [format_table_name("player")].ckey = [format_table_name("ban")].a_ckey) FROM [format_table_name("ban")] WHERE ckey = '[sql_ckey]' AND (bantype = 'JOB_PERMABAN' OR (bantype = 'JOB_TEMPBAN' AND expiration_time > Now())) AND isnull(unbanned) AND job = '[job]'")
if(!query_get_jobban.warn_execute())
return
if(query_get_jobban.NextRow())
@@ -947,9 +947,9 @@ GLOBAL_LIST_EMPTY(preferences_datums)
var/bantime = query_get_jobban.item[2]
var/duration = query_get_jobban.item[3]
var/expiration_time = query_get_jobban.item[4]
- var/a_ckey = query_get_jobban.item[5]
+ var/admin_key = query_get_jobban.item[5]
var/text
- text = "You, or another user of this computer, ([user.ckey]) is banned from playing [job]. The ban reason is: [reason] This ban was applied by [a_ckey] on [bantime]"
+ text = "You, or another user of this computer, ([user.key]) is banned from playing [job]. The ban reason is: [reason] This ban was applied by [admin_key] on [bantime]"
if(text2num(duration) > 0)
text += ". The ban is for [duration] minutes and expires on [expiration_time] (server time)"
text += "."
@@ -1223,7 +1223,7 @@ GLOBAL_LIST_EMPTY(preferences_datums)
var/new_tail
new_tail = input(user, "Choose your character's tail:", "Character Preference") as null|anything in GLOB.tails_list_human
if(new_tail)
- features["tail_human"] = new_tail
+ features["tail_human"] = new_tail
if("snout")
var/new_snout
@@ -1413,9 +1413,9 @@ GLOBAL_LIST_EMPTY(preferences_datums)
if("balls_internal")
features["balls_internal"] = !features["balls_internal"]
if("eggsack_internal")
- features["eggsack_internal"] = !features["eggsack_internal"]
+ features["eggsack_internal"] = !features["eggsack_internal"]
if("has_breasts")
- features["has_breasts"] = !features["has_breasts"]
+ features["has_breasts"] = !features["has_breasts"]
if("has_vag")
features["has_vag"] = !features["has_vag"]
if("has_womb")
diff --git a/code/modules/library/lib_machines.dm b/code/modules/library/lib_machines.dm
index 81e296e4c8..5f686699d2 100644
--- a/code/modules/library/lib_machines.dm
+++ b/code/modules/library/lib_machines.dm
@@ -422,8 +422,9 @@ GLOBAL_LIST(cachedbooks) // List of our cached book datums
var/sqlauthor = sanitizeSQL(scanner.cache.author)
var/sqlcontent = sanitizeSQL(scanner.cache.dat)
var/sqlcategory = sanitizeSQL(upload_category)
+ var/sqlckey = sanitizeSQL(usr.ckey)
var/msg = "[key_name(usr)] has uploaded the book titled [scanner.cache.name], [length(scanner.cache.dat)] signs"
- var/datum/DBQuery/query_library_upload = SSdbcore.NewQuery("INSERT INTO [format_table_name("library")] (author, title, content, category, ckey, datetime, round_id_created) VALUES ('[sqlauthor]', '[sqltitle]', '[sqlcontent]', '[sqlcategory]', '[usr.ckey]', Now(), '[GLOB.round_id]')")
+ var/datum/DBQuery/query_library_upload = SSdbcore.NewQuery("INSERT INTO [format_table_name("library")] (author, title, content, category, ckey, datetime, round_id_created) VALUES ('[sqlauthor]', '[sqltitle]', '[sqlcontent]', '[sqlcategory], '[sqlckey]', Now(), '[GLOB.round_id]')")
if(!query_library_upload.Execute())
qdel(query_library_upload)
alert("Database error encountered uploading to Archive")
diff --git a/code/modules/mob/dead/new_player/poll.dm b/code/modules/mob/dead/new_player/poll.dm
index 388f63961b..5ac1b4adb5 100644
--- a/code/modules/mob/dead/new_player/poll.dm
+++ b/code/modules/mob/dead/new_player/poll.dm
@@ -375,9 +375,9 @@
if (!usr || !src)
return 0
//we gots ourselfs a dirty cheater on our hands!
- log_game("[key_name(usr)] attempted to rig the vote by voting as [ckey]")
- message_admins("[key_name_admin(usr)] attempted to rig the vote by voting as [ckey]")
- to_chat(usr, "You don't seem to be [ckey].")
+ log_game("[key_name(usr)] attempted to rig the vote by voting as [key]")
+ message_admins("[key_name_admin(usr)] attempted to rig the vote by voting as [key]")
+ to_chat(usr, "You don't seem to be [key].")
to_chat(src, "Something went horribly wrong processing your vote. Please contact an administrator, they should have gotten a message about this")
return 0
return 1
@@ -579,7 +579,7 @@
return 1
var/i
if(query_multi_choicelen.NextRow())
- i = text2num(query_multi_choicelen.item[1])
+ i = text2num(query_multi_choicelen.item[1])
qdel(query_multi_choicelen)
var/datum/DBQuery/query_multi_hasvoted = SSdbcore.NewQuery("SELECT id FROM [format_table_name("poll_vote")] WHERE pollid = [pollid] AND ckey = '[ckey]'")
if(!query_multi_hasvoted.warn_execute())
diff --git a/code/modules/projectiles/guns/misc/blastcannon.dm b/code/modules/projectiles/guns/misc/blastcannon.dm
index df1f9fdfbd..6c685ebe89 100644
--- a/code/modules/projectiles/guns/misc/blastcannon.dm
+++ b/code/modules/projectiles/guns/misc/blastcannon.dm
@@ -102,9 +102,8 @@
playsound(user, "explosion", 100, 1)
var/turf/starting = get_turf(user)
var/turf/targturf = get_turf(target)
- var/log_str = "Blast wave fired from [ADMIN_VERBOSEJMP(starting)] ([get_area_name(user, TRUE)]) at [ADMIN_VERBOSEJMP(targturf)] ([target.name]) by [user.name]([user.ckey]) with power [heavy]/[medium]/[light]."
- message_admins(log_str)
- log_game(log_str)
+ message_admins("Blast wave fired from [ADMIN_VERBOSEJMP(starting)] at [ADMIN_VERBOSEJMP(targturf)] ([target.name]) by [key_name_admin(user)] with power [heavy]/[medium]/[light].")
+ log_game("Blast wave fired from [AREACOORD(starting)] at [AREACOORD(targturf)] ([target.name]) by [key_name(user)] with power [heavy]/[medium]/[light].")
var/obj/item/projectile/blastwave/BW = new(loc, heavy, medium, light)
BW.hugbox = hugbox
BW.preparePixelProjectile(target, get_turf(src), params, 0)
@@ -158,4 +157,4 @@
lightr = max(lightr - 1, 0)
/obj/item/projectile/blastwave/ex_act()
- return
\ No newline at end of file
+ return
diff --git a/code/modules/reagents/reagent_containers/syringes.dm b/code/modules/reagents/reagent_containers/syringes.dm
index 2159302ce9..64ef740278 100644
--- a/code/modules/reagents/reagent_containers/syringes.dm
+++ b/code/modules/reagents/reagent_containers/syringes.dm
@@ -142,7 +142,7 @@
if(L != user)
add_logs(user, L, "injected", src, addition="which had [contained]")
else
- log_attack("[user.name] ([user.ckey]) injected [L.name] ([L.ckey]) with [src.name], which had [contained] (INTENT: [uppertext(user.a_intent)])")
+ log_attack("[key_name(user)] injected [key_name(L)] with [src.name], which had [contained] (INTENT: [uppertext(user.a_intent)])")
L.log_message("Injected themselves ([contained]) with [src.name].", INDIVIDUAL_ATTACK_LOG)
var/fraction = min(amount_per_transfer_from_this/reagents.total_volume, 1)