mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-21 03:55:05 +01:00
Merge branch 'master' into AI_announcer_new
This commit is contained in:
@@ -28,26 +28,26 @@
|
||||
admin = 1
|
||||
|
||||
//Guest Checking
|
||||
if(!GLOB.guests_allowed && IsGuestKey(key))
|
||||
if(GLOB.configuration.general.guest_ban && IsGuestKey(key))
|
||||
log_adminwarn("Failed Login: [key] [computer_id] [address] - Guests not allowed")
|
||||
// message_admins("<span class='notice'>Failed Login: [key] - Guests not allowed</span>")
|
||||
INVOKE_ASYNC(GLOBAL_PROC, .proc/log_connection, ckey(key), address, computer_id, CONNECTION_TYPE_DROPPED_BANNED)
|
||||
return list("reason"="guest", "desc"="\nReason: Guests not allowed. Please sign in with a BYOND account.")
|
||||
|
||||
//check if the IP address is a known proxy/vpn, and the user is not whitelisted
|
||||
if(check_ipintel && config.ipintel_email && config.ipintel_whitelist && ipintel_is_banned(key, address))
|
||||
if(check_ipintel && GLOB.configuration.ipintel.contact_email && GLOB.configuration.ipintel.whitelist_mode && SSipintel.ipintel_is_banned(key, address))
|
||||
log_adminwarn("Failed Login: [key] [computer_id] [address] - Proxy/VPN")
|
||||
var/mistakemessage = ""
|
||||
if(config.banappeals)
|
||||
mistakemessage = "\nIf you have to use one, request whitelisting at: [config.banappeals]"
|
||||
if(GLOB.configuration.url.banappeals_url)
|
||||
mistakemessage = "\nIf you have to use one, request whitelisting at: [GLOB.configuration.url.banappeals_url]"
|
||||
INVOKE_ASYNC(GLOBAL_PROC, .proc/log_connection, ckey(key), address, computer_id, CONNECTION_TYPE_DROPPED_IPINTEL)
|
||||
return list("reason"="using proxy or vpn", "desc"="\nReason: Proxies/VPNs are not allowed here. [mistakemessage]")
|
||||
|
||||
|
||||
// If 2FA is enabled, makes sure they were authed within the last minute
|
||||
if(check_2fa && config._2fa_auth_host)
|
||||
if(check_2fa && GLOB.configuration.system._2fa_auth_host)
|
||||
// First see if they exist at all
|
||||
var/datum/db_query/check_query = SSdbcore.NewQuery("SELECT 2fa_status, ip FROM [format_table_name("player")] WHERE ckey=:ckey", list("ckey" = ckey(key)))
|
||||
var/datum/db_query/check_query = SSdbcore.NewQuery("SELECT 2fa_status, ip FROM player WHERE ckey=:ckey", list("ckey" = ckey(key)))
|
||||
|
||||
if(!check_query.warn_execute())
|
||||
message_admins("Failed to do a DB 2FA check for [key]. You have been warned.")
|
||||
@@ -71,7 +71,7 @@
|
||||
// Have it set to always check, or their IP is different
|
||||
if(_2fa_enabled && (always_check || (address != last_ip)))
|
||||
// They have 2FA enabled, lets make sure they have authed within the last minute
|
||||
var/datum/db_query/verify_query = SSdbcore.NewQuery("SELECT ckey FROM [format_table_name("2fa_secrets")] WHERE (last_time BETWEEN NOW() - INTERVAL 1 MINUTE AND NOW()) AND ckey=:ckey LIMIT 1", list(
|
||||
var/datum/db_query/verify_query = SSdbcore.NewQuery("SELECT ckey FROM 2fa_secrets WHERE (last_time BETWEEN NOW() - INTERVAL 1 MINUTE AND NOW()) AND ckey=:ckey LIMIT 1", list(
|
||||
"ckey" = ckey(key)
|
||||
))
|
||||
|
||||
@@ -87,7 +87,24 @@
|
||||
|
||||
qdel(verify_query)
|
||||
|
||||
if(config.ban_legacy_system)
|
||||
if(SSdbcore.IsConnected())
|
||||
// If we have a DB, see if the player has been seen before
|
||||
var/datum/db_query/exist_query = SSdbcore.NewQuery("SELECT ckey FROM player WHERE ckey=:ckey", list(
|
||||
"ckey" = ckey
|
||||
))
|
||||
// If we didnt execute, skip this part
|
||||
if(!exist_query.warn_execute())
|
||||
qdel(exist_query)
|
||||
else
|
||||
if(!exist_query.NextRow()) // If there isnt a row, they aint been seen before
|
||||
if(GLOB.panic_bunker_enabled)
|
||||
qdel(exist_query)
|
||||
var/threshold = GLOB.configuration.general.panic_bunker_threshold
|
||||
return list("reason" = "panic bunker", "desc" = "Server is not accepting connections from never-before-seen players until player count is less than [threshold]. Please try again later.")
|
||||
|
||||
qdel(exist_query)
|
||||
|
||||
if(!GLOB.configuration.general.use_database_bans)
|
||||
//Ban Checking
|
||||
. = CheckBan(ckey(key), computer_id, address)
|
||||
if(.)
|
||||
@@ -120,7 +137,7 @@
|
||||
sql_query_params["cid"] = computer_id
|
||||
|
||||
var/datum/db_query/query = SSdbcore.NewQuery({"
|
||||
SELECT ckey, ip, computerid, a_ckey, reason, expiration_time, duration, bantime, bantype, ban_round_id FROM [format_table_name("ban")]
|
||||
SELECT ckey, ip, computerid, a_ckey, reason, expiration_time, duration, bantime, bantype, ban_round_id FROM 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)"}, sql_query_params)
|
||||
|
||||
@@ -159,8 +176,8 @@
|
||||
expires = " The ban is for [duration] minutes and expires on [expiration] (server time)."
|
||||
else
|
||||
var/appealmessage = ""
|
||||
if(config.banappeals)
|
||||
appealmessage = " You may appeal it at <a href='[config.banappeals]'>[config.banappeals]</a>."
|
||||
if(GLOB.configuration.url.banappeals_url)
|
||||
appealmessage = " You may appeal it at <a href='[GLOB.configuration.url.banappeals_url]'>[GLOB.configuration.url.banappeals_url]</a>."
|
||||
expires = " This ban does not expire automatically and must be appealed.[appealmessage]"
|
||||
|
||||
var/desc = "\nReason: You, or another user of this computer or connection ([pckey]) is banned from playing here. The ban reason is:\n[reason]\nThis ban was applied by [ackey] on [bantime][ban_round_id ? " (Round [ban_round_id])" : ""].[expires]"
|
||||
|
||||
@@ -10,8 +10,8 @@ GLOBAL_PROTECT(banlist_savefile) // Obvious reasons
|
||||
|
||||
. = list()
|
||||
var/appeal
|
||||
if(config && config.banappeals)
|
||||
appeal = "\nFor more information on your ban, or to appeal, head to <a href='[config.banappeals]'>[config.banappeals]</a>"
|
||||
if(GLOB.configuration.url.banappeals_url)
|
||||
appeal = "\nFor more information on your ban, or to appeal, head to <a href='[GLOB.configuration.url.banappeals_url]'>[GLOB.configuration.url.banappeals_url]</a>"
|
||||
GLOB.banlist_savefile.cd = "/base"
|
||||
if( "[ckey][id]" in GLOB.banlist_savefile.dir )
|
||||
GLOB.banlist_savefile.cd = "[ckey][id]"
|
||||
|
||||
+29
-23
@@ -91,8 +91,8 @@ GLOBAL_VAR_INIT(nologevent, 0)
|
||||
else
|
||||
body += "\[[M.client.holder ? M.client.holder.rank : "Player"]\] "
|
||||
body += "\[<A href='?_src_=holder;getplaytimewindow=[M.UID()]'>" + M.client.get_exp_type(EXP_TYPE_CREW) + " as [EXP_TYPE_CREW]</a>\]"
|
||||
body += "<br>BYOND account registration date: [M.client.byondacc_date || "ERROR"] [M.client.byondacc_age <= config.byond_account_age_threshold ? "<b>" : ""]([M.client.byondacc_age] days old)[M.client.byondacc_age <= config.byond_account_age_threshold ? "</b>" : ""]"
|
||||
body += "<br>Global Ban DB Lookup: [config.centcom_ban_db_url ? "<a href='?_src_=holder;open_ccbdb=[M.client.ckey]'>Lookup</a>" : "<i>Disabled</i>"]"
|
||||
body += "<br>BYOND account registration date: [M.client.byondacc_date || "ERROR"] [M.client.byondacc_age <= GLOB.configuration.general.byond_account_age_threshold ? "<b>" : ""]([M.client.byondacc_age] days old)[M.client.byondacc_age <= GLOB.configuration.general.byond_account_age_threshold ? "</b>" : ""]"
|
||||
body += "<br>Global Ban DB Lookup: [GLOB.configuration.url.centcom_ban_db_url ? "<a href='?_src_=holder;open_ccbdb=[M.client.ckey]'>Lookup</a>" : "<i>Disabled</i>"]"
|
||||
|
||||
body += "<br>"
|
||||
|
||||
@@ -127,7 +127,7 @@ GLOBAL_VAR_INIT(nologevent, 0)
|
||||
body += "<A href='?_src_=holder;appearanceban=[M.UID()];dbbanaddckey=[M.ckey]'>Appearance Ban</A> | "
|
||||
body += "<A href='?_src_=holder;shownoteckey=[M.ckey]'>Notes</A> | "
|
||||
body += "<A href='?_src_=holder;viewkarma=[M.ckey]'>View Karma</A> | "
|
||||
if(config.forum_playerinfo_url)
|
||||
if(GLOB.configuration.url.forum_playerinfo_url)
|
||||
body += "<A href='?_src_=holder;webtools=[M.ckey]'>WebInfo</A> | "
|
||||
if(M.client)
|
||||
if(check_watchlist(M.client.ckey))
|
||||
@@ -315,7 +315,7 @@ GLOBAL_VAR_INIT(nologevent, 0)
|
||||
return
|
||||
var/key = stripped_input(usr, "Enter ckey to add/remove, or leave blank to cancel:", "VPN Whitelist add/remove", max_length=32)
|
||||
if(key)
|
||||
vpn_whitelist_panel(key)
|
||||
SSipintel.vpn_whitelist_panel(key)
|
||||
|
||||
/datum/admins/proc/Jobbans()
|
||||
if(!check_rights(R_BAN))
|
||||
@@ -462,8 +462,8 @@ GLOBAL_VAR_INIT(nologevent, 0)
|
||||
if(!check_rights(R_ADMIN))
|
||||
return
|
||||
|
||||
config.looc_allowed = !(config.looc_allowed)
|
||||
if(config.looc_allowed)
|
||||
GLOB.looc_enabled = !(GLOB.looc_enabled)
|
||||
if(GLOB.looc_enabled)
|
||||
to_chat(world, "<B>The LOOC channel has been globally enabled!</B>")
|
||||
else
|
||||
to_chat(world, "<B>The LOOC channel has been globally disabled!</B>")
|
||||
@@ -478,8 +478,8 @@ GLOBAL_VAR_INIT(nologevent, 0)
|
||||
if(!check_rights(R_ADMIN))
|
||||
return
|
||||
|
||||
config.dsay_allowed = !(config.dsay_allowed)
|
||||
if(config.dsay_allowed)
|
||||
GLOB.dsay_enabled = !(GLOB.dsay_enabled)
|
||||
if(GLOB.dsay_enabled)
|
||||
to_chat(world, "<B>Deadchat has been globally enabled!</B>")
|
||||
else
|
||||
to_chat(world, "<B>Deadchat has been globally disabled!</B>")
|
||||
@@ -495,7 +495,7 @@ GLOBAL_VAR_INIT(nologevent, 0)
|
||||
if(!check_rights(R_ADMIN))
|
||||
return
|
||||
|
||||
config.dooc_allowed = !( config.dooc_allowed )
|
||||
GLOB.dooc_enabled = !(GLOB.dooc_enabled)
|
||||
log_admin("[key_name(usr)] toggled Dead OOC.")
|
||||
message_admins("[key_name_admin(usr)] toggled Dead OOC.", 1)
|
||||
SSblackbox.record_feedback("tally", "admin_verb", 1, "Toggle Dead OOC") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
@@ -508,7 +508,7 @@ GLOBAL_VAR_INIT(nologevent, 0)
|
||||
if(!check_rights(R_ADMIN))
|
||||
return
|
||||
|
||||
config.disable_ooc_emoji = !(config.disable_ooc_emoji)
|
||||
GLOB.configuration.general.enable_ooc_emoji = !(GLOB.configuration.general.enable_ooc_emoji)
|
||||
log_admin("[key_name(usr)] toggled OOC Emoji.")
|
||||
message_admins("[key_name_admin(usr)] toggled OOC Emoji.", 1)
|
||||
SSblackbox.record_feedback("tally", "admin_verb", 1, "Toggle OOC Emoji")
|
||||
@@ -525,7 +525,7 @@ GLOBAL_VAR_INIT(nologevent, 0)
|
||||
alert("Unable to start the game as it is not set up.")
|
||||
return
|
||||
|
||||
if(config.start_now_confirmation)
|
||||
if(GLOB.configuration.general.start_now_confirmation)
|
||||
if(alert(usr, "This is a live server. Are you sure you want to start now?", "Start game", "Yes", "No") != "Yes")
|
||||
return
|
||||
|
||||
@@ -568,8 +568,9 @@ GLOBAL_VAR_INIT(nologevent, 0)
|
||||
if(!check_rights(R_EVENT))
|
||||
return
|
||||
|
||||
config.allow_ai = !( config.allow_ai )
|
||||
if(!( config.allow_ai ))
|
||||
|
||||
GLOB.configuration.jobs.allow_ai = !(GLOB.configuration.jobs.allow_ai)
|
||||
if(!GLOB.configuration.jobs.allow_ai)
|
||||
to_chat(world, "<B>The AI job is no longer chooseable.</B>")
|
||||
else
|
||||
to_chat(world, "<B>The AI job is chooseable now.</B>")
|
||||
@@ -586,13 +587,13 @@ GLOBAL_VAR_INIT(nologevent, 0)
|
||||
if(!check_rights(R_SERVER))
|
||||
return
|
||||
|
||||
GLOB.abandon_allowed = !( GLOB.abandon_allowed )
|
||||
if(GLOB.abandon_allowed)
|
||||
GLOB.configuration.general.respawn_enabled = !(GLOB.configuration.general.respawn_enabled)
|
||||
if(GLOB.configuration.general.respawn_enabled)
|
||||
to_chat(world, "<B>You may now respawn.</B>")
|
||||
else
|
||||
to_chat(world, "<B>You may no longer respawn :(</B>")
|
||||
message_admins("[key_name_admin(usr)] toggled respawn to [GLOB.abandon_allowed ? "On" : "Off"].", 1)
|
||||
log_admin("[key_name(usr)] toggled respawn to [GLOB.abandon_allowed ? "On" : "Off"].")
|
||||
to_chat(world, "<B>You may no longer respawn</B>")
|
||||
message_admins("[key_name_admin(usr)] toggled respawn to [GLOB.configuration.general.respawn_enabled ? "On" : "Off"].", 1)
|
||||
log_admin("[key_name(usr)] toggled respawn to [GLOB.configuration.general.respawn_enabled ? "On" : "Off"].")
|
||||
world.update_status()
|
||||
SSblackbox.record_feedback("tally", "admin_verb", 1, "Toggle Respawn") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
@@ -724,13 +725,13 @@ GLOBAL_VAR_INIT(nologevent, 0)
|
||||
if(!check_rights(R_SERVER))
|
||||
return
|
||||
|
||||
GLOB.guests_allowed = !( GLOB.guests_allowed )
|
||||
if(!( GLOB.guests_allowed ))
|
||||
GLOB.configuration.general.guest_ban = !(GLOB.configuration.general.guest_ban)
|
||||
if(GLOB.configuration.general.guest_ban)
|
||||
to_chat(world, "<B>Guests may no longer enter the game.</B>")
|
||||
else
|
||||
to_chat(world, "<B>Guests may now enter the game.</B>")
|
||||
log_admin("[key_name(usr)] toggled guests game entering [GLOB.guests_allowed ? "" : "dis"]allowed.")
|
||||
message_admins("<span class='notice'>[key_name_admin(usr)] toggled guests game entering [GLOB.guests_allowed ? "" : "dis"]allowed.</span>", 1)
|
||||
log_admin("[key_name(usr)] toggled guests game entering [GLOB.configuration?.general.guest_ban ? "dis" : ""]allowed.")
|
||||
message_admins("<span class='notice'>[key_name_admin(usr)] toggled guests game entering [GLOB.configuration?.general.guest_ban ? "dis" : ""]allowed.</span>", 1)
|
||||
SSblackbox.record_feedback("tally", "admin_verb", 1, "Toggle Guests") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
/datum/admins/proc/output_ai_laws()
|
||||
@@ -787,9 +788,15 @@ GLOBAL_VAR_INIT(gamma_ship_location, 1) // 0 = station , 1 = space
|
||||
if(GLOB.gamma_ship_location == 1)
|
||||
fromArea = locate(/area/shuttle/gamma/space)
|
||||
toArea = locate(/area/shuttle/gamma/station)
|
||||
for(var/obj/machinery/door/airlock/hatch/gamma/H in GLOB.airlocks)
|
||||
H.unlock(TRUE)
|
||||
GLOB.event_announcement.Announce("Central Command has deployed the Gamma Armory shuttle.", new_sound = 'sound/AI/commandreport.ogg')
|
||||
else
|
||||
fromArea = locate(/area/shuttle/gamma/station)
|
||||
toArea = locate(/area/shuttle/gamma/space)
|
||||
for(var/obj/machinery/door/airlock/hatch/gamma/H in GLOB.airlocks)
|
||||
H.lock(TRUE)
|
||||
GLOB.event_announcement.Announce("Central Command has recalled the Gamma Armory shuttle.", new_sound = 'sound/AI/commandreport.ogg')
|
||||
fromArea.move_contents_to(toArea)
|
||||
|
||||
for(var/obj/machinery/mech_bay_recharge_port/P in toArea)
|
||||
@@ -917,4 +924,3 @@ GLOBAL_VAR_INIT(gamma_ship_location, 1) // 0 = station , 1 = space
|
||||
continue
|
||||
result[1]++
|
||||
return result
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
watchlist_show()
|
||||
|
||||
if("hrefs") //persistant logs and stuff
|
||||
if(config && config.log_hrefs)
|
||||
if(GLOB.configuration.logging.href_logging)
|
||||
if(GLOB.world_href_log)
|
||||
src << browse(file(GLOB.world_href_log), "window=investigate[subject];size=800x300")
|
||||
else
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
switch(task)
|
||||
if("Write")
|
||||
var/datum/db_query/query_memocheck = SSdbcore.NewQuery(
|
||||
"SELECT ckey FROM [format_table_name("memo")] WHERE ckey=:ckey",
|
||||
"SELECT ckey FROM memo WHERE ckey=:ckey",
|
||||
list("ckey" = ckey)
|
||||
)
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
return
|
||||
|
||||
var/datum/db_query/query_memoadd = SSdbcore.NewQuery(
|
||||
"INSERT INTO [format_table_name("memo")] (ckey, memotext, timestamp) VALUES (:ckey, :memotext, NOW())",
|
||||
"INSERT INTO memo (ckey, memotext, timestamp) VALUES (:ckey, :memotext, NOW())",
|
||||
list(
|
||||
"ckey" = ckey,
|
||||
"memotext" = memotext
|
||||
@@ -57,7 +57,7 @@
|
||||
qdel(query_memoadd)
|
||||
|
||||
if("Edit")
|
||||
var/datum/db_query/query_memolist = SSdbcore.NewQuery("SELECT ckey FROM [format_table_name("memo")]")
|
||||
var/datum/db_query/query_memolist = SSdbcore.NewQuery("SELECT ckey FROM memo")
|
||||
|
||||
if(!query_memolist.warn_execute())
|
||||
qdel(query_memolist)
|
||||
@@ -78,7 +78,7 @@
|
||||
return
|
||||
|
||||
var/datum/db_query/query_memofind = SSdbcore.NewQuery(
|
||||
"SELECT memotext FROM [format_table_name("memo")] WHERE ckey=:ckey",
|
||||
"SELECT memotext FROM memo WHERE ckey=:ckey",
|
||||
list("ckey" = target_ckey)
|
||||
)
|
||||
|
||||
@@ -96,7 +96,7 @@
|
||||
var/edit_text = "Edited by [target_ckey] on [SQLtime()] from<br>[old_memo]<br>to<br>[new_memo]<hr>"
|
||||
|
||||
var/datum/db_query/update_query = SSdbcore.NewQuery(
|
||||
"UPDATE [format_table_name("memo")] SET memotext=:newmemo, last_editor=:lasteditor, edits=CONCAT(IFNULL(edits,''),:edittext) WHERE ckey=:targetckey",
|
||||
"UPDATE memo SET memotext=:newmemo, last_editor=:lasteditor, edits=CONCAT(IFNULL(edits,''),:edittext) WHERE ckey=:targetckey",
|
||||
list(
|
||||
"newmemo" = new_memo,
|
||||
"lasteditor" = ckey,
|
||||
@@ -120,7 +120,7 @@
|
||||
qdel(query_memofind)
|
||||
|
||||
if("Show")
|
||||
var/datum/db_query/query_memoshow = SSdbcore.NewQuery("SELECT ckey, memotext, timestamp, last_editor FROM [format_table_name("memo")]")
|
||||
var/datum/db_query/query_memoshow = SSdbcore.NewQuery("SELECT ckey, memotext, timestamp, last_editor FROM memo")
|
||||
if(!query_memoshow.warn_execute())
|
||||
qdel(query_memoshow)
|
||||
return
|
||||
@@ -141,7 +141,7 @@
|
||||
qdel(query_memoshow)
|
||||
|
||||
if("Remove")
|
||||
var/datum/db_query/query_memodellist = SSdbcore.NewQuery("SELECT ckey FROM [format_table_name("memo")]")
|
||||
var/datum/db_query/query_memodellist = SSdbcore.NewQuery("SELECT ckey FROM memo")
|
||||
if(!query_memodellist.warn_execute())
|
||||
qdel(query_memodellist)
|
||||
return
|
||||
@@ -161,7 +161,7 @@
|
||||
return
|
||||
|
||||
var/datum/db_query/query_memodel = SSdbcore.NewQuery(
|
||||
"DELETE FROM [format_table_name("memo")] WHERE ckey=:ckey",
|
||||
"DELETE FROM memo WHERE ckey=:ckey",
|
||||
list("ckey" = target_ckey)
|
||||
)
|
||||
|
||||
|
||||
@@ -7,25 +7,15 @@ GLOBAL_PROTECT(admin_ranks) // this shit is being protected for obvious reasons
|
||||
|
||||
var/previous_rights = 0
|
||||
|
||||
//load text from file
|
||||
var/list/Lines = file2list("config/admin_ranks.txt")
|
||||
|
||||
//process each line seperately
|
||||
for(var/line in Lines)
|
||||
if(!length(line)) continue
|
||||
if(copytext(line,1,2) == "#") continue
|
||||
|
||||
var/list/List = splittext(line,"+")
|
||||
if(!List.len) continue
|
||||
|
||||
var/rank = ckeyEx(List[1])
|
||||
switch(rank)
|
||||
if(null,"") continue
|
||||
if("Removed") continue //Reserved
|
||||
// Process each rank set seperately
|
||||
// key: rank name | value: list of rights
|
||||
for(var/rankname in GLOB.configuration.admin.rank_rights_map)
|
||||
var/list/rank_right_tokens = GLOB.configuration.admin.rank_rights_map[rankname]
|
||||
|
||||
var/rights = 0
|
||||
for(var/i=2, i<=List.len, i++)
|
||||
switch(ckey(List[i]))
|
||||
for(var/right_token in rank_right_tokens)
|
||||
var/token = lowertext(splittext(right_token, "+")[2])
|
||||
switch(token)
|
||||
if("@","prev") rights |= previous_rights
|
||||
if("buildmode","build") rights |= R_BUILDMODE
|
||||
if("admin") rights |= R_ADMIN
|
||||
@@ -46,7 +36,7 @@ GLOBAL_PROTECT(admin_ranks) // this shit is being protected for obvious reasons
|
||||
if("proccall") rights |= R_PROCCALL
|
||||
if("viewruntimes") rights |= R_VIEWRUNTIMES
|
||||
|
||||
GLOB.admin_ranks[rank] = rights
|
||||
GLOB.admin_ranks[rankname] = rights
|
||||
previous_rights = rights
|
||||
|
||||
#ifdef TESTING
|
||||
@@ -73,29 +63,13 @@ GLOBAL_PROTECT(admin_ranks) // this shit is being protected for obvious reasons
|
||||
for(var/A in world.GetConfig("admin"))
|
||||
world.SetConfig("APP/admin", A, null)
|
||||
|
||||
if(config.admin_legacy_system)
|
||||
if(!GLOB.configuration.admin.use_database_admins)
|
||||
load_admin_ranks()
|
||||
|
||||
//load text from file
|
||||
var/list/Lines = file2list("config/admins.txt")
|
||||
|
||||
//process each line seperately
|
||||
for(var/line in Lines)
|
||||
if(!length(line)) continue
|
||||
if(copytext(line,1,2) == "#") continue
|
||||
|
||||
//Split the line at every "-"
|
||||
var/list/List = splittext(line, "-")
|
||||
if(!List.len) continue
|
||||
|
||||
//ckey is before the first "-"
|
||||
var/ckey = ckey(List[1])
|
||||
if(!ckey) continue
|
||||
|
||||
//rank follows the first "-"
|
||||
var/rank = ""
|
||||
if(List.len >= 2)
|
||||
rank = ckeyEx(List[2])
|
||||
for(var/iterator_key in GLOB.configuration.admin.ckey_rank_map)
|
||||
var/ckey = ckey(iterator_key) // Snip out formatting
|
||||
var/rank = GLOB.configuration.admin.ckey_rank_map[iterator_key]
|
||||
|
||||
//load permissions associated with this rank
|
||||
var/rights = GLOB.admin_ranks[rank]
|
||||
@@ -113,11 +87,11 @@ GLOBAL_PROTECT(admin_ranks) // this shit is being protected for obvious reasons
|
||||
//The current admin system uses SQL
|
||||
if(!SSdbcore.IsConnected())
|
||||
log_world("Failed to connect to database in load_admins(). Reverting to legacy system.")
|
||||
config.admin_legacy_system = 1
|
||||
GLOB.configuration.admin.use_database_admins = FALSE
|
||||
load_admins()
|
||||
return
|
||||
|
||||
var/datum/db_query/query = SSdbcore.NewQuery("SELECT ckey, admin_rank, level, flags FROM [format_table_name("admin")]")
|
||||
var/datum/db_query/query = SSdbcore.NewQuery("SELECT ckey, admin_rank, level, flags FROM admin")
|
||||
if(!query.warn_execute(async=run_async))
|
||||
qdel(query)
|
||||
return
|
||||
@@ -141,7 +115,7 @@ GLOBAL_PROTECT(admin_ranks) // this shit is being protected for obvious reasons
|
||||
|
||||
if(!GLOB.admin_datums)
|
||||
log_world("The database query in load_admins() resulted in no admins being added to the list. Reverting to legacy system.")
|
||||
config.admin_legacy_system = 1
|
||||
GLOB.configuration.admin.use_database_admins = FALSE
|
||||
load_admins()
|
||||
return
|
||||
|
||||
|
||||
@@ -137,7 +137,6 @@ GLOBAL_LIST_INIT(admin_verbs_server, list(
|
||||
/client/proc/toggle_antagHUD_restrictions,
|
||||
/client/proc/set_ooc,
|
||||
/client/proc/reset_ooc,
|
||||
/client/proc/toggledrones,
|
||||
/client/proc/set_next_map
|
||||
))
|
||||
GLOBAL_LIST_INIT(admin_verbs_debug, list(
|
||||
@@ -403,7 +402,7 @@ GLOBAL_LIST_INIT(admin_verbs_ticket, list(
|
||||
if(!check_rights(R_BAN))
|
||||
return
|
||||
|
||||
if(config.ban_legacy_system)
|
||||
if(!GLOB.configuration.general.use_database_bans)
|
||||
holder.unbanpanel()
|
||||
else
|
||||
holder.DB_ban_panel()
|
||||
@@ -679,28 +678,20 @@ GLOBAL_LIST_INIT(admin_verbs_ticket, list(
|
||||
|
||||
var/datum/admins/D = GLOB.admin_datums[ckey]
|
||||
var/rank = null
|
||||
if(config.admin_legacy_system)
|
||||
//load text from file
|
||||
var/list/Lines = file2list("config/admins.txt")
|
||||
for(var/line in Lines)
|
||||
if(findtext(line, "#")) // Skip comments
|
||||
if(!GLOB.configuration.admin.use_database_admins)
|
||||
for(var/iterator_key in GLOB.configuration.admin.ckey_rank_map)
|
||||
var/_ckey = ckey(iterator_key) // Snip out formatting
|
||||
if(ckey != _ckey)
|
||||
continue
|
||||
|
||||
var/list/splitline = splittext(line, " - ")
|
||||
if(length(splitline) != 2) // Always 'ckey - rank'
|
||||
continue
|
||||
if(lowertext(splitline[1]) == ckey)
|
||||
rank = ckeyEx(splitline[2])
|
||||
break
|
||||
continue
|
||||
|
||||
rank = GLOB.configuration.admin.ckey_rank_map[iterator_key]
|
||||
break
|
||||
else
|
||||
if(!SSdbcore.IsConnected())
|
||||
to_chat(src, "Warning, MYSQL database is not connected.")
|
||||
return
|
||||
|
||||
var/datum/db_query/rank_read = SSdbcore.NewQuery(
|
||||
"SELECT admin_rank FROM [format_table_name("admin")] WHERE ckey=:ckey",
|
||||
"SELECT admin_rank FROM admin WHERE ckey=:ckey",
|
||||
list("ckey" = ckey)
|
||||
)
|
||||
|
||||
@@ -713,7 +704,7 @@ GLOBAL_LIST_INIT(admin_verbs_ticket, list(
|
||||
|
||||
qdel(rank_read)
|
||||
if(!D)
|
||||
if(config.admin_legacy_system)
|
||||
if(!GLOB.configuration.admin.use_database_admins)
|
||||
if(GLOB.admin_ranks[rank] == null)
|
||||
error("Error while re-adminning [src], admin rank ([rank]) does not exist.")
|
||||
to_chat(src, "Error while re-adminning, admin rank ([rank]) does not exist.")
|
||||
@@ -726,7 +717,7 @@ GLOBAL_LIST_INIT(admin_verbs_ticket, list(
|
||||
return
|
||||
|
||||
var/datum/db_query/admin_read = SSdbcore.NewQuery(
|
||||
"SELECT ckey, admin_rank, flags FROM [format_table_name("admin")] WHERE ckey=:ckey",
|
||||
"SELECT ckey, admin_rank, flags FROM admin WHERE ckey=:ckey",
|
||||
list("ckey" = ckey)
|
||||
)
|
||||
|
||||
@@ -773,13 +764,13 @@ GLOBAL_LIST_INIT(admin_verbs_ticket, list(
|
||||
if(!check_rights(R_SERVER))
|
||||
return
|
||||
|
||||
if(config)
|
||||
if(config.log_hrefs)
|
||||
config.log_hrefs = 0
|
||||
to_chat(src, "<b>Stopped logging hrefs</b>")
|
||||
else
|
||||
config.log_hrefs = 1
|
||||
to_chat(src, "<b>Started logging hrefs</b>")
|
||||
// Why would we ever turn this off?
|
||||
if(GLOB.configuration.logging.href_logging)
|
||||
GLOB.configuration.logging.href_logging = FALSE
|
||||
to_chat(src, "<b>Stopped logging hrefs</b>")
|
||||
else
|
||||
GLOB.configuration.logging.href_logging = TRUE
|
||||
to_chat(src, "<b>Started logging hrefs</b>")
|
||||
|
||||
/client/proc/check_ai_laws()
|
||||
set name = "Check AI Laws"
|
||||
@@ -956,17 +947,6 @@ GLOBAL_LIST_INIT(admin_verbs_ticket, list(
|
||||
else
|
||||
to_chat(usr, "You now will get admin ticket messages.")
|
||||
|
||||
/client/proc/toggledrones()
|
||||
set name = "Toggle Maintenance Drones"
|
||||
set category = "Server"
|
||||
|
||||
if(!check_rights(R_SERVER))
|
||||
return
|
||||
|
||||
config.allow_drone_spawn = !(config.allow_drone_spawn)
|
||||
log_admin("[key_name(usr)] has [config.allow_drone_spawn ? "enabled" : "disabled"] maintenance drones.")
|
||||
message_admins("[key_name_admin(usr)] has [config.allow_drone_spawn ? "enabled" : "disabled"] maintenance drones.")
|
||||
|
||||
/client/proc/toggledebuglogs()
|
||||
set name = "Toggle Debug Log Messages"
|
||||
set category = "Preferences"
|
||||
|
||||
@@ -40,8 +40,9 @@ DEBUG
|
||||
appearance_loadbanfile()
|
||||
*/
|
||||
// AA 2020-11-25: This entire proc isnt even called. What the actual fuck.
|
||||
// AA 2021-05-23: This entire proc STILL isnt even called. I am going to screan.
|
||||
/proc/appearance_loadbanfile()
|
||||
if(config.ban_legacy_system)
|
||||
if(!GLOB.configuration.general.use_database_bans)
|
||||
var/savefile/S=new("data/appearance_full.ban")
|
||||
S["keys[0]"] >> GLOB.appearance_keylist
|
||||
log_admin("Loading appearance_rank")
|
||||
@@ -53,12 +54,12 @@ DEBUG
|
||||
else
|
||||
if(!SSdbcore.IsConnected())
|
||||
log_world("Database connection failed. Reverting to the legacy ban system.")
|
||||
config.ban_legacy_system = 1
|
||||
GLOB.configuration.general.use_database_bans = FALSE
|
||||
appearance_loadbanfile()
|
||||
return
|
||||
|
||||
//appearance bans
|
||||
var/datum/db_query/appearanceban_query = SSdbcore.NewQuery("SELECT ckey FROM [format_table_name("ban")] WHERE bantype = 'APPEARANCE_BAN' AND NOT unbanned = 1")
|
||||
var/datum/db_query/appearanceban_query = SSdbcore.NewQuery("SELECT ckey FROM ban WHERE bantype = 'APPEARANCE_BAN' AND NOT unbanned = 1")
|
||||
|
||||
if(!appearanceban_query.warn_execute())
|
||||
qdel(appearanceban_query)
|
||||
|
||||
@@ -17,7 +17,7 @@ GLOBAL_DATUM_INIT(jobban_regex, /regex, regex("(\[\\S]+) - (\[^#]+\[^# ])(?: ##
|
||||
return
|
||||
GLOB.jobban_keylist.Add(text("[M.ckey] - [rank] ## [reason]"))
|
||||
jobban_assoc_insert(M.ckey, rank, reason)
|
||||
if(config.ban_legacy_system)
|
||||
if(!GLOB.configuration.general.use_database_bans)
|
||||
jobban_savebanfile()
|
||||
|
||||
/proc/jobban_client_fullban(ckey, rank)
|
||||
@@ -25,7 +25,7 @@ GLOBAL_DATUM_INIT(jobban_regex, /regex, regex("(\[\\S]+) - (\[^#]+\[^# ])(?: ##
|
||||
return
|
||||
GLOB.jobban_keylist.Add(text("[ckey] - [rank]"))
|
||||
jobban_assoc_insert(ckey, rank)
|
||||
if(config.ban_legacy_system)
|
||||
if(!GLOB.configuration.general.use_database_bans)
|
||||
jobban_savebanfile()
|
||||
|
||||
//returns a reason if M is banned from rank, returns 0 otherwise
|
||||
@@ -33,7 +33,7 @@ GLOBAL_DATUM_INIT(jobban_regex, /regex, regex("(\[\\S]+) - (\[^#]+\[^# ])(?: ##
|
||||
if(!M || !rank)
|
||||
return 0
|
||||
|
||||
if(config.guest_jobban && guest_jobbans(rank))
|
||||
if(GLOB.configuration.jobs.guest_job_ban && guest_jobbans(rank))
|
||||
if(IsGuestKey(M.key))
|
||||
return "Guest Job-ban"
|
||||
|
||||
@@ -46,7 +46,7 @@ GLOBAL_DATUM_INIT(jobban_regex, /regex, regex("(\[\\S]+) - (\[^#]+\[^# ])(?: ##
|
||||
if(!ckey || !rank)
|
||||
return null
|
||||
|
||||
if(config.guest_jobban && guest_jobbans(rank))
|
||||
if(GLOB.configuration.jobs.guest_job_ban && guest_jobbans(rank))
|
||||
if(IsGuestKey(ckey))
|
||||
return "Guest Job-ban"
|
||||
|
||||
@@ -56,7 +56,7 @@ GLOBAL_DATUM_INIT(jobban_regex, /regex, regex("(\[\\S]+) - (\[^#]+\[^# ])(?: ##
|
||||
return null
|
||||
|
||||
/proc/jobban_loadbanfile()
|
||||
if(config.ban_legacy_system)
|
||||
if(!GLOB.configuration.general.use_database_bans)
|
||||
var/savefile/S=new("data/job_full.ban")
|
||||
S["keys[0]"] >> GLOB.jobban_keylist
|
||||
log_admin("Loading jobban_rank")
|
||||
@@ -74,12 +74,12 @@ GLOBAL_DATUM_INIT(jobban_regex, /regex, regex("(\[\\S]+) - (\[^#]+\[^# ])(?: ##
|
||||
else
|
||||
if(!SSdbcore.IsConnected())
|
||||
log_world("Database connection failed. Reverting to the legacy ban system.")
|
||||
config.ban_legacy_system = 1
|
||||
GLOB.configuration.general.use_database_bans = FALSE
|
||||
jobban_loadbanfile()
|
||||
return
|
||||
|
||||
//Job permabans
|
||||
var/datum/db_query/permabans = SSdbcore.NewQuery("SELECT ckey, job FROM [format_table_name("ban")] WHERE bantype = 'JOB_PERMABAN' AND isnull(unbanned)")
|
||||
var/datum/db_query/permabans = SSdbcore.NewQuery("SELECT ckey, job FROM ban WHERE bantype = 'JOB_PERMABAN' AND isnull(unbanned)")
|
||||
|
||||
if(!permabans.warn_execute(async=FALSE))
|
||||
qdel(permabans)
|
||||
@@ -94,7 +94,7 @@ GLOBAL_DATUM_INIT(jobban_regex, /regex, regex("(\[\\S]+) - (\[^#]+\[^# ])(?: ##
|
||||
qdel(permabans)
|
||||
|
||||
// Job tempbans
|
||||
var/datum/db_query/tempbans = SSdbcore.NewQuery("SELECT ckey, job FROM [format_table_name("ban")] WHERE bantype = 'JOB_TEMPBAN' AND isnull(unbanned) AND expiration_time > Now()")
|
||||
var/datum/db_query/tempbans = SSdbcore.NewQuery("SELECT ckey, job FROM ban WHERE bantype = 'JOB_TEMPBAN' AND isnull(unbanned) AND expiration_time > Now()")
|
||||
|
||||
if(!tempbans.warn_execute(async=FALSE))
|
||||
qdel(tempbans)
|
||||
@@ -132,7 +132,7 @@ GLOBAL_DATUM_INIT(jobban_regex, /regex, regex("(\[\\S]+) - (\[^#]+\[^# ])(?: ##
|
||||
else
|
||||
log_runtime(EXCEPTION("Failed to remove malformed job ban from associative list: [X]"))
|
||||
GLOB.jobban_keylist.Remove(GLOB.jobban_keylist[i])
|
||||
if(config.ban_legacy_system)
|
||||
if(!GLOB.configuration.general.use_database_bans)
|
||||
jobban_savebanfile()
|
||||
return 1
|
||||
return 0
|
||||
@@ -144,7 +144,7 @@ GLOBAL_DATUM_INIT(jobban_regex, /regex, regex("(\[\\S]+) - (\[^#]+\[^# ])(?: ##
|
||||
|
||||
if(!client || !ckey)
|
||||
return
|
||||
if(config.ban_legacy_system)
|
||||
if(!GLOB.configuration.general.use_database_bans)
|
||||
//using the legacy .txt ban system
|
||||
to_chat(src, "The server is using the legacy ban system. Ask an administrator for help!")
|
||||
|
||||
@@ -152,7 +152,7 @@ GLOBAL_DATUM_INIT(jobban_regex, /regex, regex("(\[\\S]+) - (\[^#]+\[^# ])(?: ##
|
||||
//using the SQL ban system
|
||||
var/is_actually_banned = FALSE
|
||||
var/datum/db_query/select_query = SSdbcore.NewQuery({"
|
||||
SELECT bantime, bantype, reason, job, duration, expiration_time, a_ckey FROM [format_table_name("ban")]
|
||||
SELECT bantime, bantype, reason, job, duration, expiration_time, a_ckey FROM ban
|
||||
WHERE ckey LIKE :ckey AND ((bantype like 'JOB_TEMPBAN' AND expiration_time > Now()) OR (bantype like 'JOB_PERMABAN')) AND isnull(unbanned)
|
||||
ORDER BY bantime DESC LIMIT 100"},
|
||||
list("ckey" = ckey)
|
||||
@@ -182,7 +182,7 @@ GLOBAL_DATUM_INIT(jobban_regex, /regex, regex("(\[\\S]+) - (\[^#]+\[^# ])(?: ##
|
||||
qdel(select_query)
|
||||
|
||||
if(is_actually_banned)
|
||||
if(config.banappeals)
|
||||
to_chat(src, "<span class='warning'>You can appeal the bans at: [config.banappeals]</span>")
|
||||
if(GLOB.configuration.url.banappeals_url)
|
||||
to_chat(src, "<span class='warning'>You can appeal the bans at: [GLOB.configuration.url.banappeals_url]</span>")
|
||||
else
|
||||
to_chat(src, "<span class='warning'>You have no active jobbans!</span>")
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
*/
|
||||
/datum/admins/proc/create_ccbdb_lookup(ckey)
|
||||
// Bail if disabled
|
||||
if(!config.centcom_ban_db_url)
|
||||
if(!GLOB.configuration.url.centcom_ban_db_url)
|
||||
to_chat(usr, "<span class='warning'>The CentCom Ban DB lookup is disabled. Please inform a maintainer or server host.</span>")
|
||||
return
|
||||
// Bail if no ckey is supplied
|
||||
@@ -22,7 +22,7 @@
|
||||
return
|
||||
|
||||
var/datum/callback/cb = CALLBACK(src, /datum/admins/.proc/ccbdb_lookup_callback, usr, ckey)
|
||||
SShttp.create_async_request(RUSTG_HTTP_METHOD_GET, "[config.centcom_ban_db_url][ckey]", proc_callback=cb)
|
||||
SShttp.create_async_request(RUSTG_HTTP_METHOD_GET, "[GLOB.configuration.url.centcom_ban_db_url][ckey]", proc_callback=cb)
|
||||
|
||||
/**
|
||||
* CCBDB Lookup Callback
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
var/has_note = FALSE
|
||||
var/raw_text = ""
|
||||
// Now lets see if we have a note logging the infraction in the past
|
||||
var/datum/db_query/check_existing_note = SSdbcore.NewQuery("SELECT notetext FROM [format_table_name("notes")] WHERE ckey=:ckey AND adminckey=:ackey", list(
|
||||
var/datum/db_query/check_existing_note = SSdbcore.NewQuery("SELECT notetext FROM notes WHERE ckey=:ckey AND adminckey=:ackey", list(
|
||||
"ckey" = cookie_holder_ckey,
|
||||
"ackey" = COOKIERECORD_PSUEDO_CKEY
|
||||
))
|
||||
@@ -99,7 +99,7 @@
|
||||
serialized_text = serialized_list.Join("<br>")
|
||||
|
||||
if(has_note) // They have a note. Update.
|
||||
var/datum/db_query/update_existing_note = SSdbcore.NewQuery("UPDATE [format_table_name("notes")] SET notetext=:nt, timestamp=NOW(), round_id=:rid WHERE ckey=:ckey AND adminckey=:ackey", list(
|
||||
var/datum/db_query/update_existing_note = SSdbcore.NewQuery("UPDATE notes SET notetext=:nt, timestamp=NOW(), round_id=:rid WHERE ckey=:ckey AND adminckey=:ackey", list(
|
||||
"nt" = serialized_text,
|
||||
"rid" = GLOB.round_id,
|
||||
"ckey" = cookie_holder_ckey,
|
||||
|
||||
@@ -86,7 +86,7 @@
|
||||
message_admins("<font color='red'>[key_name_admin(usr)] attempted to add a ban based on a non-existent mob, with no ckey provided. Report this bug.",1)
|
||||
return
|
||||
|
||||
var/datum/db_query/query = SSdbcore.NewQuery("SELECT id FROM [format_table_name("player")] WHERE ckey=:ckey", list(
|
||||
var/datum/db_query/query = SSdbcore.NewQuery("SELECT id FROM player WHERE ckey=:ckey", list(
|
||||
"ckey" = ckey
|
||||
))
|
||||
if(!query.warn_execute())
|
||||
@@ -131,7 +131,7 @@
|
||||
adminwho += ", [C]"
|
||||
|
||||
if(maxadminbancheck)
|
||||
var/datum/db_query/adm_query = SSdbcore.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)", list(
|
||||
var/datum/db_query/adm_query = SSdbcore.NewQuery("SELECT count(id) AS num FROM ban WHERE (a_ckey=:a_ckey) AND (bantype = 'ADMIN_PERMABAN' OR (bantype = 'ADMIN_TEMPBAN' AND expiration_time > Now())) AND isnull(unbanned)", list(
|
||||
"a_ckey" = a_ckey
|
||||
))
|
||||
if(!adm_query.warn_execute())
|
||||
@@ -146,7 +146,7 @@
|
||||
qdel(adm_query)
|
||||
|
||||
var/datum/db_query/query_insert = SSdbcore.NewQuery({"
|
||||
INSERT INTO [format_table_name("ban")] (`id`,`bantime`,`serverip`,`bantype`,`reason`,`job`,`duration`,`rounds`,`expiration_time`,`ckey`,`computerid`,`ip`,`a_ckey`,`a_computerid`,`a_ip`,`who`,`adminwho`,`edits`,`unbanned`,`unbanned_datetime`,`unbanned_ckey`,`unbanned_computerid`,`unbanned_ip`,`ban_round_id`,`unbanned_round_id`)
|
||||
INSERT INTO ban (`id`,`bantime`,`serverip`,`bantype`,`reason`,`job`,`duration`,`rounds`,`expiration_time`,`ckey`,`computerid`,`ip`,`a_ckey`,`a_computerid`,`a_ip`,`who`,`adminwho`,`edits`,`unbanned`,`unbanned_datetime`,`unbanned_ckey`,`unbanned_computerid`,`unbanned_ip`,`ban_round_id`,`unbanned_round_id`)
|
||||
VALUES (null, Now(), :serverip, :bantype_str, :reason, :job, :duration, :rounds, Now() + INTERVAL :duration MINUTE, :ckey, :computerid, :ip, :a_ckey, :a_computerid, :a_ip, :who, :adminwho, '', null, null, null, null, null, :roundid, null)
|
||||
"}, list(
|
||||
// Get ready for parameters
|
||||
@@ -233,7 +233,7 @@
|
||||
else
|
||||
bantype_sql = "bantype = '[bantype_str]'"
|
||||
|
||||
var/sql = "SELECT id FROM [format_table_name("ban")] WHERE ckey=:ckey AND [bantype_sql] AND (unbanned is null OR unbanned = false)"
|
||||
var/sql = "SELECT id FROM ban WHERE ckey=:ckey AND [bantype_sql] AND (unbanned is null OR unbanned = false)"
|
||||
var/list/sql_params = list(
|
||||
"ckey" = ckey
|
||||
)
|
||||
@@ -283,7 +283,7 @@
|
||||
to_chat(usr, "Cancelled")
|
||||
return
|
||||
|
||||
var/datum/db_query/query = SSdbcore.NewQuery("SELECT ckey, duration, reason, job FROM [format_table_name("ban")] WHERE id=:banid", list(
|
||||
var/datum/db_query/query = SSdbcore.NewQuery("SELECT ckey, duration, reason, job FROM ban WHERE id=:banid", list(
|
||||
"banid" = banid
|
||||
))
|
||||
if(!query.warn_execute())
|
||||
@@ -318,7 +318,7 @@
|
||||
return
|
||||
|
||||
var/edit_reason = "- [eckey] changed ban reason from <cite><b>\\\"[reason]\\\"</b></cite> to <cite><b>\\\"[value]\\\"</b></cite><BR>"
|
||||
var/datum/db_query/update_query = SSdbcore.NewQuery("UPDATE [format_table_name("ban")] SET reason=:value, edits = CONCAT(IFNULL(edits,''), :edittext) WHERE id=:banid", list(
|
||||
var/datum/db_query/update_query = SSdbcore.NewQuery("UPDATE ban SET reason=:value, edits = CONCAT(IFNULL(edits,''), :edittext) WHERE id=:banid", list(
|
||||
"edittext" = edit_reason,
|
||||
"banid" = banid,
|
||||
"value" = value
|
||||
@@ -337,7 +337,7 @@
|
||||
return
|
||||
|
||||
var/edittext = "- [eckey] changed ban duration from [duration] to [value]<br>"
|
||||
var/datum/db_query/update_query = SSdbcore.NewQuery("UPDATE [format_table_name("ban")] SET duration=:value, edits = CONCAT(IFNULL(edits, ''), :edittext), expiration_time = DATE_ADD(bantime, INTERVAL :value MINUTE) WHERE id=:banid", list(
|
||||
var/datum/db_query/update_query = SSdbcore.NewQuery("UPDATE ban SET duration=:value, edits = CONCAT(IFNULL(edits, ''), :edittext), expiration_time = DATE_ADD(bantime, INTERVAL :value MINUTE) WHERE id=:banid", list(
|
||||
"edittext" = edittext,
|
||||
"banid" = banid,
|
||||
"value" = value
|
||||
@@ -373,7 +373,7 @@
|
||||
var/ban_number = 0 //failsafe
|
||||
|
||||
var/pckey
|
||||
var/datum/db_query/query = SSdbcore.NewQuery("SELECT ckey FROM [format_table_name("ban")] WHERE id=:banid", list(
|
||||
var/datum/db_query/query = SSdbcore.NewQuery("SELECT ckey FROM ban WHERE id=:banid", list(
|
||||
"banid" = id
|
||||
))
|
||||
if(!query.warn_execute())
|
||||
@@ -400,7 +400,7 @@
|
||||
var/unban_computerid = src.owner:computer_id
|
||||
var/unban_ip = src.owner:address
|
||||
|
||||
var/datum/db_query/query_update = SSdbcore.NewQuery("UPDATE [format_table_name("ban")] SET unbanned = 1, unbanned_datetime = Now(), unbanned_ckey=:unban_ckey, unbanned_computerid=:unban_computerid, unbanned_ip=:unban_ip, unbanned_round_id=:roundid WHERE id=:id", list(
|
||||
var/datum/db_query/query_update = SSdbcore.NewQuery("UPDATE ban SET unbanned = 1, unbanned_datetime = Now(), unbanned_ckey=:unban_ckey, unbanned_computerid=:unban_computerid, unbanned_ip=:unban_ip, unbanned_round_id=:roundid WHERE id=:id", list(
|
||||
"unban_ckey" = unban_ckey,
|
||||
"unban_computerid" = unban_computerid,
|
||||
"unban_ip" = unban_ip,
|
||||
@@ -587,7 +587,7 @@
|
||||
|
||||
var/datum/db_query/select_query = SSdbcore.NewQuery({"
|
||||
SELECT id, bantime, bantype, reason, job, duration, expiration_time, ckey, a_ckey, unbanned, unbanned_ckey, unbanned_datetime, edits, ip, computerid, ban_round_id, unbanned_round_id
|
||||
FROM [format_table_name("ban")] WHERE 1 [playersearch] [adminsearch] [ipsearch] [cidsearch] [bantypesearch] ORDER BY bantime DESC LIMIT 100"}, sql_params)
|
||||
FROM ban WHERE 1 [playersearch] [adminsearch] [ipsearch] [cidsearch] [bantypesearch] ORDER BY bantime DESC LIMIT 100"}, sql_params)
|
||||
|
||||
if(!select_query.warn_execute())
|
||||
qdel(select_query)
|
||||
@@ -673,7 +673,7 @@
|
||||
/proc/flag_account_for_forum_sync(ckey)
|
||||
if(!SSdbcore.IsConnected())
|
||||
return
|
||||
var/datum/db_query/adm_query = SSdbcore.NewQuery("UPDATE [format_table_name("player")] SET fupdate = 1 WHERE ckey=:ckey", list(
|
||||
var/datum/db_query/adm_query = SSdbcore.NewQuery("UPDATE player SET fupdate = 1 WHERE ckey=:ckey", list(
|
||||
"ckey" = ckey
|
||||
))
|
||||
// We do nothing with output here so we dont need to wrap the warn_execute() inside an if statement
|
||||
|
||||
@@ -1,247 +0,0 @@
|
||||
/datum/ipintel
|
||||
var/ip
|
||||
var/intel = 0
|
||||
var/cache = FALSE
|
||||
var/cacheminutesago = 0
|
||||
var/cachedate = ""
|
||||
var/cacherealtime = 0
|
||||
|
||||
/datum/ipintel/New()
|
||||
cachedate = SQLtime()
|
||||
cacherealtime = world.realtime
|
||||
|
||||
/datum/ipintel/proc/is_valid()
|
||||
. = FALSE
|
||||
if(intel < 0)
|
||||
return
|
||||
if(intel <= config.ipintel_rating_bad)
|
||||
if(world.realtime < cacherealtime + (config.ipintel_save_good HOURS))
|
||||
return TRUE
|
||||
else
|
||||
if(world.realtime < cacherealtime + (config.ipintel_save_bad HOURS))
|
||||
return TRUE
|
||||
|
||||
/proc/get_ip_intel(ip, bypasscache = FALSE, updatecache = TRUE)
|
||||
var/datum/ipintel/res = new()
|
||||
res.ip = ip
|
||||
. = res
|
||||
if(!ip || !config.ipintel_email || !SSipintel.enabled)
|
||||
return
|
||||
if(!bypasscache)
|
||||
var/datum/ipintel/cachedintel = SSipintel.cache[ip]
|
||||
if(cachedintel && cachedintel.is_valid())
|
||||
cachedintel.cache = TRUE
|
||||
return cachedintel
|
||||
|
||||
if(SSdbcore.IsConnected())
|
||||
var/datum/db_query/query_get_ip_intel = SSdbcore.NewQuery({"
|
||||
SELECT date, intel, TIMESTAMPDIFF(MINUTE,date,NOW())
|
||||
FROM [format_table_name("ipintel")]
|
||||
WHERE
|
||||
ip = INET_ATON(:ip)
|
||||
AND ((
|
||||
intel < :rating_bad
|
||||
AND
|
||||
date + INTERVAL :save_good HOUR > NOW()
|
||||
) OR (
|
||||
intel >= :rating_bad
|
||||
AND
|
||||
date + INTERVAL :save_bad HOUR > NOW()
|
||||
))
|
||||
"}, list(
|
||||
"ip" = ip,
|
||||
"rating_bad" = config.ipintel_rating_bad,
|
||||
"save_good" = config.ipintel_save_good,
|
||||
"save_bad" = config.ipintel_save_bad,
|
||||
))
|
||||
if(!query_get_ip_intel.warn_execute())
|
||||
qdel(query_get_ip_intel)
|
||||
return
|
||||
if(query_get_ip_intel.NextRow())
|
||||
res.cache = TRUE
|
||||
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
|
||||
qdel(query_get_ip_intel)
|
||||
return
|
||||
qdel(query_get_ip_intel)
|
||||
res.intel = ip_intel_query(ip)
|
||||
if(updatecache && res.intel >= 0)
|
||||
SSipintel.cache[ip] = res
|
||||
if(SSdbcore.IsConnected())
|
||||
var/datum/db_query/query_add_ip_intel = SSdbcore.NewQuery({"
|
||||
INSERT INTO [format_table_name("ipintel")] (ip, intel) VALUES (INET_ATON(:ip), :intel)
|
||||
ON DUPLICATE KEY UPDATE intel = VALUES(intel), date = NOW()"},
|
||||
list(
|
||||
"ip" = ip,
|
||||
"intel" = res.intel
|
||||
)
|
||||
)
|
||||
query_add_ip_intel.warn_execute()
|
||||
qdel(query_add_ip_intel)
|
||||
|
||||
|
||||
/proc/ip_intel_query(ip, retryed=0)
|
||||
. = -1 //default
|
||||
if(!ip)
|
||||
return
|
||||
if(SSipintel.throttle > world.timeofday)
|
||||
return
|
||||
if(!SSipintel.enabled)
|
||||
return
|
||||
|
||||
// Do not refactor this to use SShttp, because that requires the subsystem to be firing for requests to be made, and this will be triggered before the MC has finished loading
|
||||
var/list/http[] = world.Export("http://[config.ipintel_domain]/check.php?ip=[ip]&contact=[config.ipintel_email]&format=json&flags=b")
|
||||
|
||||
if(http)
|
||||
var/status = text2num(http["STATUS"])
|
||||
|
||||
if(status == 200)
|
||||
var/response = json_decode(file2text(http["CONTENT"]))
|
||||
if(response)
|
||||
if(response["status"] == "success")
|
||||
var/intelnum = text2num(response["result"])
|
||||
if(isnum(intelnum))
|
||||
return text2num(response["result"])
|
||||
else
|
||||
ipintel_handle_error("Bad intel from server: [response["result"]].", ip, retryed)
|
||||
if(!retryed)
|
||||
sleep(25)
|
||||
return .(ip, 1)
|
||||
else
|
||||
ipintel_handle_error("Bad response from server: [response["status"]].", ip, retryed)
|
||||
if(!retryed)
|
||||
sleep(25)
|
||||
return .(ip, 1)
|
||||
|
||||
else if(status == 429)
|
||||
ipintel_handle_error("Error #429: We have exceeded the rate limit.", ip, 1)
|
||||
return
|
||||
else
|
||||
ipintel_handle_error("Unknown status code: [status].", ip, retryed)
|
||||
if(!retryed)
|
||||
sleep(25)
|
||||
return .(ip, 1)
|
||||
else
|
||||
ipintel_handle_error("Unable to connect to API.", ip, retryed)
|
||||
if(!retryed)
|
||||
sleep(25)
|
||||
return .(ip, 1)
|
||||
|
||||
|
||||
/proc/ipintel_handle_error(error, ip, retryed)
|
||||
if(retryed)
|
||||
SSipintel.errors++
|
||||
error += " Could not check [ip]. Disabling IPINTEL for [SSipintel.errors] minute[( SSipintel.errors == 1 ? "" : "s" )]"
|
||||
SSipintel.throttle = world.timeofday + (2 * SSipintel.errors MINUTES)
|
||||
else
|
||||
error += " Attempting retry on [ip]."
|
||||
log_ipintel(error)
|
||||
|
||||
/proc/log_ipintel(text)
|
||||
log_game("IPINTEL: [text]")
|
||||
log_debug("IPINTEL: [text]")
|
||||
|
||||
|
||||
/proc/ipintel_is_banned(t_ckey, t_ip)
|
||||
if(!config.ipintel_email)
|
||||
return FALSE
|
||||
if(!config.ipintel_whitelist)
|
||||
return FALSE
|
||||
if(!SSdbcore.IsConnected())
|
||||
return FALSE
|
||||
if(!ipintel_badip_check(t_ip))
|
||||
return FALSE
|
||||
if(vpn_whitelist_check(t_ckey))
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
/proc/ipintel_badip_check(target_ip)
|
||||
var/rating_bad = config.ipintel_rating_bad
|
||||
if(!rating_bad)
|
||||
log_debug("ipintel_badip_check reports misconfigured rating_bad directive")
|
||||
return FALSE
|
||||
var/valid_hours = config.ipintel_save_bad
|
||||
if(!valid_hours)
|
||||
log_debug("ipintel_badip_check reports misconfigured ipintel_save_bad directive")
|
||||
return FALSE
|
||||
var/datum/db_query/query_get_ip_intel = SSdbcore.NewQuery({"
|
||||
SELECT * FROM [format_table_name("ipintel")] WHERE ip = INET_ATON(:target_ip)
|
||||
AND intel >= :rating_bad AND (date + INTERVAL :valid_hours HOUR) > NOW()"},
|
||||
list(
|
||||
"target_ip" = target_ip,
|
||||
"rating_bad" = rating_bad,
|
||||
"valid_hours" = valid_hours
|
||||
)
|
||||
)
|
||||
if(!query_get_ip_intel.warn_execute())
|
||||
log_debug("ipintel_badip_check reports failed query execution")
|
||||
qdel(query_get_ip_intel)
|
||||
return FALSE
|
||||
if(!query_get_ip_intel.NextRow())
|
||||
qdel(query_get_ip_intel)
|
||||
return FALSE
|
||||
qdel(query_get_ip_intel)
|
||||
return TRUE
|
||||
|
||||
/proc/vpn_whitelist_check(target_ckey)
|
||||
if(!config.ipintel_whitelist)
|
||||
return FALSE
|
||||
var/datum/db_query/query_whitelist_check = SSdbcore.NewQuery("SELECT * FROM [format_table_name("vpn_whitelist")] WHERE ckey=:ckey", list(
|
||||
"ckey" = target_ckey
|
||||
))
|
||||
if(!query_whitelist_check.warn_execute())
|
||||
qdel(query_whitelist_check)
|
||||
return FALSE
|
||||
if(query_whitelist_check.NextRow())
|
||||
qdel(query_whitelist_check)
|
||||
return TRUE // At least one row in the whitelist names their ckey. That means they are whitelisted.
|
||||
qdel(query_whitelist_check)
|
||||
return FALSE
|
||||
|
||||
/proc/vpn_whitelist_add(target_ckey)
|
||||
var/reason_string = input(usr, "Enter link to the URL of their whitelist request on the forum.","Reason required") as message|null
|
||||
if(!reason_string)
|
||||
return FALSE
|
||||
var/datum/db_query/query_whitelist_add = SSdbcore.NewQuery("INSERT INTO [format_table_name("vpn_whitelist")] (ckey,reason) VALUES (:targetckey, :reason)", list(
|
||||
"targetckey" = target_ckey,
|
||||
"reason" = reason_string
|
||||
))
|
||||
if(!query_whitelist_add.warn_execute())
|
||||
qdel(query_whitelist_add)
|
||||
return FALSE
|
||||
qdel(query_whitelist_add)
|
||||
return TRUE
|
||||
|
||||
/proc/vpn_whitelist_remove(target_ckey)
|
||||
var/datum/db_query/query_whitelist_remove = SSdbcore.NewQuery("DELETE FROM [format_table_name("vpn_whitelist")] WHERE ckey=:targetckey", list(
|
||||
"targetckey" = target_ckey
|
||||
))
|
||||
if(!query_whitelist_remove.warn_execute())
|
||||
qdel(query_whitelist_remove)
|
||||
return FALSE
|
||||
qdel(query_whitelist_remove)
|
||||
return TRUE
|
||||
|
||||
/proc/vpn_whitelist_panel(target_ckey as text)
|
||||
if(!check_rights(R_ADMIN))
|
||||
return
|
||||
if(!target_ckey)
|
||||
return
|
||||
var/is_already_whitelisted = vpn_whitelist_check(target_ckey)
|
||||
if(is_already_whitelisted)
|
||||
var/confirm = alert("[target_ckey] is already whitelisted. Remove them?", "Confirm Removal", "No", "Yes")
|
||||
if(!confirm || confirm != "Yes")
|
||||
to_chat(usr, "VPN whitelist alteration cancelled.")
|
||||
return
|
||||
else if(vpn_whitelist_remove(target_ckey))
|
||||
to_chat(usr, "[target_ckey] was removed from the VPN whitelist.")
|
||||
else
|
||||
to_chat(usr, "VPN whitelist unchanged.")
|
||||
else
|
||||
if(vpn_whitelist_add(target_ckey))
|
||||
to_chat(usr, "[target_ckey] was added to the VPN whitelist.")
|
||||
else
|
||||
to_chat(usr, "VPN whitelist unchanged.")
|
||||
@@ -52,7 +52,8 @@
|
||||
usr << browse(output,"window=editrights;size=600x500")
|
||||
|
||||
/datum/admins/proc/log_admin_rank_modification(adm_ckey, new_rank)
|
||||
if(config.admin_legacy_system) return
|
||||
if(!GLOB.configuration.admin.use_database_admins)
|
||||
return
|
||||
|
||||
if(!usr.client)
|
||||
return
|
||||
@@ -75,7 +76,7 @@
|
||||
if(!istext(adm_ckey) || !istext(new_rank))
|
||||
return
|
||||
|
||||
var/datum/db_query/select_query = SSdbcore.NewQuery("SELECT id FROM [format_table_name("admin")] WHERE ckey=:adm_ckey", list(
|
||||
var/datum/db_query/select_query = SSdbcore.NewQuery("SELECT id FROM admin WHERE ckey=:adm_ckey", list(
|
||||
"adm_ckey" = adm_ckey
|
||||
))
|
||||
if(!select_query.warn_execute())
|
||||
@@ -90,7 +91,7 @@
|
||||
qdel(select_query)
|
||||
flag_account_for_forum_sync(adm_ckey)
|
||||
if(new_admin)
|
||||
var/datum/db_query/insert_query = SSdbcore.NewQuery("INSERT INTO [format_table_name("admin")] (`id`, `ckey`, `admin_rank`, `level`, `flags`) VALUES (null, :adm_ckey, :new_rank, -1, 0)", list(
|
||||
var/datum/db_query/insert_query = SSdbcore.NewQuery("INSERT INTO admin (`id`, `ckey`, `admin_rank`, `level`, `flags`) VALUES (null, :adm_ckey, :new_rank, -1, 0)", list(
|
||||
"adm_ckey" = adm_ckey,
|
||||
"new_rank" = new_rank
|
||||
))
|
||||
@@ -100,7 +101,7 @@
|
||||
qdel(insert_query)
|
||||
|
||||
var/logtxt = "Added new admin [adm_ckey] to rank [new_rank]"
|
||||
var/datum/db_query/log_query = SSdbcore.NewQuery("INSERT INTO [format_table_name("admin_log")] (`datetime` ,`adminckey` ,`adminip` ,`log` ) VALUES (Now() , :uckey, :uip, :logtxt)", list(
|
||||
var/datum/db_query/log_query = SSdbcore.NewQuery("INSERT INTO admin_log (`datetime` ,`adminckey` ,`adminip` ,`log` ) VALUES (Now() , :uckey, :uip, :logtxt)", list(
|
||||
"uckey" = usr.ckey,
|
||||
"uip" = usr.client.address,
|
||||
"logtxt" = logtxt
|
||||
@@ -113,7 +114,7 @@
|
||||
to_chat(usr, "<span class='notice'>New admin added.</span>")
|
||||
else
|
||||
if(!isnull(admin_id) && isnum(admin_id))
|
||||
var/datum/db_query/insert_query = SSdbcore.NewQuery("UPDATE [format_table_name("admin")] SET admin_rank=:new_rank WHERE id=:admin_id", list(
|
||||
var/datum/db_query/insert_query = SSdbcore.NewQuery("UPDATE admin SET admin_rank=:new_rank WHERE id=:admin_id", list(
|
||||
"new_rank" = new_rank,
|
||||
"admin_id" = admin_id,
|
||||
))
|
||||
@@ -123,7 +124,7 @@
|
||||
qdel(insert_query)
|
||||
|
||||
var/logtxt = "Edited the rank of [adm_ckey] to [new_rank]"
|
||||
var/datum/db_query/log_query = SSdbcore.NewQuery("INSERT INTO [format_table_name("admin_log")] (`datetime` ,`adminckey` ,`adminip` ,`log` ) VALUES (Now() , :uckey, :uip, :logtxt)", list(
|
||||
var/datum/db_query/log_query = SSdbcore.NewQuery("INSERT INTO admin_log (`datetime` ,`adminckey` ,`adminip` ,`log` ) VALUES (Now() , :uckey, :uip, :logtxt)", list(
|
||||
"uckey" = usr.ckey,
|
||||
"uip" = usr.client.address,
|
||||
"logtxt" = logtxt,
|
||||
@@ -140,7 +141,7 @@
|
||||
message_admins("[key_name(usr)] attempted to edit admin ranks via advanced proc-call")
|
||||
log_admin("[key_name(usr)] attempted to edit admin ranks via advanced proc-call")
|
||||
return
|
||||
if(config.admin_legacy_system)
|
||||
if(!GLOB.configuration.admin.use_database_admins)
|
||||
return
|
||||
|
||||
if(!usr.client)
|
||||
@@ -167,7 +168,7 @@
|
||||
if(!istext(adm_ckey) || !isnum(new_permission))
|
||||
return
|
||||
|
||||
var/datum/db_query/select_query = SSdbcore.NewQuery("SELECT id, flags FROM [format_table_name("admin")] WHERE ckey=:adm_ckey", list(
|
||||
var/datum/db_query/select_query = SSdbcore.NewQuery("SELECT id, flags FROM admin WHERE ckey=:adm_ckey", list(
|
||||
"adm_ckey" = adm_ckey
|
||||
))
|
||||
if(!select_query.warn_execute())
|
||||
@@ -186,7 +187,7 @@
|
||||
|
||||
flag_account_for_forum_sync(adm_ckey)
|
||||
if(admin_rights & new_permission) //This admin already has this permission, so we are removing it.
|
||||
var/datum/db_query/insert_query = SSdbcore.NewQuery("UPDATE [format_table_name("admin")] SET flags=:newflags WHERE id=:admin_id", list(
|
||||
var/datum/db_query/insert_query = SSdbcore.NewQuery("UPDATE admin SET flags=:newflags WHERE id=:admin_id", list(
|
||||
"newflags" = (admin_rights & ~new_permission),
|
||||
"admin_id" = admin_id
|
||||
))
|
||||
@@ -197,7 +198,7 @@
|
||||
|
||||
var/logtxt = "Removed permission [rights2text(new_permission)] (flag = [new_permission]) to admin [adm_ckey]"
|
||||
var/datum/db_query/log_query = SSdbcore.NewQuery({"
|
||||
INSERT INTO [format_table_name("admin_log")] (`datetime` ,`adminckey` ,`adminip` ,`log`)
|
||||
INSERT INTO admin_log (`datetime` ,`adminckey` ,`adminip` ,`log`)
|
||||
VALUES (Now() , :uckey, :uip, :logtxt)"}, list(
|
||||
"uckey" = usr.ckey,
|
||||
"uip" = usr.client.address,
|
||||
@@ -209,7 +210,7 @@
|
||||
qdel(log_query)
|
||||
to_chat(usr, "<span class='notice'>Permission removed.</span>")
|
||||
else //This admin doesn't have this permission, so we are adding it.
|
||||
var/datum/db_query/insert_query = SSdbcore.NewQuery("UPDATE [format_table_name("admin")] SET flags=:newflags WHERE id=:admin_id", list(
|
||||
var/datum/db_query/insert_query = SSdbcore.NewQuery("UPDATE admin SET flags=:newflags WHERE id=:admin_id", list(
|
||||
"newflags" = (admin_rights | new_permission),
|
||||
"admin_id" = admin_id
|
||||
))
|
||||
@@ -220,7 +221,7 @@
|
||||
|
||||
var/logtxt = "Added permission [rights2text(new_permission)] (flag = [new_permission]) to admin [adm_ckey]"
|
||||
var/datum/db_query/log_query = SSdbcore.NewQuery({"
|
||||
INSERT INTO [format_table_name("admin_log")] (`datetime` ,`adminckey` ,`adminip` ,`log`)
|
||||
INSERT INTO admin_log (`datetime` ,`adminckey` ,`adminip` ,`log`)
|
||||
VALUES (Now() , :uckey, :uip, :logtxt)"}, list(
|
||||
"uckey" = usr.ckey,
|
||||
"uip" = usr.client.address,
|
||||
@@ -239,7 +240,7 @@
|
||||
if(!check_rights(R_PERMISSIONS))
|
||||
return
|
||||
|
||||
var/datum/db_query/query_update = SSdbcore.NewQuery("UPDATE [format_table_name("player")] SET lastadminrank=:admin_rank WHERE ckey=:ckey", list(
|
||||
var/datum/db_query/query_update = SSdbcore.NewQuery("UPDATE player SET lastadminrank=:admin_rank WHERE ckey=:ckey", list(
|
||||
"admin_rank" = newrank,
|
||||
"ckey" = ckey
|
||||
))
|
||||
|
||||
@@ -418,7 +418,7 @@
|
||||
var/mob/M = blob.current
|
||||
if(M)
|
||||
dat += "<tr><td>[ADMIN_PP(M,"[M.real_name]")][M.client ? "" : " <i>(ghost)</i>"][M.stat == 2 ? " <b><font color=red>(DEAD)</font></b>" : ""]</td>"
|
||||
dat += "<td><A href='?priv_msg=[M.client?.ckey]'>PM</A></td>"
|
||||
dat += "<td><A href='?priv_msg=[M.client?.ckey]'>PM</A> [ADMIN_FLW(M, "FLW")]</td>"
|
||||
else
|
||||
dat += "<tr><td><i>Blob not found!</i></td></tr>"
|
||||
dat += "</table>"
|
||||
|
||||
@@ -81,6 +81,9 @@
|
||||
<b>Create Weather</b><BR>
|
||||
<A href='?src=[UID()];secretsfun=weatherashstorm'>Weather - Ash Storm</A>
|
||||
<BR>
|
||||
<b>Reinforce Station</b><BR>
|
||||
<A href='?src=[UID()];secretsfun=gammashuttle'>Move the Gamma Armory</A>
|
||||
<BR>
|
||||
</center>"}
|
||||
|
||||
if(2)
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
else
|
||||
target_ckey = ckey(target_ckey)
|
||||
|
||||
var/datum/db_query/query_find_ckey = SSdbcore.NewQuery("SELECT ckey, exp FROM [format_table_name("player")] WHERE ckey=:ckey", list(
|
||||
var/datum/db_query/query_find_ckey = SSdbcore.NewQuery("SELECT ckey, exp FROM player WHERE ckey=:ckey", list(
|
||||
"ckey" = target_ckey
|
||||
))
|
||||
|
||||
@@ -54,14 +54,14 @@
|
||||
adminckey = ckey(adminckey)
|
||||
|
||||
if(!server)
|
||||
if(config && config.server_name)
|
||||
server = config.server_name
|
||||
if(GLOB.configuration.general.server_name)
|
||||
server = GLOB.configuration.general.server_name
|
||||
|
||||
// Force cast this to 1/0 incase someone tries to feed bad data
|
||||
automated = !!automated
|
||||
|
||||
var/datum/db_query/query_noteadd = SSdbcore.NewQuery({"
|
||||
INSERT INTO [format_table_name("notes")] (ckey, timestamp, notetext, adminckey, server, crew_playtime, round_id, automated)
|
||||
INSERT INTO notes (ckey, timestamp, notetext, adminckey, server, crew_playtime, round_id, automated)
|
||||
VALUES (:targetckey, NOW(), :notetext, :adminkey, :server, :crewnum, :roundid, :automated)
|
||||
"}, list(
|
||||
"targetckey" = target_ckey,
|
||||
@@ -95,7 +95,7 @@
|
||||
if(!note_id)
|
||||
return
|
||||
note_id = text2num(note_id)
|
||||
var/datum/db_query/query_find_note_del = SSdbcore.NewQuery("SELECT ckey, notetext, adminckey FROM [format_table_name("notes")] WHERE id=:note_id", list(
|
||||
var/datum/db_query/query_find_note_del = SSdbcore.NewQuery("SELECT ckey, notetext, adminckey FROM notes WHERE id=:note_id", list(
|
||||
"note_id" = note_id
|
||||
))
|
||||
if(!query_find_note_del.warn_execute())
|
||||
@@ -107,7 +107,7 @@
|
||||
adminckey = query_find_note_del.item[3]
|
||||
qdel(query_find_note_del)
|
||||
|
||||
var/datum/db_query/query_del_note = SSdbcore.NewQuery("DELETE FROM [format_table_name("notes")] WHERE id=:note_id", list(
|
||||
var/datum/db_query/query_del_note = SSdbcore.NewQuery("DELETE FROM notes WHERE id=:note_id", list(
|
||||
"note_id" = note_id
|
||||
))
|
||||
if(!query_del_note.warn_execute())
|
||||
@@ -130,7 +130,7 @@
|
||||
return
|
||||
note_id = text2num(note_id)
|
||||
var/target_ckey
|
||||
var/datum/db_query/query_find_note_edit = SSdbcore.NewQuery("SELECT ckey, notetext, adminckey, automated FROM [format_table_name("notes")] WHERE id=:note_id", list(
|
||||
var/datum/db_query/query_find_note_edit = SSdbcore.NewQuery("SELECT ckey, notetext, adminckey, automated FROM notes WHERE id=:note_id", list(
|
||||
"note_id" = note_id
|
||||
))
|
||||
if(!query_find_note_edit.warn_execute())
|
||||
@@ -148,7 +148,7 @@
|
||||
if(!new_note)
|
||||
return
|
||||
var/edit_text = "Edited by [usr.ckey] on [SQLtime()] from \"[old_note]\" to \"[new_note]\"<hr>"
|
||||
var/datum/db_query/query_update_note = SSdbcore.NewQuery("UPDATE [format_table_name("notes")] SET notetext=:new_note, last_editor=:akey, edits = CONCAT(IFNULL(edits,''),:edit_text) WHERE id=:note_id", list(
|
||||
var/datum/db_query/query_update_note = SSdbcore.NewQuery("UPDATE notes SET notetext=:new_note, last_editor=:akey, edits = CONCAT(IFNULL(edits,''),:edit_text) WHERE id=:note_id", list(
|
||||
"new_note" = new_note,
|
||||
"akey" = usr.ckey,
|
||||
"edit_text" = edit_text,
|
||||
@@ -182,7 +182,7 @@
|
||||
var/target_sql_ckey = ckey(target_ckey)
|
||||
var/datum/db_query/query_get_notes = SSdbcore.NewQuery({"
|
||||
SELECT id, timestamp, notetext, adminckey, last_editor, server, crew_playtime, round_id, automated
|
||||
FROM [format_table_name("notes")] WHERE ckey=:targetkey ORDER BY timestamp"}, list(
|
||||
FROM notes WHERE ckey=:targetkey ORDER BY timestamp"}, list(
|
||||
"targetkey" = target_sql_ckey
|
||||
))
|
||||
if(!query_get_notes.warn_execute())
|
||||
@@ -226,7 +226,7 @@
|
||||
search = "^\[^\[:alpha:\]\]"
|
||||
else
|
||||
search = "^[index]"
|
||||
var/datum/db_query/query_list_notes = SSdbcore.NewQuery("SELECT DISTINCT ckey FROM [format_table_name("notes")] WHERE ckey REGEXP :search ORDER BY ckey", list(
|
||||
var/datum/db_query/query_list_notes = SSdbcore.NewQuery("SELECT DISTINCT ckey FROM notes WHERE ckey REGEXP :search ORDER BY ckey", list(
|
||||
"search" = search
|
||||
))
|
||||
if(!query_list_notes.warn_execute())
|
||||
|
||||
+42
-42
@@ -287,19 +287,19 @@
|
||||
if(null,"") return
|
||||
if("*New Rank*")
|
||||
new_rank = input("Please input a new rank", "New custom rank", null, null) as null|text
|
||||
if(config.admin_legacy_system)
|
||||
if(!GLOB.configuration.admin.use_database_admins)
|
||||
new_rank = ckeyEx(new_rank)
|
||||
if(!new_rank)
|
||||
to_chat(usr, "<font color='red'>Error: Topic 'editrights': Invalid rank</font>")
|
||||
return
|
||||
if(config.admin_legacy_system)
|
||||
if(!GLOB.configuration.admin.use_database_admins)
|
||||
if(GLOB.admin_ranks.len)
|
||||
if(new_rank in GLOB.admin_ranks)
|
||||
rights = GLOB.admin_ranks[new_rank] //we typed a rank which already exists, use its rights
|
||||
else
|
||||
GLOB.admin_ranks[new_rank] = 0 //add the new rank to admin_ranks
|
||||
else
|
||||
if(config.admin_legacy_system)
|
||||
if(!GLOB.configuration.admin.use_database_admins)
|
||||
new_rank = ckeyEx(new_rank)
|
||||
rights = GLOB.admin_ranks[new_rank] //we input an existing rank, use its rights
|
||||
|
||||
@@ -538,8 +538,8 @@
|
||||
to_chat(M, "<span class='warning'><big><b>You have been appearance banned by [usr.client.ckey].</b></big></span>")
|
||||
to_chat(M, "<span class='danger'>The reason is: [reason]</span>")
|
||||
to_chat(M, "<span class='warning'>Appearance ban can be lifted only upon request.</span>")
|
||||
if(config.banappeals)
|
||||
to_chat(M, "<span class='warning'>To try to resolve this matter head to [config.banappeals]</span>")
|
||||
if(GLOB.configuration.url.banappeals_url)
|
||||
to_chat(M, "<span class='warning'>To try to resolve this matter head to [GLOB.configuration.url.banappeals_url]</span>")
|
||||
else
|
||||
to_chat(M, "<span class='warning'>No ban appeals URL has been set.</span>")
|
||||
if("No")
|
||||
@@ -877,7 +877,7 @@
|
||||
if(notbannedlist.len) //at least 1 unbanned job exists in joblist so we have stuff to ban.
|
||||
switch(alert("Temporary Ban of [M.ckey]?",,"Yes","No", "Cancel"))
|
||||
if("Yes")
|
||||
if(config.ban_legacy_system)
|
||||
if(!GLOB.configuration.general.use_database_bans)
|
||||
to_chat(usr, "<span class='warning'>Your server is using the legacy banning system, which does not support temporary job bans. Consider upgrading. Aborting ban.</span>")
|
||||
return
|
||||
var/mins = input(usr,"How long (in minutes)?","Ban time",1440) as num|null
|
||||
@@ -928,7 +928,7 @@
|
||||
//Unbanning joblist
|
||||
//all jobs in joblist are banned already OR we didn't give a reason (implying they shouldn't be banned)
|
||||
if(joblist.len) //at least 1 banned job exists in joblist so we have stuff to unban.
|
||||
if(!config.ban_legacy_system)
|
||||
if(GLOB.configuration.general.use_database_bans)
|
||||
to_chat(usr, "<span class='warning'>Unfortunately, database based unbanning cannot be done through this panel</span>")
|
||||
DB_ban_panel(M.ckey)
|
||||
return
|
||||
@@ -1002,8 +1002,8 @@
|
||||
|
||||
else if(href_list["webtools"])
|
||||
var/target_ckey = href_list["webtools"]
|
||||
if(config.forum_playerinfo_url)
|
||||
var/url_to_open = config.forum_playerinfo_url + target_ckey
|
||||
if(GLOB.configuration.url.forum_playerinfo_url)
|
||||
var/url_to_open = "[GLOB.configuration.url.forum_playerinfo_url][target_ckey]"
|
||||
if(alert("Open [url_to_open]",,"Yes","No")=="Yes")
|
||||
usr.client << link(url_to_open)
|
||||
|
||||
@@ -1017,7 +1017,7 @@
|
||||
|
||||
else if(href_list["noteedits"])
|
||||
var/note_id = text2num(href_list["noteedits"])
|
||||
var/datum/db_query/query_noteedits = SSdbcore.NewQuery("SELECT edits FROM [format_table_name("notes")] WHERE id=:note_id", list(
|
||||
var/datum/db_query/query_noteedits = SSdbcore.NewQuery("SELECT edits FROM notes WHERE id=:note_id", list(
|
||||
"note_id" = note_id
|
||||
))
|
||||
if(!query_noteedits.warn_execute())
|
||||
@@ -1067,8 +1067,8 @@
|
||||
DB_ban_record(BANTYPE_TEMP, M, mins, reason)
|
||||
if(M.client)
|
||||
M.client.link_forum_account(TRUE)
|
||||
if(config.banappeals)
|
||||
to_chat(M, "<span class='warning'>To try to resolve this matter head to [config.banappeals]</span>")
|
||||
if(GLOB.configuration.url.banappeals_url)
|
||||
to_chat(M, "<span class='warning'>To try to resolve this matter head to [GLOB.configuration.url.banappeals_url]</span>")
|
||||
else
|
||||
to_chat(M, "<span class='warning'>No ban appeals URL has been set.</span>")
|
||||
log_admin("[key_name(usr)] has banned [M.ckey].\nReason: [reason]\nThis will be removed in [mins] minutes.")
|
||||
@@ -1084,8 +1084,8 @@
|
||||
to_chat(M, "<span class='warning'>This ban does not expire automatically and must be appealed.</span>")
|
||||
if(M.client)
|
||||
M.client.link_forum_account(TRUE)
|
||||
if(config.banappeals)
|
||||
to_chat(M, "<span class='warning'>To try to resolve this matter head to [config.banappeals]</span>")
|
||||
if(GLOB.configuration.url.banappeals_url)
|
||||
to_chat(M, "<span class='warning'>To try to resolve this matter head to [GLOB.configuration.url.banappeals_url]</span>")
|
||||
else
|
||||
to_chat(M, "<span class='warning'>No ban appeals URL has been set.</span>")
|
||||
log_admin("[key_name(usr)] has banned [M.ckey].\nReason: [reason]\nThis ban does not expire automatically and must be appealed.")
|
||||
@@ -1132,7 +1132,7 @@
|
||||
|
||||
else if(href_list["watcheditlog"])
|
||||
var/target_ckey = href_list["watcheditlog"]
|
||||
var/datum/db_query/query_watchedits = SSdbcore.NewQuery("SELECT edits FROM [format_table_name("watch")] WHERE ckey=:targetkey", list(
|
||||
var/datum/db_query/query_watchedits = SSdbcore.NewQuery("SELECT edits FROM watch WHERE ckey=:targetkey", list(
|
||||
"targetkey" = target_ckey
|
||||
))
|
||||
if(!query_watchedits.warn_execute())
|
||||
@@ -1163,8 +1163,8 @@
|
||||
if(SSticker && SSticker.mode)
|
||||
return alert(usr, "The game has already started.", null, null, null, null)
|
||||
var/dat = {"<b>What mode do you wish to play?</b><hr>"}
|
||||
for(var/mode in config.modes)
|
||||
dat += {"<A href='?src=[UID()];c_mode2=[mode]'>[config.mode_names[mode]]</A><br>"}
|
||||
for(var/mode in GLOB.configuration.gamemode.gamemodes)
|
||||
dat += {"<A href='?src=[UID()];c_mode2=[mode]'>[GLOB.configuration.gamemode.gamemode_names[mode]]</A><br>"}
|
||||
dat += {"<A href='?src=[UID()];c_mode2=secret'>Secret</A><br>"}
|
||||
dat += {"<A href='?src=[UID()];c_mode2=random'>Random</A><br>"}
|
||||
dat += {"Now: [GLOB.master_mode]"}
|
||||
@@ -1178,8 +1178,8 @@
|
||||
if(GLOB.master_mode != "secret")
|
||||
return alert(usr, "The game mode has to be secret!", null, null, null, null)
|
||||
var/dat = {"<b>What game mode do you want to force secret to be? Use this if you want to change the game mode, but want the players to believe it's secret. This will only work if the current game mode is secret.</b><hr>"}
|
||||
for(var/mode in config.modes)
|
||||
dat += {"<A href='?src=[UID()];f_secret2=[mode]'>[config.mode_names[mode]]</A><br>"}
|
||||
for(var/mode in GLOB.configuration.gamemode.gamemodes)
|
||||
dat += {"<A href='?src=[UID()];f_secret2=[mode]'>[GLOB.configuration.gamemode.gamemode_names[mode]]</A><br>"}
|
||||
dat += {"<A href='?src=[UID()];f_secret2=secret'>Random (default)</A><br>"}
|
||||
dat += {"Now: [GLOB.secret_force_mode]"}
|
||||
usr << browse(dat, "window=f_secret")
|
||||
@@ -2165,7 +2165,7 @@
|
||||
if(!istype(M))
|
||||
to_chat(usr, "<span class='warning'>This can only be used on instances of type /mob/living</span>")
|
||||
return
|
||||
var/ptypes = list("Lightning bolt", "Fire Death", "Gib")
|
||||
var/ptypes = list("Lightning bolt", "Fire Death", "Gib", "Dust")
|
||||
if(ishuman(M))
|
||||
H = M
|
||||
ptypes += "Brain Damage"
|
||||
@@ -2180,7 +2180,6 @@
|
||||
ptypes += "Crew Traitor"
|
||||
ptypes += "Floor Cluwne"
|
||||
ptypes += "Shamebrero"
|
||||
ptypes += "Dust"
|
||||
var/punishment = input(owner, "How would you like to smite [M]?", "Its good to be baaaad...", "") as null|anything in ptypes
|
||||
if(!(punishment in ptypes))
|
||||
return
|
||||
@@ -2203,6 +2202,9 @@
|
||||
if("Gib")
|
||||
M.gib(FALSE)
|
||||
logmsg = "gibbed."
|
||||
if("Dust")
|
||||
M.dust()
|
||||
logmsg = "dust"
|
||||
|
||||
// These smiting types are only valid for ishuman() mobs
|
||||
if("Brain Damage")
|
||||
@@ -2292,9 +2294,6 @@
|
||||
var/obj/item/clothing/head/sombrero/shamebrero/S = new(H.loc)
|
||||
H.equip_to_slot_or_del(S, slot_head)
|
||||
logmsg = "shamebrero"
|
||||
if("Dust")
|
||||
H.dust()
|
||||
logmsg = "dust"
|
||||
if(logmsg)
|
||||
log_admin("[key_name(owner)] smited [key_name(M)] with: [logmsg]")
|
||||
message_admins("[key_name_admin(owner)] smited [key_name_admin(M)] with: [logmsg]")
|
||||
@@ -2510,7 +2509,7 @@
|
||||
if("Central Command")
|
||||
stamptype = "icon"
|
||||
stampvalue = "cent"
|
||||
sendername = command_name()
|
||||
sendername = "NAS Trurl"
|
||||
if("Syndicate")
|
||||
stamptype = "icon"
|
||||
stampvalue = "syndicate"
|
||||
@@ -2840,7 +2839,7 @@
|
||||
else if(href_list["memoeditlist"])
|
||||
if(!check_rights(R_SERVER)) return
|
||||
var/sql_key = href_list["memoeditlist"]
|
||||
var/datum/db_query/query_memoedits = SSdbcore.NewQuery("SELECT edits FROM [format_table_name("memo")] WHERE (ckey=:sql_key)", list(
|
||||
var/datum/db_query/query_memoedits = SSdbcore.NewQuery("SELECT edits FROM memo WHERE (ckey=:sql_key)", list(
|
||||
"sql_key" = sql_key
|
||||
))
|
||||
if(!query_memoedits.warn_execute())
|
||||
@@ -3008,21 +3007,16 @@
|
||||
if("togglebombcap")
|
||||
SSblackbox.record_feedback("tally", "admin_secrets_fun_used", 1, "Bomb Cap")
|
||||
|
||||
var/newBombCap = input(usr,"What would you like the new bomb cap to be. (entered as the light damage range (the 3rd number in common (1,2,3) notation)) Must be between 4 and 128)", "New Bomb Cap", GLOB.max_ex_light_range) as num|null
|
||||
var/newBombCap = input(usr,"What would you like the new bomb cap to be. (entered as the light damage range (the 3rd number in common (1,2,3) notation)) Must be between 4 and 128)", "New Bomb Cap", GLOB.configuration.general.bomb_cap) as num|null
|
||||
if(newBombCap < 4)
|
||||
return
|
||||
if(newBombCap > 128)
|
||||
newBombCap = 128
|
||||
|
||||
GLOB.max_ex_devastation_range = round(newBombCap/4)
|
||||
GLOB.max_ex_heavy_range = round(newBombCap/2)
|
||||
GLOB.max_ex_light_range = newBombCap
|
||||
//I don't know why these are their own variables, but fuck it, they are.
|
||||
GLOB.max_ex_flash_range = newBombCap
|
||||
GLOB.max_ex_flame_range = newBombCap
|
||||
GLOB.configuration.general.bomb_cap = newBombCap
|
||||
|
||||
message_admins("<span class='boldannounce'>[key_name_admin(usr)] changed the bomb cap to [GLOB.max_ex_devastation_range], [GLOB.max_ex_heavy_range], [GLOB.max_ex_light_range]</span>")
|
||||
log_admin("[key_name(usr)] changed the bomb cap to [GLOB.max_ex_devastation_range], [GLOB.max_ex_heavy_range], [GLOB.max_ex_light_range]")
|
||||
message_admins("<span class='boldannounce'>[key_name_admin(usr)] changed the bomb cap to [GLOB.configuration.general.bomb_cap / 4], [GLOB.configuration.general.bomb_cap / 2], [GLOB.configuration.general.bomb_cap]</span>")
|
||||
log_admin("[key_name(usr)] changed the bomb cap to [GLOB.configuration.general.bomb_cap / 4], [GLOB.configuration.general.bomb_cap / 2], [GLOB.configuration.general.bomb_cap]")
|
||||
|
||||
if("flicklights")
|
||||
SSblackbox.record_feedback("tally", "admin_secrets_fun_used", 1, "Flicker Lights")
|
||||
@@ -3220,6 +3214,12 @@
|
||||
message_admins("[key_name_admin(usr)] moved the centcom ferry")
|
||||
log_admin("[key_name(usr)] moved the centcom ferry")
|
||||
|
||||
if("gammashuttle")
|
||||
SSblackbox.record_feedback("tally", "admin_secrets_fun_used", 1, "Send Gamma Armory")
|
||||
message_admins("[key_name_admin(usr)] moved the gamma armory")
|
||||
log_admin("[key_name(usr)] moved the gamma armory")
|
||||
move_gamma_ship()
|
||||
|
||||
if(usr)
|
||||
log_admin("[key_name(usr)] used secret [href_list["secretsfun"]]")
|
||||
if(ok)
|
||||
@@ -3299,7 +3299,7 @@
|
||||
var/val = alert(usr, "What do you want to set night shift to? This will override the automatic system until set to automatic again.", "Night Shift", "On", "Off", "Automatic")
|
||||
switch(val)
|
||||
if("Automatic")
|
||||
if(config.enable_night_shifts)
|
||||
if(GLOB.configuration.general.enable_night_shifts)
|
||||
SSnightshift.can_fire = TRUE
|
||||
SSnightshift.fire()
|
||||
else
|
||||
@@ -3378,7 +3378,7 @@
|
||||
if(!newname)
|
||||
return
|
||||
G.name = newname
|
||||
var/description = input("Enter [command_name()] message contents:") as message|null
|
||||
var/description = input("Enter NAS Trurl message contents:") as message|null
|
||||
if(!description)
|
||||
return
|
||||
G.report_message = description
|
||||
@@ -3398,7 +3398,7 @@
|
||||
var/isbn = text2num(href_list["library_book_id"])
|
||||
|
||||
if(href_list["view_library_book"])
|
||||
var/datum/db_query/query_view_book = SSdbcore.NewQuery("SELECT content, title FROM [format_table_name("library")] WHERE id=:isbn", list(
|
||||
var/datum/db_query/query_view_book = SSdbcore.NewQuery("SELECT content, title FROM library WHERE id=:isbn", list(
|
||||
"isbn" = isbn
|
||||
))
|
||||
if(!query_view_book.warn_execute())
|
||||
@@ -3425,7 +3425,7 @@
|
||||
return
|
||||
|
||||
else if(href_list["unflag_library_book"])
|
||||
var/datum/db_query/query_unflag_book = SSdbcore.NewQuery("UPDATE [format_table_name("library")] SET flagged = 0 WHERE id=:isbn", list(
|
||||
var/datum/db_query/query_unflag_book = SSdbcore.NewQuery("UPDATE library SET flagged = 0 WHERE id=:isbn", list(
|
||||
"isbn" = isbn
|
||||
))
|
||||
if(!query_unflag_book.warn_execute())
|
||||
@@ -3437,7 +3437,7 @@
|
||||
message_admins("[key_name_admin(usr)] has unflagged the book [isbn].")
|
||||
|
||||
else if(href_list["delete_library_book"])
|
||||
var/datum/db_query/query_delbook = SSdbcore.NewQuery("DELETE FROM [format_table_name("library")] WHERE id=:isbn", list(
|
||||
var/datum/db_query/query_delbook = SSdbcore.NewQuery("DELETE FROM library WHERE id=:isbn", list(
|
||||
"isbn" = isbn
|
||||
))
|
||||
if(!query_delbook.warn_execute())
|
||||
@@ -3505,7 +3505,7 @@
|
||||
var/unlocked_jobs = ""
|
||||
var/unlocked_species = ""
|
||||
// Get their totals
|
||||
var/datum/db_query/query_get_totals = SSdbcore.NewQuery("SELECT karma, karmaspent FROM [format_table_name("karmatotals")] WHERE byondkey=:ckey", list(
|
||||
var/datum/db_query/query_get_totals = SSdbcore.NewQuery("SELECT karma, karmaspent FROM karmatotals WHERE byondkey=:ckey", list(
|
||||
"ckey" = target_ckey
|
||||
))
|
||||
if(!query_get_totals.warn_execute())
|
||||
@@ -3519,7 +3519,7 @@
|
||||
qdel(query_get_totals)
|
||||
|
||||
// Now get their unlocks
|
||||
var/datum/db_query/query_get_unlocks = SSdbcore.NewQuery("SELECT job, species FROM [format_table_name("whitelist")] WHERE ckey=:ckey", list(
|
||||
var/datum/db_query/query_get_unlocks = SSdbcore.NewQuery("SELECT job, species FROM whitelist WHERE ckey=:ckey", list(
|
||||
"ckey" = target_ckey
|
||||
))
|
||||
if(!query_get_unlocks.warn_execute())
|
||||
|
||||
@@ -142,7 +142,7 @@
|
||||
C.adminhelped = 0
|
||||
|
||||
//AdminPM popup for ApocStation and anybody else who wants to use it. Set it with POPUP_ADMIN_PM in config.txt ~Carn
|
||||
if(config.popup_admin_pm)
|
||||
if(GLOB.configuration.general.popup_admin_pm)
|
||||
spawn(0) //so we don't hold the caller proc up
|
||||
var/sender = src
|
||||
var/sendername = key
|
||||
|
||||
@@ -34,7 +34,7 @@ GLOBAL_VAR_INIT(sent_syndicate_infiltration_team, 0)
|
||||
return
|
||||
var/tctext = input(src, "How much TC do you want to give each team member? Suggested: 20-30. They cannot trade TC.") as num
|
||||
var/tcamount = text2num(tctext)
|
||||
tcamount = between(0, tcamount, 1000)
|
||||
tcamount = clamp(tcamount, 0, 1000)
|
||||
if(GLOB.sent_syndicate_infiltration_team == 1)
|
||||
if(alert("A Syndicate Infiltration Team has already been sent. Sure you want to send another?",,"Yes","No")=="No")
|
||||
return
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
/datum/admins/proc/makeTraitors()
|
||||
var/datum/game_mode/traitor/temp = new
|
||||
|
||||
if(config.protect_roles_from_antagonist)
|
||||
if(GLOB.configuration.gamemode.prevent_mindshield_antags)
|
||||
temp.restricted_jobs += temp.protected_jobs
|
||||
|
||||
var/list/mob/living/carbon/human/candidates = list()
|
||||
@@ -76,7 +76,7 @@
|
||||
/datum/admins/proc/makeChangelings()
|
||||
|
||||
var/datum/game_mode/changeling/temp = new
|
||||
if(config.protect_roles_from_antagonist)
|
||||
if(GLOB.configuration.gamemode.prevent_mindshield_antags)
|
||||
temp.restricted_jobs += temp.protected_jobs
|
||||
|
||||
var/list/mob/living/carbon/human/candidates = list()
|
||||
@@ -106,7 +106,7 @@
|
||||
/datum/admins/proc/makeRevs()
|
||||
|
||||
var/datum/game_mode/revolution/temp = new
|
||||
if(config.protect_roles_from_antagonist)
|
||||
if(GLOB.configuration.gamemode.prevent_mindshield_antags)
|
||||
temp.restricted_jobs += temp.protected_jobs
|
||||
|
||||
var/list/mob/living/carbon/human/candidates = list()
|
||||
@@ -156,7 +156,7 @@
|
||||
/datum/admins/proc/makeCult()
|
||||
|
||||
var/datum/game_mode/cult/temp = new
|
||||
if(config.protect_roles_from_antagonist)
|
||||
if(GLOB.configuration.gamemode.prevent_mindshield_antags)
|
||||
temp.restricted_jobs += temp.protected_jobs
|
||||
|
||||
var/list/mob/living/carbon/human/candidates = list()
|
||||
@@ -517,7 +517,7 @@
|
||||
/datum/admins/proc/makeVampires()
|
||||
|
||||
var/datum/game_mode/vampire/temp = new
|
||||
if(config.protect_roles_from_antagonist)
|
||||
if(GLOB.configuration.gamemode.prevent_mindshield_antags)
|
||||
temp.restricted_jobs += temp.protected_jobs
|
||||
|
||||
var/list/mob/living/carbon/human/candidates = list()
|
||||
@@ -527,8 +527,8 @@
|
||||
if(!antnum || antnum <= 0)
|
||||
return
|
||||
|
||||
log_admin("[key_name(owner)] tried making Vampires with One-Click-Antag")
|
||||
message_admins("[key_name_admin(owner)] tried making Vampires with One-Click-Antag")
|
||||
log_admin("[key_name(owner)] tried making [antnum] Vampires with One-Click-Antag")
|
||||
message_admins("[key_name_admin(owner)] tried making [antnum] Vampires with One-Click-Antag")
|
||||
|
||||
for(var/mob/living/carbon/human/applicant in GLOB.player_list)
|
||||
if(CandCheck(ROLE_VAMPIRE, applicant, temp))
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
return
|
||||
|
||||
if(istype(O,/obj/singularity))
|
||||
if(config.forbid_singulo_possession)
|
||||
if(GLOB.configuration.general.forbid_singulo_possession) // I love how this needs to exist
|
||||
to_chat(usr, "It is forbidden to possess singularities.")
|
||||
return
|
||||
|
||||
|
||||
@@ -203,7 +203,7 @@
|
||||
|
||||
/proc/cmd_admin_mute(mob/M as mob, mute_type, automute = 0)
|
||||
if(automute)
|
||||
if(!config.automute_on)
|
||||
if(!GLOB.configuration.general.enable_auto_mute)
|
||||
return
|
||||
else
|
||||
if(!usr || !usr.client)
|
||||
@@ -276,21 +276,21 @@
|
||||
return
|
||||
|
||||
var/action=""
|
||||
if(config.antag_hud_allowed)
|
||||
if(GLOB.configuration.general.allow_antag_hud)
|
||||
for(var/mob/dead/observer/g in get_ghosts())
|
||||
if(g.antagHUD)
|
||||
g.antagHUD = FALSE // Disable it on those that have it enabled
|
||||
g.has_enabled_antagHUD = FALSE // We'll allow them to respawn
|
||||
to_chat(g, "<span class='danger'>The Administrator has disabled AntagHUD </span>")
|
||||
config.antag_hud_allowed = 0
|
||||
to_chat(g, "<span class='danger'>The Administrators have disabled AntagHUD </span>")
|
||||
GLOB.configuration.general.allow_antag_hud = FALSE
|
||||
to_chat(src, "<span class='danger'>AntagHUD usage has been disabled</span>")
|
||||
action = "disabled"
|
||||
else
|
||||
for(var/mob/dead/observer/g in get_ghosts())
|
||||
if(!g.client.holder) // Add the verb back for all non-admin ghosts
|
||||
to_chat(g, "<span class='boldnotice'>The Administrator has enabled AntagHUD </span>")// Notify all observers they can now use AntagHUD
|
||||
to_chat(g, "<span class='boldnotice'>The Administrators have enabled AntagHUD </span>")// Notify all observers they can now use AntagHUD
|
||||
|
||||
config.antag_hud_allowed = 1
|
||||
GLOB.configuration.general.allow_antag_hud = TRUE
|
||||
action = "enabled"
|
||||
to_chat(src, "<span class='boldnotice'>AntagHUD usage has been enabled</span>")
|
||||
|
||||
@@ -307,11 +307,11 @@
|
||||
return
|
||||
|
||||
var/action=""
|
||||
if(config.antag_hud_restricted)
|
||||
if(GLOB.configuration.general.restrict_antag_hud_rejoin)
|
||||
for(var/mob/dead/observer/g in get_ghosts())
|
||||
to_chat(g, "<span class='boldnotice'>The administrator has lifted restrictions on joining the round if you use AntagHUD</span>")
|
||||
action = "lifted restrictions"
|
||||
config.antag_hud_restricted = 0
|
||||
GLOB.configuration.general.restrict_antag_hud_rejoin = FALSE
|
||||
to_chat(src, "<span class='boldnotice'>AntagHUD restrictions have been lifted</span>")
|
||||
else
|
||||
for(var/mob/dead/observer/g in get_ghosts())
|
||||
@@ -320,7 +320,7 @@
|
||||
g.antagHUD = FALSE
|
||||
g.has_enabled_antagHUD = FALSE
|
||||
action = "placed restrictions"
|
||||
config.antag_hud_restricted = 1
|
||||
GLOB.configuration.general.restrict_antag_hud_rejoin = TRUE
|
||||
to_chat(src, "<span class='danger'>AntagHUD restrictions have been enabled</span>")
|
||||
|
||||
log_admin("[key_name(usr)] has [action] on joining the round if they use AntagHUD")
|
||||
@@ -941,14 +941,14 @@ Traitors and the like can also be revived with the previous role mostly intact.
|
||||
if(!check_rights(R_SERVER|R_EVENT))
|
||||
return
|
||||
|
||||
if(!config.allow_random_events)
|
||||
config.allow_random_events = 1
|
||||
if(!GLOB.configuration.event.enable_random_events)
|
||||
GLOB.configuration.event.enable_random_events = TRUE
|
||||
to_chat(usr, "Random events enabled")
|
||||
message_admins("Admin [key_name_admin(usr)] has enabled random events.", 1)
|
||||
message_admins("Admin [key_name_admin(usr)] has enabled random events.")
|
||||
else
|
||||
config.allow_random_events = 0
|
||||
GLOB.configuration.event.enable_random_events = FALSE
|
||||
to_chat(usr, "Random events disabled")
|
||||
message_admins("Admin [key_name_admin(usr)] has disabled random events.", 1)
|
||||
message_admins("Admin [key_name_admin(usr)] has disabled random events.")
|
||||
SSblackbox.record_feedback("tally", "admin_verb", 1, "Toggle Random Events") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
/client/proc/reset_all_tcs()
|
||||
@@ -1031,7 +1031,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
|
||||
if(H.client == null || H.stat == DEAD) // No clientless or dead
|
||||
continue
|
||||
mins_afk = round(H.client.inactivity / 600)
|
||||
if(mins_afk < config.list_afk_minimum)
|
||||
if(mins_afk < 5)
|
||||
continue
|
||||
if(H.job)
|
||||
job_string = H.job
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
var/new_ckey = ckey(clean_input("Who would you like to add to the watchlist?","Enter a ckey",null))
|
||||
if(!new_ckey)
|
||||
return
|
||||
var/datum/db_query/query_watchfind = SSdbcore.NewQuery("SELECT ckey FROM [format_table_name("player")] WHERE ckey=:new_ckey", list(
|
||||
var/datum/db_query/query_watchfind = SSdbcore.NewQuery("SELECT ckey FROM player WHERE ckey=:new_ckey", list(
|
||||
"new_ckey" = new_ckey
|
||||
))
|
||||
if(!query_watchfind.warn_execute())
|
||||
@@ -27,7 +27,7 @@
|
||||
if(!adminckey)
|
||||
return
|
||||
var/datum/db_query/query_watchadd = SSdbcore.NewQuery({"
|
||||
INSERT INTO [format_table_name("watch")] (ckey, reason, adminckey, timestamp)
|
||||
INSERT INTO watch (ckey, reason, adminckey, timestamp)
|
||||
VALUES (:targetkey, :reason, :adminkey, NOW())"},
|
||||
list(
|
||||
"targetkey" = target_ckey,
|
||||
@@ -50,7 +50,7 @@
|
||||
/client/proc/watchlist_remove(target_ckey, browse = 0)
|
||||
if(!check_rights(R_ADMIN))
|
||||
return
|
||||
var/datum/db_query/query_watchdel = SSdbcore.NewQuery("DELETE FROM [format_table_name("watch")] WHERE ckey=:target_ckey", list(
|
||||
var/datum/db_query/query_watchdel = SSdbcore.NewQuery("DELETE FROM watch WHERE ckey=:target_ckey", list(
|
||||
"target_ckey" = target_ckey
|
||||
))
|
||||
if(!query_watchdel.warn_execute())
|
||||
@@ -68,7 +68,7 @@
|
||||
/client/proc/watchlist_edit(target_ckey, browse = 0)
|
||||
if(!check_rights(R_ADMIN))
|
||||
return
|
||||
var/datum/db_query/query_watchreason = SSdbcore.NewQuery("SELECT reason FROM [format_table_name("watch")] WHERE ckey=:target_ckey", list(
|
||||
var/datum/db_query/query_watchreason = SSdbcore.NewQuery("SELECT reason FROM watch WHERE ckey=:target_ckey", list(
|
||||
"target_ckey" = target_ckey
|
||||
))
|
||||
if(!query_watchreason.warn_execute())
|
||||
@@ -82,7 +82,7 @@
|
||||
var/sql_ckey = usr.ckey
|
||||
var/edit_text = "Edited by [sql_ckey] on [SQLtime()] from \"[watch_reason]\" to \"[new_reason]\""
|
||||
|
||||
var/datum/db_query/query_watchupdate = SSdbcore.NewQuery("UPDATE [format_table_name("watch")] SET reason=:new_reason, last_editor=:sql_ckey, edits = CONCAT(IFNULL(edits,''), :edit_text) WHERE ckey=:target_ckey", list(
|
||||
var/datum/db_query/query_watchupdate = SSdbcore.NewQuery("UPDATE watch SET reason=:new_reason, last_editor=:sql_ckey, edits = CONCAT(IFNULL(edits,''), :edit_text) WHERE ckey=:target_ckey", list(
|
||||
"new_reason" = new_reason,
|
||||
"sql_ckey" = sql_ckey,
|
||||
"edit_text" = edit_text,
|
||||
@@ -114,7 +114,7 @@
|
||||
else
|
||||
search = "^."
|
||||
|
||||
var/datum/db_query/query_watchlist = SSdbcore.NewQuery("SELECT ckey, reason, adminckey, timestamp, last_editor FROM [format_table_name("watch")] WHERE ckey REGEXP :search ORDER BY ckey", list(
|
||||
var/datum/db_query/query_watchlist = SSdbcore.NewQuery("SELECT ckey, reason, adminckey, timestamp, last_editor FROM watch WHERE ckey REGEXP :search ORDER BY ckey", list(
|
||||
"search" = search
|
||||
))
|
||||
if(!query_watchlist.warn_execute())
|
||||
@@ -134,7 +134,7 @@
|
||||
qdel(query_watchlist)
|
||||
|
||||
/proc/check_watchlist(target_ckey)
|
||||
var/datum/db_query/query_watch = SSdbcore.NewQuery("SELECT reason FROM [format_table_name("watch")] WHERE ckey=:target_ckey", list(
|
||||
var/datum/db_query/query_watch = SSdbcore.NewQuery("SELECT reason FROM watch WHERE ckey=:target_ckey", list(
|
||||
"target_ckey" = target_ckey
|
||||
))
|
||||
if(!query_watch.warn_execute())
|
||||
|
||||
Reference in New Issue
Block a user