From fed6625e07dc43f0481c815d25f44b3ad9c8b854 Mon Sep 17 00:00:00 2001 From: Cael_Aislinn Date: Fri, 12 Oct 2012 13:44:23 +1000 Subject: [PATCH] fix for moderators not being loaded correctly Signed-off-by: Cael_Aislinn --- code/modules/admin/verbs/diagnostics.dm | 5 +++-- code/modules/mob/new_player/login.dm | 1 + code/world.dm | 21 +++++++++++++++++++-- 3 files changed, 23 insertions(+), 4 deletions(-) diff --git a/code/modules/admin/verbs/diagnostics.dm b/code/modules/admin/verbs/diagnostics.dm index ba97d8c257..4596411440 100644 --- a/code/modules/admin/verbs/diagnostics.dm +++ b/code/modules/admin/verbs/diagnostics.dm @@ -168,9 +168,10 @@ usr << "\red Not a good cop" return - message_admins("[usr] manually reloaded admins.txt") - usr << "You reload admins.txt" + message_admins("[usr] manually reloaded admins.txt and moderators.txt") + usr << "You reload admins.txt and moderators.txt" world.load_admins() + world.load_mods() feedback_add_details("admin_verb","RLDA") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! //todo: diff --git a/code/modules/mob/new_player/login.dm b/code/modules/mob/new_player/login.dm index 009fb35876..98f3e816bc 100644 --- a/code/modules/mob/new_player/login.dm +++ b/code/modules/mob/new_player/login.dm @@ -1,4 +1,5 @@ /mob/new_player/Login() + world << "mob/new_player/Login()" update_Login_details() //handles setting lastKnownIP and computer_id for use by the ban systems as well as checking for multikeying if (join_motd) src << "
[join_motd]
" diff --git a/code/world.dm b/code/world.dm index 2354238db2..aedc3137ce 100644 --- a/code/world.dm +++ b/code/world.dm @@ -19,6 +19,7 @@ src.load_mode() src.load_motd() src.load_admins() + src.load_mods() investigate_reset() if (config.usewhitelist) load_whitelist() @@ -191,8 +192,8 @@ Starting up. [time2text(world.timeofday, "hh:mm.ss")] /world/proc/load_motd() join_motd = file2text("config/motd.txt") - /world/proc/load_admins() + log_admin("Loading admins...") var/text = file2text("config/admins.txt") if (!text) diary << "Failed to load config/admins.txt\n" @@ -210,8 +211,24 @@ Starting up. [time2text(world.timeofday, "hh:mm.ss")] var/m_key = copytext(line, 1, pos) var/a_lev = copytext(line, pos + 3, length(line) + 1) admins[m_key] = new /datum/admins(a_lev) - diary << ("ADMIN: [m_key] = [a_lev]") +/world/proc/load_mods() + log_admin("Loading mods...)") + var/text = file2text("config/moderators.txt") + if (!text) + diary << "Failed to load config/moderators.txt\n" + else + //diary << "Successfully loaded config/moderators.txt\n" + var/list/lines = dd_text2list(text, "\n") + for(var/line in lines) + if (!line) + continue + + if (copytext(line, 1, 2) == ";") + continue + + var/m_key = copytext(line, 1, length(line) + 1) + admins[m_key] = new /datum/admins("Moderator") /world/proc/load_configuration() config = new /datum/configuration()