Further logging/right check updates

This commit is contained in:
Markolie
2015-09-24 04:01:47 +02:00
parent fa0efbf983
commit fccac25c99
3 changed files with 225 additions and 233 deletions
+61 -62
View File
@@ -33,12 +33,9 @@ var/global/nologevent = 0
if(!M)
usr << "You seem to be selecting a mob that doesn't exist anymore."
return
if (!istype(src,/datum/admins))
src = usr.client.holder
if (!istype(src,/datum/admins))
usr << "Error: you are not an admin!"
if(!check_rights(R_ADMIN|R_MOD))
return
if(!check_rights(R_ADMIN|R_MOD)) return
var/body = "<html><head><title>Options for [M.key]</title></head>"
body += "<body>Options panel for <b>[M]</b>"
@@ -216,7 +213,7 @@ var/global/nologevent = 0
set category = "Admin"
set name = "Player Notes"
if(!check_rights(R_MOD))
if(!check_rights(R_MOD|R_ADMIN))
return
show_note()
@@ -225,7 +222,7 @@ var/global/nologevent = 0
set category = "Admin"
set name = "Show Player Notes"
if(!check_rights(R_MOD))
if(!check_rights(R_MOD|R_ADMIN))
return
show_note(key)
@@ -472,10 +469,9 @@ var/global/nologevent = 0
usr << browse(dat, "window=admincaster_main;size=400x600")
onclose(usr, "admincaster_main")
/datum/admins/proc/Jobbans()
if(!check_rights(R_BAN)) return
if(!check_rights(R_BAN))
return
var/dat = "<B>Job Bans!</B><HR><table>"
for(var/t in jobban_keylist)
@@ -487,7 +483,8 @@ var/global/nologevent = 0
usr << browse(dat, "window=ban;size=400x400")
/datum/admins/proc/Game()
if(!check_rights(0)) return
if(!check_rights(R_ADMIN))
return
var/dat = {"
<center><B>Game Panel</B></center><hr>\n
@@ -516,7 +513,8 @@ var/global/nologevent = 0
set name = "Restart"
set desc = "Restarts the world."
if(!check_rights(R_ADMIN)) return
if(!check_rights(R_SERVER))
return
var/confirm = alert("Restart the game world?", "Restart", "Yes", "Cancel")
if(confirm == "Cancel")
@@ -539,7 +537,8 @@ var/global/nologevent = 0
set name = "Announce"
set desc="Announce your desires to the world"
if(!check_rights(R_ADMIN)) return
if(!check_rights(R_ADMIN))
return
var/message = input("Global message to send:", "Admin Announce", null, null) as message|null
if(message)
@@ -608,26 +607,21 @@ var/global/nologevent = 0
message_admins("[key_name_admin(usr)] toggled Dead OOC.", 1)
feedback_add_details("admin_verb","TDOOC") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/datum/admins/proc/toggletraitorscaling()
set category = "Server"
set desc="Toggle traitor scaling"
set name="Toggle Traitor Scaling"
traitor_scaling = !traitor_scaling
log_admin("[key_name(usr)] toggled Traitor Scaling to [traitor_scaling].")
message_admins("[key_name_admin(usr)] toggled Traitor Scaling [traitor_scaling ? "on" : "off"].", 1)
feedback_add_details("admin_verb","TTS") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/datum/admins/proc/startnow()
set category = "Server"
set desc="Start the round RIGHT NOW"
set name="Start Now"
if(!check_rights(R_SERVER))
return
if(!ticker)
alert("Unable to start the game as it is not set up.")
return
if(ticker.current_state == GAME_STATE_PREGAME)
ticker.current_state = GAME_STATE_SETTING_UP
log_admin("[usr.key] has started the game.")
message_admins("<font color='blue'>[usr.key] has started the game.</font>")
log_admin("[key_name(usr)] has started the game.")
message_admins("[key_name_admin(usr)] has started the game.")
feedback_add_details("admin_verb","SN") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
return 1
else
@@ -638,13 +632,17 @@ var/global/nologevent = 0
set category = "Server"
set desc="People can't enter"
set name="Toggle Entering"
if(!check_rights(R_SERVER))
return
enter_allowed = !( enter_allowed )
if (!( enter_allowed ))
world << "<B>New players may no longer enter the game.</B>"
else
world << "<B>New players may now enter the game.</B>"
log_admin("[key_name(usr)] toggled new player game entering.")
message_admins("\blue [key_name_admin(usr)] toggled new player game entering.", 1)
message_admins("[key_name_admin(usr)] toggled new player game entering.", 1)
world.update_status()
feedback_add_details("admin_verb","TE") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
@@ -652,25 +650,34 @@ var/global/nologevent = 0
set category = "Event"
set desc="People can't be AI"
set name="Toggle AI"
if(!check_rights(R_EVENT))
return
config.allow_ai = !( config.allow_ai )
if (!( config.allow_ai ))
world << "<B>The AI job is no longer chooseable.</B>"
else
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.")
world.update_status()
feedback_add_details("admin_verb","TAI") //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="Respawn basically"
set desc="Toggle the ability for players to respawn."
set name="Toggle Respawn"
if(!check_rights(R_SERVER))
return
abandon_allowed = !( abandon_allowed )
if (abandon_allowed)
world << "<B>You may now respawn.</B>"
else
world << "<B>You may no longer respawn :(</B>"
message_admins("\blue [key_name_admin(usr)] toggled respawn to [abandon_allowed ? "On" : "Off"].", 1)
message_admins("[key_name_admin(usr)] toggled respawn to [abandon_allowed ? "On" : "Off"].", 1)
log_admin("[key_name(usr)] toggled respawn to [abandon_allowed ? "On" : "Off"].")
world.update_status()
feedback_add_details("admin_verb","TR") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
@@ -679,9 +686,13 @@ var/global/nologevent = 0
set category = "Event"
set desc="Toggle alien mobs"
set name="Toggle Aliens"
if(!check_rights(R_EVENT))
return
aliens_allowed = !aliens_allowed
log_admin("[key_name(usr)] toggled Aliens to [aliens_allowed].")
message_admins("[key_name_admin(usr)] toggled Aliens [aliens_allowed ? "on" : "off"].", 1)
log_admin("[key_name(usr)] toggled aliens to [aliens_allowed].")
message_admins("[key_name_admin(usr)] toggled aliens [aliens_allowed ? "on" : "off"].")
feedback_add_details("admin_verb","TA") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/datum/admins/proc/delay()
@@ -689,11 +700,13 @@ var/global/nologevent = 0
set desc="Delay the game start/end"
set name="Delay"
if(!check_rights(R_ADMIN)) return
if(!check_rights(R_SERVER))
return
if (!ticker || ticker.current_state != GAME_STATE_PREGAME)
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(usr)] [ticker.delay_end ? "delayed the round end" : "has made the round end normally"].", 1)
message_admins("[key_name(usr)] [ticker.delay_end ? "delayed the round end" : "has made the round end normally"].", 1)
return //alert("Round end delayed", null, null, null, null, null)
going = !( going )
if (!( going ))
@@ -704,17 +717,6 @@ var/global/nologevent = 0
log_admin("[key_name(usr)] removed the delay.")
feedback_add_details("admin_verb","DELAY") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/datum/admins/proc/unprison(var/mob/M in mob_list)
set category = "Admin"
set name = "Unprison"
if ((M.z in config.admin_levels))
M.loc = pick(latejoin)
message_admins("[key_name_admin(usr)] has unprisoned [key_name_admin(M)]", 1)
log_admin("[key_name(usr)] has unprisoned [key_name(M)]")
else
alert("[M.name] is not prisoned.")
feedback_add_details("admin_verb","UP") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
////////////////////////////////////////////////////////////////////////////////////////////////ADMIN HELPER PROCS
/proc/is_special_character(mob/M as mob) // returns 1 for specail characters and 2 for heroes of gamemode
@@ -760,7 +762,8 @@ var/global/nologevent = 0
set desc = "(atom path) Spawn an atom"
set name = "Spawn"
if(!check_rights(R_SPAWN)) return
if(!check_rights(R_SPAWN))
return
var/list/types = typesof(/atom)
var/list/matches = new()
@@ -794,6 +797,9 @@ var/global/nologevent = 0
set category = "Admin"
set desc = "Edit mobs's memory and role"
set name = "Show Traitor Panel"
if(!check_rights(R_ADMIN))
return
if(!istype(M))
usr << "This can only be used on instances of type /mob"
@@ -805,24 +811,14 @@ var/global/nologevent = 0
M.mind.edit_memory()
feedback_add_details("admin_verb","STP") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/datum/admins/proc/toggletintedweldhelmets()
set category = "Debug"
set desc="Reduces view range when wearing welding helmets"
set name="Toggle tinted welding helmes"
tinted_weldhelh = !( tinted_weldhelh )
if (tinted_weldhelh)
world << "<B>The tinted_weldhelh has been enabled!</B>"
else
world << "<B>The tinted_weldhelh has been disabled!</B>"
log_admin("[key_name(usr)] toggled tinted_weldhelh.")
message_admins("[key_name_admin(usr)] toggled tinted_weldhelh.", 1)
feedback_add_details("admin_verb","TTWH") //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"
set name="Toggle Guests"
if(!check_rights(R_SERVER))
return
guests_allowed = !( guests_allowed )
if (!( guests_allowed ))
world << "<B>Guests may no longer enter the game.</B>"
@@ -861,6 +857,9 @@ var/global/nologevent = 0
set category = "Admin"
set name = "Update Mob Sprite"
set desc = "Should fix any mob sprite update errors."
if(!check_rights(R_ADMIN))
return
if (!holder)
src << "Only administrators may use this command."
@@ -876,7 +875,7 @@ var/global/nologevent = 0
var/gamma_ship_location = 1 // 0 = station , 1 = space
proc/move_gamma_ship()
/proc/move_gamma_ship()
var/area/fromArea
var/area/toArea
if (gamma_ship_location == 1)
@@ -902,7 +901,7 @@ proc/move_gamma_ship()
gamma_ship_location = 1
return
proc/formatJumpTo(var/location,var/where="")
/proc/formatJumpTo(var/location,var/where="")
var/turf/loc
if(istype(location,/turf/))
loc = location
@@ -912,7 +911,7 @@ proc/formatJumpTo(var/location,var/where="")
where=formatLocation(loc)
return "<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[loc.x];Y=[loc.y];Z=[loc.z]'>[where]</a>"
proc/formatLocation(var/location)
/proc/formatLocation(var/location)
var/turf/loc
if(istype(location,/turf/))
loc = location
@@ -921,7 +920,7 @@ proc/formatLocation(var/location)
var/area/A = get_area(location)
return "[A.name] - [loc.x],[loc.y],[loc.z]"
proc/formatPlayerPanel(var/mob/U,var/text="PP")
/proc/formatPlayerPanel(var/mob/U,var/text="PP")
return "<A HREF='?_src_=holder;adminplayeropts=\ref[U]'>[text]</A>"
//Kicks all the clients currently in the lobby. The second parameter (kick_only_afk) determins if an is_afk() check is ran, or if all clients are kicked