From 6b5ca589c3f424f71c04bd444806aa3e408d8e51 Mon Sep 17 00:00:00 2001 From: Casper Date: Tue, 9 Jul 2024 21:12:29 +0100 Subject: [PATCH 1/8] Port --- code/datums/components/crafting/crafting.dm | 11 ++ .../objects/items/devices/transfer_valve.dm | 9 + code/modules/admin/verbs/admin.dm | 7 +- .../machinery/portable/canister.dm | 8 + .../chemistry/machinery/chem_dispenser.dm | 9 + .../wiremod/core/integrated_circuit.dm | 8 + .../code/modules/admin/playtimes.dm | 123 ++++++++++++++ tgstation.dme | 1 + .../tgui/interfaces/PlayerPlaytimes.tsx | 156 ++++++++++++++++++ 9 files changed, 326 insertions(+), 6 deletions(-) create mode 100644 modular_zzplurt/code/modules/admin/playtimes.dm create mode 100644 tgui/packages/tgui/interfaces/PlayerPlaytimes.tsx diff --git a/code/datums/components/crafting/crafting.dm b/code/datums/components/crafting/crafting.dm index 228a1918c9898..56bd90b342b4a 100644 --- a/code/datums/components/crafting/crafting.dm +++ b/code/datums/components/crafting/crafting.dm @@ -544,6 +544,17 @@ to_chat(user, span_notice("You made [crafted_items] item\s.")) else make_action(crafting_recipe, user) + + if (istype(crafting_recipe, /datum/crafting_recipe/improv_explosive) || istype(crafting_recipe, /datum/crafting_recipe/molotov) || istype(crafting_recipe, /datum/crafting_recipe/chemical_payload) || istype(crafting_recipe, /datum/crafting_recipe/chemical_payload2)) + var/client/client = user.client + if (CONFIG_GET(flag/use_exp_tracking) && client && client.get_exp_living(TRUE) < 8 HOURS) // Player with less than 8 hours playtime is making an IED or molotov cocktail. + if(client.next_ied_grief_warning < world.time) + var/turf/T = get_turf(user) + client.next_ied_grief_warning = world.time + 15 MINUTES // Wait 15 minutes before alerting admins again + message_admins("[span_adminhelp("ANTI-GRIEF:")] New player [ADMIN_LOOKUPFLW(user)] has crafted an IED or Molotov at [ADMIN_VERBOSEJMP(T)].") + client.crafted_ied = TRUE + + busy = FALSE if("toggle_recipes") display_craftable_only = !display_craftable_only diff --git a/code/game/objects/items/devices/transfer_valve.dm b/code/game/objects/items/devices/transfer_valve.dm index 598c16c9041a8..64f46caf9a9a0 100644 --- a/code/game/objects/items/devices/transfer_valve.dm +++ b/code/game/objects/items/devices/transfer_valve.dm @@ -119,6 +119,15 @@ //Triggers mousetraps /obj/item/transfer_valve/attack_hand(mob/user, list/modifiers) . = ..() + + var/client/client = user.client + if (CONFIG_GET(flag/use_exp_tracking) && client && client.get_exp_living(TRUE) < 8 HOURS) // Player with less than 8 hours playtime has touched a bomb valve. + if(client.next_valve_grief_warning < world.time) + var/turf/T = get_turf(src) + client.next_valve_grief_warning = world.time + 15 MINUTES // Wait 15 minutes before alerting admins again + message_admins("[span_adminhelp("ANTI-GRIEF:")] New player [ADMIN_LOOKUPFLW(user)] touched \a [src] at [ADMIN_VERBOSEJMP(T)].") + client.touched_transfer_valve = TRUE + if(.) return if(attached_device) diff --git a/code/modules/admin/verbs/admin.dm b/code/modules/admin/verbs/admin.dm index 3aaab5bae58fc..efe7a25c33863 100644 --- a/code/modules/admin/verbs/admin.dm +++ b/code/modules/admin/verbs/admin.dm @@ -42,12 +42,7 @@ ADMIN_VERB(cmd_admin_check_player_exp, R_ADMIN, "Player Playtime", "View player to_chat(user, span_warning("Tracking is disabled in the server configuration file."), confidential = TRUE) return - var/list/msg = list() - msg += "Playtime ReportPlaytime:
" - user << browse(msg.Join(), "window=Player_playtime_check") + new /datum/player_playtime(usr) /client/proc/trigger_centcom_recall() if(!check_rights(R_ADMIN)) diff --git a/code/modules/atmospherics/machinery/portable/canister.dm b/code/modules/atmospherics/machinery/portable/canister.dm index af13be0bbbf9b..1517f0f233eba 100644 --- a/code/modules/atmospherics/machinery/portable/canister.dm +++ b/code/modules/atmospherics/machinery/portable/canister.dm @@ -531,6 +531,14 @@ ui = new(user, src, "Canister", name) ui.open() + var/client/client = user.client + if (CONFIG_GET(flag/use_exp_tracking) && client && client.get_exp_living(TRUE) < 8 HOURS) // Player with less than 8 hours playtime is interacting with this canister. + if(client.next_canister_grief_warning < world.time) + var/turf/T = get_turf(src) + client.next_canister_grief_warning = world.time + 15 MINUTES // Wait 15 minutes before alerting admins again + message_admins("[span_adminhelp("ANTI-GRIEF:")] New player [ADMIN_LOOKUPFLW(user)] has touched \a [src] at [ADMIN_VERBOSEJMP(T)].") + client.touched_canister = TRUE + /obj/machinery/portable_atmospherics/canister/ui_static_data(mob/user) return list( "defaultReleasePressure" = round(CAN_DEFAULT_RELEASE_PRESSURE), diff --git a/code/modules/reagents/chemistry/machinery/chem_dispenser.dm b/code/modules/reagents/chemistry/machinery/chem_dispenser.dm index 06d9561744fad..cebc5b57ecbc2 100644 --- a/code/modules/reagents/chemistry/machinery/chem_dispenser.dm +++ b/code/modules/reagents/chemistry/machinery/chem_dispenser.dm @@ -253,6 +253,15 @@ ui = new(user, src, "ChemDispenser", name) ui.open() + var/client/client = user.client + if (CONFIG_GET(flag/use_exp_tracking) && client && client.get_exp_living(TRUE) < 8 HOURS) // Player with less than 8 hours playtime is using this machine. + if(client.next_chem_grief_warning < world.time) + if(!istype(src, /obj/machinery/chem_dispenser/drinks) && !istype(src, /obj/machinery/chem_dispenser/mutagen) && !istype(src, /obj/machinery/chem_dispenser/mutagensaltpeter) && !istype(src, /obj/machinery/chem_dispenser/abductor)) // These types aren't used for grief + var/turf/T = get_turf(src) + client.next_chem_grief_warning = world.time + 15 MINUTES // Wait 15 minutes before alerting admins again + message_admins("[span_adminhelp("ANTI-GRIEF:")] New player [ADMIN_LOOKUPFLW(user)] used \a [src] at [ADMIN_VERBOSEJMP(T)].") + client.used_chem_dispenser = TRUE + var/is_hallucinating = FALSE if(isliving(user)) var/mob/living/living_user = user diff --git a/code/modules/wiremod/core/integrated_circuit.dm b/code/modules/wiremod/core/integrated_circuit.dm index c295dc8ad7965..7f72cbbd501c7 100644 --- a/code/modules/wiremod/core/integrated_circuit.dm +++ b/code/modules/wiremod/core/integrated_circuit.dm @@ -450,6 +450,14 @@ GLOBAL_LIST_EMPTY_TYPED(integrated_circuits, /obj/item/integrated_circuit) ui.open() ui.set_autoupdate(FALSE) + var/client/client = user.client + if (CONFIG_GET(flag/use_exp_tracking) && client && client.get_exp_living(TRUE) < 8 HOURS) // Player with less than 8 hours playtime is using this machine. + if(client.next_circuit_grief_warning < world.time) + var/turf/T = get_turf(src) + client.next_circuit_grief_warning = world.time + 15 MINUTES // Wait 15 minutes before alerting admins again + message_admins("[span_adminhelp("ANTI-GRIEF:")] New player [ADMIN_LOOKUPFLW(user)] has touched \a [src] at [ADMIN_VERBOSEJMP(T)].") + client.touched_circuit = TRUE + #define WITHIN_RANGE(id, table) (id >= 1 && id <= length(table)) /obj/item/integrated_circuit/ui_act(action, list/params, datum/tgui/ui) diff --git a/modular_zzplurt/code/modules/admin/playtimes.dm b/modular_zzplurt/code/modules/admin/playtimes.dm new file mode 100644 index 0000000000000..1ef4bb970640b --- /dev/null +++ b/modular_zzplurt/code/modules/admin/playtimes.dm @@ -0,0 +1,123 @@ +/client + var/datum/player_playtime/playtime_menu + var/next_valve_grief_warning = 0 + var/next_chem_grief_warning = 0 + var/next_canister_grief_warning = 0 + var/next_ied_grief_warning = 0 + var/next_circuit_grief_warning = 0 + var/touched_transfer_valve = FALSE + var/used_chem_dispenser = FALSE + var/touched_canister = FALSE + var/crafted_ied = FALSE + var/touched_circuit = FALSE + var/uses_vpn = FALSE + +/datum/player_playtime/New(mob/viewer) + ui_interact(viewer) + +/datum/player_playtime/ui_interact(mob/user, datum/tgui/ui) + ui = SStgui.try_update_ui(user, src, ui) + if(!ui) + ui = new(user, src, "PlayerPlaytimes", "Player Playtimes") + ui.open() + +/datum/player_playtime/ui_state(mob/user) + return GLOB.admin_state + +/datum/player_playtime/ui_data(mob/user) + var/list/data = list() + + var/list/clients = list() + for(var/client/C in GLOB.clients) + var/list/client = list() + + client["ckey"] = C.ckey + client["playtime_hours"] = C.get_exp_living() + client["flags"] = check_flags(C) + + var/mob/M = C.mob + client["observer"] = isobserver(M) + client["ingame"] = !isnewplayer(M) + client["name"] = M.real_name + var/nnpa = CONFIG_GET(number/notify_new_player_age) + if(nnpa >= 0) + if(C.account_age >= 0 && (C.account_age < CONFIG_GET(number/notify_new_player_age))) + client["new_account"] = "New BYOND account [C.account_age] day[(C.account_age==1?"":"s")] old, created on [C.account_join_date]" + + clients += list(client) + + clients = sort_list(clients, GLOBAL_PROC_REF(cmp_playtime_asc)) + data["clients"] = clients + return data + +/datum/player_playtime/ui_act(action, params) + if(..()) + return + + switch(action) + if("view_playtime") + var/mob/target = get_mob_by_ckey(params["ckey"]) + usr.client.holder.cmd_show_exp_panel(target.client) + if("admin_pm") + usr.client.cmd_admin_pm(params["ckey"]) + if("player_panel") + var/mob/target = get_mob_by_ckey(params["ckey"]) + SSadmin_verbs.dynamic_invoke_verb(usr.client, /datum/admin_verb/show_player_panel, target) + if("view_variables") + var/mob/target = get_mob_by_ckey(params["ckey"]) + usr.client.debug_variables(target) + if("observe") + if(!isobserver(usr) && !check_rights(R_ADMIN)) + return + + var/mob/target = get_mob_by_key(params["ckey"]) + if(!target) + to_chat(usr, span_notice("Player not found.")) + return + + var/client/C = usr.client + if(!isobserver(usr)) + SSadmin_verbs.dynamic_invoke_verb(usr.client, /datum/admin_verb/admin_ghost) + var/mob/dead/observer/A = C.mob + A.ManualFollow(target) + +/datum/player_playtime/proc/check_flags(client/C) + var/list/flags = list() + + if (C.touched_transfer_valve) + var/list/flag = list() + flag["icon"] = "bomb" + flag["tooltip"] = "This player touched a Transfer Valve." + flags += list(flag) + + if (C.used_chem_dispenser) + var/list/flag = list() + flag["icon"] = "flask" + flag["tooltip"] = "This player used a Chem Dispenser." + flags += list(flag) + + if (C.touched_canister) + var/list/flag = list() + flag["icon"] = "spray-can" + flag["tooltip"] = "This player touched a gas canister." + flags += list(flag) + + if (C.crafted_ied) + var/list/flag = list() + flag["icon"] = "hammer" + flag["tooltip"] = "This player crafted an IED or Molotov." + flags += list(flag) + + if (C.touched_circuit) + var/list/flag = list() + flag["icon"] = "code-branch" + flag["tooltip"] = "This player touched an integrated circuit." + flags += list(flag) + + if(C.uses_vpn) + var/list/flag = list() + flag["icon"] = "wifi" + flag["tooltip"] = "This player is [round(C.ip_intel*100, 0.01)]% likely to be using a Proxy/VPN" + flags += list(flag) + + return flags diff --git a/tgstation.dme b/tgstation.dme index 1522d37464652..a709d763c4dd6 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -9077,6 +9077,7 @@ #include "modular_zzplurt\code\_globalvars\mobs.dm" #include "modular_zzplurt\code\controllers\configuration\entries\discord.dm" #include "modular_zzplurt\code\controllers\subsystem\discord.dm" +#include "modular_zzplurt\code\modules\admin\playtimes.dm" #include "modular_zzplurt\code\modules\client\verbs\looc.dm" #include "modular_zzplurt\code\modules\client\verbs\ooc.dm" #include "modular_zzplurt\code\modules\discord\tgs_commands.dm" diff --git a/tgui/packages/tgui/interfaces/PlayerPlaytimes.tsx b/tgui/packages/tgui/interfaces/PlayerPlaytimes.tsx new file mode 100644 index 0000000000000..0db81a27f019f --- /dev/null +++ b/tgui/packages/tgui/interfaces/PlayerPlaytimes.tsx @@ -0,0 +1,156 @@ +import { useBackend } from '../backend'; +import { Box, Button, Icon, Section, Table, Tooltip } from '../components'; +import { Window } from '../layouts'; + +type Data = { + clients: { + ckey: string; + name: string; + observer: boolean; + ingame: boolean; + new_account: string; + playtime_hours: number; + flags: { + icon: string; + tooltip: string; + }[]; + }[]; +}; + +export const PlayerPlaytimes = () => { + const { act, data } = useBackend(); + const { clients } = data; + return ( + + +
+ + + +
+ +
+
+ +
Ckey
+
+ +
Real Name
+
+ +
Flags
+
+ +
Actions
+
+
+ {clients.map((client) => ( + + +
+
+
+ +
+ {!!client.new_account && ( + + + + )}{' '} + {client.ckey} +
+
+ +
+ {!client.ingame ? ( + (At lobby) + ) : ( + !!client.observer && ( + + + + ) + )}{' '} + {client.name} +
+
+ +
+ {client.flags.map((flag) => ( +
+
+ +
+
+
+
+
+ ))} +
+
+
+
+ ); +}; From 06af8da5048d5cafa1a77ddfa4afc51b74f0c527 Mon Sep 17 00:00:00 2001 From: Casper Date: Thu, 11 Jul 2024 12:58:23 +0100 Subject: [PATCH 2/8] Modularises --- code/datums/components/crafting/crafting.dm | 11 +---------- .../objects/items/devices/transfer_valve.dm | 8 -------- .../atmospherics/machinery/portable/canister.dm | 8 -------- .../chemistry/machinery/chem_dispenser.dm | 9 --------- code/modules/wiremod/core/integrated_circuit.dm | 8 -------- .../atmospherics/machinery/portable/canister.dm | 11 +++++++++++ .../code/datums/components/crafting/crafting.dm | 17 +++++++++++++++++ .../objects/items/devices/transfer_valve.dm | 11 +++++++++++ .../chemistry/machinery/chem_dispenser.dm | 11 +++++++++++ .../modules/wiremod/core/integrated_circuit.dm | 10 ++++++++++ tgstation.dme | 4 ++++ 11 files changed, 65 insertions(+), 43 deletions(-) create mode 100644 modular_zzplurt/code/datums/components/crafting/crafting.dm create mode 100644 modular_zzplurt/code/game/objects/items/devices/transfer_valve.dm create mode 100644 modular_zzplurt/code/modules/reagents/chemistry/machinery/chem_dispenser.dm create mode 100644 modular_zzplurt/code/modules/wiremod/core/integrated_circuit.dm diff --git a/code/datums/components/crafting/crafting.dm b/code/datums/components/crafting/crafting.dm index 08ed539e9fc3b..2ff89d049646c 100644 --- a/code/datums/components/crafting/crafting.dm +++ b/code/datums/components/crafting/crafting.dm @@ -536,6 +536,7 @@ . = ..() if(.) return + switch(action) if("make", "make_mass") var/mob/user = usr @@ -551,16 +552,6 @@ else make_action(crafting_recipe, user) - if (istype(crafting_recipe, /datum/crafting_recipe/improv_explosive) || istype(crafting_recipe, /datum/crafting_recipe/molotov) || istype(crafting_recipe, /datum/crafting_recipe/chemical_payload) || istype(crafting_recipe, /datum/crafting_recipe/chemical_payload2)) - var/client/client = user.client - if (CONFIG_GET(flag/use_exp_tracking) && client && client.get_exp_living(TRUE) < 8 HOURS) // Player with less than 8 hours playtime is making an IED or molotov cocktail. - if(client.next_ied_grief_warning < world.time) - var/turf/T = get_turf(user) - client.next_ied_grief_warning = world.time + 15 MINUTES // Wait 15 minutes before alerting admins again - message_admins("[span_adminhelp("ANTI-GRIEF:")] New player [ADMIN_LOOKUPFLW(user)] has crafted an IED or Molotov at [ADMIN_VERBOSEJMP(T)].") - client.crafted_ied = TRUE - - busy = FALSE if("toggle_recipes") display_craftable_only = !display_craftable_only diff --git a/code/game/objects/items/devices/transfer_valve.dm b/code/game/objects/items/devices/transfer_valve.dm index 64f46caf9a9a0..8e914f757d4c7 100644 --- a/code/game/objects/items/devices/transfer_valve.dm +++ b/code/game/objects/items/devices/transfer_valve.dm @@ -120,14 +120,6 @@ /obj/item/transfer_valve/attack_hand(mob/user, list/modifiers) . = ..() - var/client/client = user.client - if (CONFIG_GET(flag/use_exp_tracking) && client && client.get_exp_living(TRUE) < 8 HOURS) // Player with less than 8 hours playtime has touched a bomb valve. - if(client.next_valve_grief_warning < world.time) - var/turf/T = get_turf(src) - client.next_valve_grief_warning = world.time + 15 MINUTES // Wait 15 minutes before alerting admins again - message_admins("[span_adminhelp("ANTI-GRIEF:")] New player [ADMIN_LOOKUPFLW(user)] touched \a [src] at [ADMIN_VERBOSEJMP(T)].") - client.touched_transfer_valve = TRUE - if(.) return if(attached_device) diff --git a/code/modules/atmospherics/machinery/portable/canister.dm b/code/modules/atmospherics/machinery/portable/canister.dm index 1517f0f233eba..af13be0bbbf9b 100644 --- a/code/modules/atmospherics/machinery/portable/canister.dm +++ b/code/modules/atmospherics/machinery/portable/canister.dm @@ -531,14 +531,6 @@ ui = new(user, src, "Canister", name) ui.open() - var/client/client = user.client - if (CONFIG_GET(flag/use_exp_tracking) && client && client.get_exp_living(TRUE) < 8 HOURS) // Player with less than 8 hours playtime is interacting with this canister. - if(client.next_canister_grief_warning < world.time) - var/turf/T = get_turf(src) - client.next_canister_grief_warning = world.time + 15 MINUTES // Wait 15 minutes before alerting admins again - message_admins("[span_adminhelp("ANTI-GRIEF:")] New player [ADMIN_LOOKUPFLW(user)] has touched \a [src] at [ADMIN_VERBOSEJMP(T)].") - client.touched_canister = TRUE - /obj/machinery/portable_atmospherics/canister/ui_static_data(mob/user) return list( "defaultReleasePressure" = round(CAN_DEFAULT_RELEASE_PRESSURE), diff --git a/code/modules/reagents/chemistry/machinery/chem_dispenser.dm b/code/modules/reagents/chemistry/machinery/chem_dispenser.dm index cebc5b57ecbc2..06d9561744fad 100644 --- a/code/modules/reagents/chemistry/machinery/chem_dispenser.dm +++ b/code/modules/reagents/chemistry/machinery/chem_dispenser.dm @@ -253,15 +253,6 @@ ui = new(user, src, "ChemDispenser", name) ui.open() - var/client/client = user.client - if (CONFIG_GET(flag/use_exp_tracking) && client && client.get_exp_living(TRUE) < 8 HOURS) // Player with less than 8 hours playtime is using this machine. - if(client.next_chem_grief_warning < world.time) - if(!istype(src, /obj/machinery/chem_dispenser/drinks) && !istype(src, /obj/machinery/chem_dispenser/mutagen) && !istype(src, /obj/machinery/chem_dispenser/mutagensaltpeter) && !istype(src, /obj/machinery/chem_dispenser/abductor)) // These types aren't used for grief - var/turf/T = get_turf(src) - client.next_chem_grief_warning = world.time + 15 MINUTES // Wait 15 minutes before alerting admins again - message_admins("[span_adminhelp("ANTI-GRIEF:")] New player [ADMIN_LOOKUPFLW(user)] used \a [src] at [ADMIN_VERBOSEJMP(T)].") - client.used_chem_dispenser = TRUE - var/is_hallucinating = FALSE if(isliving(user)) var/mob/living/living_user = user diff --git a/code/modules/wiremod/core/integrated_circuit.dm b/code/modules/wiremod/core/integrated_circuit.dm index 7f72cbbd501c7..c295dc8ad7965 100644 --- a/code/modules/wiremod/core/integrated_circuit.dm +++ b/code/modules/wiremod/core/integrated_circuit.dm @@ -450,14 +450,6 @@ GLOBAL_LIST_EMPTY_TYPED(integrated_circuits, /obj/item/integrated_circuit) ui.open() ui.set_autoupdate(FALSE) - var/client/client = user.client - if (CONFIG_GET(flag/use_exp_tracking) && client && client.get_exp_living(TRUE) < 8 HOURS) // Player with less than 8 hours playtime is using this machine. - if(client.next_circuit_grief_warning < world.time) - var/turf/T = get_turf(src) - client.next_circuit_grief_warning = world.time + 15 MINUTES // Wait 15 minutes before alerting admins again - message_admins("[span_adminhelp("ANTI-GRIEF:")] New player [ADMIN_LOOKUPFLW(user)] has touched \a [src] at [ADMIN_VERBOSEJMP(T)].") - client.touched_circuit = TRUE - #define WITHIN_RANGE(id, table) (id >= 1 && id <= length(table)) /obj/item/integrated_circuit/ui_act(action, list/params, datum/tgui/ui) diff --git a/modular_zubbers/code/modules/atmospherics/machinery/portable/canister.dm b/modular_zubbers/code/modules/atmospherics/machinery/portable/canister.dm index d4cf5dc08a1f6..686e6278e6f34 100644 --- a/modular_zubbers/code/modules/atmospherics/machinery/portable/canister.dm +++ b/modular_zubbers/code/modules/atmospherics/machinery/portable/canister.dm @@ -1,3 +1,14 @@ +/obj/machinery/portable_atmospherics/canister/ui_interact(mob/user, datum/tgui/ui) + . = ..() + + var/client/client = user.client + if (CONFIG_GET(flag/use_exp_tracking) && client && client.get_exp_living(TRUE) < 8 HOURS) // Player with less than 8 hours playtime is interacting with this canister. + if(client.next_canister_grief_warning < world.time) + var/turf/T = get_turf(src) + client.next_canister_grief_warning = world.time + 15 MINUTES // Wait 15 minutes before alerting admins again + message_admins("[span_adminhelp("ANTI-GRIEF:")] New player [ADMIN_LOOKUPFLW(user)] has touched \a [src] at [ADMIN_VERBOSEJMP(T)].") + client.touched_canister = TRUE + /obj/machinery/portable_atmospherics/canister/goblin name = "G-081-N canister" gas_type = /datum/gas/goblin diff --git a/modular_zzplurt/code/datums/components/crafting/crafting.dm b/modular_zzplurt/code/datums/components/crafting/crafting.dm new file mode 100644 index 0000000000000..ea99b2e3a3657 --- /dev/null +++ b/modular_zzplurt/code/datums/components/crafting/crafting.dm @@ -0,0 +1,17 @@ +/datum/component/personal_crafting/ui_act(action, params) + . = ..() + if(.) + return + + switch(action) + if("make", "make_mass") + var/datum/crafting_recipe/crafting_recipe = locate(params["recipe"]) in (mode ? GLOB.cooking_recipes : GLOB.crafting_recipes) + + if (istype(crafting_recipe, /datum/crafting_recipe/improv_explosive) || istype(crafting_recipe, /datum/crafting_recipe/molotov) || istype(crafting_recipe, /datum/crafting_recipe/chemical_payload) || istype(crafting_recipe, /datum/crafting_recipe/chemical_payload2)) + var/client/client = usr.client + if (CONFIG_GET(flag/use_exp_tracking) && client && client.get_exp_living(TRUE) < 8 HOURS) // Player with less than 8 hours playtime is making an IED or molotov cocktail. + if(client.next_ied_grief_warning < world.time) + var/turf/T = get_turf(usr) + client.next_ied_grief_warning = world.time + 15 MINUTES // Wait 15 minutes before alerting admins again + message_admins("[span_adminhelp("ANTI-GRIEF:")] New player [ADMIN_LOOKUPFLW(usr)] has crafted an IED or Molotov at [ADMIN_VERBOSEJMP(T)].") + client.crafted_ied = TRUE diff --git a/modular_zzplurt/code/game/objects/items/devices/transfer_valve.dm b/modular_zzplurt/code/game/objects/items/devices/transfer_valve.dm new file mode 100644 index 0000000000000..2bae09b88b051 --- /dev/null +++ b/modular_zzplurt/code/game/objects/items/devices/transfer_valve.dm @@ -0,0 +1,11 @@ +/obj/item/transfer_valve/attack_hand(mob/user, list/modifiers) + . = ..() + + var/client/client = user.client + if (CONFIG_GET(flag/use_exp_tracking) && client && client.get_exp_living(TRUE) < 8 HOURS) // Player with less than 8 hours playtime has touched a bomb valve. + if(client.next_valve_grief_warning < world.time) + var/turf/T = get_turf(src) + client.next_valve_grief_warning = world.time + 15 MINUTES // Wait 15 minutes before alerting admins again + message_admins("[span_adminhelp("ANTI-GRIEF:")] New player [ADMIN_LOOKUPFLW(user)] touched \a [src] at [ADMIN_VERBOSEJMP(T)].") + client.touched_transfer_valve = TRUE + diff --git a/modular_zzplurt/code/modules/reagents/chemistry/machinery/chem_dispenser.dm b/modular_zzplurt/code/modules/reagents/chemistry/machinery/chem_dispenser.dm new file mode 100644 index 0000000000000..5b3b50341f596 --- /dev/null +++ b/modular_zzplurt/code/modules/reagents/chemistry/machinery/chem_dispenser.dm @@ -0,0 +1,11 @@ +/obj/machinery/chem_dispenser/ui_interact(mob/user, datum/tgui/ui) + . = ..() + + var/client/client = user.client + if (CONFIG_GET(flag/use_exp_tracking) && client && client.get_exp_living(TRUE) < 8 HOURS) // Player with less than 8 hours playtime is using this machine. + if(client.next_chem_grief_warning < world.time) + if(!istype(src, /obj/machinery/chem_dispenser/drinks) && !istype(src, /obj/machinery/chem_dispenser/mutagen) && !istype(src, /obj/machinery/chem_dispenser/mutagensaltpeter) && !istype(src, /obj/machinery/chem_dispenser/abductor)) // These types aren't used for grief + var/turf/T = get_turf(src) + client.next_chem_grief_warning = world.time + 15 MINUTES // Wait 15 minutes before alerting admins again + message_admins("[span_adminhelp("ANTI-GRIEF:")] New player [ADMIN_LOOKUPFLW(user)] used \a [src] at [ADMIN_VERBOSEJMP(T)].") + client.used_chem_dispenser = TRUE diff --git a/modular_zzplurt/code/modules/wiremod/core/integrated_circuit.dm b/modular_zzplurt/code/modules/wiremod/core/integrated_circuit.dm new file mode 100644 index 0000000000000..9fdefe58240f3 --- /dev/null +++ b/modular_zzplurt/code/modules/wiremod/core/integrated_circuit.dm @@ -0,0 +1,10 @@ +/obj/item/integrated_circuit/ui_interact(mob/user, datum/tgui/ui) + . = ..() + + var/client/client = user.client + if (CONFIG_GET(flag/use_exp_tracking) && client && client.get_exp_living(TRUE) < 8 HOURS) // Player with less than 8 hours playtime is using this machine. + if(client.next_circuit_grief_warning < world.time) + var/turf/T = get_turf(src) + client.next_circuit_grief_warning = world.time + 15 MINUTES // Wait 15 minutes before alerting admins again + message_admins("[span_adminhelp("ANTI-GRIEF:")] New player [ADMIN_LOOKUPFLW(user)] has touched \a [src] at [ADMIN_VERBOSEJMP(T)].") + client.touched_circuit = TRUE diff --git a/tgstation.dme b/tgstation.dme index 66c23bfd1d854..2ecf615b649c3 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -9104,10 +9104,14 @@ #include "modular_zzplurt\code\_globalvars\mobs.dm" #include "modular_zzplurt\code\controllers\configuration\entries\discord.dm" #include "modular_zzplurt\code\controllers\subsystem\discord.dm" +#include "modular_zzplurt\code\datums\components\crafting\crafting.dm" +#include "modular_zzplurt\code\game\objects\items\devices\transfer_valve.dm" #include "modular_zzplurt\code\modules\admin\playtimes.dm" #include "modular_zzplurt\code\modules\client\verbs\looc.dm" #include "modular_zzplurt\code\modules\client\verbs\ooc.dm" #include "modular_zzplurt\code\modules\discord\tgs_commands.dm" #include "modular_zzplurt\code\modules\discord\verbs.dm" #include "modular_zzplurt\code\modules\mob\dead\new_player\new_player.dm" +#include "modular_zzplurt\code\modules\reagents\chemistry\machinery\chem_dispenser.dm" +#include "modular_zzplurt\code\modules\wiremod\core\integrated_circuit.dm" // END_INCLUDE From 155804c29b0960270ba6f4e854b4864f7b3235a6 Mon Sep 17 00:00:00 2001 From: Casper Date: Thu, 11 Jul 2024 13:00:41 +0100 Subject: [PATCH 3/8] Modularisation 2 --- code/datums/components/crafting/crafting.dm | 2 -- code/game/objects/items/devices/transfer_valve.dm | 1 - code/modules/admin/verbs/admin.dm | 2 ++ 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/code/datums/components/crafting/crafting.dm b/code/datums/components/crafting/crafting.dm index 2ff89d049646c..21b5548dcaaa8 100644 --- a/code/datums/components/crafting/crafting.dm +++ b/code/datums/components/crafting/crafting.dm @@ -536,7 +536,6 @@ . = ..() if(.) return - switch(action) if("make", "make_mass") var/mob/user = usr @@ -551,7 +550,6 @@ to_chat(user, span_notice("You made [crafted_items] item\s.")) else make_action(crafting_recipe, user) - busy = FALSE if("toggle_recipes") display_craftable_only = !display_craftable_only diff --git a/code/game/objects/items/devices/transfer_valve.dm b/code/game/objects/items/devices/transfer_valve.dm index 8e914f757d4c7..598c16c9041a8 100644 --- a/code/game/objects/items/devices/transfer_valve.dm +++ b/code/game/objects/items/devices/transfer_valve.dm @@ -119,7 +119,6 @@ //Triggers mousetraps /obj/item/transfer_valve/attack_hand(mob/user, list/modifiers) . = ..() - if(.) return if(attached_device) diff --git a/code/modules/admin/verbs/admin.dm b/code/modules/admin/verbs/admin.dm index efe7a25c33863..86bbd15ff3571 100644 --- a/code/modules/admin/verbs/admin.dm +++ b/code/modules/admin/verbs/admin.dm @@ -42,7 +42,9 @@ ADMIN_VERB(cmd_admin_check_player_exp, R_ADMIN, "Player Playtime", "View player to_chat(user, span_warning("Tracking is disabled in the server configuration file."), confidential = TRUE) return + // SPLURT EDIT START new /datum/player_playtime(usr) + // SPLURT EDIT END /client/proc/trigger_centcom_recall() if(!check_rights(R_ADMIN)) From b148894fc9ea5f141a065d90236a505f3c299bcd Mon Sep 17 00:00:00 2001 From: Casper Date: Thu, 11 Jul 2024 13:10:44 +0100 Subject: [PATCH 4/8] Oops --- .../atmospherics/machinery/portable/canister.dm | 11 ----------- .../atmospherics/machinery/portable/canister.dm | 10 ++++++++++ tgstation.dme | 1 + 3 files changed, 11 insertions(+), 11 deletions(-) create mode 100644 modular_zzplurt/code/modules/atmospherics/machinery/portable/canister.dm diff --git a/modular_zubbers/code/modules/atmospherics/machinery/portable/canister.dm b/modular_zubbers/code/modules/atmospherics/machinery/portable/canister.dm index 686e6278e6f34..d4cf5dc08a1f6 100644 --- a/modular_zubbers/code/modules/atmospherics/machinery/portable/canister.dm +++ b/modular_zubbers/code/modules/atmospherics/machinery/portable/canister.dm @@ -1,14 +1,3 @@ -/obj/machinery/portable_atmospherics/canister/ui_interact(mob/user, datum/tgui/ui) - . = ..() - - var/client/client = user.client - if (CONFIG_GET(flag/use_exp_tracking) && client && client.get_exp_living(TRUE) < 8 HOURS) // Player with less than 8 hours playtime is interacting with this canister. - if(client.next_canister_grief_warning < world.time) - var/turf/T = get_turf(src) - client.next_canister_grief_warning = world.time + 15 MINUTES // Wait 15 minutes before alerting admins again - message_admins("[span_adminhelp("ANTI-GRIEF:")] New player [ADMIN_LOOKUPFLW(user)] has touched \a [src] at [ADMIN_VERBOSEJMP(T)].") - client.touched_canister = TRUE - /obj/machinery/portable_atmospherics/canister/goblin name = "G-081-N canister" gas_type = /datum/gas/goblin diff --git a/modular_zzplurt/code/modules/atmospherics/machinery/portable/canister.dm b/modular_zzplurt/code/modules/atmospherics/machinery/portable/canister.dm new file mode 100644 index 0000000000000..569149cb2016a --- /dev/null +++ b/modular_zzplurt/code/modules/atmospherics/machinery/portable/canister.dm @@ -0,0 +1,10 @@ +/obj/machinery/portable_atmospherics/canister/ui_interact(mob/user, datum/tgui/ui) + . = ..() + + var/client/client = user.client + if (CONFIG_GET(flag/use_exp_tracking) && client && client.get_exp_living(TRUE) < 8 HOURS) // Player with less than 8 hours playtime is interacting with this canister. + if(client.next_canister_grief_warning < world.time) + var/turf/T = get_turf(src) + client.next_canister_grief_warning = world.time + 15 MINUTES // Wait 15 minutes before alerting admins again + message_admins("[span_adminhelp("ANTI-GRIEF:")] New player [ADMIN_LOOKUPFLW(user)] has touched \a [src] at [ADMIN_VERBOSEJMP(T)].") + client.touched_canister = TRUE diff --git a/tgstation.dme b/tgstation.dme index 2ecf615b649c3..6b8d121e81f87 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -9107,6 +9107,7 @@ #include "modular_zzplurt\code\datums\components\crafting\crafting.dm" #include "modular_zzplurt\code\game\objects\items\devices\transfer_valve.dm" #include "modular_zzplurt\code\modules\admin\playtimes.dm" +#include "modular_zzplurt\code\modules\atmospherics\machinery\portable\canister.dm" #include "modular_zzplurt\code\modules\client\verbs\looc.dm" #include "modular_zzplurt\code\modules\client\verbs\ooc.dm" #include "modular_zzplurt\code\modules\discord\tgs_commands.dm" From 369197ecc853b8c84e652a9cbb280e7c8769d726 Mon Sep 17 00:00:00 2001 From: Casper Date: Thu, 11 Jul 2024 20:37:48 +0100 Subject: [PATCH 5/8] Correct order? --- tgstation.dme | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tgstation.dme b/tgstation.dme index e3ed61b1f21f9..b84fa84096478 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -9116,11 +9116,11 @@ #include "modular_zzplurt\code\modules\client\verbs\ooc.dm" #include "modular_zzplurt\code\modules\discord\tgs_commands.dm" #include "modular_zzplurt\code\modules\discord\verbs.dm" -#include "modular_zzplurt\code\modules\mob\mob.dm" -#include "modular_zzplurt\code\modules\mob\mob_defines.dm" #include "modular_zzplurt\code\modules\mob\dead\new_player\new_player.dm" #include "modular_zzplurt\code\modules\mob\living\living.dm" #include "modular_zzplurt\code\modules\mob\living\living_defines.dm" +#include "modular_zzplurt\code\modules\mob\mob.dm" +#include "modular_zzplurt\code\modules\mob\mob_defines.dm" #include "modular_zzplurt\code\modules\reagents\chemistry\machinery\chem_dispenser.dm" #include "modular_zzplurt\code\modules\wiremod\core\integrated_circuit.dm" // END_INCLUDE From df08cdcf8c60769929078b4b14379cbbf1c68d28 Mon Sep 17 00:00:00 2001 From: Casper Date: Thu, 11 Jul 2024 20:44:28 +0100 Subject: [PATCH 6/8] . --- tgstation.dme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tgstation.dme b/tgstation.dme index b84fa84096478..801c556c0dd35 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -9104,11 +9104,11 @@ #include "modular_zzplurt\code\_globalvars\mobs.dm" #include "modular_zzplurt\code\controllers\configuration\entries\discord.dm" #include "modular_zzplurt\code\controllers\subsystem\discord.dm" +#include "modular_zzplurt\code\datums\components\crafting\crafting.dm" #include "modular_zzplurt\code\modules\admin\player_panel.dm" #include "modular_zzplurt\code\modules\admin\transform.dm" #include "modular_zzplurt\code\modules\client\client_procs.dm" #include "modular_zzplurt\code\modules\client\preferences\player_panel.dm" -#include "modular_zzplurt\code\datums\components\crafting\crafting.dm" #include "modular_zzplurt\code\game\objects\items\devices\transfer_valve.dm" #include "modular_zzplurt\code\modules\admin\playtimes.dm" #include "modular_zzplurt\code\modules\atmospherics\machinery\portable\canister.dm" From edd52825bddefc584dfe3b2af8e0d943f1dc9a2f Mon Sep 17 00:00:00 2001 From: BongaTheProto <93835010+BongaTheProto@users.noreply.github.com> Date: Fri, 12 Jul 2024 12:22:50 -0500 Subject: [PATCH 7/8] Update tgstation.dme --- tgstation.dme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tgstation.dme b/tgstation.dme index 801c556c0dd35..23fb08a7e2e2a 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -9105,11 +9105,11 @@ #include "modular_zzplurt\code\controllers\configuration\entries\discord.dm" #include "modular_zzplurt\code\controllers\subsystem\discord.dm" #include "modular_zzplurt\code\datums\components\crafting\crafting.dm" +#include "modular_zzplurt\code\game\objects\items\devices\transfer_valve.dm" #include "modular_zzplurt\code\modules\admin\player_panel.dm" #include "modular_zzplurt\code\modules\admin\transform.dm" #include "modular_zzplurt\code\modules\client\client_procs.dm" #include "modular_zzplurt\code\modules\client\preferences\player_panel.dm" -#include "modular_zzplurt\code\game\objects\items\devices\transfer_valve.dm" #include "modular_zzplurt\code\modules\admin\playtimes.dm" #include "modular_zzplurt\code\modules\atmospherics\machinery\portable\canister.dm" #include "modular_zzplurt\code\modules\client\verbs\looc.dm" From 65329fe2d6230d9fc3fa5fec9b016a4c94d3bb8f Mon Sep 17 00:00:00 2001 From: BongaTheProto <93835010+BongaTheProto@users.noreply.github.com> Date: Fri, 12 Jul 2024 12:59:35 -0500 Subject: [PATCH 8/8] Update tgstation.dme --- tgstation.dme | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tgstation.dme b/tgstation.dme index 23fb08a7e2e2a..001b53f70cbff 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -9107,20 +9107,20 @@ #include "modular_zzplurt\code\datums\components\crafting\crafting.dm" #include "modular_zzplurt\code\game\objects\items\devices\transfer_valve.dm" #include "modular_zzplurt\code\modules\admin\player_panel.dm" +#include "modular_zzplurt\code\modules\admin\playtimes.dm" #include "modular_zzplurt\code\modules\admin\transform.dm" +#include "modular_zzplurt\code\modules\atmospherics\machinery\portable\canister.dm" #include "modular_zzplurt\code\modules\client\client_procs.dm" #include "modular_zzplurt\code\modules\client\preferences\player_panel.dm" -#include "modular_zzplurt\code\modules\admin\playtimes.dm" -#include "modular_zzplurt\code\modules\atmospherics\machinery\portable\canister.dm" #include "modular_zzplurt\code\modules\client\verbs\looc.dm" #include "modular_zzplurt\code\modules\client\verbs\ooc.dm" #include "modular_zzplurt\code\modules\discord\tgs_commands.dm" #include "modular_zzplurt\code\modules\discord\verbs.dm" +#include "modular_zzplurt\code\modules\mob\mob.dm" +#include "modular_zzplurt\code\modules\mob\mob_defines.dm" #include "modular_zzplurt\code\modules\mob\dead\new_player\new_player.dm" #include "modular_zzplurt\code\modules\mob\living\living.dm" #include "modular_zzplurt\code\modules\mob\living\living_defines.dm" -#include "modular_zzplurt\code\modules\mob\mob.dm" -#include "modular_zzplurt\code\modules\mob\mob_defines.dm" #include "modular_zzplurt\code\modules\reagents\chemistry\machinery\chem_dispenser.dm" #include "modular_zzplurt\code\modules\wiremod\core\integrated_circuit.dm" // END_INCLUDE