diff --git a/code/controllers/configuration.dm b/code/controllers/configuration.dm index e49c69968cd..fd83ab43f5d 100644 --- a/code/controllers/configuration.dm +++ b/code/controllers/configuration.dm @@ -176,6 +176,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) @@ -370,6 +373,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 9ee7dba62d3..61f1c05baa8 100644 --- a/code/modules/client/client procs.dm +++ b/code/modules/client/client procs.dm @@ -107,6 +107,18 @@ 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 + break + 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 1e7b8c371f2..72eb1f2f27c 100644 --- a/config/config.txt +++ b/config/config.txt @@ -221,4 +221,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