diff --git a/code/modules/client/client_procs.dm b/code/modules/client/client_procs.dm index 19bfebc0fe2..a80bfce45dc 100644 --- a/code/modules/client/client_procs.dm +++ b/code/modules/client/client_procs.dm @@ -322,30 +322,47 @@ GLOBAL_LIST_INIT(unrecommended_builds, list( if(!joined_player_preferences) continue //this shouldn't happen. - var/client/C = GLOB.directory[joined_player_ckey] - var/in_round = "" - if (joined_players[joined_player_ckey]) - in_round = " who has played in the current round" - var/message_type = "Notice" + var/client/potential_match = GLOB.directory[joined_player_ckey] + + var/matched_ip = null + var/matched_cid = null + var/same_round = FALSE - var/matches if(joined_player_preferences.last_ip == address) - matches += "IP ([address])" + matched_ip = "IP [address]" + if(joined_player_preferences.last_id == computer_id) - if(matches) - matches = "BOTH [matches] and " - alert_admin_multikey = TRUE - message_type = "MULTIKEY" - matches += "Computer ID ([computer_id])" + matched_cid = "Computer ID [computer_id]" alert_mob_dupe_login = TRUE - if(matches) - if(C) - message_admins(span_danger("[message_type]: Connecting player [key_name_admin(src)] has the same [matches] as [key_name_admin(C)][in_round].")) - log_admin_private("[message_type]: Connecting player [key_name(src)] has the same [matches] as [key_name(C)][in_round].") - else - message_admins(span_danger("[message_type]: Connecting player [key_name_admin(src)] has the same [matches] as [joined_player_ckey](no longer logged in)[in_round]. ")) - log_admin_private("[message_type]: Connecting player [key_name(src)] has the same [matches] as [joined_player_ckey](no longer logged in)[in_round].") + if(isnull(matched_ip) && isnull(matched_cid)) + continue + + if (joined_players[joined_player_ckey]) + same_round = TRUE + + var/double_match = !isnull(matched_ip) && !isnull(matched_cid) + + if(double_match && same_round) + alert_admin_multikey = TRUE + + var/list/concatables = list() + concatables += span_danger(span_bold("[double_match ? "MULTIKEY" : "Notice"]:")) + concatables += "Connecting player [key_name_admin(src)] has the same" + if(double_match) + concatables += "!BOTH! [matched_ip] and [matched_cid]" + else + concatables += (!isnull(matched_ip) ? matched_ip : matched_cid) + concatables += "as [isnull(potential_match) ? "[joined_player_ckey] (no longer logged in)" : "[key_name_admin(potential_match)]"]" + if(same_round) + concatables += span_bold("in the current round") + + concatables += "" + + var/sendable_string = jointext(concatables, " ") + + message_admins(sendable_string) + log_admin_private(strip_html_full(sendable_string, MAX_MESSAGE_LEN)) . = ..() //calls mob.Login()