mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-21 20:13:45 +01:00
port ADMIN_VERB and friends (#30646)
* port ADMIN_VERB and friends * some renaming * dumb * one more rename * never search and replace this codebase * fix TM issues, more renaming * add a static analysis to shore up user verbs * fix double message on roundstart * remove macro we're not using yet * convert remaining playsounds verbs * convert more verbs i missed somehow * why is this a completely different signature than everything else * fix ui_interact arg * fix logging view and others * buncha issues caught in TM * fix mentor tickets ui * fix bug report viewing * moron
This commit is contained in:
committed by
GitHub
parent
f89b05ee88
commit
2a842644d5
@@ -70,16 +70,11 @@ GLOBAL_VAR_INIT(disable_explosions, FALSE)
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////Panels
|
||||
|
||||
/datum/admins/proc/show_player_panel(mob/M in GLOB.mob_list)
|
||||
set name = "\[Admin\] Show Player Panel"
|
||||
set desc="Edit player (respawn, ban, heal, etc)"
|
||||
|
||||
USER_CONTEXT_MENU(show_player_panel, R_ADMIN|R_MOD, "\[Admin\] Show Player Panel", mob/M)
|
||||
if(!M)
|
||||
to_chat(usr, "You seem to be selecting a mob that doesn't exist anymore.")
|
||||
to_chat(client, "You seem to be selecting a mob that doesn't exist anymore.")
|
||||
return
|
||||
|
||||
if(!check_rights(R_ADMIN|R_MOD))
|
||||
return
|
||||
var/our_key = M.key
|
||||
if(M.client && M.client.holder)
|
||||
if(M.client.holder.fakekey && M.client.holder.big_brother)
|
||||
@@ -289,34 +284,19 @@ GLOBAL_VAR_INIT(disable_explosions, FALSE)
|
||||
</body></html>
|
||||
"}
|
||||
|
||||
usr << browse(body, "window=adminplayeropts;size=550x615")
|
||||
client << browse(body, "window=adminplayeropts;size=550x615")
|
||||
SSblackbox.record_feedback("tally", "admin_verb", 1, "Show Player Panel") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
#define PLAYER_NOTES_ENTRIES_PER_PAGE 50
|
||||
/datum/admins/proc/PlayerNotes()
|
||||
set category = "Admin"
|
||||
set name = "Player Notes"
|
||||
|
||||
if(!check_rights(R_ADMIN|R_MOD))
|
||||
return
|
||||
|
||||
USER_VERB(player_notes, R_ADMIN|R_MOD, "Player Notes", "Open Player Notes panel.", VERB_CATEGORY_ADMIN)
|
||||
show_note()
|
||||
|
||||
/datum/admins/proc/show_player_notes(key as text)
|
||||
set category = "Admin"
|
||||
set name = "Show Player Notes"
|
||||
|
||||
if(!check_rights(R_ADMIN|R_MOD))
|
||||
return
|
||||
|
||||
USER_VERB(player_notes_target, R_ADMIN|R_MOD, "Show Player Notes", "Show Player Notes panel for a given ckey.", VERB_CATEGORY_ADMIN, key as text)
|
||||
show_note(key)
|
||||
|
||||
/datum/admins/proc/vpn_whitelist()
|
||||
set category = "Admin"
|
||||
set name = "VPN Ckey Whitelist"
|
||||
if(!check_rights(R_BAN))
|
||||
return
|
||||
var/key = stripped_input(usr, "Enter ckey to add/remove, or leave blank to cancel:", "VPN Whitelist add/remove", max_length=32)
|
||||
USER_VERB(vpn_whitelist, R_BAN, "VPN Ckey Whitelist", "Modify ckey's presence on VPN whitelist", VERB_CATEGORY_ADMIN)
|
||||
var/key = stripped_input(client, "Enter ckey to add/remove, or leave blank to cancel:", "VPN Whitelist add/remove", max_length=32)
|
||||
if(key)
|
||||
GLOB.ipintel_manager.vpn_whitelist_panel(key)
|
||||
|
||||
@@ -348,118 +328,87 @@ GLOBAL_VAR_INIT(disable_explosions, FALSE)
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////admins2.dm merge
|
||||
//i.e. buttons/verbs
|
||||
|
||||
|
||||
/datum/admins/proc/restart()
|
||||
set category = "Server"
|
||||
set name = "Restart"
|
||||
set desc = "Restarts the world."
|
||||
|
||||
if(!check_rights(R_SERVER))
|
||||
return
|
||||
|
||||
USER_VERB(restart_server, R_SERVER, "Restart", "Restarts the world.", VERB_CATEGORY_SERVER)
|
||||
// Give an extra popup if they are rebooting a live server
|
||||
var/is_live_server = TRUE
|
||||
if(usr.client.is_connecting_from_localhost())
|
||||
if(client.is_connecting_from_localhost())
|
||||
is_live_server = FALSE
|
||||
|
||||
var/list/options = list("Regular Restart", "Hard Restart")
|
||||
if(world.TgsAvailable()) // TGS lets you kill the process entirely
|
||||
options += "Terminate Process (Kill and restart DD)"
|
||||
|
||||
var/result = input(usr, "Select reboot method", "World Reboot", options[1]) as null|anything in options
|
||||
var/result = input(client, "Select reboot method", "World Reboot", options[1]) as null|anything in options
|
||||
|
||||
if(result && is_live_server)
|
||||
if(alert(usr, "WARNING: THIS IS A LIVE SERVER, NOT A LOCAL TEST SERVER. DO YOU STILL WANT TO RESTART","This server is live","Restart","Cancel") != "Restart")
|
||||
if(alert(client, "WARNING: THIS IS A LIVE SERVER, NOT A LOCAL TEST SERVER. DO YOU STILL WANT TO RESTART","This server is live","Restart","Cancel") != "Restart")
|
||||
return FALSE
|
||||
|
||||
if(result)
|
||||
SSblackbox.record_feedback("tally", "admin_verb", 1, "Reboot World") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
var/init_by = "Initiated by [usr.client.holder.fakekey ? "Admin" : usr.key]."
|
||||
var/init_by = "Initiated by [client.holder.fakekey ? "Admin" : client.key]."
|
||||
switch(result)
|
||||
|
||||
if("Regular Restart")
|
||||
var/delay = input("What delay should the restart have (in seconds)?", "Restart Delay", 5) as num|null
|
||||
var/delay = input(client, "What delay should the restart have (in seconds)?", "Restart Delay", 5) as num|null
|
||||
if(!delay)
|
||||
return FALSE
|
||||
|
||||
|
||||
// These are pasted each time so that they dont false send if reboot is cancelled
|
||||
message_admins("[key_name_admin(usr)] has initiated a server restart of type [result]")
|
||||
log_admin("[key_name(usr)] has initiated a server restart of type [result]")
|
||||
message_admins("[key_name_admin(client)] has initiated a server restart of type [result]")
|
||||
log_admin("[key_name(client)] has initiated a server restart of type [result]")
|
||||
SSticker.delay_end = FALSE // We arent delayed anymore
|
||||
SSticker.reboot_helper(init_by, "admin reboot - by [usr.key] [usr.client.holder.fakekey ? "(stealth)" : ""]", delay * 10)
|
||||
SSticker.reboot_helper(init_by, "admin reboot - by [client.key] [client.holder.fakekey ? "(stealth)" : ""]", delay * 10)
|
||||
|
||||
if("Hard Restart")
|
||||
message_admins("[key_name_admin(usr)] has initiated a server restart of type [result]")
|
||||
log_admin("[key_name(usr)] has initiated a server restart of type [result]")
|
||||
message_admins("[key_name_admin(client)] has initiated a server restart of type [result]")
|
||||
log_admin("[key_name(client)] has initiated a server restart of type [result]")
|
||||
world.Reboot(fast_track = TRUE)
|
||||
|
||||
if("Terminate Process (Kill and restart DD)")
|
||||
message_admins("[key_name_admin(usr)] has initiated a server restart of type [result]")
|
||||
log_admin("[key_name(usr)] has initiated a server restart of type [result]")
|
||||
message_admins("[key_name_admin(client)] has initiated a server restart of type [result]")
|
||||
log_admin("[key_name(client)] has initiated a server restart of type [result]")
|
||||
world.TgsEndProcess() // Just nuke the entire process if we are royally fucked
|
||||
|
||||
/datum/admins/proc/end_round()
|
||||
set category = "Server"
|
||||
set name = "End Round"
|
||||
set desc = "Instantly ends the round and brings up the scoreboard, in the same way that wizards dying do."
|
||||
if(!check_rights(R_SERVER))
|
||||
return
|
||||
var/input = sanitize(copytext_char(input(usr, "What text should players see announcing the round end? Input nothing to cancel.", "Specify Announcement Text", "Shift Has Ended!"), 1, MAX_MESSAGE_LEN))
|
||||
USER_VERB(end_round, R_SERVER, "End Round", \
|
||||
"Instantly ends the round and brings up the scoreboard, in the same way that wizards dying do.", \
|
||||
VERB_CATEGORY_SERVER)
|
||||
var/input = sanitize(copytext_char(input(client, "What text should players see announcing the round end? Input nothing to cancel.", "Specify Announcement Text", "Shift Has Ended!"), 1, MAX_MESSAGE_LEN))
|
||||
|
||||
if(!input)
|
||||
return
|
||||
if(SSticker.force_ending)
|
||||
return
|
||||
message_admins("[key_name_admin(usr)] has admin ended the round with message: '[input]'")
|
||||
log_admin("[key_name(usr)] has admin ended the round with message: '[input]'")
|
||||
message_admins("[key_name_admin(client)] has admin ended the round with message: '[input]'")
|
||||
log_admin("[key_name(client)] has admin ended the round with message: '[input]'")
|
||||
SSticker.force_ending = TRUE
|
||||
SSticker.record_biohazard_results()
|
||||
to_chat(world, "<span class='warning'><big><b>[input]</b></big></span>")
|
||||
SSblackbox.record_feedback("tally", "admin_verb", 1, "End Round") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
SSticker.mode_result = "admin ended"
|
||||
|
||||
/datum/admins/proc/announce()
|
||||
set category = "Admin"
|
||||
set name = "Announce"
|
||||
set desc = "Announce your desires to the world"
|
||||
|
||||
if(!check_rights(R_ADMIN))
|
||||
return
|
||||
|
||||
var/message = input("Global message to send:", "Admin Announce", null, null) as message|null
|
||||
USER_VERB(announce, R_ADMIN, "Announce", "Announce your desires to the world", VERB_CATEGORY_ADMIN)
|
||||
var/message = input(client, "Global message to send:", "Admin Announce", null) as message|null
|
||||
if(message)
|
||||
if(!check_rights(R_SERVER,0))
|
||||
if(!check_rights_client(R_SERVER, 0, client))
|
||||
message = adminscrub(message,500)
|
||||
message = replacetext(message, "\n", "<br>") // required since we're putting it in a <p> tag
|
||||
to_chat(world, chat_box_notice("<span class='notice'><b>[usr.client.holder.fakekey ? "Administrator" : usr.key] Announces:</b><br><br><p>[message]</p></span>"))
|
||||
log_admin("Announce: [key_name(usr)] : [message]")
|
||||
to_chat(world, chat_box_notice("<span class='notice'><b>[client.holder.fakekey ? "Administrator" : client.key] Announces:</b><br><br><p>[message]</p></span>"))
|
||||
log_admin("Announce: [key_name(client)] : [message]")
|
||||
for(var/client/clients_to_alert in GLOB.clients)
|
||||
window_flash(clients_to_alert)
|
||||
if(clients_to_alert.prefs?.sound & SOUND_ADMINHELP)
|
||||
SEND_SOUND(clients_to_alert, sound('sound/misc/server_alert.ogg'))
|
||||
|
||||
SSblackbox.record_feedback("tally", "admin_verb", 1, "Announce") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
/datum/admins/proc/toggleooc()
|
||||
set category = "Server"
|
||||
set desc="Globally Toggles OOC"
|
||||
set name="Toggle OOC"
|
||||
|
||||
if(!check_rights(R_ADMIN))
|
||||
return
|
||||
|
||||
USER_VERB(toggle_ooc, R_ADMIN, "Toggle OOC", "Globally Toggles OOC", VERB_CATEGORY_SERVER)
|
||||
toggle_ooc()
|
||||
log_and_message_admins("toggled OOC.")
|
||||
SSblackbox.record_feedback("tally", "admin_verb", 1, "Toggle OOC") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
/datum/admins/proc/togglelooc()
|
||||
set category = "Server"
|
||||
set desc="Globally Toggles LOOC"
|
||||
set name="Toggle LOOC"
|
||||
|
||||
if(!check_rights(R_ADMIN))
|
||||
return
|
||||
|
||||
USER_VERB(toggle_looc, R_ADMIN, "Toggle LOOC", "Globally Toggles LOOC", VERB_CATEGORY_SERVER)
|
||||
GLOB.looc_enabled = !(GLOB.looc_enabled)
|
||||
if(GLOB.looc_enabled)
|
||||
to_chat(world, "<B>The LOOC channel has been globally enabled!</B>")
|
||||
@@ -468,92 +417,57 @@ GLOBAL_VAR_INIT(disable_explosions, FALSE)
|
||||
log_and_message_admins("toggled LOOC.")
|
||||
SSblackbox.record_feedback("tally", "admin_verb", 1, "Toggle LOOC") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
/datum/admins/proc/toggledsay()
|
||||
set category = "Server"
|
||||
set desc="Globally Toggles DSAY"
|
||||
set name="Toggle DSAY"
|
||||
|
||||
if(!check_rights(R_ADMIN))
|
||||
return
|
||||
|
||||
USER_VERB(toggle_dsay, R_ADMIN, "Toggle DSAY", "Globally Toggles DSAY", VERB_CATEGORY_SERVER)
|
||||
GLOB.dsay_enabled = !(GLOB.dsay_enabled)
|
||||
if(GLOB.dsay_enabled)
|
||||
to_chat(world, "<b>Deadchat has been globally enabled!</b>", MESSAGE_TYPE_DEADCHAT)
|
||||
else
|
||||
to_chat(world, "<b>Deadchat has been globally disabled!</b>", MESSAGE_TYPE_DEADCHAT)
|
||||
log_admin("[key_name(usr)] toggled deadchat.")
|
||||
message_admins("[key_name_admin(usr)] toggled deadchat.", 1)
|
||||
SSblackbox.record_feedback("tally", "admin_verb", 1, "Toggle Deadchat") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc
|
||||
|
||||
/datum/admins/proc/toggleoocdead()
|
||||
set category = "Server"
|
||||
set desc="Toggle Dead OOC."
|
||||
set name="Toggle Dead OOC"
|
||||
|
||||
if(!check_rights(R_ADMIN))
|
||||
return
|
||||
log_admin("[key_name(client)] toggled deadchat.")
|
||||
message_admins("[key_name_admin(client)] toggled deadchat.", 1)
|
||||
SSblackbox.record_feedback("tally", "admin_verb", 1, "Toggle Deadchat") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
USER_VERB(toggle_ooc_dead, R_ADMIN, "Toggle Dead OOC", "Toggle Dead OOC.", VERB_CATEGORY_SERVER)
|
||||
GLOB.dooc_enabled = !(GLOB.dooc_enabled)
|
||||
log_admin("[key_name(usr)] toggled Dead OOC.")
|
||||
message_admins("[key_name_admin(usr)] toggled Dead OOC.", 1)
|
||||
log_admin("[key_name(client)] toggled Dead OOC.")
|
||||
message_admins("[key_name_admin(client)] toggled Dead OOC.", 1)
|
||||
SSblackbox.record_feedback("tally", "admin_verb", 1, "Toggle Dead OOC") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
/datum/admins/proc/toggleemoji()
|
||||
set category = "Server"
|
||||
set desc = "Toggle OOC Emoji"
|
||||
set name = "Toggle OOC Emoji"
|
||||
|
||||
if(!check_rights(R_ADMIN))
|
||||
return
|
||||
|
||||
USER_VERB(toggle_emoji, R_ADMIN, "Toggle OOC Emoji", "Toggle OOC Emoji", VERB_CATEGORY_SERVER)
|
||||
GLOB.configuration.general.enable_ooc_emoji = !(GLOB.configuration.general.enable_ooc_emoji)
|
||||
log_admin("[key_name(usr)] toggled OOC Emoji.")
|
||||
message_admins("[key_name_admin(usr)] toggled OOC Emoji.", 1)
|
||||
log_admin("[key_name(client)] toggled OOC Emoji.")
|
||||
message_admins("[key_name_admin(client)] toggled OOC Emoji.", 1)
|
||||
SSblackbox.record_feedback("tally", "admin_verb", 1, "Toggle OOC Emoji")
|
||||
|
||||
/datum/admins/proc/startnow()
|
||||
set category = "Server"
|
||||
set desc="Start the round RIGHT NOW"
|
||||
set name="Start Now"
|
||||
|
||||
if(!check_rights(R_SERVER))
|
||||
return
|
||||
|
||||
USER_VERB(start_server_now, R_SERVER, "Start Now", "Start the round RIGHT NOW", VERB_CATEGORY_SERVER)
|
||||
if(SSticker.current_state < GAME_STATE_STARTUP)
|
||||
alert("Unable to start the game as it is not set up.")
|
||||
alert(client, "Unable to start the game as it is not set up.")
|
||||
return
|
||||
|
||||
if(!SSticker.ticker_going)
|
||||
alert("Remove the round-start delay first.")
|
||||
alert(client, "Remove the round-start delay first.")
|
||||
return
|
||||
|
||||
if(GLOB.configuration.general.start_now_confirmation)
|
||||
if(alert(usr, "This is a live server. Are you sure you want to start now?", "Start game", "Yes", "No") != "Yes")
|
||||
if(alert(client, "This is a live server. Are you sure you want to start now?", "Start game", "Yes", "No") != "Yes")
|
||||
return
|
||||
|
||||
if(SSticker.current_state == GAME_STATE_PREGAME || SSticker.current_state == GAME_STATE_STARTUP)
|
||||
SSticker.force_start = TRUE
|
||||
log_admin("[usr.key] has started the game.")
|
||||
log_admin("[client.key] has started the game.")
|
||||
var/msg = ""
|
||||
if(SSticker.current_state == GAME_STATE_STARTUP)
|
||||
msg = " (The server is still setting up, but the round will be started as soon as possible.)"
|
||||
message_admins("<span class='darkmblue'>[usr.key] has started the game.[msg]</span>")
|
||||
message_admins("<span class='darkmblue'>[client.key] has started the game.[msg]</span>")
|
||||
SSblackbox.record_feedback("tally", "admin_verb", 1, "Start Game") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
return 1
|
||||
else
|
||||
to_chat(usr, "<font color='red'>Error: Start Now: Game has already started.</font>")
|
||||
to_chat(client, "<font color='red'>Error: Start Now: Game has already started.</font>")
|
||||
return
|
||||
|
||||
/datum/admins/proc/toggleenter()
|
||||
set category = "Server"
|
||||
set desc="People can't enter"
|
||||
set name="Toggle Entering"
|
||||
|
||||
if(!check_rights(R_SERVER))
|
||||
return
|
||||
|
||||
if(!usr.client.is_connecting_from_localhost())
|
||||
if(tgui_alert(usr, "Are you sure about this?", "Confirm", list("Yes", "No")) != "Yes")
|
||||
USER_VERB(toggle_enter, R_SERVER, "Toggle Entering", "People can't enter", VERB_CATEGORY_SERVER)
|
||||
if(!client.is_connecting_from_localhost())
|
||||
if(tgui_alert(client, "Are you sure about this?", "Confirm", list("Yes", "No")) != "Yes")
|
||||
return
|
||||
|
||||
GLOB.enter_allowed = !GLOB.enter_allowed
|
||||
@@ -561,40 +475,25 @@ GLOBAL_VAR_INIT(disable_explosions, FALSE)
|
||||
to_chat(world, "<B>New players may no longer enter the game.</B>")
|
||||
else
|
||||
to_chat(world, "<B>New players may now enter the game.</B>")
|
||||
log_admin("[key_name(usr)] toggled new player game entering.")
|
||||
message_admins("[key_name_admin(usr)] toggled new player game entering.", 1)
|
||||
log_admin("[key_name(client)] toggled new player game entering.")
|
||||
message_admins("[key_name_admin(client)] toggled new player game entering.", 1)
|
||||
world.update_status()
|
||||
SSblackbox.record_feedback("tally", "admin_verb", 1, "Toggle Entering") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
/datum/admins/proc/toggle_ai()
|
||||
set category = "Event"
|
||||
set desc="People can't be AI"
|
||||
set name="Toggle AI"
|
||||
|
||||
if(!check_rights(R_EVENT))
|
||||
return
|
||||
|
||||
|
||||
USER_VERB(toggle_ai_role, R_EVENT, "Toggle AI", "People can't be AI", VERB_CATEGORY_EVENT)
|
||||
GLOB.configuration.jobs.allow_ai = !(GLOB.configuration.jobs.allow_ai)
|
||||
if(!GLOB.configuration.jobs.allow_ai)
|
||||
to_chat(world, "<B>The AI job is no longer chooseable.</B>")
|
||||
else
|
||||
to_chat(world, "<B>The AI job is chooseable now.</B>")
|
||||
message_admins("[key_name_admin(usr)] toggled AI allowed.")
|
||||
log_admin("[key_name(usr)] toggled AI allowed.")
|
||||
message_admins("[key_name_admin(client)] toggled AI allowed.")
|
||||
log_admin("[key_name(client)] toggled AI allowed.")
|
||||
world.update_status()
|
||||
SSblackbox.record_feedback("tally", "admin_verb", 1, "Toggle AI") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
/datum/admins/proc/toggleaban()
|
||||
set category = "Server"
|
||||
set desc="Toggle the ability for players to respawn."
|
||||
set name="Toggle Respawn"
|
||||
|
||||
if(!check_rights(R_SERVER))
|
||||
return
|
||||
|
||||
if(!usr.client.is_connecting_from_localhost())
|
||||
if(tgui_alert(usr, "Are you sure about this?", "Confirm", list("Yes", "No")) != "Yes")
|
||||
USER_VERB(toggle_respawn, R_SERVER, "Toggle Respawn", "Toggle the ability for players to respawn.", VERB_CATEGORY_SERVER)
|
||||
if(!client.is_connecting_from_localhost())
|
||||
if(tgui_alert(client, "Are you sure about this?", "Confirm", list("Yes", "No")) != "Yes")
|
||||
return
|
||||
|
||||
GLOB.configuration.general.respawn_enabled = !(GLOB.configuration.general.respawn_enabled)
|
||||
@@ -602,25 +501,18 @@ GLOBAL_VAR_INIT(disable_explosions, FALSE)
|
||||
to_chat(world, "<B>You may now respawn.</B>")
|
||||
else
|
||||
to_chat(world, "<B>You may no longer respawn</B>")
|
||||
message_admins("[key_name_admin(usr)] toggled respawn to [GLOB.configuration.general.respawn_enabled ? "On" : "Off"].", 1)
|
||||
log_admin("[key_name(usr)] toggled respawn to [GLOB.configuration.general.respawn_enabled ? "On" : "Off"].")
|
||||
message_admins("[key_name_admin(client)] toggled respawn to [GLOB.configuration.general.respawn_enabled ? "On" : "Off"].", 1)
|
||||
log_admin("[key_name(client)] toggled respawn to [GLOB.configuration.general.respawn_enabled ? "On" : "Off"].")
|
||||
world.update_status()
|
||||
SSblackbox.record_feedback("tally", "admin_verb", 1, "Toggle Respawn") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
/datum/admins/proc/delay()
|
||||
set category = "Server"
|
||||
set desc="Delay the game start/end"
|
||||
set name="Delay"
|
||||
|
||||
if(!check_rights(R_SERVER))
|
||||
return
|
||||
|
||||
USER_VERB(delay_game, R_SERVER, "Delay", "Delay the game start/end", VERB_CATEGORY_SERVER)
|
||||
if(SSticker.current_state < GAME_STATE_STARTUP)
|
||||
alert("Slow down a moment, let the ticker start first!")
|
||||
alert(client, "Slow down a moment, let the ticker start first!")
|
||||
return
|
||||
|
||||
if(!usr.client.is_connecting_from_localhost())
|
||||
if(tgui_alert(usr, "Are you sure about this?", "Confirm", list("Yes", "No")) != "Yes")
|
||||
if(!client.is_connecting_from_localhost())
|
||||
if(tgui_alert(client, "Are you sure about this?", "Confirm", list("Yes", "No")) != "Yes")
|
||||
return
|
||||
|
||||
if(SSblackbox)
|
||||
@@ -628,8 +520,8 @@ GLOBAL_VAR_INIT(disable_explosions, FALSE)
|
||||
|
||||
if(SSticker.current_state > GAME_STATE_PREGAME)
|
||||
SSticker.delay_end = !SSticker.delay_end
|
||||
log_admin("[key_name(usr)] [SSticker.delay_end ? "delayed the round end" : "has made the round end normally"].")
|
||||
message_admins("[key_name(usr)] [SSticker.delay_end ? "delayed the round end" : "has made the round end normally"].", 1)
|
||||
log_admin("[key_name(client)] [SSticker.delay_end ? "delayed the round end" : "has made the round end normally"].")
|
||||
message_admins("[key_name(client)] [SSticker.delay_end ? "delayed the round end" : "has made the round end normally"].", 1)
|
||||
if(SSticker.delay_end)
|
||||
SSticker.real_reboot_time = 0 // Immediately show the "Admin delayed round end" message
|
||||
return //alert("Round end delayed", null, null, null, null, null)
|
||||
@@ -637,12 +529,12 @@ GLOBAL_VAR_INIT(disable_explosions, FALSE)
|
||||
SSticker.ticker_going = FALSE
|
||||
SSticker.delay_end = TRUE
|
||||
to_chat(world, "<b>The game start has been delayed.</b>")
|
||||
log_admin("[key_name(usr)] delayed the game.")
|
||||
log_admin("[key_name(client)] delayed the game.")
|
||||
else
|
||||
SSticker.ticker_going = TRUE
|
||||
SSticker.round_start_time = world.time + SSticker.pregame_timeleft
|
||||
to_chat(world, "<b>The game will start soon.</b>")
|
||||
log_admin("[key_name(usr)] removed the delay.")
|
||||
log_admin("[key_name(client)] removed the delay.")
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////ADMIN HELPER PROCS
|
||||
|
||||
@@ -725,14 +617,9 @@ GLOBAL_VAR_INIT(disable_explosions, FALSE)
|
||||
|
||||
return ""
|
||||
|
||||
/datum/admins/proc/spawn_atom(object as text)
|
||||
set category = "Debug"
|
||||
set desc = "(atom path) Spawn an atom. Append a period to the text in order to exclude subtypes of paths matching the input."
|
||||
set name = "Spawn"
|
||||
|
||||
if(!check_rights(R_SPAWN))
|
||||
return
|
||||
|
||||
USER_VERB(spawn_atom, R_SPAWN, "Spawn", \
|
||||
"Spawn an atom. Append a period to the text in order to exclude subtypes of paths matching the input.", \
|
||||
VERB_CATEGORY_DEBUG, object as text)
|
||||
if(!object)
|
||||
return
|
||||
|
||||
@@ -761,48 +648,35 @@ GLOBAL_VAR_INIT(disable_explosions, FALSE)
|
||||
if(length(matches)==1)
|
||||
chosen = matches[1]
|
||||
else
|
||||
chosen = tgui_input_list(usr, "Select an Atom Type", "Spawn Atom", matches)
|
||||
chosen = tgui_input_list(client, "Select an Atom Type", "Spawn Atom", matches)
|
||||
if(!chosen)
|
||||
return
|
||||
|
||||
if(ispath(chosen,/turf))
|
||||
var/turf/T = get_turf(usr.loc)
|
||||
var/turf/T = get_turf(client.mob.loc)
|
||||
T.ChangeTurf(chosen)
|
||||
else
|
||||
var/atom/A = new chosen(usr.loc)
|
||||
var/atom/A = new chosen(client.mob.loc)
|
||||
A.admin_spawned = TRUE
|
||||
|
||||
log_admin("[key_name(usr)] spawned [chosen] at ([usr.x],[usr.y],[usr.z])")
|
||||
log_admin("[key_name(client)] spawned [chosen] at ([client.mob.x],[client.mob.y],[client.mob.z])")
|
||||
SSblackbox.record_feedback("tally", "admin_verb", 1, "Spawn Atom") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
/datum/admins/proc/show_traitor_panel(mob/M in GLOB.mob_list)
|
||||
set category = "Admin"
|
||||
set desc = "Edit mobs's memory and role"
|
||||
set name = "Show Traitor Panel"
|
||||
|
||||
if(!check_rights(R_ADMIN|R_MOD))
|
||||
return
|
||||
|
||||
USER_VERB_VISIBILITY(show_traitor_panel, VERB_VISIBILITY_FLAG_MOREDEBUG)
|
||||
USER_VERB(show_traitor_panel, R_ADMIN|R_MOD, "Show Traitor Panel", "Edit mob's memory and role", VERB_CATEGORY_ADMIN, mob/M in GLOB.mob_list)
|
||||
if(!istype(M))
|
||||
to_chat(usr, "This can only be used on instances of type /mob")
|
||||
to_chat(client, "This can only be used on instances of type /mob")
|
||||
return
|
||||
if(!M.mind)
|
||||
to_chat(usr, "This mob has no mind!")
|
||||
to_chat(client, "This mob has no mind!")
|
||||
return
|
||||
|
||||
M.mind.edit_memory()
|
||||
SSblackbox.record_feedback("tally", "admin_verb", 1, "Show Traitor Panel") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
/datum/admins/proc/toggleguests()
|
||||
set category = "Server"
|
||||
set desc="Guests can't enter"
|
||||
set name="Toggle Guests"
|
||||
|
||||
if(!check_rights(R_SERVER))
|
||||
return
|
||||
|
||||
if(!usr.client.is_connecting_from_localhost())
|
||||
if(tgui_alert(usr, "Are you sure about this?", "Confirm", list("Yes", "No")) != "Yes")
|
||||
USER_VERB(toggle_guests, R_SERVER, "Toggle Guests", "Guests can't enter", VERB_CATEGORY_SERVER)
|
||||
if(!client.is_connecting_from_localhost())
|
||||
if(tgui_alert(client, "Are you sure about this?", "Confirm", list("Yes", "No")) != "Yes")
|
||||
return
|
||||
|
||||
GLOB.configuration.general.guest_ban = !(GLOB.configuration.general.guest_ban)
|
||||
@@ -810,8 +684,8 @@ GLOBAL_VAR_INIT(disable_explosions, FALSE)
|
||||
to_chat(world, "<B>Guests may no longer enter the game.</B>")
|
||||
else
|
||||
to_chat(world, "<B>Guests may now enter the game.</B>")
|
||||
log_admin("[key_name(usr)] toggled guests game entering [GLOB.configuration?.general.guest_ban ? "dis" : ""]allowed.")
|
||||
message_admins("<span class='notice'>[key_name_admin(usr)] toggled guests game entering [GLOB.configuration?.general.guest_ban ? "dis" : ""]allowed.</span>", 1)
|
||||
log_admin("[key_name(client)] toggled guests game entering [GLOB.configuration?.general.guest_ban ? "dis" : ""]allowed.")
|
||||
message_admins("<span class='notice'>[key_name_admin(client)] toggled guests game entering [GLOB.configuration?.general.guest_ban ? "dis" : ""]allowed.</span>", 1)
|
||||
SSblackbox.record_feedback("tally", "admin_verb", 1, "Toggle Guests") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
/datum/admins/proc/output_ai_laws()
|
||||
@@ -848,13 +722,7 @@ GLOBAL_VAR_INIT(disable_explosions, FALSE)
|
||||
log_admin("[key_name(usr)] checked the AI laws")
|
||||
message_admins("[key_name_admin(usr)] checked the AI laws")
|
||||
|
||||
/client/proc/update_mob_sprite(mob/living/carbon/human/H as mob)
|
||||
set name = "\[Admin\] Update Mob Sprite"
|
||||
set desc = "Should fix any mob sprite update errors."
|
||||
|
||||
if(!check_rights(R_ADMIN))
|
||||
return
|
||||
|
||||
USER_CONTEXT_MENU(update_mob_sprite, R_ADMIN, "\[Admin\] Update Mob Sprite", mob/living/carbon/human/H as mob)
|
||||
if(istype(H))
|
||||
H.regenerate_icons()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user