BS12 Hooks

This commit is contained in:
Mloc-Argent
2014-05-22 23:56:35 +02:00
committed by alex-gh
parent a2a50586b0
commit 1b2f83dee4
18 changed files with 96 additions and 122 deletions
+3
View File
@@ -58,6 +58,9 @@ var/savefile/Banlist
CMinutes = (world.realtime / 10) / 60
return 1
/hook/startup/proc/loadBans()
return LoadBans()
/proc/LoadBans()
Banlist = new("data/banlist.bdb")
-8
View File
@@ -927,14 +927,6 @@ var/global/floorIsLava = 0
message_admins("\blue [key_name_admin(usr)] toggled guests game entering [guests_allowed?"":"dis"]allowed.", 1)
feedback_add_details("admin_verb","TGU") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/client/proc/unjobban_panel()
set name = "Unjobban Panel"
set category = "Admin"
if (src.holder)
src.holder.unjobbanpanel()
feedback_add_details("admin_verb","UJBP") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
return
/datum/admins/proc/output_ai_laws()
var/ai_number = 0
for(var/mob/living/silicon/S in mob_list)
+4
View File
@@ -11,6 +11,10 @@
/proc/investigate_subject2file(var/subject)
return file("[INVESTIGATE_DIR][subject].html")
/hook/startup/proc/resetInvestigate()
investigate_reset()
return 1
/proc/investigate_reset()
if(fdel(INVESTIGATE_DIR)) return 1
return 0
+1 -3
View File
@@ -75,9 +75,7 @@ var/list/admin_verbs_admin = list(
)
var/list/admin_verbs_ban = list(
/client/proc/unban_panel,
/client/proc/jobbans,
// /client/proc/unjobban_panel,
// /client/proc/DB_ban_panel
/client/proc/jobbans
)
var/list/admin_verbs_sounds = list(
/client/proc/play_local_sound,
+4 -9
View File
@@ -48,6 +48,10 @@ DEBUG
jobban_loadbanfile()
*/
/hook/startup/proc/loadJobBans()
jobban_loadbanfile()
return 1
/proc/jobban_loadbanfile()
if(config.ban_legacy_system)
var/savefile/S=new("data/job_full.ban")
@@ -99,15 +103,6 @@ DEBUG
text2file(formatted_log,"data/ban_unban_log.txt")
/proc/jobban_updatelegacybans()
if(!jobban_runonce)
log_admin("Updating jobbanfile!")
// Updates bans.. Or fixes them. Either way.
for(var/T in jobban_keylist)
if(!T) continue
jobban_runonce++ //don't run this update again
/proc/jobban_remove(X)
for (var/i = 1; i <= length(jobban_keylist); i++)
if( findtext(jobban_keylist[i], "[X]") )
-13
View File
@@ -982,19 +982,6 @@
if("Cancel")
return
else if(href_list["unjobbanf"])
if(!check_rights(R_BAN)) return
var/banfolder = href_list["unjobbanf"]
Banlist.cd = "/base/[banfolder]"
var/key = Banlist["key"]
if(alert(usr, "Are you sure you want to unban [key]?", "Confirmation", "Yes", "No") == "Yes")
if (RemoveBanjob(banfolder))
unjobbanpanel()
else
alert(usr,"This ban has already been lifted / does not exist.","Error","Ok")
unjobbanpanel()
else if(href_list["mute"])
if(!check_rights(R_ADMIN)) return
+4 -5
View File
@@ -4,16 +4,15 @@
return
/proc/send2mainirc(var/msg)
if(config.use_irc_bot && config.main_irc && config.irc_bot_host)
ext_python("ircbot_message.py", "[config.comms_password] [config.irc_bot_host] [config.main_irc] [msg]")
if(config.main_irc)
send2irc(config.main_irc, msg)
return
/proc/send2adminirc(var/msg)
if(config.use_irc_bot && config.admin_irc && config.irc_bot_host)
ext_python("ircbot_message.py", "[config.comms_password] [config.irc_bot_host] [config.admin_irc] [msg]")
if(config.admin_irc)
send2irc(config.admin_irc, msg)
return
/hook/startup/proc/ircNotify()
send2mainirc("Server starting up on [config.server? "byond://[config.server]" : "byond://[world.address]:[world.port]"]")
return 1
@@ -12,6 +12,12 @@ var/datum/paiController/paiController // Global handler for pAI candidates
var/comments
var/ready = 0
/hook/startup/proc/paiControllerSetup()
paiController = new /datum/paiController()
return 1
/datum/paiController
var/list/pai_candidates = list()
var/list/asked = list()
+5
View File
@@ -89,6 +89,9 @@
// rebuild all power networks from scratch
/hook/startup/proc/buildPowernets()
return makepowernets()
/proc/makepowernets()
for(var/datum/powernet/PN in powernets)
del(PN)
@@ -111,6 +114,8 @@
if(!M.powernet) continue // APCs have powernet=0 so they don't count as network nodes directly
M.powernet.nodes[M] = M
return 1
// returns a list of all power-related objects (nodes, cable, junctions) in turf,
// excluding source, that match the direction d