Skip to content

Commit

Permalink
Merge branch 'master' into clean_squa_vendors_inventory
Browse files Browse the repository at this point in the history
  • Loading branch information
Huffie56 authored Jul 20, 2023
2 parents 6d5bdeb + 8ac357f commit 7278627
Show file tree
Hide file tree
Showing 63 changed files with 1,102 additions and 461 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/ci_suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ jobs:
- name: Find Maps
id: map_finder
run: |
echo "$(ls -mw0 maps/*.json)" > maps_output.txt
shopt -s extglob
echo "$(ls -mw0 maps/!(*override*).json)" > maps_output.txt
sed -i -e s+maps/+\"+g -e s+.json+\"+g maps_output.txt
echo "Maps: $(cat maps_output.txt)"
echo "maps={\"paths\":[$(cat maps_output.txt)]}" >> $GITHUB_OUTPUT
Expand Down
3 changes: 3 additions & 0 deletions code/__DEFINES/admin.dm
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,6 @@ var/global/list/note_categories = list("Admin", "Merit", "Commanding Officer", "
#define ANTIGRIEF_NEW_PLAYERS 1
/// Enables antigrief entirely: Nobody can activate explosives on the Almayer, unless the ship crashed.
#define ANTIGRIEF_ENABLED 2

/// Proc has been blocked by IsAdminAdvancedProcCall()
#define PROC_BLOCKED "PROCCALL BLOCKED"
2 changes: 1 addition & 1 deletion code/__HELPERS/game.dm
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@

// copied from join as xeno
var/deathtime = world.time - cur_obs.timeofdeath
if(deathtime < XENO_JOIN_DEAD_TIME && ( !cur_obs.client.admin_holder || !(cur_obs.client.admin_holder.rights & R_ADMIN)) )
if(deathtime < XENO_JOIN_DEAD_TIME && ( !cur_obs.client.admin_holder || !(cur_obs.client.admin_holder.rights & R_ADMIN) || !cur_obs.bypass_time_of_death_checks))
continue

// AFK players cannot be drafted
Expand Down
1 change: 0 additions & 1 deletion code/__HELPERS/type2type.dm
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,6 @@
if(rights & R_POSSESS) . += "[seperator]+POSSESS"
if(rights & R_PERMISSIONS) . += "[seperator]+PERMISSIONS"
if(rights & R_STEALTH) . += "[seperator]+STEALTH"
if(rights & R_REJUVINATE) . += "[seperator]+REJUVINATE"
if(rights & R_COLOR) . += "[seperator]+COLOR"
if(rights & R_VAREDIT) . += "[seperator]+VAREDIT"
if(rights & R_SOUNDS) . += "[seperator]+SOUND"
Expand Down
7 changes: 6 additions & 1 deletion code/__HELPERS/unsorted.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1139,7 +1139,7 @@ var/global/image/action_purple_power_up
break
if(user_flags & INTERRUPT_NEEDHAND)
if(user_holding)
if(!user_holding.loc || busy_user.get_active_hand() != user_holding) //no longer holding the required item
if(!user_holding.loc || busy_user.get_active_hand() != user_holding) //no longer holding the required item in active hand
. = FALSE
break
else if(busy_user.get_active_hand()) //something in active hand when we need it to stay empty
Expand All @@ -1153,6 +1153,11 @@ var/global/image/action_purple_power_up
else if(T.get_active_hand())
. = FALSE
break
if(user_flags & INTERRUPT_NO_NEEDHAND)
if(user_holding)
if(!user_holding.loc || (busy_user.l_hand != user_holding && busy_user.r_hand != user_holding)) //no longer holding the required item in either hand
. = FALSE
break
if(user_flags & INTERRUPT_RESIST && busy_user.resisting || \
target_is_mob && (target_flags & INTERRUPT_RESIST && T.resisting)
)
Expand Down
4 changes: 2 additions & 2 deletions code/__HELPERS/verb_helpers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
if(!target)
CRASH("add_verb called without a target")
if(IsAdminAdvancedProcCall())
return
return PROC_BLOCKED
var/mob/mob_target = null

if(ismob(target))
Expand Down Expand Up @@ -56,7 +56,7 @@
*/
/proc/remove_verb(client/target, verb_or_list_to_remove)
if(IsAdminAdvancedProcCall())
return
return PROC_BLOCKED

var/mob/mob_target = null
if(ismob(target))
Expand Down
1 change: 0 additions & 1 deletion code/_globalvars/bitfields.dm
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ DEFINE_BITFIELD(rights, list(
"POSSESS" = R_POSSESS,
"PERMISSIONS" = R_PERMISSIONS,
"STEALTH" = R_STEALTH,
"REJUVENATE" = R_REJUVINATE,
"COLOR" = R_COLOR,
"VAREDIT" = R_VAREDIT,
"SOUNDS" = R_SOUNDS,
Expand Down
16 changes: 10 additions & 6 deletions code/controllers/configuration/configuration.dm
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@

/datum/controller/configuration/proc/admin_reload()
if(IsAdminAdvancedProcCall())
return
alert_proccall("configuration admin_reload")
return PROC_BLOCKED
log_admin("[key_name(usr)] has forcefully reloaded the configuration from disk.")
message_admins("[key_name_admin(usr)] has forcefully reloaded the configuration from disk.")
full_wipe()
Expand All @@ -33,7 +34,8 @@

/datum/controller/configuration/proc/Load(_directory)
if(IsAdminAdvancedProcCall()) //If admin proccall is detected down the line it will horribly break everything.
return
alert_proccall("configuration Load")
return PROC_BLOCKED
if(_directory)
directory = _directory
if(entries)
Expand Down Expand Up @@ -117,7 +119,8 @@

/datum/controller/configuration/proc/full_wipe()
if(IsAdminAdvancedProcCall())
return
alert_proccall("configuration full_wipe")
return PROC_BLOCKED
entries_by_type.Cut()
QDEL_LIST_ASSOC_VAL(entries)
entries = null
Expand Down Expand Up @@ -163,7 +166,8 @@

/datum/controller/configuration/proc/LoadEntries(filename, list/stack = list())
if(IsAdminAdvancedProcCall())
return
alert_proccall("configuration LoadEntries")
return PROC_BLOCKED

var/filename_to_test = world.system_type == MS_WINDOWS ? lowertext(filename) : filename
if(filename_to_test in stack)
Expand Down Expand Up @@ -264,7 +268,7 @@
CRASH("Missing config entry for [entry_type]!")
if((E.protection & CONFIG_ENTRY_HIDDEN) && IsAdminAdvancedProcCall() && GLOB.LastAdminCalledProc == "Get" && GLOB.LastAdminCalledTargetRef == "[REF(src)]")
log_admin_private("Config access of [entry_type] attempted by [key_name(usr)]")
return
return PROC_BLOCKED
return E.config_entry_value


Expand All @@ -278,7 +282,7 @@
CRASH("Missing config entry for [entry_type]!")
if((E.protection & CONFIG_ENTRY_LOCKED) && IsAdminAdvancedProcCall() && GLOB.LastAdminCalledProc == "Set" && GLOB.LastAdminCalledTargetRef == "[REF(src)]")
log_admin_private("Config rewrite of [entry_type] to [new_val] attempted by [key_name(usr)]")
return
return PROC_BLOCKED
return E.ValidateAndSet("[new_val]")


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,13 @@ GLOBAL_LIST_INIT(cm_vending_gear_engi, list(
list("M4 Pattern Armor", 30, /obj/item/clothing/suit/storage/marine/rto, null, VENDOR_ITEM_REGULAR),
list("Large General Pouch", 6, /obj/item/storage/pouch/general/large, null, VENDOR_ITEM_REGULAR),
list("Sling Pouch", 6, /obj/item/storage/pouch/sling, null, VENDOR_ITEM_REGULAR),
list("Large Magazine Pouch", 6, /obj/item/storage/pouch/magazine/large, null, VENDOR_ITEM_REGULAR),
list("Fuel Tank Strap Pouch", 4, /obj/item/storage/pouch/flamertank, null, VENDOR_ITEM_REGULAR),
list("Machete Pouch (Full)", 8, /obj/item/storage/pouch/machete/full, null, VENDOR_ITEM_REGULAR),
list("Fire Extinguisher (Portable)", 3, /obj/item/tool/extinguisher/mini, null, VENDOR_ITEM_REGULAR),
list("Motion Detector", 8, /obj/item/device/motiondetector, null, VENDOR_ITEM_REGULAR),
list("Whistle", 3, /obj/item/device/whistle, null, VENDOR_ITEM_REGULAR),
list("JTAC Pamphlet", 15, /obj/item/pamphlet/skill/jtac, null, VENDOR_ITEM_REGULAR),
list("Powerloader Certification", 45, /obj/item/pamphlet/skill/powerloader, null, VENDOR_ITEM_REGULAR),
list("Large Shotgun Shell Pouch", 10, /obj/item/storage/pouch/shotgun/large, null, VENDOR_ITEM_RECOMMENDED),
list("M276 Pattern Combat Toolbelt Rig", 15, /obj/item/storage/belt/gun/utility, null, VENDOR_ITEM_REGULAR),

list("RADIO KEYS", 0, null, null, null),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ GLOBAL_LIST_INIT(cm_vending_gear_leader, list(
list("Motion Detector", 5, /obj/item/device/motiondetector, null, VENDOR_ITEM_REGULAR),
list("M4 Pattern Armor", 30, /obj/item/clothing/suit/storage/marine/rto, null, VENDOR_ITEM_REGULAR),
list("Powerloader Certification", 45, /obj/item/pamphlet/skill/powerloader, null, VENDOR_ITEM_REGULAR),
list("Large Shotgun Shell Pouch", 10, /obj/item/storage/pouch/shotgun/large, null, VENDOR_ITEM_RECOMMENDED),
list("Fulton Device Stack", 5, /obj/item/stack/fulton, null, VENDOR_ITEM_REGULAR),
list("Radio Telephone Pack", 5, /obj/item/storage/backpack/marine/satchel/rto, null, VENDOR_ITEM_REGULAR),

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,6 @@ GLOBAL_LIST_INIT(cm_vending_gear_medic, list(
list("M4 Pattern Armor", 28, /obj/item/clothing/suit/storage/marine/rto, null, VENDOR_ITEM_REGULAR),
list("Range Finder", 6, /obj/item/device/binoculars/range, null, VENDOR_ITEM_REGULAR),
list("Laser Designator", 8, /obj/item/device/binoculars/range/designator, null, VENDOR_ITEM_REGULAR),
list("Large General Pouch", 6, /obj/item/storage/pouch/general/large, null, VENDOR_ITEM_REGULAR),
list("Large Magazine Pouch", 6, /obj/item/storage/pouch/magazine/large, null, VENDOR_ITEM_REGULAR),
list("Large Shotgun Shell Pouch", 6, /obj/item/storage/pouch/shotgun/large, null, VENDOR_ITEM_REGULAR),
list("Fuel Tank Strap Pouch", 4, /obj/item/storage/pouch/flamertank, null, VENDOR_ITEM_REGULAR),
list("Shoulder Holster", 6, /obj/item/clothing/accessory/storage/holster, null, VENDOR_ITEM_REGULAR),
list("Machete Scabbard (Full)", 6, /obj/item/storage/large_holster/machete/full, null, VENDOR_ITEM_REGULAR),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,6 @@ GLOBAL_LIST_INIT(cm_vending_clothing_marine, list(
list("B12 Pattern Marine Armor", 30, /obj/item/clothing/suit/storage/marine/leader, null, VENDOR_ITEM_REGULAR),
list("Range Finder", 10, /obj/item/device/binoculars/range, null, VENDOR_ITEM_REGULAR),
list("Laser Designator", 15, /obj/item/device/binoculars/range/designator, null, VENDOR_ITEM_REGULAR),
list("Large General Pouch", 15, /obj/item/storage/pouch/general/large, null, VENDOR_ITEM_REGULAR),
list("Large Magazine Pouch", 15, /obj/item/storage/pouch/magazine/large, null, VENDOR_ITEM_REGULAR),
list("Fuel Tank Strap Pouch", 5, /obj/item/storage/pouch/flamertank, null, VENDOR_ITEM_REGULAR),
list("Shoulder Holster", 15, /obj/item/clothing/accessory/storage/holster, null, VENDOR_ITEM_REGULAR),
list("Machete Scabbard (Full)", 15, /obj/item/storage/large_holster/machete/full, null, VENDOR_ITEM_REGULAR),
Expand All @@ -102,7 +100,6 @@ GLOBAL_LIST_INIT(cm_vending_clothing_marine, list(
list("JTAC Pamphlet", 15, /obj/item/pamphlet/skill/jtac, null, VENDOR_ITEM_REGULAR),
list("Engineering Pamphlet", 15, /obj/item/pamphlet/skill/engineer, null, VENDOR_ITEM_REGULAR),
list("Powerloader Certification", 45, /obj/item/pamphlet/skill/powerloader, null, VENDOR_ITEM_REGULAR),
list("Large Shotgun Shell Pouch", 10, /obj/item/storage/pouch/shotgun/large, null, VENDOR_ITEM_REGULAR),
list("USCM Radio Telephone Pack", 15, /obj/item/storage/backpack/marine/satchel/rto, null, VENDOR_ITEM_REGULAR),

list("RADIO KEYS", 0, null, null, null),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,12 @@ GLOBAL_LIST_INIT(cm_vending_gear_smartgun, list(
list("UTILITIES", 0, null, null, null),
list("Range Finder", 10, /obj/item/device/binoculars/range, null, VENDOR_ITEM_REGULAR),
list("Laser Designator", 15, /obj/item/device/binoculars/range/designator, null, VENDOR_ITEM_REGULAR),
list("Large General Pouch", 15, /obj/item/storage/pouch/general/large, null, VENDOR_ITEM_REGULAR),
list("Large Magazine Pouch", 15, /obj/item/storage/pouch/magazine/large, null, VENDOR_ITEM_REGULAR),
list("Fuel Tank Strap Pouch", 5, /obj/item/storage/pouch/flamertank, null, VENDOR_ITEM_REGULAR),
list("Fire Extinguisher (Portable)", 5, /obj/item/tool/extinguisher/mini, null, VENDOR_ITEM_REGULAR),
list("Whistle", 5, /obj/item/device/whistle, null, VENDOR_ITEM_REGULAR),
list("JTAC Pamphlet", 15, /obj/item/pamphlet/skill/jtac, null, VENDOR_ITEM_REGULAR),
list("Engineering Pamphlet", 15, /obj/item/pamphlet/skill/engineer, null, VENDOR_ITEM_REGULAR),
list("Powerloader Certification", 45, /obj/item/pamphlet/skill/powerloader, null, VENDOR_ITEM_REGULAR),
list("Large Shotgun Shell Pouch", 10, /obj/item/storage/pouch/shotgun/large, null, VENDOR_ITEM_RECOMMENDED),
list("Roller Bed", 5, /obj/item/roller, null, VENDOR_ITEM_REGULAR),
list("Fulton Device Stack", 5, /obj/item/stack/fulton, null, VENDOR_ITEM_REGULAR),

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ GLOBAL_LIST_INIT(cm_vending_gear_spec, list(
list("JTAC Pamphlet", 15, /obj/item/pamphlet/skill/jtac, null, VENDOR_ITEM_REGULAR),
list("Engineering Pamphlet", 15, /obj/item/pamphlet/skill/engineer, null, VENDOR_ITEM_REGULAR),
list("Powerloader Certification", 45, /obj/item/pamphlet/skill/powerloader, null, VENDOR_ITEM_REGULAR),
list("Large Shotgun Shell Pouch", 10, /obj/item/storage/pouch/shotgun/large, null, VENDOR_ITEM_REGULAR),

list("RADIO KEYS", 0, null, null, null),
list("Engineering Radio Encryption Key", 5, /obj/item/device/encryptionkey/engi, null, VENDOR_ITEM_REGULAR),
Expand Down Expand Up @@ -101,8 +100,8 @@ GLOBAL_LIST_INIT(cm_vending_clothing_specialist, list(
list("First-Aid Pouch (Splints, Gauze, Ointment)", 0, /obj/item/storage/pouch/firstaid/full/alternate, MARINE_CAN_BUY_POUCH, VENDOR_ITEM_RECOMMENDED),
list("First-Aid Pouch (Pill Packets)", 0, /obj/item/storage/pouch/firstaid/full/pills, MARINE_CAN_BUY_POUCH, VENDOR_ITEM_RECOMMENDED),
list("Flare Pouch (Full)", 0, /obj/item/storage/pouch/flare/full, MARINE_CAN_BUY_POUCH, VENDOR_ITEM_REGULAR),
list("Large Magazine Pouch", 0, /obj/item/storage/pouch/magazine/large, MARINE_CAN_BUY_POUCH, VENDOR_ITEM_RECOMMENDED),
list("Large Shotgun Shell Pouch", 0, /obj/item/storage/pouch/shotgun/large, MARINE_CAN_BUY_POUCH, VENDOR_ITEM_RECOMMENDED),
list("Magazine Pouch", 0, /obj/item/storage/pouch/magazine, MARINE_CAN_BUY_POUCH, VENDOR_ITEM_RECOMMENDED),
list("Shotgun Shell Pouch", 0, /obj/item/storage/pouch/shotgun, MARINE_CAN_BUY_POUCH, VENDOR_ITEM_RECOMMENDED),
list("Large Pistol Magazine Pouch", 0, /obj/item/storage/pouch/magazine/pistol/large, MARINE_CAN_BUY_POUCH, VENDOR_ITEM_REGULAR),
list("Medium General Pouch", 0, /obj/item/storage/pouch/general/medium, MARINE_CAN_BUY_POUCH, VENDOR_ITEM_REGULAR),
list("Pistol Pouch", 0, /obj/item/storage/pouch/pistol, MARINE_CAN_BUY_POUCH, VENDOR_ITEM_REGULAR),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,23 +32,20 @@ GLOBAL_LIST_INIT(cm_vending_gear_tl, list(
list("UTILITIES", 0, null, null, null),
list("Radio Telephone Pack", 5, /obj/item/storage/backpack/marine/satchel/rto, null, VENDOR_ITEM_RECOMMENDED),
list("Binoculars", 5, /obj/item/device/binoculars, null, VENDOR_ITEM_REGULAR),
list("Large Magazine Pouch", 10, /obj/item/storage/pouch/magazine/large, null, VENDOR_ITEM_REGULAR),
list("Motion Detector", 15, /obj/item/device/motiondetector, null, VENDOR_ITEM_RECOMMENDED),
list("Plastic Explosive", 10, /obj/item/explosive/plastic, null, VENDOR_ITEM_REGULAR),
list("Breaching Charge", 10, /obj/item/explosive/plastic/breaching_charge, null, VENDOR_ITEM_REGULAR),
list("SensorMate Medical HUD", 15, /obj/item/clothing/glasses/hud/sensor, null, VENDOR_ITEM_REGULAR),
list("M2 Night Vision Goggles", 30, /obj/item/prop/helmetgarb/helmet_nvg, null, VENDOR_ITEM_RECOMMENDED),
list("Roller Bed", 5, /obj/item/roller, null, VENDOR_ITEM_REGULAR),
list("Fulton Device Stack", 5, /obj/item/stack/fulton, null, VENDOR_ITEM_REGULAR),
list("Large General Pouch", 15, /obj/item/storage/pouch/general/large, null, VENDOR_ITEM_REGULAR),
list("Shoulder Holster", 15, /obj/item/clothing/accessory/storage/holster, null, VENDOR_ITEM_REGULAR),
list("Machete Scabbard (Full)", 5, /obj/item/storage/large_holster/machete/full, null, VENDOR_ITEM_REGULAR),
list("Machete Pouch (Full)", 15, /obj/item/storage/pouch/machete/full, null, VENDOR_ITEM_REGULAR),
list("Fire Extinguisher (Portable)", 5, /obj/item/tool/extinguisher/mini, null, VENDOR_ITEM_REGULAR),
list("Whistle", 5, /obj/item/device/whistle, null, VENDOR_ITEM_REGULAR),
list("Welding Goggles", 5, /obj/item/clothing/glasses/welding, null, VENDOR_ITEM_REGULAR),
list("Powerloader Certification", 45, /obj/item/pamphlet/skill/powerloader, null, VENDOR_ITEM_REGULAR),
list("Large Shotgun Shell Pouch", 10, /obj/item/storage/pouch/shotgun/large, null, VENDOR_ITEM_RECOMMENDED),
list("Insulated Gloves", 3, /obj/item/clothing/gloves/yellow, null, VENDOR_ITEM_REGULAR),

list("RADIO KEYS", 0, null, null, null),
Expand Down
4 changes: 2 additions & 2 deletions code/game/objects/effects/landmarks/survivor_spawner.dm
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@

/obj/effect/landmark/survivor_spawner/bigred_crashed_pmc_medic
equipment = /datum/equipment_preset/survivor/pmc/medic
synth_equipment = /datum/equipment_preset/pmc/synth
synth_equipment = /datum/equipment_preset/synth/survivor/pmc
intro_text = list("<h2>You are a survivor of a crash landing!</h2>",\
"You are NOT aware of the xenomorph threat.",\
"Your primary objective is to heal up and survive. If you want to assault the hive - adminhelp.")
Expand All @@ -93,7 +93,7 @@

/obj/effect/landmark/survivor_spawner/bigred_crashed_pmc_engineer
equipment = /datum/equipment_preset/survivor/pmc/engineer
synth_equipment = /datum/equipment_preset/pmc/synth
synth_equipment = /datum/equipment_preset/synth/survivor/pmc
intro_text = list("<h2>You are a survivor of a crash landing!</h2>",\
"You are NOT aware of the xenomorph threat.",\
"Your primary objective is to heal up and survive. If you want to assault the hive - adminhelp.")
Expand Down
2 changes: 1 addition & 1 deletion code/game/verbs/who.dm
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@
var/dat = ""
var/list/mappings
if(CONFIG_GET(flag/show_manager))
LAZYSET(mappings, "<B style='color:purple'>Management</B>", R_HOST)
LAZYSET(mappings, "<B style='color:purple'>Management</B>", R_PERMISSIONS)
if(CONFIG_GET(flag/show_devs))
LAZYSET(mappings, "<B style='color:blue'>Maintainers</B>", R_PROFILER)
LAZYSET(mappings, "<B style='color:red'>Admins</B>", R_ADMIN)
Expand Down
30 changes: 15 additions & 15 deletions code/global.dm
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,21 @@
#define R_POSSESS (1<<5)
#define R_PERMISSIONS (1<<6)
#define R_STEALTH (1<<7)
#define R_REJUVINATE (1<<8)
#define R_COLOR (1<<9)
#define R_VAREDIT (1<<10)
#define R_SOUNDS (1<<11)
#define R_SPAWN (1<<12)
#define R_MOD (1<<13)
#define R_MENTOR (1<<14)
#define R_HOST (1<<15)
#define R_PROFILER (1<<16)
#define R_NOLOCK (1<<17)
#define R_EVENT (1<<18)

/// The sum of all other rank permissions.
#define R_EVERYTHING ((1<<19)-1)

#define R_COLOR (1<<8)
#define R_VAREDIT (1<<9)
#define R_SOUNDS (1<<10)
#define R_SPAWN (1<<11)
#define R_MOD (1<<12)
#define R_MENTOR (1<<13)
#define R_HOST (1<<14)
#define R_PROFILER (1<<15)
#define R_NOLOCK (1<<16)
#define R_EVENT (1<<17)

/// The sum of all other rank permissions, other than host or profiler.
#define RL_EVERYTHING (R_BUILDMODE|R_ADMIN|R_BAN|R_SERVER|R_DEBUG|R_PERMISSIONS|R_POSSESS|R_STEALTH|R_COLOR|R_VAREDIT|R_EVENT|R_SOUNDS|R_NOLOCK|R_SPAWN|R_MOD|R_MENTOR)
/// Truely everything
#define RL_HOST (RL_EVERYTHING|R_HOST|R_PROFILER)
// 512.1430 increases maximum bit flags from 16 to 24, so the following flags should be available for future changes:
//=================================================

Expand Down
3 changes: 3 additions & 0 deletions code/modules/admin/NewBan.dm
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,9 @@ var/savefile/Banlist
RemoveBan(A)

/client/proc/cmd_admin_do_ban(mob/M)
if(IsAdminAdvancedProcCall())
alert_proccall("cmd_admin_do_ban")
return PROC_BLOCKED
if(!check_rights(R_BAN|R_MOD)) return

if(!ismob(M)) return
Expand Down
4 changes: 2 additions & 2 deletions code/modules/admin/admin_ranks.dm
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,17 @@ var/list/admin_ranks = list() //list of all ranks with associated rights
if("permissions","rights") rights |= R_PERMISSIONS
if("possess") rights |= R_POSSESS
if("stealth") rights |= R_STEALTH
if("rejuv","rejuvinate") rights |= R_REJUVINATE
if("color") rights |= R_COLOR
if("varedit") rights |= R_VAREDIT
if("event") rights |= R_EVENT
if("everything","host","all") rights |= (R_HOST|R_BUILDMODE|R_ADMIN|R_BAN|R_SERVER|R_DEBUG|R_PERMISSIONS|R_POSSESS|R_STEALTH|R_REJUVINATE|R_COLOR|R_VAREDIT|R_EVENT|R_SOUNDS|R_NOLOCK|R_SPAWN|R_MOD|R_MENTOR)
if("sound","sounds") rights |= R_SOUNDS
if("nolock") rights |= R_NOLOCK
if("spawn","create") rights |= R_SPAWN
if("mod") rights |= R_MOD
if("mentor") rights |= R_MENTOR
if("profiler") rights |= R_PROFILER
if("host") rights |= RL_HOST
if("everything") rights |= RL_EVERYTHING

admin_ranks[rank] = rights
previous_rights = rights
Expand Down
10 changes: 8 additions & 2 deletions code/modules/admin/callproc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ GLOBAL_PROTECT(LastAdminCalledProc)
*/
/proc/HandleUserlessProcCall(user, datum/target, procname, list/arguments)
if(IsAdminAdvancedProcCall())
return
alert_proccall("HandleUserlessProcCall")
return PROC_BLOCKED
var/mob/proccall_handler/handler = GLOB.AdminProcCallHandler
handler.add_caller(user)
var/lastusr = usr
Expand All @@ -90,7 +91,8 @@ GLOBAL_PROTECT(LastAdminCalledProc)
*/
/proc/HandleUserlessSDQL(user, query_text)
if(IsAdminAdvancedProcCall())
return
alert_proccall("HandleUserlessSDQL")
return PROC_BLOCKED

var/mob/proccall_handler/handler = GLOB.AdminProcCallHandler
handler.add_caller(user)
Expand Down Expand Up @@ -224,6 +226,10 @@ GLOBAL_PROTECT(LastAdminCalledProc)
/proc/IsAdminAdvancedProcCall()
return (GLOB.AdminProcCaller && GLOB.AdminProcCaller == usr?.client?.ckey) || (GLOB.AdminProcCallHandler && usr == GLOB.AdminProcCallHandler)

/proc/alert_proccall(procname = "Unknown")
to_chat(usr, SPAN_BOLDWARNING("Warning: Force attempt has been logged."))
message_admins("[key_name(usr)] has attempted to execute a restricted proc. ([procname])")

/client/proc/callproc_datum(datum/called_datum as null|area|mob|obj|turf)
set category = "Debug"
set name = "Datum ProcCall"
Expand Down
Loading

0 comments on commit 7278627

Please sign in to comment.