diff --git a/code/modules/admin/db_ban/functions.dm b/code/modules/admin/db_ban/functions.dm index 7d42d900578..029b80de4d2 100644 --- a/code/modules/admin/db_ban/functions.dm +++ b/code/modules/admin/db_ban/functions.dm @@ -61,8 +61,8 @@ var/computerid var/ip - if(ismob(banned_mob) && banned_mob.ckey) - ckey = banned_mob.ckey + if(ismob(banned_mob) && banned_mob.last_known_ckey) + ckey = banned_mob.last_known_ckey if(banned_mob.client) computerid = banned_mob.client.computer_id ip = banned_mob.client.address @@ -496,7 +496,7 @@ output += "" output += "" output += "Reason:

" - output += " Auto populate CID & IP for online players
" + output += " Auto populate CID & IP for players seen this round
" output += "" output += "" diff --git a/code/modules/admin/topic.dm b/code/modules/admin/topic.dm index 5781dd6254a..cc8b859095c 100644 --- a/code/modules/admin/topic.dm +++ b/code/modules/admin/topic.dm @@ -153,10 +153,13 @@ var/mob/playermob if("autopopulate" in href_list) - for(var/mob/M in GLOB.player_list) + for(var/mob/M in GLOB.mob_list) if(M.ckey == banckey) playermob = M break + else if(M.last_known_ckey == banckey) + playermob = M + // ... but do not break, so we prefer current ckeys. banreason = "(MANUAL BAN) "+banreason @@ -166,7 +169,7 @@ 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.last_known_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") if(job_ban) if(banjob in list("commanddept","securitydept","engineeringdept","medicaldept","sciencedept","servicedept","supplydept","nonhumandept")) @@ -444,7 +447,7 @@ to_chat(usr, "This can only be used on instances of type /mob") return - if(!M.ckey) //sanity + if(!M.last_known_ckey) //sanity to_chat(usr, "This mob has no ckey") return if(!SSjobs) @@ -465,17 +468,17 @@ //Regular jobs //Command (Blue) jobs += "" - jobs += "" + jobs += "" for(var/jobPos in GLOB.command_positions) if(!jobPos) continue var/datum/job/job = SSjobs.GetJob(jobPos) if(!job) continue if(jobban_isbanned(M, job.title)) - jobs += "" + jobs += "" counter++ else - jobs += "" + jobs += "" counter++ if(counter >= 6) //So things dont get squiiiiished! @@ -486,17 +489,17 @@ //Security (Red) counter = 0 jobs += "
Command Positions
Command Positions
[replacetext(job.title, " ", " ")][replacetext(job.title, " ", " ")][replacetext(job.title, " ", " ")][replacetext(job.title, " ", " ")]
" - jobs += "" + jobs += "" for(var/jobPos in GLOB.security_positions) if(!jobPos) continue var/datum/job/job = SSjobs.GetJob(jobPos) if(!job) continue if(jobban_isbanned(M, job.title)) - jobs += "" + jobs += "" counter++ else - jobs += "" + jobs += "" counter++ if(counter >= 5) //So things dont get squiiiiished! @@ -507,17 +510,17 @@ //Engineering (Yellow) counter = 0 jobs += "
Security Positions
Security Positions
[replacetext(job.title, " ", " ")][replacetext(job.title, " ", " ")][replacetext(job.title, " ", " ")][replacetext(job.title, " ", " ")]
" - jobs += "" + jobs += "" for(var/jobPos in GLOB.engineering_positions) if(!jobPos) continue var/datum/job/job = SSjobs.GetJob(jobPos) if(!job) continue if(jobban_isbanned(M, job.title)) - jobs += "" + jobs += "" counter++ else - jobs += "" + jobs += "" counter++ if(counter >= 5) //So things dont get squiiiiished! @@ -528,17 +531,17 @@ //Medical (White) counter = 0 jobs += "
Engineering Positions
Engineering Positions
[replacetext(job.title, " ", " ")][replacetext(job.title, " ", " ")][replacetext(job.title, " ", " ")][replacetext(job.title, " ", " ")]
" - jobs += "" + jobs += "" for(var/jobPos in GLOB.medical_positions) if(!jobPos) continue var/datum/job/job = SSjobs.GetJob(jobPos) if(!job) continue if(jobban_isbanned(M, job.title)) - jobs += "" + jobs += "" counter++ else - jobs += "" + jobs += "" counter++ if(counter >= 5) //So things dont get squiiiiished! @@ -549,17 +552,17 @@ //Science (Purple) counter = 0 jobs += "
Medical Positions
Medical Positions
[replacetext(job.title, " ", " ")][replacetext(job.title, " ", " ")][replacetext(job.title, " ", " ")][replacetext(job.title, " ", " ")]
" - jobs += "" + jobs += "" for(var/jobPos in GLOB.science_positions) if(!jobPos) continue var/datum/job/job = SSjobs.GetJob(jobPos) if(!job) continue if(jobban_isbanned(M, job.title)) - jobs += "" + jobs += "" counter++ else - jobs += "" + jobs += "" counter++ if(counter >= 5) //So things dont get squiiiiished! @@ -570,17 +573,17 @@ //Service (Grey) counter = 0 jobs += "
Science Positions
Science Positions
[replacetext(job.title, " ", " ")][replacetext(job.title, " ", " ")][replacetext(job.title, " ", " ")][replacetext(job.title, " ", " ")]
" - jobs += "" + jobs += "" for(var/jobPos in GLOB.service_positions) if(!jobPos) continue var/datum/job/job = SSjobs.GetJob(jobPos) if(!job) continue if(jobban_isbanned(M, job.title)) - jobs += "" + jobs += "" counter++ else - jobs += "" + jobs += "" counter++ if(counter >= 5) //So things dont get squiiiiished! @@ -591,17 +594,17 @@ //Supply (Brown) counter = 0 jobs += "
Service Positions
Service Positions
[replacetext(job.title, " ", " ")][replacetext(job.title, " ", " ")][replacetext(job.title, " ", " ")][replacetext(job.title, " ", " ")]
" - jobs += "" + jobs += "" for(var/jobPos in GLOB.supply_positions) if(!jobPos) continue var/datum/job/job = SSjobs.GetJob(jobPos) if(!job) continue if(jobban_isbanned(M, job.title)) - jobs += "" + jobs += "" counter++ else - jobs += "" + jobs += "" counter++ if(counter >= 5) //So things dont get squiiiiished! @@ -612,17 +615,17 @@ //Non-Human (Green) counter = 0 jobs += "
Supply Positions
Supply Positions
[replacetext(job.title, " ", " ")][replacetext(job.title, " ", " ")][replacetext(job.title, " ", " ")][replacetext(job.title, " ", " ")]
" - jobs += "" + jobs += "" for(var/jobPos in GLOB.nonhuman_positions) if(!jobPos) continue var/datum/job/job = SSjobs.GetJob(jobPos) if(!job) continue if(jobban_isbanned(M, job.title)) - jobs += "" + jobs += "" counter++ else - jobs += "" + jobs += "" counter++ if(counter >= 5) //So things dont get squiiiiished! @@ -631,29 +634,29 @@ //Drone if(jobban_isbanned(M, "Drone")) - jobs += "" + jobs += "" else - jobs += "" + jobs += "" //pAI if(jobban_isbanned(M, "pAI")) - jobs += "" + jobs += "" else - jobs += "" + jobs += "" jobs += "
Non-human Positions
Non-human Positions
[replacetext(job.title, " ", " ")][replacetext(job.title, " ", " ")][replacetext(job.title, " ", " ")][replacetext(job.title, " ", " ")]DroneDroneDroneDronepAIpAIpAIpAI
" //Antagonist (Orange) var/isbanned_dept = jobban_isbanned(M, "Syndicate") jobs += "" - jobs += "" + jobs += "" counter = 0 for(var/role in GLOB.antag_roles) if(jobban_isbanned(M, role) || isbanned_dept) - jobs += "" + jobs += "" else - jobs += "" + jobs += "" counter++ if(counter >= 5) //So things dont get squiiiiished! @@ -668,9 +671,9 @@ counter = 0 for(var/role in GLOB.other_roles) if(jobban_isbanned(M, role) || isbanned_dept) - jobs += "" + jobs += "" else - jobs += "" + jobs += "" counter++ if(counter >= 5) //So things dont get squiiiiished! @@ -766,7 +769,7 @@ //Banning comes first if(length(notbannedlist)) //at least 1 unbanned job exists in joblist so we have stuff to ban. - switch(alert("Temporary Ban of [M.ckey]?", null,"Yes","No", "Cancel")) + switch(alert("Temporary Ban of [M.last_known_ckey]?", null,"Yes","No", "Cancel")) if("Yes") var/mins = input(usr,"How long (in minutes)?","Ban time",1440) as num|null if(!mins) @@ -784,7 +787,7 @@ msg = job else msg += ", [job]" - add_note(M.ckey, "Banned from [msg] - [reason]", null, usr.ckey, 0) + add_note(M.last_known_ckey, "Banned from [msg] - [reason]", null, usr.ckey, 0) message_admins("[key_name_admin(usr)] banned [key_name_admin(M)] from [msg] for [mins] minutes", 1) // Reload their job ban holder (refresh this round) @@ -807,7 +810,7 @@ msg = job else msg += ", [job]" - add_note(M.ckey, "Banned from [msg] - [reason]", null, usr.ckey, 0) + add_note(M.last_known_ckey, "Banned from [msg] - [reason]", null, usr.ckey, 0) message_admins("[key_name_admin(usr)] banned [key_name_admin(M)] from [msg]", 1) // Reload their job ban holder (refresh this round) @@ -912,7 +915,7 @@ return var/ban_ckey_param = href_list["dbbanaddckey"] - switch(alert("Temporary Ban of [M.ckey] / [ban_ckey_param]?", null,"Yes","No", "Cancel")) + switch(alert("Temporary Ban of [M.last_known_ckey] / [ban_ckey_param]?", null,"Yes","No", "Cancel")) if("Yes") var/mins = input(usr,"How long (in minutes)?","Ban time",1440) as num|null if(!mins) @@ -925,15 +928,15 @@ to_chat(M, "You have been banned by [usr.client.ckey].\nReason: [reason].") to_chat(M, "This is a temporary ban, it will be removed in [mins] minutes.") DB_ban_record(BANTYPE_TEMP, M, mins, reason) - add_note(M.ckey, "Banned for [mins] minutes - [reason]", null, usr.ckey, FALSE) + add_note(M.last_known_ckey, "Banned for [mins] minutes - [reason]", null, usr.ckey, FALSE) if(M.client) M.client.link_forum_account(TRUE) if(GLOB.configuration.url.banappeals_url) to_chat(M, "To try to resolve this matter head to [GLOB.configuration.url.banappeals_url]") else to_chat(M, "No ban appeals URL has been set.") - log_admin("[key_name(usr)] has banned [M.ckey].\nReason: [reason]\nThis will be removed in [mins] minutes.") - message_admins("[key_name_admin(usr)] has banned [M.ckey].\nReason: [reason]\nThis will be removed in [mins] minutes.") + log_admin("[key_name(usr)] has banned [M.last_known_ckey].\nReason: [reason]\nThis will be removed in [mins] minutes.") + message_admins("[key_name_admin(usr)] has banned [M.last_known_ckey].\nReason: [reason]\nThis will be removed in [mins] minutes.") qdel(M.client) if("No") @@ -948,10 +951,10 @@ to_chat(M, "To try to resolve this matter head to [GLOB.configuration.url.banappeals_url]") else to_chat(M, "No ban appeals URL has been set.") - log_admin("[key_name(usr)] has banned [M.ckey].\nReason: [reason]\nThis ban does not expire automatically and must be appealed.") - message_admins("[key_name_admin(usr)] has banned [M.ckey].\nReason: [reason]\nThis ban does not expire automatically and must be appealed.") + log_admin("[key_name(usr)] has banned [M.last_known_ckey].\nReason: [reason]\nThis ban does not expire automatically and must be appealed.") + message_admins("[key_name_admin(usr)] has banned [M.last_known_ckey].\nReason: [reason]\nThis ban does not expire automatically and must be appealed.") DB_ban_record(BANTYPE_PERMA, M, -1, reason) - add_note(M.ckey, "Permanently banned - [reason]", null, usr.ckey, FALSE) + add_note(M.last_known_ckey, "Permanently banned - [reason]", null, usr.ckey, FALSE) qdel(M.client) if("Cancel") diff --git a/code/modules/mob/mob_login_base.dm b/code/modules/mob/mob_login_base.dm index 326108cf97b..7c2a6354fa9 100644 --- a/code/modules/mob/mob_login_base.dm +++ b/code/modules/mob/mob_login_base.dm @@ -1,6 +1,7 @@ -//handles setting lastKnownIP and computer_id for use by the ban systems as well as checking for multikeying +//handles setting last_known_ckey, lastKnownIP, and computer_id for use by the ban systems as well as checking for multikeying /mob/proc/update_Login_details() //Multikey checks and logging + last_known_ckey = ckey lastKnownIP = client.address computer_id = client.computer_id log_access_in(client) @@ -31,7 +32,6 @@ /mob/Login() GLOB.player_list |= src - last_known_ckey = ckey update_Login_details() world.update_status() diff --git a/code/modules/mob/new_player/new_player_login.dm b/code/modules/mob/new_player/new_player_login.dm index ffd7902f7c0..95225af0d00 100644 --- a/code/modules/mob/new_player/new_player_login.dm +++ b/code/modules/mob/new_player/new_player_login.dm @@ -1,5 +1,5 @@ /mob/new_player/Login() - update_Login_details() //handles setting lastKnownIP and computer_id for use by the ban systems as well as checking for multikeying + update_Login_details() //handles setting last_known_ckey, lastKnownIP, and computer_id for use by the ban systems as well as checking for multikeying if(GLOB.join_motd) to_chat(src, "
[GLOB.join_motd]
")
Antagonist Positions
Antagonist Positions
[replacetext(role, " ", " ")][replacetext(role, " ", " ")][replacetext(role, " ", " ")][replacetext(role, " ", " ")][replacetext(role, " ", " ")][replacetext(role, " ", " ")][replacetext(role, " ", " ")][replacetext(role, " ", " ")]