Merge branch 'incremental_tg' r5067 into bs12_with_tgport

removed extraneous admin attack messages, temporarily disabled much moderator stuff (will be re-enabled in future updates)

Conflicts:
	baystation12.dme
	code/__HELPERS/type2type.dm
	code/controllers/configuration.dm
	code/datums/datumvars.dm
	code/datums/helper_datums/getrev.dm
	code/defines/obj.dm
	code/game/gamemodes/events/black_hole.dm
	code/game/gamemodes/events/space_ninja.dm
	code/game/gamemodes/wizard/rightandwrong.dm
	code/game/jobs/job/captain.dm
	code/game/jobs/job/job.dm
	code/game/jobs/job_controller.dm
	code/game/machinery/bots/medbot.dm
	code/game/machinery/computer/card.dm
	code/game/machinery/telecomms/traffic_control.dm
	code/game/machinery/turrets.dm
	code/game/machinery/wishgranter.dm
	code/game/objects/items/blueprints.dm
	code/game/objects/items/devices/uplinks.dm
	code/game/objects/items/stacks/stack.dm
	code/game/objects/items/weapons/surgery_tools.dm
	code/game/turfs/turf.dm
	code/game/verbs/ooc.dm
	code/global.dm
	code/modules/admin/IsBanned.dm
	code/modules/admin/admin.dm
	code/modules/admin/admin_memo.dm
	code/modules/admin/admin_verbs.dm
	code/modules/admin/holder2.dm
	code/modules/admin/player_panel.dm
	code/modules/admin/verbs/adminpm.dm
	code/modules/admin/verbs/diagnostics.dm
	code/modules/assembly/igniter.dm
	code/modules/client/client defines.dm
	code/modules/client/client procs.dm
	code/modules/clothing/spacesuits/miscellaneous.dm
	code/modules/clothing/suits/armor.dm
	code/modules/clothing/suits/jobs.dm
	code/modules/mining/mine_turfs.dm
	code/modules/mob/living/carbon/human/say.dm
	code/modules/mob/living/carbon/human/update_icons.dm
	code/modules/mob/living/living.dm
	code/modules/mob/living/living_defense.dm
	code/modules/mob/living/silicon/robot/emote.dm
	code/modules/mob/living/silicon/robot/life.dm
	code/modules/mob/mob_cleanup.dm
	code/modules/mob/new_player/new_player.dm
	code/modules/mob/new_player/preferences.dm
	code/modules/paperwork/paper.dm
	code/modules/paperwork/photocopier.dm
	code/modules/projectiles/guns/projectile/automatic.dm
	code/modules/reagents/Chemistry-Machinery.dm
	code/setup.dm
	code/stylesheet.dm
	code/world.dm
	config/admins.txt
	config/config.txt
	html/changelog.html
	icons/mob/items_lefthand.dmi
	icons/mob/items_righthand.dmi
	icons/mob/suit.dmi
	icons/obj/clothing/suits.dmi
	icons/turf/areas.dmi

Signed-off-by: Cael_Aislinn <cael_aislinn@yahoo.com.au>
This commit is contained in:
Cael_Aislinn
2012-12-28 13:12:41 +10:00
341 changed files with 17940 additions and 16947 deletions
+235 -28
View File
@@ -1,14 +1,9 @@
datum/admins/proc/DB_ban_record(var/bantype, var/mob/banned_mob, var/duration = -1, var/reason, var/job = "", var/rounds = 0)
var/user = sqlfdbklogin
var/pass = sqlfdbkpass
var/db = sqlfdbkdb
var/address = sqladdress
var/port = sqlport
datum/admins/proc/DB_ban_record(var/bantype, var/mob/banned_mob, var/duration = -1, var/reason, var/job = "", var/rounds = 0, var/banckey = null)
var/DBConnection/dbcon = new()
if(!check_rights(R_BAN)) return
dbcon.Connect("dbi:mysql:[db]:[address]:[port]","[user]","[pass]")
establish_db_connection()
if(!dbcon.IsConnected())
return
@@ -43,6 +38,17 @@ datum/admins/proc/DB_ban_record(var/bantype, var/mob/banned_mob, var/duration =
if(banned_mob.client)
computerid = banned_mob.client.computer_id
ip = banned_mob.client.address
else if(banckey)
ckey = ckey(banckey)
var/DBQuery/query = dbcon.NewQuery("SELECT id FROM erro_player WHERE ckey = '[ckey]'")
query.Execute()
var/validckey = 0
if(query.NextRow())
validckey = 1
if(!validckey)
message_admins("<font color='red'>[key_name_admin(usr)] attempted to ban [ckey], but [ckey] has not been seen yet. Please only ban actual players.</font>",1)
return
var/a_ckey
var/a_computerid
@@ -72,17 +78,14 @@ datum/admins/proc/DB_ban_record(var/bantype, var/mob/banned_mob, var/duration =
var/sql = "INSERT INTO erro_ban VALUES (null, Now(), '[serverip]', '[bantype_str]', '[reason]', '[job]', [(duration)?"[duration]":"0"], [(rounds)?"[rounds]":"0"], Now() + INTERVAL [(duration>0) ? duration : 0] MINUTE, '[ckey]', '[computerid]', '[ip]', '[a_ckey]', '[a_computerid]', '[a_ip]', '[who]', '[adminwho]', '', null, null, null, null, null)"
var/DBQuery/query_insert = dbcon.NewQuery(sql)
query_insert.Execute()
dbcon.Disconnect()
usr << "\blue Ban saved to database."
message_admins("[key_name_admin(usr)] has added a [bantype_str] for [ckey] [(job)?"([job])":""] [(duration > 0)?"([duration] minutes)":""] with the reason: \"[reason]\" to the ban database.",1)
datum/admins/proc/DB_ban_unban(var/ckey, var/bantype, var/job = "")
var/user = sqlfdbklogin
var/pass = sqlfdbkpass
var/db = sqlfdbkdb
var/address = sqladdress
var/port = sqlport
if(!check_rights(R_BAN)) return
var/bantype_str
if(bantype)
@@ -115,9 +118,7 @@ datum/admins/proc/DB_ban_unban(var/ckey, var/bantype, var/job = "")
if(job)
sql += " AND job = '[job]'"
var/DBConnection/dbcon = new()
dbcon.Connect("dbi:mysql:[db]:[address]:[port]","[user]","[pass]")
establish_db_connection()
if(!dbcon.IsConnected())
return
@@ -146,27 +147,83 @@ datum/admins/proc/DB_ban_unban(var/ckey, var/bantype, var/job = "")
DB_ban_unban_by_id(ban_id)
datum/admins/proc/DB_ban_edit(var/banid = null, var/param = null)
if(!check_rights(R_BAN)) return
if(!isnum(banid) || !istext(param))
usr << "Cancelled"
return
var/DBQuery/query = dbcon.NewQuery("SELECT ckey, duration, reason FROM erro_ban WHERE id = [banid]")
query.Execute()
var/eckey = usr.ckey //Editing admin ckey
var/pckey //(banned) Player ckey
var/duration //Old duration
var/reason //Old reason
if(query.NextRow())
pckey = query.item[1]
duration = query.item[2]
reason = query.item[3]
else
usr << "Invalid ban id. Contact the database admin"
return
reason = sql_sanitize_text(reason)
var/value
switch(param)
if("reason")
if(!value)
value = input("Insert the new reason for [pckey]'s ban", "New Reason", "[reason]", null) as null|text
value = sql_sanitize_text(value)
if(!value)
usr << "Cancelled"
return
var/DBQuery/update_query = dbcon.NewQuery("UPDATE erro_ban SET reason = '[value]', edits = CONCAT(edits,'- [eckey] changed ban reason from <cite><b>\\\"[reason]\\\"</b></cite> to <cite><b>\\\"[value]\\\"</b></cite><BR>') WHERE id = [banid]")
update_query.Execute()
message_admins("[key_name_admin(usr)] has edited a ban for [pckey]'s reason from [reason] to [value]",1)
if("duration")
if(!value)
value = input("Insert the new duration (in minutes) for [pckey]'s ban", "New Duration", "[duration]", null) as null|num
if(!isnum(value) || !value)
usr << "Cancelled"
return
var/DBQuery/update_query = dbcon.NewQuery("UPDATE erro_ban SET duration = [value], edits = CONCAT(edits,'- [eckey] changed ban duration from [duration] to [value]<br>'), expiration_time = DATE_ADD(bantime, INTERVAL [value] MINUTE) WHERE id = [banid]")
message_admins("[key_name_admin(usr)] has edited a ban for [pckey]'s duration from [duration] to [value]",1)
update_query.Execute()
if("unban")
if(alert("Unban [pckey]?", "Unban?", "Yes", "No") == "Yes")
DB_ban_unban_by_id(banid)
return
else
usr << "Cancelled"
return
else
usr << "Cancelled"
return
datum/admins/proc/DB_ban_unban_by_id(var/id)
var/user = sqlfdbklogin
var/pass = sqlfdbkpass
var/db = sqlfdbkdb
var/address = sqladdress
var/port = sqlport
var/sql = "SELECT id FROM erro_ban WHERE id = [id]"
if(!check_rights(R_BAN)) return
var/DBConnection/dbcon = new()
var/sql = "SELECT ckey FROM erro_ban WHERE id = [id]"
dbcon.Connect("dbi:mysql:[db]:[address]:[port]","[user]","[pass]")
establish_db_connection()
if(!dbcon.IsConnected())
return
var/ban_number = 0 //failsafe
var/pckey
var/DBQuery/query = dbcon.NewQuery(sql)
query.Execute()
while(query.NextRow())
pckey = query.item[1]
ban_number++;
if(ban_number == 0)
@@ -185,7 +242,157 @@ datum/admins/proc/DB_ban_unban_by_id(var/id)
var/unban_ip = src.owner:address
var/sql_update = "UPDATE erro_ban SET unbanned = 1, unbanned_datetime = Now(), unbanned_ckey = '[unban_ckey]', unbanned_computerid = '[unban_computerid]', unbanned_ip = '[unban_ip]' WHERE id = [id]"
message_admins("[key_name_admin(usr)] has lifted [pckey]'s ban.",1)
var/DBQuery/query_update = dbcon.NewQuery(sql_update)
query_update.Execute()
query_update.Execute()
/client/proc/DB_ban_panel()
set category = "Admin"
set name = "Banning Panel"
set desc = "Edit admin permissions"
if(!holder)
return
holder.DB_ban_panel()
/datum/admins/proc/DB_ban_panel(var/playerckey = null, var/adminckey = null)
if(!usr.client)
return
if(!check_rights(R_BAN)) return
establish_db_connection()
if(!dbcon.IsConnected())
usr << "\red Failed to establish database connection"
return
var/output = "<div align='center'><table width='90%'><tr>"
output += "<td width='35%' align='center'>"
output += "<h1>Banning panel</h1>"
output += "</td>"
output += "<td width='65%' align='center' bgcolor='#f9f9f9'>"
output += "<form method='GET' action='?src=\ref[src]'><b>Add custom ban:</b> (ONLY use this if you can't ban through any other method)"
output += "<input type='hidden' name='src' value='\ref[src]'>"
output += "<table width='100%'><tr>"
output += "<td><b>Ban type:</b><select name='dbbanaddtype'>"
output += "<option value=''>--</option>"
output += "<option value='[BANTYPE_PERMA]'>PERMABAN</option>"
output += "<option value='[BANTYPE_TEMP]'>TEMPBAN</option>"
output += "<option value='[BANTYPE_JOB_PERMA]'>JOB PERMABAN</option>"
output += "</select></td>"
output += "<td><b>Ckey:</b> <input type='text' name='dbbanaddckey'></td></tr>"
output += "<tr><td><b>Duration:</b> <input type='text' name='dbbaddduration'></td>"
output += "<td><b>Job:</b><select name='dbbanaddjob'>"
output += "<option value=''>--</option>"
for(var/j in get_all_jobs())
output += "<option value='[j]'>[j]</option>"
output += "</select></td></tr></table>"
output += "<b>Reason:<br></b><textarea name='dbbanreason' cols='50'></textarea><br>"
output += "<input type='submit' value='Add ban'>"
output += "</form>"
output += "</td>"
output += "</tr>"
output += "</table>"
output += "<form method='GET' action='?src=\ref[src]'><b>Search:</b> "
output += "<input type='hidden' name='src' value='\ref[src]'>"
output += "<b>Ckey:</b> <input type='text' name='dbsearchckey' value='[playerckey]'>"
output += "<b>Admin ckey:</b> <input type='text' name='dbsearchadmin' value='[adminckey]'>"
output += "<input type='submit' value='search'>"
output += "</form>"
output += "Please note that all jobban bans or unbans are in-effect the following round."
if(adminckey || playerckey)
var/blcolor = "#ffeeee" //banned light
var/bdcolor = "#ffdddd" //banned dark
var/ulcolor = "#eeffee" //unbanned light
var/udcolor = "#ddffdd" //unbanned dark
output += "<table width='90%' bgcolor='#e3e3e3' cellpadding='5' cellspacing='0' align='center'>"
output += "<tr>"
output += "<th width='25%'><b>TYPE</b></th>"
output += "<th width='20%'><b>CKEY</b></th>"
output += "<th width='20%'><b>TIME APPLIED</b></th>"
output += "<th width='20%'><b>ADMIN</b></th>"
output += "<th width='15%'><b>OPTIONS</b></th>"
output += "</tr>"
adminckey = ckey(adminckey)
playerckey = ckey(playerckey)
var/adminsearch = ""
var/playersearch = ""
if(adminckey)
adminsearch = "AND a_ckey = '[adminckey]' "
if(playerckey)
playersearch = "AND ckey = '[playerckey]' "
var/DBQuery/select_query = dbcon.NewQuery("SELECT id, bantime, bantype, reason, job, duration, expiration_time, ckey, a_ckey, unbanned, unbanned_ckey, unbanned_datetime, edits FROM erro_ban WHERE 1 [playersearch] [adminsearch] ORDER BY bantime DESC")
select_query.Execute()
while(select_query.NextRow())
var/banid = select_query.item[1]
var/bantime = select_query.item[2]
var/bantype = select_query.item[3]
var/reason = select_query.item[4]
var/job = select_query.item[5]
var/duration = select_query.item[6]
var/expiration = select_query.item[7]
var/ckey = select_query.item[8]
var/ackey = select_query.item[9]
var/unbanned = select_query.item[10]
var/unbanckey = select_query.item[11]
var/unbantime = select_query.item[12]
var/edits = select_query.item[13]
var/lcolor = blcolor
var/dcolor = bdcolor
if(unbanned)
lcolor = ulcolor
dcolor = udcolor
var/typedesc =""
switch(bantype)
if("PERMABAN")
typedesc = "<font color='red'><b>PERMABAN</b></font>"
if("TEMPBAN")
typedesc = "<b>TEMPBAN</b><br><font size='2'>([duration] minutes [(unbanned) ? "" : "(<a href=\"byond://?src=\ref[src];dbbanedit=duration;dbbanid=[banid]\">Edit</a>))"]<br>Expires [expiration]</font>"
if("JOB_PERMABAN")
typedesc = "<b>JOBBAN</b><br><font size='2'>([job])"
output += "<tr bgcolor='[dcolor]'>"
output += "<td align='center'>[typedesc]</td>"
output += "<td align='center'><b>[ckey]</b></td>"
output += "<td align='center'>[bantime]</td>"
output += "<td align='center'><b>[ackey]</b></td>"
output += "<td align='center'>[(unbanned) ? "" : "<b><a href=\"byond://?src=\ref[src];dbbanedit=unban;dbbanid=[banid]\">Unban</a></b>"]</td>"
output += "</tr>"
output += "<tr bgcolor='[lcolor]'>"
output += "<td align='center' colspan='5'><b>Reason: [(unbanned) ? "" : "(<a href=\"byond://?src=\ref[src];dbbanedit=reason;dbbanid=[banid]\">Edit</a>)"]</b> <cite>\"[reason]\"</cite></td>"
output += "</tr>"
if(edits)
output += "<tr bgcolor='[dcolor]'>"
output += "<td align='center' colspan='5'><b>EDITS</b></td>"
output += "</tr>"
output += "<tr bgcolor='[lcolor]'>"
output += "<td align='center' colspan='5'><font size='2'>[edits]</font></td>"
output += "</tr>"
if(unbanned)
output += "<tr bgcolor='[dcolor]'>"
output += "<td align='center' colspan='5' bgcolor=''><b>UNBANNED by admin [unbanckey] on [unbantime]</b></td>"
output += "</tr>"
output += "<tr>"
output += "<td colspan='5' bgcolor='white'>&nbsp</td>"
output += "</tr>"
output += "</table></div>"
usr << browse(output,"window=lookupbans;size=900x500")
+55 -19
View File
@@ -3,25 +3,61 @@ world/IsBanned(key,address,computer_id)
if(ckey(key) in admin_datums)
return ..()
//Guest Checking
if( !guests_allowed && IsGuestKey(key) )
log_access("Failed Login: [key] - Guests not allowed")
message_admins("\blue Failed Login: [key] - Guests not allowed")
return list("reason"="guest", "desc"="\nReason: Guests not allowed. Please sign in with a byond account.")
if(config.ban_legacy_system)
//check if the IP address is a known TOR node
if( config && config.ToRban && ToRban_isbanned(address) )
log_access("Failed Login: [src] - Banned: ToR")
message_admins("\blue Failed Login: [src] - Banned: ToR")
//ban their computer_id and ckey for posterity
AddBan(ckey(key), computer_id, "Use of ToR", "Automated Ban", 0, 0)
return list("reason"="Using ToR", "desc"="\nReason: The network you are using to connect has been banned.\nIf you believe this is a mistake, please request help at [config.banappeals]")
//Guest Checking
if( !guests_allowed && IsGuestKey(key) )
log_access("Failed Login: [key] - Guests not allowed")
message_admins("\blue Failed Login: [key] - Guests not allowed")
return list("reason"="guest", "desc"="\nReason: Guests not allowed. Please sign in with a byond account.")
//Ban Checking
. = CheckBan( ckey(key), computer_id, address )
if(.)
log_access("Failed Login: [key] [computer_id] [address] - Banned [.["reason"]]")
message_admins("\blue Failed Login: [key] id:[computer_id] ip:[address] - Banned [.["reason"]]")
return .
//check if the IP address is a known TOR node
if( config && config.ToRban && ToRban_isbanned(address) )
log_access("Failed Login: [src] - Banned: ToR")
message_admins("\blue Failed Login: [src] - Banned: ToR")
//ban their computer_id and ckey for posterity
AddBan(ckey(key), computer_id, "Use of ToR", "Automated Ban", 0, 0)
return list("reason"="Using ToR", "desc"="\nReason: The network you are using to connect has been banned.\nIf you believe this is a mistake, please request help at [config.banappeals]")
return ..() //default pager ban stuff
//Ban Checking
. = CheckBan( ckey(key), computer_id, address )
if(.)
log_access("Failed Login: [key] [computer_id] [address] - Banned [.["reason"]]")
message_admins("\blue Failed Login: [key] id:[computer_id] ip:[address] - Banned [.["reason"]]")
return .
return ..() //default pager ban stuff
else
var/ckeytext = ckey(key)
if(!establish_db_connection())
world.log << "Ban database connection failure. Key [ckeytext] not checked"
diary << "Ban database connection failure. Key [ckeytext] not checked"
return
var/DBQuery/query = dbcon.NewQuery("SELECT ckey, ip, computerid, a_ckey, reason, expiration_time, duration, bantime, bantype FROM erro_Ban WHERE (ckey = '[ckeytext]' OR ip = '[address]' OR computerid = '[computer_id]') AND (bantype = 'PERMABAN' OR (bantype = 'TEMPBAN' AND expiration_time > Now())) AND isnull(unbanned)")
query.Execute()
while(query.NextRow())
var/pckey = query.item[1]
//var/pip = query.item[2]
//var/pcid = query.item[3]
var/ackey = query.item[4]
var/reason = query.item[5]
var/expiration = query.item[6]
var/duration = query.item[7]
var/bantime = query.item[8]
var/bantype = query.item[9]
var/expires = ""
if(text2num(duration) > 0)
expires = " The ban is for [duration] minutes and expires on [expiration] (server time)."
var/desc = "\nReason: You, or another user of this computer or connection ([pckey]) is banned from playing here. The ban reason is:\n[reason]\nThis ban was applied by [ackey] on [bantime], [expires]"
return list("reason"="[bantype]", "desc"="[desc]")
return ..() //default pager ban stuff
+151 -199
View File
@@ -10,11 +10,12 @@ var/global/floorIsLava = 0
for(var/client/C in admins)
var/msg = rendered
if(admin_ref)
msg = dd_replacetext(msg, "%admin_ref%", "\ref[C]")
msg = replacetext(msg, "%admin_ref%", "\ref[C]")
if(admin_holder_ref && C.holder)
msg = dd_replacetext(msg, "%holder_ref%", "\ref[C.holder]")
msg = replacetext(msg, "%holder_ref%", "\ref[C.holder]")
C << msg
/*
/proc/msg_admin_attack(var/text) //Toggleable Attack Messages
var/rendered = "<span class=\"admin\"><span class=\"prefix\">ADMIN LOG:</span> <span class=\"message\">[text]</span></span>"
log_adminwarn(rendered)
@@ -23,6 +24,7 @@ var/global/floorIsLava = 0
if(!C.STFU_atklog)
var/msg = rendered
C << msg
*/
///////////////////////////////////////////////////////////////////////////////////////////////Panels
@@ -56,9 +58,9 @@ var/global/floorIsLava = 0
body += "<br><br>\[ "
body += "<a href='?src=\ref[src];adminplayervars=\ref[M]'>VV</a> - "
body += "<a href='?src=\ref[src];traitor_panel_pp=\ref[M]'>TP</a> - "
body += "<a href='?src=\ref[src];traitor=\ref[M]'>TP</a> - "
body += "<a href='?src=\ref[usr];priv_msg=\ref[M]'>PM</a> - "
body += "<a href='?src=\ref[src];adminplayersubtlemessage=\ref[M]'>SM</a> - "
body += "<a href='?src=\ref[src];subtlemessage=\ref[M]'>SM</a> - "
body += "<a href='?src=\ref[src];adminplayerobservejump=\ref[M]'>JMP</a>\] </b><br>"
body += "<b>Mob type</b> = [M.type]<br><br>"
@@ -463,183 +465,132 @@ var/global/floorIsLava = 0
/datum/admins/proc/Jobbans()
if(!check_rights(R_BAN)) return
if ((src.rank in list( "Game Admin", "Game Master" )))
var/dat = "<B>Job Bans!</B><HR><table>"
for(var/t in jobban_keylist)
var/r = t
if( findtext(r,"##") )
r = copytext( r, 1, findtext(r,"##") )//removes the description
dat += text("<tr><td>[t] (<A href='?src=\ref[src];removejobban=[r]'>unban</A>)</td></tr>")
dat += "</table>"
usr << browse(dat, "window=ban;size=400x400")
var/dat = "<B>Job Bans!</B><HR><table>"
for(var/t in jobban_keylist)
var/r = t
if( findtext(r,"##") )
r = copytext( r, 1, findtext(r,"##") )//removes the description
dat += text("<tr><td>[t] (<A href='?src=\ref[src];removejobban=[r]'>unban</A>)</td></tr>")
dat += "</table>"
usr << browse(dat, "window=ban;size=400x400")
/datum/admins/proc/Game()
var/dat
var/lvl = 0
switch(src.rank)
if("Moderator")
lvl = 1
if("Temporary Admin")
lvl = 2
if("Admin Candidate")
lvl = 3
if("Trial Admin")
lvl = 4
if("Badmin")
lvl = 5
if("Game Admin")
lvl = 6
if("Game Master")
lvl = 7
dat += "<center><B>Game Panel</B></center><hr>\n"
if(lvl > 0)
// if(lvl >= 2 )
dat += "<A href='?src=\ref[src];c_mode=1'>Change Game Mode</A><br>"
if(lvl > 0 && master_mode == "secret")
dat += "<A href='?src=\ref[src];f_secret=1'>(Force Secret Mode)</A><br>"
dat += "<BR>"
if(lvl >= 3 )
dat += "<A href='?src=\ref[src];create_object=1'>Create Object</A><br>"
dat += "<A href='?src=\ref[src];quick_create_object=1'>Quick Create Object</A><br>"
dat += "<A href='?src=\ref[src];create_turf=1'>Create Turf</A><br>"
if(lvl >= 5)
dat += "<A href='?src=\ref[src];create_mob=1'>Create Mob</A><br>"
if(lvl >= 3 )
dat += "<br><A href='?src=\ref[src];vsc=airflow'>Edit Airflow Settings</A><br>"
dat += "<A href='?src=\ref[src];vsc=plasma'>Edit Plasma Settings</A><br>"
dat += "<A href='?src=\ref[src];vsc=default'>Choose a default ZAS setting</A><br>"
// if(lvl == 6 )
usr << browse(dat, "window=admin2;size=210x180")
return
/*
/datum/admins/proc/goons()
var/dat = "<HR><B>GOOOOOOONS</B><HR><table cellspacing=5><tr><th>Key</th><th>SA Username</th></tr>"
for(var/t in goon_keylist)
dat += text("<tr><td><A href='?src=\ref[src];remove=[ckey(t)]'><B>[t]</B></A></td><td>[goon_keylist[ckey(t)]]</td></tr>")
dat += "</table>"
usr << browse(dat, "window=ban;size=300x400")
/datum/admins/proc/beta_testers()
var/dat = "<HR><B>Beta testers</B><HR><table cellspacing=5><tr><th>Key</th></tr>"
for(var/t in beta_tester_keylist)
dat += text("<tr><td>[t]</td></tr>")
dat += "</table>"
usr << browse(dat, "window=ban;size=300x400")
*/
/datum/admins/proc/Secrets()
if (!usr.client.holder)
return
var/lvl = 0
switch(src.rank)
if("Moderator")
lvl = 1
if("Temporary Admin")
lvl = 2
if("Admin Candidate")
lvl = 3
if("Trial Admin")
lvl = 4
if("Badmin")
lvl = 5
if("Game Admin")
lvl = 6
if("Game Master")
lvl = 7
if(!check_rights(0)) return
var/dat = {"
<B>Choose a secret, any secret at all.</B><HR>
<B>Admin Secrets</B><BR>
<BR>
<A href='?src=\ref[src];secretsadmin=clear_bombs'>Remove all bombs currently in existence</A><BR>
<A href='?src=\ref[src];secretsadmin=list_bombers'>Bombing List</A><BR>
<A href='?src=\ref[src];secretsadmin=check_antagonist'>Show current traitors and objectives</A><BR>
<A href='?src=\ref[src];secretsadmin=list_signalers'>Show last [length(lastsignalers)] signalers</A><BR>
<A href='?src=\ref[src];secretsadmin=list_lawchanges'>Show last [length(lawchanges)] law changes</A><BR>
<A href='?src=\ref[src];secretsadmin=showailaws'>Show AI Laws</A><BR>
<A href='?src=\ref[src];secretsadmin=showgm'>Show Game Mode</A><BR>
<A href='?src=\ref[src];secretsadmin=manifest'>Show Crew Manifest</A><BR>
<A href='?src=\ref[src];secretsadmin=DNA'>List DNA (Blood)</A><BR>
<A href='?src=\ref[src];secretsadmin=fingerprints'>List Fingerprints</A><BR><BR>
<BR>"}
if(lvl > 2)
dat += {"
<B>'Random' Events</B><BR>
<BR>
<A href='?src=\ref[src];secretsfun=wave'>Spawn a wave of meteors</A><BR>
<A href='?src=\ref[src];secretsfun=gravanomalies'>Spawn a gravitational anomaly (Untested)</A><BR>
<A href='?src=\ref[src];secretsfun=timeanomalies'>Spawn wormholes (Untested)</A><BR>
<A href='?src=\ref[src];secretsfun=goblob'>Spawn blob(Untested)</A><BR>
<A href='?src=\ref[src];secretsfun=aliens'>Trigger an Alien infestation</A><BR>
<A href='?src=\ref[src];secretsfun=spaceninja'>Send in a space ninja</A><BR>
<A href='?src=\ref[src];secretsfun=carp'>Trigger an Carp migration</A><BR>
<A href='?src=\ref[src];secretsfun=radiation'>Irradiate the station</A><BR>
<A href='?src=\ref[src];secretsfun=prison_break'>Trigger a Prison Break</A><BR>
<A href='?src=\ref[src];secretsfun=virus'>Trigger a Virus Outbreak</A><BR>
<A href='?src=\ref[src];secretsfun=immovable'>Spawn an Immovable Rod</A><BR>
<A href='?src=\ref[src];secretsfun=lightsout'>Toggle a "lights out" event</A><BR>
<A href='?src=\ref[src];secretsfun=ionstorm'>Spawn an Ion Storm</A><BR>
<A href='?src=\ref[src];secretsfun=spacevines'>Spawn Space-Vines</A><BR>
<A href='?src=\ref[src];secretsfun=comms_blackout'>Trigger a communication blackout</A><BR>
<BR>
<B>Fun Secrets</B><BR>
<BR>
<A href='?src=\ref[src];secretsfun=sec_clothes'>Remove 'internal' clothing</A><BR>
<A href='?src=\ref[src];secretsfun=sec_all_clothes'>Remove ALL clothing</A><BR>
<A href='?src=\ref[src];secretsfun=toxic'>Toxic Air (WARNING: dangerous)</A><BR>
<A href='?src=\ref[src];secretsfun=monkey'>Turn all humans into monkeys</A><BR>
<A href='?src=\ref[src];secretsfun=sec_classic1'>Remove firesuits, grilles, and pods</A><BR>
<A href='?src=\ref[src];secretsfun=power'>Make all areas powered</A><BR>
<A href='?src=\ref[src];secretsfun=unpower'>Make all areas unpowered</A><BR>
<A href='?src=\ref[src];secretsfun=quickpower'>Power all SMES</A><BR>
<A href='?src=\ref[src];secretsfun=toggleprisonstatus'>Toggle Prison Shuttle Status(Use with S/R)</A><BR>
<A href='?src=\ref[src];secretsfun=activateprison'>Send Prison Shuttle</A><BR>
<A href='?src=\ref[src];secretsfun=deactivateprison'>Return Prison Shuttle</A><BR>
<A href='?src=\ref[src];secretsfun=prisonwarp'>Warp all Players to Prison</A><BR>
<A href='?src=\ref[src];secretsfun=traitor_all'>Everyone is the traitor</A><BR>
<A href='?src=\ref[src];secretsfun=flicklights'>Ghost Mode</A><BR>
<A href='?src=\ref[src];secretsfun=retardify'>Make all players retarded</A><BR>
<A href='?src=\ref[src];secretsfun=fakeguns'>Make all items look like guns</A><BR>
<A href='?src=\ref[src];secretsfun=schoolgirl'>Japanese Animes Mode</A><BR>
<A href='?src=\ref[src];secretsfun=moveadminshuttle'>Move Administration Shuttle</A><BR>
<A href='?src=\ref[src];secretsfun=moveferry'>Move Ferry</A><BR>
<A href='?src=\ref[src];secretsfun=movealienship'>Move Alien Dinghy</A><BR>
<A href='?src=\ref[src];secretsfun=moveminingshuttle'>Move Mining Shuttle</A><BR>
<A href='?src=\ref[src];secretsfun=blackout'>Break all lights</A><BR>
<A href='?src=\ref[src];secretsfun=whiteout'>Fix all lights</A><BR>
<A href='?src=\ref[src];secretsfun=friendai'>Best Friend AI</A><BR>
<A href='?src=\ref[src];secretsfun=floorlava'>The floor is lava! (DANGEROUS)</A><BR>"}
//<A href='?src=\ref[src];secretsfun=shockwave'>Station Shockwave</A><BR>
if(lvl >= 6)
dat += {"
<A href='?src=\ref[src];secretsfun=togglebombcap'>Toggle bomb cap</A><BR>
<center><B>Game Panel</B></center><hr>\n
<A href='?src=\ref[src];c_mode=1'>Change Game Mode</A><br>
"}
if(master_mode == "secret")
dat += "<A href='?src=\ref[src];f_secret=1'>(Force Secret Mode)</A><br>"
dat += {"
<BR>
<A href='?src=\ref[src];create_object=1'>Create Object</A><br>
<A href='?src=\ref[src];quick_create_object=1'>Quick Create Object</A><br>
<A href='?src=\ref[src];create_turf=1'>Create Turf</A><br>
<A href='?src=\ref[src];create_mob=1'>Create Mob</A><br>
"}
usr << browse(dat, "window=admin2;size=210x180")
return
/datum/admins/proc/Secrets()
if(!check_rights(0)) return
var/dat = "<B>The first rule of adminbuse is: you don't talk about the adminbuse.</B><HR>"
if(check_rights(R_ADMIN,0))
dat += {"
<B>Admin Secrets</B><BR>
<BR>
<A href='?src=\ref[src];secretsadmin=clear_bombs'>Remove all bombs currently in existence</A><BR>
<A href='?src=\ref[src];secretsadmin=list_bombers'>Bombing List</A><BR>
<A href='?src=\ref[src];secretsadmin=check_antagonist'>Show current traitors and objectives</A><BR>
<A href='?src=\ref[src];secretsadmin=list_signalers'>Show last [length(lastsignalers)] signalers</A><BR>
<A href='?src=\ref[src];secretsadmin=list_lawchanges'>Show last [length(lawchanges)] law changes</A><BR>
<A href='?src=\ref[src];secretsadmin=showailaws'>Show AI Laws</A><BR>
<A href='?src=\ref[src];secretsadmin=showgm'>Show Game Mode</A><BR>
<A href='?src=\ref[src];secretsadmin=manifest'>Show Crew Manifest</A><BR>
<A href='?src=\ref[src];secretsadmin=DNA'>List DNA (Blood)</A><BR>
<A href='?src=\ref[src];secretsadmin=fingerprints'>List Fingerprints</A><BR><BR>
<BR>
"}
if(check_rights(R_FUN,0))
dat += {"
<B>'Random' Events</B><BR>
<BR>
<A href='?src=\ref[src];secretsfun=gravity'>Toggle station artificial gravity</A><BR>
<A href='?src=\ref[src];secretsfun=wave'>Spawn a wave of meteors (aka lagocolyptic shower)</A><BR>
<A href='?src=\ref[src];secretsfun=gravanomalies'>Spawn a gravitational anomaly (aka lagitational anomolag)</A><BR>
<A href='?src=\ref[src];secretsfun=timeanomalies'>Spawn wormholes</A><BR>
<A href='?src=\ref[src];secretsfun=goblob'>Spawn blob</A><BR>
<A href='?src=\ref[src];secretsfun=aliens'>Trigger an Alien infestation</A><BR>
<A href='?src=\ref[src];secretsfun=alien_silent'>Spawn an Alien silently</A><BR>
<A href='?src=\ref[src];secretsfun=spaceninja'>Send in a space ninja</A><BR>
<A href='?src=\ref[src];secretsfun=striketeam'>Send in a strike team</A><BR>
<A href='?src=\ref[src];secretsfun=carp'>Trigger an Carp migration</A><BR>
<A href='?src=\ref[src];secretsfun=radiation'>Irradiate the station</A><BR>
<A href='?src=\ref[src];secretsfun=prison_break'>Trigger a Prison Break</A><BR>
<A href='?src=\ref[src];secretsfun=virus'>Trigger a Virus Outbreak</A><BR>
<A href='?src=\ref[src];secretsfun=immovable'>Spawn an Immovable Rod</A><BR>
<A href='?src=\ref[src];secretsfun=lightsout'>Toggle a "lights out" event</A><BR>
<A href='?src=\ref[src];secretsfun=ionstorm'>Spawn an Ion Storm</A><BR>
<A href='?src=\ref[src];secretsfun=spacevines'>Spawn Space-Vines</A><BR>
<A href='?src=\ref[src];secretsfun=comms_blackout'>Trigger a communication blackout</A><BR>
<BR>
<B>Fun Secrets</B><BR>
<BR>
<A href='?src=\ref[src];secretsfun=sec_clothes'>Remove 'internal' clothing</A><BR>
<A href='?src=\ref[src];secretsfun=sec_all_clothes'>Remove ALL clothing</A><BR>
<A href='?src=\ref[src];secretsfun=monkey'>Turn all humans into monkeys</A><BR>
<A href='?src=\ref[src];secretsfun=sec_classic1'>Remove firesuits, grilles, and pods</A><BR>
<A href='?src=\ref[src];secretsfun=power'>Make all areas powered</A><BR>
<A href='?src=\ref[src];secretsfun=unpower'>Make all areas unpowered</A><BR>
<A href='?src=\ref[src];secretsfun=quickpower'>Power all SMES</A><BR>
<A href='?src=\ref[src];secretsfun=toggleprisonstatus'>Toggle Prison Shuttle Status(Use with S/R)</A><BR>
<A href='?src=\ref[src];secretsfun=activateprison'>Send Prison Shuttle</A><BR>
<A href='?src=\ref[src];secretsfun=deactivateprison'>Return Prison Shuttle</A><BR>
<A href='?src=\ref[src];secretsfun=prisonwarp'>Warp all Players to Prison</A><BR>
<A href='?src=\ref[src];secretsfun=tripleAI'>Triple AI mode (needs to be used in the lobby)</A><BR>
<A href='?src=\ref[src];secretsfun=traitor_all'>Everyone is the traitor</A><BR>
<A href='?src=\ref[src];secretsfun=flicklights'>Ghost Mode</A><BR>
<A href='?src=\ref[src];secretsfun=retardify'>Make all players retarded</A><BR>
<A href='?src=\ref[src];secretsfun=fakeguns'>Make all items look like guns</A><BR>
<A href='?src=\ref[src];secretsfun=schoolgirl'>Japanese Animes Mode</A><BR>
<A href='?src=\ref[src];secretsfun=moveadminshuttle'>Move Administration Shuttle</A><BR>
<A href='?src=\ref[src];secretsfun=moveferry'>Move Ferry</A><BR>
<A href='?src=\ref[src];secretsfun=movealienship'>Move Alien Dinghy</A><BR>
<A href='?src=\ref[src];secretsfun=moveminingshuttle'>Move Mining Shuttle</A><BR>
<A href='?src=\ref[src];secretsfun=blackout'>Break all lights</A><BR>
<A href='?src=\ref[src];secretsfun=whiteout'>Fix all lights</A><BR>
<A href='?src=\ref[src];secretsfun=friendai'>Best Friend AI</A><BR>
<A href='?src=\ref[src];secretsfun=floorlava'>The floor is lava! (DANGEROUS: extremely lame)</A><BR>
"}
if(check_rights(R_SERVER,0))
dat += "<A href='?src=\ref[src];secretsfun=togglebombcap'>Toggle bomb cap</A><BR>"
dat += "<BR>"
if(lvl >= 5)
if(check_rights(R_DEBUG,0))
dat += {"
<B>Security Level Elevated</B><BR>
<BR>
<A href='?src=\ref[src];secretscoder=maint_access_engiebrig'>Change all maintenance doors to engie/brig access only</A><BR>
<A href='?src=\ref[src];secretscoder=maint_access_brig'>Change all maintenance doors to brig access only</A><BR>
<A href='?src=\ref[src];secretscoder=infinite_sec'>Remove cap on security officers</A><BR>
<BR>
<B>Coder Secrets</B><BR>
<BR>
<A href='?src=\ref[src];secretsadmin=list_job_debug'>Show Job Debug</A><BR>
<A href='?src=\ref[src];secretscoder=spawn_objects'>Admin Log</A><BR>
<BR>
"}
<B>Security Level Elevated</B><BR>
<BR>
<A href='?src=\ref[src];secretscoder=maint_access_engiebrig'>Change all maintenance doors to engie/brig access only</A><BR>
<A href='?src=\ref[src];secretscoder=maint_access_brig'>Change all maintenance doors to brig access only</A><BR>
<A href='?src=\ref[src];secretscoder=infinite_sec'>Remove cap on security officers</A><BR>
<BR>
<B>Coder Secrets</B><BR>
<BR>
<A href='?src=\ref[src];secretsadmin=list_job_debug'>Show Job Debug</A><BR>
<A href='?src=\ref[src];secretscoder=spawn_objects'>Admin Log</A><BR>
<BR>
"}
usr << browse(dat, "window=secrets")
return
@@ -676,10 +627,11 @@ var/global/floorIsLava = 0
set category = "Special Verbs"
set name = "Announce"
set desc="Announce your desires to the world"
if(!usr.client.holder) return
if(!check_rights(0)) return
var/message = input("Global message to send:", "Admin Announce", null, null) as message
if (message)
if(usr.client.holder.rank != "Game Admin" && usr.client.holder.rank != "Game Master")
if(message)
if(!check_rights(R_SERVER,0))
message = adminscrub(message,500)
world << "\blue <b>[usr.client.holder.fakekey ? "Administrator" : usr.key] Announces:</b>\n \t [message]"
log_admin("Announce: [key_name(usr)] : [message]")
@@ -954,36 +906,32 @@ var/global/floorIsLava = 0
*/
/datum/admins/proc/spawn_atom(var/object as text)
set category = "Debug"
set desc= "(atom path) Spawn an atom"
set name= "Spawn"
set desc = "(atom path) Spawn an atom"
set name = "Spawn"
if(usr.client.holder.level >= 5)
var/list/types = typesof(/atom)
if(!check_rights(R_DEBUG)) return
var/list/matches = new()
var/list/types = typesof(/atom)
var/list/matches = new()
for(var/path in types)
if(findtext("[path]", object))
matches += path
for(var/path in types)
if(findtext("[path]", object))
matches += path
if(matches.len==0)
if(matches.len==0)
return
var/chosen
if(matches.len==1)
chosen = matches[1]
else
chosen = input("Select an atom type", "Spawn Atom", matches[1]) as null|anything in matches
if(!chosen)
return
var/chosen
if(matches.len==1)
chosen = matches[1]
else
chosen = input("Select an atom type", "Spawn Atom", matches[1]) as null|anything in matches
if(!chosen)
return
new chosen(usr.loc)
new chosen(usr.loc)
log_admin("[key_name(usr)] spawned [chosen] at ([usr.x],[usr.y],[usr.z])")
else
alert("You cannot perform this action. You must be of a higher administrative rank!", null, null, null, null, null)
return
log_admin("[key_name(usr)] spawned [chosen] at ([usr.x],[usr.y],[usr.z])")
feedback_add_details("admin_verb","SA") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
@@ -992,9 +940,13 @@ var/global/floorIsLava = 0
set desc = "Edit mobs's memory and role"
set name = "Show Traitor Panel"
if (!M.mind)
usr << "Sorry, this mob has no mind!"
if(!istype(M))
usr << "This can only be used on instances of type /mob"
return
if(!M.mind)
usr << "This mob has no mind!"
return
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!
+6 -9
View File
@@ -5,15 +5,12 @@
/client/proc/admin_memo(task in list("write","show","delete"))
set name = "Memo"
set category = "Server"
if(!holder || !ENABLE_MEMOS) return
if(!ENABLE_MEMOS) return
if(!check_rights(0)) return
switch(task)
if("write")
admin_memo_write()
if("show")
admin_memo_show()
if("delete")
admin_memo_delete()
if("write") admin_memo_write()
if("show") admin_memo_show()
if("delete") admin_memo_delete()
//write a message
/client/proc/admin_memo_write()
@@ -45,7 +42,7 @@
var/savefile/F = new(MEMOFILE)
if(F)
var/ckey
if( holder.rank == "Game Master" )
if(check_rights(R_SERVER,0)) //high ranking admins can delete other admin's memos
ckey = input(src,"Whose memo shall we remove?","Remove Memo",null) as null|anything in F.dir
else
ckey = src.ckey
+156
View File
@@ -0,0 +1,156 @@
var/list/admin_ranks = list() //list of all ranks with associated rights
//load our rank - > rights associations
/proc/load_admin_ranks()
admin_ranks.Cut()
var/previous_rights = 0
//load text from file
var/list/Lines = file2list("config/admin_ranks.txt")
//process each line seperately
for(var/line in Lines)
if(!length(line)) continue
if(copytext(line,1,2) == "#") continue
var/list/List = text2list(line,"+")
if(!List.len) continue
var/rank = ckeyEx(List[1])
switch(rank)
if(null,"") continue
if("Removed") continue //Reserved
var/rights = 0
for(var/i=2, i<=List.len, i++)
switch(ckey(List[i]))
if("@","prev") rights |= previous_rights
if("buildmode","build") rights |= R_BUILDMODE
if("admin") rights |= R_ADMIN
if("ban") rights |= R_BAN
if("fun") rights |= R_FUN
if("server") rights |= R_SERVER
if("debug") rights |= R_DEBUG
if("permissions","rights") rights |= R_PERMISSIONS
if("possess") rights |= R_POSSESS
if("stealth") rights |= R_STEALTH
if("rejuv","rejuvinate") rights |= R_REJUVINATE
if("varedit") rights |= R_VAREDIT
if("everything","host","all") rights |= R_HOST
if("sound","sounds") rights |= R_SOUNDS
if("spawn","create") rights |= R_SPAWN
admin_ranks[rank] = rights
previous_rights = rights
#ifdef TESTING
var/msg = "Permission Sets Built:\n"
for(var/rank in admin_ranks)
msg += "\t[rank] - [admin_ranks[rank]]\n"
testing(msg)
#endif
/proc/load_admins()
//clear the datums references
admin_datums.Cut()
for(var/client/C in admins)
C.remove_admin_verbs()
C.holder = null
admins.Cut()
if(config.admin_legacy_system)
load_admin_ranks()
//load text from file
var/list/Lines = file2list("config/admins.txt")
//process each line seperately
for(var/line in Lines)
if(!length(line)) continue
if(copytext(line,1,2) == "#") continue
//Split the line at every "-"
var/list/List = text2list(line, "-")
if(!List.len) continue
//ckey is before the first "-"
var/ckey = ckey(List[1])
if(!ckey) continue
//rank follows the first "-"
var/rank = ""
if(List.len >= 2)
rank = ckeyEx(List[2])
//load permissions associated with this rank
var/rights = admin_ranks[rank]
//create the admin datum and store it for later use
var/datum/admins/D = new /datum/admins(rank, rights, ckey)
//find the client for a ckey if they are connected and associate them with the new admin datum
D.associate(directory[ckey])
else
//The current admin system uses SQL
establish_db_connection()
if(!dbcon.IsConnected())
world.log << "Failed to connect to database in load_admins(). Reverting to legacy system."
diary << "Failed to connect to database in load_admins(). Reverting to legacy system."
config.admin_legacy_system = 1
load_admins()
return
var/DBQuery/query = dbcon.NewQuery("SELECT ckey, rank, level, flags FROM erro_admin")
query.Execute()
while(query.NextRow())
var/ckey = query.item[1]
var/rank = query.item[2]
if(rank == "Removed") continue //This person was de-adminned. They are only in the admin list for archive purposes.
var/rights = query.item[4]
if(istext(rights)) rights = text2num(rights)
var/datum/admins/D = new /datum/admins(rank, rights, ckey)
//find the client for a ckey if they are connected and associate them with the new admin datum
D.associate(directory[ckey])
if(!admin_datums)
world.log << "The database query in load_admins() resulted in no admins being added to the list. Reverting to legacy system."
diary << "The database query in load_admins() resulted in no admins being added to the list. Reverting to legacy system."
config.admin_legacy_system = 1
load_admins()
return
#ifdef TESTING
var/msg = "Admins Built:\n"
for(var/ckey in admin_datums)
var/rank
var/datum/admins/D = admin_datums[ckey]
if(D) rank = D.rank
msg += "\t[ckey] - [rank]\n"
testing(msg)
#endif
#ifdef TESTING
/client/verb/changerank(newrank in admin_ranks)
if(holder)
holder.rank = newrank
holder.rights = admin_ranks[newrank]
else
holder = new /datum/admins(newrank,admin_ranks[newrank],ckey)
remove_admin_verbs()
holder.associate(src)
/client/verb/changerights(newrights as num)
if(holder)
holder.rights = newrights
else
holder = new /datum/admins("testing",newrights,ckey)
remove_admin_verbs()
holder.associate(src)
#endif
+180
View File
@@ -0,0 +1,180 @@
// Reports are a way to notify admins of wrongdoings that happened
// while no admin was present. They work a bit similar to news, but
// they can only be read by admins and moderators.
// a single admin report
datum/admin_report/var
ID // the ID of the report
body // the content of the report
author // key of the author
date // date on which this was created
done // whether this was handled
offender_key // store the key of the offender
offender_cid // store the cid of the offender
datum/report_topic_handler
Topic(href,href_list)
..()
var/client/C = locate(href_list["client"])
if(href_list["action"] == "show_reports")
C.display_admin_reports()
else if(href_list["action"] == "remove")
C.mark_report_done(text2num(href_list["ID"]))
else if(href_list["action"] == "edit")
C.edit_report(text2num(href_list["ID"]))
var/datum/report_topic_handler/report_topic_handler
world/New()
..()
report_topic_handler = new
// add a new news datums
proc/make_report(body, author, okey, cid)
var/savefile/Reports = new("data/reports.sav")
var/list/reports
var/lastID
Reports["reports"] >> reports
Reports["lastID"] >> lastID
if(!reports) reports = list()
if(!lastID) lastID = 0
var/datum/admin_report/created = new()
created.ID = ++lastID
created.body = body
created.author = author
created.date = world.realtime
created.done = 0
created.offender_key = okey
created.offender_cid = cid
reports.Insert(1, created)
Reports["reports"] << reports
Reports["lastID"] << lastID
// load the reports from disk
proc/load_reports()
var/savefile/Reports = new("data/reports.sav")
var/list/reports
Reports["reports"] >> reports
if(!reports) reports = list()
return reports
// check if there are any unhandled reports
client/proc/unhandled_reports()
if(!src.holder) return 0
var/list/reports = load_reports()
for(var/datum/admin_report/N in reports)
if(N.done)
continue
else return 1
return 0
// checks if the player has an unhandled report against him
client/proc/is_reported()
var/list/reports = load_reports()
for(var/datum/admin_report/N in reports) if(!N.done)
if(N.offender_key == src.key)
return 1
return 0
// display only the reports that haven't been handled
client/proc/display_admin_reports()
set category = "Admin"
set name = "Display Admin Reports"
if(!src.holder) return
var/list/reports = load_reports()
var/output = ""
if(unhandled_reports())
// load the list of unhandled reports
for(var/datum/admin_report/N in reports)
if(N.done)
continue
output += "<b>Reported player:</b> [N.offender_key](CID: [N.offender_cid])<br>"
output += "<b>Offense:</b>[N.body]<br>"
output += "<small>Occured at [time2text(N.date,"MM/DD hh:mm:ss")]</small><br>"
output += "<small>authored by <i>[N.author]</i></small><br>"
output += " <a href='?src=\ref[report_topic_handler];client=\ref[src];action=remove;ID=[N.ID]'>Flag as Handled</a>"
if(src.key == N.author)
output += " <a href='?src=\ref[report_topic_handler];client=\ref[src];action=edit;ID=[N.ID]'>Edit</a>"
output += "<br>"
output += "<br>"
else
output += "Whoops, no reports!"
usr << browse(output, "window=news;size=600x400")
client/proc/Report(mob/M as mob in world)
set category = "Admin"
if(!src.holder)
return
var/CID = "Unknown"
if(M.client)
CID = M.client.computer_id
var/body = input(src.mob, "Describe in detail what you're reporting [M] for", "Report") as null|text
if(!body) return
make_report(body, key, M.key, CID)
spawn(1)
display_admin_reports()
client/proc/mark_report_done(ID as num)
if(!src.holder || src.holder.level < 0)
return
var/savefile/Reports = new("data/reports.sav")
var/list/reports
Reports["reports"] >> reports
var/datum/admin_report/found
for(var/datum/admin_report/N in reports)
if(N.ID == ID)
found = N
if(!found) src << "<b>* An error occured, sorry.</b>"
found.done = 1
Reports["reports"] << reports
client/proc/edit_report(ID as num)
if(!src.holder || src.holder.level < 0)
src << "<b>You tried to modify the news, but you're not an admin!"
return
var/savefile/Reports = new("data/reports.sav")
var/list/reports
Reports["reports"] >> reports
var/datum/admin_report/found
for(var/datum/admin_report/N in reports)
if(N.ID == ID)
found = N
if(!found) src << "<b>* An error occured, sorry.</b>"
var/body = input(src.mob, "Enter a body for the news", "Body") as null|message
if(!body) return
found.body = body
Reports["reports"] << reports
+309 -543
View File
@@ -1,457 +1,302 @@
//GUYS REMEMBER TO ADD A += to UPDATE_ADMINS
//AND A -= TO CLEAR_ADMIN_VERBS
//Some verbs that are still in the code but not used atm
// Debug
// verbs += /client/proc/radio_report //for radio debugging dont think its been used in a very long time
// verbs += /client/proc/fix_next_move //has not been an issue in a very very long time
// Mapping helpers added via enable_debug_verbs verb
// verbs += /client/proc/do_not_use_these
// verbs += /client/proc/camera_view
// verbs += /client/proc/sec_camera_report
// verbs += /client/proc/intercom_view
// verbs += /client/proc/air_status //Air things
// verbs += /client/proc/Cell //More air things
/client/proc/admin_rank_check(var/rank, var/requested)
if(rank < requested)
alert("You cannot perform this action. You must be of a higher administrative rank!", null, null, null, null, null)
return(0)
return(1)
/client/proc/update_admins(var/rank)
if(!holder)
holder = new /datum/admins(rank)
admins |= src
admin_datums[ckey] = holder
var/need_update = 0
//check if our rank has changed
if(holder.rank != rank)
holder.rank = rank
need_update = 1
//check if our state has changed
if(istype(mob,/mob/living))
if(holder.state != 1)
holder.state = 1
need_update = 1
else
if(holder.state != 2)
holder.state = 2
need_update = 1
if(!need_update) return
clear_admin_verbs()
handle_permission_verbs()
switch(rank)
if("Game Master")
holder.level = 6
if ("Game Admin")
holder.level = 5
if ("Badmin")
holder.level = 4
if ("Trial Admin")
holder.level = 3
if(holder.state == 2) // if observing
verbs += /client/proc/debug_variables
verbs += /client/proc/cmd_modify_ticker_variables
verbs += /client/proc/toggle_view_range
verbs += /client/proc/Getmob
verbs += /client/proc/Getkey
verbs += /client/proc/sendmob
verbs += /client/proc/Jump
verbs += /client/proc/jumptokey
verbs += /client/proc/jumptomob
verbs += /client/proc/jumptoturf
verbs += /client/proc/jumptocoord
verbs += /client/proc/cmd_admin_delete
verbs += /client/proc/cmd_admin_add_freeform_ai_law
verbs += /client/proc/cmd_admin_rejuvenate
if ("Admin Candidate")
holder.level = 2
if(holder.state == 2) // if observing
deadchat = 1
verbs += /datum/admins/proc/toggleaban //abandon mob
verbs += /client/proc/deadchat //toggles deadchat
verbs += /client/proc/cmd_admin_check_contents
verbs += /client/proc/Jump
verbs += /client/proc/jumptokey
verbs += /client/proc/jumptomob
if ("Temporary Admin")
holder.level = 1
if ("Moderator")
holder.level = 0
if ("Admin Observer")
holder.level = -1
// if ("Banned")
// holder.level = -2
// del(src)
// return
else
del(holder)
return
if (holder) //THE BELOW handles granting powers. The above is for special cases only!
holder.owner = src
//---- Special Admin Ranks //Retired admin
if (holder.level == -3)
verbs += /client/proc/cmd_admin_say
verbs += /client/proc/cmd_mod_say
return
//Admin Observer
if (holder.level >= -1)
seeprayers = 1
verbs += /client/proc/cmd_admin_say //Allows anyone rank -1 or higher to use asay -- removed when it hits 0 (mods), added again at 1 (Temp Admin)
verbs += /client/proc/cmd_mod_say //Allows anyone rank -1 or higher to use msay
verbs += /client/proc/deadmin_self
verbs += /client/proc/toggleadminhelpsound
else
return
//Moderator
if (holder.level >= 0)
verbs += /client/proc/cmd_admin_pm_panel
verbs += /client/proc/cmd_admin_pm_context
verbs += /client/proc/hide_verbs
verbs += /client/proc/Report
verbs += /client/proc/display_admin_reports
verbs += /datum/admins/proc/show_skills
verbs += /client/proc/admin_ghost
verbs += /datum/admins/proc/show_player_info
verbs += /datum/admins/proc/PlayerNotes
else
return
//Extra moderator commands
if(holder.level == 0)
verbs += /client/proc/mod_panel
verbs -= /client/proc/cmd_admin_say
return
//Temporary Admin
if (holder.level >= 1)
verbs += /client/proc/investigate_show
verbs += /client/proc/cmd_admin_say
verbs += /datum/admins/proc/startnow
verbs += /datum/admins/proc/delay //game start delay
verbs += /datum/admins/proc/immreboot //immediate reboot
verbs += /datum/admins/proc/restart //restart
verbs += /client/proc/cmd_admin_check_contents
verbs += /client/proc/cmd_admin_create_centcom_report
verbs += /client/proc/toggle_hear_deadcast
verbs += /client/proc/toggle_hear_radio
verbs += /client/proc/deadmin_self
verbs += /datum/admins/proc/announce
verbs += /datum/admins/proc/startnow
verbs += /datum/admins/proc/toggleAI //Toggle the AI
verbs += /datum/admins/proc/toggleenter //Toggle enterting
verbs += /datum/admins/proc/toggleguests //Toggle guests entering
verbs += /datum/admins/proc/toggleooc //toggle ooc
verbs += /datum/admins/proc/toggleoocdead //toggle ooc for dead/unc
verbs += /datum/admins/proc/show_player_panel
verbs += /client/proc/deadchat //toggles deadchat
verbs += /client/proc/cmd_admin_subtle_message
verbs += /client/proc/dsay
verbs += /client/proc/admin_ghost
verbs += /client/proc/game_panel
verbs += /client/proc/player_panel
verbs += /client/proc/player_panel_new
verbs += /client/proc/unban_panel
verbs += /client/proc/jobbans
verbs += /client/proc/unjobban_panel
verbs += /client/proc/hide_verbs
verbs += /client/proc/general_report
verbs += /client/proc/air_report
verbs += /client/proc/check_ai_laws
verbs += /client/proc/investigate_show
verbs += /client/proc/cmd_admin_gib_self
verbs += /client/proc/player_panel_new
verbs += /client/proc/cmd_admin_change_custom_event
verbs += /client/proc/game_panel
verbs += /client/proc/unjobban_panel
verbs += /client/proc/jobbans
verbs += /client/proc/unban_panel
verbs += /datum/admins/proc/toggleooc
verbs += /datum/admins/proc/toggleoocdead
else
return
//Admin Candidate
if (holder.level >= 2)
verbs += /client/proc/cmd_admin_add_random_ai_law
verbs += /client/proc/secrets
verbs += /client/proc/check_antagonists
verbs += /client/proc/play_sound
verbs += /client/proc/stealth
else
return
//Trial Admin
if (holder.level >= 3)
deadchat = 1
verbs += /client/proc/invisimin
verbs += /datum/admins/proc/view_txt_log
verbs += /datum/admins/proc/view_atk_log
verbs += /datum/admins/proc/toggleaban //abandon mob
verbs += /datum/admins/proc/show_traitor_panel
verbs += /client/proc/getserverlog //fetch an old serverlog to look at
verbs += /client/proc/admin_call_shuttle
verbs += /client/proc/admin_cancel_shuttle
verbs += /client/proc/cmd_admin_dress
verbs += /client/proc/respawn_character
verbs += /client/proc/spawn_xeno
verbs += /client/proc/toggleprayers
verbs += /proc/possess
verbs += /proc/release
verbs += /client/proc/one_click_antag
//bs12 specific
verbs += /client/proc/admin_deny_shuttle
verbs += /client/proc/editappear
else
return
//Badmin
if (holder.level >= 4)
verbs += /datum/admins/proc/adrev //toggle admin revives
verbs += /datum/admins/proc/adspawn //toggle admin item spawning
verbs += /client/proc/debug_variables
verbs += /datum/admins/proc/access_news_network //Admin access to the newscaster network
verbs += /client/proc/cmd_modify_ticker_variables
verbs += /client/proc/Debug2 //debug toggle switch
verbs += /client/proc/toggle_view_range
verbs += /client/proc/Getmob
verbs += /client/proc/Getkey
verbs += /client/proc/sendmob
verbs += /client/proc/Jump
verbs += /client/proc/jumptokey
verbs += /client/proc/jumptomob
verbs += /client/proc/jumptoturf
verbs += /client/proc/cmd_admin_delete
verbs += /client/proc/cmd_admin_add_freeform_ai_law
verbs += /client/proc/cmd_admin_add_random_ai_law
verbs += /client/proc/cmd_admin_rejuvenate
verbs += /client/proc/hide_most_verbs
verbs += /client/proc/jumptocoord
verbs += /client/proc/deadmin_self
verbs += /client/proc/giveruntimelog //used by coders to retrieve runtime logs
verbs += /client/proc/togglebuildmodeself
verbs += /client/proc/debug_controller
else
return
//Game Admin
if (holder.level >= 5)
verbs += /datum/admins/proc/spawn_atom
verbs += /client/proc/cmd_admin_list_open_jobs
verbs += /client/proc/cmd_admin_direct_narrate
verbs += /client/proc/colorooc
verbs += /client/proc/kill_air
verbs += /client/proc/cmd_admin_world_narrate
verbs += /client/proc/cmd_debug_del_all
verbs += /client/proc/cmd_debug_tog_aliens
verbs += /client/proc/check_words
verbs += /client/proc/drop_bomb
verbs += /client/proc/kill_airgroup
verbs += /client/proc/make_sound
verbs += /client/proc/play_local_sound
verbs += /client/proc/send_space_ninja
verbs += /client/proc/restart_controller //Can call via aproccall --I_hate_easy_things.jpg, Mport --Agouri
verbs += /client/proc/toggle_clickproc //TODO ERRORAGE (Temporary proc while the new clickproc is being tested)
verbs += /client/proc/toggle_gravity_on
verbs += /client/proc/toggle_gravity_off
verbs += /client/proc/toggle_random_events
verbs += /client/proc/deadmin_self
verbs += /client/proc/Set_Holiday //Force-set a Holiday
verbs += /client/proc/admin_memo
verbs += /client/proc/ToRban //ToRban frontend to access its features.
verbs += /client/proc/game_panel
else
return
//Game Master
if (holder.level >= 6)
verbs += /datum/admins/proc/toggle_aliens //toggle aliens
verbs += /datum/admins/proc/toggle_space_ninja //toggle ninjas
verbs += /datum/admins/proc/adjump
verbs += /client/proc/callproc
verbs += /client/proc/triple_ai
verbs += /client/proc/reload_admins
verbs += /client/proc/cmd_debug_make_powernets
verbs += /client/proc/object_talk
verbs += /client/proc/strike_team
verbs += /client/proc/enable_debug_verbs
verbs += /client/proc/everyone_random
verbs += /client/proc/only_one
verbs += /client/proc/cinematic //show a cinematic sequence
verbs += /client/proc/startSinglo //Used to prevent the station from losing power while testing stuff out.
verbs += /client/proc/toggle_log_hrefs
verbs += /client/proc/cmd_debug_mob_lists
verbs += /client/proc/set_ooc
else
return
return
/client/proc/clear_admin_verbs()
deadchat = 0
verbs.Remove(
/datum/admins/proc/announce,
/datum/admins/proc/startnow,
/datum/admins/proc/toggleAI, /*Toggle the AI*/
/datum/admins/proc/toggleenter, /*Toggle enterting*/
/datum/admins/proc/toggleguests, /*Toggle guests entering*/
/datum/admins/proc/toggleooc, /*toggle ooc*/
/datum/admins/proc/toggleoocdead, /*toggle ooc for dead/unc*/
/datum/admins/proc/delay, /*game start delay*/
/datum/admins/proc/immreboot, /*immediate reboot*/
/datum/admins/proc/restart, /*restart*/
/datum/admins/proc/show_traitor_panel,
/datum/admins/proc/show_player_panel,
/datum/admins/proc/toggle_aliens, /*toggle aliens*/
/datum/admins/proc/toggle_space_ninja,/*toggle ninjas*/
/datum/admins/proc/adjump,
/datum/admins/proc/view_txt_log,
/datum/admins/proc/view_atk_log,
/datum/admins/proc/spawn_atom,
/datum/admins/proc/adrev, /*toggle admin revives*/
/datum/admins/proc/adspawn, /*toggle admin item spawning*/
/datum/admins/proc/toggleaban, /*abandon mob*/
/client/proc/hide_verbs,
/client/proc/hide_most_verbs,
/client/proc/show_verbs,
/client/proc/colorooc,
/client/proc/triple_ai,
/client/proc/reload_admins,
/client/proc/kill_air,
/client/proc/cmd_debug_make_powernets,
/client/proc/object_talk,
/client/proc/strike_team,
/client/proc/cmd_admin_list_open_jobs,
/client/proc/cmd_admin_direct_narrate,
/client/proc/cmd_admin_world_narrate,
/client/proc/callproc,
/client/proc/Cell,
/client/proc/cmd_debug_del_all,
/client/proc/cmd_debug_tog_aliens,
/client/proc/check_words,
/client/proc/drop_bomb,
/client/proc/make_sound,
/client/proc/only_one,
/client/proc/send_space_ninja,
/client/proc/debug_variables,
/client/proc/cmd_modify_ticker_variables,
/client/proc/Debug2, /*debug toggle switch*/
/client/proc/toggle_view_range,
/client/proc/Getmob,
/client/proc/Getkey,
/client/proc/sendmob,
/client/proc/Jump,
/client/proc/jumptokey,
/client/proc/jumptomob,
/client/proc/jumptoturf,
/client/proc/cmd_admin_add_freeform_ai_law,
/client/proc/cmd_admin_add_random_ai_law,
/client/proc/cmd_admin_rejuvenate,
/client/proc/cmd_admin_delete,
/client/proc/toggleadminhelpsound,
/client/proc/admin_call_shuttle,
/client/proc/admin_cancel_shuttle,
/client/proc/cmd_admin_dress,
/client/proc/respawn_character,
/client/proc/spawn_xeno,
/client/proc/cmd_admin_add_random_ai_law,
/client/proc/secrets,
/client/proc/check_antagonists,
/client/proc/play_sound,
/client/proc/stealth,
/client/proc/cmd_admin_check_contents,
/client/proc/cmd_admin_create_centcom_report,
/client/proc/deadchat, /*toggles deadchat*/
/client/proc/cmd_admin_pm_context,
/client/proc/cmd_admin_pm_panel,
/client/proc/cmd_admin_say,
/client/proc/cmd_admin_subtle_message,
/client/proc/dsay,
/client/proc/admin_ghost,
/client/proc/game_panel,
/client/proc/player_panel,
/client/proc/unban_panel,
/client/proc/jobbans,
/client/proc/unjobban_panel,
/client/proc/hide_verbs,
/client/proc/general_report,
/client/proc/air_report,
/client/proc/cmd_admin_say,
/client/proc/cmd_admin_gib_self,
/client/proc/restart_controller,
/client/proc/play_local_sound,
/client/proc/enable_debug_verbs,
/client/proc/toggleprayers,
/client/proc/toggle_clickproc, /*TODO ERRORAGE (Temporary proc while the enw clickproc is being tested)*/
/client/proc/toggle_hear_deadcast,
/client/proc/toggle_hear_radio,
/client/proc/player_panel_new,
/client/proc/toggle_gravity_on,
/client/proc/toggle_gravity_off,
/client/proc/toggle_random_events,
/client/proc/deadmin_self,
/client/proc/jumptocoord,
/client/proc/everyone_random,
/client/proc/Set_Holiday,
/client/proc/giveruntimelog, /*used by coders to retrieve runtime logs*/
/client/proc/getserverlog,
/client/proc/cinematic, /*show a cinematic sequence*/
/client/proc/admin_memo,
/client/proc/investigate_show, /*investigate in-game mishaps using various logs.*/
/client/proc/toggle_log_hrefs,
/client/proc/ToRban,
/proc/possess,
/proc/release,
/client/proc/togglebuildmodeself,
/client/proc/kill_airgroup,
/client/proc/debug_controller,
/client/proc/startSinglo,
/client/proc/check_ai_laws,
/client/proc/cmd_debug_mob_lists,
/datum/admins/proc/access_news_network,
/client/proc/one_click_antag,
/client/proc/invisimin,
/client/proc/set_ooc,
//bs12 verbs
/client/proc/update_mob_sprite,
/client/proc/mod_panel,
/client/proc/admin_deny_shuttle,
/client/proc/playernotes,
/datum/admins/proc/show_skills,
/client/proc/Report,
/client/proc/display_admin_reports,
/client/proc/editappear,
/client/proc/cmd_mod_say,
/client/proc/playernotes,
/client/proc/cmd_admin_change_custom_event
//admin verb groups - They can overlap if you so wish. Only one of each verb will exist in the verbs list regardless
var/list/admin_verbs_default = list(
/datum/admins/proc/show_player_panel, /*shows an interface for individual players, with various links (links require additional flags*/
/client/proc/game_panel, /*game panel, allows to change game-mode etc*/
/datum/admins/proc/toggleooc, /*toggles ooc on/off for everyone*/
/datum/admins/proc/toggleoocdead, /*toggles ooc on/off for everyone who is dead*/
/client/proc/toggleadminhelpsound, /*toggles whether we hear a sound when adminhelps/PMs are used*/
/client/proc/deadmin_self, /*destroys our own admin datum so we can play as a regular player*/
/client/proc/cmd_admin_say, /*admin-only ooc chat*/
/client/proc/hide_verbs, /*hides all our adminverbs*/
/client/proc/hide_most_verbs, /*hides all our hideable adminverbs*/
/client/proc/debug_variables, /*allows us to -see- the variables of any instance in the game. +VAREDIT needed to modify*/
/client/proc/check_ai_laws, /*shows AI and borg laws*/
/client/proc/check_antagonists, /*shows all antags*/
/client/proc/admin_memo, /*admin memo system. show/delete/write. +SERVER needed to delete admin memos of others*/
/client/proc/deadchat, /*toggles deadchat on/off*/
/client/proc/dsay, /*talk in deadchat using our ckey/fakekey*/
/client/proc/toggleprayers, /*toggles prayers on/off*/
/client/proc/toggle_hear_deadcast, /*toggles whether we hear deadchat*/
/client/proc/toggle_hear_radio, /*toggles whether we hear the radio*/
/client/proc/investigate_show, /*various admintools for investigation. Such as a singulo grief-log*/
/client/proc/secrets
)
var/list/admin_verbs_admin = list(
/client/proc/player_panel, /*shows an interface for all players, with links to various panels (old style)*/
/client/proc/player_panel_new, /*shows an interface for all players, with links to various panels*/
/client/proc/invisimin, /*allows our mob to go invisible/visible*/
/datum/admins/proc/show_traitor_panel, /*interface which shows a mob's mind*/
/datum/admins/proc/toggleenter, /*toggles whether people can join the current game*/
/datum/admins/proc/toggleguests, /*toggles whether guests can join the current game*/
/datum/admins/proc/announce, /*priority announce something to all clients.*/
/client/proc/colorooc, /*allows us to set a custom colour for everythign we say in ooc*/
/client/proc/admin_ghost, /*allows us to ghost/reenter body at will*/
/client/proc/toggle_view_range, /*changes how far we can see*/
/datum/admins/proc/view_txt_log, /*shows the server log (diary) for today*/
// /datum/admins/proc/view_atk_log, /*shows the server combat-log, doesn't do anything presently*/
/client/proc/cmd_admin_pm_context, /*right-click adminPM interface*/
/client/proc/cmd_admin_pm_panel, /*admin-pm list*/
/client/proc/cmd_admin_subtle_message, /*send an message to somebody as a 'voice in their head'*/
/client/proc/cmd_admin_delete, /*delete an instance/object/mob/etc*/
/client/proc/cmd_admin_check_contents, /*displays the contents of an instance*/
/datum/admins/proc/access_news_network, /*allows access of newscasters*/
/client/proc/giveruntimelog, /*allows us to give access to runtime logs to somebody*/
/client/proc/getserverlog, /*allows us to fetch server logs (diary) for other days*/
/client/proc/jumptocoord, /*we ghost and jump to a coordinate*/
/client/proc/Getmob, /*teleports a mob to our location*/
/client/proc/Getkey, /*teleports a mob with a certain ckey to our location*/
/client/proc/sendmob, /*sends a mob somewhere*/
/client/proc/Jump,
/client/proc/jumptokey, /*allows us to jump to the location of a mob with a certain ckey*/
/client/proc/jumptomob, /*allows us to jump to a specific mob*/
/client/proc/jumptoturf, /*allows us to jump to a specific turf*/
/client/proc/admin_call_shuttle, /*allows us to call the emergency shuttle*/
/client/proc/admin_cancel_shuttle, /*allows us to cancel the emergency shuttle, sending it back to centcomm*/
/client/proc/cmd_admin_direct_narrate, /*send text directly to a player with no padding. Useful for narratives and fluff-text*/
/client/proc/cmd_admin_world_narrate, /*sends text to all players with no padding*/
/client/proc/cmd_admin_create_centcom_report,
/client/proc/check_words /*displays cult-words*/
)
var/list/admin_verbs_ban = list(
/client/proc/unban_panel,
/client/proc/jobbans,
/client/proc/unjobban_panel,
/client/proc/DB_ban_panel
)
var/list/admin_verbs_sounds = list(
/client/proc/play_local_sound,
/client/proc/play_sound
)
var/list/admin_verbs_fun = list(
/client/proc/object_talk,
/client/proc/cmd_admin_dress,
/client/proc/cmd_admin_gib_self,
/client/proc/drop_bomb,
/client/proc/cinematic,
/client/proc/one_click_antag,
/datum/admins/proc/toggle_aliens,
/datum/admins/proc/toggle_space_ninja,
/client/proc/only_one,
/client/proc/send_space_ninja,
/client/proc/cmd_admin_add_freeform_ai_law,
/client/proc/cmd_admin_add_random_ai_law,
/client/proc/make_sound,
/client/proc/toggle_random_events
)
var/list/admin_verbs_spawn = list(
/datum/admins/proc/spawn_atom, /*allows us to spawn instances*/
/client/proc/respawn_character
)
var/list/admin_verbs_server = list(
/client/proc/Set_Holiday,
/client/proc/ToRban,
/datum/admins/proc/startnow,
/datum/admins/proc/restart,
/datum/admins/proc/delay,
/datum/admins/proc/toggleaban,
/client/proc/toggle_log_hrefs,
/datum/admins/proc/immreboot,
/client/proc/everyone_random,
/datum/admins/proc/toggleAI,
/client/proc/cmd_admin_delete, /*delete an instance/object/mob/etc*/
/client/proc/cmd_debug_del_all,
/datum/admins/proc/adrev,
/datum/admins/proc/adspawn,
/datum/admins/proc/adjump,
/client/proc/toggle_random_events
)
var/list/admin_verbs_debug = list(
/client/proc/restart_controller,
/client/proc/cmd_admin_list_open_jobs,
/client/proc/Debug2,
/client/proc/kill_air,
/client/proc/cmd_debug_make_powernets,
/client/proc/kill_airgroup,
/client/proc/debug_controller,
/client/proc/cmd_debug_mob_lists,
/client/proc/cmd_admin_delete,
/client/proc/cmd_debug_del_all,
/client/proc/cmd_debug_tog_aliens,
/client/proc/air_report,
/client/proc/reload_admins,
/client/proc/restart_controller,
/client/proc/enable_debug_verbs
)
var/list/admin_verbs_possess = list(
/proc/possess,
/proc/release
)
var/list/admin_verbs_permissions = list(
/client/proc/edit_admin_permissions
)
var/list/admin_verbs_rejuv = list(
/client/proc/cmd_admin_rejuvenate,
/client/proc/respawn_character
)
//verbs which can be hidden - needs work
var/list/admin_verbs_hideable = list(
/client/proc/deadmin_self,
/client/proc/deadchat,
/client/proc/toggleprayers,
/client/proc/toggle_hear_deadcast,
/client/proc/toggle_hear_radio,
/datum/admins/proc/show_traitor_panel,
/datum/admins/proc/toggleenter,
/datum/admins/proc/toggleguests,
/datum/admins/proc/announce,
/client/proc/colorooc,
/client/proc/admin_ghost,
/client/proc/toggle_view_range,
/datum/admins/proc/view_txt_log,
// /datum/admins/proc/view_atk_log,
/client/proc/cmd_admin_subtle_message,
/client/proc/cmd_admin_check_contents,
/datum/admins/proc/access_news_network,
/client/proc/giveruntimelog,
/client/proc/getserverlog,
/client/proc/admin_call_shuttle,
/client/proc/admin_cancel_shuttle,
/client/proc/cmd_admin_direct_narrate,
/client/proc/cmd_admin_world_narrate,
/client/proc/check_words,
/client/proc/play_local_sound,
/client/proc/play_sound,
/client/proc/object_talk,
/client/proc/cmd_admin_dress,
/client/proc/cmd_admin_gib_self,
/client/proc/drop_bomb,
/client/proc/cinematic,
/datum/admins/proc/toggle_aliens,
/datum/admins/proc/toggle_space_ninja,
/client/proc/only_one,
/client/proc/send_space_ninja,
/client/proc/cmd_admin_add_freeform_ai_law,
/client/proc/cmd_admin_add_random_ai_law,
/client/proc/cmd_admin_create_centcom_report,
/client/proc/make_sound,
/client/proc/toggle_random_events,
/client/proc/cmd_admin_add_random_ai_law,
/client/proc/Set_Holiday,
/client/proc/ToRban,
/datum/admins/proc/startnow,
/datum/admins/proc/restart,
/datum/admins/proc/delay,
/datum/admins/proc/toggleaban,
/client/proc/toggle_log_hrefs,
/datum/admins/proc/immreboot,
/client/proc/everyone_random,
/datum/admins/proc/toggleAI,
/datum/admins/proc/adrev,
/datum/admins/proc/adspawn,
/datum/admins/proc/adjump,
/client/proc/restart_controller,
/client/proc/cmd_admin_list_open_jobs,
/client/proc/callproc,
/client/proc/Debug2,
/client/proc/reload_admins,
/client/proc/kill_air,
/client/proc/cmd_debug_make_powernets,
/client/proc/kill_airgroup,
/client/proc/debug_controller,
/client/proc/startSinglo,
/client/proc/cmd_debug_mob_lists,
/client/proc/cmd_debug_del_all,
/client/proc/cmd_debug_tog_aliens,
/client/proc/air_report,
/client/proc/enable_debug_verbs,
/proc/possess,
/proc/release
)
/client/proc/add_admin_verbs()
if(holder)
verbs += admin_verbs_default
if(holder.rights & R_BUILDMODE) verbs += /client/proc/togglebuildmodeself
if(holder.rights & R_ADMIN) verbs += admin_verbs_admin
if(holder.rights & R_BAN) verbs += admin_verbs_ban
if(holder.rights & R_FUN) verbs += admin_verbs_fun
if(holder.rights & R_SERVER) verbs += admin_verbs_server
if(holder.rights & R_DEBUG) verbs += admin_verbs_debug
if(holder.rights & R_POSSESS) verbs += admin_verbs_possess
if(holder.rights & R_PERMISSIONS) verbs += admin_verbs_permissions
if(holder.rights & R_STEALTH) verbs += /client/proc/stealth
if(holder.rights & R_REJUVINATE) verbs += admin_verbs_rejuv
if(holder.rights & R_SOUNDS) verbs += admin_verbs_sounds
if(holder.rights & R_SPAWN) verbs += admin_verbs_spawn
/client/proc/remove_admin_verbs()
verbs.Remove(
admin_verbs_default,
/client/proc/togglebuildmodeself,
admin_verbs_admin,
admin_verbs_ban,
admin_verbs_fun,
admin_verbs_server,
admin_verbs_debug,
admin_verbs_possess,
admin_verbs_permissions,
/client/proc/stealth,
admin_verbs_rejuv,
admin_verbs_sounds,
admin_verbs_spawn,
/*Debug verbs added by "show debug verbs"*/
/client/proc/Cell,
/client/proc/do_not_use_these,
/client/proc/camera_view,
/client/proc/sec_camera_report,
/client/proc/intercom_view,
/client/proc/air_status,
/client/proc/atmosscan,
/client/proc/powerdebug,
/client/proc/count_objects_on_z_level,
/client/proc/count_objects_all,
/client/proc/cmd_assume_direct_control,
/client/proc/jump_to_dead_group,
/client/proc/startSinglo,
/client/proc/ticklag,
/client/proc/cmd_admin_grantfullaccess,
/client/proc/kaboom,
/client/proc/splash,
/client/proc/cmd_admin_areatest
)
/client/proc/hide_most_verbs()//Allows you to keep some functionality while hiding some verbs
set name = "Adminverbs - Hide Most"
set category = "Admin"
verbs.Remove(/client/proc/hide_most_verbs, admin_verbs_hideable)
verbs += /client/proc/show_verbs
src << "<span class='interface'>Most of your adminverbs have been hidden.</span>"
feedback_add_details("admin_verb","HMV") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
return
/client/proc/hide_verbs()
set name = "Adminverbs - Hide All"
set category = "Admin"
remove_admin_verbs()
verbs += /client/proc/show_verbs
src << "<span class='interface'>Almost all of your adminverbs have been hidden.</span>"
feedback_add_details("admin_verb","TAVVH") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
return
/client/proc/show_verbs()
set name = "Adminverbs - Show"
set category = "Admin"
verbs -= /client/proc/show_verbs
add_admin_verbs()
src << "<span class='interface'>All of your adminverbs are now visible.</span>"
feedback_add_details("admin_verb","TAVVS") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/client/proc/admin_ghost()
set category = "Admin"
set name = "Aghost"
@@ -472,19 +317,6 @@
body.key = "@[key]" //Haaaaaaaack. But the people have spoken. If it breaks; blame adminbus
feedback_add_details("admin_verb","O") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/*
/client/proc/get_admin_state()
set name = "Get Admin State"
set category = "Debug"
for(var/client/C in admins)
if(C.holder.state == 1)
src << "[C.key] is playing - [C.holder.state]"
else if(C.holder.state == 2)
src << "[C.key] is observing - [C.holder.state]"
else
src << "[C.key] is undefined - [C.holder.state]"
feedback_add_details("admin_verb","GAS") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
*/
/client/proc/invisimin()
set name = "Invisimin"
@@ -533,7 +365,10 @@
set name = "Display Job bans"
set category = "Admin"
if(holder)
holder.Jobbans()
if(config.ban_legacy_system)
holder.Jobbans()
else
holder.DB_ban_panel()
feedback_add_details("admin_verb","VJB") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
return
@@ -541,7 +376,10 @@
set name = "Unban Panel"
set category = "Admin"
if(holder)
holder.unbanpanel()
if(config.ban_legacy_system)
holder.unbanpanel()
else
holder.DB_ban_panel()
feedback_add_details("admin_verb","UBP") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
return
@@ -586,17 +424,14 @@
message_admins("[key_name_admin(usr)] has turned stealth mode [holder.fakekey ? "ON" : "OFF"]", 1)
feedback_add_details("admin_verb","SM") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
#define AUTOBATIME 10
/client/proc/warn(var/mob/M in player_list)
/*set category = "Special Verbs"
set name = "Warn"
set desc = "Warn a player"*/ //Based on the information I gathered via stat logging this verb was not used. Use the show player panel alternative. --erro
if(!holder)
src << "Only administrators may use this command."
return
if(M.client && M.client.holder && (M.client.holder.level >= holder.level))
alert("You cannot perform this action. You must be of a higher administrative rank!", null, null, null, null, null)
return
if(!check_rights(R_ADMIN)) return
if(!M.client.warned)
M << "\red <B>You have been warned by an administrator. This is the only warning you will recieve.</B>"
M.client.warned = 1
@@ -721,17 +556,6 @@
log_admin("[key_name(usr)] used 'kill air'.")
message_admins("\blue [key_name_admin(usr)] used 'kill air'.", 1)
/client/proc/show_verbs()
set name = "Toggle admin verb visibility"
set category = "Admin"
src << "Restoring admin verbs back"
var/temp = deadchat
holder.state = null //forces a full verbs update
update_admins(holder.rank)
deadchat = temp
feedback_add_details("admin_verb","TAVVS") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/client/proc/toggle_clickproc() //TODO ERRORAGE (This is a temporary verb here while I test the new clicking proc)
set name = "Toggle NewClickProc"
set category = "Debug"
@@ -763,72 +587,14 @@
set name = "De-admin self"
set category = "Admin"
if(src.holder)
if(holder)
if(alert("Confirm self-deadmin for the round? You can't re-admin yourself without someont promoting you.",,"Yes","No") == "Yes")
log_admin("[src] deadmined themself.")
message_admins("[src] deadmined themself.", 1)
deadmin()
usr << "You are now a normal player."
src << "<span class='interface'>You are now a normal player.</span>"
feedback_add_details("admin_verb","DAS") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/client/proc/hide_most_verbs()//Allows you to keep some functionality while hiding some verbs
set name = "Toggle most admin verb visibility"
set category = "Admin"
src << "Hiding most admin verbs"
var/temp = deadchat
clear_admin_verbs()
deadchat = temp
verbs -= /client/proc/hide_verbs
verbs -= /client/proc/hide_most_verbs
verbs += /client/proc/show_verbs
if(holder.level >= 5)//Game Admin********************************************************************
verbs += /client/proc/colorooc
if(holder.level >= 4)//Badmin********************************************************************
verbs += /client/proc/debug_variables
//verbs += /client/proc/cmd_modify_object_variables --merged with view vairiables
verbs += /client/proc/Jump
verbs += /client/proc/jumptoturf
verbs += /client/proc/togglebuildmodeself
verbs += /client/proc/dsay
verbs += /client/proc/admin_ghost
verbs += /client/proc/game_panel
verbs += /client/proc/player_panel
verbs += /client/proc/cmd_admin_subtle_message
verbs += /client/proc/cmd_admin_pm_context
verbs += /client/proc/cmd_admin_pm_panel
verbs += /client/proc/cmd_admin_gib_self
verbs += /client/proc/deadchat //toggles deadchat
verbs += /datum/admins/proc/toggleooc //toggle ooc
verbs += /client/proc/cmd_admin_say//asay
verbs += /client/proc/toggleadminhelpsound
feedback_add_details("admin_verb","HMV") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
return
/client/proc/hide_verbs()
set name = "Toggle admin verb visibility"
set category = "Admin"
src << "Hiding almost all admin verbs"
var/temp = deadchat
clear_admin_verbs()
deadchat = temp
verbs -= /client/proc/hide_verbs
verbs -= /client/proc/hide_most_verbs
verbs += /client/proc/show_verbs
verbs += /client/proc/deadchat //toggles deadchat
verbs += /datum/admins/proc/toggleooc //toggle ooc
verbs += /client/proc/cmd_admin_say//asay
feedback_add_details("admin_verb","TAVVH") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
return
/client/proc/toggle_log_hrefs()
set name = "Toggle href logging"
set category = "Server"
+22 -15
View File
@@ -48,24 +48,31 @@ DEBUG
*/
/proc/jobban_loadbanfile()
var/savefile/S=new("data/job_full.ban")
S["keys[0]"] >> jobban_keylist
log_admin("Loading jobban_rank")
S["runonce"] >> jobban_runonce
if(config.ban_legacy_system)
var/savefile/S=new("data/job_full.ban")
S["keys[0]"] >> jobban_keylist
log_admin("Loading jobban_rank")
S["runonce"] >> jobban_runonce
/*
for(var/i = 1; i <= length(jobban_keylist); i++)
if( findtext(jobban_keylist[i],"##") )
var/index = findtext(jobban_keylist[i],"##")
var/s = jobban_keylist[i]
s = copytext( s , 1 , index ) //Removes the reason for the ban from this list
jobban_keylist[i] = s
world << "DEBUG: index: [index] - s: [s] - jobban_keylist\[[i]\] = [jobban_keylist[i]]"*/
if (!length(jobban_keylist))
jobban_keylist=list()
log_admin("jobban_keylist was empty")
else
if(!establish_db_connection())
world.log << "Database connection failed. Reverting to the legacy ban system."
diary << "Database connection failed. Reverting to the legacy ban system."
config.ban_legacy_system = 1
jobban_loadbanfile()
return
if (!length(jobban_keylist))
jobban_keylist=list()
log_admin("jobban_keylist was empty")
var/DBQuery/query = dbcon.NewQuery("SELECT ckey, job FROM erro_ban WHERE bantype = 'JOB_PERMABAN' AND isnull(unbanned)")
query.Execute()
while(query.NextRow())
var/ckey = query.item[1]
var/job = query.item[2]
jobban_keylist.Add("[ckey] - [job]")
/proc/jobban_savebanfile()
var/savefile/S=new("data/job_full.ban")
+2 -2
View File
@@ -4,6 +4,6 @@
var/mobjs = null
mobjs = dd_list2text(typesof(/mob), ";")
create_mob_html = file2text('html/create_object.html')
create_mob_html = dd_replacetext(create_mob_html, "null /* object types */", "\"[mobjs]\"")
create_mob_html = replacetext(create_mob_html, "null /* object types */", "\"[mobjs]\"")
user << browse(dd_replacetext(create_mob_html, "/* ref src */", "\ref[src]"), "window=create_mob;size=425x475")
user << browse(replacetext(create_mob_html, "/* ref src */", "\ref[src]"), "window=create_mob;size=425x475")
+4 -4
View File
@@ -5,9 +5,9 @@
var/objectjs = null
objectjs = dd_list2text(typesof(/obj), ";")
create_object_html = file2text('html/create_object.html')
create_object_html = dd_replacetext(create_object_html, "null /* object types */", "\"[objectjs]\"")
create_object_html = replacetext(create_object_html, "null /* object types */", "\"[objectjs]\"")
user << browse(dd_replacetext(create_object_html, "/* ref src */", "\ref[src]"), "window=create_object;size=425x475")
user << browse(replacetext(create_object_html, "/* ref src */", "\ref[src]"), "window=create_object;size=425x475")
/datum/admins/proc/quick_create_object(var/mob/user)
@@ -23,6 +23,6 @@
var/objectjs = null
objectjs = dd_list2text(typesof(path), ";")
quick_create_object_html = file2text('html/create_object.html')
quick_create_object_html = dd_replacetext(quick_create_object_html, "null /* object types */", "\"[objectjs]\"")
quick_create_object_html = replacetext(quick_create_object_html, "null /* object types */", "\"[objectjs]\"")
user << browse(dd_replacetext(quick_create_object_html, "/* ref src */", "\ref[src]"), "window=quick_create_object;size=425x475")
user << browse(replacetext(quick_create_object_html, "/* ref src */", "\ref[src]"), "window=quick_create_object;size=425x475")
+2 -2
View File
@@ -4,6 +4,6 @@
var/turfjs = null
turfjs = dd_list2text(typesof(/turf), ";")
create_turf_html = file2text('html/create_object.html')
create_turf_html = dd_replacetext(create_turf_html, "null /* object types */", "\"[turfjs]\"")
create_turf_html = replacetext(create_turf_html, "null /* object types */", "\"[turfjs]\"")
user << browse(dd_replacetext(create_turf_html, "/* ref src */", "\ref[src]"), "window=create_turf;size=425x475")
user << browse(replacetext(create_turf_html, "/* ref src */", "\ref[src]"), "window=create_turf;size=425x475")
File diff suppressed because it is too large Load Diff
+12 -12
View File
@@ -262,23 +262,23 @@
else if(isobserver(M))
M_job = "Ghost"
M_job = dd_replacetext(M_job, "'", "")
M_job = dd_replacetext(M_job, "\"", "")
M_job = dd_replacetext(M_job, "\\", "")
M_job = replacetext(M_job, "'", "")
M_job = replacetext(M_job, "\"", "")
M_job = replacetext(M_job, "\\", "")
var/M_name = M.name
M_name = dd_replacetext(M_name, "'", "")
M_name = dd_replacetext(M_name, "\"", "")
M_name = dd_replacetext(M_name, "\\", "")
M_name = replacetext(M_name, "'", "")
M_name = replacetext(M_name, "\"", "")
M_name = replacetext(M_name, "\\", "")
var/M_rname = M.real_name
M_rname = dd_replacetext(M_rname, "'", "")
M_rname = dd_replacetext(M_rname, "\"", "")
M_rname = dd_replacetext(M_rname, "\\", "")
M_rname = replacetext(M_rname, "'", "")
M_rname = replacetext(M_rname, "\"", "")
M_rname = replacetext(M_rname, "\\", "")
var/M_key = M.key
M_key = dd_replacetext(M_key, "'", "")
M_key = dd_replacetext(M_key, "\"", "")
M_key = dd_replacetext(M_key, "\\", "")
M_key = replacetext(M_key, "'", "")
M_key = replacetext(M_key, "\"", "")
M_key = replacetext(M_key, "\\", "")
//output for each mob
dat += {"
@@ -1,12 +0,0 @@
//Before this proc is called, the holder variable must already be set, with the proper rank, level and permissions set.
//This proc also DOES NOT CLEAR EXISTING ADMIN VERBS
/client/proc/handle_permission_verbs()
if(!holder || !holder.rank || !holder.sql_permissions)
return
if(holder.sql_permissions & PERMISSIONS)
verbs += /client/proc/edit_admin_permissions
@@ -8,21 +8,9 @@
holder.edit_admin_permissions()
/datum/admins/proc/edit_admin_permissions()
if(!usr.client)
return
if(!check_rights(R_PERMISSIONS)) return
if(!usr.client.holder || !(usr.client.holder.sql_permissions & PERMISSIONS))
usr << "\red You do not have permission to do this!"
return
var/user = sqlfdbklogin
var/pass = sqlfdbkpass
var/db = sqlfdbkdb
var/address = sqladdress
var/port = sqlport
var/DBConnection/dbcon = new()
dbcon.Connect("dbi:mysql:[db]:[address]:[port]","[user]","[pass]")
establish_db_connection()
if(!dbcon.IsConnected())
usr << "\red Failed to establish database connection"
return
@@ -53,14 +41,18 @@
var/adm_rank = select_query.item[2]
var/adm_level = select_query.item[3]
var/adm_flags = text2num(select_query.item[4])
var/rights_text = rights2text(adm_flags)
rights_text = replacetextEx(rights_text, "+", "<br>+")
if(length(rights_text) > 5)
rights_text = copytext(rights_text, 5) //Removes the first <br>, which replacetextEx() adds.
output += "<tr bgcolor='[(i % 2) ? color1 : color2]'>"
output += "<td align='center'><b>[adm_ckey]</b></td>"
output += "<td align='center'><b>[adm_rank]</b></td>"
output += "<td align='center'>[adm_level]</td>"
var/list/permissionlist = bitfield2list(adm_flags, permissionwords_sql)
output += "<td align='center'>"
for(var/word in permissionlist)
output += "[word]<BR>"
output += "<font size='2'>[rights_text]</font>"
output += "</td>"
output += "<td align='center'><font size='2'>"
@@ -81,18 +73,12 @@
if(!usr.client)
return
if(!usr.client.holder || !(usr.client.holder.sql_permissions & PERMISSIONS))
if(!usr.client.holder || !(usr.client.holder.rights & R_PERMISSIONS))
usr << "\red You do not have permission to do this!"
return
var/user = sqlfdbklogin
var/pass = sqlfdbkpass
var/db = sqlfdbkdb
var/address = sqladdress
var/port = sqlport
establish_db_connection()
var/DBConnection/dbcon = new()
dbcon.Connect("dbi:mysql:[db]:[address]:[port]","[user]","[pass]")
if(!dbcon.IsConnected())
usr << "\red Failed to establish database connection"
return
@@ -130,3 +116,58 @@
var/DBQuery/log_query = dbcon.NewQuery("INSERT INTO `test`.`erro_admin_log` (`id` ,`datetime` ,`adminckey` ,`adminip` ,`log` ) VALUES (NULL , NOW( ) , '[usr.ckey]', '[usr.client.address]', 'Edited the rank of [adm_ckey] to [new_rank]');")
log_query.Execute()
usr << "\blue Admin rank changed."
/datum/admins/proc/log_admin_permission_modification(var/adm_ckey, var/new_permission)
if(!usr.client)
return
if(!usr.client.holder || !(usr.client.holder.rights & R_PERMISSIONS))
usr << "\red You do not have permission to do this!"
return
establish_db_connection()
if(!dbcon.IsConnected())
usr << "\red Failed to establish database connection"
return
if(!adm_ckey || !new_permission)
return
adm_ckey = ckey(adm_ckey)
if(!adm_ckey)
return
if(istext(new_permission))
new_permission = text2num(new_permission)
if(!istext(adm_ckey) || !isnum(new_permission))
return
var/DBQuery/select_query = dbcon.NewQuery("SELECT id, flags FROM erro_admin WHERE ckey = '[adm_ckey]'")
select_query.Execute()
var/admin_id
var/admin_rights
while(select_query.NextRow())
admin_id = text2num(select_query.item[1])
admin_rights = text2num(select_query.item[2])
if(!admin_id)
return
if(admin_rights & new_permission) //This admin already has this permission, so we are removing it.
var/DBQuery/insert_query = dbcon.NewQuery("UPDATE `erro_admin` SET flags = [admin_rights & ~new_permission] WHERE id = [admin_id]")
insert_query.Execute()
var/DBQuery/log_query = dbcon.NewQuery("INSERT INTO `test`.`erro_admin_log` (`id` ,`datetime` ,`adminckey` ,`adminip` ,`log` ) VALUES (NULL , NOW( ) , '[usr.ckey]', '[usr.client.address]', 'Removed permission [rights2text(new_permission)] (flag = [new_permission]) to admin [adm_ckey]');")
log_query.Execute()
usr << "\blue Permission removed."
else //This admin doesn't have this permission, so we are adding it.
var/DBQuery/insert_query = dbcon.NewQuery("UPDATE `erro_admin` SET flags = '[admin_rights | new_permission]' WHERE id = [admin_id]")
insert_query.Execute()
var/DBQuery/log_query = dbcon.NewQuery("INSERT INTO `test`.`erro_admin_log` (`id` ,`datetime` ,`adminckey` ,`adminip` ,`log` ) VALUES (NULL , NOW( ) , '[usr.ckey]', '[usr.client.address]', 'Added permission [rights2text(new_permission)] (flag = [new_permission]) to admin [adm_ckey]')")
log_query.Execute()
usr << "\blue Permission added."
+83
View File
@@ -0,0 +1,83 @@
//This stuff was originally intended to be integrated into the ban-system I was working on
//but it's safe to say that'll never be finished. So I've merged it into the current player panel.
//enjoy ~Carn
#define NOTESFILE "data/player_notes.sav" //where the player notes are saved
datum/admins/proc/notes_show(var/ckey)
usr << browse("<head><title>Player Notes</title></head><body>[notes_gethtml(ckey)]</body>","window=player_notes;size=700x400")
datum/admins/proc/notes_gethtml(var/ckey)
var/savefile/notesfile = new(NOTESFILE)
if(!notesfile) return "<font color='red'>Error: Cannot access [NOTESFILE]</font>"
if(ckey)
. = "<b>Notes for <a href='?src=\ref[src];notes=show'>[ckey]</a>:</b> <a href='?src=\ref[src];notes=add;ckey=[ckey]'>\[+\]</a> <a href='?src=\ref[src];notes=remove;ckey=[ckey]'>\[-\]</a><br>"
notesfile.cd = "/[ckey]"
var/index = 1
while( !notesfile.eof )
var/note
notesfile >> note
. += "[note] <a href='?src=\ref[src];notes=remove;ckey=[ckey];from=[index]'>\[-\]</a><br>"
index++
else
. = "<b>All Notes:</b> <a href='?src=\ref[src];notes=add'>\[+\]</a> <a href='?src=\ref[src];notes=remove'>\[-\]</a><br>"
notesfile.cd = "/"
for(var/dir in notesfile.dir)
. += "<a href='?src=\ref[src];notes=show;ckey=[dir]'>[dir]</a><br>"
return
//handles adding notes to the end of a ckey's buffer
//originally had seperate entries such as var/by to record who left the note and when
//but the current bansystem is a heap of dung.
/proc/notes_add(var/ckey, var/note)
if(!ckey)
ckey = ckey(input(usr,"Who would you like to add notes for?","Enter a ckey",null) as text|null)
if(!ckey) return
if(!note)
note = html_encode(input(usr,"Enter your note:","Enter some text",null) as message|null)
if(!note) return
var/savefile/notesfile = new(NOTESFILE)
if(!notesfile) return
notesfile.cd = "/[ckey]"
notesfile.eof = 1 //move to the end of the buffer
notesfile << "[time2text(world.realtime,"DD-MMM-YYYY")] | [note][(usr && usr.ckey)?" ~[usr.ckey]":""]"
return
//handles removing entries from the buffer, or removing the entire directory if no start_index is given
/proc/notes_remove(var/ckey, var/start_index, var/end_index)
var/savefile/notesfile = new(NOTESFILE)
if(!notesfile) return
if(!ckey)
notesfile.cd = "/"
ckey = ckey(input(usr,"Who would you like to remove notes for?","Enter a ckey",null) as null|anything in notesfile.dir)
if(!ckey) return
if(start_index)
notesfile.cd = "/[ckey]"
var/list/noteslist = list()
if(!end_index) end_index = start_index
var/index = 0
while( !notesfile.eof )
index++
var/temp
notesfile >> temp
if( (start_index <= index) && (index <= end_index) )
continue
noteslist += temp
notesfile.eof = -2 //Move to the start of the buffer and then erase.
for( var/note in noteslist )
notesfile << note
else
notesfile.cd = "/"
if(alert(usr,"Are you sure you want to remove all their notes?","Confirmation","No","Yes - Remove all notes") == "Yes - Remove all notes")
notesfile.dir.Remove(ckey)
return
#undef NOTESFILE
+14 -14
View File
@@ -78,9 +78,9 @@
body += "<a href='?src=\ref[src];adminplayeropts="+ref+"'>PP</a> - "
body += "<a href='?src=\ref[src];notes=show;mob="+ref+"'>N</a> - "
body += "<a href='?src=\ref[src];adminplayervars="+ref+"'>VV</a> - "
body += "<a href='?src=\ref[src];traitor_panel_pp="+ref+"'>TP</a> - "
body += "<a href='?src=\ref[src];traitor="+ref+"'>TP</a> - "
body += "<a href='?src=\ref[usr];priv_msg=\ref"+ref+"'>PM</a> - "
body += "<a href='?src=\ref[src];adminplayersubtlemessage="+ref+"'>SM</a> - "
body += "<a href='?src=\ref[src];subtlemessage="+ref+"'>SM</a> - "
body += "<a href='?src=\ref[src];adminplayerobservejump="+ref+"'>JMP</a><br>"
if(antagonist > 0)
body += "<font size='2'><a href='?src=\ref[src];secretsadmin=check_antagonist'><font color='red'><b>Antagonist</b></font></a></font>";
@@ -266,23 +266,23 @@
else if(isobserver(M))
M_job = "Ghost"
M_job = dd_replacetext(M_job, "'", "")
M_job = dd_replacetext(M_job, "\"", "")
M_job = dd_replacetext(M_job, "\\", "")
M_job = replacetext(M_job, "'", "")
M_job = replacetext(M_job, "\"", "")
M_job = replacetext(M_job, "\\", "")
var/M_name = M.name
M_name = dd_replacetext(M_name, "'", "")
M_name = dd_replacetext(M_name, "\"", "")
M_name = dd_replacetext(M_name, "\\", "")
M_name = replacetext(M_name, "'", "")
M_name = replacetext(M_name, "\"", "")
M_name = replacetext(M_name, "\\", "")
var/M_rname = M.real_name
M_rname = dd_replacetext(M_rname, "'", "")
M_rname = dd_replacetext(M_rname, "\"", "")
M_rname = dd_replacetext(M_rname, "\\", "")
M_rname = replacetext(M_rname, "'", "")
M_rname = replacetext(M_rname, "\"", "")
M_rname = replacetext(M_rname, "\\", "")
var/M_key = M.key
M_key = dd_replacetext(M_key, "'", "")
M_key = dd_replacetext(M_key, "\"", "")
M_key = dd_replacetext(M_key, "\\", "")
M_key = replacetext(M_key, "'", "")
M_key = replacetext(M_key, "\"", "")
M_key = replacetext(M_key, "\\", "")
//output for each mob
dat += {"
File diff suppressed because it is too large Load Diff
+35 -40
View File
@@ -26,9 +26,9 @@ var/list/adminhelp_ignored_words = list("unknown","the","a","an", "monkey", "ali
var/original_msg = msg
//The symbol × (fancy multiplication sign) will be used to mark where to put replacements, so the original message must not contain it.
msg = dd_replacetext(msg, "×", "")
msg = dd_replacetext(msg, "HOLDERREF", "HOLDER-REF") //HOLDERREF is a key word which gets replaced with the admin's holder ref later on, so it mustn't be in the original message
msg = dd_replacetext(msg, "ADMINREF", "ADMIN-REF") //ADMINREF is a key word which gets replaced with the admin's client's ref. So it mustn't be in the original message.
msg = replacetext(msg, "×", "")
msg = replacetext(msg, "HOLDERREF", "HOLDER-REF") //HOLDERREF is a key word which gets replaced with the admin's holder ref later on, so it mustn't be in the original message
msg = replacetext(msg, "ADMINREF", "ADMIN-REF") //ADMINREF is a key word which gets replaced with the admin's client's ref. So it mustn't be in the original message.
var/list/msglist = text2list(msg, " ")
@@ -51,14 +51,14 @@ var/list/adminhelp_ignored_words = list("unknown","the","a","an", "monkey", "ali
for(var/i = 1; i <= msglist.len; i++)
var/word = msglist[i]
var/original_word = word
word = dd_replacetext(word, ".", "")
word = dd_replacetext(word, ",", "")
word = dd_replacetext(word, "!", "")
word = dd_replacetext(word, "?", "") //Strips some common punctuation characters so the actual word can be better compared.
word = dd_replacetext(word, ";", "")
word = dd_replacetext(word, ":", "")
word = dd_replacetext(word, "(", "")
word = dd_replacetext(word, ")", "")
word = replacetext(word, ".", "")
word = replacetext(word, ",", "")
word = replacetext(word, "!", "")
word = replacetext(word, "?", "") //Strips some common punctuation characters so the actual word can be better compared.
word = replacetext(word, ";", "")
word = replacetext(word, ":", "")
word = replacetext(word, "(", "")
word = replacetext(word, ")", "")
if(lowertext(word) in adminhelp_ignored_words)
continue
if(lowertext(word) == "ai")
@@ -88,43 +88,38 @@ var/list/adminhelp_ignored_words = list("unknown","the","a","an", "monkey", "ali
j++
msg = dd_list2text(msglist, " ")
var/admin_number = 0
var/admin_number_afk = 0
if(mob)
var/ref_mob = "\ref[src.mob]"
for (var/client/X)
if (X.holder)
admin_number++
if( X.inactivity > AFK_THRESHOLD ) //When I made this, the AFK_THRESHOLD was 3000ds = 300s = 5m, see setup.dm for the new one.
admin_number_afk++
if(X.holder.sound_adminhelp)
X << 'sound/effects/adminhelp.ogg'
var/check_laws_text = ""
if(ai_found)
check_laws_text = (" (<A HREF='?src=\ref[X.holder];adminchecklaws=[ref_mob]'>CL</A>)")
for(var/client/X in admins)
if( X.inactivity > AFK_THRESHOLD ) //When I made this, the AFK_THRESHOLD was 3000ds = 300s = 5m, see setup.dm for the new one.
admin_number_afk++
if(X.holder.sound_adminhelp)
X << 'sound/effects/adminhelp.ogg'
var/check_laws_text = ""
if(ai_found)
check_laws_text = (" (<A HREF='?src=\ref[X.holder];adminchecklaws=[ref_mob]'>CL</A>)")
var/msg_to_send = "\blue <b><font color=red>HELP: </font>[key_name(src, X)] (<A HREF='?src=\ref[X.holder];adminmoreinfo=[ref_mob]'>?</A>) (<A HREF='?src=\ref[X.holder];adminplayeropts=[ref_mob]'>PP</A>) (<A HREF='?src=\ref[X.holder];adminplayervars=[ref_mob]'>VV</A>) (<A HREF='?src=\ref[X.holder];adminplayersubtlemessage=[ref_mob]'>SM</A>) (<A HREF='?src=\ref[X.holder];adminplayerobservejump=[ref_mob]'>JMP</A>) (<A HREF='?src=\ref[X.holder];secretsadmin=check_antagonist'>CA</A>) [check_laws_text]:</b> [msg]"
msg_to_send = dd_replacetext(msg_to_send, "HOLDERREF", "\ref[X.holder]")
msg_to_send = dd_replacetext(msg_to_send, "ADMINREF", "\ref[X]")
X << msg_to_send
var/msg_to_send = "\blue <b><font color=red>HELP: </font>[key_name(src, X)] (<A HREF='?src=\ref[X.holder];adminmoreinfo=[ref_mob]'>?</A>) (<A HREF='?src=\ref[X.holder];adminplayeropts=[ref_mob]'>PP</A>) (<A HREF='?src=\ref[X.holder];adminplayervars=[ref_mob]'>VV</A>) (<A HREF='?src=\ref[X.holder];subtlemessage=[ref_mob]'>SM</A>) (<A HREF='?src=\ref[X.holder];adminplayerobservejump=[ref_mob]'>JMP</A>) (<A HREF='?src=\ref[X.holder];secretsadmin=check_antagonist'>CA</A>) [check_laws_text]:</b> [msg]"
msg_to_send = replacetext(msg_to_send, "HOLDERREF", "\ref[X.holder]")
msg_to_send = replacetext(msg_to_send, "ADMINREF", "\ref[X]")
X << msg_to_send
else
var/ref_client = "\ref[src]"
for (var/client/X)
if (X.holder)
admin_number++
if( X.inactivity > AFK_THRESHOLD ) //When I made this, the AFK_THRESHOLD was 3000ds = 300s = 5m, see setup.dm for the new one.
admin_number_afk++
if(X.holder.sound_adminhelp)
X << 'sound/effects/adminhelp.ogg'
var/msg_to_send = "\blue <b><font color=red>HELP: </font>[key_name(src, X)] (<A HREF='?src=\ref[X.holder];adminplayervars=[ref_client]'>VV</A>) (<A HREF='?src=\ref[X.holder];secretsadmin=check_antagonist'>CA</A>):</b> [msg]"
msg_to_send = dd_replacetext(msg_to_send, "HOLDERREF", "\ref[X.holder]")
msg_to_send = dd_replacetext(msg_to_send, "ADMINREF", "\ref[X]")
X << msg_to_send
for(var/client/X in admins)
if( X.inactivity > AFK_THRESHOLD ) //When I made this, the AFK_THRESHOLD was 3000ds = 300s = 5m, see setup.dm for the new one.
admin_number_afk++
if(X.holder.sound_adminhelp)
X << 'sound/effects/adminhelp.ogg'
var/msg_to_send = "\blue <b><font color=red>HELP: </font>[key_name(src, X)] (<A HREF='?src=\ref[X.holder];adminplayervars=[ref_client]'>VV</A>) (<A HREF='?src=\ref[X.holder];secretsadmin=check_antagonist'>CA</A>):</b> [msg]"
msg_to_send = replacetext(msg_to_send, "HOLDERREF", "\ref[X.holder]")
msg_to_send = replacetext(msg_to_send, "ADMINREF", "\ref[X]")
X << msg_to_send
var/admin_number_present = admins.len - admin_number_afk
src << "<font color='blue'>PM to-<b>Admins</b>: [original_msg]</font>"
log_admin("HELP: [key_name(src)]: [original_msg] - heard by [admin_number] non-AFK admins.")
if((admin_number - admin_number_afk) <= 0)
log_admin("HELP: [key_name(src)]: [original_msg] - heard by [admin_number_present] non-AFK admins.")
if(admin_number_present <= 0)
if(!admin_number_afk)
send2irc(ckey, "[original_msg] - No admins online")
else
+1 -1
View File
@@ -30,7 +30,7 @@
alert("Admin jumping disabled")
return
/client/proc/jumptomob(var/mob/M in sortmobs())
/client/proc/jumptomob(var/mob/M in mob_list)
set category = "Admin"
set name = "Jump to Mob"
+7 -7
View File
@@ -40,9 +40,9 @@
src << "<font color='red'>Error: Admin-PM: You are unable to use admin PM-s (muted).</font>"
return
if( !C || !istype(C,/client) )
if(holder) src << "<font color='red'>Error: Admin-PM: Client not found.</font>"
else adminhelp(msg) //admin we are replying to left. adminhelp instead
if(!istype(C,/client))
if(holder) src << "<font color='red'>Error: Admin-PM: Client not found.</font>"
else adminhelp(msg) //admin we are replying to left. adminhelp instead
return
//get message text, limit it's length.and clean/escape html
@@ -58,8 +58,8 @@
if (src.handle_spam_prevention(msg,MUTE_ADMINHELP))
return
//clean the message if it's not sent by a GA or GM
if( !holder || !(holder.rank in list("Game Admin", "Game Master")) )
//clean the message if it's not sent by a high-rank admin
if(!check_rights(R_SERVER|R_DEBUG,0))
msg = sanitize(copytext(msg,1,MAX_MESSAGE_LEN))
if(!msg) return
@@ -115,7 +115,7 @@
log_admin("PM: [key_name(src)]->[key_name(C)]: [msg]")
//we don't use message_admins here because the sender/receiver might get it too
for(var/client/X) //there are fewer clients than mobs
if(X.holder && X.key!=key && X.key!=C.key) //check client/X is an admin and isn't the sender or recipient
for(var/client/X in admins)
if(X.key!=key && X.key!=C.key) //check client/X is an admin and isn't the sender or recipient
X << "<B><font color='blue'>PM: [key_name(src, X, 0)]-&gt;[key_name(C, X, 0)]:</B> \blue [msg]</font>" //inform X
+9 -21
View File
@@ -2,32 +2,20 @@
set category = "Special Verbs"
set name = "Asay" //Gave this shit a shorter name so you only have to time out "asay" rather than "admin say" to use it --NeoFite
set hidden = 1
if (!src.holder)
src << "Only administrators may use this command."
return
if (src.muted & MUTE_ADMINHELP)
src << "You cannot send ASAY messages (muted)."
return
if (src.handle_spam_prevention(msg,MUTE_ADMINHELP))
return
if(!check_rights(0)) return
msg = copytext(sanitize(msg), 1, MAX_MESSAGE_LEN)
log_admin("[key_name(src)] : [msg]")
if(!msg) return
if (!msg)
return
feedback_add_details("admin_verb","M") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
if(holder.rank == "Admin Observer")
for(var/client/C in admins)
C << "<span class='adminobserver'><span class='prefix'>ADMIN:</span> <EM>[key_name(usr, C)]:</EM> <span class='message'>[msg]</span></span>"
else
if(check_rights(R_ADMIN,0))
for(var/client/C in admins)
C << "<span class='admin'><span class='prefix'>ADMIN:</span> <EM>[key_name(usr, C)]</EM> (<A HREF='?src=\ref[C.holder];adminplayerobservejump=\ref[mob]'>JMP</A>): <span class='message'>[msg]</span></span>"
else
for(var/client/C in admins)
C << "<span class='adminobserver'><span class='prefix'>ADMIN:</span> <EM>[key_name(usr, C)]:</EM> <span class='message'>[msg]</span></span>"
log_admin("[key_name(src)] : [msg]")
feedback_add_details("admin_verb","M") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/client/proc/cmd_mod_say(msg as text)
set category = "Special Verbs"
+13 -19
View File
@@ -1,22 +1,17 @@
/client/proc/Debug2()
set category = "Debug"
set name = "Debug-Game"
if(!holder)
src << "Only administrators may use this command."
return
if(holder.rank == "Game Admin")
Debug2 = !Debug2
if(!check_rights(R_DEBUG)) return
world << "Debugging [Debug2 ? "On" : "Off"]"
log_admin("[key_name(src)] toggled debugging to [Debug2]")
else if(holder.rank == "Game Master")
Debug2 = !Debug2
world << "Debugging [Debug2 ? "On" : "Off"]"
log_admin("[key_name(src)] toggled debugging to [Debug2]")
if(Debug2)
Debug2 = 0
message_admins("[key_name(src)] toggled debugging off.")
log_admin("[key_name(src)] toggled debugging off.")
else
alert("Coders only baby")
return
Debug2 = 1
message_admins("[key_name(src)] toggled debugging on.")
log_admin("[key_name(src)] toggled debugging on.")
feedback_add_details("admin_verb","DG2") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
@@ -34,9 +29,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
set category = "Debug"
set name = "Advanced ProcCall"
if(!holder)
src << "Only administrators may use this command."
return
if(!check_rights(R_DEBUG)) return
spawn(0)
var/target = null
@@ -345,6 +338,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
src << "Made [M] a cultist."
*/
//TODO: merge the vievars version into this or something maybe mayhaps
/client/proc/cmd_debug_del_all()
set category = "Debug"
set name = "Del-All"
@@ -419,13 +413,13 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
else
var/mob/dead/observer/ghost = new/mob/dead/observer(M,1)
ghost.ckey = M.ckey
message_admins("\blue [key_name_admin(usr)] assumed direct control of [M].", 1)
log_admin("[key_name(usr)] assumed direct control of [M].")
var/mob/adminmob = src.mob
M.ckey = src.ckey
if( isobserver(adminmob) )
del(adminmob)
feedback_add_details("admin_verb","ADC") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
log_admin("[key_name(usr)] assumed direct control of [M].")
message_admins("\blue [key_name_admin(usr)] assumed direct control of [M].", 1)
+148 -186
View File
@@ -1,53 +1,26 @@
/client/proc
general_report()
set category = "Debug"
set name = "Show General Report"
/client/proc/air_report()
set category = "Debug"
set name = "Show Air Report"
if(!master_controller)
usr << alert("Master_controller not found.")
/*(!master_controller || !air_master)
alert(usr,"Master_controller or air_master not found.","Air Report")
return 0
var/mobs = 0
for(var/mob/M in mob_list)
mobs++
var/active_groups = 0
var/inactive_groups = 0
var/active_tiles = 0
for(var/datum/air_group/group in air_master.air_groups)
if(group.group_processing)
active_groups++
else
inactive_groups++
active_tiles += group.members.len
var/output = {"<B>GENERAL SYSTEMS REPORT</B><HR>
<B>General Processing Data</B><BR>
<B># of Machines:</B> [machines.len]<BR>
<B># of Pipe Networks:</B> [pipe_networks.len]<BR>
<B># of Processing Items:</B> [processing_objects.len]<BR>
<B># of Power Nets:</B> [powernets.len]<BR>
<B># of Mobs:</B> [mobs]<BR>
"}
var/hotspots = 0
for(var/obj/effect/hotspot/hotspot in world)
hotspots++
usr << browse(output,"window=generalreport")
feedback_add_details("admin_verb","SGR") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
//todo:
air_report()
set category = "Debug"
set name = "Show Air Report"
usr << "\red This proc is unavailable."
/*
if(!master_controller || !air_master)
alert(usr,"Master_controller or air_master not found.","Air Report")
return 0
var/active_groups = 0
var/inactive_groups = 0
var/active_tiles = 0
for(var/datum/air_group/group in air_master.air_groups)
if(group.group_processing)
active_groups++
else
inactive_groups++
active_tiles += group.members.len
var/hotspots = 0
for(var/obj/effect/hotspot/hotspot in world)
hotspots++
var/output = {"<B>AIR SYSTEMS REPORT</B><HR>
var/output = {"<B>AIR SYSTEMS REPORT</B><HR>
<B>General Processing Data</B><BR>
<B># of Groups:</B> [air_master.air_groups.len]<BR>
---- <I>Active:</I> [active_groups]<BR>
@@ -65,159 +38,148 @@
<B>Tile Update:</B> [air_master.tiles_to_update.len]<BR>
"}
usr << browse(output,"window=airreport")
feedback_add_details("admin_verb","SAR") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
*/
usr << browse(output,"window=airreport")
feedback_add_details("admin_verb","SAR") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
*/
/client/proc/air_status(turf/target as turf)
set category = "Debug"
set name = "Display Air Status"
//todo:
air_status(turf/target as turf)
set category = "Debug"
set name = "Display Air Status"
usr << "\red This proc is unavailable."
/*
if(!isturf(target))
return
var/datum/gas_mixture/GM = target.return_air()
var/burning = 0
if(istype(target, /turf/simulated))
var/turf/simulated/T = target
if(T.active_hotspot)
burning = 1
usr << "\blue @[target.x],[target.y] ([GM.group_multiplier]): O:[GM.oxygen] T:[GM.toxins] N:[GM.nitrogen] C:[GM.carbon_dioxide] w [GM.temperature] Kelvin, [GM.return_pressure()] kPa [(burning)?("\red BURNING"):(null)]"
for(var/datum/gas/trace_gas in GM.trace_gases)
usr << "[trace_gas.type]: [trace_gas.moles]"
feedback_add_details("admin_verb","DAST") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
*/
fix_next_move()
set category = "Debug"
set name = "Unfreeze Everyone"
var/largest_move_time = 0
var/largest_click_time = 0
var/mob/largest_move_mob = null
var/mob/largest_click_mob = null
for(var/mob/M in world)
if(!M.client)
continue
if(M.next_move >= largest_move_time)
largest_move_mob = M
if(M.next_move > world.time)
largest_move_time = M.next_move - world.time
else
largest_move_time = 1
if(M.lastDblClick >= largest_click_time)
largest_click_mob = M
if(M.lastDblClick > world.time)
largest_click_time = M.lastDblClick - world.time
else
largest_click_time = 0
log_admin("DEBUG: [key_name(M)] next_move = [M.next_move] lastDblClick = [M.lastDblClick] world.time = [world.time]")
M.next_move = 1
M.lastDblClick = 0
message_admins("[key_name_admin(largest_move_mob)] had the largest move delay with [largest_move_time] frames / [largest_move_time/10] seconds!", 1)
message_admins("[key_name_admin(largest_click_mob)] had the largest click delay with [largest_click_time] frames / [largest_click_time/10] seconds!", 1)
message_admins("world.time = [world.time]", 1)
feedback_add_details("admin_verb","UFE") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/*(!isturf(target))
return
radio_report()
set category = "Debug"
set name = "Radio report"
var/datum/gas_mixture/GM = target.return_air()
var/burning = 0
if(istype(target, /turf/simulated))
var/turf/simulated/T = target
if(T.active_hotspot)
burning = 1
var/filters = list(
"1" = "RADIO_TO_AIRALARM",
"2" = "RADIO_FROM_AIRALARM",
"3" = "RADIO_CHAT",
"4" = "RADIO_ATMOSIA",
"5" = "RADIO_NAVBEACONS",
"6" = "RADIO_AIRLOCK",
"7" = "RADIO_SECBOT",
"8" = "RADIO_MULEBOT",
"_default" = "NO_FILTER"
)
var/output = "<b>Radio Report</b><hr>"
for (var/fq in radio_controller.frequencies)
output += "<b>Freq: [fq]</b><br>"
var/list/datum/radio_frequency/fqs = radio_controller.frequencies[fq]
if (!fqs)
output += "&nbsp;&nbsp;<b>ERROR</b><br>"
usr << "\blue @[target.x],[target.y] ([GM.group_multiplier]): O:[GM.oxygen] T:[GM.toxins] N:[GM.nitrogen] C:[GM.carbon_dioxide] w [GM.temperature] Kelvin, [GM.return_pressure()] kPa [(burning)?("\red BURNING"):(null)]"
for(var/datum/gas/trace_gas in GM.trace_gases)
usr << "[trace_gas.type]: [trace_gas.moles]"
feedback_add_details("admin_verb","DAST") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
*/
/client/proc/fix_next_move()
set category = "Debug"
set name = "Unfreeze Everyone"
var/largest_move_time = 0
var/largest_click_time = 0
var/mob/largest_move_mob = null
var/mob/largest_click_mob = null
for(var/mob/M in world)
if(!M.client)
continue
if(M.next_move >= largest_move_time)
largest_move_mob = M
if(M.next_move > world.time)
largest_move_time = M.next_move - world.time
else
largest_move_time = 1
if(M.lastDblClick >= largest_click_time)
largest_click_mob = M
if(M.lastDblClick > world.time)
largest_click_time = M.lastDblClick - world.time
else
largest_click_time = 0
log_admin("DEBUG: [key_name(M)] next_move = [M.next_move] lastDblClick = [M.lastDblClick] world.time = [world.time]")
M.next_move = 1
M.lastDblClick = 0
message_admins("[key_name_admin(largest_move_mob)] had the largest move delay with [largest_move_time] frames / [largest_move_time/10] seconds!", 1)
message_admins("[key_name_admin(largest_click_mob)] had the largest click delay with [largest_click_time] frames / [largest_click_time/10] seconds!", 1)
message_admins("world.time = [world.time]", 1)
feedback_add_details("admin_verb","UFE") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
return
/client/proc/radio_report()
set category = "Debug"
set name = "Radio report"
var/filters = list(
"1" = "RADIO_TO_AIRALARM",
"2" = "RADIO_FROM_AIRALARM",
"3" = "RADIO_CHAT",
"4" = "RADIO_ATMOSIA",
"5" = "RADIO_NAVBEACONS",
"6" = "RADIO_AIRLOCK",
"7" = "RADIO_SECBOT",
"8" = "RADIO_MULEBOT",
"_default" = "NO_FILTER"
)
var/output = "<b>Radio Report</b><hr>"
for (var/fq in radio_controller.frequencies)
output += "<b>Freq: [fq]</b><br>"
var/list/datum/radio_frequency/fqs = radio_controller.frequencies[fq]
if (!fqs)
output += "&nbsp;&nbsp;<b>ERROR</b><br>"
continue
for (var/filter in fqs.devices)
var/list/f = fqs.devices[filter]
if (!f)
output += "&nbsp;&nbsp;[filters[filter]]: ERROR<br>"
continue
for (var/filter in fqs.devices)
var/list/f = fqs.devices[filter]
if (!f)
output += "&nbsp;&nbsp;[filters[filter]]: ERROR<br>"
continue
output += "&nbsp;&nbsp;[filters[filter]]: [f.len]<br>"
for (var/device in f)
if (isobj(device))
output += "&nbsp;&nbsp;&nbsp;&nbsp;[device] ([device:x],[device:y],[device:z] in area [get_area(device:loc)])<br>"
else
output += "&nbsp;&nbsp;&nbsp;&nbsp;[device]<br>"
output += "&nbsp;&nbsp;[filters[filter]]: [f.len]<br>"
for (var/device in f)
if (isobj(device))
output += "&nbsp;&nbsp;&nbsp;&nbsp;[device] ([device:x],[device:y],[device:z] in area [get_area(device:loc)])<br>"
else
output += "&nbsp;&nbsp;&nbsp;&nbsp;[device]<br>"
usr << browse(output,"window=radioreport")
feedback_add_details("admin_verb","RR") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
usr << browse(output,"window=radioreport")
feedback_add_details("admin_verb","RR") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
reload_admins()
set name = "Reload Admins"
set category = "Debug"
/client/proc/reload_admins()
set name = "Reload Admins"
set category = "Debug"
if(!(usr.client.holder && usr.client.holder.level >= 6)) // protect and prevent
usr << "\red Not a good cop"
return
if(!check_rights(R_SERVER)) return
message_admins("[usr] manually reloaded admins.txt and moderators.txt")
usr << "You reload admins.txt and moderators.txt"
world.load_admins()
world.load_mods()
feedback_add_details("admin_verb","RLDA") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
message_admins("[usr] manually reloaded admins")
load_admins()
feedback_add_details("admin_verb","RLDA") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
//todo:
jump_to_dead_group()
set name = "Jump to dead group"
set category = "Debug"
usr << "\red This proc is unavailable."
/client/proc/jump_to_dead_group()
set name = "Jump to dead group"
set category = "Debug"
/*
if(!holder)
src << "Only administrators may use this command."
return
if(!air_master)
usr << "Cannot find air_system"
return
var/datum/air_group/dead_groups = list()
for(var/datum/air_group/group in air_master.air_groups)
if (!group.group_processing)
dead_groups += group
var/datum/air_group/dest_group = pick(dead_groups)
usr.loc = pick(dest_group.members)
feedback_add_details("admin_verb","JDAG") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
if(!holder)
src << "Only administrators may use this command."
return
*/
kill_airgroup()
set name = "Kill Local Airgroup"
set desc = "Use this to allow manual manupliation of atmospherics."
set category = "Debug"
usr << "\red This proc is unavailable."
/*
if(!holder)
src << "Only administrators may use this command."
return
if(!air_master)
usr << "Cannot find air_system"
return
var/datum/air_group/dead_groups = list()
for(var/datum/air_group/group in air_master.air_groups)
if (!group.group_processing)
dead_groups += group
var/datum/air_group/dest_group = pick(dead_groups)
usr.loc = pick(dest_group.members)
feedback_add_details("admin_verb","JDAG") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
return
*/
if(!air_master)
usr << "Cannot find air_system"
return
/client/proc/kill_airgroup()
set name = "Kill Local Airgroup"
set desc = "Use this to allow manual manupliation of atmospherics."
set category = "Debug"
/*
if(!holder)
src << "Only administrators may use this command."
return
var/turf/T = get_turf(usr)
if(istype(T, /turf/simulated))
var/datum/air_group/AG = T:parent
AG.next_check = 30
AG.group_processing = 0
else
usr << "Local airgroup is unsimulated!"
feedback_add_detail("admin_verb","KLAG") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
*/
if(!air_master)
usr << "Cannot find air_system"
return
var/turf/T = get_turf(usr)
if(istype(T, /turf/simulated))
var/datum/air_group/AG = T:parent
AG.next_check = 30
AG.group_processing = 0
else
usr << "Local airgroup is unsimulated!"
feedback_add_details("admin_verb","KLAG") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
*/
+3
View File
@@ -127,6 +127,9 @@ var/intercom_range_display_status = 0
/client/proc/enable_debug_verbs()
set category = "Debug"
set name = "Debug verbs"
if(!check_rights(R_DEBUG)) return
src.verbs += /client/proc/do_not_use_these //-errorage
src.verbs += /client/proc/camera_view //-errorage
src.verbs += /client/proc/sec_camera_report //-errorage
+6 -12
View File
@@ -5,7 +5,7 @@
var/method = 0 //0 means strict type detection while 1 means this type and all subtypes (IE: /obj/item with this set to 1 will set it to ALL itms)
if(!admin_rank_check(src.holder.level, 3)) return
if(!check_rights(R_VAREDIT)) return
if(A && A.type)
if(typesof(A.type))
@@ -24,11 +24,9 @@
/client/proc/massmodify_variables(var/atom/O, var/var_name = "", var/method = 0)
var/list/locked = list("vars", "key", "ckey", "client")
if(!check_rights(R_VAREDIT)) return
if(!src.holder)
src << "Only administrators may use this command."
return
var/list/locked = list("vars", "key", "ckey", "client")
for(var/p in forbidden_varedit_object_types)
if( istype(O,p) )
@@ -48,17 +46,13 @@
else
variable = var_name
if(!variable)
return
if(!variable) return
var/default
var/var_value = O.vars[variable]
var/dir
if (locked.Find(variable) && !(src.holder.rank in list("Game Master", "Game Admin")))
return
if (variable == "holder" && holder.rank != "Game Master") //Hotfix, a bit ugly but that exploit has been there for ages and now somebody just had to go and tell everyone of it bluh bluh - U
return
if(variable == "holder" || (variable in locked))
if(!check_rights(R_DEBUG)) return
if(isnull(var_value))
usr << "Unable to determine variable type."
+11 -21
View File
@@ -126,6 +126,8 @@ var/list/forbidden_varedit_object_types = list(
L += var_value
/client/proc/mod_list(var/list/L)
if(!check_rights(R_VAREDIT)) return
if(!istype(L,/list)) src << "Not a List."
var/list/locked = list("vars", "key", "ckey", "client", "firemut", "ishulk", "telekinesis", "xray", "virus", "viruses", "cuffed", "ka", "last_eaten", "urine", "poo", "icon", "icon_state")
@@ -144,8 +146,8 @@ var/list/forbidden_varedit_object_types = list(
var/dir
if (locked.Find(variable) && !(src.holder.rank in list("Game Master", "Game Admin")))
return
if(variable in locked)
if(!check_rights(R_DEBUG)) return
if(isnull(variable))
usr << "Unable to determine variable type."
@@ -264,12 +266,9 @@ var/list/forbidden_varedit_object_types = list(
/client/proc/modify_variables(var/atom/O, var/param_var_name = null, var/autodetect_class = 0)
var/list/locked = list("vars", "key", "ckey", "client", "firemut", "ishulk", "telekinesis", "xray", "virus", "cuffed", "ka", "last_eaten", "icon", "icon_state", "mutantrace")
if(!check_rights(R_VAREDIT)) return
if(!src.holder)
src << "Only administrators may use this command."
return
if(!admin_rank_check(src.holder.level, 3)) return
var/list/locked = list("vars", "key", "ckey", "client", "firemut", "ishulk", "telekinesis", "xray", "virus", "cuffed", "ka", "last_eaten", "icon", "icon_state", "mutantrace")
for(var/p in forbidden_varedit_object_types)
if( istype(O,p) )
@@ -285,13 +284,8 @@ var/list/forbidden_varedit_object_types = list(
src << "A variable with this name ([param_var_name]) doesn't exist in this atom ([O])"
return
if (param_var_name == "holder" && holder.rank != "Game Master")
src << "No. Stop being stupid."
return
if (locked.Find(param_var_name) && !(src.holder.rank in list("Game Master", "Game Admin")))
src << "Editing this variable requires you to be a game master or game admin."
return
if(param_var_name == "holder" || (param_var_name in locked))
if(!check_rights(R_DEBUG)) return
variable = param_var_name
@@ -345,15 +339,11 @@ var/list/forbidden_varedit_object_types = list(
names = sortList(names)
variable = input("Which var?","Var") as null|anything in names
if(!variable)
return
if(!variable) return
var_value = O.vars[variable]
if (locked.Find(variable) && !(src.holder.rank in list("Game Master", "Game Admin")))
return
if (variable == "holder" && holder.rank != "Game Master") //Hotfix, a bit ugly but that exploit has been there for ages and now somebody just had to go and tell everyone of it bluh bluh - U
return
if(variable == "holder" || (variable in locked))
if(!check_rights(R_DEBUG)) return
if(!autodetect_class)
+11 -30
View File
@@ -1,47 +1,28 @@
/client/proc/play_sound(S as sound)
set category = "Fun"
set name = "Play Global Sound"
if(!src.holder)
src << "Only administrators may use this command."
return
if(!check_rights(R_SOUNDS)) return
var/sound/uploaded_sound = sound(S, repeat = 0, wait = 1, channel = 777)
uploaded_sound.priority = 250
if(src.holder.rank == "Game Master" || src.holder.rank == "Game Admin" || src.holder.rank == "Badmin")
log_admin("[key_name(src)] played sound [S]")
message_admins("[key_name_admin(src)] played sound [S]", 1)
for(var/mob/M in player_list)
if(M.client.midis)
M << uploaded_sound
else
if(usr.client.canplaysound)
usr.client.canplaysound = 0
log_admin("[key_name(src)] played sound [S]")
message_admins("[key_name_admin(src)] played sound [S]", 1)
for(var/mob/M in player_list)
if(M.client.midis)
M << uploaded_sound
else
usr << "You already used up your jukebox monies this round!"
del(uploaded_sound)
log_admin("[key_name(src)] played sound [S]")
message_admins("[key_name_admin(src)] played sound [S]", 1)
for(var/mob/M in player_list)
if(M.client.midis)
M << uploaded_sound
feedback_add_details("admin_verb","PGS") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/client/proc/play_local_sound(S as sound)
set category = "Fun"
set name = "Play Local Sound"
if(!check_rights(R_SOUNDS)) return
if(!src.holder)
src << "Only administrators may use this command."
return
if(src.holder.rank == "Game Master" || src.holder.rank == "Game Admin")
log_admin("[key_name(src)] played a local sound [S]")
message_admins("[key_name_admin(src)] played a local sound [S]", 1)
playsound(get_turf_loc(src.mob), S, 50, 0, 0)
return
log_admin("[key_name(src)] played a local sound [S]")
message_admins("[key_name_admin(src)] played a local sound [S]", 1)
playsound(get_turf_loc(src.mob), S, 50, 0, 0)
feedback_add_details("admin_verb","PLS") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
+3 -3
View File
@@ -19,7 +19,7 @@
for(var/client/C in admins)
if(C.seeprayers)
C << "\blue \icon[cross] <b><font color=purple>PRAY: </font>[key_name(src, C)] (<A HREF='?src=\ref[C.holder];adminmoreinfo=\ref[src]'>?</A>) (<A HREF='?src=\ref[C.holder];adminplayeropts=\ref[src]'>PP</A>) (<A HREF='?src=\ref[C.holder];adminplayervars=\ref[src]'>VV</A>) (<A HREF='?src=\ref[C.holder];adminplayersubtlemessage=\ref[src]'>SM</A>) (<A HREF='?src=\ref[C.holder];adminplayerobservejump=\ref[src]'>JMP</A>) (<A HREF='?src=\ref[C.holder];secretsadmin=check_antagonist'>CA</A>) (<A HREF='?src=\ref[C.holder];adminspawncookie=\ref[src]'>SC</a>):</b> [msg]"
C << "\blue \icon[cross] <b><font color=purple>PRAY: </font>[key_name(src, C)] (<A HREF='?src=\ref[C.holder];adminmoreinfo=\ref[src]'>?</A>) (<A HREF='?src=\ref[C.holder];adminplayeropts=\ref[src]'>PP</A>) (<A HREF='?src=\ref[C.holder];adminplayervars=\ref[src]'>VV</A>) (<A HREF='?src=\ref[C.holder];subtlemessage=\ref[src]'>SM</A>) (<A HREF='?src=\ref[C.holder];adminplayerobservejump=\ref[src]'>JMP</A>) (<A HREF='?src=\ref[C.holder];secretsadmin=check_antagonist'>CA</A>) (<A HREF='?src=\ref[C.holder];adminspawncookie=\ref[src]'>SC</a>):</b> [msg]"
usr << "Your prayers have been received by the gods."
feedback_add_details("admin_verb","PR") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
@@ -29,10 +29,10 @@
/proc/Centcomm_announce(var/text , var/mob/Sender)
var/msg = copytext(sanitize(text), 1, MAX_MESSAGE_LEN)
for(var/client/C in admins)
C << "\blue <b><font color=orange>CENTCOMM:</font>[key_name(Sender, C)] (<A HREF='?src=\ref[C.holder];adminplayeropts=\ref[Sender]'>PP</A>) (<A HREF='?src=\ref[C.holder];adminplayervars=\ref[Sender]'>VV</A>) (<A HREF='?src=\ref[C.holder];adminplayersubtlemessage=\ref[Sender]'>SM</A>) (<A HREF='?src=\ref[C.holder];adminplayerobservejump=\ref[Sender]'>JMP</A>) (<A HREF='?src=\ref[C.holder];secretsadmin=check_antagonist'>CA</A>) (<A HREF='?src=\ref[C.holder];BlueSpaceArtillery=\ref[Sender]'>BSA</A>) (<A HREF='?src=\ref[C.holder];CentcommReply=\ref[Sender]'>RPLY</A>):</b> [msg]"
C << "\blue <b><font color=orange>CENTCOMM:</font>[key_name(Sender, C)] (<A HREF='?src=\ref[C.holder];adminplayeropts=\ref[Sender]'>PP</A>) (<A HREF='?src=\ref[C.holder];adminplayervars=\ref[Sender]'>VV</A>) (<A HREF='?src=\ref[C.holder];subtlemessage=\ref[Sender]'>SM</A>) (<A HREF='?src=\ref[C.holder];adminplayerobservejump=\ref[Sender]'>JMP</A>) (<A HREF='?src=\ref[C.holder];secretsadmin=check_antagonist'>CA</A>) (<A HREF='?src=\ref[C.holder];BlueSpaceArtillery=\ref[Sender]'>BSA</A>) (<A HREF='?src=\ref[C.holder];CentcommReply=\ref[Sender]'>RPLY</A>):</b> [msg]"
/proc/Syndicate_announce(var/text , var/mob/Sender)
var/msg = copytext(sanitize(text), 1, MAX_MESSAGE_LEN)
for(var/client/C in admins)
C << "\blue <b><font color=crimson>SYNDICATE:</font>[key_name(Sender, C)] (<A HREF='?src=\ref[C.holder];adminplayeropts=\ref[Sender]'>PP</A>) (<A HREF='?src=\ref[C.holder];adminplayervars=\ref[Sender]'>VV</A>) (<A HREF='?src=\ref[C.holder];adminplayersubtlemessage=\ref[Sender]'>SM</A>) (<A HREF='?src=\ref[C.holder];adminplayerobservejump=\ref[Sender]'>JMP</A>) (<A HREF='?src=\ref[C.holder];secretsadmin=check_antagonist'>CA</A>) (<A HREF='?src=\ref[C.holder];BlueSpaceArtillery=\ref[Sender]'>BSA</A>) (<A HREF='?src=\ref[C.holder];SyndicateReply=\ref[Sender]'>RPLY</A>):</b> [msg]"
C << "\blue <b><font color=crimson>SYNDICATE:</font>[key_name(Sender, C)] (<A HREF='?src=\ref[C.holder];adminplayeropts=\ref[Sender]'>PP</A>) (<A HREF='?src=\ref[C.holder];adminplayervars=\ref[Sender]'>VV</A>) (<A HREF='?src=\ref[C.holder];subtlemessage=\ref[Sender]'>SM</A>) (<A HREF='?src=\ref[C.holder];adminplayerobservejump=\ref[Sender]'>JMP</A>) (<A HREF='?src=\ref[C.holder];secretsadmin=check_antagonist'>CA</A>) (<A HREF='?src=\ref[C.holder];BlueSpaceArtillery=\ref[Sender]'>BSA</A>) (<A HREF='?src=\ref[C.holder];SyndicateReply=\ref[Sender]'>RPLY</A>):</b> [msg]"
+33 -103
View File
@@ -193,69 +193,37 @@ proc/cmd_admin_mute(mob/M as mob, mute_type, automute = 0)
IonStorm(0)
feedback_add_details("admin_verb","ION") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/*
Stealth spawns xenos
Changed to accomodate specific spawning. It was annoying before. /N
*/
/client/proc/spawn_xeno()
set category = "Fun"
set name = "Spawn Xeno"
set desc = "Spawns a xenomorph for all those boring rounds, without having you to do so manually."
set popup_menu = 0
if(!holder)
src << "Only administrators may use this command."
return
var/confirm = alert(src, "You sure?", "Confirm", "Yes", "No")
if(confirm != "Yes") return
if(create_xeno())
feedback_add_details("admin_verb","X") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
log_admin("[key_name(usr)] spawned a xeno.")
message_admins("\blue [key_name_admin(usr)] spawned a xeno.", 1)
return
//I use this proc for respawn character too. /N
/proc/create_xeno(mob/dead/observer/G)
var/alien_caste = alert(src, "Please choose which caste to spawn.",,"Hunter","Sentinel","Drone")
var/obj/effect/landmark/spawn_here = xeno_spawn.len ? pick(xeno_spawn) : pick(latejoin)
var/mob/living/carbon/alien/humanoid/new_xeno
switch(alien_caste)
if("Hunter")
new_xeno = new /mob/living/carbon/alien/humanoid/hunter(spawn_here)
if("Sentinel")
new_xeno = new /mob/living/carbon/alien/humanoid/sentinel(spawn_here)
if("Drone")
new_xeno = new /mob/living/carbon/alien/humanoid/drone(spawn_here)
else
return 0
var/selected_key
if(G && G.key)
selected_key = G.key
else
var/list/candidates = list() //List of candidate KEYS to assume control of the new larva ~Carn
for(G in player_list)
if(G.client.be_alien)
if(((G.client.inactivity/10)/60) <= 5)
if(!(G.mind && G.mind.current && G.mind.current.stat != DEAD))
candidates += G.key
/proc/create_xeno(ckey)
if(!ckey)
var/list/candidates = list()
for(var/mob/M in player_list)
if(M.stat != DEAD) continue //we are not dead!
if(!M.client.be_alien) continue //we don't want to be an alium
if(M.client.is_afk()) continue //we are afk
if(M.mind && M.mind.current && M.mind.current.stat != DEAD) continue //we have a live body we are tied to
candidates += M.ckey
if(candidates.len)
selected_key = input("Pick the client you want to respawn as a xeno.", "Suitable Candidates") as null|anything in candidates
ckey = input("Pick the player you want to respawn as a xeno.", "Suitable Candidates") as null|anything in candidates
else
usr << "<font color='red'>Error: create_xeno(): no suitable candidates.</font>"
if(!istext(ckey)) return 0
if(selected_key)
new_xeno.key = selected_key
message_admins("\blue [key_name_admin(usr)] has spawned [selected_key] as a filthy xeno.", 1)
return 1
else
//we couldn't find a candidate
usr << "<font color='red'>Error: create_xeno(): no suitable players.</font>"
del(new_xeno)
return 0
var/alien_caste = input(usr, "Please choose which caste to spawn.","Pick a caste",null) as null|anything in list("Queen","Hunter","Sentinel","Drone","Larva")
var/obj/effect/landmark/spawn_here = xeno_spawn.len ? pick(xeno_spawn) : pick(latejoin)
var/mob/living/carbon/alien/new_xeno
switch(alien_caste)
if("Queen") new_xeno = new /mob/living/carbon/alien/humanoid/queen(spawn_here)
if("Hunter") new_xeno = new /mob/living/carbon/alien/humanoid/hunter(spawn_here)
if("Sentinel") new_xeno = new /mob/living/carbon/alien/humanoid/sentinel(spawn_here)
if("Drone") new_xeno = new /mob/living/carbon/alien/humanoid/drone(spawn_here)
if("Larva") new_xeno = new /mob/living/carbon/alien/larva(spawn_here)
else return 0
new_xeno.ckey = ckey
message_admins("\blue [key_name_admin(usr)] has spawned [ckey] as a filthy xeno [alien_caste].", 1)
return 1
/*
If a guy was gibbed and you want to revive him, this is a good way to do so.
@@ -298,7 +266,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
if("Drone") new_xeno = new /mob/living/carbon/alien/humanoid/drone(T)
if("Queen") new_xeno = new /mob/living/carbon/alien/humanoid/queen(T)
else//If we don't know what special role they have, for whatever reason, or they're a larva.
create_xeno(G_found)
create_xeno(G_found.ckey)
return
//Now to give them their mind back.
@@ -673,7 +641,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
M << "\red To try to resolve this matter head to http://ss13.donglabs.com/forum/"
log_admin("[usr.client.ckey] has banned [M.ckey].\nReason: [reason]\nThis will be removed in [mins] minutes.")
message_admins("\blue[usr.client.ckey] has banned [M.ckey].\nReason: [reason]\nThis will be removed in [mins] minutes.")
world.Export("http://216.38.134.132/adminlog.php?type=ban&key=[usr.client.key]&key2=[M.key]&msg=[html_decode(reason)]&time=[mins]&server=[dd_replacetext(config.server_name, "#", "")]")
world.Export("http://216.38.134.132/adminlog.php?type=ban&key=[usr.client.key]&key2=[M.key]&msg=[html_decode(reason)]&time=[mins]&server=[replacetext(config.server_name, "#", "")]")
del(M.client)
del(M)
else
@@ -688,7 +656,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
M << "\red To try to resolve this matter head to http://ss13.donglabs.com/forum/"
log_admin("[usr.client.ckey] has banned [M.ckey].\nReason: [reason]\nThis is a permanent ban.")
message_admins("\blue[usr.client.ckey] has banned [M.ckey].\nReason: [reason]\nThis is a permanent ban.")
world.Export("http://216.38.134.132/adminlog.php?type=ban&key=[usr.client.key]&key2=[M.key]&msg=[html_decode(reason)]&time=perma&server=[dd_replacetext(config.server_name, "#", "")]")
world.Export("http://216.38.134.132/adminlog.php?type=ban&key=[usr.client.key]&key2=[M.key]&msg=[html_decode(reason)]&time=perma&server=[replacetext(config.server_name, "#", "")]")
del(M.client)
del(M)
*/
@@ -784,20 +752,14 @@ Traitors and the like can also be revived with the previous role mostly intact.
return
/client/proc/admin_cancel_shuttle()
set category = "Admin"
set name = "Cancel Shuttle"
if(!check_rights(0)) return
if(alert(src, "You sure?", "Confirm", "Yes", "No") != "Yes") return
if ((!( ticker ) || emergency_shuttle.location || emergency_shuttle.direction == 0))
if(!ticker || emergency_shuttle.location || emergency_shuttle.direction == 0)
return
if (!holder)
src << "Only administrators may use this command."
return
var/confirm = alert(src, "You sure?", "Confirm", "Yes", "No")
if(confirm != "Yes") return
emergency_shuttle.recall()
feedback_add_details("admin_verb","CCSHUT") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
log_admin("[key_name(usr)] admin-recalled the emergency shuttle.")
@@ -862,38 +824,6 @@ Traitors and the like can also be revived with the previous role mostly intact.
ticker.random_players = 1
feedback_add_details("admin_verb","MER") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/client/proc/toggle_gravity_on()
set category = "Debug"
set name = "Toggle station gravity on"
set desc = "Toggles all gravity to active on the station."
if (!(ticker && ticker.mode))
usr << "Please wait until the game starts! Not sure how it will work otherwise."
return
for(var/area/A in world)
A.gravitychange(1,A)
command_alert("CentComm is now beaming gravitons to your station. We appoligize for any inconvience.")
feedback_add_details("admin_verb","TSGON") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/client/proc/toggle_gravity_off()
set category = "Debug"
set name = "Toggle station gravity off"
set desc = "Toggles all gravity to inactive on the station."
if (!(ticker && ticker.mode))
usr << "Please wait until the game starts! Not sure how it will work otherwise."
return
for(var/area/A in world)
A.gravitychange(0,A)
command_alert("For budget reasons, Centcomm is no longer beaming gravitons to your station. We appoligize for any inconvience.")
feedback_add_details("admin_verb","TSGOFF") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/client/proc/toggle_random_events()
set category = "Server"
+6 -13
View File
@@ -3,22 +3,16 @@
var/const/commandos_possible = 6 //if more Commandos are needed in the future
var/global/sent_strike_team = 0
/client/proc/strike_team()
set category = "Fun"
set name = "Spawn Death Squad"
set desc = "Spawns a squad of commandos in CentCom if you want to run an admin event."
if(!src.holder)
src << "Only administrators may use this command."
return
if(!ticker)
alert("The game hasn't started yet!")
usr << "<font color='red'>The game hasn't started yet!</font>"
return
if(world.time < 6000)
alert("Not so fast, buddy. Wait a few minutes until the game gets going. There are [(6000-world.time)/10] seconds remaining.")
usr << "<font color='red'>There are [(6000-world.time)/10] seconds remaining before it may be called.</font>"
return
if(sent_strike_team == 1)
alert("CentCom is already sending a team, Mr. Dumbass.")
usr << "<font color='red'>CentCom is already sending a team.</font>"
return
if(alert("Do you want to send in the CentCom death squad? Once enabled, this is irreversible.",,"Yes","No")=="No")
if(alert("Do you want to send in the CentCom death squad? Once enabled, this is irreversible.",,"Yes","No")!="Yes")
return
alert("This 'mode' will go on until everyone is dead or the station is destroyed. You may also admin-call the evac shuttle when appropriate. Spawned commandos have internals cameras which are viewable through a monitor inside the Spec. Ops. Office. Assigning the team's detailed task is recommended from there. While you will be able to manually pick the candidates from active ghosts, their assignment in the squad will be random.")
@@ -30,7 +24,7 @@ var/global/sent_strike_team = 0
return
if(sent_strike_team)
src << "Looks like someone beat you to it."
usr << "Looks like someone beat you to it."
return
sent_strike_team = 1
@@ -100,7 +94,7 @@ var/global/sent_strike_team = 0
message_admins("\blue [key_name_admin(usr)] has spawned a CentCom strike squad.", 1)
log_admin("[key_name(usr)] used Spawn Death Squad.")
feedback_add_details("admin_verb","DTHS") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
return 1
/client/proc/create_death_commando(obj/spawn_location, leader_selected = 0)
var/mob/living/carbon/human/new_commando = new(spawn_location.loc)
@@ -181,5 +175,4 @@ var/global/sent_strike_team = 0
W.registered_name = real_name
equip_to_slot_or_del(W, slot_wear_id)
resistances += "alien_embryo"
return 1
@@ -178,5 +178,4 @@ var/global/sent_syndicate_strike_team = 0
W.registered_name = real_name
equip_to_slot_or_del(W, slot_wear_id)
resistances += "alien_embryo"
return 1
+13 -21
View File
@@ -5,28 +5,20 @@
set name = "Set Ticklag"
set desc = "Sets a new tick lag. Recommend you don't mess with this too much! Stable, time-tested ticklag value is 0.9"
if(src.holder)
if(!src.mob) return
if(!check_rights(R_DEBUG)) return
if(src.holder.rank in list("Game Admin", "Game Master"))
var/newtick = input("Sets a new tick lag. Please don't mess with this too much! The stable, time-tested ticklag value is 0.9","Lag of Tick", world.tick_lag) as num|null
//I've used ticks of 2 before to help with serious singulo lags
if(newtick && newtick <= 2 && newtick > 0)
log_admin("[key_name(src)] has modified world.tick_lag to [newtick]", 0)
message_admins("[key_name(src)] has modified world.tick_lag to [newtick]", 0)
world.tick_lag = newtick
feedback_add_details("admin_verb","TICKLAG") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
var/newtick = input("Sets a new tick lag. Please don't mess with this too much! The stable, time-tested ticklag value is 0.9","Lag of Tick", world.tick_lag) as num|null
//I've used ticks of 2 before to help with serious singulo lags
if(newtick && newtick <= 2 && newtick > 0)
log_admin("[key_name(src)] has modified world.tick_lag to [newtick]", 0)
message_admins("[key_name(src)] has modified world.tick_lag to [newtick]", 0)
world.tick_lag = newtick
feedback_add_details("admin_verb","TICKLAG") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
switch(alert("Enable Tick Compensation?","Tick Comp is currently: [config.Tickcomp]","Yes","No"))
if("Yes")
config.Tickcomp = 1
else
config.Tickcomp = 0
switch(alert("Enable Tick Compensation?","Tick Comp is currently: [config.Tickcomp]","Yes","No"))
if("Yes") config.Tickcomp = 1
else config.Tickcomp = 0
else
src << "\red Error: ticklag(): Invalid world.ticklag value. No changes made."
return
src << "\red Error: ticklag(): Invalid world.ticklag value. No changes made."
return
src << "\red Error: ticklag(): You are not authorised to use this. Game Admins and higher only."
return
-4
View File
@@ -6,9 +6,6 @@
usr << "This option is currently only usable during pregame. This may change at a later date."
return
var/confirm = alert(src, "You sure?", "Confirm", "Yes", "No")
if(confirm != "Yes") return
if(job_master && ticker)
var/datum/job/job = job_master.GetJob("AI")
if(!job)
@@ -22,5 +19,4 @@
ticker.triai = 1
usr << "There will be an AI Triumvirate at round start."
message_admins("\blue [key_name_admin(usr)] has toggled on triple AIs at round start.", 1)
feedback_add_details("admin_verb","CAIT") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
return