From fb57e989ce4c9f177d5885e6b5cb60902959d278 Mon Sep 17 00:00:00 2001 From: AnturK Date: Sat, 10 Oct 2015 12:37:12 +0200 Subject: [PATCH 1/2] Autoadmin initial --- code/controllers/configuration.dm | 7 +++++++ code/modules/client/client procs.dm | 11 +++++++++++ config/config.txt | 6 +++++- 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/code/controllers/configuration.dm b/code/controllers/configuration.dm index f16547a21bf..db44fe4a1c5 100644 --- a/code/controllers/configuration.dm +++ b/code/controllers/configuration.dm @@ -173,6 +173,9 @@ var/maprotation = 1 var/maprotatechancedelta = 0.75 + var/autoadmin = 0 + var/autoadmin_rank = "Game Admin" + /datum/configuration/New() var/list/L = typesof(/datum/game_mode) - /datum/game_mode for(var/T in L) @@ -363,6 +366,10 @@ config.maprotation = 1 if("maprotationchancedelta") config.maprotatechancedelta = text2num(value) + if("autoadmin") + config.autoadmin = 1 + if(value) + config.autoadmin_rank = ckeyEx(value) else diary << "Unknown setting in configuration: '[name]'" diff --git a/code/modules/client/client procs.dm b/code/modules/client/client procs.dm index 06352c11ba5..181e1718264 100644 --- a/code/modules/client/client procs.dm +++ b/code/modules/client/client procs.dm @@ -107,6 +107,17 @@ var/next_external_rsc = 0 directory[ckey] = src //Admin Authorisation + if(config.autoadmin) + if(!admin_datums[ckey]) + var/datum/admin_rank/autorank + for(var/datum/admin_rank/R in admin_ranks) + if(R.name == config.autoadmin_rank) + autorank = R + if(!autorank) + world << "Autoadmin rank not found" + else + var/datum/admins/D = new(autorank, ckey) + admin_datums[ckey] = D holder = admin_datums[ckey] if(holder) admins += src diff --git a/config/config.txt b/config/config.txt index e909d642955..aa9312226bd 100644 --- a/config/config.txt +++ b/config/config.txt @@ -213,4 +213,8 @@ ANNOUNCE_ADMIN_LOGOUT ##This is the chance of map rotation factored to the round length. ##A value of 1 would mean the map rotation chance is the round length in minutes (hour long round == 60% rotation chance) ##A value of 0.5 would mean the map rotation chance is half of the round length in minutes (hour long round == 30% rotation chance) -#MAPROTATIONCHANCEDELTA 0.75 \ No newline at end of file +#MAPROTATIONCHANCEDELTA 0.75 + +##AUTOADMIN +##Uncomment to automatically give that admin rank to all players +#AUTOADMIN Game Admin \ No newline at end of file From 4b95cb4aa6153e46aab7537973fb443c526ac706 Mon Sep 17 00:00:00 2001 From: AnturK Date: Sat, 10 Oct 2015 20:08:50 +0200 Subject: [PATCH 2/2] Update client procs.dm --- code/modules/client/client procs.dm | 1 + 1 file changed, 1 insertion(+) diff --git a/code/modules/client/client procs.dm b/code/modules/client/client procs.dm index 181e1718264..2bb6ce97bfa 100644 --- a/code/modules/client/client procs.dm +++ b/code/modules/client/client procs.dm @@ -113,6 +113,7 @@ var/next_external_rsc = 0 for(var/datum/admin_rank/R in admin_ranks) if(R.name == config.autoadmin_rank) autorank = R + break if(!autorank) world << "Autoadmin rank not found" else