mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2025-12-20 07:12:55 +00:00
3028 lines
122 KiB
Plaintext
3028 lines
122 KiB
Plaintext
/datum/admins/Topic(href, href_list)
|
|
..()
|
|
|
|
if(usr.client != src.owner || !check_rights(0))
|
|
log_admin("[key_name(usr)] tried to use the admin panel without authorization.")
|
|
message_admins("[key_name_admin(usr)] has attempted to override the admin panel!")
|
|
return
|
|
|
|
if(ticker.mode && ticker.mode.check_antagonists_topic(href, href_list))
|
|
check_antagonists()
|
|
return
|
|
|
|
if(href_list["rejectadminhelp"])
|
|
if(!check_rights(R_ADMIN|R_MOD))
|
|
return
|
|
var/client/C = locate(href_list["rejectadminhelp"])
|
|
if(!C)
|
|
return
|
|
|
|
C << 'sound/effects/adminhelp.ogg'
|
|
|
|
to_chat(C, "<font color='red' size='4'><b>- AdminHelp Rejected! -</b></font>")
|
|
to_chat(C, "<font color='red'><b>Your admin help was rejected.</b></font>")
|
|
to_chat(C, "Please try to be calm, clear, and descriptive in admin helps, do not assume the admin has seen any related events, and clearly state the names of anybody you are reporting. If you asked a question, please ensure it was clear what you were asking.")
|
|
|
|
message_admins("[key_name_admin(usr)] rejected [key_name_admin(C.mob)]'s admin help")
|
|
log_admin("[key_name(usr)] rejected [key_name(C.mob)]'s admin help")
|
|
|
|
if(href_list["stickyban"])
|
|
stickyban(href_list["stickyban"],href_list)
|
|
|
|
if(href_list["makeAntag"])
|
|
switch(href_list["makeAntag"])
|
|
if("1")
|
|
log_admin("[key_name(usr)] has spawned a traitor.")
|
|
if(!src.makeTraitors())
|
|
to_chat(usr, "\red Unfortunately there weren't enough candidates available.")
|
|
if("2")
|
|
log_admin("[key_name(usr)] has spawned a changeling.")
|
|
if(!src.makeChanglings())
|
|
to_chat(usr, "\red Unfortunately there weren't enough candidates available.")
|
|
if("3")
|
|
log_admin("[key_name(usr)] has spawned revolutionaries.")
|
|
if(!src.makeRevs())
|
|
to_chat(usr, "\red Unfortunately there weren't enough candidates available.")
|
|
if("4")
|
|
log_admin("[key_name(usr)] has spawned a cultists.")
|
|
if(!src.makeCult())
|
|
to_chat(usr, "\red Unfortunately there weren't enough candidates available.")
|
|
if("5")
|
|
log_admin("[key_name(usr)] has spawned a malf AI.")
|
|
if(!src.makeMalfAImode())
|
|
to_chat(usr, "\red Unfortunately there weren't enough candidates available.")
|
|
if("6")
|
|
log_admin("[key_name(usr)] has spawned a wizard.")
|
|
if(!src.makeWizard())
|
|
to_chat(usr, "\red Unfortunately there weren't enough candidates available.")
|
|
if("7")
|
|
log_admin("[key_name(usr)] has spawned vampires.")
|
|
if(!src.makeVampires())
|
|
to_chat(usr, "\red Unfortunately there weren't enough candidates available.")
|
|
if("8")
|
|
log_admin("[key_name(usr)] has spawned vox raiders.")
|
|
if(!src.makeVoxRaiders())
|
|
to_chat(usr, "\red Unfortunately there weren't enough candidates available.")
|
|
if("9")
|
|
log_admin("[key_name(usr)] has spawned an abductor team.")
|
|
if(!src.makeAbductorTeam())
|
|
to_chat(usr, "\red Unfortunately there weren't enough candidates available.")
|
|
|
|
else if(href_list["dbsearchckey"] || href_list["dbsearchadmin"] || href_list["dbsearchip"] || href_list["dbsearchcid"] || href_list["dbsearchbantype"])
|
|
var/adminckey = href_list["dbsearchadmin"]
|
|
var/playerckey = href_list["dbsearchckey"]
|
|
var/playerip = href_list["dbsearchip"]
|
|
var/playercid = href_list["dbsearchcid"]
|
|
var/dbbantype = text2num(href_list["dbsearchbantype"])
|
|
var/match = 0
|
|
|
|
if("dbmatch" in href_list)
|
|
match = 1
|
|
|
|
DB_ban_panel(playerckey, adminckey, playerip, playercid, dbbantype, match)
|
|
return
|
|
|
|
else if(href_list["dbbanedit"])
|
|
var/banedit = href_list["dbbanedit"]
|
|
var/banid = text2num(href_list["dbbanid"])
|
|
if(!banedit || !banid)
|
|
return
|
|
|
|
DB_ban_edit(banid, banedit)
|
|
return
|
|
|
|
else if(href_list["dbbanaddtype"])
|
|
|
|
var/bantype = text2num(href_list["dbbanaddtype"])
|
|
var/banckey = href_list["dbbanaddckey"]
|
|
var/banip = href_list["dbbanaddip"]
|
|
var/bancid = href_list["dbbanaddcid"]
|
|
var/banduration = text2num(href_list["dbbaddduration"])
|
|
var/banjob = href_list["dbbanaddjob"]
|
|
var/banreason = href_list["dbbanreason"]
|
|
|
|
banckey = ckey(banckey)
|
|
|
|
switch(bantype)
|
|
if(BANTYPE_PERMA)
|
|
if(!banckey || !banreason)
|
|
to_chat(usr, "Not enough parameters (Requires ckey and reason)")
|
|
return
|
|
banduration = null
|
|
banjob = null
|
|
if(BANTYPE_TEMP)
|
|
if(!banckey || !banreason || !banduration)
|
|
to_chat(usr, "Not enough parameters (Requires ckey, reason and duration)")
|
|
return
|
|
banjob = null
|
|
if(BANTYPE_JOB_PERMA)
|
|
if(!banckey || !banreason || !banjob)
|
|
to_chat(usr, "Not enough parameters (Requires ckey, reason and job)")
|
|
return
|
|
banduration = null
|
|
if(BANTYPE_JOB_TEMP)
|
|
if(!banckey || !banreason || !banjob || !banduration)
|
|
to_chat(usr, "Not enough parameters (Requires ckey, reason and job)")
|
|
return
|
|
if(BANTYPE_APPEARANCE)
|
|
if(!banckey || !banreason)
|
|
to_chat(usr, "Not enough parameters (Requires ckey and reason)")
|
|
return
|
|
banduration = null
|
|
banjob = null
|
|
if(BANTYPE_ADMIN_PERMA)
|
|
if(!banckey || !banreason)
|
|
to_chat(usr, "Not enough parameters (Requires ckey and reason)")
|
|
return
|
|
banduration = null
|
|
banjob = null
|
|
if(BANTYPE_ADMIN_TEMP)
|
|
if(!banckey || !banreason || !banduration)
|
|
to_chat(usr, "Not enough parameters (Requires ckey, reason and duration)")
|
|
return
|
|
banjob = null
|
|
|
|
var/mob/playermob
|
|
|
|
for(var/mob/M in player_list)
|
|
if(M.ckey == banckey)
|
|
playermob = M
|
|
break
|
|
|
|
|
|
banreason = "(MANUAL BAN) "+banreason
|
|
|
|
if(!playermob)
|
|
if(banip)
|
|
banreason = "[banreason] (CUSTOM IP)"
|
|
if(bancid)
|
|
banreason = "[banreason] (CUSTOM CID)"
|
|
else
|
|
message_admins("Ban process: A mob matching [playermob.ckey] was found at location [playermob.x], [playermob.y], [playermob.z]. Custom IP and computer id fields replaced with the IP and computer id from the located mob")
|
|
|
|
DB_ban_record(bantype, playermob, banduration, banreason, banjob, null, banckey, banip, bancid )
|
|
|
|
|
|
else if(href_list["editrights"])
|
|
if(!check_rights(R_PERMISSIONS))
|
|
message_admins("[key_name_admin(usr)] attempted to edit the admin permissions without sufficient rights.")
|
|
log_admin("[key_name(usr)] attempted to edit the admin permissions without sufficient rights.")
|
|
return
|
|
|
|
var/adm_ckey
|
|
|
|
var/task = href_list["editrights"]
|
|
if(task == "add")
|
|
var/new_ckey = ckey(input(usr,"New admin's ckey","Admin ckey", null) as text|null)
|
|
if(!new_ckey) return
|
|
if(new_ckey in admin_datums)
|
|
to_chat(usr, "<font color='red'>Error: Topic 'editrights': [new_ckey] is already an admin</font>")
|
|
return
|
|
adm_ckey = new_ckey
|
|
task = "rank"
|
|
else if(task != "show")
|
|
adm_ckey = ckey(href_list["ckey"])
|
|
if(!adm_ckey)
|
|
to_chat(usr, "<font color='red'>Error: Topic 'editrights': No valid ckey</font>")
|
|
return
|
|
|
|
var/datum/admins/D = admin_datums[adm_ckey]
|
|
|
|
if(task == "remove")
|
|
if(alert("Are you sure you want to remove [adm_ckey]?","Message","Yes","Cancel") == "Yes")
|
|
if(!D) return
|
|
admin_datums -= adm_ckey
|
|
D.disassociate()
|
|
|
|
updateranktodb(adm_ckey, "player")
|
|
message_admins("[key_name_admin(usr)] removed [adm_ckey] from the admins list")
|
|
log_admin("[key_name(usr)] removed [adm_ckey] from the admins list")
|
|
log_admin_rank_modification(adm_ckey, "Removed")
|
|
|
|
else if(task == "rank")
|
|
var/new_rank
|
|
if(admin_ranks.len)
|
|
new_rank = input("Please select a rank", "New rank", null, null) as null|anything in (admin_ranks|"*New Rank*")
|
|
else
|
|
new_rank = input("Please select a rank", "New rank", null, null) as null|anything in list("Game Master","Game Admin", "Trial Admin", "Admin Observer","*New Rank*")
|
|
|
|
var/rights = 0
|
|
if(D)
|
|
rights = D.rights
|
|
switch(new_rank)
|
|
if(null,"") return
|
|
if("*New Rank*")
|
|
new_rank = input("Please input a new rank", "New custom rank", null, null) as null|text
|
|
if(config.admin_legacy_system)
|
|
new_rank = ckeyEx(new_rank)
|
|
if(!new_rank)
|
|
to_chat(usr, "<font color='red'>Error: Topic 'editrights': Invalid rank</font>")
|
|
return
|
|
if(config.admin_legacy_system)
|
|
if(admin_ranks.len)
|
|
if(new_rank in admin_ranks)
|
|
rights = admin_ranks[new_rank] //we typed a rank which already exists, use its rights
|
|
else
|
|
admin_ranks[new_rank] = 0 //add the new rank to admin_ranks
|
|
else
|
|
if(config.admin_legacy_system)
|
|
new_rank = ckeyEx(new_rank)
|
|
rights = admin_ranks[new_rank] //we input an existing rank, use its rights
|
|
|
|
if(D)
|
|
D.disassociate() //remove adminverbs and unlink from client
|
|
D.rank = new_rank //update the rank
|
|
D.rights = rights //update the rights based on admin_ranks (default: 0)
|
|
else
|
|
D = new /datum/admins(new_rank, rights, adm_ckey)
|
|
|
|
var/client/C = directory[adm_ckey] //find the client with the specified ckey (if they are logged in)
|
|
D.associate(C) //link up with the client and add verbs
|
|
|
|
updateranktodb(adm_ckey, new_rank)
|
|
message_admins("[key_name_admin(usr)] edited the admin rank of [adm_ckey] to [new_rank]")
|
|
log_admin("[key_name(usr)] edited the admin rank of [adm_ckey] to [new_rank]")
|
|
log_admin_rank_modification(adm_ckey, new_rank)
|
|
|
|
else if(task == "permissions")
|
|
if(!D) return
|
|
var/list/permissionlist = list()
|
|
for(var/i=1, i<=R_MAXPERMISSION, i<<=1) //that <<= is shorthand for i = i << 1. Which is a left bitshift
|
|
permissionlist[rights2text(i)] = i
|
|
var/new_permission = input("Select a permission to turn on/off", "Permission toggle", null, null) as null|anything in permissionlist
|
|
if(!new_permission) return
|
|
D.rights ^= permissionlist[new_permission]
|
|
|
|
message_admins("[key_name_admin(usr)] toggled the [new_permission] permission of [adm_ckey]")
|
|
log_admin("[key_name(usr)] toggled the [new_permission] permission of [adm_ckey]")
|
|
log_admin_permission_modification(adm_ckey, permissionlist[new_permission])
|
|
|
|
edit_admin_permissions()
|
|
|
|
else if(href_list["call_shuttle"])
|
|
if(!check_rights(R_ADMIN)) return
|
|
|
|
|
|
switch(href_list["call_shuttle"])
|
|
if("1")
|
|
if(shuttle_master.emergency.mode >= SHUTTLE_DOCKED)
|
|
return
|
|
shuttle_master.emergency.request()
|
|
log_admin("[key_name(usr)] called the Emergency Shuttle")
|
|
message_admins("<span class='adminnotice'>[key_name_admin(usr)] called the Emergency Shuttle to the station</span>")
|
|
|
|
if("2")
|
|
if(shuttle_master.emergency.mode >= SHUTTLE_DOCKED)
|
|
return
|
|
switch(shuttle_master.emergency.mode)
|
|
if(SHUTTLE_CALL)
|
|
shuttle_master.emergency.cancel()
|
|
log_admin("[key_name(usr)] sent the Emergency Shuttle back")
|
|
message_admins("<span class='adminnotice'>[key_name_admin(usr)] sent the Emergency Shuttle back</span>")
|
|
else
|
|
shuttle_master.emergency.cancel()
|
|
log_admin("[key_name(usr)] called the Emergency Shuttle")
|
|
message_admins("<span class='adminnotice'>[key_name_admin(usr)] called the Emergency Shuttle to the station</span>")
|
|
|
|
|
|
href_list["secrets"] = "check_antagonist"
|
|
|
|
else if(href_list["edit_shuttle_time"])
|
|
if(!check_rights(R_SERVER)) return
|
|
|
|
var/timer = input("Enter new shuttle duration (seconds):","Edit Shuttle Timeleft", shuttle_master.emergency.timeLeft() ) as num
|
|
shuttle_master.emergency.setTimer(timer*10)
|
|
log_admin("[key_name(usr)] edited the Emergency Shuttle's timeleft to [timer] seconds")
|
|
minor_announcement.Announce("The emergency shuttle will reach its destination in [round(shuttle_master.emergency.timeLeft(600))] minutes.")
|
|
message_admins("<span class='adminnotice'>[key_name_admin(usr)] edited the Emergency Shuttle's timeleft to [timer] seconds</span>")
|
|
href_list["secrets"] = "check_antagonist"
|
|
|
|
else if(href_list["delay_round_end"])
|
|
if(!check_rights(R_SERVER)) return
|
|
|
|
ticker.delay_end = !ticker.delay_end
|
|
log_admin("[key_name(usr)] [ticker.delay_end ? "delayed the round end" : "has made the round end normally"].")
|
|
message_admins("\blue [key_name_admin(usr)] [ticker.delay_end ? "delayed the round end" : "has made the round end normally"].", 1)
|
|
href_list["secretsadmin"] = "check_antagonist"
|
|
|
|
else if(href_list["simplemake"])
|
|
if(!check_rights(R_SPAWN)) return
|
|
|
|
var/mob/M = locate(href_list["mob"])
|
|
if(!ismob(M))
|
|
to_chat(usr, "This can only be used on instances of type /mob")
|
|
return
|
|
|
|
var/delmob = 0
|
|
switch(alert("Delete old mob?","Message","Yes","No","Cancel"))
|
|
if("Cancel") return
|
|
if("Yes") delmob = 1
|
|
|
|
log_admin("[key_name(usr)] has used rudimentary transformation on [key_name(M)]. Transforming to [href_list["simplemake"]]; deletemob=[delmob]")
|
|
message_admins("\blue [key_name_admin(usr)] has used rudimentary transformation on [key_name_admin(M)]. Transforming to [href_list["simplemake"]]; deletemob=[delmob]", 1)
|
|
|
|
switch(href_list["simplemake"])
|
|
if("observer") M.change_mob_type( /mob/dead/observer , null, null, delmob, 1 )
|
|
if("drone") M.change_mob_type( /mob/living/carbon/alien/humanoid/drone , null, null, delmob, 1 )
|
|
if("hunter") M.change_mob_type( /mob/living/carbon/alien/humanoid/hunter , null, null, delmob, 1 )
|
|
if("queen") M.change_mob_type( /mob/living/carbon/alien/humanoid/queen/large , null, null, delmob, 1 )
|
|
if("sentinel") M.change_mob_type( /mob/living/carbon/alien/humanoid/sentinel , null, null, delmob, 1 )
|
|
if("larva") M.change_mob_type( /mob/living/carbon/alien/larva , null, null, delmob, 1 )
|
|
if("human") M.change_mob_type( /mob/living/carbon/human/human , null, null, delmob, 1 )
|
|
if("slime") M.change_mob_type( /mob/living/carbon/slime , null, null, delmob, 1 )
|
|
if("monkey") M.change_mob_type( /mob/living/carbon/human/monkey , null, null, delmob, 1 )
|
|
if("robot") M.change_mob_type( /mob/living/silicon/robot , null, null, delmob, 1 )
|
|
if("cat") M.change_mob_type( /mob/living/simple_animal/pet/cat , null, null, delmob, 1 )
|
|
if("runtime") M.change_mob_type( /mob/living/simple_animal/pet/cat/Runtime , null, null, delmob, 1 )
|
|
if("corgi") M.change_mob_type( /mob/living/simple_animal/pet/corgi , null, null, delmob, 1 )
|
|
if("ian") M.change_mob_type( /mob/living/simple_animal/pet/corgi/Ian , null, null, delmob, 1 )
|
|
if("crab") M.change_mob_type( /mob/living/simple_animal/crab , null, null, delmob, 1 )
|
|
if("coffee") M.change_mob_type( /mob/living/simple_animal/crab/Coffee , null, null, delmob, 1 )
|
|
if("parrot") M.change_mob_type( /mob/living/simple_animal/parrot , null, null, delmob, 1 )
|
|
if("polyparrot") M.change_mob_type( /mob/living/simple_animal/parrot/Poly , null, null, delmob, 1 )
|
|
if("constructarmoured") M.change_mob_type( /mob/living/simple_animal/construct/armoured , null, null, delmob, 1 )
|
|
if("constructbuilder") M.change_mob_type( /mob/living/simple_animal/construct/builder , null, null, delmob, 1 )
|
|
if("constructwraith") M.change_mob_type( /mob/living/simple_animal/construct/wraith , null, null, delmob, 1 )
|
|
if("shade") M.change_mob_type( /mob/living/simple_animal/shade , null, null, delmob, 1 )
|
|
|
|
|
|
/////////////////////////////////////new ban stuff
|
|
else if(href_list["unbanf"])
|
|
if(!check_rights(R_BAN)) return
|
|
|
|
var/banfolder = href_list["unbanf"]
|
|
Banlist.cd = "/base/[banfolder]"
|
|
var/key = Banlist["key"]
|
|
if(alert(usr, "Are you sure you want to unban [key]?", "Confirmation", "Yes", "No") == "Yes")
|
|
if(RemoveBan(banfolder))
|
|
unbanpanel()
|
|
else
|
|
alert(usr, "This ban has already been lifted / does not exist.", "Error", "Ok")
|
|
unbanpanel()
|
|
|
|
else if(href_list["warn"])
|
|
usr.client.warn(href_list["warn"])
|
|
|
|
else if(href_list["unbane"])
|
|
if(!check_rights(R_BAN)) return
|
|
|
|
UpdateTime()
|
|
var/reason
|
|
|
|
var/banfolder = href_list["unbane"]
|
|
Banlist.cd = "/base/[banfolder]"
|
|
var/reason2 = Banlist["reason"]
|
|
var/temp = Banlist["temp"]
|
|
|
|
var/minutes = Banlist["minutes"]
|
|
|
|
var/banned_key = Banlist["key"]
|
|
Banlist.cd = "/base"
|
|
|
|
var/duration
|
|
|
|
switch(alert("Temporary Ban?",,"Yes","No"))
|
|
if("Yes")
|
|
temp = 1
|
|
var/mins = 0
|
|
if(minutes > CMinutes)
|
|
mins = minutes - CMinutes
|
|
mins = input(usr,"How long (in minutes)? (Default: 1440)","Ban time",mins ? mins : 1440) as num|null
|
|
if(!mins) return
|
|
mins = min(525599,mins)
|
|
minutes = CMinutes + mins
|
|
duration = GetExp(minutes)
|
|
reason = input(usr,"Please state the reason","Reason",reason2) as message|null
|
|
if(!reason) return
|
|
if("No")
|
|
temp = 0
|
|
duration = "Perma"
|
|
reason = input(usr,"Please state the reason","Reason",reason2) as message|null
|
|
if(!reason) return
|
|
|
|
log_admin("[key_name(usr)] edited [banned_key]'s ban. Reason: [reason] Duration: [duration]")
|
|
ban_unban_log_save("[key_name(usr)] edited [banned_key]'s ban. Reason: [reason] Duration: [duration]")
|
|
message_admins("\blue [key_name_admin(usr)] edited [banned_key]'s ban. Reason: [reason] Duration: [duration]", 1)
|
|
Banlist.cd = "/base/[banfolder]"
|
|
to_chat(Banlist["reason"], reason)
|
|
to_chat(Banlist["temp"], temp)
|
|
to_chat(Banlist["minutes"], minutes)
|
|
to_chat(Banlist["bannedby"], usr.ckey)
|
|
Banlist.cd = "/base"
|
|
feedback_inc("ban_edit",1)
|
|
unbanpanel()
|
|
|
|
/////////////////////////////////////new ban stuff
|
|
|
|
else if(href_list["appearanceban"])
|
|
if(!check_rights(R_BAN))
|
|
return
|
|
var/mob/M = locate(href_list["appearanceban"])
|
|
if(!ismob(M))
|
|
to_chat(usr, "This can only be used on instances of type /mob")
|
|
return
|
|
if(!M.ckey) //sanity
|
|
to_chat(usr, "This mob has no ckey")
|
|
return
|
|
|
|
var/banreason = appearance_isbanned(M)
|
|
if(banreason)
|
|
/* if(!config.ban_legacy_system)
|
|
to_chat(usr, "Unfortunately, database based unbanning cannot be done through this panel")
|
|
DB_ban_panel(M.ckey)
|
|
return */
|
|
switch(alert("Reason: '[banreason]' Remove appearance ban?","Please Confirm","Yes","No"))
|
|
if("Yes")
|
|
ban_unban_log_save("[key_name(usr)] removed [key_name(M)]'s appearance ban")
|
|
log_admin("[key_name(usr)] removed [key_name(M)]'s appearance ban")
|
|
feedback_inc("ban_appearance_unban", 1)
|
|
DB_ban_unban(M.ckey, BANTYPE_APPEARANCE)
|
|
appearance_unban(M)
|
|
message_admins("\blue [key_name_admin(usr)] removed [key_name_admin(M)]'s appearance ban", 1)
|
|
to_chat(M, "\red<BIG><B>[usr.client.ckey] has removed your appearance ban.</B></BIG>")
|
|
|
|
else switch(alert("Appearance ban [M.ckey]?",,"Yes","No", "Cancel"))
|
|
if("Yes")
|
|
var/reason = input(usr,"Please state the reason","Reason") as message|null
|
|
if(!reason)
|
|
return
|
|
ban_unban_log_save("[key_name(usr)] appearance banned [key_name(M)]. reason: [reason]")
|
|
log_admin("[key_name(usr)] appearance banned [key_name(M)]. \nReason: [reason]")
|
|
feedback_inc("ban_appearance",1)
|
|
DB_ban_record(BANTYPE_APPEARANCE, M, -1, reason)
|
|
appearance_fullban(M, "[reason]; By [usr.ckey] on [time2text(world.realtime)]")
|
|
add_note(M.ckey, "Appearance banned - [reason]", null, usr, 0)
|
|
message_admins("\blue [key_name_admin(usr)] appearance banned [key_name_admin(M)]", 1)
|
|
to_chat(M, "\red<BIG><B>You have been appearance banned by [usr.client.ckey].</B></BIG>")
|
|
to_chat(M, "\red <B>The reason is: [reason]</B>")
|
|
to_chat(M, "\red Appearance ban can be lifted only upon request.")
|
|
if(config.banappeals)
|
|
to_chat(M, "\red To try to resolve this matter head to [config.banappeals]")
|
|
else
|
|
to_chat(M, "\red No ban appeals URL has been set.")
|
|
if("No")
|
|
return
|
|
|
|
else if(href_list["jobban2"])
|
|
// if(!check_rights(R_BAN)) return
|
|
|
|
var/mob/M = locate(href_list["jobban2"])
|
|
if(!ismob(M))
|
|
to_chat(usr, "This can only be used on instances of type /mob")
|
|
return
|
|
|
|
if(!M.ckey) //sanity
|
|
to_chat(usr, "This mob has no ckey")
|
|
return
|
|
if(!job_master)
|
|
to_chat(usr, "Job Master has not been setup!")
|
|
return
|
|
|
|
var/dat = ""
|
|
var/header = "<head><title>Job-Ban Panel: [M.name]</title></head>"
|
|
var/body
|
|
var/jobs = ""
|
|
|
|
/***********************************WARNING!************************************
|
|
The jobban stuff looks mangled and disgusting
|
|
But it looks beautiful in-game
|
|
-Nodrak
|
|
************************************WARNING!***********************************/
|
|
var/counter = 0
|
|
//Regular jobs
|
|
//Command (Blue)
|
|
jobs += "<table cellpadding='1' cellspacing='0' width='100%'>"
|
|
jobs += "<tr align='center' bgcolor='ccccff'><th colspan='[length(command_positions)]'><a href='?src=\ref[src];jobban3=commanddept;jobban4=\ref[M]'>Command Positions</a></th></tr><tr align='center'>"
|
|
for(var/jobPos in command_positions)
|
|
if(!jobPos) continue
|
|
var/datum/job/job = job_master.GetJob(jobPos)
|
|
if(!job) continue
|
|
|
|
if(jobban_isbanned(M, job.title))
|
|
jobs += "<td width='20%'><a href='?src=\ref[src];jobban3=[job.title];jobban4=\ref[M]'><font color=red>[replacetext(job.title, " ", " ")]</font></a></td>"
|
|
counter++
|
|
else
|
|
jobs += "<td width='20%'><a href='?src=\ref[src];jobban3=[job.title];jobban4=\ref[M]'>[replacetext(job.title, " ", " ")]</a></td>"
|
|
counter++
|
|
|
|
if(counter >= 6) //So things dont get squiiiiished!
|
|
jobs += "</tr><tr>"
|
|
counter = 0
|
|
jobs += "</tr></table>"
|
|
|
|
//Security (Red)
|
|
counter = 0
|
|
jobs += "<table cellpadding='1' cellspacing='0' width='100%'>"
|
|
jobs += "<tr bgcolor='ffddf0'><th colspan='[length(security_positions)]'><a href='?src=\ref[src];jobban3=securitydept;jobban4=\ref[M]'>Security Positions</a></th></tr><tr align='center'>"
|
|
for(var/jobPos in security_positions)
|
|
if(!jobPos) continue
|
|
var/datum/job/job = job_master.GetJob(jobPos)
|
|
if(!job) continue
|
|
|
|
if(jobban_isbanned(M, job.title))
|
|
jobs += "<td width='20%'><a href='?src=\ref[src];jobban3=[job.title];jobban4=\ref[M]'><font color=red>[replacetext(job.title, " ", " ")]</font></a></td>"
|
|
counter++
|
|
else
|
|
jobs += "<td width='20%'><a href='?src=\ref[src];jobban3=[job.title];jobban4=\ref[M]'>[replacetext(job.title, " ", " ")]</a></td>"
|
|
counter++
|
|
|
|
if(counter >= 5) //So things dont get squiiiiished!
|
|
jobs += "</tr><tr align='center'>"
|
|
counter = 0
|
|
jobs += "</tr></table>"
|
|
|
|
//Engineering (Yellow)
|
|
counter = 0
|
|
jobs += "<table cellpadding='1' cellspacing='0' width='100%'>"
|
|
jobs += "<tr bgcolor='fff5cc'><th colspan='[length(engineering_positions)]'><a href='?src=\ref[src];jobban3=engineeringdept;jobban4=\ref[M]'>Engineering Positions</a></th></tr><tr align='center'>"
|
|
for(var/jobPos in engineering_positions)
|
|
if(!jobPos) continue
|
|
var/datum/job/job = job_master.GetJob(jobPos)
|
|
if(!job) continue
|
|
|
|
if(jobban_isbanned(M, job.title))
|
|
jobs += "<td width='20%'><a href='?src=\ref[src];jobban3=[job.title];jobban4=\ref[M]'><font color=red>[replacetext(job.title, " ", " ")]</font></a></td>"
|
|
counter++
|
|
else
|
|
jobs += "<td width='20%'><a href='?src=\ref[src];jobban3=[job.title];jobban4=\ref[M]'>[replacetext(job.title, " ", " ")]</a></td>"
|
|
counter++
|
|
|
|
if(counter >= 5) //So things dont get squiiiiished!
|
|
jobs += "</tr><tr align='center'>"
|
|
counter = 0
|
|
jobs += "</tr></table>"
|
|
|
|
//Medical (White)
|
|
counter = 0
|
|
jobs += "<table cellpadding='1' cellspacing='0' width='100%'>"
|
|
jobs += "<tr bgcolor='ffeef0'><th colspan='[length(medical_positions)]'><a href='?src=\ref[src];jobban3=medicaldept;jobban4=\ref[M]'>Medical Positions</a></th></tr><tr align='center'>"
|
|
for(var/jobPos in medical_positions)
|
|
if(!jobPos) continue
|
|
var/datum/job/job = job_master.GetJob(jobPos)
|
|
if(!job) continue
|
|
|
|
if(jobban_isbanned(M, job.title))
|
|
jobs += "<td width='20%'><a href='?src=\ref[src];jobban3=[job.title];jobban4=\ref[M]'><font color=red>[replacetext(job.title, " ", " ")]</font></a></td>"
|
|
counter++
|
|
else
|
|
jobs += "<td width='20%'><a href='?src=\ref[src];jobban3=[job.title];jobban4=\ref[M]'>[replacetext(job.title, " ", " ")]</a></td>"
|
|
counter++
|
|
|
|
if(counter >= 5) //So things dont get squiiiiished!
|
|
jobs += "</tr><tr align='center'>"
|
|
counter = 0
|
|
jobs += "</tr></table>"
|
|
|
|
//Science (Purple)
|
|
counter = 0
|
|
jobs += "<table cellpadding='1' cellspacing='0' width='100%'>"
|
|
jobs += "<tr bgcolor='e79fff'><th colspan='[length(science_positions)]'><a href='?src=\ref[src];jobban3=sciencedept;jobban4=\ref[M]'>Science Positions</a></th></tr><tr align='center'>"
|
|
for(var/jobPos in science_positions)
|
|
if(!jobPos) continue
|
|
var/datum/job/job = job_master.GetJob(jobPos)
|
|
if(!job) continue
|
|
|
|
if(jobban_isbanned(M, job.title))
|
|
jobs += "<td width='20%'><a href='?src=\ref[src];jobban3=[job.title];jobban4=\ref[M]'><font color=red>[replacetext(job.title, " ", " ")]</font></a></td>"
|
|
counter++
|
|
else
|
|
jobs += "<td width='20%'><a href='?src=\ref[src];jobban3=[job.title];jobban4=\ref[M]'>[replacetext(job.title, " ", " ")]</a></td>"
|
|
counter++
|
|
|
|
if(counter >= 5) //So things dont get squiiiiished!
|
|
jobs += "</tr><tr align='center'>"
|
|
counter = 0
|
|
jobs += "</tr></table>"
|
|
|
|
//Support (Grey)
|
|
counter = 0
|
|
jobs += "<table cellpadding='1' cellspacing='0' width='100%'>"
|
|
jobs += "<tr bgcolor='dddddd'><th colspan='[length(support_positions)]'><a href='?src=\ref[src];jobban3=supportdept;jobban4=\ref[M]'>Support Positions</a></th></tr><tr align='center'>"
|
|
for(var/jobPos in support_positions)
|
|
if(!jobPos) continue
|
|
var/datum/job/job = job_master.GetJob(jobPos)
|
|
if(!job) continue
|
|
|
|
if(jobban_isbanned(M, job.title))
|
|
jobs += "<td width='20%'><a href='?src=\ref[src];jobban3=[job.title];jobban4=\ref[M]'><font color=red>[replacetext(job.title, " ", " ")]</font></a></td>"
|
|
counter++
|
|
else
|
|
jobs += "<td width='20%'><a href='?src=\ref[src];jobban3=[job.title];jobban4=\ref[M]'>[replacetext(job.title, " ", " ")]</a></td>"
|
|
counter++
|
|
|
|
if(counter >= 5) //So things dont get squiiiiished!
|
|
jobs += "</tr><tr align='center'>"
|
|
counter = 0
|
|
jobs += "</tr></table>"
|
|
|
|
//Non-Human (Green)
|
|
counter = 0
|
|
jobs += "<table cellpadding='1' cellspacing='0' width='100%'>"
|
|
jobs += "<tr bgcolor='ccffcc'><th colspan='[length(nonhuman_positions)+1]'><a href='?src=\ref[src];jobban3=nonhumandept;jobban4=\ref[M]'>Non-human Positions</a></th></tr><tr align='center'>"
|
|
for(var/jobPos in nonhuman_positions)
|
|
if(!jobPos) continue
|
|
var/datum/job/job = job_master.GetJob(jobPos)
|
|
if(!job) continue
|
|
|
|
if(jobban_isbanned(M, job.title))
|
|
jobs += "<td width='20%'><a href='?src=\ref[src];jobban3=[job.title];jobban4=\ref[M]'><font color=red>[replacetext(job.title, " ", " ")]</font></a></td>"
|
|
counter++
|
|
else
|
|
jobs += "<td width='20%'><a href='?src=\ref[src];jobban3=[job.title];jobban4=\ref[M]'>[replacetext(job.title, " ", " ")]</a></td>"
|
|
counter++
|
|
|
|
if(counter >= 5) //So things dont get squiiiiished!
|
|
jobs += "</tr><tr align='center'>"
|
|
counter = 0
|
|
|
|
//Drone
|
|
if(jobban_isbanned(M, "Drone"))
|
|
jobs += "<td width='20%'><a href='?src=\ref[src];jobban3=Drone;jobban4=\ref[M]'><font color=red>Drone</font></a></td>"
|
|
else
|
|
jobs += "<td width='20%'><a href='?src=\ref[src];jobban3=Drone;jobban4=\ref[M]'>Drone</a></td>"
|
|
|
|
//pAI
|
|
if(jobban_isbanned(M, "pAI"))
|
|
jobs += "<td width='20%'><a href='?src=\ref[src];jobban3=pAI;jobban4=\ref[M]'><font color=red>pAI</font></a></td>"
|
|
else
|
|
jobs += "<td width='20%'><a href='?src=\ref[src];jobban3=pAI;jobban4=\ref[M]'>pAI</a></td>"
|
|
|
|
jobs += "</tr></table>"
|
|
|
|
//Antagonist (Orange)
|
|
var/isbanned_dept = jobban_isbanned(M, "Syndicate")
|
|
jobs += "<table cellpadding='1' cellspacing='0' width='100%'>"
|
|
jobs += "<tr bgcolor='ffeeaa'><th colspan='10'><a href='?src=\ref[src];jobban3=Syndicate;jobban4=\ref[M]'>Antagonist Positions</a></th></tr><tr align='center'>"
|
|
|
|
counter = 0
|
|
for(var/role in antag_roles)
|
|
if(jobban_isbanned(M, role) || isbanned_dept)
|
|
jobs += "<td width='20%'><a href='?src=\ref[src];jobban3=[role];jobban4=\ref[M]'><font color=red>[replacetext(role, " ", " ")]</font></a></td>"
|
|
else
|
|
jobs += "<td width='20%'><a href='?src=\ref[src];jobban3=[role];jobban4=\ref[M]'>[replacetext(role, " ", " ")]</a></td>"
|
|
counter++
|
|
|
|
if(counter >= 5) //So things dont get squiiiiished!
|
|
jobs += "</tr><tr align='center'>"
|
|
counter = 0
|
|
jobs += "</tr></table>"
|
|
|
|
//Other races (BLUE, because I have no idea what other color to make this)
|
|
jobs += "<table cellpadding='1' cellspacing='0' width='100%'>"
|
|
jobs += "<tr bgcolor='ccccff'><th colspan='10'>Other</th></tr><tr align='center'>"
|
|
|
|
counter = 0
|
|
for(var/role in other_roles)
|
|
if(jobban_isbanned(M, role) || isbanned_dept)
|
|
jobs += "<td width='20%'><a href='?src=\ref[src];jobban3=[role];jobban4=\ref[M]'><font color=red>[replacetext(role, " ", " ")]</font></a></td>"
|
|
else
|
|
jobs += "<td width='20%'><a href='?src=\ref[src];jobban3=[role];jobban4=\ref[M]'>[replacetext(role, " ", " ")]</a></td>"
|
|
counter++
|
|
|
|
if(counter >= 5) //So things dont get squiiiiished!
|
|
jobs += "</tr><tr align='center'>"
|
|
counter = 0
|
|
jobs += "</tr></table>"
|
|
|
|
//Whitelisted positions
|
|
counter = 0
|
|
jobs += "<table cellpadding='1' cellspacing='0' width='100%'>"
|
|
jobs += "<tr bgcolor='dddddd'><th colspan='[length(whitelisted_positions)]'><a href='?src=\ref[src];jobban3=whitelistdept;jobban4=\ref[M]'>Whitelisted Positions</a></th></tr><tr align='center'>"
|
|
for(var/jobPos in whitelisted_positions)
|
|
if(!jobPos) continue
|
|
var/datum/job/job = job_master.GetJob(jobPos)
|
|
if(!job) continue
|
|
|
|
if(jobban_isbanned(M, job.title))
|
|
jobs += "<td width='20%'><a href='?src=\ref[src];jobban3=[job.title];jobban4=\ref[M]'><font color=red>[replacetext(job.title, " ", " ")]</font></a></td>"
|
|
counter++
|
|
else
|
|
jobs += "<td width='20%'><a href='?src=\ref[src];jobban3=[job.title];jobban4=\ref[M]'>[replacetext(job.title, " ", " ")]</a></td>"
|
|
counter++
|
|
|
|
if(counter >= 5) //So things dont get squiiiiished!
|
|
jobs += "</tr><tr align='center'>"
|
|
counter = 0
|
|
jobs += "</tr></table>"
|
|
|
|
body = "<body>[jobs]</body>"
|
|
dat = "<tt>[header][body]</tt>"
|
|
usr << browse(dat, "window=jobban2;size=800x490")
|
|
return
|
|
|
|
//JOBBAN'S INNARDS
|
|
else if(href_list["jobban3"])
|
|
if(!check_rights(R_BAN)) return
|
|
|
|
var/mob/M = locate(href_list["jobban4"])
|
|
if(!ismob(M))
|
|
to_chat(usr, "This can only be used on instances of type /mob")
|
|
return
|
|
|
|
if(M != usr) //we can jobban ourselves
|
|
if(M.client && M.client.holder && (M.client.holder.rights & R_BAN)) //they can ban too. So we can't ban them
|
|
alert("You cannot perform this action. You must be of a higher administrative rank!")
|
|
return
|
|
|
|
if(!job_master)
|
|
to_chat(usr, "Job Master has not been setup!")
|
|
return
|
|
|
|
//get jobs for department if specified, otherwise just returnt he one job in a list.
|
|
var/list/joblist = list()
|
|
switch(href_list["jobban3"])
|
|
if("commanddept")
|
|
for(var/jobPos in command_positions)
|
|
if(!jobPos) continue
|
|
var/datum/job/temp = job_master.GetJob(jobPos)
|
|
if(!temp) continue
|
|
joblist += temp.title
|
|
if("securitydept")
|
|
for(var/jobPos in security_positions)
|
|
if(!jobPos) continue
|
|
var/datum/job/temp = job_master.GetJob(jobPos)
|
|
if(!temp) continue
|
|
joblist += temp.title
|
|
if("engineeringdept")
|
|
for(var/jobPos in engineering_positions)
|
|
if(!jobPos) continue
|
|
var/datum/job/temp = job_master.GetJob(jobPos)
|
|
if(!temp) continue
|
|
joblist += temp.title
|
|
if("medicaldept")
|
|
for(var/jobPos in medical_positions)
|
|
if(!jobPos) continue
|
|
var/datum/job/temp = job_master.GetJob(jobPos)
|
|
if(!temp) continue
|
|
joblist += temp.title
|
|
if("sciencedept")
|
|
for(var/jobPos in science_positions)
|
|
if(!jobPos) continue
|
|
var/datum/job/temp = job_master.GetJob(jobPos)
|
|
if(!temp) continue
|
|
joblist += temp.title
|
|
if("supportdept")
|
|
for(var/jobPos in support_positions)
|
|
if(!jobPos) continue
|
|
var/datum/job/temp = job_master.GetJob(jobPos)
|
|
if(!temp) continue
|
|
joblist += temp.title
|
|
if("nonhumandept")
|
|
joblist += "pAI"
|
|
for(var/jobPos in nonhuman_positions)
|
|
if(!jobPos) continue
|
|
var/datum/job/temp = job_master.GetJob(jobPos)
|
|
if(!temp) continue
|
|
joblist += temp.title
|
|
if("whitelistdept")
|
|
for(var/jobPos in whitelisted_positions)
|
|
if(!jobPos) continue
|
|
var/datum/job/temp = job_master.GetJob(jobPos)
|
|
if(!temp) continue
|
|
joblist += temp.title
|
|
else
|
|
joblist += href_list["jobban3"]
|
|
|
|
//Create a list of unbanned jobs within joblist
|
|
var/list/notbannedlist = list()
|
|
for(var/job in joblist)
|
|
if(!jobban_isbanned(M, job))
|
|
notbannedlist += job
|
|
|
|
//Banning comes first
|
|
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(config.ban_legacy_system)
|
|
to_chat(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
|
|
var/reason = input(usr,"Please state the reason","Reason","") as message|null
|
|
if(!reason)
|
|
return
|
|
|
|
var/msg
|
|
for(var/job in notbannedlist)
|
|
ban_unban_log_save("[key_name(usr)] temp-jobbanned [key_name(M)] from [job] for [mins] minutes. reason: [reason]")
|
|
log_admin("[key_name(usr)] temp-jobbanned [key_name(M)] from [job] for [mins] minutes")
|
|
feedback_inc("ban_job_tmp",1)
|
|
DB_ban_record(BANTYPE_JOB_TEMP, M, mins, reason, job)
|
|
feedback_add_details("ban_job_tmp","- [job]")
|
|
jobban_fullban(M, job, "[reason]; By [usr.ckey] on [time2text(world.realtime)]") //Legacy banning does not support temporary jobbans.
|
|
if(!msg)
|
|
msg = job
|
|
else
|
|
msg += ", [job]"
|
|
add_note(M.ckey, "Banned from [msg] - [reason]", null, usr, 0)
|
|
message_admins("\blue [key_name_admin(usr)] banned [key_name_admin(M)] from [msg] for [mins] minutes", 1)
|
|
to_chat(M, "\red<BIG><B>You have been jobbanned by [usr.client.ckey] from: [msg].</B></BIG>")
|
|
to_chat(M, "\red <B>The reason is: [reason]</B>")
|
|
to_chat(M, "\red This jobban will be lifted in [mins] minutes.")
|
|
href_list["jobban2"] = 1 // lets it fall through and refresh
|
|
return 1
|
|
if("No")
|
|
var/reason = input(usr,"Please state the reason","Reason","") as message|null
|
|
if(reason)
|
|
var/msg
|
|
for(var/job in notbannedlist)
|
|
ban_unban_log_save("[key_name(usr)] perma-jobbanned [key_name(M)] from [job]. reason: [reason]")
|
|
log_admin("[key_name(usr)] perma-banned [key_name(M)] from [job]")
|
|
feedback_inc("ban_job",1)
|
|
DB_ban_record(BANTYPE_JOB_PERMA, M, -1, reason, job)
|
|
feedback_add_details("ban_job","- [job]")
|
|
jobban_fullban(M, job, "[reason]; By [usr.ckey] on [time2text(world.realtime)]")
|
|
if(!msg) msg = job
|
|
else msg += ", [job]"
|
|
add_note(M.ckey, "Banned from [msg] - [reason]", null, usr, 0)
|
|
message_admins("\blue [key_name_admin(usr)] banned [key_name_admin(M)] from [msg]", 1)
|
|
to_chat(M, "\red<BIG><B>You have been jobbanned by [usr.client.ckey] from: [msg].</B></BIG>")
|
|
to_chat(M, "\red <B>The reason is: [reason]</B>")
|
|
to_chat(M, "\red Jobban can be lifted only upon request.")
|
|
href_list["jobban2"] = 1 // lets it fall through and refresh
|
|
return 1
|
|
if("Cancel")
|
|
return
|
|
|
|
//Unbanning joblist
|
|
//all jobs in joblist are banned already OR we didn't give a reason (implying they shouldn't be banned)
|
|
if(joblist.len) //at least 1 banned job exists in joblist so we have stuff to unban.
|
|
if(!config.ban_legacy_system)
|
|
to_chat(usr, "Unfortunately, database based unbanning cannot be done through this panel")
|
|
DB_ban_panel(M.ckey)
|
|
return
|
|
var/msg
|
|
for(var/job in joblist)
|
|
var/reason = jobban_isbanned(M, job)
|
|
if(!reason) continue //skip if it isn't jobbanned anyway
|
|
switch(alert("Job: '[job]' Reason: '[reason]' Un-jobban?","Please Confirm","Yes","No"))
|
|
if("Yes")
|
|
ban_unban_log_save("[key_name(usr)] unjobbanned [key_name(M)] from [job]")
|
|
log_admin("[key_name(usr)] unbanned [key_name(M)] from [job]")
|
|
DB_ban_unban(M.ckey, BANTYPE_JOB_PERMA, job)
|
|
feedback_inc("ban_job_unban",1)
|
|
feedback_add_details("ban_job_unban","- [job]")
|
|
jobban_unban(M, job)
|
|
if(!msg) msg = job
|
|
else msg += ", [job]"
|
|
else
|
|
continue
|
|
if(msg)
|
|
message_admins("\blue [key_name_admin(usr)] unbanned [key_name_admin(M)] from [msg]", 1)
|
|
to_chat(M, "\red<BIG><B>You have been un-jobbanned by [usr.client.ckey] from [msg].</B></BIG>")
|
|
href_list["jobban2"] = 1 // lets it fall through and refresh
|
|
return 1
|
|
return 0 //we didn't do anything!
|
|
|
|
else if(href_list["boot2"])
|
|
var/mob/M = locate(href_list["boot2"])
|
|
if(ismob(M))
|
|
if(!check_if_greater_rights_than(M.client))
|
|
return
|
|
to_chat(M, "\red You have been kicked from the server")
|
|
log_admin("[key_name(usr)] booted [key_name(M)].")
|
|
message_admins("\blue [key_name_admin(usr)] booted [key_name_admin(M)].", 1)
|
|
//M.client = null
|
|
del(M.client)
|
|
|
|
//Player Notes
|
|
else if(href_list["addnote"])
|
|
var/target_ckey = href_list["addnote"]
|
|
add_note(target_ckey)
|
|
|
|
else if(href_list["addnoteempty"])
|
|
add_note()
|
|
|
|
else if(href_list["removenote"])
|
|
var/note_id = href_list["removenote"]
|
|
remove_note(note_id)
|
|
|
|
else if(href_list["editnote"])
|
|
var/note_id = href_list["editnote"]
|
|
edit_note(note_id)
|
|
|
|
else if(href_list["shownote"])
|
|
var/target = href_list["shownote"]
|
|
show_note(index = target)
|
|
|
|
else if(href_list["nonalpha"])
|
|
var/target = href_list["nonalpha"]
|
|
target = text2num(target)
|
|
show_note(index = target)
|
|
|
|
else if(href_list["shownoteckey"])
|
|
var/target_ckey = href_list["shownoteckey"]
|
|
show_note(target_ckey)
|
|
|
|
else if(href_list["notessearch"])
|
|
var/target = href_list["notessearch"]
|
|
show_note(index = target)
|
|
|
|
else if(href_list["noteedits"])
|
|
var/note_id = sanitizeSQL("[href_list["noteedits"]]")
|
|
var/DBQuery/query_noteedits = dbcon.NewQuery("SELECT edits FROM [format_table_name("notes")] WHERE id = '[note_id]'")
|
|
if(!query_noteedits.Execute())
|
|
var/err = query_noteedits.ErrorMsg()
|
|
log_game("SQL ERROR obtaining edits from notes table. Error : \[[err]\]\n")
|
|
return
|
|
if(query_noteedits.NextRow())
|
|
var/edit_log = query_noteedits.item[1]
|
|
usr << browse(edit_log,"window=noteedits")
|
|
|
|
else if(href_list["removejobban"])
|
|
if(!check_rights(R_BAN)) return
|
|
|
|
var/t = href_list["removejobban"]
|
|
if(t)
|
|
if((alert("Do you want to unjobban [t]?","Unjobban confirmation", "Yes", "No") == "Yes") && t) //No more misclicks! Unless you do it twice.
|
|
log_admin("[key_name(usr)] removed [t]")
|
|
message_admins("\blue [key_name_admin(usr)] removed [t]", 1)
|
|
jobban_remove(t)
|
|
href_list["ban"] = 1 // lets it fall through and refresh
|
|
var/t_split = splittext(t, " - ")
|
|
var/key = t_split[1]
|
|
var/job = t_split[2]
|
|
DB_ban_unban(ckey(key), BANTYPE_JOB_PERMA, job)
|
|
|
|
else if(href_list["newban"])
|
|
if(!check_rights(R_BAN)) return
|
|
|
|
var/mob/M = locate(href_list["newban"])
|
|
if(!ismob(M)) return
|
|
|
|
if(M.client && M.client.holder) return //admins cannot be banned. Even if they could, the ban doesn't affect them anyway
|
|
|
|
switch(alert("Temporary Ban?",,"Yes","No", "Cancel"))
|
|
if("Yes")
|
|
var/mins = input(usr,"How long (in minutes)?","Ban time",1440) as num|null
|
|
if(!mins)
|
|
return
|
|
if(mins >= 525600) mins = 525599
|
|
var/reason = input(usr,"Please state the reason","Reason") as message|null
|
|
if(!reason)
|
|
return
|
|
AddBan(M.ckey, M.computer_id, reason, usr.ckey, 1, mins)
|
|
ban_unban_log_save("[usr.client.ckey] has banned [M.ckey]. - Reason: [reason] - This will be removed in [mins] minutes.")
|
|
to_chat(M, "\red<BIG><B>You have been banned by [usr.client.ckey].\nReason: [reason].</B></BIG>")
|
|
to_chat(M, "\red This is a temporary ban, it will be removed in [mins] minutes.")
|
|
feedback_inc("ban_tmp",1)
|
|
DB_ban_record(BANTYPE_TEMP, M, mins, reason)
|
|
feedback_inc("ban_tmp_mins",mins)
|
|
if(config.banappeals)
|
|
to_chat(M, "\red To try to resolve this matter head to [config.banappeals]")
|
|
else
|
|
to_chat(M, "\red No ban appeals URL has been set.")
|
|
log_admin("[key_name(usr)] has banned [M.ckey].\nReason: [reason]\nThis will be removed in [mins] minutes.")
|
|
message_admins("\blue [key_name_admin(usr)] has banned [M.ckey].\nReason: [reason]\nThis will be removed in [mins] minutes.")
|
|
|
|
del(M.client)
|
|
//qdel(M) // See no reason why to delete mob. Important stuff can be lost. And ban can be lifted before round ends.
|
|
if("No")
|
|
var/reason = input(usr,"Please state the reason","Reason") as message|null
|
|
if(!reason)
|
|
return
|
|
switch(alert(usr,"IP ban?",,"Yes","No","Cancel"))
|
|
if("Cancel") return
|
|
if("Yes")
|
|
AddBan(M.ckey, M.computer_id, reason, usr.ckey, 0, 0, M.lastKnownIP)
|
|
if("No")
|
|
AddBan(M.ckey, M.computer_id, reason, usr.ckey, 0, 0)
|
|
to_chat(M, "\red<BIG><B>You have been banned by [usr.client.ckey].\nReason: [reason].</B></BIG>")
|
|
to_chat(M, "\red This is a permanent ban.")
|
|
if(config.banappeals)
|
|
to_chat(M, "\red To try to resolve this matter head to [config.banappeals]")
|
|
else
|
|
to_chat(M, "\red No ban appeals URL has been set.")
|
|
ban_unban_log_save("[usr.client.ckey] has permabanned [M.ckey]. - Reason: [reason] - This is a permanent ban.")
|
|
log_admin("[key_name(usr)] has banned [M.ckey].\nReason: [reason]\nThis is a permanent ban.")
|
|
message_admins("\blue[key_name_admin(usr)] has banned [M.ckey].\nReason: [reason]\nThis is a permanent ban.")
|
|
feedback_inc("ban_perma",1)
|
|
DB_ban_record(BANTYPE_PERMA, M, -1, reason)
|
|
|
|
del(M.client)
|
|
//qdel(M)
|
|
if("Cancel")
|
|
return
|
|
|
|
|
|
//Watchlist
|
|
else if(href_list["watchadd"])
|
|
var/target_ckey = locate(href_list["watchadd"])
|
|
usr.client.watchlist_add(target_ckey)
|
|
|
|
else if(href_list["watchremove"])
|
|
var/target_ckey = href_list["watchremove"]
|
|
var/confirm = alert("Are you sure you want to remove [target_ckey] from the watchlist?", "Confirm Watchlist Removal", "Yes", "No")
|
|
if(confirm == "Yes")
|
|
usr.client.watchlist_remove(target_ckey)
|
|
|
|
else if(href_list["watchedit"])
|
|
var/target_ckey = href_list["watchedit"]
|
|
usr.client.watchlist_edit(target_ckey)
|
|
|
|
else if(href_list["watchaddbrowse"])
|
|
usr.client.watchlist_add(null, 1)
|
|
|
|
else if(href_list["watchremovebrowse"])
|
|
var/target_ckey = href_list["watchremovebrowse"]
|
|
usr.client.watchlist_remove(target_ckey, 1)
|
|
|
|
else if(href_list["watcheditbrowse"])
|
|
var/target_ckey = href_list["watcheditbrowse"]
|
|
usr.client.watchlist_edit(target_ckey, 1)
|
|
|
|
else if(href_list["watchsearch"])
|
|
var/target_ckey = href_list["watchsearch"]
|
|
usr.client.watchlist_show(target_ckey)
|
|
|
|
else if(href_list["watchshow"])
|
|
usr.client.watchlist_show()
|
|
|
|
else if(href_list["watcheditlog"])
|
|
var/target_ckey = sanitizeSQL("[href_list["watcheditlog"]]")
|
|
var/DBQuery/query_watchedits = dbcon.NewQuery("SELECT edits FROM [format_table_name("watch")] WHERE ckey = '[target_ckey]'")
|
|
if(!query_watchedits.Execute())
|
|
var/err = query_watchedits.ErrorMsg()
|
|
log_game("SQL ERROR obtaining edits from watch table. Error : \[[err]\]\n")
|
|
return
|
|
if(query_watchedits.NextRow())
|
|
var/edit_log = query_watchedits.item[1]
|
|
usr << browse(edit_log,"window=watchedits")
|
|
|
|
else if(href_list["mute"])
|
|
if(!check_rights(R_ADMIN|R_MOD))
|
|
return
|
|
|
|
var/mob/M = locate(href_list["mute"])
|
|
if(!ismob(M)) return
|
|
if(!M.client) return
|
|
|
|
var/mute_type = href_list["mute_type"]
|
|
if(istext(mute_type)) mute_type = text2num(mute_type)
|
|
if(!isnum(mute_type)) return
|
|
|
|
cmd_admin_mute(M, mute_type)
|
|
|
|
else if(href_list["c_mode"])
|
|
if(!check_rights(R_ADMIN)) return
|
|
|
|
if(ticker && ticker.mode)
|
|
return alert(usr, "The game has already started.", null, null, null, null)
|
|
var/dat = {"<B>What mode do you wish to play?</B><HR>"}
|
|
for(var/mode in config.modes)
|
|
dat += {"<A href='?src=\ref[src];c_mode2=[mode]'>[config.mode_names[mode]]</A><br>"}
|
|
dat += {"<A href='?src=\ref[src];c_mode2=secret'>Secret</A><br>"}
|
|
dat += {"<A href='?src=\ref[src];c_mode2=random'>Random</A><br>"}
|
|
dat += {"Now: [master_mode]"}
|
|
usr << browse(dat, "window=c_mode")
|
|
|
|
else if(href_list["f_secret"])
|
|
if(!check_rights(R_ADMIN)) return
|
|
|
|
if(ticker && ticker.mode)
|
|
return alert(usr, "The game has already started.", null, null, null, null)
|
|
if(master_mode != "secret")
|
|
return alert(usr, "The game mode has to be secret!", null, null, null, null)
|
|
var/dat = {"<B>What game mode do you want to force secret to be? Use this if you want to change the game mode, but want the players to believe it's secret. This will only work if the current game mode is secret.</B><HR>"}
|
|
for(var/mode in config.modes)
|
|
dat += {"<A href='?src=\ref[src];f_secret2=[mode]'>[config.mode_names[mode]]</A><br>"}
|
|
dat += {"<A href='?src=\ref[src];f_secret2=secret'>Random (default)</A><br>"}
|
|
dat += {"Now: [secret_force_mode]"}
|
|
usr << browse(dat, "window=f_secret")
|
|
|
|
else if(href_list["c_mode2"])
|
|
if(!check_rights(R_ADMIN|R_SERVER)) return
|
|
|
|
if(ticker && ticker.mode)
|
|
return alert(usr, "The game has already started.", null, null, null, null)
|
|
master_mode = href_list["c_mode2"]
|
|
log_admin("[key_name(usr)] set the mode as [master_mode].")
|
|
message_admins("\blue [key_name_admin(usr)] set the mode as [master_mode].", 1)
|
|
to_chat(world, "\blue <b>The mode is now: [master_mode]</b>")
|
|
Game() // updates the main game menu
|
|
world.save_mode(master_mode)
|
|
.(href, list("c_mode"=1))
|
|
|
|
else if(href_list["f_secret2"])
|
|
if(!check_rights(R_ADMIN|R_SERVER)) return
|
|
|
|
if(ticker && ticker.mode)
|
|
return alert(usr, "The game has already started.", null, null, null, null)
|
|
if(master_mode != "secret")
|
|
return alert(usr, "The game mode has to be secret!", null, null, null, null)
|
|
secret_force_mode = href_list["f_secret2"]
|
|
log_admin("[key_name(usr)] set the forced secret mode as [secret_force_mode].")
|
|
message_admins("\blue [key_name_admin(usr)] set the forced secret mode as [secret_force_mode].", 1)
|
|
Game() // updates the main game menu
|
|
.(href, list("f_secret"=1))
|
|
|
|
else if(href_list["monkeyone"])
|
|
if(!check_rights(R_SPAWN)) return
|
|
|
|
var/mob/living/carbon/human/H = locate(href_list["monkeyone"])
|
|
if(!istype(H))
|
|
to_chat(usr, "This can only be used on instances of type /mob/living/carbon/human")
|
|
return
|
|
if(alert(usr, "Confirm make monkey?",, "Yes", "No") != "Yes")
|
|
return
|
|
|
|
log_admin("[key_name(usr)] attempting to monkeyize [key_name(H)]")
|
|
message_admins("\blue [key_name_admin(usr)] attempting to monkeyize [key_name_admin(H)]", 1)
|
|
H.monkeyize()
|
|
|
|
|
|
else if(href_list["corgione"])
|
|
if(!check_rights(R_SPAWN)) return
|
|
|
|
var/mob/living/carbon/human/H = locate(href_list["corgione"])
|
|
if(!istype(H))
|
|
to_chat(usr, "This can only be used on instances of type /mob/living/carbon/human")
|
|
return
|
|
|
|
if(alert(usr, "Confirm make corgi?",, "Yes", "No") != "Yes")
|
|
return
|
|
|
|
log_admin("[key_name(usr)] attempting to corgize [key_name(H)]")
|
|
message_admins("\blue [key_name_admin(usr)] attempting to corgize [key_name_admin(H)]", 1)
|
|
H.corgize()
|
|
|
|
else if(href_list["makePAI"])
|
|
if(!check_rights(R_SPAWN)) return
|
|
|
|
var/mob/living/carbon/human/H = locate(href_list["makePAI"])
|
|
if(!istype(H))
|
|
to_chat(usr, "This can only be used on instances of type /mob/living/carbon/human")
|
|
return
|
|
if(alert(usr, "Confirm make pai?",, "Yes", "No") != "Yes")
|
|
return
|
|
|
|
var/painame = "Default"
|
|
var/name = ""
|
|
if(alert(usr, "Do you want to set their name or let them choose their own name?", "Name Choice", "Set Name", "Let them choose") == "Set Name")
|
|
name = sanitize(copytext(input(usr, "Enter a name for the new pAI. Default name is [painame].", "pAI Name", painame),1,MAX_NAME_LEN))
|
|
else
|
|
name = sanitize(copytext(input(H, "An admin wants to make you into a pAI. Choose a name. Default is [painame].", "pAI Name", painame),1,MAX_NAME_LEN))
|
|
|
|
if(!name)
|
|
name = painame
|
|
|
|
log_admin("[key_name(usr)] attempting to pAIze [key_name(H)]")
|
|
message_admins("\blue [key_name_admin(usr)] attempting to pAIze [key_name_admin(H)]", 1)
|
|
H.paize(name)
|
|
|
|
else if(href_list["forcespeech"])
|
|
if(!check_rights(R_SERVER|R_EVENT)) return
|
|
|
|
var/mob/M = locate(href_list["forcespeech"])
|
|
if(!ismob(M))
|
|
to_chat(usr, "this can only be used on instances of type /mob")
|
|
|
|
var/speech = input("What will [key_name(M)] say?.", "Force speech", "")// Don't need to sanitize, since it does that in say(), we also trust our admins.
|
|
if(!speech) return
|
|
M.say(speech)
|
|
speech = sanitize(speech) // Nah, we don't trust them
|
|
log_admin("[key_name(usr)] forced [key_name(M)] to say: [speech]")
|
|
message_admins("\blue [key_name_admin(usr)] forced [key_name_admin(M)] to say: [speech]")
|
|
|
|
else if(href_list["sendtoprison"])
|
|
if(!check_rights(R_ADMIN)) return
|
|
|
|
if(alert(usr, "Send to admin prison for the round?", "Message", "Yes", "No") != "Yes")
|
|
return
|
|
|
|
var/mob/M = locate(href_list["sendtoprison"])
|
|
if(!ismob(M))
|
|
to_chat(usr, "This can only be used on instances of type /mob")
|
|
return
|
|
if(istype(M, /mob/living/silicon/ai))
|
|
to_chat(usr, "This cannot be used on instances of type /mob/living/silicon/ai")
|
|
return
|
|
|
|
var/turf/prison_cell = pick(prisonwarp)
|
|
if(!prison_cell) return
|
|
|
|
var/obj/structure/closet/secure_closet/brig/locker = new /obj/structure/closet/secure_closet/brig(prison_cell)
|
|
locker.opened = 0
|
|
locker.locked = 1
|
|
|
|
//strip their stuff and stick it in the crate
|
|
for(var/obj/item/I in M)
|
|
M.unEquip(I)
|
|
if(I)
|
|
I.loc = locker
|
|
I.layer = initial(I.layer)
|
|
I.plane = initial(I.plane)
|
|
I.dropped(M)
|
|
M.update_icons()
|
|
|
|
//so they black out before warping
|
|
M.Paralyse(5)
|
|
sleep(5)
|
|
if(!M) return
|
|
|
|
M.loc = prison_cell
|
|
if(istype(M, /mob/living/carbon/human))
|
|
var/mob/living/carbon/human/prisoner = M
|
|
prisoner.equip_to_slot_or_del(new /obj/item/clothing/under/color/orange(prisoner), slot_w_uniform)
|
|
prisoner.equip_to_slot_or_del(new /obj/item/clothing/shoes/orange(prisoner), slot_shoes)
|
|
|
|
to_chat(M, "\red You have been sent to the prison station!")
|
|
log_admin("[key_name(usr)] sent [key_name(M)] to the prison station.")
|
|
message_admins("\blue [key_name_admin(usr)] sent [key_name_admin(M)] to the prison station.", 1)
|
|
|
|
else if(href_list["sendbacktolobby"])
|
|
if(!check_rights(R_ADMIN))
|
|
return
|
|
|
|
var/mob/M = locate(href_list["sendbacktolobby"])
|
|
|
|
if(!isobserver(M))
|
|
to_chat(usr, "<span class='notice'>You can only send ghost players back to the Lobby.</span>")
|
|
return
|
|
|
|
if(!M.client)
|
|
to_chat(usr, "<span class='warning'>[M] doesn't seem to have an active client.</span>")
|
|
return
|
|
|
|
if(alert(usr, "Send [key_name(M)] back to Lobby?", "Message", "Yes", "No") != "Yes")
|
|
return
|
|
|
|
log_admin("[key_name(usr)] has sent [key_name(M)] back to the Lobby.")
|
|
message_admins("[key_name_admin(usr)] has sent [key_name_admin(M)] back to the Lobby.")
|
|
|
|
var/mob/new_player/NP = new()
|
|
NP.ckey = M.ckey
|
|
qdel(M)
|
|
|
|
else if(href_list["tdome1"])
|
|
if(!check_rights(R_SERVER|R_EVENT)) return
|
|
|
|
if(alert(usr, "Confirm?", "Message", "Yes", "No") != "Yes")
|
|
return
|
|
|
|
var/mob/M = locate(href_list["tdome1"])
|
|
if(!ismob(M))
|
|
to_chat(usr, "This can only be used on instances of type /mob")
|
|
return
|
|
if(istype(M, /mob/living/silicon/ai))
|
|
to_chat(usr, "This cannot be used on instances of type /mob/living/silicon/ai")
|
|
return
|
|
|
|
for(var/obj/item/I in M)
|
|
M.unEquip(I)
|
|
if(I)
|
|
I.loc = M.loc
|
|
I.layer = initial(I.layer)
|
|
I.plane = initial(I.plane)
|
|
I.dropped(M)
|
|
|
|
M.Paralyse(5)
|
|
sleep(5)
|
|
M.loc = pick(tdome1)
|
|
spawn(50)
|
|
to_chat(M, "\blue You have been sent to the Thunderdome.")
|
|
log_admin("[key_name(usr)] has sent [key_name(M)] to the thunderdome. (Team 1)")
|
|
message_admins("[key_name_admin(usr)] has sent [key_name_admin(M)] to the thunderdome. (Team 1)", 1)
|
|
|
|
else if(href_list["tdome2"])
|
|
if(!check_rights(R_SERVER|R_EVENT)) return
|
|
|
|
if(alert(usr, "Confirm?", "Message", "Yes", "No") != "Yes")
|
|
return
|
|
|
|
var/mob/M = locate(href_list["tdome2"])
|
|
if(!ismob(M))
|
|
to_chat(usr, "This can only be used on instances of type /mob")
|
|
return
|
|
if(istype(M, /mob/living/silicon/ai))
|
|
to_chat(usr, "This cannot be used on instances of type /mob/living/silicon/ai")
|
|
return
|
|
|
|
for(var/obj/item/I in M)
|
|
M.unEquip(I)
|
|
if(I)
|
|
I.loc = M.loc
|
|
I.layer = initial(I.layer)
|
|
I.plane = initial(I.plane)
|
|
I.dropped(M)
|
|
|
|
M.Paralyse(5)
|
|
sleep(5)
|
|
M.loc = pick(tdome2)
|
|
spawn(50)
|
|
to_chat(M, "\blue You have been sent to the Thunderdome.")
|
|
log_admin("[key_name(usr)] has sent [key_name(M)] to the thunderdome. (Team 2)")
|
|
message_admins("[key_name_admin(usr)] has sent [key_name_admin(M)] to the thunderdome. (Team 2)", 1)
|
|
|
|
else if(href_list["tdomeadmin"])
|
|
if(!check_rights(R_SERVER|R_EVENT)) return
|
|
|
|
if(alert(usr, "Confirm?", "Message", "Yes", "No") != "Yes")
|
|
return
|
|
|
|
var/mob/M = locate(href_list["tdomeadmin"])
|
|
if(!ismob(M))
|
|
to_chat(usr, "This can only be used on instances of type /mob")
|
|
return
|
|
if(istype(M, /mob/living/silicon/ai))
|
|
to_chat(usr, "This cannot be used on instances of type /mob/living/silicon/ai")
|
|
return
|
|
|
|
M.Paralyse(5)
|
|
sleep(5)
|
|
M.loc = pick(tdomeadmin)
|
|
spawn(50)
|
|
to_chat(M, "\blue You have been sent to the Thunderdome.")
|
|
log_admin("[key_name(usr)] has sent [key_name(M)] to the thunderdome. (Admin.)")
|
|
message_admins("[key_name_admin(usr)] has sent [key_name_admin(M)] to the thunderdome. (Admin.)", 1)
|
|
|
|
else if(href_list["tdomeobserve"])
|
|
if(!check_rights(R_SERVER|R_EVENT)) return
|
|
|
|
if(alert(usr, "Confirm?", "Message", "Yes", "No") != "Yes")
|
|
return
|
|
|
|
var/mob/M = locate(href_list["tdomeobserve"])
|
|
if(!ismob(M))
|
|
to_chat(usr, "This can only be used on instances of type /mob")
|
|
return
|
|
if(istype(M, /mob/living/silicon/ai))
|
|
to_chat(usr, "This cannot be used on instances of type /mob/living/silicon/ai")
|
|
return
|
|
|
|
for(var/obj/item/I in M)
|
|
M.unEquip(I)
|
|
if(I)
|
|
I.loc = M.loc
|
|
I.layer = initial(I.layer)
|
|
I.plane = initial(I.plane)
|
|
I.dropped(M)
|
|
|
|
if(istype(M, /mob/living/carbon/human))
|
|
var/mob/living/carbon/human/observer = M
|
|
observer.equip_to_slot_or_del(new /obj/item/clothing/under/suit_jacket(observer), slot_w_uniform)
|
|
observer.equip_to_slot_or_del(new /obj/item/clothing/shoes/black(observer), slot_shoes)
|
|
M.Paralyse(5)
|
|
sleep(5)
|
|
M.loc = pick(tdomeobserve)
|
|
spawn(50)
|
|
to_chat(M, "\blue You have been sent to the Thunderdome.")
|
|
log_admin("[key_name(usr)] has sent [key_name(M)] to the thunderdome. (Observer.)")
|
|
message_admins("[key_name_admin(usr)] has sent [key_name_admin(M)] to the thunderdome. (Observer.)", 1)
|
|
|
|
else if(href_list["aroomwarp"])
|
|
if(!check_rights(R_SERVER|R_EVENT)) return
|
|
|
|
if(alert(usr, "Confirm?", "Message", "Yes", "No") != "Yes")
|
|
return
|
|
|
|
var/mob/M = locate(href_list["aroomwarp"])
|
|
if(!ismob(M))
|
|
to_chat(usr, "This can only be used on instances of type /mob")
|
|
return
|
|
if(istype(M, /mob/living/silicon/ai))
|
|
to_chat(usr, "This cannot be used on instances of type /mob/living/silicon/ai")
|
|
return
|
|
|
|
M.Paralyse(5)
|
|
sleep(5)
|
|
M.loc = pick(aroomwarp)
|
|
spawn(50)
|
|
to_chat(M, "\blue You have been sent to the <b>Admin Room!</b>.")
|
|
log_admin("[key_name(usr)] has sent [key_name(M)] to the Admin Room")
|
|
message_admins("[key_name_admin(usr)] has sent [key_name_admin(M)] to the Admin Room", 1)
|
|
|
|
|
|
else if(href_list["revive"])
|
|
if(!check_rights(R_REJUVINATE)) return
|
|
|
|
var/mob/living/L = locate(href_list["revive"])
|
|
if(!istype(L))
|
|
to_chat(usr, "This can only be used on instances of type /mob/living")
|
|
return
|
|
|
|
L.revive()
|
|
message_admins("\red Admin [key_name_admin(usr)] healed / revived [key_name_admin(L)]!", 1)
|
|
log_admin("[key_name(usr)] healed / revived [key_name(L)]")
|
|
|
|
else if(href_list["makeai"])
|
|
if(!check_rights(R_SPAWN)) return
|
|
|
|
var/mob/living/carbon/human/H = locate(href_list["makeai"])
|
|
if(!istype(H))
|
|
to_chat(usr, "This can only be used on instances of type /mob/living/carbon/human")
|
|
return
|
|
|
|
if(alert(usr, "Confirm make ai?",, "Yes", "No") != "Yes")
|
|
return
|
|
|
|
message_admins("\red Admin [key_name_admin(usr)] AIized [key_name_admin(H)]!", 1)
|
|
log_admin("[key_name(usr)] AIized [key_name(H)]")
|
|
H.AIize()
|
|
|
|
|
|
else if(href_list["makemask"])
|
|
if(!check_rights(R_SPAWN)) return
|
|
|
|
if(alert(usr, "Confirm make mask?",, "Yes", "No") != "Yes")
|
|
return
|
|
|
|
var/mob/currentMob = locate(href_list["makemask"])
|
|
message_admins("\red Admin [key_name_admin(usr)] made [key_name_admin(currentMob)] into a Mask of Nar'Sie!", 1)
|
|
log_admin("[key_name(usr)] made [key_name(currentMob)] into a Mask of Nar'Sie!")
|
|
currentMob.make_into_mask(0,0)
|
|
|
|
|
|
else if(href_list["makealien"])
|
|
if(!check_rights(R_SPAWN)) return
|
|
|
|
var/mob/living/carbon/human/H = locate(href_list["makealien"])
|
|
if(!istype(H))
|
|
to_chat(usr, "This can only be used on instances of type /mob/living/carbon/human")
|
|
return
|
|
if(alert(usr, "Confirm make alien?",, "Yes", "No") != "Yes")
|
|
return
|
|
|
|
usr.client.cmd_admin_alienize(H)
|
|
|
|
else if(href_list["makeslime"])
|
|
if(!check_rights(R_SPAWN)) return
|
|
|
|
var/mob/living/carbon/human/H = locate(href_list["makeslime"])
|
|
if(!istype(H))
|
|
to_chat(usr, "This can only be used on instances of type /mob/living/carbon/human")
|
|
return
|
|
if(alert(usr, "Confirm make slime?",, "Yes", "No") != "Yes")
|
|
return
|
|
|
|
usr.client.cmd_admin_slimeize(H)
|
|
|
|
else if(href_list["makesuper"])
|
|
if(!check_rights(R_SPAWN)) return
|
|
|
|
var/mob/living/carbon/human/H = locate(href_list["makesuper"])
|
|
if(!istype(H))
|
|
to_chat(usr, "This can only be used on instances of type /mob/living/carbon/human")
|
|
return
|
|
|
|
if(alert(usr, "Confirm make superhero?",, "Yes", "No") != "Yes")
|
|
return
|
|
|
|
usr.client.cmd_admin_super(H)
|
|
|
|
else if(href_list["makerobot"])
|
|
if(!check_rights(R_SPAWN)) return
|
|
|
|
var/mob/living/carbon/human/H = locate(href_list["makerobot"])
|
|
if(!istype(H))
|
|
to_chat(usr, "This can only be used on instances of type /mob/living/carbon/human")
|
|
return
|
|
if(alert(usr, "Confirm make robot?",, "Yes", "No") != "Yes")
|
|
return
|
|
|
|
usr.client.cmd_admin_robotize(H)
|
|
|
|
else if(href_list["makeanimal"])
|
|
if(!check_rights(R_SPAWN)) return
|
|
|
|
var/mob/M = locate(href_list["makeanimal"])
|
|
if(istype(M, /mob/new_player))
|
|
to_chat(usr, "This cannot be used on instances of type /mob/new_player")
|
|
return
|
|
if(alert(usr, "Confirm make animal?",, "Yes", "No") != "Yes")
|
|
return
|
|
|
|
usr.client.cmd_admin_animalize(M)
|
|
|
|
else if(href_list["incarn_ghost"])
|
|
if(!check_rights(R_SPAWN)) return
|
|
|
|
var/mob/dead/observer/G = locate(href_list["incarn_ghost"])
|
|
if(!istype(G))
|
|
to_chat(usr, "This will only work on /mob/dead/observer")
|
|
log_admin("[key_name(G)] was incarnated by [key_name(src.owner)]")
|
|
message_admins("[key_name_admin(G)] was incarnated by [key_name_admin(src.owner)]")
|
|
G.incarnate_ghost()
|
|
|
|
else if(href_list["togmutate"])
|
|
if(!check_rights(R_SPAWN)) return
|
|
|
|
var/mob/living/carbon/human/H = locate(href_list["togmutate"])
|
|
if(!istype(H))
|
|
to_chat(usr, "This can only be used on instances of type /mob/living/carbon/human")
|
|
return
|
|
var/block=text2num(href_list["block"])
|
|
//testing("togmutate([href_list["block"]] -> [block])")
|
|
usr.client.cmd_admin_toggle_block(H,block)
|
|
show_player_panel(H)
|
|
//H.regenerate_icons()
|
|
|
|
else if(href_list["adminplayeropts"])
|
|
var/mob/M = locate(href_list["adminplayeropts"])
|
|
show_player_panel(M)
|
|
|
|
else if(href_list["adminplayerobservejump"])
|
|
if(!check_rights(R_ADMIN|R_MOD))
|
|
return
|
|
|
|
var/mob/M = locate(href_list["adminplayerobservejump"])
|
|
|
|
var/client/C = usr.client
|
|
if(!isobserver(usr)) C.admin_ghost()
|
|
sleep(2)
|
|
C.jumptomob(M)
|
|
|
|
else if(href_list["adminplayerobservefollow"])
|
|
if(!check_rights(R_ADMIN|R_MOD))
|
|
return
|
|
|
|
var/mob/M = locate(href_list["adminplayerobservefollow"])
|
|
|
|
var/client/C = usr.client
|
|
if(!isobserver(usr)) C.admin_ghost()
|
|
var/mob/dead/observer/A = C.mob
|
|
sleep(2)
|
|
A.ManualFollow(M)
|
|
|
|
else if(href_list["check_antagonist"])
|
|
check_antagonists()
|
|
|
|
else if(href_list["adminplayerobservecoodjump"])
|
|
if(!check_rights(R_ADMIN)) return
|
|
|
|
var/x = text2num(href_list["X"])
|
|
var/y = text2num(href_list["Y"])
|
|
var/z = text2num(href_list["Z"])
|
|
|
|
var/client/C = usr.client
|
|
if(!isobserver(usr)) C.admin_ghost()
|
|
sleep(2)
|
|
C.jumptocoord(x,y,z)
|
|
|
|
else if(href_list["adminchecklaws"])
|
|
output_ai_laws()
|
|
|
|
else if(href_list["adminmoreinfo"])
|
|
var/mob/M = locate(href_list["adminmoreinfo"])
|
|
admin_mob_info(M)
|
|
|
|
else if(href_list["adminspawncookie"])
|
|
if(!check_rights(R_ADMIN|R_EVENT)) return
|
|
|
|
var/mob/living/carbon/human/H = locate(href_list["adminspawncookie"])
|
|
if(!ishuman(H))
|
|
to_chat(usr, "This can only be used on instances of type /mob/living/carbon/human")
|
|
return
|
|
|
|
H.equip_to_slot_or_del( new /obj/item/weapon/reagent_containers/food/snacks/cookie(H), slot_l_hand )
|
|
if(!(istype(H.l_hand,/obj/item/weapon/reagent_containers/food/snacks/cookie)))
|
|
H.equip_to_slot_or_del( new /obj/item/weapon/reagent_containers/food/snacks/cookie(H), slot_r_hand )
|
|
if(!(istype(H.r_hand,/obj/item/weapon/reagent_containers/food/snacks/cookie)))
|
|
log_admin("[key_name(H)] has their hands full, so they did not receive their cookie, spawned by [key_name(src.owner)].")
|
|
message_admins("[key_name_admin(H)] has their hands full, so they did not receive their cookie, spawned by [key_name_admin(src.owner)].")
|
|
return
|
|
else
|
|
H.update_inv_r_hand()//To ensure the icon appears in the HUD
|
|
else
|
|
H.update_inv_l_hand()
|
|
log_admin("[key_name(H)] got their cookie, spawned by [key_name(src.owner)]")
|
|
message_admins("[key_name_admin(H)] got their cookie, spawned by [key_name_admin(src.owner)]")
|
|
feedback_inc("admin_cookies_spawned",1)
|
|
to_chat(H, "\blue Your prayers have been answered!! You received the <b>best cookie</b>!")
|
|
|
|
else if(href_list["BlueSpaceArtillery"])
|
|
if(!check_rights(R_ADMIN|R_EVENT)) return
|
|
|
|
var/mob/living/M = locate(href_list["BlueSpaceArtillery"])
|
|
if(!isliving(M))
|
|
to_chat(usr, "This can only be used on instances of type /mob/living")
|
|
return
|
|
|
|
if(alert(src.owner, "Are you sure you wish to hit [key_name(M)] with Bluespace Artillery?", "Confirm Firing?" , "Yes" , "No") != "Yes")
|
|
return
|
|
|
|
if(BSACooldown)
|
|
to_chat(src.owner, "Standby. Reload cycle in progress. Gunnery crews ready in five seconds!")
|
|
return
|
|
|
|
BSACooldown = 1
|
|
spawn(50)
|
|
BSACooldown = 0
|
|
|
|
to_chat(M, "You've been hit by bluespace artillery!")
|
|
log_admin("[key_name(M)] has been hit by Bluespace Artillery fired by [key_name(src.owner)]")
|
|
message_admins("[key_name_admin(M)] has been hit by Bluespace Artillery fired by [key_name_admin(src.owner)]")
|
|
|
|
var/obj/effect/stop/S
|
|
S = new /obj/effect/stop
|
|
S.victim = M
|
|
S.loc = M.loc
|
|
spawn(20)
|
|
qdel(S)
|
|
|
|
var/turf/simulated/floor/T = get_turf(M)
|
|
if(istype(T))
|
|
if(prob(80)) T.break_tile_to_plating()
|
|
else T.break_tile()
|
|
|
|
if(M.health == 1)
|
|
M.gib()
|
|
else
|
|
M.adjustBruteLoss( min( 99 , (M.health - 1) ) )
|
|
M.Stun(20)
|
|
M.Weaken(20)
|
|
M.stuttering = 20
|
|
|
|
else if(href_list["CentcommReply"])
|
|
if(!check_rights(R_ADMIN))
|
|
return
|
|
|
|
var/mob/living/carbon/human/H = locate(href_list["CentcommReply"])
|
|
if(!istype(H))
|
|
to_chat(usr, "This can only be used on instances of type /mob/living/carbon/human")
|
|
return
|
|
if(!istype(H.l_ear, /obj/item/device/radio/headset) && !istype(H.r_ear, /obj/item/device/radio/headset))
|
|
to_chat(usr, "The person you are trying to contact is not wearing a headset")
|
|
return
|
|
|
|
var/input = input(src.owner, "Please enter a message to reply to [key_name(H)] via their headset.","Outgoing message from Centcomm", "")
|
|
if(!input) return
|
|
|
|
to_chat(src.owner, "You sent [input] to [H] via a secure channel.")
|
|
log_admin("[key_name(src.owner)] replied to [key_name(H)]'s Centcomm message with the message [input].")
|
|
message_admins("[key_name_admin(src.owner)] replied to [key_name_admin(H)]'s Centcom message with: \"[input]\"")
|
|
to_chat(H, "You hear something crackle in your headset for a moment before a voice speaks. \"Please stand by for a message from Central Command. Message as follows. [input]. Message ends.\"")
|
|
|
|
else if(href_list["EvilFax"])
|
|
if(!check_rights(R_ADMIN))
|
|
return
|
|
var/mob/living/carbon/human/H = locate(href_list["EvilFax"])
|
|
if(!istype(H))
|
|
to_chat(usr, "This can only be used on instances of type /mob/living/carbon/human")
|
|
return
|
|
var/etypes = list("Borgification","Corgification","Death By Fire","Total Brain Death","Honk Tumor","Cluwne","Demotion Notice")
|
|
var/eviltype = input(src.owner, "Which type of evil fax do you wish to send [H]?","Its good to be baaaad...", "") as null|anything in etypes
|
|
if(!(eviltype in etypes))
|
|
return
|
|
var/customname = input(src.owner, "Pick a title for the evil fax.", "Fax Title") as text|null
|
|
if(!customname)
|
|
customname = "paper"
|
|
var/obj/item/weapon/paper/evilfax/P = new /obj/item/weapon/paper/evilfax(null)
|
|
var/obj/machinery/photocopier/faxmachine/fax = locate(href_list["originfax"])
|
|
|
|
P.name = "Central Command - [customname]"
|
|
P.info = "<b>You <i>really</i> should've known better.</b>"
|
|
P.myeffect = eviltype
|
|
P.mytarget = H
|
|
if(alert("Do you want the Evil Fax to activate automatically if [H] tries to ignore it?",,"Yes", "No") == "Yes")
|
|
P.activate_on_timeout = 1
|
|
P.x = rand(-2, 0)
|
|
P.y = rand(-1, 2)
|
|
P.offset_x += P.x
|
|
P.offset_y += P.y
|
|
P.update_icon()
|
|
var/stampvalue = "cent"
|
|
var/image/stampoverlay = image('icons/obj/bureaucracy.dmi')
|
|
stampoverlay.icon_state = "paper_stamp-[stampvalue]"
|
|
stampoverlay.pixel_x = P.x
|
|
stampoverlay.pixel_y = P.y
|
|
P.stamped = list()
|
|
P.stamped += /obj/item/weapon/stamp/centcom
|
|
if(!P.ico)
|
|
P.ico = new
|
|
P.ico += "paper_stamp-[stampvalue]"
|
|
P.overlays += stampoverlay
|
|
P.stamps += "<HR><img src=large_stamp-[stampvalue].png>"
|
|
P.update_icon()
|
|
//fax.receivefax(P) // this does not work, it does not preserve the type, we have to physically teleport the fax paper instead
|
|
P.loc = fax.loc
|
|
if(istype(H) && H.stat == CONSCIOUS && (istype(H.l_ear, /obj/item/device/radio/headset) || istype(H.r_ear, /obj/item/device/radio/headset)))
|
|
to_chat(H, "Your headset pings, notifying you that a reply to your fax has arrived.")
|
|
to_chat(src.owner, "You sent a [eviltype] fax to [H]")
|
|
log_admin("[key_name(src.owner)] sent [key_name(H)] a [eviltype] fax")
|
|
message_admins("[key_name_admin(src.owner)] replied to [key_name_admin(H)] with a [eviltype] fax")
|
|
else if(href_list["FaxReplyTemplate"])
|
|
if(!check_rights(R_ADMIN))
|
|
return
|
|
var/mob/living/carbon/human/H = locate(href_list["FaxReplyTemplate"])
|
|
if(!istype(H))
|
|
to_chat(usr, "This can only be used on instances of type /mob/living/carbon/human")
|
|
return
|
|
var/obj/item/weapon/paper/P = new /obj/item/weapon/paper(null)
|
|
var/obj/machinery/photocopier/faxmachine/fax = locate(href_list["originfax"])
|
|
P.name = "Central Command - paper"
|
|
var/stypes = list("Handle it yourselves!","Illegible fax","Fax not signed","Not Right Now","You are wasting our time", "Keep up the good work", "ERT Instructions")
|
|
var/stype = input(src.owner, "Which type of standard reply do you wish to send to [H]?","Choose your paperwork", "") as null|anything in stypes
|
|
var/tmsg = "<font face='Verdana' color='black'><center><img src = 'ntlogo.png'><BR><BR><BR><font size='4'><B>NanoTrasen Science Station Cyberiad</B></font><BR><BR><BR><font size='4'>NAS Trurl Communications Department Report</font></center><BR><BR>"
|
|
if(stype == "Handle it yourselves!")
|
|
tmsg += "Greetings, esteemed crewmember. Your fax has been <B><I>DECLINED</I></B> automatically by NAS Trurl Fax Registration.<BR><BR>Please proceed in accordance with Standard Operating Procedure and/or Space Law. You are fully trained to handle this situation without Central Command intervention.<BR><BR><i><small>This is an automatic message.</small>"
|
|
else if(stype == "Illegible fax")
|
|
tmsg += "Greetings, esteemed crewmember. Your fax has been <B><I>DECLINED</I></B> automatically by NAS Trurl Fax Registration.<BR><BR>Your fax's grammar, syntax and/or typography are of a sub-par level and do not allow us to understand the contents of the message.<BR><BR>Please consult your nearest dictionary and/or thesaurus and try again.<BR><BR><i><small>This is an automatic message.</small>"
|
|
else if(stype == "Fax not signed")
|
|
tmsg += "Greetings, esteemed crewmember. Your fax has been <B><I>DECLINED</I></B> automatically by NAS Trurl Fax Registration.<BR><BR>Your fax has not been correctly signed and, as such, we cannot verify your identity.<BR><BR>Please sign your faxes before sending them so that we may verify your identity.<BR><BR><i><small>This is an automatic message.</small>"
|
|
else if(stype == "Not Right Now")
|
|
tmsg += "Greetings, esteemed crewmember. Your fax has been <B><I>DECLINED</I></B> automatically by NAS Trurl Fax Registration.<BR><BR>Due to pressing concerns of a matter above your current paygrade, we are unable to provide assistance in whatever matter your fax referenced.<BR><BR>This can be either due to a power outage, bureaucratic audit, pest infestation, Ascendance Event, corgi outbreak, or any other situation that would affect the proper functioning of the NAS Trurl.<BR><BR>Please try again later.<BR><BR><i><small>This is an automatic message.</small>"
|
|
else if(stype == "You are wasting our time")
|
|
tmsg += "Greetings, esteemed crewmember. Your fax has been <B><I>DECLINED</I></B> automatically by NAS Trurl Fax Registration.<BR><BR>In the interest of preventing further mismanagement of company resources, please avoid wasting our time with such petty drivel.<BR><BR>Do kindly remember that we expect our workforce to maintain at least a semi-decent level of profesionalism. Do not test our patience.<BR><BR><i><small>This is an automatic message.</i></small>"
|
|
else if(stype == "Keep up the good work")
|
|
tmsg += "Greetings, esteemed crewmember. Your fax has been received successfully by NAS Trurl Fax Registration.<BR><BR>We at the NAS Trurl appreciate the good work that you have done here, and sincerely recommend that you continue such a display of dedication to the company.<BR><BR><i><small>This is absolutely not an automated message.</i></small>"
|
|
else if(stype == "ERT Instructions")
|
|
tmsg += "Greetings, esteemed crewmember. Your fax has been <B><I>DECLINED</I></B> automatically by NAS Trurl Fax Registration.<BR><BR>Please utilize the Card Swipers if you wish to call for an ERT.<BR><BR><i><small>This is an automated message.</i></small>"
|
|
else
|
|
return
|
|
tmsg += "</font>"
|
|
P.info = tmsg
|
|
P.x = rand(-2, 0)
|
|
P.y = rand(-1, 2)
|
|
P.offset_x += P.x
|
|
P.offset_y += P.y
|
|
P.update_icon()
|
|
var/stampvalue = "cent"
|
|
var/image/stampoverlay = image('icons/obj/bureaucracy.dmi')
|
|
stampoverlay.icon_state = "paper_stamp-[stampvalue]"
|
|
stampoverlay.pixel_x = P.x
|
|
stampoverlay.pixel_y = P.y
|
|
P.stamped = list()
|
|
P.stamped += /obj/item/weapon/stamp/centcom
|
|
if(!P.ico)
|
|
P.ico = new
|
|
P.ico += "paper_stamp-[stampvalue]"
|
|
P.overlays += stampoverlay
|
|
P.stamps += "<HR><img src=large_stamp-[stampvalue].png>"
|
|
P.update_icon()
|
|
fax.receivefax(P)
|
|
if(istype(H) && H.stat == CONSCIOUS && (istype(H.l_ear, /obj/item/device/radio/headset) || istype(H.r_ear, /obj/item/device/radio/headset)))
|
|
to_chat(H, "Your headset pings, notifying you that a reply to your fax has arrived.")
|
|
to_chat(src.owner, "You sent a standard '[stype]' fax to [H]")
|
|
log_admin("[key_name(src.owner)] sent [key_name(H)] a standard '[stype]' fax")
|
|
message_admins("[key_name_admin(src.owner)] replied to [key_name_admin(H)] with a standard '[stype]' fax")
|
|
|
|
else if(href_list["SyndicateReply"])
|
|
if(!check_rights(R_ADMIN))
|
|
return
|
|
var/mob/living/carbon/human/H = locate(href_list["SyndicateReply"])
|
|
if(!istype(H))
|
|
to_chat(usr, "This can only be used on instances of type /mob/living/carbon/human")
|
|
return
|
|
if(H.stat != 0)
|
|
to_chat(usr, "The person you are trying to contact is not conscious.")
|
|
return
|
|
if(!istype(H.l_ear, /obj/item/device/radio/headset) && !istype(H.r_ear, /obj/item/device/radio/headset))
|
|
to_chat(usr, "The person you are trying to contact is not wearing a headset")
|
|
return
|
|
var/input = input(src.owner, "Please enter a message to reply to [key_name(H)] via their headset.","Outgoing message from The Syndicate", "")
|
|
if(!input)
|
|
return
|
|
to_chat(src.owner, "You sent [input] to [H] via a secure channel.")
|
|
log_admin("[src.owner] replied to [key_name(H)]'s Syndicate message with the message [input].")
|
|
to_chat(H, "You hear something crackle in your headset for a moment before a voice speaks. \"Please stand by for a message from your benefactor. Message as follows, agent. [input]. Message ends.\"")
|
|
|
|
else if(href_list["HONKReply"])
|
|
var/mob/living/carbon/human/H = locate(href_list["HONKReply"])
|
|
if(!istype(H))
|
|
to_chat(usr, "This can only be used on instances of type /mob/living/carbon/human")
|
|
return
|
|
if(!istype(H.l_ear, /obj/item/device/radio/headset) && !istype(H.r_ear, /obj/item/device/radio/headset))
|
|
to_chat(usr, "The person you are trying to contact is not wearing a headset")
|
|
return
|
|
|
|
var/input = input(src.owner, "Please enter a message to reply to [key_name(H)] via their headset.","Outgoing message from HONKplanet", "")
|
|
if(!input) return
|
|
|
|
to_chat(src.owner, "You sent [input] to [H] via a secure channel.")
|
|
log_admin("[src.owner] replied to [key_name(H)]'s HONKplanet message with the message [input].")
|
|
to_chat(H, "You hear something crackle in your headset for a moment before a voice speaks. \"Please stand by for a message from your HONKbrothers. Message as follows, HONK. [input]. Message ends, HONK.\"")
|
|
|
|
else if(href_list["ErtReply"])
|
|
if(!check_rights(R_ADMIN))
|
|
return
|
|
|
|
if(alert(src.owner, "Accept or Deny ERT request?", "CentComm Response", "Accept", "Deny") == "Deny")
|
|
var/mob/living/carbon/human/H = locate(href_list["ErtReply"])
|
|
if(!istype(H))
|
|
to_chat(usr, "This can only be used on instances of type /mob/living/carbon/human")
|
|
return
|
|
if(H.stat != 0)
|
|
to_chat(usr, "The person you are trying to contact is not conscious.")
|
|
return
|
|
if(!istype(H.l_ear, /obj/item/device/radio/headset) && !istype(H.r_ear, /obj/item/device/radio/headset))
|
|
to_chat(usr, "The person you are trying to contact is not wearing a headset")
|
|
return
|
|
|
|
var/input = input(src.owner, "Please enter a reason for denying [key_name(H)]'s ERT request.","Outgoing message from CentComm", "")
|
|
if(!input) return
|
|
ert_request_answered = 1
|
|
to_chat(src.owner, "You sent [input] to [H] via a secure channel.")
|
|
log_admin("[src.owner] denied [key_name(H)]'s ERT request with the message [input].")
|
|
to_chat(H, "You hear something crackle in your headset for a moment before a voice speaks. \"Your ERT request has been denied for the following reasons: [input]. Message ends.\"")
|
|
else
|
|
src.owner.response_team()
|
|
|
|
|
|
else if(href_list["AdminFaxView"])
|
|
if(!check_rights(R_ADMIN))
|
|
return
|
|
|
|
var/obj/item/fax = locate(href_list["AdminFaxView"])
|
|
if(istype(fax, /obj/item/weapon/paper))
|
|
var/obj/item/weapon/paper/P = fax
|
|
P.show_content(usr,1)
|
|
else if(istype(fax, /obj/item/weapon/photo))
|
|
var/obj/item/weapon/photo/H = fax
|
|
H.show(usr)
|
|
else if(istype(fax, /obj/item/weapon/paper_bundle))
|
|
//having multiple people turning pages on a paper_bundle can cause issues
|
|
//open a browse window listing the contents instead
|
|
var/data = ""
|
|
var/obj/item/weapon/paper_bundle/B = fax
|
|
|
|
for(var/page = 1, page <= B.amount + 1, page++)
|
|
var/obj/pageobj = B.contents[page]
|
|
data += "<A href='?src=\ref[src];AdminFaxViewPage=[page];paper_bundle=\ref[B]'>Page [page] - [pageobj.name]</A><BR>"
|
|
|
|
usr << browse(data, "window=[B.name]")
|
|
else
|
|
to_chat(usr, "\red The faxed item is not viewable. This is probably a bug, and should be reported on the tracker: [fax.type]")
|
|
|
|
else if(href_list["AdminFaxViewPage"])
|
|
if(!check_rights(R_ADMIN))
|
|
return
|
|
|
|
var/page = text2num(href_list["AdminFaxViewPage"])
|
|
var/obj/item/weapon/paper_bundle/bundle = locate(href_list["paper_bundle"])
|
|
|
|
if(!bundle) return
|
|
|
|
if(istype(bundle.contents[page], /obj/item/weapon/paper))
|
|
var/obj/item/weapon/paper/P = bundle.contents[page]
|
|
P.show_content(usr, 1)
|
|
else if(istype(bundle.contents[page], /obj/item/weapon/photo))
|
|
var/obj/item/weapon/photo/H = bundle.contents[page]
|
|
H.show(usr)
|
|
return
|
|
|
|
else if(href_list["AdminFaxCreate"])
|
|
if(!check_rights(R_ADMIN))
|
|
return
|
|
|
|
var/mob/sender = locate(href_list["AdminFaxCreate"])
|
|
var/obj/machinery/photocopier/faxmachine/fax = locate(href_list["originfax"])
|
|
var/faxtype = href_list["faxtype"]
|
|
var/reply_to = locate(href_list["replyto"])
|
|
var/destination
|
|
var/notify
|
|
|
|
var/obj/item/weapon/paper/P = new /obj/item/weapon/paper(null) //hopefully the null loc won't cause trouble for us
|
|
|
|
if(!fax)
|
|
var/list/departmentoptions = alldepartments + "All Departments"
|
|
destination = input(usr, "To which department?", "Choose a department", "") as null|anything in departmentoptions
|
|
if(!destination)
|
|
qdel(P)
|
|
return
|
|
|
|
for(var/obj/machinery/photocopier/faxmachine/F in allfaxes)
|
|
if(destination != "All Departments" && F.department == destination)
|
|
fax = F
|
|
|
|
|
|
var/input = input(src.owner, "Please enter a message to send a fax via secure connection. Use <br> for line breaks. Both pencode and HTML work.", "Outgoing message from Centcomm", "") as message|null
|
|
if(!input)
|
|
qdel(P)
|
|
return
|
|
input = P.parsepencode(input) // Encode everything from pencode to html
|
|
|
|
var/customname = input(src.owner, "Pick a title for the fax.", "Fax Title") as text|null
|
|
if(!customname)
|
|
customname = "paper"
|
|
|
|
var/stampname
|
|
var/stamptype
|
|
var/stampvalue
|
|
var/sendername
|
|
switch(faxtype)
|
|
if("Central Command")
|
|
stamptype = "icon"
|
|
stampvalue = "cent"
|
|
sendername = command_name()
|
|
if("Syndicate")
|
|
stamptype = "icon"
|
|
stampvalue = "syndicate"
|
|
sendername = "UNKNOWN"
|
|
if("Administrator")
|
|
stamptype = input(src.owner, "Pick a stamp type.", "Stamp Type") as null|anything in list("icon","text","none")
|
|
if(stamptype == "icon")
|
|
stampname = input(src.owner, "Pick a stamp icon.", "Stamp Icon") as null|anything in list("centcom","syndicate","granted","denied","clown")
|
|
switch(stampname)
|
|
if("centcom")
|
|
stampvalue = "cent"
|
|
if("syndicate")
|
|
stampvalue = "syndicate"
|
|
if("granted")
|
|
stampvalue = "ok"
|
|
if("denied")
|
|
stampvalue = "deny"
|
|
if("clown")
|
|
stampvalue = "clown"
|
|
else if(stamptype == "text")
|
|
stampvalue = input(src.owner, "What should the stamp say?", "Stamp Text") as text|null
|
|
else if(stamptype == "none")
|
|
stamptype = ""
|
|
else
|
|
qdel(P)
|
|
return
|
|
|
|
sendername = input(src.owner, "What organization does the fax come from? This determines the prefix of the paper (i.e. Central Command- Title). This is optional.", "Organization") as text|null
|
|
|
|
if(sender)
|
|
notify = alert(src.owner, "Would you like to inform the original sender that a fax has arrived?","Notify Sender","Yes","No")
|
|
|
|
// Create the reply message
|
|
if(sendername)
|
|
P.name = "[sendername]- [customname]"
|
|
else
|
|
P.name = "[customname]"
|
|
P.info = input
|
|
P.update_icon()
|
|
P.x = rand(-2, 0)
|
|
P.y = rand(-1, 2)
|
|
P.offset_x += P.x
|
|
P.offset_y += P.y
|
|
if(stamptype)
|
|
var/image/stampoverlay = image('icons/obj/bureaucracy.dmi')
|
|
stampoverlay.pixel_x = P.x
|
|
stampoverlay.pixel_y = P.y
|
|
|
|
if(!P.ico)
|
|
P.ico = new
|
|
P.ico += "paper_stamp-[stampvalue]"
|
|
stampoverlay.icon_state = "paper_stamp-[stampvalue]"
|
|
|
|
if(stamptype == "icon")
|
|
if(!P.stamped)
|
|
P.stamped = new
|
|
P.stamped += /obj/item/weapon/stamp/centcom
|
|
P.overlays += stampoverlay
|
|
P.stamps += "<HR><img src=large_stamp-[stampvalue].png>"
|
|
|
|
else if(stamptype == "text")
|
|
if(!P.stamped)
|
|
P.stamped = new
|
|
P.stamped += /obj/item/weapon/stamp
|
|
P.overlays += stampoverlay
|
|
P.stamps += "<HR><i>[stampvalue]</i>"
|
|
|
|
if(destination != "All Departments")
|
|
if(!fax.receivefax(P))
|
|
to_chat(src.owner, "\red Message transmission failed.")
|
|
return
|
|
else
|
|
for(var/obj/machinery/photocopier/faxmachine/F in allfaxes)
|
|
if((F.z in config.station_levels))
|
|
spawn(0)
|
|
if(!F.receivefax(P))
|
|
to_chat(src.owner, "\red Message transmission to [F.department] failed.")
|
|
|
|
var/datum/fax/admin/A = new /datum/fax/admin()
|
|
A.name = P.name
|
|
A.from_department = faxtype
|
|
if(destination != "All Departments")
|
|
A.to_department = fax.department
|
|
else
|
|
A.to_department = "All Departments"
|
|
A.origin = "Administrator"
|
|
A.message = P
|
|
A.reply_to = reply_to
|
|
A.sent_by = usr
|
|
A.sent_at = world.time
|
|
|
|
to_chat(src.owner, "\blue Message transmitted successfully.")
|
|
if(notify == "Yes")
|
|
var/mob/living/carbon/human/H = sender
|
|
if(istype(H) && H.stat == CONSCIOUS && (istype(H.l_ear, /obj/item/device/radio/headset) || istype(H.r_ear, /obj/item/device/radio/headset)))
|
|
to_chat(sender, "Your headset pings, notifying you that a reply to your fax has arrived.")
|
|
if(sender)
|
|
log_admin("[key_name(src.owner)] replied to a fax message from [key_name(sender)]: [input]")
|
|
message_admins("[key_name_admin(src.owner)] replied to a fax message from [key_name_admin(sender)] (<a href='?_src_=holder;AdminFaxView=\ref[P]'>VIEW</a>).", 1)
|
|
else
|
|
log_admin("[key_name(src.owner)] sent a fax message to [destination]: [input]")
|
|
message_admins("[key_name_admin(src.owner)] sent a fax message to [destination] (<a href='?_src_=holder;AdminFaxView=\ref[P]'>VIEW</a>).", 1)
|
|
return
|
|
|
|
else if(href_list["refreshfaxpanel"])
|
|
if(!check_rights(R_ADMIN))
|
|
return
|
|
|
|
fax_panel(usr)
|
|
|
|
else if(href_list["jumpto"])
|
|
if(!check_rights(R_ADMIN)) return
|
|
|
|
var/mob/M = locate(href_list["jumpto"])
|
|
usr.client.jumptomob(M)
|
|
|
|
else if(href_list["getmob"])
|
|
if(!check_rights(R_ADMIN)) return
|
|
|
|
if(alert(usr, "Confirm?", "Message", "Yes", "No") != "Yes") return
|
|
var/mob/M = locate(href_list["getmob"])
|
|
usr.client.Getmob(M)
|
|
|
|
else if(href_list["sendmob"])
|
|
if(!check_rights(R_ADMIN)) return
|
|
|
|
var/mob/M = locate(href_list["sendmob"])
|
|
usr.client.sendmob(M)
|
|
|
|
else if(href_list["narrateto"])
|
|
if(!check_rights(R_ADMIN)) return
|
|
|
|
var/mob/M = locate(href_list["narrateto"])
|
|
usr.client.cmd_admin_direct_narrate(M)
|
|
|
|
else if(href_list["subtlemessage"])
|
|
if(!check_rights(R_ADMIN)) return
|
|
|
|
var/mob/M = locate(href_list["subtlemessage"])
|
|
usr.client.cmd_admin_subtle_message(M)
|
|
|
|
else if(href_list["traitor"])
|
|
if(!check_rights(R_ADMIN|R_MOD)) return
|
|
|
|
if(!ticker || !ticker.mode)
|
|
alert("The game hasn't started yet!")
|
|
return
|
|
|
|
var/mob/M = locate(href_list["traitor"])
|
|
if(!ismob(M))
|
|
to_chat(usr, "This can only be used on instances of type /mob.")
|
|
return
|
|
show_traitor_panel(M)
|
|
|
|
else if(href_list["create_object"])
|
|
if(!check_rights(R_SPAWN)) return
|
|
return create_object(usr)
|
|
|
|
else if(href_list["quick_create_object"])
|
|
if(!check_rights(R_SPAWN)) return
|
|
return quick_create_object(usr)
|
|
|
|
else if(href_list["create_turf"])
|
|
if(!check_rights(R_SPAWN)) return
|
|
return create_turf(usr)
|
|
|
|
else if(href_list["create_mob"])
|
|
if(!check_rights(R_SPAWN)) return
|
|
return create_mob(usr)
|
|
|
|
else if(href_list["object_list"]) //this is the laggiest thing ever
|
|
if(!check_rights(R_SPAWN)) return
|
|
|
|
var/atom/loc = usr.loc
|
|
|
|
var/dirty_paths
|
|
if(istext(href_list["object_list"]))
|
|
dirty_paths = list(href_list["object_list"])
|
|
else if(istype(href_list["object_list"], /list))
|
|
dirty_paths = href_list["object_list"]
|
|
|
|
var/paths = list()
|
|
|
|
for(var/dirty_path in dirty_paths)
|
|
var/path = text2path(dirty_path)
|
|
if(!path)
|
|
continue
|
|
else if(!ispath(path, /obj) && !ispath(path, /turf) && !ispath(path, /mob))
|
|
continue
|
|
paths += path
|
|
|
|
if(!paths)
|
|
alert("The path list you sent is empty")
|
|
return
|
|
if(length(paths) > 5)
|
|
alert("Select fewer object types, (max 5)")
|
|
return
|
|
|
|
var/list/offset = splittext(href_list["offset"],",")
|
|
var/number = dd_range(1, 100, text2num(href_list["object_count"]))
|
|
var/X = offset.len > 0 ? text2num(offset[1]) : 0
|
|
var/Y = offset.len > 1 ? text2num(offset[2]) : 0
|
|
var/Z = offset.len > 2 ? text2num(offset[3]) : 0
|
|
var/tmp_dir = href_list["object_dir"]
|
|
var/obj_dir = tmp_dir ? text2num(tmp_dir) : 2
|
|
if(!obj_dir || !(obj_dir in list(1,2,4,8,5,6,9,10)))
|
|
obj_dir = 2
|
|
var/obj_name = sanitize(href_list["object_name"])
|
|
|
|
|
|
var/atom/target //Where the object will be spawned
|
|
var/where = href_list["object_where"]
|
|
if(!( where in list("onfloor","inhand","inmarked") ))
|
|
where = "onfloor"
|
|
|
|
|
|
switch(where)
|
|
if("inhand")
|
|
if(!iscarbon(usr) && !isrobot(usr))
|
|
to_chat(usr, "Can only spawn in hand when you're a carbon mob or cyborg.")
|
|
where = "onfloor"
|
|
target = usr
|
|
|
|
if("onfloor")
|
|
switch(href_list["offset_type"])
|
|
if("absolute")
|
|
target = locate(0 + X,0 + Y,0 + Z)
|
|
if("relative")
|
|
target = locate(loc.x + X,loc.y + Y,loc.z + Z)
|
|
if("inmarked")
|
|
if(!marked_datum)
|
|
to_chat(usr, "You don't have any object marked. Abandoning spawn.")
|
|
return
|
|
else if(!istype(marked_datum,/atom))
|
|
to_chat(usr, "The object you have marked cannot be used as a target. Target must be of type /atom. Abandoning spawn.")
|
|
return
|
|
else
|
|
target = marked_datum
|
|
|
|
if(target)
|
|
for(var/path in paths)
|
|
for(var/i = 0; i < number; i++)
|
|
if(path in typesof(/turf))
|
|
var/turf/O = target
|
|
var/turf/N = O.ChangeTurf(path)
|
|
if(N && obj_name)
|
|
N.name = obj_name
|
|
else
|
|
var/atom/O = new path(target)
|
|
if(O)
|
|
O.dir = obj_dir
|
|
if(obj_name)
|
|
O.name = obj_name
|
|
if(istype(O,/mob))
|
|
var/mob/M = O
|
|
M.real_name = obj_name
|
|
if(where == "inhand" && isliving(usr) && istype(O, /obj/item))
|
|
var/mob/living/L = usr
|
|
var/obj/item/I = O
|
|
L.put_in_hands(I)
|
|
if(isrobot(L))
|
|
var/mob/living/silicon/robot/R = L
|
|
if(R.module)
|
|
R.module.modules += I
|
|
I.loc = R.module
|
|
R.module.rebuild()
|
|
R.activate_module(I)
|
|
R.module.fix_modules()
|
|
|
|
if(number == 1)
|
|
log_admin("[key_name(usr)] created a [english_list(paths)]")
|
|
for(var/path in paths)
|
|
if(ispath(path, /mob))
|
|
message_admins("[key_name_admin(usr)] created a [english_list(paths)]")
|
|
break
|
|
else
|
|
log_admin("[key_name(usr)] created [number]ea [english_list(paths)]")
|
|
for(var/path in paths)
|
|
if(ispath(path, /mob))
|
|
message_admins("[key_name_admin(usr)] created [number]ea [english_list(paths)]")
|
|
break
|
|
return
|
|
|
|
else if(href_list["kick_all_from_lobby"])
|
|
if(!check_rights(R_ADMIN))
|
|
return
|
|
if(ticker && ticker.current_state == GAME_STATE_PLAYING)
|
|
var/afkonly = text2num(href_list["afkonly"])
|
|
if(alert("Are you sure you want to kick all [afkonly ? "AFK" : ""] clients from the lobby?","Confirmation","Yes","Cancel") != "Yes")
|
|
return
|
|
var/list/listkicked = kick_clients_in_lobby("<span class='danger'>You were kicked from the lobby by an Administrator.</span>", afkonly)
|
|
|
|
var/strkicked = ""
|
|
for(var/name in listkicked)
|
|
strkicked += "[name], "
|
|
message_admins("[key_name_admin(usr)] has kicked [afkonly ? "all AFK" : "all"] clients from the lobby. [length(listkicked)] clients kicked: [strkicked ? strkicked : "--"]")
|
|
log_admin("[key_name(usr)] has kicked [afkonly ? "all AFK" : "all"] clients from the lobby. [length(listkicked)] clients kicked: [strkicked ? strkicked : "--"]")
|
|
else
|
|
to_chat(usr, "You may only use this when the game is running.")
|
|
|
|
else if(href_list["memoeditlist"])
|
|
if(!check_rights(R_SERVER)) return
|
|
var/sql_key = sanitizeSQL("[href_list["memoeditlist"]]")
|
|
var/DBQuery/query_memoedits = dbcon.NewQuery("SELECT edits FROM [format_table_name("memo")] WHERE (ckey = '[sql_key]')")
|
|
if(!query_memoedits.Execute())
|
|
var/err = query_memoedits.ErrorMsg()
|
|
log_game("SQL ERROR obtaining edits from memo table. Error : \[[err]\]\n")
|
|
return
|
|
if(query_memoedits.NextRow())
|
|
var/edit_log = query_memoedits.item[1]
|
|
usr << browse(edit_log,"window=memoeditlist")
|
|
|
|
else if(href_list["secretsfun"])
|
|
if(!check_rights(R_SERVER|R_EVENT)) return
|
|
|
|
var/ok = 0
|
|
switch(href_list["secretsfun"])
|
|
if("sec_clothes")
|
|
feedback_inc("admin_secrets_fun_used",1)
|
|
feedback_add_details("admin_secrets_fun_used","SC")
|
|
for(var/obj/item/clothing/under/O in world)
|
|
qdel(O)
|
|
ok = 1
|
|
if("sec_all_clothes")
|
|
feedback_inc("admin_secrets_fun_used",1)
|
|
feedback_add_details("admin_secrets_fun_used","SAC")
|
|
for(var/obj/item/clothing/O in world)
|
|
qdel(O)
|
|
ok = 1
|
|
if("sec_classic1")
|
|
feedback_inc("admin_secrets_fun_used",1)
|
|
feedback_add_details("admin_secrets_fun_used","SC1")
|
|
for(var/obj/item/clothing/suit/fire/O in world)
|
|
qdel(O)
|
|
for(var/obj/structure/grille/O in world)
|
|
qdel(O)
|
|
/* for(var/obj/machinery/vehicle/pod/O in world)
|
|
for(var/mob/M in src)
|
|
M.loc = src.loc
|
|
if(M.client)
|
|
M.client.perspective = MOB_PERSPECTIVE
|
|
M.client.eye = M
|
|
qdel(O)
|
|
ok = 1*/
|
|
if("monkey")
|
|
feedback_inc("admin_secrets_fun_used",1)
|
|
feedback_add_details("admin_secrets_fun_used","M")
|
|
for(var/mob/living/carbon/human/H in mob_list)
|
|
spawn(0)
|
|
H.monkeyize()
|
|
ok = 1
|
|
if("corgi")
|
|
feedback_inc("admin_secrets_fun_used",1)
|
|
feedback_add_details("admin_secrets_fun_used","M")
|
|
for(var/mob/living/carbon/human/H in mob_list)
|
|
spawn(0)
|
|
H.corgize()
|
|
ok = 1
|
|
if("honksquad")
|
|
if(usr.client.honksquad())
|
|
feedback_inc("admin_secrets_fun_used",1)
|
|
feedback_add_details("admin_secrets_fun_used","HONK")
|
|
if("striketeam")
|
|
if(usr.client.strike_team())
|
|
feedback_inc("admin_secrets_fun_used",1)
|
|
feedback_add_details("admin_secrets_fun_used","Strike")
|
|
if("striketeam_syndicate")
|
|
if(usr.client.syndicate_strike_team())
|
|
feedback_inc("admin_secrets_fun_used",1)
|
|
feedback_add_details("admin_secrets_fun_used","Strike")
|
|
if("tripleAI")
|
|
usr.client.triple_ai()
|
|
feedback_inc("admin_secrets_fun_used",1)
|
|
feedback_add_details("admin_secrets_fun_used","TriAI")
|
|
if("gravity")
|
|
if(!(ticker && ticker.mode))
|
|
to_chat(usr, "Please wait until the game starts! Not sure how it will work otherwise.")
|
|
return
|
|
gravity_is_on = !gravity_is_on
|
|
for(var/area/A in world)
|
|
A.gravitychange(gravity_is_on,A)
|
|
feedback_inc("admin_secrets_fun_used",1)
|
|
feedback_add_details("admin_secrets_fun_used","Grav")
|
|
if(gravity_is_on)
|
|
log_admin("[key_name(usr)] toggled gravity on.", 1)
|
|
message_admins("\blue [key_name_admin(usr)] toggled gravity on.", 1)
|
|
command_announcement.Announce("Gravity generators are again functioning within normal parameters. Sorry for any inconvenience.")
|
|
else
|
|
log_admin("[key_name(usr)] toggled gravity off.", 1)
|
|
message_admins("\blue [key_name_admin(usr)] toggled gravity off.", 1)
|
|
command_announcement.Announce("Feedback surge detected in mass-distributions systems. Artifical gravity has been disabled whilst the system reinitializes. Further failures may result in a gravitational collapse and formation of blackholes. Have a nice day.")
|
|
|
|
if("power")
|
|
feedback_inc("admin_secrets_fun_used",1)
|
|
feedback_add_details("admin_secrets_fun_used","P")
|
|
log_admin("[key_name(usr)] made all areas powered", 1)
|
|
message_admins("\blue [key_name_admin(usr)] made all areas powered", 1)
|
|
power_restore()
|
|
if("unpower")
|
|
feedback_inc("admin_secrets_fun_used",1)
|
|
feedback_add_details("admin_secrets_fun_used","UP")
|
|
log_admin("[key_name(usr)] made all areas unpowered", 1)
|
|
message_admins("\blue [key_name_admin(usr)] made all areas unpowered", 1)
|
|
power_failure()
|
|
if("quickpower")
|
|
feedback_inc("admin_secrets_fun_used",1)
|
|
feedback_add_details("admin_secrets_fun_used","QP")
|
|
log_admin("[key_name(usr)] made all SMESs powered", 1)
|
|
message_admins("\blue [key_name_admin(usr)] made all SMESs powered", 1)
|
|
power_restore_quick()
|
|
if("prisonwarp")
|
|
if(!ticker)
|
|
alert("The game hasn't started yet!", null, null, null, null, null)
|
|
return
|
|
feedback_inc("admin_secrets_fun_used",1)
|
|
feedback_add_details("admin_secrets_fun_used","PW")
|
|
message_admins("\blue [key_name_admin(usr)] teleported all players to the prison station.", 1)
|
|
for(var/mob/living/carbon/human/H in mob_list)
|
|
var/turf/loc = find_loc(H)
|
|
var/security = 0
|
|
if(!(loc.z in config.station_levels) || prisonwarped.Find(H))
|
|
|
|
//don't warp them if they aren't ready or are already there
|
|
continue
|
|
H.Paralyse(5)
|
|
if(H.wear_id)
|
|
var/obj/item/weapon/card/id/id = H.get_idcard()
|
|
for(var/A in id.access)
|
|
if(A == access_security)
|
|
security++
|
|
if(!security)
|
|
//strip their stuff before they teleport into a cell :downs:
|
|
for(var/obj/item/weapon/W in H)
|
|
if(istype(W, /obj/item/organ/external))
|
|
continue
|
|
//don't strip organs
|
|
H.unEquip(W)
|
|
if(H.client)
|
|
H.client.screen -= W
|
|
if(W)
|
|
W.loc = H.loc
|
|
W.dropped(H)
|
|
W.layer = initial(W.layer)
|
|
W.plane = initial(W.plane)
|
|
//teleport person to cell
|
|
H.loc = pick(prisonwarp)
|
|
H.equip_to_slot_or_del(new /obj/item/clothing/under/color/orange(H), slot_w_uniform)
|
|
H.equip_to_slot_or_del(new /obj/item/clothing/shoes/orange(H), slot_shoes)
|
|
else
|
|
//teleport security person
|
|
H.loc = pick(prisonsecuritywarp)
|
|
prisonwarped += H
|
|
if("traitor_all")
|
|
if(!ticker)
|
|
alert("The game hasn't started yet!")
|
|
return
|
|
var/objective = sanitize(copytext(input("Enter an objective"),1,MAX_MESSAGE_LEN))
|
|
if(!objective)
|
|
return
|
|
feedback_inc("admin_secrets_fun_used",1)
|
|
feedback_add_details("admin_secrets_fun_used","TA([objective])")
|
|
for(var/mob/living/carbon/human/H in player_list)
|
|
if(H.stat == 2 || !H.client || !H.mind) continue
|
|
if(is_special_character(H)) continue
|
|
//traitorize(H, objective, 0)
|
|
ticker.mode.traitors += H.mind
|
|
H.mind.special_role = "traitor"
|
|
var/datum/objective/new_objective = new
|
|
new_objective.owner = H
|
|
new_objective.explanation_text = objective
|
|
H.mind.objectives += new_objective
|
|
ticker.mode.greet_traitor(H.mind)
|
|
//ticker.mode.forge_traitor_objectives(H.mind)
|
|
ticker.mode.finalize_traitor(H.mind)
|
|
for(var/mob/living/silicon/A in player_list)
|
|
ticker.mode.traitors += A.mind
|
|
A.mind.special_role = "traitor"
|
|
var/datum/objective/new_objective = new
|
|
new_objective.owner = A
|
|
new_objective.explanation_text = objective
|
|
A.mind.objectives += new_objective
|
|
ticker.mode.greet_traitor(A.mind)
|
|
ticker.mode.finalize_traitor(A.mind)
|
|
message_admins("\blue [key_name_admin(usr)] used everyone is a traitor secret. Objective is [objective]", 1)
|
|
log_admin("[key_name(usr)] used everyone is a traitor secret. Objective is [objective]")
|
|
|
|
if("togglebombcap")
|
|
feedback_inc("admin_secrets_fun_used",1)
|
|
feedback_add_details("admin_secrets_fun_used","BC")
|
|
|
|
var/newBombCap = input(usr,"What would you like the new bomb cap to be. (entered as the light damage range (the 3rd number in common (1,2,3) notation)) Must be between 4 and 128)", "New Bomb Cap", MAX_EX_LIGHT_RANGE) as num|null
|
|
if(newBombCap < 4)
|
|
return
|
|
if(newBombCap > 128)
|
|
newBombCap = 128
|
|
|
|
MAX_EX_DEVESTATION_RANGE = round(newBombCap/4)
|
|
MAX_EX_HEAVY_RANGE = round(newBombCap/2)
|
|
MAX_EX_LIGHT_RANGE = newBombCap
|
|
//I don't know why these are their own variables, but fuck it, they are.
|
|
MAX_EX_FLASH_RANGE = newBombCap
|
|
MAX_EX_FLAME_RANGE = newBombCap
|
|
|
|
message_admins("<span class='boldannounce'>[key_name_admin(usr)] changed the bomb cap to [MAX_EX_DEVESTATION_RANGE], [MAX_EX_HEAVY_RANGE], [MAX_EX_LIGHT_RANGE]</span>")
|
|
log_admin("[key_name(usr)] changed the bomb cap to [MAX_EX_DEVESTATION_RANGE], [MAX_EX_HEAVY_RANGE], [MAX_EX_LIGHT_RANGE]")
|
|
|
|
if("flicklights")
|
|
feedback_inc("admin_secrets_fun_used",1)
|
|
feedback_add_details("admin_secrets_fun_used","FL")
|
|
while(!usr.stat)
|
|
//knock yourself out to stop the ghosts
|
|
for(var/mob/M in player_list)
|
|
if(M.stat != 2 && prob(25))
|
|
var/area/AffectedArea = get_area(M)
|
|
if(AffectedArea.name != "Space" && AffectedArea.name != "Engine Walls" && AffectedArea.name != "Chemical Lab Test Chamber" && AffectedArea.name != "Escape Shuttle" && AffectedArea.name != "Arrival Area" && AffectedArea.name != "Arrival Shuttle" && AffectedArea.name != "start area" && AffectedArea.name != "Engine Combustion Chamber")
|
|
AffectedArea.power_light = 0
|
|
AffectedArea.power_change()
|
|
spawn(rand(55,185))
|
|
AffectedArea.power_light = 1
|
|
AffectedArea.power_change()
|
|
var/Message = rand(1,4)
|
|
switch(Message)
|
|
if(1)
|
|
M.show_message(text("\blue You shudder as if cold..."), 1)
|
|
if(2)
|
|
M.show_message(text("\blue You feel something gliding across your back..."), 1)
|
|
if(3)
|
|
M.show_message(text("\blue Your eyes twitch, you feel like something you can't see is here..."), 1)
|
|
if(4)
|
|
M.show_message(text("\blue You notice something moving out of the corner of your eye, but nothing is there..."), 1)
|
|
for(var/obj/W in orange(5,M))
|
|
if(prob(25) && !W.anchored)
|
|
step_rand(W)
|
|
sleep(rand(100,1000))
|
|
for(var/mob/M in player_list)
|
|
if(M.stat != 2)
|
|
M.show_message(text("\blue The chilling wind suddenly stops..."), 1)
|
|
/* if("shockwave")
|
|
ok = 1
|
|
to_chat(world, "\red <B><big>ALERT: STATION STRESS CRITICAL</big></B>")
|
|
sleep(60)
|
|
to_chat(world, "\red <B><big>ALERT: STATION STRESS CRITICAL. TOLERABLE LEVELS EXCEEDED!</big></B>")
|
|
sleep(80)
|
|
to_chat(world, "\red <B><big>ALERT: STATION STRUCTURAL STRESS CRITICAL. SAFETY MECHANISMS FAILED!</big></B>")
|
|
sleep(40)
|
|
for(var/mob/M in world)
|
|
shake_camera(M, 400, 1)
|
|
for(var/obj/structure/window/W in world)
|
|
spawn(0)
|
|
sleep(rand(10,400))
|
|
W.ex_act(rand(2,1))
|
|
for(var/obj/structure/grille/G in world)
|
|
spawn(0)
|
|
sleep(rand(20,400))
|
|
G.ex_act(rand(2,1))
|
|
for(var/obj/machinery/door/D in world)
|
|
spawn(0)
|
|
sleep(rand(20,400))
|
|
D.ex_act(rand(2,1))
|
|
for(var/turf/station/floor/Floor in world)
|
|
spawn(0)
|
|
sleep(rand(30,400))
|
|
Floor.ex_act(rand(2,1))
|
|
for(var/obj/structure/cable/Cable in world)
|
|
spawn(0)
|
|
sleep(rand(30,400))
|
|
Cable.ex_act(rand(2,1))
|
|
for(var/obj/structure/closet/Closet in world)
|
|
spawn(0)
|
|
sleep(rand(30,400))
|
|
Closet.ex_act(rand(2,1))
|
|
for(var/obj/machinery/Machinery in world)
|
|
spawn(0)
|
|
sleep(rand(30,400))
|
|
Machinery.ex_act(rand(1,3))
|
|
for(var/turf/station/wall/Wall in world)
|
|
spawn(0)
|
|
sleep(rand(30,400))
|
|
Wall.ex_act(rand(2,1)) */
|
|
if("lightout")
|
|
feedback_inc("admin_secrets_fun_used",1)
|
|
feedback_add_details("admin_secrets_fun_used","LO")
|
|
message_admins("[key_name_admin(usr)] has broke a lot of lights", 1)
|
|
lightsout(1,2)
|
|
if("blackout")
|
|
feedback_inc("admin_secrets_fun_used",1)
|
|
feedback_add_details("admin_secrets_fun_used","BO")
|
|
message_admins("[key_name_admin(usr)] broke all lights", 1)
|
|
lightsout(0,0)
|
|
if("whiteout")
|
|
feedback_inc("admin_secrets_fun_used",1)
|
|
feedback_add_details("admin_secrets_fun_used","WO")
|
|
for(var/obj/machinery/light/L in world)
|
|
L.fix()
|
|
message_admins("[key_name_admin(usr)] fixed all lights", 1)
|
|
if("floorlava")
|
|
feedback_inc("admin_secrets_fun_used", 1)
|
|
feedback_add_details("admin_secrets_fun_used", "LF")
|
|
var/sure = alert(usr, "Are you sure you want to do this?", "Confirmation", "Yes", "No")
|
|
if(sure == "No")
|
|
return
|
|
weather_master.run_weather("the floor is lava")
|
|
message_admins("[key_name_admin(usr)] made the floor lava")
|
|
if("fakelava")
|
|
feedback_inc("admin_secrets_fun_used", 1)
|
|
feedback_add_details("admin_secrets_fun_used", "LZ")
|
|
var/sure = alert(usr, "Are you sure you want to do this?", "Confirmation", "Yes", "No")
|
|
if(sure == "No")
|
|
return
|
|
weather_master.run_weather("fake lava")
|
|
message_admins("[key_name_admin(usr)] made aesthetic lava on the floor")
|
|
if("weatherashstorm")
|
|
feedback_inc("admin_secrets_fun_used", 1)
|
|
feedback_add_details("admin_secrets_fun_used", "WA")
|
|
var/sure = alert(usr, "Are you sure you want to do this?", "Confirmation", "Yes", "No")
|
|
if(sure == "No")
|
|
return
|
|
weather_master.run_weather("ash storm")
|
|
message_admins("[key_name_admin(usr)] spawned an ash storm on the mining asteroid")
|
|
if("weatherdarkness")
|
|
feedback_inc("admin_secrets_fun_used", 1)
|
|
feedback_add_details("admin_secrets_fun_used", "WD")
|
|
var/sure = alert(usr, "Are you sure you want to do this?", "Confirmation", "Yes", "No")
|
|
if(sure == "No")
|
|
return
|
|
weather_master.run_weather("advanced darkness")
|
|
message_admins("[key_name_admin(usr)] made the station go through advanced darkness")
|
|
if("retardify")
|
|
feedback_inc("admin_secrets_fun_used",1)
|
|
feedback_add_details("admin_secrets_fun_used","RET")
|
|
for(var/mob/living/carbon/human/H in player_list)
|
|
to_chat(H, "\red <B>You suddenly feel stupid.</B>")
|
|
H.setBrainLoss(60)
|
|
message_admins("[key_name_admin(usr)] made everybody retarded")
|
|
if("fakeguns")
|
|
feedback_inc("admin_secrets_fun_used",1)
|
|
feedback_add_details("admin_secrets_fun_used","FG")
|
|
for(var/obj/item/W in world)
|
|
if(istype(W, /obj/item/clothing) || istype(W, /obj/item/weapon/card/id) || istype(W, /obj/item/weapon/disk) || istype(W, /obj/item/weapon/tank))
|
|
continue
|
|
W.icon = 'icons/obj/guns/projectile.dmi'
|
|
W.icon_state = "revolver"
|
|
W.item_state = "gun"
|
|
message_admins("[key_name_admin(usr)] made every item look like a gun")
|
|
if("schoolgirl")
|
|
feedback_inc("admin_secrets_fun_used",1)
|
|
feedback_add_details("admin_secrets_fun_used","SG")
|
|
for(var/obj/item/clothing/under/W in world)
|
|
W.icon_state = "schoolgirl"
|
|
W.item_state = "w_suit"
|
|
W.item_color = "schoolgirl"
|
|
message_admins("[key_name_admin(usr)] activated Japanese Animes mode")
|
|
world << sound('sound/AI/animes.ogg')
|
|
if("eagles")//SCRAW
|
|
feedback_inc("admin_secrets_fun_used",1)
|
|
feedback_add_details("admin_secrets_fun_used","EgL")
|
|
for(var/obj/machinery/door/airlock/W in world)
|
|
if((W.z in config.station_levels) && !istype(get_area(W), /area/bridge) && !istype(get_area(W), /area/crew_quarters) && !istype(get_area(W), /area/security/prison))
|
|
W.req_access = list()
|
|
message_admins("[key_name_admin(usr)] activated Egalitarian Station mode")
|
|
command_announcement.Announce("Centcomm airlock control override activated. Please take this time to get acquainted with your coworkers.", new_sound = 'sound/AI/commandreport.ogg')
|
|
if("onlyone")
|
|
feedback_inc("admin_secrets_fun_used",1)
|
|
feedback_add_details("admin_secrets_fun_used","OO")
|
|
usr.client.only_one()
|
|
// message_admins("[key_name_admin(usr)] has triggered HIGHLANDER")
|
|
if("onlyme")
|
|
feedback_inc("admin_secrets_fun_used",1)
|
|
feedback_add_details("admin_secrets_fun_used","OM")
|
|
usr.client.only_me()
|
|
if("onlyoneteam")
|
|
feedback_inc("admin_secrets_fun_used",1)
|
|
feedback_add_details("admin_secrets_fun_used","OOT")
|
|
usr.client.only_one_team()
|
|
// message_admins("[key_name_admin(usr)] has triggered ")
|
|
if("rolldice")
|
|
feedback_inc("admin_secrets_fun_used",1)
|
|
feedback_add_details("admin_secrets_fun_used","ROL")
|
|
usr.client.roll_dices()
|
|
if("guns")
|
|
feedback_inc("admin_secrets_fun_used",1)
|
|
feedback_add_details("admin_secrets_fun_used","SG")
|
|
usr.rightandwrong(0)
|
|
if("magic")
|
|
feedback_inc("admin_secrets_fun_used",1)
|
|
feedback_add_details("admin_secrets_fun_used","SM")
|
|
usr.rightandwrong(1)
|
|
if("tdomereset")
|
|
var/delete_mobs = alert("Clear all mobs?","Confirm","Yes","No","Cancel")
|
|
if(delete_mobs == "Cancel")
|
|
return
|
|
|
|
var/area/thunderdome = locate(/area/tdome/arena)
|
|
if(delete_mobs == "Yes")
|
|
for(var/mob/living/mob in thunderdome)
|
|
qdel(mob) //Clear mobs
|
|
for(var/obj/obj in thunderdome)
|
|
if(!istype(obj,/obj/machinery/camera))
|
|
qdel(obj) //Clear objects
|
|
|
|
var/area/template = locate(/area/tdome/arena_source)
|
|
template.copy_contents_to(thunderdome)
|
|
|
|
log_admin("[key_name(usr)] reset the thunderdome to default with delete_mobs==[delete_mobs].", 1)
|
|
message_admins("<span class='adminnotice'>[key_name_admin(usr)] reset the thunderdome to default with delete_mobs==[delete_mobs].</span>")
|
|
|
|
if("tdomestart")
|
|
var/confirmation = alert("Start a Thunderdome match?","Confirm","Yes","No")
|
|
if(confirmation == "No")
|
|
return
|
|
if(makeThunderdomeTeams())
|
|
log_admin("[key_name(usr)] started a Thunderdome match!", 1)
|
|
message_admins("<span class='adminnotice'>[key_name_admin(usr)] has started a Thunderdome match!</span>")
|
|
else
|
|
log_admin("[key_name(usr)] attempted to start a Thunderdome match, but no ghosts signed up.", 1)
|
|
message_admins("<span class='adminnotice'>[key_name_admin(usr)] tried starting a Thunderdome match, but no ghosts signed up.</span>")
|
|
if("securitylevel0")
|
|
set_security_level(0)
|
|
message_admins("\blue [key_name_admin(usr)] change security level to Green.", 1)
|
|
if("securitylevel1")
|
|
set_security_level(1)
|
|
message_admins("\blue [key_name_admin(usr)] change security level to Blue.", 1)
|
|
if("securitylevel2")
|
|
set_security_level(2)
|
|
message_admins("\blue [key_name_admin(usr)] change security level to Red.", 1)
|
|
if("securitylevel3")
|
|
set_security_level(3)
|
|
message_admins("\blue [key_name_admin(usr)] change security level to Gamma.", 1)
|
|
if("securitylevel4")
|
|
set_security_level(4)
|
|
message_admins("\blue [key_name_admin(usr)] change security level to Epsilon.", 1)
|
|
if("securitylevel5")
|
|
set_security_level(5)
|
|
message_admins("\blue [key_name_admin(usr)] change security level to Delta.", 1)
|
|
if("moveminingshuttle")
|
|
feedback_inc("admin_secrets_fun_used",1)
|
|
feedback_add_details("admin_secrets_fun_used","ShM")
|
|
if(!shuttle_master.toggleShuttle("mining","mining_home","mining_away"))
|
|
message_admins("[key_name_admin(usr)] moved mining shuttle")
|
|
log_admin("[key_name(usr)] moved the mining shuttle")
|
|
|
|
if("movelaborshuttle")
|
|
feedback_inc("admin_secrets_fun_used",1)
|
|
feedback_add_details("admin_secrets_fun_used","ShL")
|
|
if(!shuttle_master.toggleShuttle("laborcamp","laborcamp_home","laborcamp_away"))
|
|
message_admins("[key_name_admin(usr)] moved labor shuttle")
|
|
log_admin("[key_name(usr)] moved the labor shuttle")
|
|
|
|
if("moveferry")
|
|
feedback_inc("admin_secrets_fun_used",1)
|
|
feedback_add_details("admin_secrets_fun_used","ShF")
|
|
if(!shuttle_master.toggleShuttle("ferry","ferry_home","ferry_away"))
|
|
message_admins("[key_name_admin(usr)] moved the centcom ferry")
|
|
log_admin("[key_name(usr)] moved the centcom ferry")
|
|
|
|
if(usr)
|
|
log_admin("[key_name(usr)] used secret [href_list["secretsfun"]]")
|
|
if(ok)
|
|
to_chat(world, text("<B>A secret has been activated by []!</B>", usr.key))
|
|
|
|
else if(href_list["secretsadmin"])
|
|
if(!check_rights(R_ADMIN)) return
|
|
|
|
var/ok = 0
|
|
switch(href_list["secretsadmin"])
|
|
if("clear_bombs")
|
|
//I do nothing
|
|
if("list_bombers")
|
|
var/dat = "<B>Bombing List<HR>"
|
|
for(var/l in bombers)
|
|
dat += text("[l]<BR>")
|
|
usr << browse(dat, "window=bombers")
|
|
if("list_signalers")
|
|
var/dat = "<B>Showing last [length(lastsignalers)] signalers.</B><HR>"
|
|
for(var/sig in lastsignalers)
|
|
dat += "[sig]<BR>"
|
|
usr << browse(dat, "window=lastsignalers;size=800x500")
|
|
if("list_lawchanges")
|
|
var/dat = "<B>Showing last [length(lawchanges)] law changes.</B><HR>"
|
|
for(var/sig in lawchanges)
|
|
dat += "[sig]<BR>"
|
|
usr << browse(dat, "window=lawchanges;size=800x500")
|
|
if("list_job_debug")
|
|
var/dat = "<B>Job Debug info.</B><HR>"
|
|
if(job_master)
|
|
for(var/line in job_master.job_debug)
|
|
dat += "[line]<BR>"
|
|
dat+= "*******<BR><BR>"
|
|
for(var/datum/job/job in job_master.occupations)
|
|
if(!job) continue
|
|
dat += "job: [job.title], current_positions: [job.current_positions], total_positions: [job.total_positions] <BR>"
|
|
usr << browse(dat, "window=jobdebug;size=600x500")
|
|
if("showailaws")
|
|
output_ai_laws()
|
|
if("showgm")
|
|
if(!ticker)
|
|
alert("The game hasn't started yet!")
|
|
else if(ticker.mode)
|
|
alert("The game mode is [ticker.mode.name]")
|
|
else alert("For some reason there's a ticker, but not a game mode")
|
|
if("manifest")
|
|
var/dat = "<B>Showing Crew Manifest.</B><HR>"
|
|
dat += "<table cellspacing=5><tr><th>Name</th><th>Position</th></tr>"
|
|
for(var/mob/living/carbon/human/H in mob_list)
|
|
if(H.ckey)
|
|
dat += text("<tr><td>[]</td><td>[]</td></tr>", H.name, H.get_assignment())
|
|
dat += "</table>"
|
|
usr << browse(dat, "window=manifest;size=440x410")
|
|
if("check_antagonist")
|
|
check_antagonists()
|
|
if("DNA")
|
|
var/dat = "<B>Showing DNA from blood.</B><HR>"
|
|
dat += "<table cellspacing=5><tr><th>Name</th><th>DNA</th><th>Blood Type</th></tr>"
|
|
for(var/mob/living/carbon/human/H in mob_list)
|
|
if(H.dna && H.ckey)
|
|
dat += "<tr><td>[H]</td><td>[H.dna.unique_enzymes]</td><td>[H.b_type]</td></tr>"
|
|
dat += "</table>"
|
|
usr << browse(dat, "window=DNA;size=440x410")
|
|
if("fingerprints")
|
|
var/dat = "<B>Showing Fingerprints.</B><HR>"
|
|
dat += "<table cellspacing=5><tr><th>Name</th><th>Fingerprints</th></tr>"
|
|
for(var/mob/living/carbon/human/H in mob_list)
|
|
if(H.ckey)
|
|
if(H.dna && H.dna.uni_identity)
|
|
dat += "<tr><td>[H]</td><td>[md5(H.dna.uni_identity)]</td></tr>"
|
|
else if(H.dna && !H.dna.uni_identity)
|
|
dat += "<tr><td>[H]</td><td>H.dna.uni_identity = null</td></tr>"
|
|
else if(!H.dna)
|
|
dat += "<tr><td>[H]</td><td>H.dna = null</td></tr>"
|
|
dat += "</table>"
|
|
usr << browse(dat, "window=fingerprints;size=440x410")
|
|
else
|
|
if(usr)
|
|
log_admin("[key_name(usr)] used secret [href_list["secretsadmin"]]")
|
|
if(ok)
|
|
to_chat(world, text("<B>A secret has been activated by []!</B>", usr.key))
|
|
|
|
else if(href_list["secretscoder"])
|
|
if(!check_rights(R_DEBUG)) return
|
|
|
|
switch(href_list["secretscoder"])
|
|
if("spawn_objects")
|
|
var/dat = "<B>Admin Log<HR></B>"
|
|
for(var/l in admin_log)
|
|
dat += "<li>[l]</li>"
|
|
if(!admin_log.len)
|
|
dat += "No-one has done anything this round!"
|
|
usr << browse(dat, "window=admin_log")
|
|
if("maint_access_brig")
|
|
for(var/obj/machinery/door/airlock/maintenance/M in world)
|
|
if(access_maint_tunnels in M.req_access)
|
|
M.req_access = list(access_brig)
|
|
message_admins("[key_name_admin(usr)] made all maint doors brig access-only.")
|
|
if("maint_access_engiebrig")
|
|
for(var/obj/machinery/door/airlock/maintenance/M in world)
|
|
if(access_maint_tunnels in M.req_access)
|
|
M.req_access = list()
|
|
M.req_one_access = list(access_brig,access_engine)
|
|
message_admins("[key_name_admin(usr)] made all maint doors engineering and brig access-only.")
|
|
if("infinite_sec")
|
|
var/datum/job/J = job_master.GetJob("Security Officer")
|
|
if(!J) return
|
|
J.total_positions = -1
|
|
J.spawn_positions = -1
|
|
message_admins("[key_name_admin(usr)] has removed the cap on security officers.")
|
|
|
|
else if(href_list["ac_view_wanted"]) //Admin newscaster Topic() stuff be here
|
|
src.admincaster_screen = 18 //The ac_ prefix before the hrefs stands for AdminCaster.
|
|
src.access_news_network()
|
|
|
|
else if(href_list["ac_set_channel_name"])
|
|
src.admincaster_feed_channel.channel_name = strip_html_simple(input(usr, "Provide a Feed Channel Name", "Network Channel Handler", ""))
|
|
while(findtext(src.admincaster_feed_channel.channel_name," ") == 1)
|
|
src.admincaster_feed_channel.channel_name = copytext(src.admincaster_feed_channel.channel_name,2,lentext(src.admincaster_feed_channel.channel_name)+1)
|
|
src.access_news_network()
|
|
|
|
else if(href_list["ac_set_channel_lock"])
|
|
src.admincaster_feed_channel.locked = !src.admincaster_feed_channel.locked
|
|
src.access_news_network()
|
|
|
|
else if(href_list["ac_submit_new_channel"])
|
|
var/check = 0
|
|
for(var/datum/feed_channel/FC in news_network.network_channels)
|
|
if(FC.channel_name == src.admincaster_feed_channel.channel_name)
|
|
check = 1
|
|
break
|
|
if(src.admincaster_feed_channel.channel_name == "" || src.admincaster_feed_channel.channel_name == "\[REDACTED\]" || check )
|
|
src.admincaster_screen=7
|
|
else
|
|
var/choice = alert("Please confirm Feed channel creation","Network Channel Handler","Confirm","Cancel")
|
|
if(choice=="Confirm")
|
|
var/datum/feed_channel/newChannel = new /datum/feed_channel
|
|
newChannel.channel_name = src.admincaster_feed_channel.channel_name
|
|
newChannel.author = src.admincaster_signature
|
|
newChannel.locked = src.admincaster_feed_channel.locked
|
|
newChannel.is_admin_channel = 1
|
|
feedback_inc("newscaster_channels",1)
|
|
news_network.network_channels += newChannel //Adding channel to the global network
|
|
log_admin("[key_name_admin(usr)] created command feed channel: [src.admincaster_feed_channel.channel_name]!")
|
|
src.admincaster_screen=5
|
|
src.access_news_network()
|
|
|
|
else if(href_list["ac_set_channel_receiving"])
|
|
var/list/available_channels = list()
|
|
for(var/datum/feed_channel/F in news_network.network_channels)
|
|
available_channels += F.channel_name
|
|
src.admincaster_feed_channel.channel_name = adminscrub(input(usr, "Choose receiving Feed Channel", "Network Channel Handler") in available_channels )
|
|
src.access_news_network()
|
|
|
|
else if(href_list["ac_set_new_message"])
|
|
src.admincaster_feed_message.body = adminscrub(input(usr, "Write your Feed story", "Network Channel Handler", ""))
|
|
while(findtext(src.admincaster_feed_message.body," ") == 1)
|
|
src.admincaster_feed_message.body = copytext(src.admincaster_feed_message.body,2,lentext(src.admincaster_feed_message.body)+1)
|
|
src.access_news_network()
|
|
|
|
else if(href_list["ac_submit_new_message"])
|
|
if(src.admincaster_feed_message.body =="" || src.admincaster_feed_message.body =="\[REDACTED\]" || src.admincaster_feed_channel.channel_name == "" )
|
|
src.admincaster_screen = 6
|
|
else
|
|
var/datum/feed_message/newMsg = new /datum/feed_message
|
|
newMsg.author = src.admincaster_signature
|
|
newMsg.body = src.admincaster_feed_message.body
|
|
newMsg.is_admin_message = 1
|
|
feedback_inc("newscaster_stories",1)
|
|
for(var/datum/feed_channel/FC in news_network.network_channels)
|
|
if(FC.channel_name == src.admincaster_feed_channel.channel_name)
|
|
FC.messages += newMsg //Adding message to the network's appropriate feed_channel
|
|
break
|
|
src.admincaster_screen=4
|
|
|
|
for(var/obj/machinery/newscaster/NEWSCASTER in allCasters)
|
|
NEWSCASTER.newsAlert(src.admincaster_feed_channel.channel_name)
|
|
|
|
log_admin("[key_name_admin(usr)] submitted a feed story to channel: [src.admincaster_feed_channel.channel_name]!")
|
|
src.access_news_network()
|
|
|
|
else if(href_list["ac_create_channel"])
|
|
src.admincaster_screen=2
|
|
src.access_news_network()
|
|
|
|
else if(href_list["ac_create_feed_story"])
|
|
src.admincaster_screen=3
|
|
src.access_news_network()
|
|
|
|
else if(href_list["ac_menu_censor_story"])
|
|
src.admincaster_screen=10
|
|
src.access_news_network()
|
|
|
|
else if(href_list["ac_menu_censor_channel"])
|
|
src.admincaster_screen=11
|
|
src.access_news_network()
|
|
|
|
else if(href_list["ac_menu_wanted"])
|
|
var/already_wanted = 0
|
|
if(news_network.wanted_issue)
|
|
already_wanted = 1
|
|
|
|
if(already_wanted)
|
|
src.admincaster_feed_message.author = news_network.wanted_issue.author
|
|
src.admincaster_feed_message.body = news_network.wanted_issue.body
|
|
src.admincaster_screen = 14
|
|
src.access_news_network()
|
|
|
|
else if(href_list["ac_set_wanted_name"])
|
|
src.admincaster_feed_message.author = adminscrub(input(usr, "Provide the name of the Wanted person", "Network Security Handler", ""))
|
|
while(findtext(src.admincaster_feed_message.author," ") == 1)
|
|
src.admincaster_feed_message.author = copytext(admincaster_feed_message.author,2,lentext(admincaster_feed_message.author)+1)
|
|
src.access_news_network()
|
|
|
|
else if(href_list["ac_set_wanted_desc"])
|
|
src.admincaster_feed_message.body = adminscrub(input(usr, "Provide the a description of the Wanted person and any other details you deem important", "Network Security Handler", ""))
|
|
while(findtext(src.admincaster_feed_message.body," ") == 1)
|
|
src.admincaster_feed_message.body = copytext(src.admincaster_feed_message.body,2,lentext(src.admincaster_feed_message.body)+1)
|
|
src.access_news_network()
|
|
|
|
else if(href_list["ac_submit_wanted"])
|
|
var/input_param = text2num(href_list["ac_submit_wanted"])
|
|
if(src.admincaster_feed_message.author == "" || src.admincaster_feed_message.body == "")
|
|
src.admincaster_screen = 16
|
|
else
|
|
var/choice = alert("Please confirm Wanted Issue [(input_param==1) ? ("creation.") : ("edit.")]","Network Security Handler","Confirm","Cancel")
|
|
if(choice=="Confirm")
|
|
if(input_param==1) //If input_param == 1 we're submitting a new wanted issue. At 2 we're just editing an existing one. See the else below
|
|
var/datum/feed_message/WANTED = new /datum/feed_message
|
|
WANTED.author = src.admincaster_feed_message.author //Wanted name
|
|
WANTED.body = src.admincaster_feed_message.body //Wanted desc
|
|
WANTED.backup_author = src.admincaster_signature //Submitted by
|
|
WANTED.is_admin_message = 1
|
|
news_network.wanted_issue = WANTED
|
|
for(var/obj/machinery/newscaster/NEWSCASTER in allCasters)
|
|
NEWSCASTER.newsAlert()
|
|
NEWSCASTER.update_icon()
|
|
src.admincaster_screen = 15
|
|
else
|
|
news_network.wanted_issue.author = src.admincaster_feed_message.author
|
|
news_network.wanted_issue.body = src.admincaster_feed_message.body
|
|
news_network.wanted_issue.backup_author = src.admincaster_feed_message.backup_author
|
|
src.admincaster_screen = 19
|
|
log_admin("[key_name_admin(usr)] issued a Station-wide Wanted Notification for [src.admincaster_feed_message.author]!")
|
|
src.access_news_network()
|
|
|
|
else if(href_list["ac_cancel_wanted"])
|
|
var/choice = alert("Please confirm Wanted Issue removal","Network Security Handler","Confirm","Cancel")
|
|
if(choice=="Confirm")
|
|
news_network.wanted_issue = null
|
|
for(var/obj/machinery/newscaster/NEWSCASTER in allCasters)
|
|
NEWSCASTER.update_icon()
|
|
src.admincaster_screen=17
|
|
src.access_news_network()
|
|
|
|
else if(href_list["ac_censor_channel_author"])
|
|
var/datum/feed_channel/FC = locate(href_list["ac_censor_channel_author"])
|
|
if(FC.author != "<B>\[REDACTED\]</B>")
|
|
FC.backup_author = FC.author
|
|
FC.author = "<B>\[REDACTED\]</B>"
|
|
else
|
|
FC.author = FC.backup_author
|
|
src.access_news_network()
|
|
|
|
else if(href_list["ac_censor_channel_story_author"])
|
|
var/datum/feed_message/MSG = locate(href_list["ac_censor_channel_story_author"])
|
|
if(MSG.author != "<B>\[REDACTED\]</B>")
|
|
MSG.backup_author = MSG.author
|
|
MSG.author = "<B>\[REDACTED\]</B>"
|
|
else
|
|
MSG.author = MSG.backup_author
|
|
src.access_news_network()
|
|
|
|
else if(href_list["ac_censor_channel_story_body"])
|
|
var/datum/feed_message/MSG = locate(href_list["ac_censor_channel_story_body"])
|
|
if(MSG.body != "<B>\[REDACTED\]</B>")
|
|
MSG.backup_body = MSG.body
|
|
MSG.body = "<B>\[REDACTED\]</B>"
|
|
else
|
|
MSG.body = MSG.backup_body
|
|
src.access_news_network()
|
|
|
|
else if(href_list["ac_pick_d_notice"])
|
|
var/datum/feed_channel/FC = locate(href_list["ac_pick_d_notice"])
|
|
src.admincaster_feed_channel = FC
|
|
src.admincaster_screen=13
|
|
src.access_news_network()
|
|
|
|
else if(href_list["ac_toggle_d_notice"])
|
|
var/datum/feed_channel/FC = locate(href_list["ac_toggle_d_notice"])
|
|
FC.censored = !FC.censored
|
|
src.access_news_network()
|
|
|
|
else if(href_list["ac_view"])
|
|
src.admincaster_screen=1
|
|
src.access_news_network()
|
|
|
|
else if(href_list["ac_setScreen"]) //Brings us to the main menu and resets all fields~
|
|
src.admincaster_screen = text2num(href_list["ac_setScreen"])
|
|
if(src.admincaster_screen == 0)
|
|
if(src.admincaster_feed_channel)
|
|
src.admincaster_feed_channel = new /datum/feed_channel
|
|
if(src.admincaster_feed_message)
|
|
src.admincaster_feed_message = new /datum/feed_message
|
|
src.access_news_network()
|
|
|
|
else if(href_list["ac_show_channel"])
|
|
var/datum/feed_channel/FC = locate(href_list["ac_show_channel"])
|
|
src.admincaster_feed_channel = FC
|
|
src.admincaster_screen = 9
|
|
src.access_news_network()
|
|
|
|
else if(href_list["ac_pick_censor_channel"])
|
|
var/datum/feed_channel/FC = locate(href_list["ac_pick_censor_channel"])
|
|
src.admincaster_feed_channel = FC
|
|
src.admincaster_screen = 12
|
|
src.access_news_network()
|
|
|
|
else if(href_list["ac_refresh"])
|
|
src.access_news_network()
|
|
|
|
else if(href_list["ac_set_signature"])
|
|
src.admincaster_signature = adminscrub(input(usr, "Provide your desired signature", "Network Identity Handler", ""))
|
|
src.access_news_network()
|
|
|
|
if(href_list["secretsmenu"])
|
|
switch(href_list["secretsmenu"])
|
|
if("tab")
|
|
current_tab = text2num(href_list["tab"])
|
|
Secrets(usr)
|
|
return 1
|
|
|
|
else if(href_list["viewruntime"])
|
|
var/datum/ErrorViewer/error_viewer = locate(href_list["viewruntime"])
|
|
if(!istype(error_viewer))
|
|
to_chat(usr, "<span class='warning'>That runtime viewer no longer exists.</span>")
|
|
return
|
|
if(href_list["viewruntime_backto"])
|
|
error_viewer.showTo(usr, locate(href_list["viewruntime_backto"]), href_list["viewruntime_linear"])
|
|
else
|
|
error_viewer.showTo(usr, null, href_list["viewruntime_linear"])
|
|
|
|
/proc/admin_jump_link(var/atom/target, var/source)
|
|
if(!target) return
|
|
// The way admin jump links handle their src is weirdly inconsistent...
|
|
if(istype(source, /datum/admins))
|
|
source = "src=\ref[source]"
|
|
else
|
|
source = "_src_=holder"
|
|
|
|
if(isAI(target)) // AI core/eye follow links
|
|
var/mob/living/silicon/ai/A = target
|
|
. = "<A HREF='?[source];adminplayerobservefollow=\ref[target]'>FLW</A>"
|
|
if(A.client && A.eyeobj) // No point following clientless AI eyes
|
|
. += "|<A HREF='?[source];adminplayerobservefollow=\ref[A.eyeobj]'>EYE</A>"
|
|
return
|
|
else if(istype(target, /mob/dead/observer))
|
|
var/mob/dead/observer/O = target
|
|
. = "<A HREF='?[source];adminplayerobservefollow=\ref[target]'>FLW</A>"
|
|
if(O.mind && O.mind.current)
|
|
. += "|<A HREF='?[source];adminplayerobservefollow=\ref[O.mind.current]'>BDY</A>"
|
|
return
|
|
else
|
|
return "<A HREF='?[source];adminplayerobservefollow=\ref[target]'>FLW</A>"
|