From a75ae3492c1d99996ddacab375ac9de3114be886 Mon Sep 17 00:00:00 2001 From: michael Date: Sun, 4 Oct 2026 08:49:20 -0400 Subject: [PATCH] =?UTF-8?q?feat:=20server-side=20rpc=5Frequest=5Fset=5Fsma?= =?UTF-8?q?rt=5Ftag=20shadow=20=E2=80=94=20flip=20testify=20around=20the?= =?UTF-8?q?=20request=20handler=20so=20client=20auto-mark=20requests=20sto?= =?UTF-8?q?p=20dying=20in=20the=20server's=20aim-cone/LOS=20re-check=20at?= =?UTF-8?q?=20packet=20arrival=20(OMNI-CONFIRM=20measured=2034%=20silent?= =?UTF-8?q?=20rejects,=20heaviest=20on=20ranged=20breeds);=20armed=20from?= =?UTF-8?q?=20SmartTagSystem:update=20hook=5Fsafe=20so=20it=20installs=20i?= =?UTF-8?q?n=20the=20server=20state=20too=20(client=20ticks=20never=20run?= =?UTF-8?q?=20there);=20OMNI-BOOT=20probe=20proves=20whether/where=20mod?= =?UTF-8?q?=20code=20executes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mods/AutoMark/mark/servo_skull_mark.lua | 54 ++++++++++++++++++- 1 file changed, 53 insertions(+), 1 deletion(-) diff --git a/AutoMark/scripts/mods/AutoMark/mark/servo_skull_mark.lua b/AutoMark/scripts/mods/AutoMark/mark/servo_skull_mark.lua index ea63276..752853a 100644 --- a/AutoMark/scripts/mods/AutoMark/mark/servo_skull_mark.lua +++ b/AutoMark/scripts/mods/AutoMark/mark/servo_skull_mark.lua @@ -36,7 +36,48 @@ local CANCEL_INTERVAL = 0.5 -- (_generate_tag_id -> _create_tag_locally -> group limit -> rpc to clients) minus the gate. local function ensure_automark_tag_hook() local smart_tag_system = context.smart_tag_system - if not smart_tag_system or mod.omni_hack_patched_sys == smart_tag_system then + if not smart_tag_system then + return + end + if smart_tag_system._is_server then + if mod.omni_rpc_patched_sys == smart_tag_system then + return + end + local orig_rpc = smart_tag_system.rpc_request_set_smart_tag + if type(orig_rpc) ~= "function" then + return + end + -- SERVER STATE: clients' mark requests land here and die in _tagger_is_looking_at_target + -- (OMNI-CONFIRM measured 34% of outgoing auto-mark requests silently rejected: the server + -- re-checks aim cone + LOS at packet-arrival time, by which time the player has turned). + -- Rawset-shadow the handler on this instance and flip GameParameters.testify around the + -- synchronous original call so the look-check short-circuits; everything else in the + -- handler (templates, group limits, start(), rpc broadcast, telemetry) runs untouched. + -- Other testify consumers (dialogue, backend, talent, triggers) do not execute inside + -- this synchronous window. + local patched_rpc = function(self, channel_id, template_name_id, ...) + if mod_settings.debug_mode and not mod.omni_rpc_shadow_fired then + mod.omni_rpc_shadow_fired = true + mod:diag("OMNI-RPC-SHADOW FIRE (server-side testify window)") + end + local target_game_object_id, target_level_index, target_location = ... + local saved_testify = GameParameters.testify + GameParameters.testify = true + local ok = pcall(function() + orig_rpc(self, channel_id, template_name_id, target_game_object_id, target_level_index, target_location) + end) + GameParameters.testify = saved_testify + if not ok and mod_settings.debug_mode and not mod.omni_rpc_shadow_err_logged then + mod.omni_rpc_shadow_err_logged = true + mod:diag("OMNI-RPC-SHADOW orig handler threw") + end + end + rawset(smart_tag_system, "rpc_request_set_smart_tag", patched_rpc) + mod.omni_rpc_patched_sys = smart_tag_system + mod:diag("OMNI-RPC-SHADOW INSTALLED on server-state system") + return + end + if mod.omni_hack_patched_sys == smart_tag_system then return end local orig_set_tag = smart_tag_system.set_tag @@ -97,6 +138,17 @@ local function ensure_automark_tag_hook() end mod.ensure_automark_tag_hook = ensure_automark_tag_hook +-- the server-side state never runs our auto_hack/mark ticks (no local player), so arm the +-- rpc-handler shadow from the tag system's own per-frame update, which runs in every state. +mod:hook_safe(CLASS.SmartTagSystem, "update", + function(self, ...) + if not mod.omni_update_hook_seen then + mod.omni_update_hook_seen = true + mod:diag("OMNI-BOOT smart_tag_system:update seen, is_server=", tostring(self._is_server), " ctx_same=", tostring(self == context.smart_tag_system)) + end + ensure_automark_tag_hook() + end) + local function servo_skull_mark_callback() local smart_tag_system = context.smart_tag_system if not smart_tag_system then