mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 10:12:45 +00:00
*(If something happens to apply plane_holder to mob before login) Yeah a feature somewhere down there relied on the mob getting its plane_holder before client (and thus making the only vis_enabled init right here that required the lack of plane_holder on login completely unobtainable) and I was vaguely told to fix this here instead of fixing the forementioned downstream feature.
60 lines
2.6 KiB
Plaintext
60 lines
2.6 KiB
Plaintext
//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( (client.connection != "web") && (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("<font color='red'><B>Notice: </B></font><font color='blue'><A href='?src=\ref[usr];priv_msg=\ref[src]'>[key_name_admin(src)]</A> has the same [matches] as <A href='?src=\ref[usr];priv_msg=\ref[M]'>[key_name_admin(M)]</A>.</font>", 1)
|
|
log_access("Notice: [key_name(src)] has the same [matches] as [key_name(M)].")
|
|
else
|
|
message_admins("<font color='red'><B>Notice: </B></font><font color='blue'><A href='?src=\ref[usr];priv_msg=\ref[src]'>[key_name_admin(src)]</A> has the same [matches] as [key_name_admin(M)] (no longer logged in). </font>", 1)
|
|
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()
|
|
world.update_status()
|
|
|
|
client.images = null //remove the images such as AIs being unable to see runes
|
|
client.screen = list() //remove hud items just in case
|
|
if(hud_used) qdel(hud_used) //remove the hud objects
|
|
hud_used = new /datum/hud(src)
|
|
|
|
next_move = 1
|
|
sight |= SEE_SELF
|
|
..()
|
|
|
|
if(loc && !isturf(loc))
|
|
client.eye = loc
|
|
client.perspective = EYE_PERSPECTIVE
|
|
else
|
|
client.eye = src
|
|
client.perspective = MOB_PERSPECTIVE
|
|
reload_fullscreen() // Reload any fullscreen overlays this mob has.
|
|
add_click_catcher()
|
|
update_client_color()
|
|
|
|
if(!plane_holder) //Lazy
|
|
plane_holder = new(src) //Not a location, it takes it and saves it.
|
|
if(!vis_enabled)
|
|
vis_enabled = list()
|
|
client.screen += plane_holder.plane_masters
|
|
recalculate_vis()
|
|
|
|
//set macro to normal incase it was overriden (like cyborg currently does)
|
|
winset(src, null, "mainwindow.macro=macro hotkey_toggle.is-checked=false input.focus=true input.background-color=#D3B5B5")
|