From 89a14a82f0bebc79bb4e1658a9e403714f7dab4a Mon Sep 17 00:00:00 2001 From: kevinz000 <2003111+kevinz000@users.noreply.github.com> Date: Wed, 20 May 2020 07:46:58 -0700 Subject: [PATCH] ok --- code/__HELPERS/_logging.dm | 5 ++++- code/_globalvars/logging.dm | 2 ++ code/game/world.dm | 2 ++ code/modules/client/client_procs.dm | 8 +++++++- code/modules/client/preferences.dm | 1 + 5 files changed, 16 insertions(+), 2 deletions(-) diff --git a/code/__HELPERS/_logging.dm b/code/__HELPERS/_logging.dm index 8ef924eea4..343c00f1e6 100644 --- a/code/__HELPERS/_logging.dm +++ b/code/__HELPERS/_logging.dm @@ -152,6 +152,9 @@ /proc/log_subsystem(subsystem, text) WRITE_LOG(GLOB.subsystem_log, "[subsystem]: [text]") +/proc/log_click(object, location, control, params, client/C, event = "clicked") + WRITE_LOG(GLOB.click_log, "CLICK: [C.ckey] - [event] : [object] | [location] | [control] | [params]") + /* Log to both DD and the logfile. */ /proc/log_world(text) #ifdef USE_CUSTOM_ERROR_HANDLER @@ -181,7 +184,7 @@ /proc/start_log(log) WRITE_LOG(log, "Starting up round ID [GLOB.round_id].\n-------------------------") -/* ui logging */ +/* ui logging */ /proc/log_tgui(text) WRITE_LOG(GLOB.tgui_log, text) diff --git a/code/_globalvars/logging.dm b/code/_globalvars/logging.dm index ba75fbfc9c..65fd772dfe 100644 --- a/code/_globalvars/logging.dm +++ b/code/_globalvars/logging.dm @@ -36,6 +36,8 @@ GLOBAL_VAR(reagent_log) GLOBAL_PROTECT(reagent_log) GLOBAL_VAR(world_crafting_log) GLOBAL_PROTECT(world_crafting_log) +GLOBAL_VAR(click_log) +GLOBAL_PROTECT(click_log) GLOBAL_LIST_EMPTY(bombers) GLOBAL_PROTECT(bombers) diff --git a/code/game/world.dm b/code/game/world.dm index 10431e4af9..2423cb263c 100644 --- a/code/game/world.dm +++ b/code/game/world.dm @@ -125,6 +125,7 @@ GLOBAL_LIST(topic_status_cache) GLOB.subsystem_log = "[GLOB.log_directory]/subsystem.log" GLOB.reagent_log = "[GLOB.log_directory]/reagents.log" GLOB.world_crafting_log = "[GLOB.log_directory]/crafting.log" + GLOb.click_log = "[GLOB.log_directory]/click.log" #ifdef UNIT_TESTS @@ -144,6 +145,7 @@ GLOBAL_LIST(topic_status_cache) start_log(GLOB.subsystem_log) start_log(GLOB.reagent_log) start_log(GLOB.world_crafting_log) + start_log(GLOB.click_log) GLOB.changelog_hash = md5('html/changelog.html') //for telling if the changelog has changed recently if(fexists(GLOB.config_error_log)) diff --git a/code/modules/client/client_procs.dm b/code/modules/client/client_procs.dm index ab1db47db6..7ebdf77f44 100644 --- a/code/modules/client/client_procs.dm +++ b/code/modules/client/client_procs.dm @@ -789,7 +789,9 @@ GLOBAL_LIST_EMPTY(external_rsc_urls) log_game("[key_name(src)] is using the middle click aimbot exploit") message_admins("[ADMIN_LOOKUPFLW(src)] [ADMIN_KICK(usr)] is using the middle click aimbot exploit") add_system_note("aimbot", "Is using the middle click aimbot exploit") - + log_click(object, location, control, params, src, "lockout (spam - minute ab c [ab] s [middragtime])") + else + log_click(object, location, control, params, src, "lockout (spam - minute)") log_game("[key_name(src)] Has hit the per-minute click limit of [mcl] clicks in a given game minute") message_admins("[ADMIN_LOOKUPFLW(src)] [ADMIN_KICK(usr)] Has hit the per-minute click limit of [mcl] clicks in a given game minute") to_chat(src, "[msg]") @@ -809,8 +811,12 @@ GLOBAL_LIST_EMPTY(external_rsc_urls) return if(ab) //Citadel edit, things with stuff. + log_click(object, location, control, params, src, "dropped (ab c [ab] s [middragtime])") return + if(prefs.log_clicks) + log_click(object, location, control, params, src) + if (prefs.hotkeys) // If hotkey mode is enabled, then clicking the map will automatically // unfocus the text bar. This removes the red color from the text bar diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index 4ffe7f2ea4..fe976129b8 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -20,6 +20,7 @@ GLOBAL_LIST_EMPTY(preferences_datums) var/muted = 0 var/last_ip var/last_id + var/log_clicks = FALSE var/icon/custom_holoform_icon var/list/cached_holoform_icons