Deadmin tweaks: Admins without +AUTOLOGIN start deadmined. AUTOLOGIN defaults to on. (#33480)

* Deadmin tweaks, Admins without +ADMIN start deadmined.
Deadmining no longer destroys the admin datum.
Admins without +ADMIN start deadmined, reloading admins re-deadmins them.
Moved some code around to make it more sane
People with +PERMISSION can now deadmin or readmin other admins at will.

* Adds new flag for if the role should automatically log in, defaults to on, can be removed with -AUTOLOGIN
Also fixes a bug in permission panel not handling these cases gracefully
This commit is contained in:
Kyle Spier-Swenson
2017-12-13 22:03:37 -05:00
committed by Joan Lung
parent 5ffec027af
commit 4e929c74a9
11 changed files with 171 additions and 105 deletions
+12 -7
View File
@@ -161,7 +161,7 @@ GLOBAL_LIST(external_rsc_urls)
GLOB.directory[ckey] = src
GLOB.ahelp_tickets.ClientLogin(src)
var/connecting_admin = FALSE //because de-admined admins connecting should be treated like admins.
//Admin Authorisation
var/localhost_addresses = list("127.0.0.1", "::1")
if(address && (address in localhost_addresses))
@@ -185,6 +185,11 @@ GLOBAL_LIST(external_rsc_urls)
if(holder)
GLOB.admins |= src
holder.owner = src
connecting_admin = TRUE
else if(GLOB.deadmins[ckey])
verbs += /client/proc/readmin
connecting_admin = TRUE
//preferences datum - also holds some persistent data for the client (because we may as well keep these datums to a minimum)
prefs = GLOB.preferences_datums[ckey]
@@ -234,8 +239,8 @@ GLOBAL_LIST(external_rsc_urls)
chatOutput.start() // Starts the chat
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!")
spawn()
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
@@ -249,7 +254,7 @@ GLOBAL_LIST(external_rsc_urls)
to_chat(src, "Your version: [byond_version]")
to_chat(src, "Required version: [cev] or later")
to_chat(src, "Visit http://www.byond.com/download/ to get the latest version of byond.")
if (holder)
if (connecting_admin)
to_chat(src, "Because you are an admin, you are being allowed to walk past this limitation, But it is still STRONGLY suggested you upgrade")
else
qdel(src)
@@ -269,7 +274,7 @@ GLOBAL_LIST(external_rsc_urls)
to_chat(src, "Required version to remove this message: [cwv] or later")
to_chat(src, "Visit http://www.byond.com/download/ to get the latest version of byond.")
if (connection == "web" && !holder)
if (connection == "web" && !connecting_admin)
if (!CONFIG_GET(flag/allow_webclient))
to_chat(src, "Web client is disabled")
qdel(src)
@@ -423,7 +428,7 @@ GLOBAL_LIST(external_rsc_urls)
if (src.holder && src.holder.rank)
admin_rank = src.holder.rank.name
else
if (check_randomizer(connectiontopic))
if (!GLOB.deadmins[ckey] && check_randomizer(connectiontopic))
return
var/sql_ip = sanitizeSQL(address)
var/sql_computerid = sanitizeSQL(computer_id)
@@ -433,7 +438,7 @@ GLOBAL_LIST(external_rsc_urls)
if(!query_client_in_db.Execute())
return
if(!query_client_in_db.NextRow())
if (CONFIG_GET(flag/panic_bunker) && !holder && !(ckey in GLOB.deadmins))
if (CONFIG_GET(flag/panic_bunker) && !holder && !GLOB.deadmins[ckey])
log_access("Failed Login: [key] - New account attempting to connect during panic bunker")
message_admins("<span class='adminnotice'>Failed Login: [key] - New account attempting to connect during panic bunker</span>")
to_chat(src, "Sorry but the server is currently not accepting connections from never before seen players.")