Login loss prevention v1

This commit is contained in:
Archie
2021-09-23 19:37:06 -03:00
parent d0070cdab2
commit d20013cfe4
26 changed files with 92 additions and 29 deletions
+2
View File
@@ -116,6 +116,8 @@ INITIALIZE_IMMEDIATE(/mob/dead)
/mob/dead/Login()
. = ..()
if(!. || !client)
return FALSE
var/turf/T = get_turf(src)
if (isturf(T))
update_z(T.z)
+5 -1
View File
@@ -1,4 +1,6 @@
/mob/dead/new_player/Login()
if(!client)
return
if(CONFIG_GET(flag/use_exp_tracking))
client.set_exp_from_db()
client.set_db_player_flags()
@@ -7,7 +9,9 @@
mind.active = 1
mind.current = src
..()
. = ..()
if(!. || !client)
return FALSE
var/motd = global.config.motd
if(motd)
+3 -1
View File
@@ -1,5 +1,7 @@
/mob/dead/observer/Login()
..()
. = ..()
if(!. || !client)
return FALSE
ghost_accs = client.prefs.ghost_accs
ghost_others = client.prefs.ghost_others
@@ -360,6 +360,10 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
if(mind.current.key && mind.current.key[1] != "@") //makes sure we don't accidentally kick any clients
to_chat(usr, "<span class='warning'>Another consciousness is in your body...It is resisting you.</span>")
return
if(mind.reEnterCooldown > world.time - 20) //cooldown to avoid body deletion. The server can be slower than players clicking this too fast.
to_chat(src, "<span class='warning'>You are doing this too fast. Stay still and try this again in a few seconds.</span>")
return
mind.reEnterCooldown = world.time
client.change_view(CONFIG_GET(string/default_view))
SStgui.on_transfer(src, mind.current) // Transfer NanoUIs.
mind.current.key = key