Merge pull request #12290 from AnturK/freeadmin

Autoadmin Config
This commit is contained in:
Razharas
2015-10-19 21:50:01 +03:00
3 changed files with 24 additions and 1 deletions
+7
View File
@@ -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]'"
+12
View File
@@ -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
+5 -1
View File
@@ -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
#MAPROTATIONCHANCEDELTA 0.75
##AUTOADMIN
##Uncomment to automatically give that admin rank to all players
#AUTOADMIN Game Admin