diff --git a/code/modules/client/client_procs.dm b/code/modules/client/client_procs.dm index b5489901814..77c26dabd76 100644 --- a/code/modules/client/client_procs.dm +++ b/code/modules/client/client_procs.dm @@ -194,8 +194,36 @@ var/next_external_rsc = 0 vars["fps"] = prefs.clientfps sethotkeys(1) //set hoykeys from preferences (from_pref = 1) + log_access("Login: [key_name(src)] from [address ? address : "localhost"]-[computer_id] || BYOND v[byond_version]") + var/alert_mob_dupe_login = FALSE + if(config.log_access) + for(var/I in clients) + if(I == src) + continue + var/client/C = I + if(C.key && (C.key != key) ) + var/matches + if( (C.address == address) ) + matches += "IP ([address])" + if( (C.computer_id == computer_id) ) + if(matches) + matches += " and " + matches += "ID ([computer_id])" + alert_mob_dupe_login = TRUE + if(matches) + if(C) + message_admins("Notice: [key_name_admin(src)] has the same [matches] as [key_name_admin(C)].") + log_access("Notice: [key_name(src)] has the same [matches] as [key_name(C)].") + else + message_admins("Notice: [key_name_admin(src)] has the same [matches] as [key_name_admin(C)] (no longer logged in). ") + log_access("Notice: [key_name(src)] has the same [matches] as [key_name(C)] (no longer logged in).") + . = ..() //calls mob.Login() + if(alert_mob_dupe_login) + set waitfor = FALSE + alert(mob, "You have logged in already with another key this round, please log out of this one NOW or risk being banned!") + connection_time = world.time connection_realtime = world.realtime connection_timeofday = world.timeofday @@ -307,6 +335,7 @@ var/next_external_rsc = 0 ////////////// /client/Del() + log_access("Logout: [key_name(src)]") if(holder) adminGreet(1) holder.owner = null diff --git a/code/modules/mob/login.dm b/code/modules/mob/login.dm index 28546c41c2c..e14419a4919 100644 --- a/code/modules/mob/login.dm +++ b/code/modules/mob/login.dm @@ -1,33 +1,8 @@ -//handles setting 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 - lastKnownIP = client.address - computer_id = client.computer_id - log_access("Login: [key_name(src)] from [lastKnownIP ? lastKnownIP : "localhost"]-[computer_id] || BYOND v[client.byond_version]") - if(config.log_access) - for(var/mob/M in player_list) - if(M == src) - continue - if( M.key && (M.key != key) ) - var/matches - if( (M.lastKnownIP == client.address) ) - matches += "IP ([client.address])" - if( (M.computer_id == client.computer_id) ) - if(matches) - matches += " and " - matches += "ID ([client.computer_id])" - spawn() alert("You have logged in already with another key this round, please log out of this one NOW or risk being banned!") - if(matches) - if(M.client) - message_admins("Notice: [key_name_admin(src)] has the same [matches] as [key_name_admin(M)].") - log_access("Notice: [key_name(src)] has the same [matches] as [key_name(M)].") - else - message_admins("Notice: [key_name_admin(src)] has the same [matches] as [key_name_admin(M)] (no longer logged in). ") - log_access("Notice: [key_name(src)] has the same [matches] as [key_name(M)] (no longer logged in).") - /mob/Login() player_list |= src - update_Login_details() + lastKnownIP = client.address + computer_id = client.computer_id + log_access("Mob Login: [key_name(src)] was assigned to a [type]") world.update_status() client.screen = list() //remove hud items just in case client.images = list() diff --git a/code/modules/mob/logout.dm b/code/modules/mob/logout.dm index 77d6ca571ea..0ef3f294607 100644 --- a/code/modules/mob/logout.dm +++ b/code/modules/mob/logout.dm @@ -2,7 +2,6 @@ SStgui.on_logout(src) unset_machine() player_list -= src - log_access("Logout: [key_name(src)]") if(admin_datums[src.ckey]) if (ticker && ticker.current_state == GAME_STATE_PLAYING) //Only report this stuff if we are currently playing. var/admins_number = admins.len