Bleeding edgy refresh (#303)
* not code stuff * other things * global vars, defines, helpers * onclick hud stuff, orphans, world.dm * controllers and datums * game folder * everything not client/mobs in modules * client folder * stage 1 mob stuff * simple animal things * silicons * carbon things * ayylmaos and monkeys * hyoomahn * icons n shit * sprite fixes * compile fixes * some fixes I cherrypicked. * qdel fixes * forgot brain refractors
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
return
|
||||
|
||||
if(!dbcon.Connect())
|
||||
src << "<span class='danger'>Failed to establish database connection.</span>"
|
||||
to_chat(src, "<span class='danger'>Failed to establish database connection.</span>")
|
||||
return
|
||||
|
||||
var/bantype_pass = 0
|
||||
@@ -71,10 +71,11 @@
|
||||
computerid = bancid
|
||||
ip = banip
|
||||
|
||||
var/DBQuery/query = dbcon.NewQuery("SELECT id FROM [format_table_name("player")] WHERE ckey = '[ckey]'")
|
||||
query.Execute()
|
||||
var/DBQuery/query_add_ban_get_id = dbcon.NewQuery("SELECT id FROM [format_table_name("player")] WHERE ckey = '[ckey]'")
|
||||
if(!query_add_ban_get_id.warn_execute())
|
||||
return
|
||||
var/validckey = 0
|
||||
if(query.NextRow())
|
||||
if(query_add_ban_get_id.NextRow())
|
||||
validckey = 1
|
||||
if(!validckey)
|
||||
if(!banned_mob || (banned_mob && !IsGuestKey(banned_mob.key)))
|
||||
@@ -92,7 +93,7 @@
|
||||
|
||||
if(blockselfban)
|
||||
if(a_ckey == ckey)
|
||||
usr << "<span class='danger'>You cannot apply this ban type on yourself.</span>"
|
||||
to_chat(usr, "<span class='danger'>You cannot apply this ban type on yourself.</span>")
|
||||
return
|
||||
|
||||
var/who
|
||||
@@ -112,18 +113,23 @@
|
||||
reason = sanitizeSQL(reason)
|
||||
|
||||
if(maxadminbancheck)
|
||||
var/DBQuery/adm_query = dbcon.NewQuery("SELECT count(id) AS num FROM [format_table_name("ban")] WHERE (a_ckey = '[a_ckey]') AND (bantype = 'ADMIN_PERMABAN' OR (bantype = 'ADMIN_TEMPBAN' AND expiration_time > Now())) AND isnull(unbanned)")
|
||||
adm_query.Execute()
|
||||
if(adm_query.NextRow())
|
||||
var/adm_bans = text2num(adm_query.item[1])
|
||||
var/DBQuery/query_check_adminban_amt = dbcon.NewQuery("SELECT count(id) AS num FROM [format_table_name("ban")] WHERE (a_ckey = '[a_ckey]') AND (bantype = 'ADMIN_PERMABAN' OR (bantype = 'ADMIN_TEMPBAN' AND expiration_time > Now())) AND isnull(unbanned)")
|
||||
if(!query_check_adminban_amt.warn_execute())
|
||||
return
|
||||
if(query_check_adminban_amt.NextRow())
|
||||
var/adm_bans = text2num(query_check_adminban_amt.item[1])
|
||||
if(adm_bans >= MAX_ADMIN_BANS_PER_ADMIN)
|
||||
usr << "<span class='danger'>You already logged [MAX_ADMIN_BANS_PER_ADMIN] admin ban(s) or more. Do not abuse this function!</span>"
|
||||
to_chat(usr, "<span class='danger'>You already logged [MAX_ADMIN_BANS_PER_ADMIN] admin ban(s) or more. Do not abuse this function!</span>")
|
||||
return
|
||||
|
||||
if(!computerid)
|
||||
computerid = "0"
|
||||
if(!ip)
|
||||
ip = "0.0.0.0"
|
||||
var/sql = "INSERT INTO [format_table_name("ban")] (`bantime`,`server_ip`,`server_port`,`bantype`,`reason`,`job`,`duration`,`expiration_time`,`ckey`,`computerid`,`ip`,`a_ckey`,`a_computerid`,`a_ip`,`who`,`adminwho`) VALUES (Now(), INET_ATON('[world.internet_address]'), '[world.port]', '[bantype_str]', '[reason]', '[job]', [(duration)?"[duration]":"0"], Now() + INTERVAL [(duration>0) ? duration : 0] MINUTE, '[ckey]', '[computerid]', INET_ATON('[ip]'), '[a_ckey]', '[a_computerid]', INET_ATON('[a_ip]'), '[who]', '[adminwho]')"
|
||||
var/DBQuery/query_insert = dbcon.NewQuery(sql)
|
||||
query_insert.Execute()
|
||||
usr << "<span class='adminnotice'>Ban saved to database.</span>"
|
||||
var/DBQuery/query_add_ban = dbcon.NewQuery(sql)
|
||||
if(!query_add_ban.warn_execute())
|
||||
return
|
||||
to_chat(usr, "<span class='adminnotice'>Ban saved to database.</span>")
|
||||
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)
|
||||
|
||||
if(announceinirc)
|
||||
@@ -187,24 +193,25 @@
|
||||
var/ban_id
|
||||
var/ban_number = 0 //failsafe
|
||||
|
||||
var/DBQuery/query = dbcon.NewQuery(sql)
|
||||
query.Execute()
|
||||
while(query.NextRow())
|
||||
ban_id = query.item[1]
|
||||
var/DBQuery/query_unban_get_id = dbcon.NewQuery(sql)
|
||||
if(!query_unban_get_id.warn_execute())
|
||||
return
|
||||
while(query_unban_get_id.NextRow())
|
||||
ban_id = query_unban_get_id.item[1]
|
||||
ban_number++;
|
||||
|
||||
if(ban_number == 0)
|
||||
usr << "<span class='danger'>Database update failed due to no bans fitting the search criteria. If this is not a legacy ban you should contact the database admin.</span>"
|
||||
to_chat(usr, "<span class='danger'>Database update failed due to no bans fitting the search criteria. If this is not a legacy ban you should contact the database admin.</span>")
|
||||
return
|
||||
|
||||
if(ban_number > 1)
|
||||
usr << "<span class='danger'>Database update failed due to multiple bans fitting the search criteria. Note down the ckey, job and current time and contact the database admin.</span>"
|
||||
to_chat(usr, "<span class='danger'>Database update failed due to multiple bans fitting the search criteria. Note down the ckey, job and current time and contact the database admin.</span>")
|
||||
return
|
||||
|
||||
if(istext(ban_id))
|
||||
ban_id = text2num(ban_id)
|
||||
if(!isnum(ban_id))
|
||||
usr << "<span class='danger'>Database update failed due to a ban ID mismatch. Contact the database admin.</span>"
|
||||
to_chat(usr, "<span class='danger'>Database update failed due to a ban ID mismatch. Contact the database admin.</span>")
|
||||
return
|
||||
|
||||
DB_ban_unban_by_id(ban_id)
|
||||
@@ -215,23 +222,24 @@
|
||||
return
|
||||
|
||||
if(!isnum(banid) || !istext(param))
|
||||
usr << "Cancelled"
|
||||
to_chat(usr, "Cancelled")
|
||||
return
|
||||
|
||||
var/DBQuery/query = dbcon.NewQuery("SELECT ckey, duration, reason FROM [format_table_name("ban")] WHERE id = [banid]")
|
||||
query.Execute()
|
||||
var/DBQuery/query_edit_ban_get_details = dbcon.NewQuery("SELECT ckey, duration, reason FROM [format_table_name("ban")] WHERE id = [banid]")
|
||||
if(!query_edit_ban_get_details.warn_execute())
|
||||
return
|
||||
|
||||
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]
|
||||
if(query_edit_ban_get_details.NextRow())
|
||||
pckey = query_edit_ban_get_details.item[1]
|
||||
duration = query_edit_ban_get_details.item[2]
|
||||
reason = query_edit_ban_get_details.item[3]
|
||||
else
|
||||
usr << "Invalid ban id. Contact the database admin"
|
||||
to_chat(usr, "Invalid ban id. Contact the database admin")
|
||||
return
|
||||
|
||||
reason = sanitizeSQL(reason)
|
||||
@@ -243,31 +251,33 @@
|
||||
value = input("Insert the new reason for [pckey]'s ban", "New Reason", "[reason]", null) as null|text
|
||||
value = sanitizeSQL(value)
|
||||
if(!value)
|
||||
usr << "Cancelled"
|
||||
to_chat(usr, "Cancelled")
|
||||
return
|
||||
|
||||
var/DBQuery/update_query = dbcon.NewQuery("UPDATE [format_table_name("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()
|
||||
var/DBQuery/query_edit_ban_reason = dbcon.NewQuery("UPDATE [format_table_name("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]")
|
||||
if(!query_edit_ban_reason.warn_execute())
|
||||
return
|
||||
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"
|
||||
to_chat(usr, "Cancelled")
|
||||
return
|
||||
|
||||
var/DBQuery/update_query = dbcon.NewQuery("UPDATE [format_table_name("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]")
|
||||
var/DBQuery/query_edit_ban_duration = dbcon.NewQuery("UPDATE [format_table_name("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]")
|
||||
if(!query_edit_ban_duration.warn_execute())
|
||||
return
|
||||
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"
|
||||
to_chat(usr, "Cancelled")
|
||||
return
|
||||
else
|
||||
usr << "Cancelled"
|
||||
to_chat(usr, "Cancelled")
|
||||
return
|
||||
|
||||
/datum/admins/proc/DB_ban_unban_by_id(id)
|
||||
@@ -283,18 +293,19 @@
|
||||
var/ban_number = 0 //failsafe
|
||||
|
||||
var/pckey
|
||||
var/DBQuery/query = dbcon.NewQuery(sql)
|
||||
query.Execute()
|
||||
while(query.NextRow())
|
||||
pckey = query.item[1]
|
||||
var/DBQuery/query_unban_get_ckey = dbcon.NewQuery(sql)
|
||||
if(!query_unban_get_ckey.warn_execute())
|
||||
return
|
||||
while(query_unban_get_ckey.NextRow())
|
||||
pckey = query_unban_get_ckey.item[1]
|
||||
ban_number++;
|
||||
|
||||
if(ban_number == 0)
|
||||
usr << "<span class='danger'>Database update failed due to a ban id not being present in the database.</span>"
|
||||
to_chat(usr, "<span class='danger'>Database update failed due to a ban id not being present in the database.</span>")
|
||||
return
|
||||
|
||||
if(ban_number > 1)
|
||||
usr << "<span class='danger'>Database update failed due to multiple bans having the same ID. Contact the database admin.</span>"
|
||||
to_chat(usr, "<span class='danger'>Database update failed due to multiple bans having the same ID. Contact the database admin.</span>")
|
||||
return
|
||||
|
||||
if(!src.owner || !istype(src.owner, /client))
|
||||
@@ -305,12 +316,11 @@
|
||||
var/unban_ip = src.owner:address
|
||||
|
||||
var/sql_update = "UPDATE [format_table_name("ban")] SET unbanned = 1, unbanned_datetime = Now(), unbanned_ckey = '[unban_ckey]', unbanned_computerid = '[unban_computerid]', unbanned_ip = INET_ATON('[unban_ip]') WHERE id = [id]"
|
||||
var/DBQuery/query_unban = dbcon.NewQuery(sql_update)
|
||||
if(!query_unban.warn_execute())
|
||||
return
|
||||
message_admins("[key_name_admin(usr)] has lifted [pckey]'s ban.",1)
|
||||
|
||||
var/DBQuery/query_update = dbcon.NewQuery(sql_update)
|
||||
query_update.Execute()
|
||||
|
||||
|
||||
/client/proc/DB_ban_panel()
|
||||
set category = "Admin"
|
||||
set name = "Banning Panel"
|
||||
@@ -322,7 +332,7 @@
|
||||
holder.DB_ban_panel()
|
||||
|
||||
|
||||
/datum/admins/proc/DB_ban_panel(playerckey = null, adminckey = null)
|
||||
/datum/admins/proc/DB_ban_panel(playerckey = null, adminckey = null, page = 0)
|
||||
if(!usr.client)
|
||||
return
|
||||
|
||||
@@ -330,7 +340,7 @@
|
||||
return
|
||||
|
||||
if(!dbcon.Connect())
|
||||
usr << "<span class='danger'>Failed to establish database connection.</span>"
|
||||
to_chat(usr, "<span class='danger'>Failed to establish database connection.</span>")
|
||||
return
|
||||
|
||||
var/output = "<div align='center'><table width='90%'><tr>"
|
||||
@@ -383,7 +393,30 @@
|
||||
output += "Please note that all jobban bans or unbans are in-effect the following round."
|
||||
|
||||
if(adminckey || playerckey)
|
||||
|
||||
playerckey = sanitizeSQL(ckey(playerckey))
|
||||
adminckey = sanitizeSQL(ckey(adminckey))
|
||||
var/playersearch = ""
|
||||
var/adminsearch = ""
|
||||
if(playerckey)
|
||||
playersearch = "AND ckey = '[playerckey]' "
|
||||
if(adminckey)
|
||||
adminsearch = "AND a_ckey = '[adminckey]' "
|
||||
var/bancount = 0
|
||||
var/bansperpage = 15
|
||||
var/pagecount = 0
|
||||
page = text2num(page)
|
||||
var/DBQuery/query_count_bans = dbcon.NewQuery("SELECT COUNT(id) FROM [format_table_name("ban")] WHERE 1 [playersearch] [adminsearch]")
|
||||
if(!query_count_bans.warn_execute())
|
||||
return
|
||||
if(query_count_bans.NextRow())
|
||||
bancount = text2num(query_count_bans.item[1])
|
||||
if(bancount > bansperpage)
|
||||
output += "<br><b>Page: </b>"
|
||||
while(bancount > 0)
|
||||
output+= "|<a href='?_src_=holder;dbsearchckey=[playerckey];dbsearchadmin=[adminckey];dbsearchpage=[pagecount]'>[pagecount == page ? "<b>\[[pagecount]\]</b>" : "\[[pagecount]\]"]</a>"
|
||||
bancount -= bansperpage
|
||||
pagecount++
|
||||
output += "|"
|
||||
var/blcolor = "#ffeeee" //banned light
|
||||
var/bdcolor = "#ffdddd" //banned dark
|
||||
var/ulcolor = "#eeffee" //unbanned light
|
||||
@@ -397,33 +430,25 @@
|
||||
output += "<th width='20%'><b>ADMIN</b></th>"
|
||||
output += "<th width='15%'><b>OPTIONS</b></th>"
|
||||
output += "</tr>"
|
||||
var/limit = " LIMIT [bansperpage * page], [bansperpage]"
|
||||
var/DBQuery/query_search_bans = dbcon.NewQuery("SELECT id, bantime, bantype, reason, job, duration, expiration_time, ckey, a_ckey, unbanned, unbanned_ckey, unbanned_datetime, edits FROM [format_table_name("ban")] WHERE 1 [playersearch] [adminsearch] ORDER BY bantime DESC[limit]")
|
||||
if(!query_search_bans.warn_execute())
|
||||
return
|
||||
|
||||
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 [format_table_name("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]
|
||||
while(query_search_bans.NextRow())
|
||||
var/banid = query_search_bans.item[1]
|
||||
var/bantime = query_search_bans.item[2]
|
||||
var/bantype = query_search_bans.item[3]
|
||||
var/reason = query_search_bans.item[4]
|
||||
var/job = query_search_bans.item[5]
|
||||
var/duration = query_search_bans.item[6]
|
||||
var/expiration = query_search_bans.item[7]
|
||||
var/ckey = query_search_bans.item[8]
|
||||
var/ackey = query_search_bans.item[9]
|
||||
var/unbanned = query_search_bans.item[10]
|
||||
var/unbanckey = query_search_bans.item[11]
|
||||
var/unbantime = query_search_bans.item[12]
|
||||
var/edits = query_search_bans.item[13]
|
||||
|
||||
var/lcolor = blcolor
|
||||
var/dcolor = bdcolor
|
||||
|
||||
@@ -74,18 +74,17 @@
|
||||
if(computer_id)
|
||||
cidquery = " OR computerid = '[computer_id]' "
|
||||
|
||||
var/DBQuery/query = dbcon.NewQuery("SELECT ckey, a_ckey, reason, expiration_time, duration, bantime, bantype FROM [format_table_name("ban")] WHERE (ckey = '[ckeytext]' [ipquery] [cidquery]) AND (bantype = 'PERMABAN' OR bantype = 'ADMIN_PERMABAN' OR ((bantype = 'TEMPBAN' OR bantype = 'ADMIN_TEMPBAN') AND expiration_time > Now())) AND isnull(unbanned)")
|
||||
|
||||
query.Execute()
|
||||
|
||||
while(query.NextRow())
|
||||
var/pckey = query.item[1]
|
||||
var/ackey = query.item[2]
|
||||
var/reason = query.item[3]
|
||||
var/expiration = query.item[4]
|
||||
var/duration = query.item[5]
|
||||
var/bantime = query.item[6]
|
||||
var/bantype = query.item[7]
|
||||
var/DBQuery/query_ban_check = dbcon.NewQuery("SELECT ckey, a_ckey, reason, expiration_time, duration, bantime, bantype FROM [format_table_name("ban")] WHERE (ckey = '[ckeytext]' [ipquery] [cidquery]) AND (bantype = 'PERMABAN' OR bantype = 'ADMIN_PERMABAN' OR ((bantype = 'TEMPBAN' OR bantype = 'ADMIN_TEMPBAN') AND expiration_time > Now())) AND isnull(unbanned)")
|
||||
if(!query_ban_check.Execute())
|
||||
return
|
||||
while(query_ban_check.NextRow())
|
||||
var/pckey = query_ban_check.item[1]
|
||||
var/ackey = query_ban_check.item[2]
|
||||
var/reason = query_ban_check.item[3]
|
||||
var/expiration = query_ban_check.item[4]
|
||||
var/duration = query_ban_check.item[5]
|
||||
var/bantime = query_ban_check.item[6]
|
||||
var/bantype = query_ban_check.item[7]
|
||||
if (bantype == "ADMIN_PERMABAN" || bantype == "ADMIN_TEMPBAN")
|
||||
//admin bans MUST match on ckey to prevent cid-spoofing attacks
|
||||
// as well as dynamic ip abuse
|
||||
@@ -182,7 +181,7 @@
|
||||
return null
|
||||
|
||||
if (C) //user is already connected!.
|
||||
C << "You are about to get disconnected for matching a sticky ban after you connected. If this turns out to be the ban evasion detection system going haywire, we will automatically detect this and revert the matches. if you feel that this is the case, please wait EXACTLY 6 seconds then reconnect using file -> reconnect to see if the match was reversed."
|
||||
to_chat(C, "You are about to get disconnected for matching a sticky ban after you connected. If this turns out to be the ban evasion detection system going haywire, we will automatically detect this and revert the matches. if you feel that this is the case, please wait EXACTLY 6 seconds then reconnect using file -> reconnect to see if the match was reversed.")
|
||||
|
||||
var/desc = "\nReason:(StickyBan) You, or another user of this computer or connection ([bannedckey]) is banned from playing here. The ban reason is:\n[ban["message"]]\nThis ban was applied by [ban["admin"]]\nThis is a BanEvasion Detection System ban, if you think this ban is a mistake, please wait EXACTLY 6 seconds, then try again before filing an appeal.\n"
|
||||
. = list("reason" = "Stickyban", "desc" = desc)
|
||||
|
||||
@@ -103,7 +103,7 @@ var/savefile/Banlist
|
||||
|
||||
Banlist.cd = "/base"
|
||||
if ( Banlist.dir.Find("[ckey][computerid]") )
|
||||
usr << text("<span class='danger'>Ban already exists.</span>")
|
||||
to_chat(usr, text("<span class='danger'>Ban already exists.</span>"))
|
||||
return 0
|
||||
else
|
||||
Banlist.dir.Add("[ckey][computerid]")
|
||||
|
||||
+38
-44
@@ -4,11 +4,11 @@ var/global/BSACooldown = 0
|
||||
////////////////////////////////
|
||||
/proc/message_admins(msg)
|
||||
msg = "<span class=\"admin\"><span class=\"prefix\">ADMIN LOG:</span> <span class=\"message\">[msg]</span></span>"
|
||||
admins << msg
|
||||
to_chat(admins, msg)
|
||||
|
||||
/proc/relay_msg_admins(msg)
|
||||
msg = "<span class=\"admin\"><span class=\"prefix\">RELAY:</span> <span class=\"message\">[msg]</span></span>"
|
||||
admins << msg
|
||||
to_chat(admins, msg)
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////Panels
|
||||
@@ -25,7 +25,7 @@ var/global/BSACooldown = 0
|
||||
log_game("[key_name_admin(usr)] checked the player panel while in game.")
|
||||
|
||||
if(!M)
|
||||
usr << "You seem to be selecting a mob that doesn't exist anymore."
|
||||
to_chat(usr, "You seem to be selecting a mob that doesn't exist anymore.")
|
||||
return
|
||||
|
||||
var/body = "<html><head><title>Options for [M.key]</title></head>"
|
||||
@@ -82,7 +82,8 @@ var/global/BSACooldown = 0
|
||||
body += "<br><br>"
|
||||
body += "<A href='?_src_=holder;traitor=\ref[M]'>Traitor panel</A> | "
|
||||
body += "<A href='?_src_=holder;narrateto=\ref[M]'>Narrate to</A> | "
|
||||
body += "<A href='?_src_=holder;subtlemessage=\ref[M]'>Subtle message</A>"
|
||||
body += "<A href='?_src_=holder;subtlemessage=\ref[M]'>Subtle message</A> | "
|
||||
body += "<A href='?_src_=holder;individuallog=\ref[M]'>Individual Round Logs</A>"
|
||||
|
||||
if (M.client)
|
||||
if(!isnewplayer(M))
|
||||
@@ -156,9 +157,6 @@ var/global/BSACooldown = 0
|
||||
body += "<br><br>"
|
||||
body += "<b>Other actions:</b>"
|
||||
body += "<br>"
|
||||
body += "<A href='?_src_=holder;mentor=\ref[M]'>Make Mentor</A> | "
|
||||
body += "<A href='?_src_=holder;removementor=\ref[M]'>Remove Mentor</A> | "
|
||||
body += "<br>"
|
||||
body += "<A href='?_src_=holder;forcespeech=\ref[M]'>Forcesay</A> | "
|
||||
body += "<A href='?_src_=holder;tdome1=\ref[M]'>Thunderdome 1</A> | "
|
||||
body += "<A href='?_src_=holder;tdome2=\ref[M]'>Thunderdome 2</A> | "
|
||||
@@ -180,7 +178,7 @@ var/global/BSACooldown = 0
|
||||
if (!istype(src,/datum/admins))
|
||||
src = usr.client.holder
|
||||
if (!istype(src,/datum/admins))
|
||||
usr << "Error: you are not an admin!"
|
||||
to_chat(usr, "Error: you are not an admin!")
|
||||
return
|
||||
var/dat
|
||||
dat = text("<HEAD><TITLE>Admin Newscaster</TITLE></HEAD><H3>Admin Newscaster Unit</H3>")
|
||||
@@ -376,8 +374,8 @@ var/global/BSACooldown = 0
|
||||
else
|
||||
dat+="I'm sorry to break your immersion. This shit's bugged. Report this bug to Agouri, polyxenitopalidou@gmail.com"
|
||||
|
||||
//world << "Channelname: [src.admincaster_feed_channel.channel_name] [src.admincaster_feed_channel.author]"
|
||||
//world << "Msg: [src.admincaster_feed_message.author] [src.admincaster_feed_message.body]"
|
||||
//to_chat(world, "Channelname: [src.admincaster_feed_channel.channel_name] [src.admincaster_feed_channel.author]")
|
||||
//to_chat(world, "Msg: [src.admincaster_feed_message.author] [src.admincaster_feed_message.body]")
|
||||
usr << browse(dat, "window=admincaster_main;size=400x600")
|
||||
onclose(usr, "admincaster_main")
|
||||
|
||||
@@ -451,7 +449,7 @@ var/global/BSACooldown = 0
|
||||
if(message)
|
||||
if(!check_rights(R_SERVER,0))
|
||||
message = adminscrub(message,500)
|
||||
world << "<span class='adminnotice'><b>[usr.client.holder.fakekey ? "Administrator" : usr.key] Announces:</b></span>\n \t [message]"
|
||||
to_chat(world, "<span class='adminnotice'><b>[usr.client.holder.fakekey ? "Administrator" : usr.key] Announces:</b></span>\n \t [message]")
|
||||
log_admin("Announce: [key_name(usr)] : [message]")
|
||||
feedback_add_details("admin_verb","A") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
@@ -473,7 +471,7 @@ var/global/BSACooldown = 0
|
||||
else
|
||||
message_admins("[key_name(usr)] set the admin notice.")
|
||||
log_admin("[key_name(usr)] set the admin notice:\n[new_admin_notice]")
|
||||
world << "<span class ='adminnotice'><b>Admin Notice:</b>\n \t [new_admin_notice]</span>"
|
||||
to_chat(world, "<span class ='adminnotice'><b>Admin Notice:</b>\n \t [new_admin_notice]</span>")
|
||||
feedback_add_details("admin_verb","SAN") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
admin_notice = new_admin_notice
|
||||
return
|
||||
@@ -493,7 +491,7 @@ var/global/BSACooldown = 0
|
||||
set name="Toggle Dead OOC"
|
||||
dooc_allowed = !( dooc_allowed )
|
||||
|
||||
log_admin("[key_name(usr)] toggled Dead OOC.")
|
||||
log_admin("[key_name(usr)] toggled OOC.")
|
||||
message_admins("[key_name_admin(usr)] toggled Dead OOC.")
|
||||
feedback_add_details("admin_verb","TDOOC") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
/*
|
||||
@@ -522,7 +520,7 @@ var/global/BSACooldown = 0
|
||||
feedback_add_details("admin_verb","SN") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
return 1
|
||||
else
|
||||
usr << "<font color='red'>Error: Start Now: Game has already started.</font>"
|
||||
to_chat(usr, "<font color='red'>Error: Start Now: Game has already started.</font>")
|
||||
|
||||
return 0
|
||||
|
||||
@@ -532,9 +530,9 @@ var/global/BSACooldown = 0
|
||||
set name="Toggle Entering"
|
||||
enter_allowed = !( enter_allowed )
|
||||
if (!( enter_allowed ))
|
||||
world << "<B>New players may no longer enter the game.</B>"
|
||||
to_chat(world, "<B>New players may no longer enter the game.</B>")
|
||||
else
|
||||
world << "<B>New players may now enter the game.</B>"
|
||||
to_chat(world, "<B>New players may now enter the game.</B>")
|
||||
log_admin("[key_name(usr)] toggled new player game entering.")
|
||||
message_admins("<span class='adminnotice'>[key_name_admin(usr)] toggled new player game entering.</span>")
|
||||
world.update_status()
|
||||
@@ -546,9 +544,9 @@ var/global/BSACooldown = 0
|
||||
set name="Toggle AI"
|
||||
config.allow_ai = !( config.allow_ai )
|
||||
if (!( config.allow_ai ))
|
||||
world << "<B>The AI job is no longer chooseable.</B>"
|
||||
to_chat(world, "<B>The AI job is no longer chooseable.</B>")
|
||||
else
|
||||
world << "<B>The AI job is chooseable now.</B>"
|
||||
to_chat(world, "<B>The AI job is chooseable now.</B>")
|
||||
log_admin("[key_name(usr)] toggled AI allowed.")
|
||||
world.update_status()
|
||||
feedback_add_details("admin_verb","TAI") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
@@ -559,9 +557,9 @@ var/global/BSACooldown = 0
|
||||
set name="Toggle Respawn"
|
||||
abandon_allowed = !( abandon_allowed )
|
||||
if (abandon_allowed)
|
||||
world << "<B>You may now respawn.</B>"
|
||||
to_chat(world, "<B>You may now respawn.</B>")
|
||||
else
|
||||
world << "<B>You may no longer respawn :(</B>"
|
||||
to_chat(world, "<B>You may no longer respawn :(</B>")
|
||||
message_admins("<span class='adminnotice'>[key_name_admin(usr)] toggled respawn to [abandon_allowed ? "On" : "Off"].</span>")
|
||||
log_admin("[key_name(usr)] toggled respawn to [abandon_allowed ? "On" : "Off"].")
|
||||
world.update_status()
|
||||
@@ -578,10 +576,10 @@ var/global/BSACooldown = 0
|
||||
if(newtime)
|
||||
ticker.SetTimeLeft(newtime * 10)
|
||||
if(newtime < 0)
|
||||
world << "<b>The game start has been delayed.</b>"
|
||||
to_chat(world, "<b>The game start has been delayed.</b>")
|
||||
log_admin("[key_name(usr)] delayed the round start.")
|
||||
else
|
||||
world << "<b>The game will start in [newtime] seconds.</b>"
|
||||
to_chat(world, "<b>The game will start in [newtime] seconds.</b>")
|
||||
world << 'sound/ai/attention.ogg'
|
||||
log_admin("[key_name(usr)] set the pre-game delay to [newtime] seconds.")
|
||||
feedback_add_details("admin_verb","DELAY") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
@@ -645,10 +643,10 @@ var/global/BSACooldown = 0
|
||||
set name = "Show Traitor Panel"
|
||||
|
||||
if(!istype(M))
|
||||
usr << "This can only be used on instances of type /mob"
|
||||
to_chat(usr, "This can only be used on instances of type /mob")
|
||||
return
|
||||
if(!M.mind)
|
||||
usr << "This mob has no mind!"
|
||||
to_chat(usr, "This mob has no mind!")
|
||||
return
|
||||
|
||||
M.mind.edit_memory()
|
||||
@@ -661,9 +659,9 @@ var/global/BSACooldown = 0
|
||||
set name="Toggle tinted welding helmes"
|
||||
tinted_weldhelh = !( tinted_weldhelh )
|
||||
if (tinted_weldhelh)
|
||||
world << "<B>The tinted_weldhelh has been enabled!</B>"
|
||||
to_chat(world, "<B>The tinted_weldhelh has been enabled!</B>")
|
||||
else
|
||||
world << "<B>The tinted_weldhelh has been disabled!</B>"
|
||||
to_chat(world, "<B>The tinted_weldhelh has been disabled!</B>")
|
||||
log_admin("[key_name(usr)] toggled tinted_weldhelh.")
|
||||
message_admins("[key_name_admin(usr)] toggled tinted_weldhelh.")
|
||||
feedback_add_details("admin_verb","TTWH") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
@@ -674,9 +672,9 @@ var/global/BSACooldown = 0
|
||||
set name="Toggle guests"
|
||||
guests_allowed = !( guests_allowed )
|
||||
if (!( guests_allowed ))
|
||||
world << "<B>Guests may no longer enter the game.</B>"
|
||||
to_chat(world, "<B>Guests may no longer enter the game.</B>")
|
||||
else
|
||||
world << "<B>Guests may now enter the game.</B>"
|
||||
to_chat(world, "<B>Guests may now enter the game.</B>")
|
||||
log_admin("[key_name(usr)] toggled guests game entering [guests_allowed?"":"dis"]allowed.")
|
||||
message_admins("<span class='adminnotice'>[key_name_admin(usr)] toggled guests game entering [guests_allowed?"":"dis"]allowed.</span>")
|
||||
feedback_add_details("admin_verb","TGU") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
@@ -686,35 +684,35 @@ var/global/BSACooldown = 0
|
||||
for(var/mob/living/silicon/S in mob_list)
|
||||
ai_number++
|
||||
if(isAI(S))
|
||||
usr << "<b>AI [key_name(S, usr)]'s laws:</b>"
|
||||
to_chat(usr, "<b>AI [key_name(S, usr)]'s laws:</b>")
|
||||
else if(iscyborg(S))
|
||||
var/mob/living/silicon/robot/R = S
|
||||
usr << "<b>CYBORG [key_name(S, usr)] [R.connected_ai?"(Slaved to: [R.connected_ai])":"(Independant)"]: laws:</b>"
|
||||
to_chat(usr, "<b>CYBORG [key_name(S, usr)] [R.connected_ai?"(Slaved to: [R.connected_ai])":"(Independant)"]: laws:</b>")
|
||||
else if (ispAI(S))
|
||||
usr << "<b>pAI [key_name(S, usr)]'s laws:</b>"
|
||||
to_chat(usr, "<b>pAI [key_name(S, usr)]'s laws:</b>")
|
||||
else
|
||||
usr << "<b>SOMETHING SILICON [key_name(S, usr)]'s laws:</b>"
|
||||
to_chat(usr, "<b>SOMETHING SILICON [key_name(S, usr)]'s laws:</b>")
|
||||
|
||||
if (S.laws == null)
|
||||
usr << "[key_name(S, usr)]'s laws are null?? Contact a coder."
|
||||
to_chat(usr, "[key_name(S, usr)]'s laws are null?? Contact a coder.")
|
||||
else
|
||||
S.laws.show_laws(usr)
|
||||
if(!ai_number)
|
||||
usr << "<b>No AIs located</b>" //Just so you know the thing is actually working and not just ignoring you.
|
||||
to_chat(usr, "<b>No AIs located</b>" )
|
||||
|
||||
/datum/admins/proc/output_all_devil_info()
|
||||
var/devil_number = 0
|
||||
for(var/D in ticker.mode.devils)
|
||||
devil_number++
|
||||
usr << "Devil #[devil_number]:<br><br>" + ticker.mode.printdevilinfo(D)
|
||||
to_chat(usr, "Devil #[devil_number]:<br><br>" + ticker.mode.printdevilinfo(D))
|
||||
if(!devil_number)
|
||||
usr << "<b>No Devils located</b>" //Just so you know the thing is actually working and not just ignoring you.
|
||||
to_chat(usr, "<b>No Devils located</b>" )
|
||||
|
||||
/datum/admins/proc/output_devil_info(mob/living/M)
|
||||
if(istype(M) && M.mind && M.mind.devilinfo)
|
||||
usr << ticker.mode.printdevilinfo(M.mind)
|
||||
to_chat(usr, ticker.mode.printdevilinfo(M.mind))
|
||||
else
|
||||
usr << "<b>[M] is not a devil."
|
||||
to_chat(usr, "<b>[M] is not a devil.")
|
||||
|
||||
/datum/admins/proc/manage_free_slots()
|
||||
if(!check_rights())
|
||||
@@ -776,7 +774,7 @@ var/global/BSACooldown = 0
|
||||
if(kick_only_afk && !C.is_afk()) //Ignore clients who are not afk
|
||||
continue
|
||||
if(message)
|
||||
C << message
|
||||
to_chat(C, message)
|
||||
kicked_client_names.Add("[C.ckey]")
|
||||
qdel(C)
|
||||
return kicked_client_names
|
||||
@@ -825,8 +823,4 @@ var/global/BSACooldown = 0
|
||||
string = pick(
|
||||
"Admin login: [key_name(src)]")
|
||||
if(string)
|
||||
message_admins("[string]")
|
||||
|
||||
|
||||
/datum/admins/SDQL_update()
|
||||
return FALSE //No.
|
||||
message_admins("[string]")
|
||||
@@ -31,20 +31,20 @@
|
||||
if(!holder)
|
||||
return
|
||||
switch(subject)
|
||||
if("singulo", "wires", "telesci", "gravity", "records", "cargo", "supermatter", "atmos", "kudzu") //general one-round-only stuff
|
||||
if("singulo", "wires", "telesci", "gravity", "records", "cargo", "supermatter", "atmos", "botany") //general one-round-only stuff
|
||||
var/F = investigate_subject2file(subject)
|
||||
if(!F)
|
||||
src << "<font color='red'>Error: admin_investigate: [INVESTIGATE_DIR][subject] is an invalid path or cannot be accessed.</font>"
|
||||
to_chat(src, "<font color='red'>Error: admin_investigate: [INVESTIGATE_DIR][subject] is an invalid path or cannot be accessed.</font>")
|
||||
return
|
||||
src << browse(F,"window=investigate[subject];size=800x300")
|
||||
if("hrefs") //persistent logs and stuff
|
||||
if(href_logfile)
|
||||
src << browse(href_logfile,"window=investigate[subject];size=800x300")
|
||||
else if(!config.log_hrefs)
|
||||
src << "<span class='danger'>Href logging is off and no logfile was found.</span>"
|
||||
to_chat(src, "<span class='danger'>Href logging is off and no logfile was found.</span>")
|
||||
return
|
||||
else
|
||||
src << "<span class='danger'>No href logfile was found.</span>"
|
||||
to_chat(src, "<span class='danger'>No href logfile was found.</span>")
|
||||
return
|
||||
if("notes, memos, watchlist")
|
||||
browse_messages()
|
||||
|
||||
@@ -1,131 +0,0 @@
|
||||
/client/proc/admin_memo()
|
||||
set name = "Admin Memos"
|
||||
set category = "Server"
|
||||
if(!check_rights(0))
|
||||
return
|
||||
if(!dbcon.IsConnected())
|
||||
src << "<span class='danger'>Failed to establish database connection.</span>"
|
||||
return
|
||||
var/memotask = input(usr,"Choose task.","Memo") in list("Show","Write","Edit","Remove")
|
||||
if(!memotask)
|
||||
return
|
||||
admin_memo_output(memotask)
|
||||
|
||||
/client/proc/admin_memo_output(task)
|
||||
if(!task)
|
||||
return
|
||||
if(!dbcon.IsConnected())
|
||||
src << "<span class='danger'>Failed to establish database connection.</span>"
|
||||
return
|
||||
var/sql_ckey = sanitizeSQL(src.ckey)
|
||||
switch(task)
|
||||
if("Write")
|
||||
var/DBQuery/query_memocheck = dbcon.NewQuery("SELECT ckey FROM [format_table_name("memo")] WHERE ckey = '[sql_ckey]'")
|
||||
if(!query_memocheck.Execute())
|
||||
var/err = query_memocheck.ErrorMsg()
|
||||
log_game("SQL ERROR obtaining ckey from memo table. Error : \[[err]\]\n")
|
||||
return
|
||||
if(query_memocheck.NextRow())
|
||||
src << "You already have set an admin memo."
|
||||
return
|
||||
var/memotext = input(src,"Write your Memo","Memo") as message
|
||||
if(!memotext)
|
||||
return
|
||||
memotext = sanitizeSQL(memotext)
|
||||
var/timestamp = SQLtime()
|
||||
var/DBQuery/query_memoadd = dbcon.NewQuery("INSERT INTO [format_table_name("memo")] (ckey, memotext, timestamp) VALUES ('[sql_ckey]', '[memotext]', '[timestamp]')")
|
||||
if(!query_memoadd.Execute())
|
||||
var/err = query_memoadd.ErrorMsg()
|
||||
log_game("SQL ERROR adding new memo. Error : \[[err]\]\n")
|
||||
return
|
||||
log_admin("[key_name(src)] has set an admin memo: [memotext]")
|
||||
message_admins("[key_name_admin(src)] has set an admin memo:<br>[memotext]")
|
||||
if("Edit")
|
||||
var/DBQuery/query_memolist = dbcon.NewQuery("SELECT ckey FROM [format_table_name("memo")]")
|
||||
if(!query_memolist.Execute())
|
||||
var/err = query_memolist.ErrorMsg()
|
||||
log_game("SQL ERROR obtaining ckey from memo table. Error : \[[err]\]\n")
|
||||
return
|
||||
var/list/memolist = list()
|
||||
while(query_memolist.NextRow())
|
||||
var/lkey = query_memolist.item[1]
|
||||
memolist += "[lkey]"
|
||||
if(!memolist.len)
|
||||
src << "No memos found in database."
|
||||
return
|
||||
var/target_ckey = input(src, "Select whose memo to edit", "Select memo") as null|anything in memolist
|
||||
if(!target_ckey)
|
||||
return
|
||||
var/target_sql_ckey = sanitizeSQL(target_ckey)
|
||||
var/DBQuery/query_memofind = dbcon.NewQuery("SELECT memotext FROM [format_table_name("memo")] WHERE ckey = '[target_sql_ckey]'")
|
||||
if(!query_memofind.Execute())
|
||||
var/err = query_memofind.ErrorMsg()
|
||||
log_game("SQL ERROR obtaining memotext from memo table. Error : \[[err]\]\n")
|
||||
return
|
||||
if(query_memofind.NextRow())
|
||||
var/old_memo = query_memofind.item[1]
|
||||
var/new_memo = input("Input new memo", "New Memo", "[old_memo]", null) as message
|
||||
if(!new_memo)
|
||||
return
|
||||
new_memo = sanitizeSQL(new_memo)
|
||||
var/edit_text = "Edited by [sql_ckey] on [SQLtime()] from<br>[old_memo]<br>to<br>[new_memo]<hr>"
|
||||
edit_text = sanitizeSQL(edit_text)
|
||||
var/DBQuery/update_query = dbcon.NewQuery("UPDATE [format_table_name("memo")] SET memotext = '[new_memo]', last_editor = '[sql_ckey]', edits = CONCAT(IFNULL(edits,''),'[edit_text]') WHERE ckey = '[target_sql_ckey]'")
|
||||
if(!update_query.Execute())
|
||||
var/err = update_query.ErrorMsg()
|
||||
log_game("SQL ERROR editing memo. Error : \[[err]\]\n")
|
||||
return
|
||||
if(target_sql_ckey == sql_ckey)
|
||||
log_admin("[key_name(src)] has edited their admin memo from [old_memo] to [new_memo]")
|
||||
message_admins("[key_name_admin(src)] has edited their admin memo from<br>[old_memo]<br>to<br>[new_memo]")
|
||||
else
|
||||
log_admin("[key_name(src)] has edited [target_sql_ckey]'s admin memo from [old_memo] to [new_memo]")
|
||||
message_admins("[key_name_admin(src)] has edited [target_sql_ckey]'s admin memo from<br>[old_memo]<br>to<br>[new_memo]")
|
||||
if("Show")
|
||||
var/DBQuery/query_memoshow = dbcon.NewQuery("SELECT ckey, memotext, timestamp, last_editor FROM [format_table_name("memo")]")
|
||||
if(!query_memoshow.Execute())
|
||||
var/err = query_memoshow.ErrorMsg()
|
||||
log_game("SQL ERROR obtaining ckey, memotext, timestamp, last_editor from memo table. Error : \[[err]\]\n")
|
||||
return
|
||||
var/output = null
|
||||
while(query_memoshow.NextRow())
|
||||
var/ckey = query_memoshow.item[1]
|
||||
var/memotext = query_memoshow.item[2]
|
||||
var/timestamp = query_memoshow.item[3]
|
||||
var/last_editor = query_memoshow.item[4]
|
||||
output += "<span class='memo'>Admin memo by <span class='prefix'>[ckey]</span> on [timestamp]"
|
||||
if(last_editor)
|
||||
output += "<br><span class='memoedit'>Last edit by [last_editor] <A href='?_src_=holder;memoeditlist=[ckey]'>(Click here to see edit log)</A></span>"
|
||||
output += "<br>[memotext]</span><br>"
|
||||
if(!output)
|
||||
src << "No memos found in database."
|
||||
return
|
||||
src << output
|
||||
if("Remove")
|
||||
var/DBQuery/query_memodellist = dbcon.NewQuery("SELECT ckey FROM [format_table_name("memo")]")
|
||||
if(!query_memodellist.Execute())
|
||||
var/err = query_memodellist.ErrorMsg()
|
||||
log_game("SQL ERROR obtaining ckey from memo table. Error : \[[err]\]\n")
|
||||
return
|
||||
var/list/memolist = list()
|
||||
while(query_memodellist.NextRow())
|
||||
var/ckey = query_memodellist.item[1]
|
||||
memolist += "[ckey]"
|
||||
if(!memolist.len)
|
||||
src << "No memos found in database."
|
||||
return
|
||||
var/target_ckey = input(src, "Select whose memo to delete", "Select memo") as null|anything in memolist
|
||||
if(!target_ckey)
|
||||
return
|
||||
var/target_sql_ckey = sanitizeSQL(target_ckey)
|
||||
var/DBQuery/query_memodel = dbcon.NewQuery("DELETE FROM [format_table_name("memo")] WHERE ckey = '[target_sql_ckey]'")
|
||||
if(!query_memodel.Execute())
|
||||
var/err = query_memodel.ErrorMsg()
|
||||
log_game("SQL ERROR removing memo. Error : \[[err]\]\n")
|
||||
return
|
||||
if(target_sql_ckey == sql_ckey)
|
||||
log_admin("[key_name(src)] has removed their admin memo.")
|
||||
message_admins("[key_name_admin(src)] has removed their admin memo.")
|
||||
else
|
||||
log_admin("[key_name(src)] has removed [target_sql_ckey]'s admin memo.")
|
||||
message_admins("[key_name_admin(src)] has removed [target_sql_ckey]'s admin memo.")
|
||||
@@ -6,9 +6,6 @@ var/list/admin_ranks = list() //list of all admin_rank datums
|
||||
var/list/adds
|
||||
var/list/subs
|
||||
|
||||
/datum/admin_rank/SDQL_update()
|
||||
return FALSE //Nice try trivialadmin!
|
||||
|
||||
/datum/admin_rank/New(init_name, init_rights, list/init_adds, list/init_subs)
|
||||
name = init_name
|
||||
switch(name)
|
||||
@@ -134,11 +131,12 @@ var/list/admin_ranks = list() //list of all admin_rank datums
|
||||
load_admin_ranks()
|
||||
return
|
||||
|
||||
var/DBQuery/query = dbcon.NewQuery("SELECT rank, flags FROM [format_table_name("admin_ranks")]")
|
||||
query.Execute()
|
||||
while(query.NextRow())
|
||||
var/rank_name = ckeyEx(query.item[1])
|
||||
var/flags = query.item[2]
|
||||
var/DBQuery/query_load_admin_ranks = dbcon.NewQuery("SELECT rank, flags FROM [format_table_name("admin_ranks")]")
|
||||
if(!query_load_admin_ranks.Execute())
|
||||
return
|
||||
while(query_load_admin_ranks.NextRow())
|
||||
var/rank_name = ckeyEx(query_load_admin_ranks.item[1])
|
||||
var/flags = query_load_admin_ranks.item[2]
|
||||
if(istext(flags))
|
||||
flags = text2num(flags)
|
||||
var/datum/admin_rank/R = new(rank_name, flags)
|
||||
@@ -208,11 +206,12 @@ var/list/admin_ranks = list() //list of all admin_rank datums
|
||||
load_admins()
|
||||
return
|
||||
|
||||
var/DBQuery/query = dbcon.NewQuery("SELECT ckey, rank FROM [format_table_name("admin")]")
|
||||
query.Execute()
|
||||
while(query.NextRow())
|
||||
var/ckey = ckey(query.item[1])
|
||||
var/rank = ckeyEx(query.item[2])
|
||||
var/DBQuery/query_load_admins = dbcon.NewQuery("SELECT ckey, rank FROM [format_table_name("admin")]")
|
||||
if(!query_load_admins.Execute())
|
||||
return
|
||||
while(query_load_admins.NextRow())
|
||||
var/ckey = ckey(query_load_admins.item[1])
|
||||
var/rank = ckeyEx(query_load_admins.item[2])
|
||||
if(target && ckey != target)
|
||||
continue
|
||||
|
||||
@@ -268,14 +267,14 @@ var/list/admin_ranks = list() //list of all admin_rank datums
|
||||
if(!new_ckey)
|
||||
return
|
||||
if(new_ckey in admin_datums)
|
||||
usr << "<font color='red'>Error: Topic 'editrights': [new_ckey] is already an admin</font>"
|
||||
to_chat(usr, "<font color='red'>Error: Topic 'editrights': [new_ckey] is already an admin</font>")
|
||||
return
|
||||
adm_ckey = new_ckey
|
||||
task = "rank"
|
||||
else
|
||||
adm_ckey = ckey(href_list["ckey"])
|
||||
if(!adm_ckey)
|
||||
usr << "<font color='red'>Error: Topic 'editrights': No valid ckey</font>"
|
||||
to_chat(usr, "<font color='red'>Error: Topic 'editrights': No valid ckey</font>")
|
||||
return
|
||||
|
||||
var/datum/admins/D = admin_datums[adm_ckey]
|
||||
@@ -378,5 +377,5 @@ var/list/admin_ranks = list() //list of all admin_rank datums
|
||||
var/sql_ckey = sanitizeSQL(ckey)
|
||||
var/sql_admin_rank = sanitizeSQL(newrank)
|
||||
|
||||
var/DBQuery/query_update = dbcon.NewQuery("UPDATE [format_table_name("player")] SET lastadminrank = '[sql_admin_rank]' WHERE ckey = '[sql_ckey]'")
|
||||
query_update.Execute()
|
||||
var/DBQuery/query_admin_rank_update = dbcon.NewQuery("UPDATE [format_table_name("player")] SET lastadminrank = '[sql_admin_rank]' WHERE ckey = '[sql_ckey]'")
|
||||
query_admin_rank_update.Execute()
|
||||
|
||||
@@ -7,8 +7,6 @@ var/list/admin_verbs_default = list(
|
||||
/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/admin_memo, /*admin memo system. show/delete/write. +SERVER needed to delete admin memos of others*/
|
||||
/client/proc/mentor_memo, /*mentor memo system. show/delete/write. +SERVER needed to delete mentor 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*/
|
||||
@@ -21,7 +19,8 @@ var/list/admin_verbs_default = list(
|
||||
/client/proc/reestablish_db_connection,/*reattempt a connection to the database*/
|
||||
/client/proc/cmd_admin_pm_context, /*right-click adminPM interface*/
|
||||
/client/proc/cmd_admin_pm_panel, /*admin-pm list*/
|
||||
/client/proc/stop_sounds
|
||||
/client/proc/stop_sounds,
|
||||
/client/proc/mentor_memo, /*mentor memo system. show/delete/write. +SERVER needed to delete mentor memos of others*/
|
||||
)
|
||||
var/list/admin_verbs_admin = list(
|
||||
/client/proc/player_panel_new, /*shows an interface for all players, with links to various panels*/
|
||||
@@ -119,10 +118,8 @@ var/list/admin_verbs_server = list(
|
||||
/client/proc/cmd_admin_delete, /*delete an instance/object/mob/etc*/
|
||||
/client/proc/cmd_debug_del_all,
|
||||
/client/proc/toggle_random_events,
|
||||
#if SERVERTOOLS
|
||||
/client/proc/forcerandomrotate,
|
||||
/client/proc/adminchangemap,
|
||||
#endif
|
||||
/client/proc/panicbunker,
|
||||
/client/proc/toggle_hub
|
||||
|
||||
@@ -150,7 +147,6 @@ var/list/admin_verbs_debug = list(
|
||||
/client/proc/get_dynex_range, //*debug verbs for dynex explosions.
|
||||
/client/proc/set_dynex_scale,
|
||||
/client/proc/cmd_display_del_log,
|
||||
/client/proc/reset_latejoin_spawns,
|
||||
/client/proc/create_outfits,
|
||||
/client/proc/modify_goals,
|
||||
/client/proc/debug_huds,
|
||||
@@ -159,7 +155,8 @@ var/list/admin_verbs_debug = list(
|
||||
/client/proc/jump_to_ruin,
|
||||
/client/proc/clear_dynamic_transit,
|
||||
/client/proc/toggle_medal_disable,
|
||||
/client/proc/view_runtimes
|
||||
/client/proc/view_runtimes,
|
||||
/client/proc/pump_random_event
|
||||
)
|
||||
var/list/admin_verbs_possess = list(
|
||||
/proc/possess,
|
||||
@@ -327,7 +324,7 @@ var/list/admin_verbs_hideable = list(
|
||||
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>"
|
||||
to_chat(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
|
||||
|
||||
@@ -338,7 +335,7 @@ var/list/admin_verbs_hideable = list(
|
||||
remove_admin_verbs()
|
||||
verbs += /client/proc/show_verbs
|
||||
|
||||
src << "<span class='interface'>Almost all of your adminverbs have been hidden.</span>"
|
||||
to_chat(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
|
||||
|
||||
@@ -349,7 +346,7 @@ var/list/admin_verbs_hideable = list(
|
||||
verbs -= /client/proc/show_verbs
|
||||
add_admin_verbs()
|
||||
|
||||
src << "<span class='interface'>All of your adminverbs are now visible.</span>"
|
||||
to_chat(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!
|
||||
|
||||
|
||||
@@ -372,7 +369,7 @@ var/list/admin_verbs_hideable = list(
|
||||
ghost.reenter_corpse()
|
||||
feedback_add_details("admin_verb","P") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
else if(isnewplayer(mob))
|
||||
src << "<font color='red'>Error: Aghost: Can't admin-ghost whilst in the lobby. Join or Observe first.</font>"
|
||||
to_chat(src, "<font color='red'>Error: Aghost: Can't admin-ghost whilst in the lobby. Join or Observe first.</font>")
|
||||
else
|
||||
//ghostize
|
||||
log_admin("[key_name(usr)] admin ghosted.")
|
||||
@@ -391,10 +388,10 @@ var/list/admin_verbs_hideable = list(
|
||||
if(holder && mob)
|
||||
if(mob.invisibility == INVISIBILITY_OBSERVER)
|
||||
mob.invisibility = initial(mob.invisibility)
|
||||
mob << "<span class='boldannounce'>Invisimin off. Invisibility reset.</span>"
|
||||
to_chat(mob, "<span class='boldannounce'>Invisimin off. Invisibility reset.</span>")
|
||||
else
|
||||
mob.invisibility = INVISIBILITY_OBSERVER
|
||||
mob << "<span class='adminnotice'><b>Invisimin on. You are now as invisible as a ghost.</b></span>"
|
||||
to_chat(mob, "<span class='adminnotice'><b>Invisimin on. You are now as invisible as a ghost.</b></span>")
|
||||
|
||||
/client/proc/player_panel_new()
|
||||
set name = "Player Panel"
|
||||
@@ -552,7 +549,7 @@ var/list/admin_verbs_hideable = list(
|
||||
|
||||
var/ex_power = input("Explosive Power:") as null|num
|
||||
var/range = round((2 * ex_power)**DYN_EX_SCALE)
|
||||
usr << "Estimated Explosive Range: (Devestation: [round(range*0.25)], Heavy: [round(range*0.5)], Light: [round(range)])"
|
||||
to_chat(usr, "Estimated Explosive Range: (Devestation: [round(range*0.25)], Heavy: [round(range*0.5)], Light: [round(range)])")
|
||||
|
||||
/client/proc/get_dynex_power()
|
||||
set category = "Debug"
|
||||
@@ -561,7 +558,7 @@ var/list/admin_verbs_hideable = list(
|
||||
|
||||
var/ex_range = input("Light Explosion Range:") as null|num
|
||||
var/power = (0.5 * ex_range)**(1/DYN_EX_SCALE)
|
||||
usr << "Estimated Explosive Power: [power]"
|
||||
to_chat(usr, "Estimated Explosive Power: [power]")
|
||||
|
||||
/client/proc/set_dynex_scale()
|
||||
set category = "Debug"
|
||||
@@ -652,10 +649,10 @@ var/list/admin_verbs_hideable = list(
|
||||
if(config)
|
||||
if(config.log_hrefs)
|
||||
config.log_hrefs = 0
|
||||
src << "<b>Stopped logging hrefs</b>"
|
||||
to_chat(src, "<b>Stopped logging hrefs</b>")
|
||||
else
|
||||
config.log_hrefs = 1
|
||||
src << "<b>Started logging hrefs</b>"
|
||||
to_chat(src, "<b>Started logging hrefs</b>")
|
||||
|
||||
/client/proc/check_ai_laws()
|
||||
set name = "Check AI Laws"
|
||||
@@ -678,7 +675,7 @@ var/list/admin_verbs_hideable = list(
|
||||
admin_datums -= ckey
|
||||
verbs += /client/proc/readmin
|
||||
|
||||
src << "<span class='interface'>You are now a normal player.</span>"
|
||||
to_chat(src, "<span class='interface'>You are now a normal player.</span>")
|
||||
log_admin("[src] deadmined themself.")
|
||||
message_admins("[src] deadmined themself.")
|
||||
feedback_add_details("admin_verb","DAS")
|
||||
@@ -696,7 +693,7 @@ var/list/admin_verbs_hideable = list(
|
||||
deadmins -= ckey
|
||||
verbs -= /client/proc/readmin
|
||||
|
||||
src << "<span class='interface'>You are now an admin.</span>"
|
||||
to_chat(src, "<span class='interface'>You are now an admin.</span>")
|
||||
message_admins("[src] re-adminned themselves.")
|
||||
log_admin("[src] re-adminned themselves.")
|
||||
feedback_add_details("admin_verb","RAS")
|
||||
|
||||
@@ -4,12 +4,11 @@
|
||||
return 0
|
||||
|
||||
if(!M.client) //no cache. fallback to a DBQuery
|
||||
var/DBQuery/query = dbcon.NewQuery("SELECT reason FROM [format_table_name("ban")] WHERE ckey = '[sanitizeSQL(M.ckey)]' AND (bantype = 'JOB_PERMABAN' OR (bantype = 'JOB_TEMPBAN' AND expiration_time > Now())) AND isnull(unbanned) AND job = '[sanitizeSQL(rank)]'")
|
||||
if(!query.Execute())
|
||||
log_game("SQL ERROR obtaining jobbans. Error : \[[query.ErrorMsg()]\]\n")
|
||||
var/DBQuery/query_jobban_check_ban = dbcon.NewQuery("SELECT reason FROM [format_table_name("ban")] WHERE ckey = '[sanitizeSQL(M.ckey)]' AND (bantype = 'JOB_PERMABAN' OR (bantype = 'JOB_TEMPBAN' AND expiration_time > Now())) AND isnull(unbanned) AND job = '[sanitizeSQL(rank)]'")
|
||||
if(!query_jobban_check_ban.warn_execute())
|
||||
return
|
||||
if(query.NextRow())
|
||||
var/reason = query.item[1]
|
||||
if(query_jobban_check_ban.NextRow())
|
||||
var/reason = query_jobban_check_ban.item[1]
|
||||
return reason ? reason : 1 //we don't want to return "" if there is no ban reason, as that would evaluate to false
|
||||
else
|
||||
return 0
|
||||
@@ -25,12 +24,11 @@
|
||||
/proc/jobban_buildcache(client/C)
|
||||
if(C && istype(C))
|
||||
C.jobbancache = list()
|
||||
var/DBQuery/query = dbcon.NewQuery("SELECT job, reason FROM [format_table_name("ban")] WHERE ckey = '[sanitizeSQL(C.ckey)]' AND (bantype = 'JOB_PERMABAN' OR (bantype = 'JOB_TEMPBAN' AND expiration_time > Now())) AND isnull(unbanned)")
|
||||
if(!query.Execute())
|
||||
log_game("SQL ERROR obtaining jobbans. Error : \[[query.ErrorMsg()]\]\n")
|
||||
var/DBQuery/query_jobban_build_cache = dbcon.NewQuery("SELECT job, reason FROM [format_table_name("ban")] WHERE ckey = '[sanitizeSQL(C.ckey)]' AND (bantype = 'JOB_PERMABAN' OR (bantype = 'JOB_TEMPBAN' AND expiration_time > Now())) AND isnull(unbanned)")
|
||||
if(!query_jobban_build_cache.warn_execute())
|
||||
return
|
||||
while(query.NextRow())
|
||||
C.jobbancache[query.item[1]] = query.item[2]
|
||||
while(query_jobban_build_cache.NextRow())
|
||||
C.jobbancache[query_jobban_build_cache.item[1]] = query_jobban_build_cache.item[2]
|
||||
|
||||
/proc/ban_unban_log_save(var/formatted_log)
|
||||
text2file(formatted_log,"data/ban_unban_log.txt")
|
||||
|
||||
@@ -4,20 +4,16 @@
|
||||
if(!check_rights(R_PERMISSIONS))
|
||||
return
|
||||
if(!dbcon.IsConnected())
|
||||
src << "<span class='danger'>Failed to establish database connection.</span>"
|
||||
to_chat(src, "<span class='danger'>Failed to establish database connection.</span>")
|
||||
return
|
||||
var/returned = create_poll_function()
|
||||
if(returned)
|
||||
var/DBQuery/query_check_option = dbcon.NewQuery("SELECT id FROM [format_table_name("poll_option")] WHERE pollid = [returned]")
|
||||
if(!query_check_option.Execute())
|
||||
var/err = query_check_option.ErrorMsg()
|
||||
log_game("SQL ERROR obtaining id from poll_option table. Error : \[[err]\]\n")
|
||||
if(!query_check_option.warn_execute())
|
||||
return
|
||||
if(query_check_option.NextRow())
|
||||
var/DBQuery/query_log_get = dbcon.NewQuery("SELECT polltype, question, adminonly FROM [format_table_name("poll_question")] WHERE id = [returned]")
|
||||
if(!query_log_get.Execute())
|
||||
var/err = query_log_get.ErrorMsg()
|
||||
log_game("SQL ERROR obtaining polltype, question, adminonly from poll_question table. Error : \[[err]\]\n")
|
||||
if(!query_log_get.warn_execute())
|
||||
return
|
||||
if(query_log_get.NextRow())
|
||||
var/polltype = query_log_get.item[1]
|
||||
@@ -26,11 +22,9 @@
|
||||
log_admin("[key_name(usr)] has created a new server poll. Poll type: [polltype] - Admin Only: [adminonly ? "Yes" : "No"] - Question: [question]")
|
||||
message_admins("[key_name_admin(usr)] has created a new server poll. Poll type: [polltype] - Admin Only: [adminonly ? "Yes" : "No"]<br>Question: [question]")
|
||||
else
|
||||
src << "Poll question created without any options, poll will be deleted."
|
||||
to_chat(src, "Poll question created without any options, poll will be deleted.")
|
||||
var/DBQuery/query_del_poll = dbcon.NewQuery("DELETE FROM [format_table_name("poll_question")] WHERE id = [returned]")
|
||||
if(!query_del_poll.Execute())
|
||||
var/err = query_del_poll.ErrorMsg()
|
||||
log_game("SQL ERROR deleting poll question [returned]. Error : \[[err]\]\n")
|
||||
if(!query_del_poll.warn_execute())
|
||||
return
|
||||
|
||||
/client/proc/create_poll_function()
|
||||
@@ -58,24 +52,20 @@
|
||||
return
|
||||
endtime = sanitizeSQL(endtime)
|
||||
var/DBQuery/query_validate_time = dbcon.NewQuery("SELECT STR_TO_DATE('[endtime]','%Y-%c-%d %T')")
|
||||
if(!query_validate_time.Execute())
|
||||
var/err = query_validate_time.ErrorMsg()
|
||||
log_game("SQL ERROR validating endtime. Error : \[[err]\]\n")
|
||||
if(!query_validate_time.warn_execute())
|
||||
return
|
||||
if(query_validate_time.NextRow())
|
||||
endtime = query_validate_time.item[1]
|
||||
if(!endtime)
|
||||
src << "Datetime entered is invalid."
|
||||
to_chat(src, "Datetime entered is invalid.")
|
||||
return
|
||||
var/DBQuery/query_time_later = dbcon.NewQuery("SELECT TIMESTAMP('[endtime]') < NOW()")
|
||||
if(!query_time_later.Execute())
|
||||
var/err = query_time_later.ErrorMsg()
|
||||
log_game("SQL ERROR comparing endtime to NOW(). Error : \[[err]\]\n")
|
||||
if(!query_time_later.warn_execute())
|
||||
return
|
||||
if(query_time_later.NextRow())
|
||||
var/checklate = text2num(query_time_later.item[1])
|
||||
if(checklate)
|
||||
src << "Datetime entered is not later than current server time."
|
||||
to_chat(src, "Datetime entered is not later than current server time.")
|
||||
return
|
||||
var/adminonly
|
||||
switch(alert("Admin only poll?",,"Yes","No","Cancel"))
|
||||
@@ -99,9 +89,7 @@
|
||||
return
|
||||
question = sanitizeSQL(question)
|
||||
var/DBQuery/query_polladd_question = dbcon.NewQuery("INSERT INTO [format_table_name("poll_question")] (polltype, starttime, endtime, question, adminonly, multiplechoiceoptions, createdby_ckey, createdby_ip, dontshow) VALUES ('[polltype]', '[starttime]', '[endtime]', '[question]', '[adminonly]', '[choice_amount]', '[sql_ckey]', INET_ATON('[address]'), '[dontshow]')")
|
||||
if(!query_polladd_question.Execute())
|
||||
var/err = query_polladd_question.ErrorMsg()
|
||||
log_game("SQL ERROR adding new poll question to table. Error : \[[err]\]\n")
|
||||
if(!query_polladd_question.warn_execute())
|
||||
return
|
||||
if(polltype == POLLTYPE_TEXT)
|
||||
log_admin("[key_name(usr)] has created a new server poll. Poll type: [polltype] - Admin Only: [adminonly ? "Yes" : "No"] - Question: [question]")
|
||||
@@ -109,9 +97,7 @@
|
||||
return
|
||||
var/pollid = 0
|
||||
var/DBQuery/query_get_id = dbcon.NewQuery("SELECT id FROM [format_table_name("poll_question")] WHERE question = '[question]' AND starttime = '[starttime]' AND endtime = '[endtime]' AND createdby_ckey = '[sql_ckey]' AND createdby_ip = INET_ATON('[address]')")
|
||||
if(!query_get_id.Execute())
|
||||
var/err = query_get_id.ErrorMsg()
|
||||
log_game("SQL ERROR obtaining id from poll_question table. Error : \[[err]\]\n")
|
||||
if(!query_get_id.warn_execute())
|
||||
return
|
||||
if(query_get_id.NextRow())
|
||||
pollid = query_get_id.item[1]
|
||||
@@ -143,7 +129,7 @@
|
||||
if(!maxval)
|
||||
return pollid
|
||||
if(minval >= maxval)
|
||||
src << "Minimum rating value can't be more than maximum rating value"
|
||||
to_chat(src, "Minimum rating value can't be more than maximum rating value")
|
||||
return pollid
|
||||
descmin = input("Optional: Set description for minimum rating","Minimum rating description") as message|null
|
||||
if(descmin)
|
||||
@@ -161,9 +147,7 @@
|
||||
else if(descmax == null)
|
||||
return pollid
|
||||
var/DBQuery/query_polladd_option = dbcon.NewQuery("INSERT INTO [format_table_name("poll_option")] (pollid, text, percentagecalc, minval, maxval, descmin, descmid, descmax) VALUES ('[pollid]', '[option]', '[percentagecalc]', '[minval]', '[maxval]', '[descmin]', '[descmid]', '[descmax]')")
|
||||
if(!query_polladd_option.Execute())
|
||||
var/err = query_polladd_option.ErrorMsg()
|
||||
log_game("SQL ERROR adding new poll option to table. Error : \[[err]\]\n")
|
||||
if(!query_polladd_option.warn_execute())
|
||||
return pollid
|
||||
switch(alert(" ",,"Add option","Finish", "Cancel"))
|
||||
if("Add option")
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
var/mob/dead/observer/ghost = pick_n_take(candidates)
|
||||
var/mob/living/body = pick_n_take(bodies)
|
||||
|
||||
body << "Your mob has been taken over by a ghost!"
|
||||
to_chat(body, "Your mob has been taken over by a ghost!")
|
||||
message_admins("[key_name_admin(ghost)] has taken control of ([key_name_admin(body)])")
|
||||
body.ghostize(0)
|
||||
body.key = ghost.key
|
||||
@@ -81,7 +81,7 @@
|
||||
var/turf/T = find_safe_turf()
|
||||
new /obj/effect/overlay/temp/gravpush(get_turf(M))
|
||||
M.forceMove(T)
|
||||
M << "<span class='notice'>Pop!</span>"
|
||||
to_chat(M, "<span class='notice'>Pop!</span>")
|
||||
|
||||
/obj/effect/station_crash
|
||||
name = "station crash"
|
||||
@@ -133,16 +133,16 @@
|
||||
else
|
||||
var/mob/living/L = M
|
||||
if(L.pulling && istype(L.pulling, /obj/item/bodypart/head))
|
||||
L << "Your offering is accepted. You may pass."
|
||||
to_chat(L, "Your offering is accepted. You may pass.")
|
||||
qdel(L.pulling)
|
||||
var/turf/LA = pick(warp_points)
|
||||
L.forceMove(LA)
|
||||
L.hallucination = 0
|
||||
L << "<span class='reallybig redtext'>The battle is won. Your bloodlust subsides.</span>"
|
||||
to_chat(L, "<span class='reallybig redtext'>The battle is won. Your bloodlust subsides.</span>")
|
||||
for(var/obj/item/weapon/twohanded/required/chainsaw/doomslayer/chainsaw in L)
|
||||
qdel(chainsaw)
|
||||
else
|
||||
L << "You are not yet worthy of passing. Drag a severed head to the barrier to be allowed entry to the hall of champions."
|
||||
to_chat(L, "You are not yet worthy of passing. Drag a severed head to the barrier to be allowed entry to the hall of champions.")
|
||||
|
||||
/obj/effect/landmark/shuttle_arena_safe
|
||||
name = "hall of champions"
|
||||
@@ -167,7 +167,7 @@
|
||||
var/obj/effect/landmark/LA = pick(warp_points)
|
||||
|
||||
M.forceMove(get_turf(LA))
|
||||
M << "<span class='reallybig redtext'>You're trapped in a deadly arena! To escape, you'll need to drag a severed head to the escape portals.</span>"
|
||||
to_chat(M, "<span class='reallybig redtext'>You're trapped in a deadly arena! To escape, you'll need to drag a severed head to the escape portals.</span>")
|
||||
spawn()
|
||||
var/obj/effect/mine/pickup/bloodbath/B = new(M)
|
||||
B.mineEffect(M)
|
||||
|
||||
@@ -8,6 +8,8 @@ var/list/admin_datums = list()
|
||||
|
||||
var/datum/marked_datum
|
||||
|
||||
var/spamcooldown = 0
|
||||
|
||||
var/admincaster_screen = 0 //TODO: remove all these 5 variables, they are completly unacceptable
|
||||
var/datum/newscaster/feed_message/admincaster_feed_message = new /datum/newscaster/feed_message
|
||||
var/datum/newscaster/wanted_message/admincaster_wanted_message = new /datum/newscaster/wanted_message
|
||||
@@ -16,13 +18,11 @@ var/list/admin_datums = list()
|
||||
|
||||
/datum/admins/New(datum/admin_rank/R, ckey)
|
||||
if(!ckey)
|
||||
spawn(0)
|
||||
del(src)
|
||||
QDEL_IN(src, 0)
|
||||
throw EXCEPTION("Admin datum created without a ckey")
|
||||
return
|
||||
if(!istype(R))
|
||||
spawn(0)
|
||||
del(src)
|
||||
QDEL_IN(src, 0)
|
||||
throw EXCEPTION("Admin datum created without a rank")
|
||||
return
|
||||
rank = R
|
||||
@@ -67,7 +67,7 @@ generally it would be used like so:
|
||||
|
||||
/proc/admin_proc()
|
||||
if(!check_rights(R_ADMIN)) return
|
||||
world << "you have enough rights!"
|
||||
to_chat(world, "you have enough rights!")
|
||||
|
||||
NOTE: it checks usr! not src! So if you're checking somebody's rank in a proc which they did not call
|
||||
you will have to do something like if(client.rights & R_ADMIN) yourself.
|
||||
@@ -78,7 +78,7 @@ you will have to do something like if(client.rights & R_ADMIN) yourself.
|
||||
return 1
|
||||
else
|
||||
if(show_msg)
|
||||
usr << "<font color='red'>Error: You do not have sufficient rights to do that. You require one of the following flags:[rights2text(rights_required," ")].</font>"
|
||||
to_chat(usr, "<font color='red'>Error: You do not have sufficient rights to do that. You require one of the following flags:[rights2text(rights_required," ")].</font>")
|
||||
return 0
|
||||
|
||||
//probably a bit iffy - will hopefully figure out a better solution
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
return cachedintel
|
||||
|
||||
if(dbcon.Connect())
|
||||
var/DBQuery/query = dbcon.NewQuery({"
|
||||
var/DBQuery/query_get_ip_intel = dbcon.NewQuery({"
|
||||
SELECT date, intel, TIMESTAMPDIFF(MINUTE,date,NOW())
|
||||
FROM [format_table_name("ipintel")]
|
||||
WHERE
|
||||
@@ -49,22 +49,22 @@
|
||||
date + INTERVAL [config.ipintel_save_bad] HOUR > NOW()
|
||||
))
|
||||
"})
|
||||
query.Execute()
|
||||
if (query.NextRow())
|
||||
if(!query_get_ip_intel.Execute())
|
||||
return
|
||||
if (query_get_ip_intel.NextRow())
|
||||
res.cache = TRUE
|
||||
res.cachedate = query.item[1]
|
||||
res.intel = text2num(query.item[2])
|
||||
res.cacheminutesago = text2num(query.item[3])
|
||||
res.cacherealtime = world.realtime - (text2num(query.item[3])*10*60)
|
||||
res.cachedate = query_get_ip_intel.item[1]
|
||||
res.intel = text2num(query_get_ip_intel.item[2])
|
||||
res.cacheminutesago = text2num(query_get_ip_intel.item[3])
|
||||
res.cacherealtime = world.realtime - (text2num(query_get_ip_intel.item[3])*10*60)
|
||||
SSipintel.cache[ip] = res
|
||||
return
|
||||
res.intel = ip_intel_query(ip)
|
||||
if (updatecache && res.intel >= 0)
|
||||
SSipintel.cache[ip] = res
|
||||
if(dbcon.Connect())
|
||||
var/DBQuery/query = dbcon.NewQuery("INSERT INTO [format_table_name("ipintel")] (ip, intel) VALUES (INET_ATON('[ip]'), [res.intel]) ON DUPLICATE KEY UPDATE intel = VALUES(intel), date = NOW()")
|
||||
query.Execute()
|
||||
return
|
||||
var/DBQuery/query_add_ip_intel = dbcon.NewQuery("INSERT INTO [format_table_name("ipintel")] (ip, intel) VALUES (INET_ATON('[ip]'), [res.intel]) ON DUPLICATE KEY UPDATE intel = VALUES(intel), date = NOW()")
|
||||
query_add_ip_intel.Execute()
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@
|
||||
return
|
||||
|
||||
if(!dbcon.Connect())
|
||||
usr << "<span class='danger'>Failed to establish database connection.</span>"
|
||||
to_chat(usr, "<span class='danger'>Failed to establish database connection.</span>")
|
||||
return
|
||||
|
||||
if(!adm_ckey || !new_rank)
|
||||
@@ -75,28 +75,33 @@
|
||||
if(!istext(adm_ckey) || !istext(new_rank))
|
||||
return
|
||||
|
||||
var/DBQuery/select_query = dbcon.NewQuery("SELECT id FROM [format_table_name("admin")] WHERE ckey = '[adm_ckey]'")
|
||||
select_query.Execute()
|
||||
var/DBQuery/query_get_admin = dbcon.NewQuery("SELECT id FROM [format_table_name("admin")] WHERE ckey = '[adm_ckey]'")
|
||||
if(!query_get_admin.warn_execute())
|
||||
return
|
||||
|
||||
var/new_admin = 1
|
||||
var/admin_id
|
||||
while(select_query.NextRow())
|
||||
while(query_get_admin.NextRow())
|
||||
new_admin = 0
|
||||
admin_id = text2num(select_query.item[1])
|
||||
admin_id = text2num(query_get_admin.item[1])
|
||||
|
||||
if(new_admin)
|
||||
var/DBQuery/insert_query = dbcon.NewQuery("INSERT INTO `[format_table_name("admin")]` (`id`, `ckey`, `rank`, `level`, `flags`) VALUES (null, '[adm_ckey]', '[new_rank]', -1, 0)")
|
||||
insert_query.Execute()
|
||||
var/DBQuery/log_query = dbcon.NewQuery("INSERT INTO `[format_table_name("admin_log")]` (`id` ,`datetime` ,`adminckey` ,`adminip` ,`log` ) VALUES (NULL , NOW( ) , '[usr.ckey]', '[usr.client.address]', 'Added new admin [adm_ckey] to rank [new_rank]');")
|
||||
log_query.Execute()
|
||||
usr << "<span class='adminnotice'>New admin added.</span>"
|
||||
var/DBQuery/query_add_admin = dbcon.NewQuery("INSERT INTO `[format_table_name("admin")]` (`id`, `ckey`, `rank`, `level`, `flags`) VALUES (null, '[adm_ckey]', '[new_rank]', -1, 0)")
|
||||
if(!query_add_admin.warn_execute())
|
||||
return
|
||||
var/DBQuery/query_add_admin_log = dbcon.NewQuery("INSERT INTO `[format_table_name("admin_log")]` (`id` ,`datetime` ,`adminckey` ,`adminip` ,`log` ) VALUES (NULL , NOW( ) , '[usr.ckey]', '[usr.client.address]', 'Added new admin [adm_ckey] to rank [new_rank]');")
|
||||
if(!query_add_admin_log.warn_execute())
|
||||
return
|
||||
to_chat(usr, "<span class='adminnotice'>New admin added.</span>")
|
||||
else
|
||||
if(!isnull(admin_id) && isnum(admin_id))
|
||||
var/DBQuery/insert_query = dbcon.NewQuery("UPDATE `[format_table_name("admin")]` SET rank = '[new_rank]' WHERE id = [admin_id]")
|
||||
insert_query.Execute()
|
||||
var/DBQuery/log_query = dbcon.NewQuery("INSERT INTO `[format_table_name("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 << "<span class='adminnnotice'>Admin rank changed.</span>"
|
||||
var/DBQuery/query_change_admin = dbcon.NewQuery("UPDATE `[format_table_name("admin")]` SET rank = '[new_rank]' WHERE id = [admin_id]")
|
||||
if(!query_change_admin.warn_execute())
|
||||
return
|
||||
var/DBQuery/query_change_admin_log = dbcon.NewQuery("INSERT INTO `[format_table_name("admin_log")]` (`id` ,`datetime` ,`adminckey` ,`adminip` ,`log` ) VALUES (NULL , NOW( ) , '[usr.ckey]', '[usr.client.address]', 'Edited the rank of [adm_ckey] to [new_rank]');")
|
||||
if(!query_change_admin_log.warn_execute())
|
||||
return
|
||||
to_chat(usr, "<span class='adminnnotice'>Admin rank changed.</span>")
|
||||
|
||||
|
||||
/datum/admins/proc/log_admin_permission_modification(adm_ckey, new_permission)
|
||||
@@ -108,23 +113,25 @@
|
||||
return
|
||||
|
||||
if(!dbcon.Connect())
|
||||
usr << "<span class='danger'>Failed to establish database connection.</span>"
|
||||
to_chat(usr, "<span class='danger'>Failed to establish database connection.</span>")
|
||||
return
|
||||
|
||||
if(!adm_ckey || !istext(adm_ckey) || !isnum(new_permission))
|
||||
return
|
||||
|
||||
var/DBQuery/select_query = dbcon.NewQuery("SELECT id, flags FROM [format_table_name("admin")] WHERE ckey = '[adm_ckey]'")
|
||||
select_query.Execute()
|
||||
var/DBQuery/query_get_perms = dbcon.NewQuery("SELECT id, flags FROM [format_table_name("admin")] WHERE ckey = '[adm_ckey]'")
|
||||
if(!query_get_perms.warn_execute())
|
||||
return
|
||||
|
||||
var/admin_id
|
||||
while(select_query.NextRow())
|
||||
admin_id = text2num(select_query.item[1])
|
||||
while(query_get_perms.NextRow())
|
||||
admin_id = text2num(query_get_perms.item[1])
|
||||
|
||||
if(!admin_id)
|
||||
return
|
||||
|
||||
var/DBQuery/insert_query = dbcon.NewQuery("UPDATE `[format_table_name("admin")]` SET flags = [new_permission] WHERE id = [admin_id]")
|
||||
insert_query.Execute()
|
||||
var/DBQuery/log_query = dbcon.NewQuery("INSERT INTO `[format_table_name("admin_log")]` (`id` ,`datetime` ,`adminckey` ,`adminip` ,`log` ) VALUES (NULL , NOW( ) , '[usr.ckey]', '[usr.client.address]', 'Edit permission [rights2text(new_permission)] (flag = [new_permission]) to admin [adm_ckey]');")
|
||||
log_query.Execute()
|
||||
var/DBQuery/query_change_perms = dbcon.NewQuery("UPDATE `[format_table_name("admin")]` SET flags = [new_permission] WHERE id = [admin_id]")
|
||||
if(!query_change_perms.warn_execute())
|
||||
return
|
||||
var/DBQuery/query_change_perms_log = dbcon.NewQuery("INSERT INTO `[format_table_name("admin_log")]` (`id` ,`datetime` ,`adminckey` ,`adminip` ,`log` ) VALUES (NULL , NOW( ) , '[usr.ckey]', '[usr.client.address]', 'Edit permission [rights2text(new_permission)] (flag = [new_permission]) to admin [adm_ckey]');")
|
||||
query_change_perms_log.warn_execute()
|
||||
|
||||
@@ -349,12 +349,16 @@
|
||||
var/brains = 0
|
||||
var/other_players = 0
|
||||
var/living_skipped = 0
|
||||
var/drones = 0
|
||||
for(var/mob/M in mob_list)
|
||||
if(M.ckey)
|
||||
if(isnewplayer(M))
|
||||
lobby_players++
|
||||
continue
|
||||
else if(M.stat != DEAD && M.mind && !isbrain(M))
|
||||
if(isdrone(M))
|
||||
drones++
|
||||
continue
|
||||
if(M.z == ZLEVEL_CENTCOM)
|
||||
living_skipped++
|
||||
continue
|
||||
@@ -373,7 +377,7 @@
|
||||
other_players++
|
||||
dat += "<BR><b><font color='blue' size='3'>Players:|[connected_players - lobby_players] ingame|[connected_players] connected|[lobby_players] lobby|</font></b>"
|
||||
dat += "<BR><b><font color='green'>Living Players:|[living_players_connected] active|[living_players - living_players_connected] disconnected|[living_players_antagonist] antagonists|</font></b>"
|
||||
dat += "<BR><b><font color='#bf42f4'>SKIPPED \[On centcom Z-level\]: [living_skipped] living players|</font></b>"
|
||||
dat += "<BR><b><font color='#bf42f4'>SKIPPED \[On centcom Z-level\]: [living_skipped] living players|[drones] living drones|</font></b>"
|
||||
dat += "<BR><b><font color='red'>Dead/Observing players:|[observers_connected] active|[observers - observers_connected] disconnected|[brains] brains|</font></b>"
|
||||
if(other_players)
|
||||
dat += "<BR><span class='userdanger'>[other_players] players in invalid state or the statistics code is bugged!</span>"
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
<A href='?src=\ref[src];secrets=list_job_debug'>Show Job Debug</A><BR>
|
||||
<A href='?src=\ref[src];secrets=admin_log'>Admin Log</A><BR>
|
||||
<A href='?src=\ref[src];secrets=show_admins'>Show Admin List</A><BR>
|
||||
<A href='?src=\ref[src];secrets=mentor_log'>Mentor Log</A><BR>
|
||||
<BR>
|
||||
"}
|
||||
|
||||
@@ -29,11 +28,13 @@
|
||||
<A href='?src=\ref[src];secrets=fingerprints'>List Fingerprints</A><BR>
|
||||
<A href='?src=\ref[src];secrets=ctfbutton'>Enable/Disable CTF</A><BR><BR>
|
||||
<A href='?src=\ref[src];secrets=tdomereset'>Reset Thunderdome to default state</A><BR>
|
||||
<A href='?src=\ref[src];secrets=set_name'>Rename Station Name</A><BR>
|
||||
<A href='?src=\ref[src];secrets=reset_name'>Reset Station Name</A><BR>
|
||||
<BR>
|
||||
<B>Shuttles</B><BR>
|
||||
<BR>
|
||||
<A href='?src=\ref[src];secrets=moveferry'>Move Ferry</A><BR>
|
||||
<A href='?src=\ref[src];secrets=togglearrivals'>Toggle Arrivals Ferry</A><BR>
|
||||
<A href='?src=\ref[src];secrets=moveminingshuttle'>Move Mining Shuttle</A><BR>
|
||||
<A href='?src=\ref[src];secrets=movelaborshuttle'>Move Labor Shuttle</A><BR>
|
||||
<BR>
|
||||
@@ -149,14 +150,25 @@
|
||||
message_admins("[key_name_admin(usr)] has cured all diseases.")
|
||||
for(var/datum/disease/D in SSdisease.processing)
|
||||
D.cure(D)
|
||||
if("set_name")
|
||||
if(!check_rights(R_ADMIN))
|
||||
return
|
||||
var/new_name = input(usr, "Please input a new name for the station.", "What?", "") as text|null
|
||||
if(!new_name)
|
||||
return
|
||||
change_station_name(new_name)
|
||||
log_admin("[key_name(usr)] renamed the station to \"[new_name]\".")
|
||||
message_admins("<span class='adminnotice'>[key_name_admin(usr)] renamed the station to: [new_name].</span>")
|
||||
priority_announce("[command_name()] has renamed the station to \"[new_name]\".")
|
||||
|
||||
if("reset_name")
|
||||
if(!check_rights(R_ADMIN))
|
||||
return
|
||||
world.name = new_station_name()
|
||||
station_name = world.name
|
||||
var/new_name = new_station_name()
|
||||
change_station_name(new_name)
|
||||
log_admin("[key_name(usr)] reset the station name.")
|
||||
message_admins("<span class='adminnotice'>[key_name_admin(usr)] reset the station name.</span>")
|
||||
priority_announce("[command_name()] has renamed the station to \"[new_name]\".")
|
||||
|
||||
if("list_bombers")
|
||||
if(!check_rights(R_ADMIN))
|
||||
@@ -208,7 +220,20 @@
|
||||
if(!SSshuttle.toggleShuttle("ferry","ferry_home","ferry_away"))
|
||||
message_admins("[key_name_admin(usr)] moved the centcom ferry")
|
||||
log_admin("[key_name(usr)] moved the centcom ferry")
|
||||
|
||||
|
||||
if("togglearrivals")
|
||||
if(!check_rights(R_ADMIN))
|
||||
return
|
||||
var/obj/docking_port/mobile/arrivals/A = SSshuttle.arrivals
|
||||
if(A)
|
||||
var/new_perma = !A.perma_docked
|
||||
A.perma_docked = new_perma
|
||||
feedback_inc("admin_secrets_fun_used",1)
|
||||
feedback_add_details("admin_secrets_fun_used","ShA[new_perma ? "s" : "g"]")
|
||||
message_admins("[key_name_admin(usr)] [new_perma ? "stopped" : "started"] the arrivals shuttle")
|
||||
log_admin("[key_name(usr)] [new_perma ? "stopped" : "started"] the arrivals shuttle")
|
||||
else
|
||||
to_chat(usr, "<span class='admin'>There is no arrivals shuttle</span>")
|
||||
if("showailaws")
|
||||
if(!check_rights(R_ADMIN))
|
||||
return
|
||||
@@ -417,7 +442,7 @@
|
||||
H.equip_to_slot_or_del(I, slot_w_uniform)
|
||||
I.flags |= NODROP
|
||||
else
|
||||
H << "You're not kawaii enough for this."
|
||||
to_chat(H, "You're not kawaii enough for this.")
|
||||
|
||||
if("whiteout")
|
||||
if(!check_rights(R_FUN))
|
||||
@@ -453,7 +478,7 @@
|
||||
feedback_inc("admin_secrets_fun_used",1)
|
||||
feedback_add_details("admin_secrets_fun_used","RET")
|
||||
for(var/mob/living/carbon/human/H in player_list)
|
||||
H << "<span class='boldannounce'>You suddenly feel stupid.</span>"
|
||||
to_chat(H, "<span class='boldannounce'>You suddenly feel stupid.</span>")
|
||||
H.setBrainLoss(60)
|
||||
message_admins("[key_name_admin(usr)] made everybody retarded")
|
||||
|
||||
@@ -578,11 +603,7 @@
|
||||
if("ctfbutton")
|
||||
if(!check_rights(R_ADMIN))
|
||||
return
|
||||
var/ctf_enabled = FALSE
|
||||
for(var/obj/machinery/capture_the_flag/CTF in machines)
|
||||
ctf_enabled = CTF.toggle_ctf()
|
||||
message_admins("[key_name_admin(usr)] has [ctf_enabled? "enabled" : "disabled"] CTF!")
|
||||
notify_ghosts("CTF has been [ctf_enabled? "enabled" : "disabled"]!",'sound/effects/ghost2.ogg')
|
||||
toggle_all_ctf(usr)
|
||||
if("masspurrbation")
|
||||
if(!check_rights(R_FUN))
|
||||
return
|
||||
@@ -598,14 +619,6 @@
|
||||
purrbation.")
|
||||
log_admin("[key_name(usr)] has removed everyone from purrbation.")
|
||||
|
||||
if("mentor_log")
|
||||
var/dat = "<B>Mentor Log<HR></B>"
|
||||
for(var/l in mentor_log)
|
||||
dat += "<li>[l]</li>"
|
||||
if(!mentor_log.len)
|
||||
dat += "No mentors have done anything this round!"
|
||||
usr << browse(dat, "window=mentor_log")
|
||||
|
||||
if(E)
|
||||
E.processing = 0
|
||||
if(E.announceWhen>0)
|
||||
@@ -615,4 +628,4 @@
|
||||
if (usr)
|
||||
log_admin("[key_name(usr)] used secret [item]")
|
||||
if (ok)
|
||||
world << text("<B>A secret has been activated by []!</B>", usr.key)
|
||||
to_chat(world, text("<B>A secret has been activated by []!</B>", usr.key))
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/proc/create_message(type, target_ckey, admin_ckey, text, timestamp, server, secret, logged = 1, browse)
|
||||
if(!dbcon.IsConnected())
|
||||
usr << "<span class='danger'>Failed to establish database connection.</span>"
|
||||
to_chat(usr, "<span class='danger'>Failed to establish database connection.</span>")
|
||||
return
|
||||
if(!type)
|
||||
return
|
||||
@@ -10,9 +10,7 @@
|
||||
return
|
||||
new_ckey = sanitizeSQL(new_ckey)
|
||||
var/DBQuery/query_find_ckey = dbcon.NewQuery("SELECT ckey FROM [format_table_name("player")] WHERE ckey = '[new_ckey]'")
|
||||
if(!query_find_ckey.Execute())
|
||||
var/err = query_find_ckey.ErrorMsg()
|
||||
log_game("SQL ERROR obtaining ckey from player table. Error : \[[err]\]\n")
|
||||
if(!query_find_ckey.warn_execute())
|
||||
return
|
||||
if(!query_find_ckey.NextRow())
|
||||
if(alert(usr, "[new_ckey] has not been seen before, are you sure you want to create a [type] for them?", "Unknown ckey", "Yes", "No", "Cancel") != "Yes")
|
||||
@@ -47,9 +45,7 @@
|
||||
else
|
||||
return
|
||||
var/DBQuery/query_create_message = dbcon.NewQuery("INSERT INTO [format_table_name("messages")] (type, targetckey, adminckey, text, timestamp, server, secret) VALUES ('[type]', '[target_ckey]', '[admin_ckey]', '[text]', '[timestamp]', '[server]', '[secret]')")
|
||||
if(!query_create_message.Execute())
|
||||
var/err = query_create_message.ErrorMsg()
|
||||
log_game("SQL ERROR creating new [type] in messages table. Error : \[[err]\]\n")
|
||||
if(!query_create_message.warn_execute())
|
||||
return
|
||||
if(logged)
|
||||
log_admin_private("[key_name(usr)] has created a [type][(type == "note" || type == "message" || type == "watchlist entry") ? " for [target_ckey]" : ""]: [text]")
|
||||
@@ -61,7 +57,7 @@
|
||||
|
||||
/proc/delete_message(message_id, logged = 1, browse)
|
||||
if(!dbcon.IsConnected())
|
||||
usr << "<span class='danger'>Failed to establish database connection.</span>"
|
||||
to_chat(usr, "<span class='danger'>Failed to establish database connection.</span>")
|
||||
return
|
||||
message_id = text2num(message_id)
|
||||
if(!message_id)
|
||||
@@ -70,18 +66,14 @@
|
||||
var/target_ckey
|
||||
var/text
|
||||
var/DBQuery/query_find_del_message = dbcon.NewQuery("SELECT type, targetckey, adminckey, text FROM [format_table_name("messages")] WHERE id = [message_id]")
|
||||
if(!query_find_del_message.Execute())
|
||||
var/err = query_find_del_message.ErrorMsg()
|
||||
log_game("SQL ERROR obtaining type, targetckey, adminckey text from messages table. Error : \[[err]\]\n")
|
||||
if(!query_find_del_message.warn_execute())
|
||||
return
|
||||
if(query_find_del_message.NextRow())
|
||||
type = query_find_del_message.item[1]
|
||||
target_ckey = query_find_del_message.item[2]
|
||||
text = query_find_del_message.item[4]
|
||||
var/DBQuery/query_del_message = dbcon.NewQuery("DELETE FROM [format_table_name("messages")] WHERE id = [message_id]")
|
||||
if(!query_del_message.Execute())
|
||||
var/err = query_del_message.ErrorMsg()
|
||||
log_game("SQL ERROR deleting [type] from messages table. Error : \[[err]\]\n")
|
||||
if(!query_del_message.warn_execute())
|
||||
return
|
||||
if(logged)
|
||||
log_admin_private("[key_name(usr)] has deleted a [type][(type == "note" || type == "message" || type == "watchlist entry") ? " for" : " made by"] [target_ckey]: [text]")
|
||||
@@ -93,15 +85,13 @@
|
||||
|
||||
/proc/edit_message(message_id, browse)
|
||||
if(!dbcon.IsConnected())
|
||||
usr << "<span class='danger'>Failed to establish database connection.</span>"
|
||||
to_chat(usr, "<span class='danger'>Failed to establish database connection.</span>")
|
||||
return
|
||||
message_id = text2num(message_id)
|
||||
if(!message_id)
|
||||
return
|
||||
var/DBQuery/query_find_edit_message = dbcon.NewQuery("SELECT type, targetckey, adminckey, text FROM [format_table_name("messages")] WHERE id = [message_id]")
|
||||
if(!query_find_edit_message.Execute())
|
||||
var/err = query_find_edit_message.ErrorMsg()
|
||||
log_game("SQL ERROR obtaining type, targetckey, adminckey, text from messages table. Error : \[[err]\]\n")
|
||||
if(!query_find_edit_message.warn_execute())
|
||||
return
|
||||
if(query_find_edit_message.NextRow())
|
||||
var/type = query_find_edit_message.item[1]
|
||||
@@ -115,9 +105,7 @@
|
||||
new_text = sanitizeSQL(new_text)
|
||||
var/edit_text = sanitizeSQL("Edited by [editor_ckey] on [SQLtime()] from<br>[old_text]<br>to<br>[new_text]<hr>")
|
||||
var/DBQuery/query_edit_message = dbcon.NewQuery("UPDATE [format_table_name("messages")] SET text = '[new_text]', lasteditor = '[editor_ckey]', edits = CONCAT(IFNULL(edits,''),'[edit_text]') WHERE id = [message_id]")
|
||||
if(!query_edit_message.Execute())
|
||||
var/err = query_edit_message.ErrorMsg()
|
||||
log_game("SQL ERROR editing messages table. Error : \[[err]\]\n")
|
||||
if(!query_edit_message.warn_execute())
|
||||
return
|
||||
log_admin_private("[key_name(usr)] has edited a [type] [(type == "note" || type == "message" || type == "watchlist entry") ? " for [target_ckey]" : ""] made by [admin_ckey] from [old_text] to [new_text]")
|
||||
message_admins("[key_name_admin(usr)] has edited a [type] [(type == "note" || type == "message" || type == "watchlist entry") ? " for [target_ckey]" : ""] made by [admin_ckey] from<br>[old_text]<br>to<br>[new_text]")
|
||||
@@ -128,15 +116,13 @@
|
||||
|
||||
/proc/toggle_message_secrecy(message_id)
|
||||
if(!dbcon.IsConnected())
|
||||
usr << "<span class='danger'>Failed to establish database connection.</span>"
|
||||
to_chat(usr, "<span class='danger'>Failed to establish database connection.</span>")
|
||||
return
|
||||
message_id = text2num(message_id)
|
||||
if(!message_id)
|
||||
return
|
||||
var/DBQuery/query_find_message_secret = dbcon.NewQuery("SELECT type, targetckey, adminckey, secret FROM [format_table_name("messages")] WHERE id = [message_id]")
|
||||
if(!query_find_message_secret.Execute())
|
||||
var/err = query_find_message_secret.ErrorMsg()
|
||||
log_game("SQL ERROR obtaining type, targetckey, adminckey, secret from messages table. Error : \[[err]\]\n")
|
||||
if(!query_find_message_secret.warn_execute())
|
||||
return
|
||||
if(query_find_message_secret.NextRow())
|
||||
var/type = query_find_message_secret.item[1]
|
||||
@@ -146,9 +132,7 @@
|
||||
var/editor_ckey = sanitizeSQL(usr.ckey)
|
||||
var/edit_text = "Made [secret ? "not secret" : "secret"] by [editor_ckey] on [SQLtime()]<hr>"
|
||||
var/DBQuery/query_message_secret = dbcon.NewQuery("UPDATE [format_table_name("messages")] SET secret = NOT secret, lasteditor = '[editor_ckey]', edits = CONCAT(IFNULL(edits,''),'[edit_text]') WHERE id = [message_id]")
|
||||
if(!query_message_secret.Execute())
|
||||
var/err = query_message_secret.ErrorMsg()
|
||||
log_game("SQL ERROR toggling message secrecy. Error : \[[err]\]\n")
|
||||
if(!query_message_secret.warn_execute())
|
||||
return
|
||||
log_admin_private("[key_name(usr)] has toggled [target_ckey]'s [type] made by [admin_ckey] to [secret ? "not secret" : "secret"]")
|
||||
message_admins("[key_name_admin(usr)] has toggled [target_ckey]'s [type] made by [admin_ckey] to [secret ? "not secret" : "secret"]")
|
||||
@@ -156,7 +140,7 @@
|
||||
|
||||
/proc/browse_messages(type, target_ckey, index, linkless = 0, filter)
|
||||
if(!dbcon.IsConnected())
|
||||
usr << "<span class='danger'>Failed to establish database connection.</span>"
|
||||
to_chat(usr, "<span class='danger'>Failed to establish database connection.</span>")
|
||||
return
|
||||
var/output
|
||||
var/ruler = "<hr style='background:#000000; border:0; height:3px'>"
|
||||
@@ -183,9 +167,7 @@
|
||||
output += "|<a href='?_src_=holder;showwatchfilter=1'>\[Filter offline clients\]</a></center>"
|
||||
output += ruler
|
||||
var/DBQuery/query_get_type_messages = dbcon.NewQuery("SELECT id, targetckey, adminckey, text, timestamp, server, lasteditor FROM [format_table_name("messages")] WHERE type = '[type]'")
|
||||
if(!query_get_type_messages.Execute())
|
||||
var/err = query_get_type_messages.ErrorMsg()
|
||||
log_game("SQL ERROR obtaining id, targetckey, adminckey, text, timestamp, server, lasteditor from messages table. Error : \[[err]\]\n")
|
||||
if(!query_get_type_messages.warn_execute())
|
||||
return
|
||||
while(query_get_type_messages.NextRow())
|
||||
var/id = query_get_type_messages.item[1]
|
||||
@@ -208,10 +190,8 @@
|
||||
output += "<br>[text]<hr style='background:#000000; border:0; height:1px'>"
|
||||
if(target_ckey)
|
||||
target_ckey = sanitizeSQL(target_ckey)
|
||||
var/DBQuery/query_get_messages = dbcon.NewQuery("SELECT type, secret, id, adminckey, text, timestamp, server, lasteditor FROM [format_table_name("messages")] WHERE type <> 'memo' AND targetckey = '[target_ckey]' ORDER BY timestamp")
|
||||
if(!query_get_messages.Execute())
|
||||
var/err = query_get_messages.ErrorMsg()
|
||||
log_game("SQL ERROR obtaining type, secret, id, adminckey, text, timestamp, server, lasteditor from messages table. Error : \[[err]\]\n")
|
||||
var/DBQuery/query_get_messages = dbcon.NewQuery("SELECT type, secret, id, adminckey, text, timestamp, server, lasteditor FROM [format_table_name("messages")] WHERE type <> 'memo' AND targetckey = '[target_ckey]' ORDER BY timestamp DESC")
|
||||
if(!query_get_messages.warn_execute())
|
||||
return
|
||||
var/messagedata
|
||||
var/watchdata
|
||||
@@ -286,9 +266,7 @@
|
||||
else
|
||||
search = "^[index]"
|
||||
var/DBQuery/query_list_messages = dbcon.NewQuery("SELECT DISTINCT targetckey FROM [format_table_name("messages")] WHERE type <> 'memo' AND targetckey REGEXP '[search]' ORDER BY targetckey")
|
||||
if(!query_list_messages.Execute())
|
||||
var/err = query_list_messages.ErrorMsg()
|
||||
log_game("SQL ERROR obtaining distinct targetckey from messages table. Error : \[[err]\]\n")
|
||||
if(!query_list_messages.warn_execute())
|
||||
return
|
||||
while(query_list_messages.NextRow())
|
||||
index_ckey = query_list_messages.item[1]
|
||||
@@ -300,7 +278,7 @@
|
||||
|
||||
proc/get_message_output(type, target_ckey)
|
||||
if(!dbcon.IsConnected())
|
||||
usr << "<span class='danger'>Failed to establish database connection.</span>"
|
||||
to_chat(usr, "<span class='danger'>Failed to establish database connection.</span>")
|
||||
return
|
||||
if(!type)
|
||||
return
|
||||
@@ -311,9 +289,7 @@ proc/get_message_output(type, target_ckey)
|
||||
if(type == "message" || type == "watchlist entry")
|
||||
query += " AND targetckey = '[target_ckey]'"
|
||||
var/DBQuery/query_get_message_output = dbcon.NewQuery(query)
|
||||
if(!query_get_message_output.Execute())
|
||||
var/err = query_get_message_output.ErrorMsg()
|
||||
log_game("SQL ERROR obtaining id, adminckey, text, timestamp, lasteditor from messages table. Error : \[[err]\]\n")
|
||||
if(!query_get_message_output.warn_execute())
|
||||
return
|
||||
while(query_get_message_output.NextRow())
|
||||
var/message_id = query_get_message_output.item[1]
|
||||
@@ -326,13 +302,11 @@ proc/get_message_output(type, target_ckey)
|
||||
output += "<font color='red' size='3'><b>Admin message left by <span class='prefix'>[admin_ckey]</span> on [timestamp]</b></font>"
|
||||
output += "<br><font color='red'>[text]</font><br>"
|
||||
var/DBQuery/query_message_read = dbcon.NewQuery("UPDATE [format_table_name("messages")] SET type = 'message sent' WHERE id = [message_id]")
|
||||
if(!query_message_read.Execute())
|
||||
var/err = query_message_read.ErrorMsg()
|
||||
log_game("SQL ERROR updating message type. Error : \[[err]\]\n")
|
||||
if(!query_message_read.warn_execute())
|
||||
return
|
||||
if("watchlist entry")
|
||||
message_admins("<font color='red'><B>Notice: </B></font><font color='blue'>[key_name_admin(target_ckey)] is on the watchlist and has just connected - Reason: [text]</font>")
|
||||
send2irc("Watchlist", "[key_name(target_ckey)] is on the watchlist and has just connected - Reason: [text]")
|
||||
send2irc_adminless_only("Watchlist", "[key_name(target_ckey)] is on the watchlist and has just connected - Reason: [text]")
|
||||
if("memo")
|
||||
output += "<span class='memo'>Memo by <span class='prefix'>[admin_ckey]</span> on [timestamp]"
|
||||
if(editor_ckey)
|
||||
@@ -361,8 +335,6 @@ proc/get_message_output(type, target_ckey)
|
||||
var/admin_ckey = note.group[3]
|
||||
var/DBQuery/query_convert_time = dbcon.NewQuery("SELECT ADDTIME(STR_TO_DATE('[timestamp]','%d-%b-%Y'), '0')")
|
||||
if(!query_convert_time.Execute())
|
||||
var/err = query_convert_time.ErrorMsg()
|
||||
log_game("SQL ERROR converting timestamp. Error : \[[err]\]\n")
|
||||
return
|
||||
if(query_convert_time.NextRow())
|
||||
timestamp = query_convert_time.item[1]
|
||||
@@ -374,7 +346,7 @@ proc/get_message_output(type, target_ckey)
|
||||
/*alternatively this proc can be run once to pass through every note and attempt to convert it before deleting the file, if done then AUTOCONVERT_NOTES should be turned off
|
||||
this proc can take several minutes to execute fully if converting and cause DD to hang if converting a lot of notes; it's not advised to do so while a server is live
|
||||
/proc/mass_convert_notes()
|
||||
world << "Beginning mass note conversion"
|
||||
to_chat(world, "Beginning mass note conversion")
|
||||
var/savefile/notesfile = new(NOTESFILE)
|
||||
if(!notesfile)
|
||||
log_game("Error: Cannot access [NOTESFILE]")
|
||||
@@ -382,7 +354,7 @@ this proc can take several minutes to execute fully if converting and cause DD t
|
||||
notesfile.cd = "/"
|
||||
for(var/ckey in notesfile.dir)
|
||||
convert_notes_sql(ckey)
|
||||
world << "Deleting NOTESFILE"
|
||||
to_chat(world, "Deleting NOTESFILE")
|
||||
fdel(NOTESFILE)
|
||||
world << "Finished mass note conversion, remember to turn off AUTOCONVERT_NOTES"*/
|
||||
to_chat(world, "Finished mass note conversion, remember to turn off AUTOCONVERT_NOTES")*/
|
||||
#undef NOTESFILE
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
ban["ckey"] = ckey
|
||||
|
||||
if (get_stickyban_from_ckey(ckey))
|
||||
usr << "<span class='adminnotice'>Error: Can not add a stickyban: User already has a current sticky ban</span>"
|
||||
to_chat(usr, "<span class='adminnotice'>Error: Can not add a stickyban: User already has a current sticky ban</span>")
|
||||
|
||||
if (data["reason"])
|
||||
ban["message"] = data["reason"]
|
||||
@@ -43,12 +43,12 @@
|
||||
|
||||
var/ban = get_stickyban_from_ckey(ckey)
|
||||
if (!ban)
|
||||
usr << "<span class='adminnotice'>Error: No sticky ban for [ckey] found!</span>"
|
||||
to_chat(usr, "<span class='adminnotice'>Error: No sticky ban for [ckey] found!</span>")
|
||||
return
|
||||
if (alert("Are you sure you want to remove the sticky ban on [ckey]?","Are you sure","Yes","No") == "No")
|
||||
return
|
||||
if (!get_stickyban_from_ckey(ckey))
|
||||
usr << "<span class='adminnotice'>Error: The ban disappeared.</span>"
|
||||
to_chat(usr, "<span class='adminnotice'>Error: The ban disappeared.</span>")
|
||||
return
|
||||
world.SetConfig("ban",ckey, null)
|
||||
|
||||
@@ -64,7 +64,7 @@
|
||||
var/alt = ckey(data["alt"])
|
||||
var/ban = get_stickyban_from_ckey(ckey)
|
||||
if (!ban)
|
||||
usr << "<span class='adminnotice'>Error: No sticky ban for [ckey] found!</span>"
|
||||
to_chat(usr, "<span class='adminnotice'>Error: No sticky ban for [ckey] found!</span>")
|
||||
return
|
||||
|
||||
var/found = 0
|
||||
@@ -75,7 +75,7 @@
|
||||
break
|
||||
|
||||
if (!found)
|
||||
usr << "<span class='adminnotice'>Error: [alt] is not linked to [ckey]'s sticky ban!</span>"
|
||||
to_chat(usr, "<span class='adminnotice'>Error: [alt] is not linked to [ckey]'s sticky ban!</span>")
|
||||
return
|
||||
|
||||
if (alert("Are you sure you want to disassociate [alt] from [ckey]'s sticky ban? \nNote: Nothing stops byond from re-linking them","Are you sure","Yes","No") == "No")
|
||||
@@ -84,7 +84,7 @@
|
||||
//we have to do this again incase something changes
|
||||
ban = get_stickyban_from_ckey(ckey)
|
||||
if (!ban)
|
||||
usr << "<span class='adminnotice'>Error: The ban disappeared.</span>"
|
||||
to_chat(usr, "<span class='adminnotice'>Error: The ban disappeared.</span>")
|
||||
return
|
||||
|
||||
found = 0
|
||||
@@ -95,7 +95,7 @@
|
||||
break
|
||||
|
||||
if (!found)
|
||||
usr << "<span class='adminnotice'>Error: [alt] link to [ckey]'s sticky ban disappeared.</span>"
|
||||
to_chat(usr, "<span class='adminnotice'>Error: [alt] link to [ckey]'s sticky ban disappeared.</span>")
|
||||
return
|
||||
|
||||
world.SetConfig("ban",ckey,list2stickyban(ban))
|
||||
@@ -109,7 +109,7 @@
|
||||
var/ckey = data["ckey"]
|
||||
var/ban = get_stickyban_from_ckey(ckey)
|
||||
if (!ban)
|
||||
usr << "<span class='adminnotice'>Error: No sticky ban for [ckey] found!"
|
||||
to_chat(usr, "<span class='adminnotice'>Error: No sticky ban for [ckey] found!")
|
||||
return
|
||||
var/oldreason = ban["message"]
|
||||
var/reason = input(usr,"Reason","Reason","[ban["message"]]") as text|null
|
||||
@@ -118,7 +118,7 @@
|
||||
//we have to do this again incase something changed while we waited for input
|
||||
ban = get_stickyban_from_ckey(ckey)
|
||||
if (!ban)
|
||||
usr << "<span class='adminnotice'>Error: The ban disappeared.</span>"
|
||||
to_chat(usr, "<span class='adminnotice'>Error: The ban disappeared.</span>")
|
||||
return
|
||||
ban["message"] = "[reason]"
|
||||
|
||||
@@ -135,11 +135,11 @@
|
||||
return
|
||||
var/ban = get_stickyban_from_ckey(ckey)
|
||||
if (!ban)
|
||||
usr << "<span class='adminnotice'>Error: No sticky ban for [ckey] found!"
|
||||
to_chat(usr, "<span class='adminnotice'>Error: No sticky ban for [ckey] found!")
|
||||
return
|
||||
var/cached_ban = SSstickyban.cache[ckey]
|
||||
if (!cached_ban)
|
||||
usr << "<span class='adminnotice'>Error: No cached sticky ban for [ckey] found!"
|
||||
to_chat(usr, "<span class='adminnotice'>Error: No cached sticky ban for [ckey] found!")
|
||||
world.SetConfig("ban",ckey,null)
|
||||
|
||||
log_admin_private("[key_name(usr)] has reverted [ckey]'s sticky ban to it's state at round start.")
|
||||
|
||||
+129
-111
@@ -6,6 +6,9 @@
|
||||
log_admin("[key_name(usr)] tried to use the admin panel without authorization.")
|
||||
return
|
||||
if(href_list["rejectadminhelp"])
|
||||
if(world.time && (spamcooldown > world.time))
|
||||
to_chat(usr, "Please wait [max(round((spamcooldown - world.time)*0.1, 0.1), 0)] seconds.")
|
||||
return
|
||||
if(!check_rights(R_ADMIN))
|
||||
return
|
||||
var/client/C = locate(href_list["rejectadminhelp"]) in clients
|
||||
@@ -16,14 +19,18 @@
|
||||
|
||||
C << 'sound/effects/adminhelp.ogg'
|
||||
|
||||
C << "<font color='red' size='4'><b>- AdminHelp Rejected! -</b></font>"
|
||||
C << "<font color='red'><b>Your admin help was rejected.</b> The adminhelp verb has been returned to you so that you may try again.</font>"
|
||||
C << "Please try to be calm, clear, and descriptive in admin helps, do not assume the admin has seen any related events, and clearly state the names of anybody you are reporting."
|
||||
to_chat(C, "<font color='red' size='4'><b>- AdminHelp Rejected! -</b></font>")
|
||||
to_chat(C, "<font color='red'><b>Your admin help was rejected.</b> The adminhelp verb has been returned to you so that you may try again.</font>")
|
||||
to_chat(C, "Please try to be calm, clear, and descriptive in admin helps, do not assume the admin has seen any related events, and clearly state the names of anybody you are reporting.")
|
||||
|
||||
message_admins("[key_name_admin(usr)] Rejected [C.key]'s admin help. [C.key]'s Adminhelp verb has been returned to them.")
|
||||
log_admin_private("[key_name(usr)] Rejected [C.key]'s admin help.")
|
||||
spamcooldown = world.time + 150 // 15 seconds
|
||||
|
||||
else if(href_list["icissue"])
|
||||
if(world.time && spamcooldown > world.time)
|
||||
to_chat(usr, "Please wait [max(round((spamcooldown - world.time)*0.1, 0.1), 0)] seconds.")
|
||||
return
|
||||
var/client/C = locate(href_list["icissue"]) in clients
|
||||
if(!C)
|
||||
return
|
||||
@@ -32,17 +39,18 @@
|
||||
msg += "<font color='red'><b>Losing is part of the game!</b></font><br>"
|
||||
msg += "<font color='red'>Your character will frequently die, sometimes without even a possibility of avoiding it. Events will often be out of your control. No matter how good or prepared you are, sometimes you just lose.</font>"
|
||||
|
||||
C << msg
|
||||
to_chat(C, msg)
|
||||
|
||||
message_admins("[key_name_admin(usr)] marked [C.key]'s admin help as an IC issue.")
|
||||
log_admin_private("[key_name(usr)] marked [C.key]'s admin help as an IC issue.")
|
||||
spamcooldown = world.time + 150 // 15 seconds
|
||||
|
||||
else if(href_list["stickyban"])
|
||||
stickyban(href_list["stickyban"],href_list)
|
||||
|
||||
else if(href_list["makeAntag"])
|
||||
if (!ticker.mode)
|
||||
usr << "<span class='danger'>Not until the round starts!</span>"
|
||||
to_chat(usr, "<span class='danger'>Not until the round starts!</span>")
|
||||
return
|
||||
switch(href_list["makeAntag"])
|
||||
if("traitors")
|
||||
@@ -173,8 +181,9 @@
|
||||
else if(href_list["dbsearchckey"] || href_list["dbsearchadmin"])
|
||||
var/adminckey = href_list["dbsearchadmin"]
|
||||
var/playerckey = href_list["dbsearchckey"]
|
||||
var/page = href_list["dbsearchpage"]
|
||||
|
||||
DB_ban_panel(playerckey, adminckey)
|
||||
DB_ban_panel(playerckey, adminckey, page)
|
||||
return
|
||||
|
||||
else if(href_list["dbbanedit"])
|
||||
@@ -201,33 +210,33 @@
|
||||
switch(bantype)
|
||||
if(BANTYPE_PERMA)
|
||||
if(!banckey || !banreason)
|
||||
usr << "Not enough parameters (Requires ckey and reason)."
|
||||
to_chat(usr, "Not enough parameters (Requires ckey and reason).")
|
||||
return
|
||||
banduration = null
|
||||
banjob = null
|
||||
if(BANTYPE_TEMP)
|
||||
if(!banckey || !banreason || !banduration)
|
||||
usr << "Not enough parameters (Requires ckey, reason and duration)."
|
||||
to_chat(usr, "Not enough parameters (Requires ckey, reason and duration).")
|
||||
return
|
||||
banjob = null
|
||||
if(BANTYPE_JOB_PERMA)
|
||||
if(!banckey || !banreason || !banjob)
|
||||
usr << "Not enough parameters (Requires ckey, reason and job)."
|
||||
to_chat(usr, "Not enough parameters (Requires ckey, reason and job).")
|
||||
return
|
||||
banduration = null
|
||||
if(BANTYPE_JOB_TEMP)
|
||||
if(!banckey || !banreason || !banjob || !banduration)
|
||||
usr << "Not enough parameters (Requires ckey, reason and job)."
|
||||
to_chat(usr, "Not enough parameters (Requires ckey, reason and job).")
|
||||
return
|
||||
if(BANTYPE_ADMIN_PERMA)
|
||||
if(!banckey || !banreason)
|
||||
usr << "Not enough parameters (Requires ckey and reason)."
|
||||
to_chat(usr, "Not enough parameters (Requires ckey and reason).")
|
||||
return
|
||||
banduration = null
|
||||
banjob = null
|
||||
if(BANTYPE_ADMIN_TEMP)
|
||||
if(!banckey || !banreason || !banduration)
|
||||
usr << "Not enough parameters (Requires ckey, reason and duration)."
|
||||
to_chat(usr, "Not enough parameters (Requires ckey, reason and duration).")
|
||||
return
|
||||
banjob = null
|
||||
|
||||
@@ -250,7 +259,7 @@
|
||||
message_admins("Ban process: A mob matching [playermob.ckey] was found at location [playermob.x], [playermob.y], [playermob.z]. Custom ip and computer id fields replaced with the ip and computer id from the located mob.")
|
||||
|
||||
if(!DB_ban_record(bantype, playermob, banduration, banreason, banjob, banckey, banip, bancid ))
|
||||
usr << "<span class='danger'>Failed to apply ban.</span>"
|
||||
to_chat(usr, "<span class='danger'>Failed to apply ban.</span>")
|
||||
return
|
||||
create_message("note", banckey, null, banreason, null, null, 0, 0)
|
||||
|
||||
@@ -387,7 +396,7 @@
|
||||
|
||||
var/mob/M = locate(href_list["mob"])
|
||||
if(!ismob(M))
|
||||
usr << "This can only be used on instances of type /mob."
|
||||
to_chat(usr, "This can only be used on instances of type /mob.")
|
||||
return
|
||||
|
||||
var/delmob = 0
|
||||
@@ -525,10 +534,10 @@
|
||||
return
|
||||
var/mob/M = locate(href_list["appearanceban"])
|
||||
if(!ismob(M))
|
||||
usr << "This can only be used on instances of type /mob"
|
||||
to_chat(usr, "This can only be used on instances of type /mob")
|
||||
return
|
||||
if(!M.ckey) //sanity
|
||||
usr << "This mob has no ckey"
|
||||
to_chat(usr, "This mob has no ckey")
|
||||
return
|
||||
|
||||
|
||||
@@ -542,7 +551,7 @@
|
||||
if(M.client)
|
||||
jobban_buildcache(M.client)
|
||||
message_admins("<span class='adminnotice'>[key_name_admin(usr)] removed [key_name_admin(M)]'s appearance ban.</span>")
|
||||
M << "<span class='boldannounce'><BIG>[usr.client.ckey] has removed your appearance ban.</BIG></span>"
|
||||
to_chat(M, "<span class='boldannounce'><BIG>[usr.client.ckey] has removed your appearance ban.</BIG></span>")
|
||||
|
||||
else switch(alert("Appearance ban [M.ckey]?",,"Yes","No", "Cancel"))
|
||||
if("Yes")
|
||||
@@ -550,7 +559,7 @@
|
||||
if(!reason)
|
||||
return
|
||||
if(!DB_ban_record(BANTYPE_JOB_PERMA, M, -1, reason, "appearance"))
|
||||
usr << "<span class='danger'>Failed to apply ban.</span>"
|
||||
to_chat(usr, "<span class='danger'>Failed to apply ban.</span>")
|
||||
return
|
||||
if(M.client)
|
||||
jobban_buildcache(M.client)
|
||||
@@ -559,24 +568,24 @@
|
||||
feedback_inc("ban_appearance",1)
|
||||
create_message("note", M.ckey, null, "Appearance banned - [reason]", null, null, 0, 0)
|
||||
message_admins("<span class='adminnotice'>[key_name_admin(usr)] appearance banned [key_name_admin(M)].</span>")
|
||||
M << "<span class='boldannounce'><BIG>You have been appearance banned by [usr.client.ckey].</BIG></span>"
|
||||
M << "<span class='boldannounce'>The reason is: [reason]</span>"
|
||||
M << "<span class='danger'>Appearance ban can be lifted only upon request.</span>"
|
||||
to_chat(M, "<span class='boldannounce'><BIG>You have been appearance banned by [usr.client.ckey].</BIG></span>")
|
||||
to_chat(M, "<span class='boldannounce'>The reason is: [reason]</span>")
|
||||
to_chat(M, "<span class='danger'>Appearance ban can be lifted only upon request.</span>")
|
||||
if(config.banappeals)
|
||||
M << "<span class='danger'>To try to resolve this matter head to [config.banappeals]</span>"
|
||||
to_chat(M, "<span class='danger'>To try to resolve this matter head to [config.banappeals]</span>")
|
||||
else
|
||||
M << "<span class='danger'>No ban appeals URL has been set.</span>"
|
||||
to_chat(M, "<span class='danger'>No ban appeals URL has been set.</span>")
|
||||
if("No")
|
||||
return
|
||||
|
||||
else if(href_list["jobban2"])
|
||||
var/mob/M = locate(href_list["jobban2"])
|
||||
if(!ismob(M))
|
||||
usr << "This can only be used on instances of type /mob."
|
||||
to_chat(usr, "This can only be used on instances of type /mob.")
|
||||
return
|
||||
|
||||
if(!M.ckey) //sanity
|
||||
usr << "This mob has no ckey."
|
||||
to_chat(usr, "This mob has no ckey.")
|
||||
return
|
||||
|
||||
var/dat = "<head><title>Job-Ban Panel: [key_name(M)]</title></head>"
|
||||
@@ -862,10 +871,10 @@
|
||||
return
|
||||
var/mob/M = locate(href_list["jobban4"])
|
||||
if(!ismob(M))
|
||||
usr << "This can only be used on instances of type /mob"
|
||||
to_chat(usr, "This can only be used on instances of type /mob")
|
||||
return
|
||||
if(!SSjob)
|
||||
usr << "Jobs subsystem not initialized yet!"
|
||||
to_chat(usr, "Jobs subsystem not initialized yet!")
|
||||
return
|
||||
//get jobs for department if specified, otherwise just return the one job in a list.
|
||||
var/list/joblist = list()
|
||||
@@ -935,7 +944,7 @@
|
||||
var/msg
|
||||
for(var/job in notbannedlist)
|
||||
if(!DB_ban_record(BANTYPE_JOB_TEMP, M, mins, reason, job))
|
||||
usr << "<span class='danger'>Failed to apply ban.</span>"
|
||||
to_chat(usr, "<span class='danger'>Failed to apply ban.</span>")
|
||||
return
|
||||
if(M.client)
|
||||
jobban_buildcache(M.client)
|
||||
@@ -949,9 +958,9 @@
|
||||
msg += ", [job]"
|
||||
create_message("note", M.ckey, null, "Banned from [msg] - [reason]", null, null, 0, 0)
|
||||
message_admins("<span class='adminnotice'>[key_name_admin(usr)] banned [key_name_admin(M)] from [msg] for [mins] minutes.</span>")
|
||||
M << "<span class='boldannounce'><BIG>You have been [(msg == ("ooc" || "appearance")) ? "banned" : "jobbanned"] by [usr.client.ckey] from: [msg].</BIG></span>"
|
||||
M << "<span class='boldannounce'>The reason is: [reason]</span>"
|
||||
M << "<span class='danger'>This jobban will be lifted in [mins] minutes.</span>"
|
||||
to_chat(M, "<span class='boldannounce'><BIG>You have been [(msg == ("ooc" || "appearance")) ? "banned" : "jobbanned"] by [usr.client.ckey] from: [msg].</BIG></span>")
|
||||
to_chat(M, "<span class='boldannounce'>The reason is: [reason]</span>")
|
||||
to_chat(M, "<span class='danger'>This jobban will be lifted in [mins] minutes.</span>")
|
||||
href_list["jobban2"] = 1 // lets it fall through and refresh
|
||||
return 1
|
||||
if("No")
|
||||
@@ -960,7 +969,7 @@
|
||||
var/msg
|
||||
for(var/job in notbannedlist)
|
||||
if(!DB_ban_record(BANTYPE_JOB_PERMA, M, -1, reason, job))
|
||||
usr << "<span class='danger'>Failed to apply ban.</span>"
|
||||
to_chat(usr, "<span class='danger'>Failed to apply ban.</span>")
|
||||
return
|
||||
if(M.client)
|
||||
jobban_buildcache(M.client)
|
||||
@@ -974,9 +983,9 @@
|
||||
msg += ", [job]"
|
||||
create_message("note", M.ckey, null, "Banned from [msg] - [reason]", null, null, 0, 0)
|
||||
message_admins("<span class='adminnotice'>[key_name_admin(usr)] banned [key_name_admin(M)] from [msg].</span>")
|
||||
M << "<span class='boldannounce'><BIG>You have been [(msg == ("ooc" || "appearance")) ? "banned" : "jobbanned"] by [usr.client.ckey] from: [msg].</BIG></span>"
|
||||
M << "<span class='boldannounce'>The reason is: [reason]</span>"
|
||||
M << "<span class='danger'>Jobban can be lifted only upon request.</span>"
|
||||
to_chat(M, "<span class='boldannounce'><BIG>You have been [(msg == ("ooc" || "appearance")) ? "banned" : "jobbanned"] by [usr.client.ckey] from: [msg].</BIG></span>")
|
||||
to_chat(M, "<span class='boldannounce'>The reason is: [reason]</span>")
|
||||
to_chat(M, "<span class='danger'>Jobban can be lifted only upon request.</span>")
|
||||
href_list["jobban2"] = 1 // lets it fall through and refresh
|
||||
return 1
|
||||
if("Cancel")
|
||||
@@ -1007,7 +1016,7 @@
|
||||
continue
|
||||
if(msg)
|
||||
message_admins("<span class='adminnotice'>[key_name_admin(usr)] unbanned [key_name_admin(M)] from [msg].</span>")
|
||||
M << "<span class='boldannounce'><BIG>You have been un-jobbanned by [usr.client.ckey] from [msg].</BIG></span>"
|
||||
to_chat(M, "<span class='boldannounce'><BIG>You have been un-jobbanned by [usr.client.ckey] from [msg].</BIG></span>")
|
||||
href_list["jobban2"] = 1 // lets it fall through and refresh
|
||||
return 1
|
||||
return 0 //we didn't do anything!
|
||||
@@ -1016,9 +1025,9 @@
|
||||
var/mob/M = locate(href_list["boot2"])
|
||||
if (ismob(M))
|
||||
if(!check_if_greater_rights_than(M.client))
|
||||
usr << "<span class='danger'>Error: They have more rights than you do.</span>"
|
||||
to_chat(usr, "<span class='danger'>Error: They have more rights than you do.</span>")
|
||||
return
|
||||
M << "<span class='danger'>You have been kicked from the server by [usr.client.holder.fakekey ? "an Administrator" : "[usr.client.ckey]"].</span>"
|
||||
to_chat(M, "<span class='danger'>You have been kicked from the server by [usr.client.holder.fakekey ? "an Administrator" : "[usr.client.ckey]"].</span>")
|
||||
log_admin("[key_name(usr)] kicked [key_name(M)].")
|
||||
message_admins("<span class='adminnotice'>[key_name_admin(usr)] kicked [key_name_admin(M)].</span>")
|
||||
//M.client = null
|
||||
@@ -1101,9 +1110,7 @@
|
||||
else if(href_list["messageedits"])
|
||||
var/message_id = sanitizeSQL("[href_list["messageedits"]]")
|
||||
var/DBQuery/query_get_message_edits = dbcon.NewQuery("SELECT edits FROM [format_table_name("messages")] WHERE id = '[message_id]'")
|
||||
if(!query_get_message_edits.Execute())
|
||||
var/err = query_get_message_edits.ErrorMsg()
|
||||
log_game("SQL ERROR obtaining edits from messages table. Error : \[[err]\]\n")
|
||||
if(!query_get_message_edits.warn_execute())
|
||||
return
|
||||
if(query_get_message_edits.NextRow())
|
||||
var/edit_log = query_get_message_edits.item[1]
|
||||
@@ -1129,18 +1136,18 @@
|
||||
if(!reason)
|
||||
return
|
||||
if(!DB_ban_record(BANTYPE_TEMP, M, mins, reason))
|
||||
usr << "<span class='danger'>Failed to apply ban.</span>"
|
||||
to_chat(usr, "<span class='danger'>Failed to apply ban.</span>")
|
||||
return
|
||||
AddBan(M.ckey, M.computer_id, reason, usr.ckey, 1, mins)
|
||||
ban_unban_log_save("[key_name(usr)] has banned [key_name(M)]. - Reason: [reason] - This will be removed in [mins] minutes.")
|
||||
M << "<span class='boldannounce'><BIG>You have been banned by [usr.client.ckey].\nReason: [reason]</BIG></span>"
|
||||
M << "<span class='danger'>This is a temporary ban, it will be removed in [mins] minutes.</span>"
|
||||
to_chat(M, "<span class='boldannounce'><BIG>You have been banned by [usr.client.ckey].\nReason: [reason]</BIG></span>")
|
||||
to_chat(M, "<span class='danger'>This is a temporary ban, it will be removed in [mins] minutes.</span>")
|
||||
feedback_inc("ban_tmp",1)
|
||||
feedback_inc("ban_tmp_mins",mins)
|
||||
if(config.banappeals)
|
||||
M << "<span class='danger'>To try to resolve this matter head to [config.banappeals]</span>"
|
||||
to_chat(M, "<span class='danger'>To try to resolve this matter head to [config.banappeals]</span>")
|
||||
else
|
||||
M << "<span class='danger'>No ban appeals URL has been set.</span>"
|
||||
to_chat(M, "<span class='danger'>No ban appeals URL has been set.</span>")
|
||||
log_admin_private("[key_name(usr)] has banned [M.ckey].\nReason: [key_name(M)]\nThis will be removed in [mins] minutes.")
|
||||
message_admins("<span class='adminnotice'>[key_name_admin(usr)] has banned [key_name_admin(M)].\nReason: [reason]\nThis will be removed in [mins] minutes.</span>")
|
||||
|
||||
@@ -1156,14 +1163,14 @@
|
||||
AddBan(M.ckey, M.computer_id, reason, usr.ckey, 0, 0, M.lastKnownIP)
|
||||
if("No")
|
||||
AddBan(M.ckey, M.computer_id, reason, usr.ckey, 0, 0)
|
||||
M << "<span class='boldannounce'><BIG>You have been banned by [usr.client.ckey].\nReason: [reason]</BIG></span>"
|
||||
M << "<span class='danger'>This is a permanent ban.</span>"
|
||||
to_chat(M, "<span class='boldannounce'><BIG>You have been banned by [usr.client.ckey].\nReason: [reason]</BIG></span>")
|
||||
to_chat(M, "<span class='danger'>This is a permanent ban.</span>")
|
||||
if(config.banappeals)
|
||||
M << "<span class='danger'>To try to resolve this matter head to [config.banappeals]</span>"
|
||||
to_chat(M, "<span class='danger'>To try to resolve this matter head to [config.banappeals]</span>")
|
||||
else
|
||||
M << "<span class='danger'>No ban appeals URL has been set.</span>"
|
||||
to_chat(M, "<span class='danger'>No ban appeals URL has been set.</span>")
|
||||
if(!DB_ban_record(BANTYPE_PERMA, M, -1, reason))
|
||||
usr << "<span class='danger'>Failed to apply ban.</span>"
|
||||
to_chat(usr, "<span class='danger'>Failed to apply ban.</span>")
|
||||
return
|
||||
ban_unban_log_save("[key_name(usr)] has permabanned [key_name(M)]. - Reason: [reason] - This is a permanent ban.")
|
||||
log_admin_private("[key_name(usr)] has banned [key_name_admin(M)].\nReason: [reason]\nThis is a permanent ban.")
|
||||
@@ -1216,7 +1223,7 @@
|
||||
master_mode = href_list["c_mode2"]
|
||||
log_admin("[key_name(usr)] set the mode as [master_mode].")
|
||||
message_admins("<span class='adminnotice'>[key_name_admin(usr)] set the mode as [master_mode].</span>")
|
||||
world << "<span class='adminnotice'><b>The mode is now: [master_mode]</b></span>"
|
||||
to_chat(world, "<span class='adminnotice'><b>The mode is now: [master_mode]</b></span>")
|
||||
Game() // updates the main game menu
|
||||
world.save_mode(master_mode)
|
||||
.(href, list("c_mode"=1))
|
||||
@@ -1241,7 +1248,7 @@
|
||||
|
||||
var/mob/living/carbon/human/H = locate(href_list["monkeyone"])
|
||||
if(!istype(H))
|
||||
usr << "This can only be used on instances of type /mob/living/carbon/human."
|
||||
to_chat(usr, "This can only be used on instances of type /mob/living/carbon/human.")
|
||||
return
|
||||
|
||||
log_admin("[key_name(usr)] attempting to monkeyize [key_name(H)].")
|
||||
@@ -1254,7 +1261,7 @@
|
||||
|
||||
var/mob/living/carbon/monkey/Mo = locate(href_list["humanone"])
|
||||
if(!istype(Mo))
|
||||
usr << "This can only be used on instances of type /mob/living/carbon/monkey."
|
||||
to_chat(usr, "This can only be used on instances of type /mob/living/carbon/monkey.")
|
||||
return
|
||||
|
||||
log_admin("[key_name(usr)] attempting to humanize [key_name(Mo)].")
|
||||
@@ -1267,7 +1274,7 @@
|
||||
|
||||
var/mob/living/carbon/human/H = locate(href_list["corgione"])
|
||||
if(!istype(H))
|
||||
usr << "This can only be used on instances of type /mob/living/carbon/human."
|
||||
to_chat(usr, "This can only be used on instances of type /mob/living/carbon/human.")
|
||||
return
|
||||
|
||||
log_admin("[key_name(usr)] attempting to corgize [key_name(H)].")
|
||||
@@ -1281,7 +1288,7 @@
|
||||
|
||||
var/mob/M = locate(href_list["forcespeech"])
|
||||
if(!ismob(M))
|
||||
usr << "this can only be used on instances of type /mob."
|
||||
to_chat(usr, "this can only be used on instances of type /mob.")
|
||||
|
||||
var/speech = input("What will [key_name(M)] say?.", "Force speech", "")// Don't need to sanitize, since it does that in say(), we also trust our admins.
|
||||
if(!speech)
|
||||
@@ -1297,17 +1304,17 @@
|
||||
|
||||
var/mob/M = locate(href_list["sendtoprison"])
|
||||
if(!ismob(M))
|
||||
usr << "This can only be used on instances of type /mob."
|
||||
to_chat(usr, "This can only be used on instances of type /mob.")
|
||||
return
|
||||
if(isAI(M))
|
||||
usr << "This cannot be used on instances of type /mob/living/silicon/ai."
|
||||
to_chat(usr, "This cannot be used on instances of type /mob/living/silicon/ai.")
|
||||
return
|
||||
|
||||
if(alert(usr, "Send [key_name(M)] to Prison?", "Message", "Yes", "No") != "Yes")
|
||||
return
|
||||
|
||||
M.loc = pick(prisonwarp)
|
||||
M << "<span class='adminnotice'>You have been sent to Prison!</span>"
|
||||
to_chat(M, "<span class='adminnotice'>You have been sent to Prison!</span>")
|
||||
|
||||
log_admin("[key_name(usr)] has sent [key_name(M)] to Prison!")
|
||||
message_admins("[key_name_admin(usr)] has sent [key_name_admin(M)] Prison!")
|
||||
@@ -1319,11 +1326,11 @@
|
||||
var/mob/M = locate(href_list["sendbacktolobby"])
|
||||
|
||||
if(!isobserver(M))
|
||||
usr << "<span class='notice'>You can only send ghost players back to the Lobby.</span>"
|
||||
to_chat(usr, "<span class='notice'>You can only send ghost players back to the Lobby.</span>")
|
||||
return
|
||||
|
||||
if(!M.client)
|
||||
usr << "<span class='warning'>[M] doesn't seem to have an active client.</span>"
|
||||
to_chat(usr, "<span class='warning'>[M] doesn't seem to have an active client.</span>")
|
||||
return
|
||||
|
||||
if(alert(usr, "Send [key_name(M)] back to Lobby?", "Message", "Yes", "No") != "Yes")
|
||||
@@ -1332,7 +1339,7 @@
|
||||
log_admin("[key_name(usr)] has sent [key_name(M)] back to the Lobby.")
|
||||
message_admins("[key_name(usr)] has sent [key_name(M)] back to the Lobby.")
|
||||
|
||||
var/mob/new_player/NP = new()
|
||||
var/mob/dead/new_player/NP = new()
|
||||
NP.ckey = M.ckey
|
||||
qdel(M)
|
||||
|
||||
@@ -1345,10 +1352,10 @@
|
||||
|
||||
var/mob/M = locate(href_list["tdome1"])
|
||||
if(!ismob(M))
|
||||
usr << "This can only be used on instances of type /mob."
|
||||
to_chat(usr, "This can only be used on instances of type /mob.")
|
||||
return
|
||||
if(isAI(M))
|
||||
usr << "This cannot be used on instances of type /mob/living/silicon/ai."
|
||||
to_chat(usr, "This cannot be used on instances of type /mob/living/silicon/ai.")
|
||||
return
|
||||
|
||||
for(var/obj/item/I in M)
|
||||
@@ -1358,7 +1365,7 @@
|
||||
sleep(5)
|
||||
M.loc = pick(tdome1)
|
||||
spawn(50)
|
||||
M << "<span class='adminnotice'>You have been sent to the Thunderdome.</span>"
|
||||
to_chat(M, "<span class='adminnotice'>You have been sent to the Thunderdome.</span>")
|
||||
log_admin("[key_name(usr)] has sent [key_name(M)] to the thunderdome. (Team 1)")
|
||||
message_admins("[key_name_admin(usr)] has sent [key_name_admin(M)] to the thunderdome. (Team 1)")
|
||||
|
||||
@@ -1371,10 +1378,10 @@
|
||||
|
||||
var/mob/M = locate(href_list["tdome2"])
|
||||
if(!ismob(M))
|
||||
usr << "This can only be used on instances of type /mob."
|
||||
to_chat(usr, "This can only be used on instances of type /mob.")
|
||||
return
|
||||
if(isAI(M))
|
||||
usr << "This cannot be used on instances of type /mob/living/silicon/ai."
|
||||
to_chat(usr, "This cannot be used on instances of type /mob/living/silicon/ai.")
|
||||
return
|
||||
|
||||
for(var/obj/item/I in M)
|
||||
@@ -1384,7 +1391,7 @@
|
||||
sleep(5)
|
||||
M.loc = pick(tdome2)
|
||||
spawn(50)
|
||||
M << "<span class='adminnotice'>You have been sent to the Thunderdome.</span>"
|
||||
to_chat(M, "<span class='adminnotice'>You have been sent to the Thunderdome.</span>")
|
||||
log_admin("[key_name(usr)] has sent [key_name(M)] to the thunderdome. (Team 2)")
|
||||
message_admins("[key_name_admin(usr)] has sent [key_name_admin(M)] to the thunderdome. (Team 2)")
|
||||
|
||||
@@ -1397,17 +1404,17 @@
|
||||
|
||||
var/mob/M = locate(href_list["tdomeadmin"])
|
||||
if(!ismob(M))
|
||||
usr << "This can only be used on instances of type /mob."
|
||||
to_chat(usr, "This can only be used on instances of type /mob.")
|
||||
return
|
||||
if(isAI(M))
|
||||
usr << "This cannot be used on instances of type /mob/living/silicon/ai."
|
||||
to_chat(usr, "This cannot be used on instances of type /mob/living/silicon/ai.")
|
||||
return
|
||||
|
||||
M.Paralyse(5)
|
||||
sleep(5)
|
||||
M.loc = pick(tdomeadmin)
|
||||
spawn(50)
|
||||
M << "<span class='adminnotice'>You have been sent to the Thunderdome.</span>"
|
||||
to_chat(M, "<span class='adminnotice'>You have been sent to the Thunderdome.</span>")
|
||||
log_admin("[key_name(usr)] has sent [key_name(M)] to the thunderdome. (Admin.)")
|
||||
message_admins("[key_name_admin(usr)] has sent [key_name_admin(M)] to the thunderdome. (Admin.)")
|
||||
|
||||
@@ -1420,10 +1427,10 @@
|
||||
|
||||
var/mob/M = locate(href_list["tdomeobserve"])
|
||||
if(!ismob(M))
|
||||
usr << "This can only be used on instances of type /mob."
|
||||
to_chat(usr, "This can only be used on instances of type /mob.")
|
||||
return
|
||||
if(isAI(M))
|
||||
usr << "This cannot be used on instances of type /mob/living/silicon/ai."
|
||||
to_chat(usr, "This cannot be used on instances of type /mob/living/silicon/ai.")
|
||||
return
|
||||
|
||||
for(var/obj/item/I in M)
|
||||
@@ -1437,7 +1444,7 @@
|
||||
sleep(5)
|
||||
M.loc = pick(tdomeobserve)
|
||||
spawn(50)
|
||||
M << "<span class='adminnotice'>You have been sent to the Thunderdome.</span>"
|
||||
to_chat(M, "<span class='adminnotice'>You have been sent to the Thunderdome.</span>")
|
||||
log_admin("[key_name(usr)] has sent [key_name(M)] to the thunderdome. (Observer.)")
|
||||
message_admins("[key_name_admin(usr)] has sent [key_name_admin(M)] to the thunderdome. (Observer.)")
|
||||
|
||||
@@ -1447,7 +1454,7 @@
|
||||
|
||||
var/mob/living/L = locate(href_list["revive"])
|
||||
if(!istype(L))
|
||||
usr << "This can only be used on instances of type /mob/living."
|
||||
to_chat(usr, "This can only be used on instances of type /mob/living.")
|
||||
return
|
||||
|
||||
L.revive(full_heal = 1, admin_revive = 1)
|
||||
@@ -1460,7 +1467,7 @@
|
||||
|
||||
var/mob/living/carbon/human/H = locate(href_list["makeai"])
|
||||
if(!istype(H))
|
||||
usr << "This can only be used on instances of type /mob/living/carbon/human."
|
||||
to_chat(usr, "This can only be used on instances of type /mob/living/carbon/human.")
|
||||
return
|
||||
|
||||
message_admins("<span class='danger'>Admin [key_name_admin(usr)] AIized [key_name_admin(H)]!</span>")
|
||||
@@ -1473,7 +1480,7 @@
|
||||
|
||||
var/mob/living/carbon/human/H = locate(href_list["makealien"])
|
||||
if(!istype(H))
|
||||
usr << "This can only be used on instances of type /mob/living/carbon/human."
|
||||
to_chat(usr, "This can only be used on instances of type /mob/living/carbon/human.")
|
||||
return
|
||||
|
||||
usr.client.cmd_admin_alienize(H)
|
||||
@@ -1484,7 +1491,7 @@
|
||||
|
||||
var/mob/living/carbon/human/H = locate(href_list["makeslime"])
|
||||
if(!istype(H))
|
||||
usr << "This can only be used on instances of type /mob/living/carbon/human."
|
||||
to_chat(usr, "This can only be used on instances of type /mob/living/carbon/human.")
|
||||
return
|
||||
|
||||
usr.client.cmd_admin_slimeize(H)
|
||||
@@ -1495,7 +1502,7 @@
|
||||
|
||||
var/mob/living/carbon/human/H = locate(href_list["makeblob"])
|
||||
if(!istype(H))
|
||||
usr << "This can only be used on instances of type /mob/living/carbon/human."
|
||||
to_chat(usr, "This can only be used on instances of type /mob/living/carbon/human.")
|
||||
return
|
||||
|
||||
usr.client.cmd_admin_blobize(H)
|
||||
@@ -1507,7 +1514,7 @@
|
||||
|
||||
var/mob/living/carbon/human/H = locate(href_list["makerobot"])
|
||||
if(!istype(H))
|
||||
usr << "This can only be used on instances of type /mob/living/carbon/human."
|
||||
to_chat(usr, "This can only be used on instances of type /mob/living/carbon/human.")
|
||||
return
|
||||
|
||||
usr.client.cmd_admin_robotize(H)
|
||||
@@ -1518,7 +1525,7 @@
|
||||
|
||||
var/mob/M = locate(href_list["makeanimal"])
|
||||
if(isnewplayer(M))
|
||||
usr << "This cannot be used on instances of type /mob/new_player."
|
||||
to_chat(usr, "This cannot be used on instances of type /mob/dead/new_player.")
|
||||
return
|
||||
|
||||
usr.client.cmd_admin_animalize(M)
|
||||
@@ -1574,7 +1581,7 @@
|
||||
else if(href_list["adminmoreinfo"])
|
||||
var/mob/M = locate(href_list["adminmoreinfo"])
|
||||
if(!ismob(M))
|
||||
usr << "This can only be used on instances of type /mob."
|
||||
to_chat(usr, "This can only be used on instances of type /mob.")
|
||||
return
|
||||
|
||||
var/location_description = ""
|
||||
@@ -1619,12 +1626,12 @@
|
||||
else
|
||||
gender_description = "<font color='red'><b>[M.gender]</b></font>"
|
||||
|
||||
src.owner << "<b>Info about [M.name]:</b> "
|
||||
src.owner << "Mob type = [M.type]; Gender = [gender_description] Damage = [health_description]"
|
||||
src.owner << "Name = <b>[M.name]</b>; Real_name = [M.real_name]; Mind_name = [M.mind?"[M.mind.name]":""]; Key = <b>[M.key]</b>;"
|
||||
src.owner << "Location = [location_description];"
|
||||
src.owner << "[special_role_description]"
|
||||
src.owner << "(<a href='?priv_msg=[M.ckey]'>PM</a>) (<A HREF='?src=\ref[src];adminplayeropts=\ref[M]'>PP</A>) (<A HREF='?_src_=vars;Vars=\ref[M]'>VV</A>) (<A HREF='?src=\ref[src];subtlemessage=\ref[M]'>SM</A>) (<A HREF='?src=\ref[src];adminplayerobservefollow=\ref[M]'>FLW</A>) (<A HREF='?src=\ref[src];secrets=check_antagonist'>CA</A>)"
|
||||
to_chat(src.owner, "<b>Info about [M.name]:</b> ")
|
||||
to_chat(src.owner, "Mob type = [M.type]; Gender = [gender_description] Damage = [health_description]")
|
||||
to_chat(src.owner, "Name = <b>[M.name]</b>; Real_name = [M.real_name]; Mind_name = [M.mind?"[M.mind.name]":""]; Key = <b>[M.key]</b>;")
|
||||
to_chat(src.owner, "Location = [location_description];")
|
||||
to_chat(src.owner, "[special_role_description]")
|
||||
to_chat(src.owner, "(<a href='?priv_msg=[M.ckey]'>PM</a>) (<A HREF='?src=\ref[src];adminplayeropts=\ref[M]'>PP</A>) (<A HREF='?_src_=vars;Vars=\ref[M]'>VV</A>) (<A HREF='?src=\ref[src];subtlemessage=\ref[M]'>SM</A>) (<A HREF='?src=\ref[src];adminplayerobservefollow=\ref[M]'>FLW</A>) (<A HREF='?src=\ref[src];secrets=check_antagonist'>CA</A>)")
|
||||
|
||||
else if(href_list["addjobslot"])
|
||||
if(!check_rights(R_ADMIN))
|
||||
@@ -1685,7 +1692,7 @@
|
||||
|
||||
var/mob/living/carbon/human/H = locate(href_list["adminspawncookie"])
|
||||
if(!ishuman(H))
|
||||
usr << "This can only be used on instances of type /mob/living/carbon/human."
|
||||
to_chat(usr, "This can only be used on instances of type /mob/living/carbon/human.")
|
||||
return
|
||||
|
||||
var/obj/item/weapon/reagent_containers/food/snacks/cookie/cookie = new(H)
|
||||
@@ -1700,7 +1707,7 @@
|
||||
log_admin("[key_name(H)] got their cookie, spawned by [key_name(src.owner)].")
|
||||
message_admins("[key_name(H)] got their cookie, spawned by [key_name(src.owner)].")
|
||||
feedback_inc("admin_cookies_spawned",1)
|
||||
H << "<span class='adminnotice'>Your prayers have been answered!! You received the <b>best cookie</b>!</span>"
|
||||
to_chat(H, "<span class='adminnotice'>Your prayers have been answered!! You received the <b>best cookie</b>!</span>")
|
||||
H << 'sound/effects/pray_chaplain.ogg'
|
||||
|
||||
else if(href_list["adminsmite"])
|
||||
@@ -1724,7 +1731,7 @@
|
||||
T.Beam(H, icon_state="lightning[rand(1,12)]", time = 5)
|
||||
H.adjustFireLoss(75)
|
||||
H.electrocution_animation(40)
|
||||
H << "<span class='userdanger'>The gods have punished you for your sins!</span>"
|
||||
to_chat(H, "<span class='userdanger'>The gods have punished you for your sins!</span>")
|
||||
if(ADMIN_PUNISHMENT_BRAINDAMAGE)
|
||||
H.adjustBrainLoss(75)
|
||||
if(ADMIN_PUNISHMENT_GIB)
|
||||
@@ -1740,10 +1747,10 @@
|
||||
else if(href_list["CentcommReply"])
|
||||
var/mob/living/carbon/human/H = locate(href_list["CentcommReply"]) in mob_list
|
||||
if(!istype(H))
|
||||
usr << "This can only be used on instances of type /mob/living/carbon/human"
|
||||
to_chat(usr, "This can only be used on instances of type /mob/living/carbon/human")
|
||||
return
|
||||
if(!istype(H.ears, /obj/item/device/radio/headset))
|
||||
usr << "The person you are trying to contact is not wearing a headset."
|
||||
to_chat(usr, "The person you are trying to contact is not wearing a headset.")
|
||||
return
|
||||
|
||||
message_admins("[src.owner] has started answering [key_name(H)]'s Centcomm request.")
|
||||
@@ -1752,18 +1759,18 @@
|
||||
message_admins("[src.owner] decided not to answer [key_name(H)]'s Centcomm request.")
|
||||
return
|
||||
|
||||
src.owner << "You sent [input] to [H] via a secure channel."
|
||||
to_chat(src.owner, "You sent [input] to [H] via a secure channel.")
|
||||
log_admin("[src.owner] replied to [key_name(H)]'s Centcom message with the message [input].")
|
||||
message_admins("[src.owner] replied to [key_name(H)]'s Centcom message with: \"[input]\"")
|
||||
H << "You hear something crackle in your ears for a moment before a voice speaks. \"Please stand by for a message from Central Command. Message as follows. [input]. Message ends.\""
|
||||
to_chat(H, "You hear something crackle in your ears for a moment before a voice speaks. \"Please stand by for a message from Central Command. Message as follows. [input]. Message ends.\"")
|
||||
|
||||
else if(href_list["SyndicateReply"])
|
||||
var/mob/living/carbon/human/H = locate(href_list["SyndicateReply"])
|
||||
if(!istype(H))
|
||||
usr << "This can only be used on instances of type /mob/living/carbon/human."
|
||||
to_chat(usr, "This can only be used on instances of type /mob/living/carbon/human.")
|
||||
return
|
||||
if(!istype(H.ears, /obj/item/device/radio/headset))
|
||||
usr << "The person you are trying to contact is not wearing a headset."
|
||||
to_chat(usr, "The person you are trying to contact is not wearing a headset.")
|
||||
return
|
||||
|
||||
message_admins("[src.owner] has started answering [key_name(H)]'s syndicate request.")
|
||||
@@ -1772,10 +1779,10 @@
|
||||
message_admins("[src.owner] decided not to answer [key_name(H)]'s syndicate request.")
|
||||
return
|
||||
|
||||
src.owner << "You sent [input] to [H] via a secure channel."
|
||||
to_chat(src.owner, "You sent [input] to [H] via a secure channel.")
|
||||
log_admin("[src.owner] replied to [key_name(H)]'s Syndicate message with the message [input].")
|
||||
message_admins("[src.owner] replied to [key_name(H)]'s Syndicate message with: \"[input]\"")
|
||||
H << "You hear something crackle in your ears for a moment before a voice speaks. \"Please stand by for a message from your benefactor. Message as follows, agent. [input]. Message ends.\""
|
||||
to_chat(H, "You hear something crackle in your ears for a moment before a voice speaks. \"Please stand by for a message from your benefactor. Message as follows, agent. [input]. Message ends.\"")
|
||||
|
||||
else if(href_list["reject_custom_name"])
|
||||
if(!check_rights(R_ADMIN))
|
||||
@@ -1820,6 +1827,17 @@
|
||||
var/mob/M = locate(href_list["subtlemessage"])
|
||||
usr.client.cmd_admin_subtle_message(M)
|
||||
|
||||
else if(href_list["individuallog"])
|
||||
if(!check_rights(R_ADMIN))
|
||||
return
|
||||
|
||||
var/mob/M = locate(href_list["individuallog"]) in mob_list
|
||||
if(!ismob(M))
|
||||
to_chat(usr, "This can only be used on instances of type /mob.")
|
||||
return
|
||||
|
||||
show_individual_logging_panel(M, href_list["log_type"])
|
||||
|
||||
else if(href_list["traitor"])
|
||||
if(!check_rights(R_ADMIN))
|
||||
return
|
||||
@@ -1830,7 +1848,7 @@
|
||||
|
||||
var/mob/M = locate(href_list["traitor"])
|
||||
if(!ismob(M))
|
||||
usr << "This can only be used on instances of type /mob."
|
||||
to_chat(usr, "This can only be used on instances of type /mob.")
|
||||
return
|
||||
show_traitor_panel(M)
|
||||
|
||||
@@ -1909,7 +1927,7 @@
|
||||
switch(where)
|
||||
if("inhand")
|
||||
if (!iscarbon(usr) && !iscyborg(usr))
|
||||
usr << "Can only spawn in hand when you're a carbon mob or cyborg."
|
||||
to_chat(usr, "Can only spawn in hand when you're a carbon mob or cyborg.")
|
||||
where = "onfloor"
|
||||
target = usr
|
||||
|
||||
@@ -1921,10 +1939,10 @@
|
||||
target = locate(loc.x + X,loc.y + Y,loc.z + Z)
|
||||
if("inmarked")
|
||||
if(!marked_datum)
|
||||
usr << "You don't have any object marked. Abandoning spawn."
|
||||
to_chat(usr, "You don't have any object marked. Abandoning spawn.")
|
||||
return
|
||||
else if(!istype(marked_datum,/atom))
|
||||
usr << "The object you have marked cannot be used as a target. Target must be of type /atom. Abandoning spawn."
|
||||
to_chat(usr, "The object you have marked cannot be used as a target. Target must be of type /atom. Abandoning spawn.")
|
||||
return
|
||||
else
|
||||
target = marked_datum
|
||||
@@ -2178,7 +2196,7 @@
|
||||
if(ticker && ticker.current_state == GAME_STATE_PLAYING)
|
||||
var/afkonly = text2num(href_list["afkonly"])
|
||||
if(alert("Are you sure you want to kick all [afkonly ? "AFK" : ""] clients from the lobby??","Message","Yes","Cancel") != "Yes")
|
||||
usr << "Kick clients from lobby aborted"
|
||||
to_chat(usr, "Kick clients from lobby aborted")
|
||||
return
|
||||
var/list/listkicked = kick_clients_in_lobby("<span class='danger'>You were kicked from the lobby by [usr.client.holder.fakekey ? "an Administrator" : "[usr.client.ckey]"].</span>", afkonly)
|
||||
|
||||
@@ -2188,7 +2206,7 @@
|
||||
message_admins("[key_name_admin(usr)] has kicked [afkonly ? "all AFK" : "all"] clients from the lobby. [length(listkicked)] clients kicked: [strkicked ? strkicked : "--"]")
|
||||
log_admin("[key_name(usr)] has kicked [afkonly ? "all AFK" : "all"] clients from the lobby. [length(listkicked)] clients kicked: [strkicked ? strkicked : "--"]")
|
||||
else
|
||||
usr << "You may only use this when the game is running."
|
||||
to_chat(usr, "You may only use this when the game is running.")
|
||||
|
||||
else if(href_list["create_outfit"])
|
||||
if(!check_rights(R_ADMIN))
|
||||
@@ -2250,24 +2268,24 @@
|
||||
else if(href_list["viewruntime"])
|
||||
var/datum/error_viewer/error_viewer = locate(href_list["viewruntime"])
|
||||
if(!istype(error_viewer))
|
||||
usr << "<span class='warning'>That runtime viewer no longer exists.</span>"
|
||||
to_chat(usr, "<span class='warning'>That runtime viewer no longer exists.</span>")
|
||||
return
|
||||
|
||||
if(href_list["viewruntime_backto"])
|
||||
error_viewer.show_to(owner, locate(href_list["viewruntime_backto"]), href_list["viewruntime_linear"])
|
||||
else
|
||||
error_viewer.show_to(owner, null, href_list["viewruntime_linear"])
|
||||
|
||||
else if(href_list["mentor"])
|
||||
|
||||
if(!check_rights(R_ADMIN)) return
|
||||
|
||||
var/mob/M = locate(href_list["mentor"])
|
||||
if(!ismob(M))
|
||||
usr << "this can be only used on instances of type /mob"
|
||||
to_chat(usr, "this can be only used on instances of type /mob")
|
||||
return
|
||||
|
||||
if(!M.client)
|
||||
usr << "no client"
|
||||
to_chat(usr, "no client")
|
||||
return
|
||||
|
||||
log_admin("[key_name(usr)] has granted [key_name(M)] mentor access")
|
||||
@@ -2280,7 +2298,7 @@
|
||||
load_mentors()
|
||||
M.verbs += /client/proc/cmd_mentor_say
|
||||
M.verbs += /client/proc/show_mentor_memo
|
||||
M << "\blue You've been granted mentor access! Help people who send mentor-pms"
|
||||
to_chat(M, "\blue You've been granted mentor access! Help people who send mentor-pms")
|
||||
|
||||
else if(href_list["removementor"])
|
||||
if(!check_rights(R_ADMIN)) return
|
||||
@@ -2298,7 +2316,7 @@
|
||||
var/err = query.ErrorMsg()
|
||||
log_game("SQL ERROR during removing mentor. Error : \[[err]\]\n")
|
||||
load_mentors()
|
||||
M << "\blue Your mentor access has been removed"
|
||||
to_chat(M, "\blue Your mentor access has been removed")
|
||||
M.verbs -= /client/proc/cmd_mentor_say
|
||||
M.verbs -= /client/proc/show_mentor_memo
|
||||
|
||||
|
||||
@@ -29,6 +29,6 @@
|
||||
var/F = file("broken_icons.txt")
|
||||
fdel(F)
|
||||
F << text
|
||||
world << "Completely successfully and written to [F]"
|
||||
to_chat(world, "Completely successfully and written to [F]")
|
||||
|
||||
|
||||
|
||||
@@ -18,10 +18,6 @@
|
||||
|
||||
*/
|
||||
|
||||
/datum/proc/SDQL_update(const/var_name, new_value)
|
||||
vars[var_name] = new_value
|
||||
return TRUE
|
||||
|
||||
/client/proc/SDQL2_query(query_text as message)
|
||||
set category = "Debug"
|
||||
if(!check_rights(R_DEBUG)) //Shouldn't happen... but just to be safe.
|
||||
@@ -38,7 +34,7 @@
|
||||
if(!query_text || length(query_text) < 1)
|
||||
return
|
||||
|
||||
//world << query_text
|
||||
//to_chat(world, query_text)
|
||||
|
||||
var/list/query_list = SDQL2_tokenize(query_text)
|
||||
|
||||
@@ -75,15 +71,8 @@
|
||||
var/list/objs = list()
|
||||
|
||||
for(var/type in select_types)
|
||||
var/char = copytext(type, 1, 2)
|
||||
|
||||
if(char == "/" || char == "*")
|
||||
for(var/from in from_objs)
|
||||
objs += SDQL_get_all(type, from)
|
||||
CHECK_TICK
|
||||
|
||||
else if(char == "'" || char == "\"")
|
||||
objs += locate(copytext(type, 2, length(type)))
|
||||
objs += SDQL_get_all(type, from_objs)
|
||||
CHECK_TICK
|
||||
|
||||
if("where" in query_tree)
|
||||
var/objs_temp = objs
|
||||
@@ -95,19 +84,8 @@
|
||||
|
||||
switch(query_tree[1])
|
||||
if("call")
|
||||
var/list/call_list = query_tree["call"]
|
||||
var/list/args_list = query_tree["args"]
|
||||
|
||||
for(var/datum/d in objs)
|
||||
var/list/new_args = list()
|
||||
for(var/a in args_list)
|
||||
new_args += SDQL_expression(d,a)
|
||||
for(var/v in call_list)
|
||||
if(copytext(v,1,8) == "global.")
|
||||
v = "/proc/[copytext(v,8)]"
|
||||
SDQL_callproc_global(v,new_args)
|
||||
else
|
||||
SDQL_callproc(d, v, new_args)
|
||||
SDQL_var(d, query_tree["call"][1], source = d)
|
||||
CHECK_TICK
|
||||
|
||||
if("delete")
|
||||
@@ -146,7 +124,7 @@
|
||||
var/i = 0
|
||||
for(var/v in sets)
|
||||
if(++i == sets.len)
|
||||
temp.SDQL_update(v, SDQL_expression(d, set_list[sets]))
|
||||
temp.vv_edit_var(v, SDQL_expression(d, set_list[sets]))
|
||||
break
|
||||
if(temp.vars.Find(v) && (istype(temp.vars[v], /datum)))
|
||||
temp = temp.vars[v]
|
||||
@@ -155,10 +133,10 @@
|
||||
CHECK_TICK
|
||||
|
||||
catch(var/exception/e)
|
||||
usr << "<span class='boldwarning'>A runtime error has occured in your SDQL2-query.</span>"
|
||||
usr << "\[NAME\][e.name]"
|
||||
usr << "\[FILE\][e.file]"
|
||||
usr << "\[LINE\][e.line]"
|
||||
to_chat(usr, "<span class='boldwarning'>A runtime error has occured in your SDQL2-query.</span>")
|
||||
to_chat(usr, "\[NAME\][e.name]")
|
||||
to_chat(usr, "\[FILE\][e.file]")
|
||||
to_chat(usr, "\[LINE\][e.line]")
|
||||
|
||||
/proc/SDQL_callproc_global(procname,args_list)
|
||||
set waitfor = FALSE
|
||||
@@ -193,7 +171,7 @@
|
||||
querys[querys_pos] = parsed_tree
|
||||
querys_pos++
|
||||
else //There was an error so don't run anything, and tell the user which query has errored.
|
||||
usr << "<span class='danger'>Parsing error on [querys_pos]\th query. Nothing was executed.</span>"
|
||||
to_chat(usr, "<span class='danger'>Parsing error on [querys_pos]\th query. Nothing was executed.</span>")
|
||||
return list()
|
||||
query_tree = list()
|
||||
do_parse = 0
|
||||
@@ -214,51 +192,36 @@
|
||||
|
||||
for(var/item in query_tree)
|
||||
if(istype(item, /list))
|
||||
usr << "[spaces]("
|
||||
to_chat(usr, "[spaces](")
|
||||
SDQL_testout(item, indent + 1)
|
||||
usr << "[spaces])"
|
||||
to_chat(usr, "[spaces])")
|
||||
|
||||
else
|
||||
usr << "[spaces][item]"
|
||||
to_chat(usr, "[spaces][item]")
|
||||
|
||||
if(!isnum(item) && query_tree[item])
|
||||
|
||||
if(istype(query_tree[item], /list))
|
||||
usr << "[spaces] ("
|
||||
to_chat(usr, "[spaces] (")
|
||||
SDQL_testout(query_tree[item], indent + 2)
|
||||
usr << "[spaces] )"
|
||||
to_chat(usr, "[spaces] )")
|
||||
|
||||
else
|
||||
usr << "[spaces] [query_tree[item]]"
|
||||
to_chat(usr, "[spaces] [query_tree[item]]")
|
||||
|
||||
|
||||
|
||||
/proc/SDQL_from_objs(list/tree)
|
||||
if("world" in tree)
|
||||
return list(world)
|
||||
|
||||
var/list/out = list()
|
||||
|
||||
for(var/type in tree)
|
||||
var/char = copytext(type, 1, 2)
|
||||
|
||||
if(char == "/")
|
||||
out += SDQL_get_all(type, world)
|
||||
|
||||
else if(char == "'" || char == "\"")
|
||||
out += locate(copytext(type, 2, length(type)))
|
||||
|
||||
return out
|
||||
|
||||
return world
|
||||
return SDQL_expression(world, tree)
|
||||
|
||||
/proc/SDQL_get_all(type, location)
|
||||
var/list/out = list()
|
||||
|
||||
if(type == "*")
|
||||
for(var/datum/d in location)
|
||||
out += d
|
||||
|
||||
return out
|
||||
// If only a single object got returned, wrap it into a list so the for loops run on it.
|
||||
if(!islist(location) && location != world)
|
||||
location = list(location)
|
||||
|
||||
type = text2path(type)
|
||||
var/typecache = typecacheof(type)
|
||||
@@ -355,7 +318,7 @@
|
||||
if("or", "||")
|
||||
result = (result || val)
|
||||
else
|
||||
usr << "<span class='danger'>SDQL2: Unknown op [op]</span>"
|
||||
to_chat(usr, "<span class='danger'>SDQL2: Unknown op [op]</span>")
|
||||
result = null
|
||||
else
|
||||
result = val
|
||||
@@ -398,51 +361,89 @@
|
||||
|
||||
else if(expression[i] == "\[")
|
||||
var/list/expressions_list = expression[++i]
|
||||
var/list/val2 = list()
|
||||
val = list()
|
||||
for(var/list/expression_list in expressions_list)
|
||||
val2[++val2.len] = SDQL_expression(object, expression_list)
|
||||
val = val2
|
||||
var/result = SDQL_expression(object, expression_list)
|
||||
var/assoc
|
||||
if(expressions_list[expression_list] != null)
|
||||
assoc = SDQL_expression(object, expressions_list[expression_list])
|
||||
if(assoc != null)
|
||||
// Need to insert the key like this to prevent duplicate keys fucking up.
|
||||
var/list/dummy = list()
|
||||
dummy[result] = assoc
|
||||
result = dummy
|
||||
val += result
|
||||
else
|
||||
val = SDQL_var(object, expression, i)
|
||||
val = SDQL_var(object, expression, i, object)
|
||||
i = expression.len
|
||||
|
||||
return list("val" = val, "i" = i)
|
||||
|
||||
/proc/SDQL_var(datum/object, list/expression, start = 1)
|
||||
/proc/SDQL_var(datum/object, list/expression, start = 1, source)
|
||||
var/v
|
||||
if(expression[start] in object.vars)
|
||||
v = object.vars[expression[start]]
|
||||
else if(expression[start] == "{" && start < expression.len)
|
||||
var/static/list/exclude = list("usr", "src", "marked", "global")
|
||||
var/long = start < expression.len
|
||||
if(object == world && long && expression[start + 1] == ".")
|
||||
to_chat(usr, "Sorry, but global variables are not supported at the moment.")
|
||||
return null
|
||||
else if(expression [start] == "{" && long)
|
||||
if(lowertext(copytext(expression[start + 1], 1, 3)) != "0x")
|
||||
usr << "<span class='danger'>Invalid pointer syntax: [expression[start + 1]]</span>"
|
||||
to_chat(usr, "<span class='danger'>Invalid pointer syntax: [expression[start + 1]]</span>")
|
||||
return null
|
||||
v = locate("\[[expression[start + 1]]]")
|
||||
if(!v)
|
||||
usr << "<span class='danger'>Invalid pointer: [expression[start + 1]]</span>"
|
||||
to_chat(usr, "<span class='danger'>Invalid pointer: [expression[start + 1]]</span>")
|
||||
return null
|
||||
start++
|
||||
else
|
||||
else if((!long || expression[start + 1] == ".") && (expression[start] in object.vars))
|
||||
v = object.vars[expression[start]]
|
||||
else if(long && expression[start + 1] == ":" && hascall(object, expression[start]))
|
||||
v = expression[start]
|
||||
else if(!long || expression[start + 1] == ".")
|
||||
switch(expression[start])
|
||||
if("usr")
|
||||
v = usr
|
||||
if("src")
|
||||
v = object
|
||||
v = source
|
||||
if("marked")
|
||||
if(usr.client && usr.client.holder && usr.client.holder.marked_datum)
|
||||
v = usr.client.holder.marked_datum
|
||||
else
|
||||
return null
|
||||
if("global")
|
||||
v = world
|
||||
else
|
||||
return null
|
||||
if(start < expression.len && expression[start + 1] == ".")
|
||||
return SDQL_var(v, expression[start + 2])
|
||||
else
|
||||
return v
|
||||
else if(object == world) // Shitty ass hack kill me.
|
||||
v = expression[start]
|
||||
if(long)
|
||||
if(expression[start + 1] == ".")
|
||||
return SDQL_var(v, expression[start + 2], source = source)
|
||||
else if(expression[start + 1] == ":")
|
||||
return SDQL_function(object, v, expression[start + 2], source)
|
||||
else if(expression[start + 1] == "\[" && islist(v))
|
||||
var/list/L = v
|
||||
var/index = SDQL_expression(source, expression[start + 2])
|
||||
if(isnum(index) && (!IsInteger(index) || L.len < index))
|
||||
to_chat(usr, "<span class='danger'>Invalid list index: [index]</span>")
|
||||
return null
|
||||
return L[index]
|
||||
return v
|
||||
|
||||
/proc/SDQL_function(var/datum/object, var/procname, var/list/arguments, source)
|
||||
set waitfor = FALSE
|
||||
var/list/new_args = list()
|
||||
for(var/arg in arguments)
|
||||
new_args += SDQL_expression(source, arg)
|
||||
if(object == world) // Global proc.
|
||||
procname = "/proc/[procname]"
|
||||
return call(procname)(arglist(new_args))
|
||||
return call(object, procname)(arglist(new_args)) // Spawn in case the function sleeps.
|
||||
|
||||
/proc/SDQL2_tokenize(query_text)
|
||||
|
||||
var/list/whitespace = list(" ", "\n", "\t")
|
||||
var/list/single = list("(", ")", ",", "+", "-", ".", ";", "{", "}", "\[", "]")
|
||||
var/list/single = list("(", ")", ",", "+", "-", ".", ";", "{", "}", "\[", "]", ":")
|
||||
var/list/multi = list(
|
||||
"=" = list("", "="),
|
||||
"<" = list("", "=", ">"),
|
||||
@@ -484,7 +485,7 @@
|
||||
|
||||
else if(char == "'")
|
||||
if(word != "")
|
||||
usr << "\red SDQL2: You have an error in your SDQL syntax, unexpected ' in query: \"<font color=gray>[query_text]</font>\" following \"<font color=gray>[word]</font>\". Please check your syntax, and try again."
|
||||
to_chat(usr, "\red SDQL2: You have an error in your SDQL syntax, unexpected ' in query: \"<font color=gray>[query_text]</font>\" following \"<font color=gray>[word]</font>\". Please check your syntax, and try again.")
|
||||
return null
|
||||
|
||||
word = "'"
|
||||
@@ -504,7 +505,7 @@
|
||||
word += char
|
||||
|
||||
if(i > len)
|
||||
usr << "\red SDQL2: You have an error in your SDQL syntax, unmatched ' in query: \"<font color=gray>[query_text]</font>\". Please check your syntax, and try again."
|
||||
to_chat(usr, "\red SDQL2: You have an error in your SDQL syntax, unmatched ' in query: \"<font color=gray>[query_text]</font>\". Please check your syntax, and try again.")
|
||||
return null
|
||||
|
||||
query_list += "[word]'"
|
||||
@@ -512,7 +513,7 @@
|
||||
|
||||
else if(char == "\"")
|
||||
if(word != "")
|
||||
usr << "\red SDQL2: You have an error in your SDQL syntax, unexpected \" in query: \"<font color=gray>[query_text]</font>\" following \"<font color=gray>[word]</font>\". Please check your syntax, and try again."
|
||||
to_chat(usr, "\red SDQL2: You have an error in your SDQL syntax, unexpected \" in query: \"<font color=gray>[query_text]</font>\" following \"<font color=gray>[word]</font>\". Please check your syntax, and try again.")
|
||||
return null
|
||||
|
||||
word = "\""
|
||||
@@ -532,7 +533,7 @@
|
||||
word += char
|
||||
|
||||
if(i > len)
|
||||
usr << "\red SDQL2: You have an error in your SDQL syntax, unmatched \" in query: \"<font color=gray>[query_text]</font>\". Please check your syntax, and try again."
|
||||
to_chat(usr, "\red SDQL2: You have an error in your SDQL syntax, unmatched \" in query: \"<font color=gray>[query_text]</font>\". Please check your syntax, and try again.")
|
||||
return null
|
||||
|
||||
query_list += "[word]\""
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
|
||||
/datum/SDQL_parser/proc/parse_error(error_message)
|
||||
error = 1
|
||||
usr << "<span class='danger'>SQDL2 Parsing Error: [error_message]</span>"
|
||||
to_chat(usr, "<span class='danger'>SQDL2 Parsing Error: [error_message]</span>")
|
||||
return query.len + 1
|
||||
|
||||
/datum/SDQL_parser/proc/parse()
|
||||
@@ -116,18 +116,7 @@
|
||||
i = select_list(i + 1, select)
|
||||
node += "select"
|
||||
node["select"] = select
|
||||
var/list/from = list()
|
||||
if(tokenl(i) in list("from", "in"))
|
||||
i = from_list(i + 1, from)
|
||||
else
|
||||
from += "world"
|
||||
node += "from"
|
||||
node["from"] = from
|
||||
if(tokenl(i) == "where")
|
||||
var/list/where = list()
|
||||
i = bool_expression(i + 1, where)
|
||||
node += "where"
|
||||
node["where"] = where
|
||||
selectors(i, node)
|
||||
return i
|
||||
|
||||
//delete_query: 'DELETE' select_list [('FROM' | 'IN') from_list] ['WHERE' bool_expression]
|
||||
@@ -136,18 +125,7 @@
|
||||
i = select_list(i + 1, select)
|
||||
node += "delete"
|
||||
node["delete"] = select
|
||||
var/list/from = list()
|
||||
if(tokenl(i) in list("from", "in"))
|
||||
i = from_list(i + 1, from)
|
||||
else
|
||||
from += "world"
|
||||
node += "from"
|
||||
node["from"] = from
|
||||
if(tokenl(i) == "where")
|
||||
var/list/where = list()
|
||||
i = bool_expression(i + 1, where)
|
||||
node += "where"
|
||||
node["where"] = where
|
||||
selectors(i, node)
|
||||
return i
|
||||
|
||||
//update_query: 'UPDATE' select_list [('FROM' | 'IN') from_list] 'SET' assignments ['WHERE' bool_expression]
|
||||
@@ -156,52 +134,28 @@
|
||||
i = select_list(i + 1, select)
|
||||
node += "update"
|
||||
node["update"] = select
|
||||
var/list/from = list()
|
||||
if(tokenl(i) in list("from", "in"))
|
||||
i = from_list(i + 1, from)
|
||||
else
|
||||
from += "world"
|
||||
node += "from"
|
||||
node["from"] = from
|
||||
if(tokenl(i) != "set")
|
||||
i = parse_error("UPDATE has misplaced SET")
|
||||
var/list/set_assignments = list()
|
||||
i = assignments(i + 1, set_assignments)
|
||||
node += "set"
|
||||
node["set"] = set_assignments
|
||||
if(tokenl(i) == "where")
|
||||
var/list/where = list()
|
||||
i = bool_expression(i + 1, where)
|
||||
node += "where"
|
||||
node["where"] = where
|
||||
selectors(i, node)
|
||||
return i
|
||||
|
||||
//call_query: 'CALL' call_function ['ON' select_list [('FROM' | 'IN') from_list] ['WHERE' bool_expression]]
|
||||
/datum/SDQL_parser/proc/call_query(i, list/node)
|
||||
var/list/func = list()
|
||||
var/list/arguments = list()
|
||||
i = call_function(i + 1, func, arguments)
|
||||
i = variable(i + 1, func) // Yes technically does anything variable() matches but I don't care, if admins fuck up this badly then they shouldn't be allowed near SDQL.
|
||||
node += "call"
|
||||
node["call"] = func
|
||||
node["args"] = arguments
|
||||
if(tokenl(i) != "on")
|
||||
return i
|
||||
var/list/select = list()
|
||||
i = select_list(i + 1, select)
|
||||
node += "on"
|
||||
node["on"] = select
|
||||
var/list/from = list()
|
||||
if(tokenl(i) in list("from", "in"))
|
||||
i = from_list(i + 1, from)
|
||||
else
|
||||
from += "world"
|
||||
node += "from"
|
||||
node["from"] = from
|
||||
if(tokenl(i) == "where")
|
||||
var/list/where = list()
|
||||
i = bool_expression(i + 1, where)
|
||||
node += "where"
|
||||
node["where"] = where
|
||||
selectors(i, node)
|
||||
return i
|
||||
|
||||
//select_list: select_item [',' select_list]
|
||||
@@ -211,13 +165,6 @@
|
||||
i = select_list(i + 1, node)
|
||||
return i
|
||||
|
||||
//from_list: from_item [',' from_list]
|
||||
/datum/SDQL_parser/proc/from_list(i, list/node)
|
||||
i = from_item(i, node)
|
||||
if(token(i) == ",")
|
||||
i = from_list(i + 1, node)
|
||||
return i
|
||||
|
||||
//assignments: assignment, [',' assignments]
|
||||
/datum/SDQL_parser/proc/assignments(i, list/node)
|
||||
i = assignment(i, node)
|
||||
@@ -236,13 +183,33 @@
|
||||
i = object_type(i, node)
|
||||
return i
|
||||
|
||||
// Standardized method for handling the IN/FROM and WHERE options.
|
||||
/datum/SDQL_parser/proc/selectors(i, list/node)
|
||||
while (token(i))
|
||||
var/tok = tokenl(i)
|
||||
if(tok in list("from", "in"))
|
||||
var/list/from = list()
|
||||
i = from_item(i + 1, from)
|
||||
node["from"] = from
|
||||
continue
|
||||
if(tok == "where")
|
||||
var/list/where = list()
|
||||
i = bool_expression(i + 1, where)
|
||||
node["where"] = where
|
||||
continue
|
||||
parse_error("Expected either FROM, IN or WHERE token, found [token(i)] instead.")
|
||||
return i + 1
|
||||
if(!node.Find("from"))
|
||||
node["from"] = list("world")
|
||||
return i
|
||||
|
||||
//from_item: 'world' | object_type
|
||||
/datum/SDQL_parser/proc/from_item(i, list/node)
|
||||
if(token(i) == "world")
|
||||
node += "world"
|
||||
i++
|
||||
else
|
||||
i = object_type(i, node)
|
||||
i = expression(i, node)
|
||||
return i
|
||||
|
||||
//bool_expression: expression [bool_operator bool_expression]
|
||||
@@ -280,6 +247,19 @@
|
||||
if(token(i + 1) == ".")
|
||||
L += "."
|
||||
i = variable(i + 2, L)
|
||||
else if(token(i + 1) == "(") // OH BOY PROC
|
||||
var/list/arguments = list()
|
||||
i = call_function(i, null, arguments)
|
||||
L += ":"
|
||||
L[++L.len] = arguments
|
||||
else if(token(i + 1) == "\[")
|
||||
var/list/expression = list()
|
||||
i = expression(i + 2, expression)
|
||||
if (token(i) != "]")
|
||||
parse_error("Missing ] at the end of list access.")
|
||||
L += "\["
|
||||
L[++L.len] = expression
|
||||
i++
|
||||
else
|
||||
i++
|
||||
return i
|
||||
@@ -291,17 +271,36 @@
|
||||
return i + 1
|
||||
node += token(i)
|
||||
var/list/expression_list = list()
|
||||
if(token(i + 1) != "]")
|
||||
i++
|
||||
if(token(i) != "]")
|
||||
var/list/temp_expression_list = list()
|
||||
var/tok
|
||||
do
|
||||
i = expression(i + 1, temp_expression_list)
|
||||
if(token(i) == ",")
|
||||
tok = token(i)
|
||||
if(tok == "," || tok == ":")
|
||||
if(temp_expression_list == null)
|
||||
parse_error("Found ',' or ':' without expression in an array.")
|
||||
return i + 1
|
||||
expression_list[++expression_list.len] = temp_expression_list
|
||||
temp_expression_list = list()
|
||||
temp_expression_list = null
|
||||
if(tok == ":")
|
||||
temp_expression_list = list()
|
||||
i = expression(i + 1, temp_expression_list)
|
||||
expression_list[expression_list[expression_list.len]] = temp_expression_list
|
||||
temp_expression_list = null
|
||||
tok = token(i)
|
||||
if(tok != ",")
|
||||
if(tok == "]")
|
||||
break
|
||||
parse_error("Expected ',' or ']' after array assoc value, but found '[token(i)]'")
|
||||
return i
|
||||
i++
|
||||
continue
|
||||
temp_expression_list = list()
|
||||
i = expression(i, temp_expression_list)
|
||||
while(token(i) && token(i) != "]")
|
||||
expression_list[++expression_list.len] = temp_expression_list
|
||||
else
|
||||
i++
|
||||
if(temp_expression_list)
|
||||
expression_list[++expression_list.len] = temp_expression_list
|
||||
node[++node.len] = expression_list
|
||||
return i + 1
|
||||
|
||||
|
||||
@@ -81,12 +81,12 @@
|
||||
set name = "Adminhelp"
|
||||
|
||||
if(say_disabled) //This is here to try to identify lag problems
|
||||
usr << "<span class='danger'>Speech is currently admin-disabled.</span>"
|
||||
to_chat(usr, "<span class='danger'>Speech is currently admin-disabled.</span>")
|
||||
return
|
||||
|
||||
//handle muting and automuting
|
||||
if(prefs.muted & MUTE_ADMINHELP)
|
||||
src << "<span class='danger'>Error: Admin-PM: You cannot send adminhelps (Muted).</span>"
|
||||
to_chat(src, "<span class='danger'>Error: Admin-PM: You cannot send adminhelps (Muted).</span>")
|
||||
return
|
||||
if(src.handle_spam_prevention(msg,MUTE_ADMINHELP))
|
||||
return
|
||||
@@ -108,7 +108,7 @@
|
||||
return //this doesn't happen
|
||||
|
||||
var/ref_client = "\ref[src]"
|
||||
msg = "<span class='adminnotice'><b><font color=red>HELP: </font><A HREF='?priv_msg=[ckey];ahelp_reply=1'>[key_name(src)]</A> [ADMIN_QUE(mob)] [ADMIN_PP(mob)] [ADMIN_VV(mob)] [ADMIN_SM(mob)] [ADMIN_FLW(mob)] [ADMIN_TP(mob)] (<A HREF='?_src_=holder;rejectadminhelp=[ref_client]'>REJT</A>) (<A HREF='?_src_=holder;icissue=[ref_client]'>IC</A>):</b> [msg]</span>"
|
||||
msg = "<span class='adminnotice'><b><font color=red>HELP: </font><A HREF='?priv_msg=[ckey];ahelp_reply=1'>[key_name(src)]</A> [ADMIN_QUE(mob)] [ADMIN_PP(mob)] [ADMIN_VV(mob)] [ADMIN_SM(mob)] [ADMIN_FLW(mob)] [ADMIN_TP(mob)] [ADMIN_SMITE(mob)] (<A HREF='?_src_=holder;rejectadminhelp=[ref_client]'>REJT</A>) (<A HREF='?_src_=holder;icissue=[ref_client]'>IC</A>):</b> [msg]</span>"
|
||||
|
||||
//send this msg to all admins
|
||||
|
||||
@@ -116,17 +116,17 @@
|
||||
if(X.prefs.toggles & SOUND_ADMINHELP)
|
||||
X << 'sound/effects/adminhelp.ogg'
|
||||
window_flash(X, ignorepref = TRUE)
|
||||
X << msg
|
||||
to_chat(X, msg)
|
||||
|
||||
|
||||
//show it to the person adminhelping too
|
||||
src << "<span class='adminnotice'>PM to-<b>Admins</b>: [original_msg]</span>"
|
||||
to_chat(src, "<span class='adminnotice'>PM to-<b>Admins</b>: [original_msg]</span>")
|
||||
|
||||
//send it to irc if nobody is on and tell us how many were on
|
||||
var/admin_number_present = send2irc_adminless_only(ckey,original_msg)
|
||||
log_admin_private("HELP: [key_name(src)]: [original_msg] - heard by [admin_number_present] non-AFK admins who have +BAN.")
|
||||
if(admin_number_present <= 0)
|
||||
src << "<span class='notice'>No active admins are online, your adminhelp was sent to the admin irc.</span>"
|
||||
to_chat(src, "<span class='notice'>No active admins are online, your adminhelp was sent to the admin irc.</span>")
|
||||
feedback_add_details("admin_verb","AH") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
return
|
||||
|
||||
@@ -167,7 +167,7 @@
|
||||
return
|
||||
|
||||
/proc/send2otherserver(source,msg,type = "Ahelp")
|
||||
if(global.cross_allowed)
|
||||
if(config.cross_allowed)
|
||||
var/list/message = list()
|
||||
message["message_sender"] = source
|
||||
message["message"] = msg
|
||||
@@ -175,7 +175,7 @@
|
||||
message["key"] = global.comms_key
|
||||
message["crossmessage"] = type
|
||||
|
||||
world.Export("[global.cross_address]?[list2params(message)]")
|
||||
world.Export("[config.cross_address]?[list2params(message)]")
|
||||
|
||||
|
||||
/proc/ircadminwho()
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
set desc = "Area to jump to"
|
||||
set category = "Admin"
|
||||
if(!src.holder)
|
||||
src << "Only administrators may use this command."
|
||||
to_chat(src, "Only administrators may use this command.")
|
||||
return
|
||||
|
||||
if(!A)
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
var/turf/T = safepick(turfs)
|
||||
if(!T)
|
||||
src << "Nowhere to jump to!"
|
||||
to_chat(src, "Nowhere to jump to!")
|
||||
return
|
||||
usr.forceMove(T)
|
||||
log_admin("[key_name(usr)] jumped to [A]")
|
||||
@@ -29,7 +29,7 @@
|
||||
set name = "Jump to Turf"
|
||||
set category = "Admin"
|
||||
if(!src.holder)
|
||||
src << "Only administrators may use this command."
|
||||
to_chat(src, "Only administrators may use this command.")
|
||||
return
|
||||
|
||||
log_admin("[key_name(usr)] jumped to [T.x],[T.y],[T.z] in [T.loc]")
|
||||
@@ -43,7 +43,7 @@
|
||||
set name = "Jump to Mob"
|
||||
|
||||
if(!src.holder)
|
||||
src << "Only administrators may use this command."
|
||||
to_chat(src, "Only administrators may use this command.")
|
||||
return
|
||||
|
||||
log_admin("[key_name(usr)] jumped to [key_name(M)]")
|
||||
@@ -55,14 +55,14 @@
|
||||
feedback_add_details("admin_verb","JM") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
A.forceMove(M.loc)
|
||||
else
|
||||
A << "This mob is not located in the game world."
|
||||
to_chat(A, "This mob is not located in the game world.")
|
||||
|
||||
/client/proc/jumptocoord(tx as num, ty as num, tz as num)
|
||||
set category = "Admin"
|
||||
set name = "Jump to Coordinate"
|
||||
|
||||
if (!holder)
|
||||
src << "Only administrators may use this command."
|
||||
to_chat(src, "Only administrators may use this command.")
|
||||
return
|
||||
|
||||
if(src.mob)
|
||||
@@ -78,7 +78,7 @@
|
||||
set name = "Jump to Key"
|
||||
|
||||
if(!src.holder)
|
||||
src << "Only administrators may use this command."
|
||||
to_chat(src, "Only administrators may use this command.")
|
||||
return
|
||||
|
||||
var/list/keys = list()
|
||||
@@ -86,7 +86,7 @@
|
||||
keys += M.client
|
||||
var/selection = input("Please, select a player!", "Admin Jumping", null, null) as null|anything in sortKey(keys)
|
||||
if(!selection)
|
||||
src << "No keys found."
|
||||
to_chat(src, "No keys found.")
|
||||
return
|
||||
var/mob/M = selection:mob
|
||||
log_admin("[key_name(usr)] jumped to [key_name(M)]")
|
||||
@@ -101,7 +101,7 @@
|
||||
set name = "Get Mob"
|
||||
set desc = "Mob to teleport"
|
||||
if(!src.holder)
|
||||
src << "Only administrators may use this command."
|
||||
to_chat(src, "Only administrators may use this command.")
|
||||
return
|
||||
|
||||
log_admin("[key_name(usr)] teleported [key_name(M)]")
|
||||
@@ -115,7 +115,7 @@
|
||||
set desc = "Key to teleport"
|
||||
|
||||
if(!src.holder)
|
||||
src << "Only administrators may use this command."
|
||||
to_chat(src, "Only administrators may use this command.")
|
||||
return
|
||||
|
||||
var/list/keys = list()
|
||||
@@ -139,7 +139,7 @@
|
||||
set category = "Admin"
|
||||
set name = "Send Mob"
|
||||
if(!src.holder)
|
||||
src << "Only administrators may use this command."
|
||||
to_chat(src, "Only administrators may use this command.")
|
||||
return
|
||||
var/area/A = input(usr, "Pick an area.", "Pick an area") in sortedAreas|null
|
||||
if(A && istype(A))
|
||||
@@ -148,5 +148,5 @@
|
||||
log_admin("[key_name(usr)] teleported [key_name(M)] to [A]")
|
||||
message_admins("[key_name_admin(usr)] teleported [key_name_admin(M)] to [A]")
|
||||
else
|
||||
src << "Failed to move mob to a valid location."
|
||||
to_chat(src, "Failed to move mob to a valid location.")
|
||||
feedback_add_details("admin_verb","SMOB") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
set category = null
|
||||
set name = "Admin PM Mob"
|
||||
if(!holder)
|
||||
src << "<font color='red'>Error: Admin-PM-Context: Only administrators may use this command.</font>"
|
||||
to_chat(src, "<font color='red'>Error: Admin-PM-Context: Only administrators may use this command.</font>")
|
||||
return
|
||||
if( !ismob(M) || !M.client )
|
||||
return
|
||||
@@ -18,7 +18,7 @@
|
||||
set category = "Admin"
|
||||
set name = "Admin PM"
|
||||
if(!holder)
|
||||
src << "<font color='red'>Error: Admin-PM-Panel: Only administrators may use this command.</font>"
|
||||
to_chat(src, "<font color='red'>Error: Admin-PM-Panel: Only administrators may use this command.</font>")
|
||||
return
|
||||
var/list/client/targets[0]
|
||||
for(var/client/T)
|
||||
@@ -37,7 +37,7 @@
|
||||
|
||||
/client/proc/cmd_ahelp_reply(whom)
|
||||
if(prefs.muted & MUTE_ADMINHELP)
|
||||
src << "<font color='red'>Error: Admin-PM: You are unable to use admin PM-s (muted).</font>"
|
||||
to_chat(src, "<font color='red'>Error: Admin-PM: You are unable to use admin PM-s (muted).</font>")
|
||||
return
|
||||
var/client/C
|
||||
if(istext(whom))
|
||||
@@ -48,7 +48,7 @@
|
||||
C = whom
|
||||
if(!C)
|
||||
if(holder)
|
||||
src << "<font color='red'>Error: Admin-PM: Client not found.</font>"
|
||||
to_chat(src, "<font color='red'>Error: Admin-PM: Client not found.</font>")
|
||||
return
|
||||
message_admins("[key_name_admin(src)] has started replying to [key_name(C, 0, 0)]'s admin help.")
|
||||
var/msg = input(src,"Message:", "Private message to [key_name(C, 0, 0)]") as text|null
|
||||
@@ -61,7 +61,7 @@
|
||||
//Fetching a message if needed. src is the sender and C is the target client
|
||||
/client/proc/cmd_admin_pm(whom, msg)
|
||||
if(prefs.muted & MUTE_ADMINHELP)
|
||||
src << "<font color='red'>Error: Admin-PM: You are unable to use admin PM-s (muted).</font>"
|
||||
to_chat(src, "<font color='red'>Error: Admin-PM: You are unable to use admin PM-s (muted).</font>")
|
||||
return
|
||||
|
||||
var/client/C
|
||||
@@ -84,14 +84,14 @@
|
||||
if(!msg)
|
||||
return
|
||||
if(holder)
|
||||
src << "<font color='red'>Error: Use the admin IRC channel, nerd.</font>"
|
||||
to_chat(src, "<font color='red'>Error: Use the admin IRC channel, nerd.</font>")
|
||||
return
|
||||
|
||||
|
||||
else
|
||||
if(!C)
|
||||
if(holder)
|
||||
src << "<font color='red'>Error: Admin-PM: Client not found.</font>"
|
||||
to_chat(src, "<font color='red'>Error: Admin-PM: Client not found.</font>")
|
||||
else
|
||||
adminhelp(msg) //admin we are replying to left. adminhelp instead
|
||||
return
|
||||
@@ -104,12 +104,12 @@
|
||||
return
|
||||
|
||||
if(prefs.muted & MUTE_ADMINHELP)
|
||||
src << "<font color='red'>Error: Admin-PM: You are unable to use admin PM-s (muted).</font>"
|
||||
to_chat(src, "<font color='red'>Error: Admin-PM: You are unable to use admin PM-s (muted).</font>")
|
||||
return
|
||||
|
||||
if(!C)
|
||||
if(holder)
|
||||
src << "<font color='red'>Error: Admin-PM: Client not found.</font>"
|
||||
to_chat(src, "<font color='red'>Error: Admin-PM: Client not found.</font>")
|
||||
else
|
||||
adminhelp(msg) //admin we are replying to has vanished, adminhelp instead
|
||||
return
|
||||
@@ -131,18 +131,18 @@
|
||||
var/keywordparsedmsg = keywords_lookup(msg)
|
||||
|
||||
if(irc)
|
||||
src << "<font color='blue'>PM to-<b>Admins</b>: [rawmsg]</font>"
|
||||
to_chat(src, "<font color='blue'>PM to-<b>Admins</b>: [rawmsg]</font>")
|
||||
ircreplyamount--
|
||||
send2irc("Reply: [ckey]",rawmsg)
|
||||
else
|
||||
if(C.holder)
|
||||
if(holder) //both are admins
|
||||
C << "<font color='red'>Admin PM from-<b>[key_name(src, C, 1)]</b>: [keywordparsedmsg]</font>"
|
||||
src << "<font color='blue'>Admin PM to-<b>[key_name(C, src, 1)]</b>: [keywordparsedmsg]</font>"
|
||||
to_chat(C, "<font color='red'>Admin PM from-<b>[key_name(src, C, 1)]</b>: [keywordparsedmsg]</font>")
|
||||
to_chat(src, "<font color='blue'>Admin PM to-<b>[key_name(C, src, 1)]</b>: [keywordparsedmsg]</font>")
|
||||
|
||||
else //recipient is an admin but sender is not
|
||||
C << "<font color='red'>Reply PM from-<b>[key_name(src, C, 1)]</b>: [keywordparsedmsg]</font>"
|
||||
src << "<font color='blue'>PM to-<b>Admins</b>: [msg]</font>"
|
||||
to_chat(C, "<font color='red'>Reply PM from-<b>[key_name(src, C, 1)]</b>: [keywordparsedmsg]</font>")
|
||||
to_chat(src, "<font color='blue'>PM to-<b>Admins</b>: [msg]</font>")
|
||||
|
||||
//play the recieving admin the adminhelp sound (if they have them enabled)
|
||||
if(C.prefs.toggles & SOUND_ADMINHELP)
|
||||
@@ -150,10 +150,10 @@
|
||||
|
||||
else
|
||||
if(holder) //sender is an admin but recipient is not. Do BIG RED TEXT
|
||||
C << "<font color='red' size='4'><b>-- Administrator private message --</b></font>"
|
||||
C << "<font color='red'>Admin PM from-<b>[key_name(src, C, 0)]</b>: [msg]</font>"
|
||||
C << "<font color='red'><i>Click on the administrator's name to reply.</i></font>"
|
||||
src << "<font color='blue'>Admin PM to-<b>[key_name(C, src, 1)]</b>: [msg]</font>"
|
||||
to_chat(C, "<font color='red' size='4'><b>-- Administrator private message --</b></font>")
|
||||
to_chat(C, "<font color='red'>Admin PM from-<b>[key_name(src, C, 0)]</b>: [msg]</font>")
|
||||
to_chat(C, "<font color='red'><i>Click on the administrator's name to reply.</i></font>")
|
||||
to_chat(src, "<font color='blue'>Admin PM to-<b>[key_name(C, src, 1)]</b>: [msg]</font>")
|
||||
|
||||
//always play non-admin recipients the adminhelp sound
|
||||
C << 'sound/effects/adminhelp.ogg'
|
||||
@@ -172,20 +172,20 @@
|
||||
return
|
||||
|
||||
else //neither are admins
|
||||
src << "<font color='red'>Error: Admin-PM: Non-admin to non-admin PM communication is forbidden.</font>"
|
||||
to_chat(src, "<font color='red'>Error: Admin-PM: Non-admin to non-admin PM communication is forbidden.</font>")
|
||||
return
|
||||
|
||||
if(irc)
|
||||
log_admin_private("PM: [key_name(src)]->IRC: [rawmsg]")
|
||||
for(var/client/X in admins)
|
||||
X << "<B><font color='blue'>PM: [key_name(src, X, 0)]->IRC:</B> \blue [keywordparsedmsg]</font>" //inform X
|
||||
to_chat(X, "<B><font color='blue'>PM: [key_name(src, X, 0)]->IRC:</B> \blue [keywordparsedmsg]</font>" )
|
||||
else
|
||||
window_flash(C, ignorepref = TRUE)
|
||||
log_admin_private("PM: [key_name(src)]->[key_name(C)]: [rawmsg]")
|
||||
//we don't use message_admins here because the sender/receiver might get it too
|
||||
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)]->[key_name(C, X, 0)]:</B> \blue [keywordparsedmsg]</font>" //inform X
|
||||
to_chat(X, "<B><font color='blue'>PM: [key_name(src, X, 0)]->[key_name(C, X, 0)]:</B> \blue [keywordparsedmsg]</font>" )
|
||||
|
||||
|
||||
|
||||
@@ -211,9 +211,9 @@
|
||||
log_admin_private("IRC PM: [sender] -> [key_name(C)] : [msg]")
|
||||
msg = emoji_parse(msg)
|
||||
|
||||
C << "<font color='red' size='4'><b>-- Administrator private message --</b></font>"
|
||||
C << "<font color='red'>Admin PM from-<b><a href='?priv_msg=[stealthkey]'>[adminname]</A></b>: [msg]</font>"
|
||||
C << "<font color='red'><i>Click on the administrator's name to reply.</i></font>"
|
||||
to_chat(C, "<font color='red' size='4'><b>-- Administrator private message --</b></font>")
|
||||
to_chat(C, "<font color='red'>Admin PM from-<b><a href='?priv_msg=[stealthkey]'>[adminname]</A></b>: [msg]</font>")
|
||||
to_chat(C, "<font color='red'><i>Click on the administrator's name to reply.</i></font>")
|
||||
window_flash(C, ignorepref = TRUE)
|
||||
//always play non-admin recipients the adminhelp sound
|
||||
C << 'sound/effects/adminhelp.ogg'
|
||||
|
||||
@@ -13,10 +13,10 @@
|
||||
msg = keywords_lookup(msg)
|
||||
if(check_rights(R_ADMIN,0))
|
||||
msg = "<span class='admin'><span class='prefix'>ADMIN:</span> <EM>[key_name(usr, 1)]</EM> (<a href='?_src_=holder;adminplayerobservefollow=\ref[mob]'>FLW</A>): <span class='message'>[msg]</span></span>"
|
||||
admins << msg
|
||||
to_chat(admins, msg)
|
||||
else
|
||||
msg = "<span class='adminobserver'><span class='prefix'>ADMIN:</span> <EM>[key_name(usr, 1)]:</EM> <span class='message'>[msg]</span></span>"
|
||||
admins << msg
|
||||
to_chat(admins, msg)
|
||||
|
||||
feedback_add_details("admin_verb","M") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
|
||||
@@ -2,30 +2,30 @@
|
||||
set category = "Mapping"
|
||||
set name = "Check Plumbing"
|
||||
if(!src.holder)
|
||||
src << "Only administrators may use this command."
|
||||
to_chat(src, "Only administrators may use this command.")
|
||||
return
|
||||
feedback_add_details("admin_verb","CP") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
//all plumbing - yes, some things might get stated twice, doesn't matter.
|
||||
for (var/obj/machinery/atmospherics/plumbing in machines)
|
||||
if (plumbing.nodealert)
|
||||
usr << "Unconnected [plumbing.name] located at [plumbing.x],[plumbing.y],[plumbing.z] ([get_area(plumbing.loc)])"
|
||||
to_chat(usr, "Unconnected [plumbing.name] located at [plumbing.x],[plumbing.y],[plumbing.z] ([get_area(plumbing.loc)])")
|
||||
|
||||
//Manifolds
|
||||
for (var/obj/machinery/atmospherics/pipe/manifold/pipe in machines)
|
||||
if (!pipe.NODE1 || !pipe.NODE2 || !pipe.NODE3)
|
||||
usr << "Unconnected [pipe.name] located at [pipe.x],[pipe.y],[pipe.z] ([get_area(pipe.loc)])"
|
||||
to_chat(usr, "Unconnected [pipe.name] located at [pipe.x],[pipe.y],[pipe.z] ([get_area(pipe.loc)])")
|
||||
|
||||
//Pipes
|
||||
for (var/obj/machinery/atmospherics/pipe/simple/pipe in machines)
|
||||
if (!pipe.NODE1 || !pipe.NODE2)
|
||||
usr << "Unconnected [pipe.name] located at [pipe.x],[pipe.y],[pipe.z] ([get_area(pipe.loc)])"
|
||||
to_chat(usr, "Unconnected [pipe.name] located at [pipe.x],[pipe.y],[pipe.z] ([get_area(pipe.loc)])")
|
||||
|
||||
/client/proc/powerdebug()
|
||||
set category = "Mapping"
|
||||
set name = "Check Power"
|
||||
if(!src.holder)
|
||||
src << "Only administrators may use this command."
|
||||
to_chat(src, "Only administrators may use this command.")
|
||||
return
|
||||
feedback_add_details("admin_verb","CPOW") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
@@ -33,9 +33,9 @@
|
||||
if (!PN.nodes || !PN.nodes.len)
|
||||
if(PN.cables && (PN.cables.len > 1))
|
||||
var/obj/structure/cable/C = PN.cables[1]
|
||||
usr << "Powernet with no nodes! (number [PN.number]) - example cable at [C.x], [C.y], [C.z] in area [get_area(C.loc)]"
|
||||
to_chat(usr, "Powernet with no nodes! (number [PN.number]) - example cable at [C.x], [C.y], [C.z] in area [get_area(C.loc)]")
|
||||
|
||||
if (!PN.cables || (PN.cables.len < 10))
|
||||
if(PN.cables && (PN.cables.len > 1))
|
||||
var/obj/structure/cable/C = PN.cables[1]
|
||||
usr << "Powernet with fewer than 10 cables! (number [PN.number]) - example cable at [C.x], [C.y], [C.z] in area [get_area(C.loc)]"
|
||||
to_chat(usr, "Powernet with fewer than 10 cables! (number [PN.number]) - example cable at [C.x], [C.y], [C.z] in area [get_area(C.loc)]")
|
||||
@@ -8,7 +8,7 @@
|
||||
var/mob/living/target = M
|
||||
|
||||
if(!isliving(target))
|
||||
usr << "This can only be used on instances of type /mob/living"
|
||||
to_chat(usr, "This can only be used on instances of type /mob/living")
|
||||
return
|
||||
|
||||
if(alert(usr, "Are you sure you wish to hit [key_name(target)] with Blue Space Artillery?", "Confirm Firing?" , "Yes" , "No") != "Yes")
|
||||
@@ -23,7 +23,7 @@
|
||||
else
|
||||
T.break_tile()
|
||||
|
||||
target << "<span class='userdanger'>You're hit by bluespace artillery!</span>"
|
||||
to_chat(target, "<span class='userdanger'>You're hit by bluespace artillery!</span>")
|
||||
log_admin("[key_name(target)] has been hit by Bluespace Artillery fired by [key_name(usr)]")
|
||||
message_admins("[ADMIN_LOOKUPFLW(target)] has been hit by Bluespace Artillery fired by [ADMIN_LOOKUPFLW(usr)]")
|
||||
|
||||
|
||||
@@ -116,45 +116,45 @@
|
||||
/datum/buildmode/proc/show_help(mob/user)
|
||||
switch(mode)
|
||||
if(BASIC_BUILDMODE)
|
||||
user << "\blue ***********************************************************"
|
||||
user << "\blue Left Mouse Button = Construct / Upgrade"
|
||||
user << "\blue Right Mouse Button = Deconstruct / Delete / Downgrade"
|
||||
user << "\blue Left Mouse Button + ctrl = R-Window"
|
||||
user << "\blue Left Mouse Button + alt = Airlock"
|
||||
user << ""
|
||||
user << "\blue Use the button in the upper left corner to"
|
||||
user << "\blue change the direction of built objects."
|
||||
user << "\blue ***********************************************************"
|
||||
to_chat(user, "\blue ***********************************************************")
|
||||
to_chat(user, "\blue Left Mouse Button = Construct / Upgrade")
|
||||
to_chat(user, "\blue Right Mouse Button = Deconstruct / Delete / Downgrade")
|
||||
to_chat(user, "\blue Left Mouse Button + ctrl = R-Window")
|
||||
to_chat(user, "\blue Left Mouse Button + alt = Airlock")
|
||||
to_chat(user, "")
|
||||
to_chat(user, "\blue Use the button in the upper left corner to")
|
||||
to_chat(user, "\blue change the direction of built objects.")
|
||||
to_chat(user, "\blue ***********************************************************")
|
||||
if(ADV_BUILDMODE)
|
||||
user << "\blue ***********************************************************"
|
||||
user << "\blue Right Mouse Button on buildmode button = Set object type"
|
||||
user << "\blue Left Mouse Button on turf/obj = Place objects"
|
||||
user << "\blue Right Mouse Button = Delete objects"
|
||||
user << ""
|
||||
user << "\blue Use the button in the upper left corner to"
|
||||
user << "\blue change the direction of built objects."
|
||||
user << "\blue ***********************************************************"
|
||||
to_chat(user, "\blue ***********************************************************")
|
||||
to_chat(user, "\blue Right Mouse Button on buildmode button = Set object type")
|
||||
to_chat(user, "\blue Left Mouse Button on turf/obj = Place objects")
|
||||
to_chat(user, "\blue Right Mouse Button = Delete objects")
|
||||
to_chat(user, "")
|
||||
to_chat(user, "\blue Use the button in the upper left corner to")
|
||||
to_chat(user, "\blue change the direction of built objects.")
|
||||
to_chat(user, "\blue ***********************************************************")
|
||||
if(VAR_BUILDMODE)
|
||||
user << "\blue ***********************************************************"
|
||||
user << "\blue Right Mouse Button on buildmode button = Select var(type) & value"
|
||||
user << "\blue Left Mouse Button on turf/obj/mob = Set var(type) & value"
|
||||
user << "\blue Right Mouse Button on turf/obj/mob = Reset var's value"
|
||||
user << "\blue ***********************************************************"
|
||||
to_chat(user, "\blue ***********************************************************")
|
||||
to_chat(user, "\blue Right Mouse Button on buildmode button = Select var(type) & value")
|
||||
to_chat(user, "\blue Left Mouse Button on turf/obj/mob = Set var(type) & value")
|
||||
to_chat(user, "\blue Right Mouse Button on turf/obj/mob = Reset var's value")
|
||||
to_chat(user, "\blue ***********************************************************")
|
||||
if(THROW_BUILDMODE)
|
||||
user << "\blue ***********************************************************"
|
||||
user << "\blue Left Mouse Button on turf/obj/mob = Select"
|
||||
user << "\blue Right Mouse Button on turf/obj/mob = Throw"
|
||||
user << "\blue ***********************************************************"
|
||||
to_chat(user, "\blue ***********************************************************")
|
||||
to_chat(user, "\blue Left Mouse Button on turf/obj/mob = Select")
|
||||
to_chat(user, "\blue Right Mouse Button on turf/obj/mob = Throw")
|
||||
to_chat(user, "\blue ***********************************************************")
|
||||
if(AREA_BUILDMODE)
|
||||
user << "\blue ***********************************************************"
|
||||
user << "\blue Left Mouse Button on turf/obj/mob = Select corner"
|
||||
user << "\blue Right Mouse Button on buildmode button = Select generator"
|
||||
user << "\blue ***********************************************************"
|
||||
to_chat(user, "\blue ***********************************************************")
|
||||
to_chat(user, "\blue Left Mouse Button on turf/obj/mob = Select corner")
|
||||
to_chat(user, "\blue Right Mouse Button on buildmode button = Select generator")
|
||||
to_chat(user, "\blue ***********************************************************")
|
||||
if(COPY_BUILDMODE)
|
||||
user << "\blue ***********************************************************"
|
||||
user << "\blue Left Mouse Button on obj/turf/mob = Spawn a Copy of selected target"
|
||||
user << "\blue Right Mouse Button on obj/mob = Select target to copy"
|
||||
user << "\blue ***********************************************************"
|
||||
to_chat(user, "\blue ***********************************************************")
|
||||
to_chat(user, "\blue Left Mouse Button on obj/turf/mob = Spawn a Copy of selected target")
|
||||
to_chat(user, "\blue Right Mouse Button on obj/mob = Select target to copy")
|
||||
to_chat(user, "\blue ***********************************************************")
|
||||
|
||||
/datum/buildmode/proc/change_settings(mob/user)
|
||||
switch(mode)
|
||||
@@ -284,7 +284,7 @@
|
||||
var/obj/structure/window/reinforced/WIN = new/obj/structure/window/reinforced(get_turf(object))
|
||||
WIN.setDir(WEST)
|
||||
if(NORTHWEST)
|
||||
var/obj/structure/window/reinforced/WIN = new/obj/structure/window/reinforced(get_turf(object))
|
||||
var/obj/structure/window/reinforced/WIN = new/obj/structure/window/reinforced/fulltile(get_turf(object))
|
||||
WIN.setDir(NORTHWEST)
|
||||
log_admin("Build Mode: [key_name(user)] built a window at ([object.x],[object.y],[object.z])")
|
||||
if(ADV_BUILDMODE)
|
||||
@@ -308,13 +308,13 @@
|
||||
log_admin("Build Mode: [key_name(user)] modified [object.name]'s [varholder] to [valueholder]")
|
||||
object.vars[varholder] = valueholder
|
||||
else
|
||||
user << "<span class='warning'>[initial(object.name)] does not have a var called '[varholder]'</span>"
|
||||
to_chat(user, "<span class='warning'>[initial(object.name)] does not have a var called '[varholder]'</span>")
|
||||
if(right_click)
|
||||
if(object.vars.Find(varholder))
|
||||
log_admin("Build Mode: [key_name(user)] modified [object.name]'s [varholder] to [valueholder]")
|
||||
object.vars[varholder] = initial(object.vars[varholder])
|
||||
else
|
||||
user << "<span class='warning'>[initial(object.name)] does not have a var called '[varholder]'</span>"
|
||||
to_chat(user, "<span class='warning'>[initial(object.name)] does not have a var called '[varholder]'</span>")
|
||||
|
||||
if(THROW_BUILDMODE)
|
||||
if(left_click)
|
||||
@@ -335,7 +335,7 @@
|
||||
if(left_click) //rectangular
|
||||
if(cornerA && cornerB)
|
||||
if(!generator_path)
|
||||
user << "<span class='warning'>Select generator type first.</span>"
|
||||
to_chat(user, "<span class='warning'>Select generator type first.</span>")
|
||||
var/datum/mapGenerator/G = new generator_path
|
||||
G.defineRegion(cornerA,cornerB,1)
|
||||
G.generate()
|
||||
@@ -352,4 +352,4 @@
|
||||
DuplicateObject(stored,perfectcopy=1,newloc=T)
|
||||
else if(right_click)
|
||||
if(ismovableatom(object)) // No copying turfs for now.
|
||||
stored = object
|
||||
stored = object
|
||||
|
||||
@@ -3,12 +3,12 @@
|
||||
set name = "Dsay" //Gave this shit a shorter name so you only have to time out "dsay" rather than "dead say" to use it --NeoFite
|
||||
set hidden = 1
|
||||
if(!src.holder)
|
||||
src << "Only administrators may use this command."
|
||||
to_chat(src, "Only administrators may use this command.")
|
||||
return
|
||||
if(!src.mob)
|
||||
return
|
||||
if(prefs.muted & MUTE_DEADCHAT)
|
||||
src << "<span class='danger'>You cannot send DSAY messages (muted).</span>"
|
||||
to_chat(src, "<span class='danger'>You cannot send DSAY messages (muted).</span>")
|
||||
return
|
||||
|
||||
if (src.handle_spam_prevention(msg,MUTE_DEADCHAT))
|
||||
|
||||
@@ -53,12 +53,12 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
|
||||
return
|
||||
|
||||
if(targetselected && !hascall(target,procname))
|
||||
usr << "<font color='red'>Error: callproc(): type [target.type] has no proc named [procname].</font>"
|
||||
to_chat(usr, "<font color='red'>Error: callproc(): type [target.type] has no proc named [procname].</font>")
|
||||
return
|
||||
else
|
||||
var/procpath = text2path(procname)
|
||||
if (!procpath)
|
||||
usr << "<font color='red'>Error: callproc(): proc [procname] does not exist. (Did you forget the /proc/ part?)</font>"
|
||||
to_chat(usr, "<font color='red'>Error: callproc(): proc [procname] does not exist. (Did you forget the /proc/ part?)</font>")
|
||||
return
|
||||
var/list/lst = get_callproc_args()
|
||||
if(!lst)
|
||||
@@ -66,7 +66,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
|
||||
|
||||
if(targetselected)
|
||||
if(!target)
|
||||
usr << "<font color='red'>Error: callproc(): owner of proc no longer exists.</font>"
|
||||
to_chat(usr, "<font color='red'>Error: callproc(): owner of proc no longer exists.</font>")
|
||||
return
|
||||
log_admin("[key_name(src)] called [target]'s [procname]() with [lst.len ? "the arguments [list2params(lst)]":"no arguments"].")
|
||||
message_admins("[key_name(src)] called [target]'s [procname]() with [lst.len ? "the arguments [list2params(lst)]":"no arguments"].")
|
||||
@@ -78,7 +78,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
|
||||
returnval = call(procname)(arglist(lst)) // Pass the lst as an argument list to the proc
|
||||
. = get_callproc_returnval(returnval, procname)
|
||||
if(.)
|
||||
usr << .
|
||||
to_chat(usr, .)
|
||||
feedback_add_details("admin_verb","APC") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
/client/proc/callproc_datum(datum/A as null|area|mob|obj|turf)
|
||||
@@ -93,14 +93,14 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
|
||||
if(!procname)
|
||||
return
|
||||
if(!hascall(A,procname))
|
||||
usr << "<font color='red'>Error: callproc_datum(): type [A.type] has no proc named [procname].</font>"
|
||||
to_chat(usr, "<font color='red'>Error: callproc_datum(): type [A.type] has no proc named [procname].</font>")
|
||||
return
|
||||
var/list/lst = get_callproc_args()
|
||||
if(!lst)
|
||||
return
|
||||
|
||||
if(!A || !IsValidSrc(A))
|
||||
usr << "<span class='warning'>Error: callproc_datum(): owner of proc no longer exists.</span>"
|
||||
to_chat(usr, "<span class='warning'>Error: callproc_datum(): owner of proc no longer exists.</span>")
|
||||
return
|
||||
log_admin("[key_name(src)] called [A]'s [procname]() with [lst.len ? "the arguments [list2params(lst)]":"no arguments"].")
|
||||
message_admins("[key_name(src)] called [A]'s [procname]() with [lst.len ? "the arguments [list2params(lst)]":"no arguments"].")
|
||||
@@ -109,7 +109,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
|
||||
var/returnval = call(A,procname)(arglist(lst)) // Pass the lst as an argument list to the proc
|
||||
. = get_callproc_returnval(returnval,procname)
|
||||
if(.)
|
||||
usr << .
|
||||
to_chat(usr, .)
|
||||
|
||||
|
||||
|
||||
@@ -174,7 +174,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
|
||||
if(id in hardcoded_gases || env_gases[id][MOLES])
|
||||
t+= "[env_gases[id][GAS_META][META_GAS_NAME]] : [env_gases[id][MOLES]]\n"
|
||||
|
||||
usr << t
|
||||
to_chat(usr, t)
|
||||
feedback_add_details("admin_verb","ASL") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
/client/proc/cmd_admin_robotize(mob/M in mob_list)
|
||||
@@ -507,33 +507,33 @@ var/list/TYPES_SHORTCUTS = list(
|
||||
var/list/areas_without_intercom = areas_all - areas_with_intercom
|
||||
var/list/areas_without_camera = areas_all - areas_with_camera
|
||||
|
||||
world << "<b>AREAS WITHOUT AN APC:</b>"
|
||||
to_chat(world, "<b>AREAS WITHOUT AN APC:</b>")
|
||||
for(var/areatype in areas_without_APC)
|
||||
world << "* [areatype]"
|
||||
to_chat(world, "* [areatype]")
|
||||
|
||||
world << "<b>AREAS WITHOUT AN AIR ALARM:</b>"
|
||||
to_chat(world, "<b>AREAS WITHOUT AN AIR ALARM:</b>")
|
||||
for(var/areatype in areas_without_air_alarm)
|
||||
world << "* [areatype]"
|
||||
to_chat(world, "* [areatype]")
|
||||
|
||||
world << "<b>AREAS WITHOUT A REQUEST CONSOLE:</b>"
|
||||
to_chat(world, "<b>AREAS WITHOUT A REQUEST CONSOLE:</b>")
|
||||
for(var/areatype in areas_without_RC)
|
||||
world << "* [areatype]"
|
||||
to_chat(world, "* [areatype]")
|
||||
|
||||
world << "<b>AREAS WITHOUT ANY LIGHTS:</b>"
|
||||
to_chat(world, "<b>AREAS WITHOUT ANY LIGHTS:</b>")
|
||||
for(var/areatype in areas_without_light)
|
||||
world << "* [areatype]"
|
||||
to_chat(world, "* [areatype]")
|
||||
|
||||
world << "<b>AREAS WITHOUT A LIGHT SWITCH:</b>"
|
||||
to_chat(world, "<b>AREAS WITHOUT A LIGHT SWITCH:</b>")
|
||||
for(var/areatype in areas_without_LS)
|
||||
world << "* [areatype]"
|
||||
to_chat(world, "* [areatype]")
|
||||
|
||||
world << "<b>AREAS WITHOUT ANY INTERCOMS:</b>"
|
||||
to_chat(world, "<b>AREAS WITHOUT ANY INTERCOMS:</b>")
|
||||
for(var/areatype in areas_without_intercom)
|
||||
world << "* [areatype]"
|
||||
to_chat(world, "* [areatype]")
|
||||
|
||||
world << "<b>AREAS WITHOUT ANY CAMERAS:</b>"
|
||||
to_chat(world, "<b>AREAS WITHOUT ANY CAMERAS:</b>")
|
||||
for(var/areatype in areas_without_camera)
|
||||
world << "* [areatype]"
|
||||
to_chat(world, "* [areatype]")
|
||||
|
||||
/client/proc/cmd_admin_dress(mob/living/carbon/human/M in mob_list)
|
||||
set category = "Fun"
|
||||
@@ -663,19 +663,19 @@ var/list/TYPES_SHORTCUTS = list(
|
||||
|
||||
switch(input("Which list?") in list("Players","Admins","Mobs","Living Mobs","Dead Mobs","Clients","Joined Clients"))
|
||||
if("Players")
|
||||
usr << jointext(player_list,",")
|
||||
to_chat(usr, jointext(player_list,","))
|
||||
if("Admins")
|
||||
usr << jointext(admins,",")
|
||||
to_chat(usr, jointext(admins,","))
|
||||
if("Mobs")
|
||||
usr << jointext(mob_list,",")
|
||||
to_chat(usr, jointext(mob_list,","))
|
||||
if("Living Mobs")
|
||||
usr << jointext(living_mob_list,",")
|
||||
to_chat(usr, jointext(living_mob_list,","))
|
||||
if("Dead Mobs")
|
||||
usr << jointext(dead_mob_list,",")
|
||||
to_chat(usr, jointext(dead_mob_list,","))
|
||||
if("Clients")
|
||||
usr << jointext(clients,",")
|
||||
to_chat(usr, jointext(clients,","))
|
||||
if("Joined Clients")
|
||||
usr << jointext(joined_player_list,",")
|
||||
to_chat(usr, jointext(joined_player_list,","))
|
||||
|
||||
/client/proc/cmd_display_del_log()
|
||||
set category = "Debug"
|
||||
@@ -734,8 +734,8 @@ var/list/TYPES_SHORTCUTS = list(
|
||||
if(istype(landmark))
|
||||
var/datum/map_template/ruin/template = landmark.ruin_template
|
||||
usr.forceMove(get_turf(landmark))
|
||||
usr << "<span class='name'>[template.name]</span>"
|
||||
usr << "<span class='italics'>[template.description]</span>"
|
||||
to_chat(usr, "<span class='name'>[template.name]</span>")
|
||||
to_chat(usr, "<span class='italics'>[template.description]</span>")
|
||||
|
||||
/client/proc/clear_dynamic_transit()
|
||||
set category = "Debug"
|
||||
@@ -771,4 +771,17 @@ var/list/TYPES_SHORTCUTS = list(
|
||||
if(!holder)
|
||||
return
|
||||
|
||||
error_cache.show_to(src)
|
||||
error_cache.show_to(src)
|
||||
|
||||
/client/proc/pump_random_event()
|
||||
set category = "Debug"
|
||||
set name = "Pump Random Event"
|
||||
set desc = "Schedules the event subsystem to fire a new random event immediately. Some events may fire without notification."
|
||||
if(!holder)
|
||||
return
|
||||
|
||||
SSevent.scheduled = world.time
|
||||
|
||||
message_admins("<span class='adminnotice'>[key_name_admin(src)] pumped a random event.</span>")
|
||||
feedback_add_details("admin_verb","PRE")
|
||||
log_admin("[key_name(src)] pumped a random event.")
|
||||
@@ -13,9 +13,9 @@
|
||||
if(T.active_hotspot)
|
||||
burning = 1
|
||||
|
||||
usr << "<span class='adminnotice'>@[target.x],[target.y]: [GM.temperature] Kelvin, [GM.return_pressure()] kPa [(burning)?("\red BURNING"):(null)]</span>"
|
||||
to_chat(usr, "<span class='adminnotice'>@[target.x],[target.y]: [GM.temperature] Kelvin, [GM.return_pressure()] kPa [(burning)?("\red BURNING"):(null)]</span>")
|
||||
for(var/id in GM_gases)
|
||||
usr << "[GM_gases[id][GAS_META][META_GAS_NAME]]: [GM_gases[id][MOLES]]"
|
||||
to_chat(usr, "[GM_gases[id][GAS_META][META_GAS_NAME]]: [GM_gases[id][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()
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
var/new_fps = round(input("Sets game frames-per-second. Can potentially break the game (default: [config.fps])","FPS", world.fps) as num|null)
|
||||
|
||||
if(new_fps <= 0)
|
||||
src << "<span class='danger'>Error: set_server_fps(): Invalid world.fps value. No changes made.</span>"
|
||||
to_chat(src, "<span class='danger'>Error: set_server_fps(): Invalid world.fps value. No changes made.</span>")
|
||||
return
|
||||
if(new_fps > config.fps*1.5)
|
||||
if(alert(src, "You are setting fps to a high value:\n\t[new_fps] frames-per-second\n\tconfig.fps = [config.fps]","Warning!","Confirm","ABORT-ABORT-ABORT") != "Confirm")
|
||||
|
||||
@@ -24,16 +24,16 @@
|
||||
set category = null
|
||||
|
||||
if(!src.holder)
|
||||
src << "<font color='red'>Only Admins may use this command.</font>"
|
||||
to_chat(src, "<font color='red'>Only Admins may use this command.</font>")
|
||||
return
|
||||
|
||||
var/client/target = input(src,"Choose somebody to grant access to the server's runtime logs (permissions expire at the end of each round):","Grant Permissions",null) as null|anything in clients
|
||||
if(!istype(target,/client))
|
||||
src << "<font color='red'>Error: giveruntimelog(): Client not found.</font>"
|
||||
to_chat(src, "<font color='red'>Error: giveruntimelog(): Client not found.</font>")
|
||||
return
|
||||
|
||||
target.verbs |= /client/proc/getruntimelog
|
||||
target << "<font color='red'>You have been granted access to runtime logs. Please use them responsibly or risk being banned.</font>"
|
||||
to_chat(target, "<font color='red'>You have been granted access to runtime logs. Please use them responsibly or risk being banned.</font>")
|
||||
return
|
||||
|
||||
|
||||
@@ -52,8 +52,8 @@
|
||||
return
|
||||
|
||||
message_admins("[key_name_admin(src)] accessed file: [path]")
|
||||
src << ftp( file(path) )
|
||||
src << "Attempting to send file, this may take a fair few minutes if the file is very large."
|
||||
src << ftp(file(path))
|
||||
to_chat(src, "Attempting to send file, this may take a fair few minutes if the file is very large.")
|
||||
return
|
||||
|
||||
|
||||
@@ -72,8 +72,8 @@
|
||||
return
|
||||
|
||||
message_admins("[key_name_admin(src)] accessed file: [path]")
|
||||
src << ftp( file(path) )
|
||||
src << "Attempting to send file, this may take a fair few minutes if the file is very large."
|
||||
src << ftp(file(path))
|
||||
to_chat(src, "Attempting to send file, this may take a fair few minutes if the file is very large.")
|
||||
return
|
||||
|
||||
|
||||
@@ -88,7 +88,7 @@
|
||||
if(fexists("[diary]"))
|
||||
src << ftp(diary)
|
||||
else
|
||||
src << "<font color='red'>Server log not found, try using .getserverlog.</font>"
|
||||
to_chat(src, "<font color='red'>Server log not found, try using .getserverlog.</font>")
|
||||
return
|
||||
feedback_add_details("admin_verb","VTL") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
return
|
||||
@@ -102,7 +102,7 @@
|
||||
if(fexists("[diaryofmeanpeople]"))
|
||||
src << ftp(diaryofmeanpeople)
|
||||
else
|
||||
src << "<font color='red'>Server attack log not found, try using .getserverlog.</font>"
|
||||
to_chat(src, "<font color='red'>Server attack log not found, try using .getserverlog.</font>")
|
||||
return
|
||||
feedback_add_details("admin_verb","SSAL") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
return
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
/proc/show_individual_logging_panel(mob/M, type = INDIVIDUAL_ATTACK_LOG)
|
||||
if(!M || !ismob(M))
|
||||
return
|
||||
var/dat = "<center><a href='?_src_=holder;individuallog=\ref[M];log_type=[INDIVIDUAL_ATTACK_LOG]'>Attack log</a> | "
|
||||
dat += "<a href='?_src_=holder;individuallog=\ref[M];log_type=[INDIVIDUAL_SAY_LOG]'>Say log</a> | "
|
||||
dat += "<a href='?_src_=holder;individuallog=\ref[M];log_type=[INDIVIDUAL_EMOTE_LOG]'>Emote log</a> | "
|
||||
dat += "<a href='?_src_=holder;individuallog=\ref[M];log_type=[INDIVIDUAL_OOC_LOG]'>OOC log</a> | "
|
||||
dat += "<a href='?_src_=holder;individuallog=\ref[M];log_type=[INDIVIDUAL_SHOW_ALL_LOG]'>Show all</a> | "
|
||||
dat += "<a href='?_src_=holder;individuallog=\ref[M];log_type=[type]'>Refresh</a></center>"
|
||||
|
||||
dat += "<hr style='background:#000000; border:0; height:1px'>"
|
||||
|
||||
|
||||
|
||||
if(type == INDIVIDUAL_SHOW_ALL_LOG)
|
||||
dat += "<center>Displaying all logs of [key_name(M)]</center><br><hr>"
|
||||
for(var/log_type in M.logging)
|
||||
dat += "<center>[log_type]</center><br>"
|
||||
for(var/entry in M.logging[log_type])
|
||||
dat += "<font size=2px>[entry]: [M.logging[log_type][entry]]</font><br>"
|
||||
dat += "<hr>"
|
||||
else
|
||||
dat += "<center>[type] of [key_name(M)]</center><br>"
|
||||
for(var/entry in M.logging[type])
|
||||
dat += "<font size=2px>[entry]: [M.logging[type][entry]]</font><hr>"
|
||||
|
||||
usr << browse(dat, "window=invidual_logging;size=600x480")
|
||||
@@ -21,7 +21,7 @@
|
||||
if(template.load(T, centered = TRUE))
|
||||
message_admins("<span class='adminnotice'>[key_name_admin(usr)] has placed a map template ([template.name]) at <A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[T.x];Y=[T.y];Z=[T.z]'>(JMP)</a></span>")
|
||||
else
|
||||
usr << "Failed to place map"
|
||||
to_chat(usr, "Failed to place map")
|
||||
usr.client.images -= preview
|
||||
|
||||
/client/proc/map_template_upload()
|
||||
@@ -32,13 +32,13 @@
|
||||
if(!map)
|
||||
return
|
||||
if(copytext("[map]",-4) != ".dmm")
|
||||
usr << "Bad map file: [map]"
|
||||
to_chat(usr, "Bad map file: [map]")
|
||||
return
|
||||
|
||||
var/datum/map_template/M = new(map, "[map]")
|
||||
if(M.preload_size(map))
|
||||
usr << "Map template '[map]' ready to place ([M.width]x[M.height])"
|
||||
to_chat(usr, "Map template '[map]' ready to place ([M.width]x[M.height])")
|
||||
SSmapping.map_templates[M.name] = M
|
||||
message_admins("<span class='adminnotice'>[key_name_admin(usr)] has uploaded a map template ([map])</span>")
|
||||
else
|
||||
usr << "Map template '[map]' failed to load properly"
|
||||
to_chat(usr, "Map template '[map]' failed to load properly")
|
||||
|
||||
@@ -215,9 +215,9 @@ var/list/admin_verbs_debug_mapping = list(
|
||||
if(i*10+j <= atom_list.len)
|
||||
temp_atom = atom_list[i*10+j]
|
||||
line += " no.[i+10+j]@\[[temp_atom.x], [temp_atom.y], [temp_atom.z]\]; "
|
||||
world << line*/
|
||||
to_chat(world, line)*/
|
||||
|
||||
world << "There are [count] objects of type [type_path] on z-level [num_level]"
|
||||
to_chat(world, "There are [count] objects of type [type_path] on z-level [num_level]")
|
||||
feedback_add_details("admin_verb","mOBJZ") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
/client/proc/count_objects_all()
|
||||
@@ -242,9 +242,9 @@ var/list/admin_verbs_debug_mapping = list(
|
||||
if(i*10+j <= atom_list.len)
|
||||
temp_atom = atom_list[i*10+j]
|
||||
line += " no.[i+10+j]@\[[temp_atom.x], [temp_atom.y], [temp_atom.z]\]; "
|
||||
world << line*/
|
||||
to_chat(world, line)*/
|
||||
|
||||
world << "There are [count] objects of type [type_path] in the game world"
|
||||
to_chat(world, "There are [count] objects of type [type_path] in the game world")
|
||||
feedback_add_details("admin_verb","mOBJ") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
|
||||
|
||||
@@ -7,27 +7,27 @@
|
||||
message_admins("[key_name_admin(usr)] is forcing a random map rotation.")
|
||||
log_admin("[key_name(usr)] is forcing a random map rotation.")
|
||||
ticker.maprotatechecked = 1
|
||||
maprotate()
|
||||
SSmapping.maprotate()
|
||||
|
||||
/client/proc/adminchangemap()
|
||||
set category = "Server"
|
||||
set name = "Change Map"
|
||||
var/list/maprotatechoices = list()
|
||||
for (var/map in config.maplist)
|
||||
var/datum/votablemap/VM = config.maplist[map]
|
||||
var/mapname = VM.friendlyname
|
||||
var/datum/map_config/VM = config.maplist[map]
|
||||
var/mapname = VM.map_name
|
||||
if (VM == config.defaultmap)
|
||||
mapname += " (Default)"
|
||||
|
||||
if (VM.minusers > 0 || VM.maxusers > 0)
|
||||
if (VM.config_min_users > 0 || VM.config_max_users > 0)
|
||||
mapname += " \["
|
||||
if (VM.minusers > 0)
|
||||
mapname += "[VM.minusers]"
|
||||
if (VM.config_min_users > 0)
|
||||
mapname += "[VM.config_min_users]"
|
||||
else
|
||||
mapname += "0"
|
||||
mapname += "-"
|
||||
if (VM.maxusers > 0)
|
||||
mapname += "[VM.maxusers]"
|
||||
if (VM.config_max_users > 0)
|
||||
mapname += "[VM.config_max_users]"
|
||||
else
|
||||
mapname += "inf"
|
||||
mapname += "\]"
|
||||
@@ -37,8 +37,8 @@
|
||||
if (!chosenmap)
|
||||
return
|
||||
ticker.maprotatechecked = 1
|
||||
var/datum/votablemap/VM = maprotatechoices[chosenmap]
|
||||
message_admins("[key_name_admin(usr)] is changing the map to [VM.name]([VM.friendlyname])")
|
||||
log_admin("[key_name(usr)] is changing the map to [VM.name]([VM.friendlyname])")
|
||||
if (changemap(VM) == 0)
|
||||
message_admins("[key_name_admin(usr)] has changed the map to [VM.name]([VM.friendlyname])")
|
||||
var/datum/map_config/VM = maprotatechoices[chosenmap]
|
||||
message_admins("[key_name_admin(usr)] is changing the map to [VM.map_name]")
|
||||
log_admin("[key_name(usr)] is changing the map to [VM.map_name]")
|
||||
if (SSmapping.changemap(VM) == 0)
|
||||
message_admins("[key_name_admin(usr)] has changed the map to [VM.map_name]")
|
||||
@@ -38,7 +38,7 @@
|
||||
var/var_value = O.vars[variable]
|
||||
|
||||
if(variable in VVckey_edit)
|
||||
src << "It's forbidden to mass-modify ckeys. It'll crash everyone's client you dummy."
|
||||
to_chat(src, "It's forbidden to mass-modify ckeys. It'll crash everyone's client you dummy.")
|
||||
return
|
||||
if(variable in VVlocked)
|
||||
if(!check_rights(R_DEBUG))
|
||||
@@ -56,11 +56,11 @@
|
||||
default = vv_get_class(var_value)
|
||||
|
||||
if(isnull(default))
|
||||
src << "Unable to determine variable type."
|
||||
to_chat(src, "Unable to determine variable type.")
|
||||
else
|
||||
src << "Variable appears to be <b>[uppertext(default)]</b>."
|
||||
to_chat(src, "Variable appears to be <b>[uppertext(default)]</b>.")
|
||||
|
||||
src << "Variable contains: [var_value]"
|
||||
to_chat(src, "Variable contains: [var_value]")
|
||||
|
||||
if(default == VV_NUM)
|
||||
var/dir_text = ""
|
||||
@@ -75,7 +75,7 @@
|
||||
dir_text += "WEST"
|
||||
|
||||
if(dir_text)
|
||||
src << "If a direction, direction is: [dir_text]"
|
||||
to_chat(src, "If a direction, direction is: [dir_text]")
|
||||
|
||||
var/value = vv_get_value(default_class = default)
|
||||
var/new_value = value["value"]
|
||||
@@ -97,9 +97,9 @@
|
||||
|
||||
switch(class)
|
||||
if(VV_RESTORE_DEFAULT)
|
||||
src << "Finding items..."
|
||||
to_chat(src, "Finding items...")
|
||||
var/list/items = get_all_of_type(O.type, method)
|
||||
src << "Changing [items.len] items..."
|
||||
to_chat(src, "Changing [items.len] items...")
|
||||
for(var/thing in items)
|
||||
if (!thing)
|
||||
continue
|
||||
@@ -123,9 +123,9 @@
|
||||
for(var/V in varsvars)
|
||||
new_value = replacetext(new_value,"\[[V]]","[O.vars[V]]")
|
||||
|
||||
src << "Finding items..."
|
||||
to_chat(src, "Finding items...")
|
||||
var/list/items = get_all_of_type(O.type, method)
|
||||
src << "Changing [items.len] items..."
|
||||
to_chat(src, "Changing [items.len] items...")
|
||||
for(var/thing in items)
|
||||
if (!thing)
|
||||
continue
|
||||
@@ -151,9 +151,9 @@
|
||||
many = FALSE
|
||||
|
||||
var/type = value["type"]
|
||||
src << "Finding items..."
|
||||
to_chat(src, "Finding items...")
|
||||
var/list/items = get_all_of_type(O.type, method)
|
||||
src << "Changing [items.len] items..."
|
||||
to_chat(src, "Changing [items.len] items...")
|
||||
for(var/thing in items)
|
||||
if (!thing)
|
||||
continue
|
||||
@@ -169,9 +169,9 @@
|
||||
CHECK_TICK
|
||||
|
||||
else
|
||||
src << "Finding items..."
|
||||
to_chat(src, "Finding items...")
|
||||
var/list/items = get_all_of_type(O.type, method)
|
||||
src << "Changing [items.len] items..."
|
||||
to_chat(src, "Changing [items.len] items...")
|
||||
for(var/thing in items)
|
||||
if (!thing)
|
||||
continue
|
||||
@@ -185,13 +185,13 @@
|
||||
|
||||
var/count = rejected+accepted
|
||||
if (!count)
|
||||
src << "No objects found"
|
||||
to_chat(src, "No objects found")
|
||||
return
|
||||
if (!accepted)
|
||||
src << "Every object rejected your edit"
|
||||
to_chat(src, "Every object rejected your edit")
|
||||
return
|
||||
if (rejected)
|
||||
src << "[rejected] out of [count] objects rejected your edit"
|
||||
to_chat(src, "[rejected] out of [count] objects rejected your edit")
|
||||
|
||||
log_world("### MassVarEdit by [src]: [O.type] (A/R [accepted]/[rejected]) [variable]=[html_encode("[O.vars[variable]]")]([list2params(value)])")
|
||||
log_admin("[key_name(src)] mass modified [original_name]'s [variable] to [O.vars[variable]] ([accepted] objects modified)")
|
||||
|
||||
@@ -335,7 +335,7 @@ var/list/VVpixelmovement = list("step_x", "step_y", "bound_height", "bound_width
|
||||
L[var_value] = mod_list_add_ass(O) //hehe
|
||||
if (O)
|
||||
if (O.vv_edit_var(objectvar, L) == FALSE)
|
||||
src << "Your edit was rejected by the object."
|
||||
to_chat(src, "Your edit was rejected by the object.")
|
||||
return
|
||||
log_world("### ListVarEdit by [src]: [(O ? O.type : "/list")] [objectvar]: ADDED=[var_value]")
|
||||
log_admin("[key_name(src)] modified [original_name]'s [objectvar]: ADDED=[var_value]")
|
||||
@@ -345,7 +345,7 @@ var/list/VVpixelmovement = list("step_x", "step_y", "bound_height", "bound_width
|
||||
if(!check_rights(R_VAREDIT))
|
||||
return
|
||||
if(!istype(L, /list))
|
||||
src << "Not a List."
|
||||
to_chat(src, "Not a List.")
|
||||
return
|
||||
|
||||
if(L.len > 1000)
|
||||
@@ -378,7 +378,7 @@ var/list/VVpixelmovement = list("step_x", "step_y", "bound_height", "bound_width
|
||||
L = L.Copy()
|
||||
listclearnulls(L)
|
||||
if (!O.vv_edit_var(objectvar, L))
|
||||
src << "Your edit was rejected by the object."
|
||||
to_chat(src, "Your edit was rejected by the object.")
|
||||
return
|
||||
log_world("### ListVarEdit by [src]: [O.type] [objectvar]: CLEAR NULLS")
|
||||
log_admin("[key_name(src)] modified [original_name]'s [objectvar]: CLEAR NULLS")
|
||||
@@ -388,7 +388,7 @@ var/list/VVpixelmovement = list("step_x", "step_y", "bound_height", "bound_width
|
||||
if(variable == "(CLEAR DUPES)")
|
||||
L = uniqueList(L)
|
||||
if (!O.vv_edit_var(objectvar, L))
|
||||
src << "Your edit was rejected by the object."
|
||||
to_chat(src, "Your edit was rejected by the object.")
|
||||
return
|
||||
log_world("### ListVarEdit by [src]: [O.type] [objectvar]: CLEAR DUPES")
|
||||
log_admin("[key_name(src)] modified [original_name]'s [objectvar]: CLEAR DUPES")
|
||||
@@ -398,7 +398,7 @@ var/list/VVpixelmovement = list("step_x", "step_y", "bound_height", "bound_width
|
||||
if(variable == "(SHUFFLE)")
|
||||
L = shuffle(L)
|
||||
if (!O.vv_edit_var(objectvar, L))
|
||||
src << "Your edit was rejected by the object."
|
||||
to_chat(src, "Your edit was rejected by the object.")
|
||||
return
|
||||
log_world("### ListVarEdit by [src]: [O.type] [objectvar]: SHUFFLE")
|
||||
log_admin("[key_name(src)] modified [original_name]'s [objectvar]: SHUFFLE")
|
||||
@@ -427,9 +427,9 @@ var/list/VVpixelmovement = list("step_x", "step_y", "bound_height", "bound_width
|
||||
|
||||
default = vv_get_class(variable)
|
||||
|
||||
src << "Variable appears to be <b>[uppertext(default)]</b>."
|
||||
to_chat(src, "Variable appears to be <b>[uppertext(default)]</b>.")
|
||||
|
||||
src << "Variable contains: [L[index]]"
|
||||
to_chat(src, "Variable contains: [L[index]]")
|
||||
|
||||
if(default == VV_NUM)
|
||||
var/dir_text = ""
|
||||
@@ -444,7 +444,7 @@ var/list/VVpixelmovement = list("step_x", "step_y", "bound_height", "bound_width
|
||||
dir_text += "WEST"
|
||||
|
||||
if(dir_text)
|
||||
usr << "If a direction, direction is: [dir_text]"
|
||||
to_chat(usr, "If a direction, direction is: [dir_text]")
|
||||
|
||||
var/original_var
|
||||
if(assoc)
|
||||
@@ -475,7 +475,7 @@ var/list/VVpixelmovement = list("step_x", "step_y", "bound_height", "bound_width
|
||||
L.Cut(index, index+1)
|
||||
if (O)
|
||||
if (O.vv_edit_var(objectvar, L))
|
||||
src << "Your edit was rejected by the object."
|
||||
to_chat(src, "Your edit was rejected by the object.")
|
||||
return
|
||||
log_world("### ListVarEdit by [src]: [O.type] [objectvar]: REMOVED=[html_encode("[original_var]")]")
|
||||
log_admin("[key_name(src)] modified [original_name]'s [objectvar]: REMOVED=[original_var]")
|
||||
@@ -494,7 +494,7 @@ var/list/VVpixelmovement = list("step_x", "step_y", "bound_height", "bound_width
|
||||
L[index] = new_var
|
||||
if (O)
|
||||
if (O.vv_edit_var(objectvar, L) == FALSE)
|
||||
src << "Your edit was rejected by the object."
|
||||
to_chat(src, "Your edit was rejected by the object.")
|
||||
return
|
||||
log_world("### ListVarEdit by [src]: [(O ? O.type : "/list")] [objectvar]: [original_var]=[new_var]")
|
||||
log_admin("[key_name(src)] modified [original_name]'s [objectvar]: [original_var]=[new_var]")
|
||||
@@ -510,7 +510,7 @@ var/list/VVpixelmovement = list("step_x", "step_y", "bound_height", "bound_width
|
||||
|
||||
if(param_var_name)
|
||||
if(!param_var_name in O.vars)
|
||||
src << "A variable with this name ([param_var_name]) doesn't exist in this datum ([O])"
|
||||
to_chat(src, "A variable with this name ([param_var_name]) doesn't exist in this datum ([O])")
|
||||
return
|
||||
variable = param_var_name
|
||||
|
||||
@@ -547,11 +547,11 @@ var/list/VVpixelmovement = list("step_x", "step_y", "bound_height", "bound_width
|
||||
var/default = vv_get_class(var_value)
|
||||
|
||||
if(isnull(default))
|
||||
src << "Unable to determine variable type."
|
||||
to_chat(src, "Unable to determine variable type.")
|
||||
else
|
||||
src << "Variable appears to be <b>[uppertext(default)]</b>."
|
||||
to_chat(src, "Variable appears to be <b>[uppertext(default)]</b>.")
|
||||
|
||||
src << "Variable contains: [var_value]"
|
||||
to_chat(src, "Variable contains: [var_value]")
|
||||
|
||||
if(default == VV_NUM)
|
||||
var/dir_text = ""
|
||||
@@ -566,7 +566,7 @@ var/list/VVpixelmovement = list("step_x", "step_y", "bound_height", "bound_width
|
||||
dir_text += "WEST"
|
||||
|
||||
if(dir_text)
|
||||
src << "If a direction, direction is: [dir_text]"
|
||||
to_chat(src, "If a direction, direction is: [dir_text]")
|
||||
|
||||
if(autodetect_class && default != VV_NULL)
|
||||
if (default == VV_TEXT)
|
||||
@@ -603,7 +603,7 @@ var/list/VVpixelmovement = list("step_x", "step_y", "bound_height", "bound_width
|
||||
|
||||
|
||||
if (O.vv_edit_var(variable, var_new) == FALSE)
|
||||
src << "Your edit was rejected by the object."
|
||||
to_chat(src, "Your edit was rejected by the object.")
|
||||
return
|
||||
log_world("### VarEdit by [src]: [O.type] [variable]=[html_encode("[O.vars[variable]]")]")
|
||||
log_admin("[key_name(src)] modified [original_name]'s [variable] to [O.vars[variable]]")
|
||||
|
||||
@@ -199,9 +199,9 @@
|
||||
|
||||
for(var/i = 0, i<numCultists, i++)
|
||||
H = pick(candidates)
|
||||
H << "<span class='heavy_brass'>The world before you suddenly glows a brilliant yellow. You hear the whooshing steam and clanking cogs of a billion billion machines, and all at once \
|
||||
to_chat(H, "<span class='heavy_brass'>The world before you suddenly glows a brilliant yellow. You hear the whooshing steam and clanking cogs of a billion billion machines, and all at once \
|
||||
you see the truth. Ratvar, the Clockwork Justiciar, lies derelict and forgotten in an unseen realm, and he has selected you as one of his harbringers. You are now a servant of \
|
||||
Ratvar, and you will bring him back.</span>"
|
||||
Ratvar, and you will bring him back.</span>")
|
||||
add_servant_of_ratvar(H, TRUE)
|
||||
ticker.mode.equip_servant(H)
|
||||
candidates.Remove(H)
|
||||
@@ -331,14 +331,14 @@
|
||||
Commando.mind.objectives += missionobj
|
||||
|
||||
//Greet the commando
|
||||
Commando << "<B><font size=3 color=red>You are the [numagents==1?"Deathsquad Officer":"Death Commando"].</font></B>"
|
||||
to_chat(Commando, "<B><font size=3 color=red>You are the [numagents==1?"Deathsquad Officer":"Death Commando"].</font></B>")
|
||||
var/missiondesc = "Your squad is being sent on a mission to [station_name()] by Nanotrasen's Security Division."
|
||||
if(numagents == 1) //If Squad Leader
|
||||
missiondesc += " Lead your squad to ensure the completion of the mission. Board the shuttle when your team is ready."
|
||||
else
|
||||
missiondesc += " Follow orders given to you by your squad leader."
|
||||
missiondesc += "<BR><B>Your Mission</B>: [mission]"
|
||||
Commando << missiondesc
|
||||
to_chat(Commando, missiondesc)
|
||||
|
||||
if(config.enforce_human_authority)
|
||||
Commando.set_species(/datum/species/human)
|
||||
@@ -423,8 +423,8 @@
|
||||
newmob.set_species(/datum/species/human)
|
||||
|
||||
//Greet the official
|
||||
newmob << "<B><font size=3 color=red>You are a Centcom Official.</font></B>"
|
||||
newmob << "<BR>Central Command is sending you to [station_name()] with the task: [mission]"
|
||||
to_chat(newmob, "<B><font size=3 color=red>You are a Centcom Official.</font></B>")
|
||||
to_chat(newmob, "<BR>Central Command is sending you to [station_name()] with the task: [mission]")
|
||||
|
||||
//Logging and cleanup
|
||||
message_admins("Centcom Official [key_name_admin(newmob)] has spawned with the task: [mission]")
|
||||
@@ -520,14 +520,14 @@
|
||||
ERTOperative.mind.objectives += missionobj
|
||||
|
||||
//Greet the commando
|
||||
ERTOperative << "<B><font size=3 color=red>You are [numagents==1?"the Emergency Response Team Commander":"an Emergency Response Officer"].</font></B>"
|
||||
to_chat(ERTOperative, "<B><font size=3 color=red>You are [numagents==1?"the Emergency Response Team Commander":"an Emergency Response Officer"].</font></B>")
|
||||
var/missiondesc = "Your squad is being sent on a Code [alert] mission to [station_name()] by Nanotrasen's Security Division."
|
||||
if(numagents == 1) //If Squad Leader
|
||||
missiondesc += " Lead your squad to ensure the completion of the mission. Avoid civilian casualites when possible. Board the shuttle when your team is ready."
|
||||
else
|
||||
missiondesc += " Follow orders given to you by your commander. Avoid civilian casualites when possible."
|
||||
missiondesc += "<BR><B>Your Mission</B>: [mission]"
|
||||
ERTOperative << missiondesc
|
||||
to_chat(ERTOperative, missiondesc)
|
||||
|
||||
if(config.enforce_human_authority)
|
||||
ERTOperative.set_species(/datum/species/human)
|
||||
|
||||
@@ -75,8 +75,8 @@ var/highlander = FALSE
|
||||
antiwelder.icon_state = "bloodhand_right"
|
||||
put_in_hands(antiwelder)
|
||||
|
||||
src << "<span class='boldannounce'>Your [H1.name] cries out for blood. Claim the lives of others, and your own will be restored!\n\
|
||||
Activate it in your hand, and it will lead to the nearest target. Attack the nuclear authentication disk with it, and you will store it.</span>"
|
||||
to_chat(src, "<span class='boldannounce'>Your [H1.name] cries out for blood. Claim the lives of others, and your own will be restored!\n\
|
||||
Activate it in your hand, and it will lead to the nearest target. Attack the nuclear authentication disk with it, and you will store it.</span>")
|
||||
|
||||
/proc/only_me()
|
||||
if(!ticker || !ticker.mode)
|
||||
@@ -94,7 +94,7 @@ var/highlander = FALSE
|
||||
hijack_objective.owner = H.mind
|
||||
H.mind.objectives += hijack_objective
|
||||
|
||||
H << "<B>You are the multiverse summoner. Activate your blade to summon copies of yourself from another universe to fight by your side.</B>"
|
||||
to_chat(H, "<B>You are the multiverse summoner. Activate your blade to summon copies of yourself from another universe to fight by your side.</B>")
|
||||
H.mind.announce_objectives()
|
||||
|
||||
var/datum/gang/multiverse/G = new(src, "[H.real_name]")
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
set category = "Server"
|
||||
set name = "Toggle Panic Bunker"
|
||||
if (!config.sql_enabled)
|
||||
usr << "<span class='adminnotice'>The Database is not enabled!</span>"
|
||||
to_chat(usr, "<span class='adminnotice'>The Database is not enabled!</span>")
|
||||
return
|
||||
|
||||
config.panic_bunker = (!config.panic_bunker)
|
||||
|
||||
@@ -13,7 +13,7 @@ var/sound/admin_sound
|
||||
var/freq = 1
|
||||
if(SSevent.holidays && SSevent.holidays[APRIL_FOOLS])
|
||||
freq = pick(0.5, 0.7, 0.8, 0.85, 0.9, 0.95, 1.1, 1.2, 1.4, 1.6, 2.0, 2.5)
|
||||
src << "You feel the Honkmother messing with your song..."
|
||||
to_chat(src, "You feel the Honkmother messing with your song...")
|
||||
|
||||
var/sound/admin_sound = new()
|
||||
admin_sound.file = S
|
||||
@@ -23,11 +23,11 @@ var/sound/admin_sound
|
||||
admin_sound.wait = 1
|
||||
admin_sound.repeat = 0
|
||||
admin_sound.status = SOUND_STREAM
|
||||
|
||||
|
||||
for(var/mob/M in player_list)
|
||||
if(M.client.prefs.toggles & SOUND_MIDI)
|
||||
M << admin_sound
|
||||
|
||||
|
||||
feedback_add_details("admin_verb","PGS") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
if(istype(O,/obj/singularity))
|
||||
if(config.forbid_singulo_possession)
|
||||
usr << "It is forbidden to possess singularities."
|
||||
to_chat(usr, "It is forbidden to possess singularities.")
|
||||
return
|
||||
|
||||
var/turf/T = get_turf(O)
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
set name = "Pray"
|
||||
|
||||
if(say_disabled) //This is here to try to identify lag problems
|
||||
usr << "<span class='danger'>Speech is currently admin-disabled.</span>"
|
||||
to_chat(usr, "<span class='danger'>Speech is currently admin-disabled.</span>")
|
||||
return
|
||||
|
||||
msg = copytext(sanitize(msg), 1, MAX_MESSAGE_LEN)
|
||||
@@ -12,7 +12,7 @@
|
||||
log_prayer("[src.key]/([src.name]): [msg]")
|
||||
if(usr.client)
|
||||
if(usr.client.prefs.muted & MUTE_PRAY)
|
||||
usr << "<span class='danger'>You cannot pray (muted).</span>"
|
||||
to_chat(usr, "<span class='danger'>You cannot pray (muted).</span>")
|
||||
return
|
||||
if(src.client.handle_spam_prevention(msg,MUTE_PRAY))
|
||||
return
|
||||
@@ -37,11 +37,11 @@
|
||||
|
||||
for(var/client/C in admins)
|
||||
if(C.prefs.chat_toggles & CHAT_PRAYER)
|
||||
C << msg
|
||||
to_chat(C, msg)
|
||||
if(C.prefs.toggles & SOUND_PRAYERS)
|
||||
if(usr.job == "Chaplain")
|
||||
C << 'sound/effects/pray.ogg'
|
||||
usr << "Your prayers have been received by the gods."
|
||||
to_chat(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!
|
||||
//log_admin("HELP: [key_name(src)]: [msg]")
|
||||
@@ -53,7 +53,7 @@
|
||||
[ADMIN_FULLMONTY(Sender)] [ADMIN_BSA(Sender)] \
|
||||
[ADMIN_CENTCOM_REPLY(Sender)]:</b> \
|
||||
[msg]</span>"
|
||||
admins << msg
|
||||
to_chat(admins, msg)
|
||||
for(var/obj/machinery/computer/communications/C in machines)
|
||||
C.overrideCooldown()
|
||||
|
||||
@@ -64,7 +64,7 @@
|
||||
[ADMIN_FULLMONTY(Sender)] [ADMIN_BSA(Sender)] \
|
||||
[ADMIN_SYNDICATE_REPLY(Sender)]:</b> \
|
||||
[msg]</span>"
|
||||
admins << msg
|
||||
to_chat(admins, msg)
|
||||
for(var/obj/machinery/computer/communications/C in machines)
|
||||
C.overrideCooldown()
|
||||
|
||||
@@ -76,6 +76,6 @@
|
||||
[ADMIN_CENTCOM_REPLY(Sender)] \
|
||||
[ADMIN_SET_SD_CODE]:</b> \
|
||||
[msg]</span>"
|
||||
admins << msg
|
||||
to_chat(admins, msg)
|
||||
for(var/obj/machinery/computer/communications/C in machines)
|
||||
C.overrideCooldown()
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
set category = null
|
||||
set name = "Drop Everything"
|
||||
if(!holder)
|
||||
src << "Only administrators may use this command."
|
||||
to_chat(src, "Only administrators may use this command.")
|
||||
return
|
||||
|
||||
var/confirm = alert(src, "Make [M] drop everything?", "Message", "Yes", "No")
|
||||
@@ -26,7 +26,7 @@
|
||||
if(!ismob(M))
|
||||
return
|
||||
if (!holder)
|
||||
src << "Only administrators may use this command."
|
||||
to_chat(src, "Only administrators may use this command.")
|
||||
return
|
||||
|
||||
message_admins("[key_name_admin(src)] has started answering [key_name(M.key, 0, 0)]'s prayer.")
|
||||
@@ -38,7 +38,7 @@
|
||||
if(usr)
|
||||
if (usr.client)
|
||||
if(usr.client.holder)
|
||||
M << "<i>You hear a voice in your head... <b>[msg]</i></b>"
|
||||
to_chat(M, "<i>You hear a voice in your head... <b>[msg]</i></b>")
|
||||
|
||||
log_admin("SubtlePM: [key_name(usr)] -> [key_name(M)] : [msg]")
|
||||
message_admins("<span class='adminnotice'><b> SubtleMessage: [key_name_admin(usr)] -> [key_name_admin(M)] :</b> [msg]</span>")
|
||||
@@ -49,14 +49,14 @@
|
||||
set name = "Global Narrate"
|
||||
|
||||
if (!holder)
|
||||
src << "Only administrators may use this command."
|
||||
to_chat(src, "Only administrators may use this command.")
|
||||
return
|
||||
|
||||
var/msg = input("Message:", text("Enter the text you wish to appear to everyone:")) as text
|
||||
|
||||
if (!msg)
|
||||
return
|
||||
world << "[msg]"
|
||||
to_chat(world, "[msg]")
|
||||
log_admin("GlobalNarrate: [key_name(usr)] : [msg]")
|
||||
message_admins("<span class='adminnotice'>[key_name_admin(usr)] Sent a global narrate</span>")
|
||||
feedback_add_details("admin_verb","GLN") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
@@ -66,7 +66,7 @@
|
||||
set name = "Direct Narrate"
|
||||
|
||||
if(!holder)
|
||||
src << "Only administrators may use this command."
|
||||
to_chat(src, "Only administrators may use this command.")
|
||||
return
|
||||
|
||||
if(!M)
|
||||
@@ -80,7 +80,7 @@
|
||||
if( !msg )
|
||||
return
|
||||
|
||||
M << msg
|
||||
to_chat(M, msg)
|
||||
log_admin("DirectNarrate: [key_name(usr)] to ([M.name]/[M.key]): [msg]")
|
||||
message_admins("<span class='adminnotice'><b> DirectNarrate: [key_name(usr)] to ([M.name]/[M.key]):</b> [msg]<BR></span>")
|
||||
feedback_add_details("admin_verb","DIRN") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
@@ -90,7 +90,7 @@
|
||||
set name = "Local Narrate"
|
||||
|
||||
if (!holder)
|
||||
src << "Only administrators may use this command."
|
||||
to_chat(src, "Only administrators may use this command.")
|
||||
return
|
||||
if(!A)
|
||||
return
|
||||
@@ -101,7 +101,7 @@
|
||||
if (!msg)
|
||||
return
|
||||
for(var/mob/M in view(range,A))
|
||||
M << msg
|
||||
to_chat(M, msg)
|
||||
|
||||
log_admin("LocalNarrate: [key_name(usr)] at ([get_area(A)]): [msg]")
|
||||
message_admins("<span class='adminnotice'><b> LocalNarrate: [key_name_admin(usr)] at (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[A.x];Y=[A.y];Z=[A.z]'>[get_area(A)]</a>):</b> [msg]<BR></span>")
|
||||
@@ -111,10 +111,10 @@
|
||||
set category = "Special Verbs"
|
||||
set name = "Godmode"
|
||||
if(!holder)
|
||||
src << "Only administrators may use this command."
|
||||
to_chat(src, "Only administrators may use this command.")
|
||||
return
|
||||
M.status_flags ^= GODMODE
|
||||
usr << "<span class='adminnotice'>Toggled [(M.status_flags & GODMODE) ? "ON" : "OFF"]</span>"
|
||||
to_chat(usr, "<span class='adminnotice'>Toggled [(M.status_flags & GODMODE) ? "ON" : "OFF"]</span>")
|
||||
|
||||
log_admin("[key_name(usr)] has toggled [key_name(M)]'s nodamage to [(M.status_flags & GODMODE) ? "On" : "Off"]")
|
||||
message_admins("[key_name_admin(usr)] has toggled [key_name_admin(M)]'s nodamage to [(M.status_flags & GODMODE) ? "On" : "Off"]")
|
||||
@@ -172,7 +172,7 @@
|
||||
log_admin("SPAM AUTOMUTE: [muteunmute] [key_name(whom)] from [mute_string]")
|
||||
message_admins("SPAM AUTOMUTE: [muteunmute] [key_name_admin(whom)] from [mute_string].")
|
||||
if(C)
|
||||
C << "You have been [muteunmute] from [mute_string] by the SPAM AUTOMUTE system. Contact an admin."
|
||||
to_chat(C, "You have been [muteunmute] from [mute_string] by the SPAM AUTOMUTE system. Contact an admin.")
|
||||
feedback_add_details("admin_verb","AUTOMUTE") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
return
|
||||
|
||||
@@ -186,7 +186,7 @@
|
||||
log_admin("[key_name(usr)] has [muteunmute] [key_name(whom)] from [mute_string]")
|
||||
message_admins("[key_name_admin(usr)] has [muteunmute] [key_name_admin(whom)] from [mute_string].")
|
||||
if(C)
|
||||
C << "You have been [muteunmute] from [mute_string] by [key_name(usr, include_name = FALSE)]."
|
||||
to_chat(C, "You have been [muteunmute] from [mute_string] by [key_name(usr, include_name = FALSE)].")
|
||||
feedback_add_details("admin_verb","MUTE") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
|
||||
@@ -207,7 +207,7 @@
|
||||
if(candidates.len)
|
||||
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>"
|
||||
to_chat(usr, "<font color='red'>Error: create_xeno(): no suitable candidates.</font>")
|
||||
if(!istext(ckey))
|
||||
return 0
|
||||
|
||||
@@ -244,7 +244,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
|
||||
set name = "Respawn Character"
|
||||
set desc = "Respawn a person that has been gibbed/dusted/killed. They must be a ghost for this to work and preferably should not have a body to go back into."
|
||||
if(!holder)
|
||||
src << "Only administrators may use this command."
|
||||
to_chat(src, "Only administrators may use this command.")
|
||||
return
|
||||
var/input = ckey(input(src, "Please specify which key will be respawned.", "Key", ""))
|
||||
if(!input)
|
||||
@@ -257,7 +257,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
|
||||
break
|
||||
|
||||
if(!G_found)//If a ghost was not found.
|
||||
usr << "<font color='red'>There is no active key like that in the game or the person is not currently a ghost.</font>"
|
||||
to_chat(usr, "<font color='red'>There is no active key like that in the game or the person is not currently a ghost.</font>")
|
||||
return
|
||||
|
||||
if(G_found.mind && !G_found.mind.active) //mind isn't currently in use by someone/something
|
||||
@@ -289,7 +289,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
|
||||
//Now to give them their mind back.
|
||||
G_found.mind.transfer_to(new_xeno) //be careful when doing stuff like this! I've already checked the mind isn't in use
|
||||
new_xeno.key = G_found.key
|
||||
new_xeno << "You have been fully respawned. Enjoy the game."
|
||||
to_chat(new_xeno, "You have been fully respawned. Enjoy the game.")
|
||||
message_admins("<span class='adminnotice'>[key_name_admin(usr)] has respawned [new_xeno.key] as a filthy xeno.</span>")
|
||||
return //all done. The ghost is auto-deleted
|
||||
|
||||
@@ -299,7 +299,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
|
||||
var/mob/living/carbon/monkey/new_monkey = new(pick(latejoin))
|
||||
G_found.mind.transfer_to(new_monkey) //be careful when doing stuff like this! I've already checked the mind isn't in use
|
||||
new_monkey.key = G_found.key
|
||||
new_monkey << "You have been fully respawned. Enjoy the game."
|
||||
to_chat(new_monkey, "You have been fully respawned. Enjoy the game.")
|
||||
message_admins("<span class='adminnotice'>[key_name_admin(usr)] has respawned [new_monkey.key] as a filthy xeno.</span>")
|
||||
return //all done. The ghost is auto-deleted
|
||||
|
||||
@@ -395,11 +395,11 @@ Traitors and the like can also be revived with the previous role mostly intact.
|
||||
data_core.manifest_inject(new_character)
|
||||
|
||||
if(alert(new_character,"Would you like an active AI to announce this character?",,"No","Yes")=="Yes")
|
||||
call(/mob/new_player/proc/AnnounceArrival)(new_character, new_character.mind.assigned_role)
|
||||
AnnounceArrival(new_character, new_character.mind.assigned_role)
|
||||
|
||||
message_admins("<span class='adminnotice'>[admin] has respawned [player_key] as [new_character.real_name].</span>")
|
||||
|
||||
new_character << "You have been fully respawned. Enjoy the game."
|
||||
to_chat(new_character, "You have been fully respawned. Enjoy the game.")
|
||||
|
||||
feedback_add_details("admin_verb","RSPCH") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
return new_character
|
||||
@@ -408,7 +408,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
|
||||
set category = "Fun"
|
||||
set name = "Add Custom AI law"
|
||||
if(!holder)
|
||||
src << "Only administrators may use this command."
|
||||
to_chat(src, "Only administrators may use this command.")
|
||||
return
|
||||
var/input = input(usr, "Please enter anything you want the AI to do. Anything. Serious.", "What?", "") as text|null
|
||||
if(!input)
|
||||
@@ -430,7 +430,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
|
||||
set category = "Special Verbs"
|
||||
set name = "Rejuvenate"
|
||||
if(!holder)
|
||||
src << "Only administrators may use this command."
|
||||
to_chat(src, "Only administrators may use this command.")
|
||||
return
|
||||
if(!mob)
|
||||
return
|
||||
@@ -447,19 +447,19 @@ Traitors and the like can also be revived with the previous role mostly intact.
|
||||
set category = "Special Verbs"
|
||||
set name = "Create Command Report"
|
||||
if(!holder)
|
||||
src << "Only administrators may use this command."
|
||||
to_chat(src, "Only administrators may use this command.")
|
||||
return
|
||||
var/input = input(usr, "Please enter anything you want. Anything. Serious.", "What?", "") as message|null
|
||||
if(!input)
|
||||
return
|
||||
|
||||
var/confirm = alert(src, "Do you want to announce the contents of the report to the crew?", "Announce", "Yes", "No")
|
||||
var/announce_command_report = TRUE
|
||||
if(confirm == "Yes")
|
||||
priority_announce(input, null, 'sound/AI/commandreport.ogg')
|
||||
else
|
||||
priority_announce("A report has been downloaded and printed out at all communications consoles.", "Incoming Classified Message", 'sound/AI/commandreport.ogg')
|
||||
announce_command_report = FALSE
|
||||
|
||||
print_command_report(input,"[confirm=="Yes" ? "" : "Classified "][command_name()] Update")
|
||||
print_command_report(input,"[confirm=="Yes" ? "" : "Classified "][command_name()] Update",announce=announce_command_report)
|
||||
|
||||
log_admin("[key_name(src)] has created a command report: [input]")
|
||||
message_admins("[key_name_admin(src)] has created a command report")
|
||||
@@ -469,7 +469,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
|
||||
set category = "Special Verbs"
|
||||
set name = "Change Command Name"
|
||||
if(!holder)
|
||||
src << "Only administrators may use this command."
|
||||
to_chat(src, "Only administrators may use this command.")
|
||||
return
|
||||
var/input = input(usr, "Please input a new name for Central Command.", "What?", "") as text|null
|
||||
if(!input)
|
||||
@@ -483,7 +483,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
|
||||
set name = "Delete"
|
||||
|
||||
if (!holder)
|
||||
src << "Only administrators may use this command."
|
||||
to_chat(src, "Only administrators may use this command.")
|
||||
return
|
||||
|
||||
if (alert(src, "Are you sure you want to delete:\n[O]\nat ([O.x], [O.y], [O.z])?", "Confirmation", "Yes", "No") == "Yes")
|
||||
@@ -501,17 +501,17 @@ Traitors and the like can also be revived with the previous role mostly intact.
|
||||
set name = "Manage Job Slots"
|
||||
|
||||
if (!holder)
|
||||
src << "Only administrators may use this command."
|
||||
to_chat(src, "Only administrators may use this command.")
|
||||
return
|
||||
holder.manage_free_slots()
|
||||
feedback_add_details("admin_verb","MFS") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
/client/proc/cmd_admin_explosion(atom/O as obj|mob|turf in world)
|
||||
set category = "Dangerous"
|
||||
set category = "Special Verbs"
|
||||
set name = "Explosion"
|
||||
|
||||
if (!holder)
|
||||
src << "Only administrators may use this command."
|
||||
to_chat(src, "Only administrators may use this command.")
|
||||
return
|
||||
|
||||
var/devastation = input("Range of total devastation. -1 to none", text("Input")) as num|null
|
||||
@@ -539,11 +539,11 @@ Traitors and the like can also be revived with the previous role mostly intact.
|
||||
return
|
||||
|
||||
/client/proc/cmd_admin_emp(atom/O as obj|mob|turf in world)
|
||||
set category = "Dangerous"
|
||||
set category = "Special Verbs"
|
||||
set name = "EM Pulse"
|
||||
|
||||
if (!holder)
|
||||
src << "Only administrators may use this command."
|
||||
to_chat(src, "Only administrators may use this command.")
|
||||
return
|
||||
|
||||
var/heavy = input("Range of heavy pulse.", text("Input")) as num|null
|
||||
@@ -567,7 +567,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
|
||||
set name = "Gib"
|
||||
|
||||
if (!holder)
|
||||
src << "Only administrators may use this command."
|
||||
to_chat(src, "Only administrators may use this command.")
|
||||
return
|
||||
|
||||
var/confirm = alert(src, "Drop a brain?", "Confirm", "Yes", "No","Cancel")
|
||||
@@ -606,7 +606,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
|
||||
|
||||
var/list/L = M.get_contents()
|
||||
for(var/t in L)
|
||||
usr << "[t]"
|
||||
to_chat(usr, "[t]")
|
||||
feedback_add_details("admin_verb","CC") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
/client/proc/toggle_view_range()
|
||||
@@ -633,7 +633,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
|
||||
return
|
||||
|
||||
if (!holder)
|
||||
src << "Only administrators may use this command."
|
||||
to_chat(src, "Only administrators may use this command.")
|
||||
return
|
||||
|
||||
var/confirm = alert(src, "You sure?", "Confirm", "Yes", "No")
|
||||
@@ -664,29 +664,19 @@ Traitors and the like can also be revived with the previous role mostly intact.
|
||||
|
||||
return
|
||||
|
||||
/client/proc/cmd_admin_attack_log(mob/M in mob_list)
|
||||
set category = "Special Verbs"
|
||||
set name = "Attack Log"
|
||||
|
||||
usr << "<span class='boldannounce'>Attack Log for [mob]</span>"
|
||||
for(var/t in M.attack_log)
|
||||
usr << t
|
||||
feedback_add_details("admin_verb","ATTL") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
|
||||
/client/proc/everyone_random()
|
||||
set category = "Dangerous"
|
||||
set category = "Fun"
|
||||
set name = "Make Everyone Random"
|
||||
set desc = "Make everyone have a random appearance. You can only use this before rounds!"
|
||||
|
||||
if(ticker && ticker.mode)
|
||||
usr << "Nope you can't do this, the game's already started. This only works before rounds!"
|
||||
to_chat(usr, "Nope you can't do this, the game's already started. This only works before rounds!")
|
||||
return
|
||||
|
||||
if(config.force_random_names)
|
||||
config.force_random_names = 0
|
||||
message_admins("Admin [key_name_admin(usr)] has disabled \"Everyone is Special\" mode.")
|
||||
usr << "Disabled."
|
||||
to_chat(usr, "Disabled.")
|
||||
return
|
||||
|
||||
|
||||
@@ -698,9 +688,9 @@ Traitors and the like can also be revived with the previous role mostly intact.
|
||||
message_admins("Admin [key_name_admin(usr)] has forced the players to have random appearances.")
|
||||
|
||||
if(notifyplayers == "Yes")
|
||||
world << "<span class='adminnotice'>Admin [usr.key] has forced the players to have completely random identities!</span>"
|
||||
to_chat(world, "<span class='adminnotice'>Admin [usr.key] has forced the players to have completely random identities!</span>")
|
||||
|
||||
usr << "<i>Remember: you can always disable the randomness by using the verb again, assuming the round hasn't started yet</i>."
|
||||
to_chat(usr, "<i>Remember: you can always disable the randomness by using the verb again, assuming the round hasn't started yet</i>.")
|
||||
|
||||
config.force_random_names = 1
|
||||
feedback_add_details("admin_verb","MER") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
@@ -712,11 +702,11 @@ Traitors and the like can also be revived with the previous role mostly intact.
|
||||
set desc = "Toggles random events such as meteors, black holes, blob (but not space dust) on/off"
|
||||
if(!config.allow_random_events)
|
||||
config.allow_random_events = 1
|
||||
usr << "Random events enabled"
|
||||
to_chat(usr, "Random events enabled")
|
||||
message_admins("Admin [key_name_admin(usr)] has enabled random events.")
|
||||
else
|
||||
config.allow_random_events = 0
|
||||
usr << "Random events disabled"
|
||||
to_chat(usr, "Random events disabled")
|
||||
message_admins("Admin [key_name_admin(usr)] has disabled random events.")
|
||||
feedback_add_details("admin_verb","TRE") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
@@ -727,7 +717,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
|
||||
set desc = "Changes the security level. Announcement only, i.e. setting to Delta won't activate nuke"
|
||||
|
||||
if (!holder)
|
||||
src << "Only administrators may use this command."
|
||||
to_chat(src, "Only administrators may use this command.")
|
||||
return
|
||||
|
||||
var/level = input("Select security level to change to","Set Security Level") as null|anything in list("green","blue","red","delta")
|
||||
@@ -740,7 +730,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
|
||||
|
||||
/client/proc/toggle_nuke(obj/machinery/nuclearbomb/N in nuke_list)
|
||||
set name = "Toggle Nuke"
|
||||
set category = "Dangerous"
|
||||
set category = "Fun"
|
||||
set popup_menu = 0
|
||||
if(!check_rights(R_DEBUG))
|
||||
return
|
||||
@@ -757,24 +747,6 @@ Traitors and the like can also be revived with the previous role mostly intact.
|
||||
message_admins("[ADMIN_LOOKUPFLW(usr)] [N.timing ? "activated" : "deactivated"] a nuke at [ADMIN_COORDJMP(N)].")
|
||||
feedback_add_details("admin_verb","TN") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
/client/proc/reset_latejoin_spawns()
|
||||
set category = "Debug"
|
||||
set name = "Remove Latejoin Spawns"
|
||||
|
||||
if(!check_rights(R_DEBUG))
|
||||
return
|
||||
var/confirm = alert(src, "Disable Latejoin spawns??", "Message", "Yes", "No")
|
||||
if(confirm != "Yes")
|
||||
return
|
||||
|
||||
latejoin.Cut()
|
||||
|
||||
log_admin("[key_name(usr)] removed latejoin spawnpoints.")
|
||||
message_admins("[key_name_admin(usr)] removed latejoin spawnpoints.")
|
||||
|
||||
|
||||
|
||||
|
||||
var/list/datum/outfit/custom_outfits = list() //Admin created outfits
|
||||
|
||||
/client/proc/create_outfits()
|
||||
@@ -969,7 +941,7 @@ var/list/datum/outfit/custom_outfits = list() //Admin created outfits
|
||||
var/datum/atom_hud/antag/H = G.ganghud
|
||||
(adding_hud) ? H.add_hud_to(usr) : H.remove_hud_from(usr)
|
||||
|
||||
usr << "You toggled your admin antag HUD [adding_hud ? "ON" : "OFF"]."
|
||||
to_chat(usr, "You toggled your admin antag HUD [adding_hud ? "ON" : "OFF"].")
|
||||
message_admins("[key_name_admin(usr)] toggled their admin antag HUD [adding_hud ? "ON" : "OFF"].")
|
||||
log_admin("[key_name(usr)] toggled their admin antag HUD [adding_hud ? "ON" : "OFF"].")
|
||||
feedback_add_details("admin_verb","TAH") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
@@ -983,7 +955,7 @@ var/list/datum/outfit/custom_outfits = list() //Admin created outfits
|
||||
M.ui_interact(usr)
|
||||
|
||||
/client/proc/mass_zombie_infection()
|
||||
set category = "Dangerous"
|
||||
set category = "Fun"
|
||||
set name = "Mass Zombie Infection"
|
||||
set desc = "Infects all humans with a latent organ that will zombify \
|
||||
them on death."
|
||||
@@ -1003,7 +975,7 @@ var/list/datum/outfit/custom_outfits = list() //Admin created outfits
|
||||
feedback_add_details("admin_verb","MZI")
|
||||
|
||||
/client/proc/mass_zombie_cure()
|
||||
set category = "Dangerous"
|
||||
set category = "Fun"
|
||||
set name = "Mass Zombie Cure"
|
||||
set desc = "Removes the zombie infection from all humans, returning them to normal."
|
||||
if(!holder)
|
||||
@@ -1021,7 +993,7 @@ var/list/datum/outfit/custom_outfits = list() //Admin created outfits
|
||||
feedback_add_details("admin_verb","MZC")
|
||||
|
||||
/client/proc/polymorph_all()
|
||||
set category = "Dangerous"
|
||||
set category = "Fun"
|
||||
set name = "Polymorph All"
|
||||
set desc = "Applies the effects of the bolt of change to every single mob."
|
||||
|
||||
@@ -1109,7 +1081,7 @@ var/list/datum/outfit/custom_outfits = list() //Admin created outfits
|
||||
return
|
||||
if(ON_PURRBATION(H))
|
||||
return
|
||||
H << "Something is nya~t right."
|
||||
to_chat(H, "Something is nya~t right.")
|
||||
H.dna.features["tail_human"] = "Cat"
|
||||
H.dna.features["ears"] = "Cat"
|
||||
H.regenerate_icons()
|
||||
@@ -1120,7 +1092,7 @@ var/list/datum/outfit/custom_outfits = list() //Admin created outfits
|
||||
return
|
||||
if(!ON_PURRBATION(H))
|
||||
return
|
||||
H << "You are no longer a cat."
|
||||
to_chat(H, "You are no longer a cat.")
|
||||
H.dna.features["tail_human"] = "None"
|
||||
H.dna.features["ears"] = "None"
|
||||
H.regenerate_icons()
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
set category = "Special Verbs"
|
||||
set name = "Reestablish DB Connection"
|
||||
if (!config.sql_enabled)
|
||||
usr << "<span class='adminnotice'>The Database is not enabled!</span>"
|
||||
to_chat(usr, "<span class='adminnotice'>The Database is not enabled!</span>")
|
||||
return
|
||||
|
||||
if (dbcon && dbcon.IsConnected())
|
||||
|
||||
@@ -3,18 +3,18 @@
|
||||
set name = "Create AI Triumvirate"
|
||||
|
||||
if(ticker.current_state > GAME_STATE_PREGAME)
|
||||
usr << "This option is currently only usable during pregame. This may change at a later date."
|
||||
to_chat(usr, "This option is currently only usable during pregame. This may change at a later date.")
|
||||
return
|
||||
|
||||
var/datum/job/job = SSjob.GetJob("AI")
|
||||
if(!job)
|
||||
usr << "Unable to locate the AI job"
|
||||
to_chat(usr, "Unable to locate the AI job")
|
||||
return
|
||||
if(ticker.triai)
|
||||
ticker.triai = 0
|
||||
usr << "Only one AI will be spawned at round start."
|
||||
to_chat(usr, "Only one AI will be spawned at round start.")
|
||||
message_admins("<span class='adminnotice'>[key_name_admin(usr)] has toggled off triple AIs at round start.</span>")
|
||||
else
|
||||
ticker.triai = 1
|
||||
usr << "There will be an AI Triumvirate at round start."
|
||||
to_chat(usr, "There will be an AI Triumvirate at round start.")
|
||||
message_admins("<span class='adminnotice'>[key_name_admin(usr)] has toggled on triple AIs at round start.</span>")
|
||||
|
||||
Reference in New Issue
Block a user