mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 10:43:20 +00:00
Merge remote-tracking branch 'upstream/master' into dev-freeze
Conflicts: code/controllers/configuration.dm code/modules/admin/topic.dm config/example/config.txt
This commit is contained in:
@@ -62,8 +62,13 @@ var/list/gamemode_cache = list()
|
||||
var/respawn = 1
|
||||
var/guest_jobban = 1
|
||||
var/usewhitelist = 0
|
||||
var/mods_are_mentors = 0
|
||||
var/kick_inactive = 0 //force disconnect for inactive players after this many minutes, if non-0
|
||||
var/show_mods = 0
|
||||
var/show_mentors = 0
|
||||
var/mods_can_tempban = 0
|
||||
var/mods_can_job_tempban = 0
|
||||
var/mod_tempban_max = 1440
|
||||
var/mod_job_tempban_max = 1440
|
||||
var/load_jobs_from_txt = 0
|
||||
var/ToRban = 0
|
||||
var/automute_on = 0 //enables automuting/spam prevention
|
||||
@@ -317,9 +322,6 @@ var/list/gamemode_cache = list()
|
||||
if ("log_runtime")
|
||||
config.log_runtime = 1
|
||||
|
||||
if ("mentors")
|
||||
config.mods_are_mentors = 1
|
||||
|
||||
if ("generate_asteroid")
|
||||
config.generate_asteroid = 1
|
||||
|
||||
@@ -471,6 +473,24 @@ var/list/gamemode_cache = list()
|
||||
if("kick_inactive")
|
||||
config.kick_inactive = text2num(value)
|
||||
|
||||
if("show_mods")
|
||||
config.show_mods = 1
|
||||
|
||||
if("show_mentors")
|
||||
config.show_mentors = 1
|
||||
|
||||
if("mods_can_tempban")
|
||||
config.mods_can_tempban = 1
|
||||
|
||||
if("mods_can_job_tempban")
|
||||
config.mods_can_job_tempban = 1
|
||||
|
||||
if("mod_tempban_max")
|
||||
config.mod_tempban_max = text2num(value)
|
||||
|
||||
if("mod_job_tempban_max")
|
||||
config.mod_job_tempban_max = text2num(value)
|
||||
|
||||
if("load_jobs_from_txt")
|
||||
load_jobs_from_txt = 1
|
||||
|
||||
|
||||
@@ -62,8 +62,10 @@
|
||||
|
||||
var/msg = ""
|
||||
var/modmsg = ""
|
||||
var/mentmsg = ""
|
||||
var/num_mods_online = 0
|
||||
var/num_admins_online = 0
|
||||
var/num_mentors_online = 0
|
||||
if(holder)
|
||||
for(var/client/C in admins)
|
||||
if(R_ADMIN & C.holder.rights || (!R_MOD & C.holder.rights && !R_MENTOR & C.holder.rights)) //Used to determine who shows up in admin rows
|
||||
@@ -88,7 +90,7 @@
|
||||
msg += "\n"
|
||||
|
||||
num_admins_online++
|
||||
else if(R_MOD & C.holder.rights || R_MENTOR & C.holder.rights) //Who shows up in mod/mentor rows.
|
||||
else if(R_MOD & C.holder.rights) //Who shows up in mod/mentor rows.
|
||||
modmsg += "\t[C] is a [C.holder.rank]"
|
||||
|
||||
if(isobserver(C.mob))
|
||||
@@ -103,17 +105,41 @@
|
||||
modmsg += "\n"
|
||||
num_mods_online++
|
||||
|
||||
else if(R_MENTOR & C.holder.rights)
|
||||
mentmsg += "\t[C] is a [C.holder.rank]"
|
||||
if(isobserver(C.mob))
|
||||
mentmsg += " - Observing"
|
||||
else if(istype(C.mob,/mob/new_player))
|
||||
mentmsg += " - Lobby"
|
||||
else
|
||||
mentmsg += " - Playing"
|
||||
|
||||
if(C.is_afk())
|
||||
mentmsg += " (AFK)"
|
||||
mentmsg += "\n"
|
||||
num_mentors_online++
|
||||
|
||||
else
|
||||
for(var/client/C in admins)
|
||||
if(R_ADMIN & C.holder.rights || (!R_MOD & C.holder.rights && !R_MENTOR & C.holder.rights))
|
||||
if(!C.holder.fakekey)
|
||||
msg += "\t[C] is a [C.holder.rank]\n"
|
||||
num_admins_online++
|
||||
else if (R_MOD & C.holder.rights || R_MENTOR & C.holder.rights)
|
||||
else if (R_MOD & C.holder.rights)
|
||||
modmsg += "\t[C] is a [C.holder.rank]\n"
|
||||
num_mods_online++
|
||||
else if (R_MENTOR & C.holder.rights)
|
||||
mentmsg += "\t[C] is a [C.holder.rank]\n"
|
||||
num_mentors_online++
|
||||
|
||||
if(config.admin_irc)
|
||||
src << "<span class='info'>Adminhelps are also sent to IRC. If no admins are available in game try anyway and an admin on IRC may see it and respond.</span>"
|
||||
msg = "<b>Current Admins ([num_admins_online]):</b>\n" + msg + "\n<b> Current [config.mods_are_mentors ? "Mentors" : "Moderators"]([num_mods_online]):</b>\n" + modmsg
|
||||
msg = "<b>Current Admins ([num_admins_online]):</b>\n" + msg
|
||||
|
||||
if(config.show_mods)
|
||||
msg += "\n<b> Current Moderators ([num_mods_online]):</b>\n" + modmsg
|
||||
|
||||
if(config.show_mentors)
|
||||
msg += "\n<b> Current Mentors ([num_mentors_online]):</b>\n" + mentmsg
|
||||
|
||||
src << msg
|
||||
|
||||
@@ -574,7 +574,13 @@
|
||||
|
||||
//JOBBAN'S INNARDS
|
||||
else if(href_list["jobban3"])
|
||||
if(!check_rights(R_MOD,0) && !check_rights(R_ADMIN)) return
|
||||
if(!check_rights(R_MOD,0) && !check_rights(R_ADMIN,0))
|
||||
usr << "<span class='warning'>You do not have the appropriate permissions to add job bans!</span>"
|
||||
return
|
||||
|
||||
if(check_rights(R_MOD,0) && !check_rights(R_ADMIN,0) && !config.mods_can_job_tempban) // If mod and tempban disabled
|
||||
usr << "<span class='warning'>Mod jobbanning is disabled!</span>"
|
||||
return
|
||||
|
||||
var/mob/M = locate(href_list["jobban4"])
|
||||
if(!ismob(M))
|
||||
@@ -649,13 +655,18 @@
|
||||
if(notbannedlist.len) //at least 1 unbanned job exists in joblist so we have stuff to ban.
|
||||
switch(alert("Temporary Ban?",,"Yes","No", "Cancel"))
|
||||
if("Yes")
|
||||
if(!check_rights(R_MOD,0) && !check_rights(R_BAN)) return
|
||||
if(!check_rights(R_MOD,0) && !check_rights(R_BAN, 0))
|
||||
usr << "<span class='warning'> You Cannot issue temporary job-bans!</span>"
|
||||
return
|
||||
if(config.ban_legacy_system)
|
||||
usr << "\red Your server is using the legacy banning system, which does not support temporary job bans. Consider upgrading. Aborting ban."
|
||||
return
|
||||
var/mins = input(usr,"How long (in minutes)?","Ban time",1440) as num|null
|
||||
if(!mins)
|
||||
return
|
||||
if(check_rights(R_MOD, 0) && !check_rights(R_BAN, 0) && mins > config.mod_job_tempban_max)
|
||||
usr << "<span class='warning'> Moderators can only job tempban up to [config.mod_job_tempban_max] minutes!</span>"
|
||||
return
|
||||
var/reason = sanitize(input(usr,"Reason?","Please State Reason","") as text|null)
|
||||
if(!reason)
|
||||
return
|
||||
@@ -764,7 +775,13 @@
|
||||
DB_ban_unban(ckey(key), BANTYPE_JOB_PERMA, job)
|
||||
|
||||
else if(href_list["newban"])
|
||||
if(!check_rights(R_MOD,0) && !check_rights(R_BAN)) return
|
||||
if(!check_rights(R_MOD,0) && !check_rights(R_BAN, 0))
|
||||
usr << "<span class='warning'>You do not have the appropriate permissions to add bans!</span>"
|
||||
return
|
||||
|
||||
if(check_rights(R_MOD,0) && !check_rights(R_ADMIN, 0) && !config.mods_can_job_tempban) // If mod and tempban disabled
|
||||
usr << "<span class='warning'>Mod jobbanning is disabled!</span>"
|
||||
return
|
||||
|
||||
var/mob/M = locate(href_list["newban"])
|
||||
if(!ismob(M)) return
|
||||
@@ -776,6 +793,9 @@
|
||||
var/mins = input(usr,"How long (in minutes)?","Ban time",1440) as num|null
|
||||
if(!mins)
|
||||
return
|
||||
if(check_rights(R_MOD, 0) && !check_rights(R_BAN, 0) && mins > config.mod_tempban_max)
|
||||
usr << "<span class='warning'>Moderators can only job tempban up to [config.mod_tempban_max] minutes!</span>"
|
||||
return
|
||||
if(mins >= 525600) mins = 525599
|
||||
var/reason = sanitize(input(usr,"Reason?","reason","Griefer") as text|null)
|
||||
if(!reason)
|
||||
|
||||
@@ -269,6 +269,7 @@ var/world_topic_spam_protect_time = world.timeofday
|
||||
|
||||
/hook/startup/proc/loadMods()
|
||||
world.load_mods()
|
||||
world.load_mentors() // no need to write another hook.
|
||||
return 1
|
||||
|
||||
/world/proc/load_mods()
|
||||
@@ -286,7 +287,26 @@ var/world_topic_spam_protect_time = world.timeofday
|
||||
continue
|
||||
|
||||
var/title = "Moderator"
|
||||
if(config.mods_are_mentors) title = "Mentor"
|
||||
var/rights = admin_ranks[title]
|
||||
|
||||
var/ckey = copytext(line, 1, length(line)+1)
|
||||
var/datum/admins/D = new /datum/admins(title, rights, ckey)
|
||||
D.associate(directory[ckey])
|
||||
|
||||
/world/proc/load_mentors()
|
||||
if(config.admin_legacy_system)
|
||||
var/text = file2text("config/mentors.txt")
|
||||
if (!text)
|
||||
error("Failed to load config/mentors.txt")
|
||||
else
|
||||
var/list/lines = text2list(text, "\n")
|
||||
for(var/line in lines)
|
||||
if (!line)
|
||||
continue
|
||||
if (copytext(line, 1, 2) == ";")
|
||||
continue
|
||||
|
||||
var/title = "Mentor"
|
||||
var/rights = admin_ranks[title]
|
||||
|
||||
var/ckey = copytext(line, 1, length(line)+1)
|
||||
|
||||
Reference in New Issue
Block a user