Hook AcesApp's local MPI proxy dispatch to drop enemy-part-damage messages (0xf104 / 0xf118, captured dynamically) whose recipient_pid does not belong to the local player or watched hero, preventing AI-vs-AI aircraft damage from leaking into the local kill feed. Remove the mistaken !is_kill gate in hook_dispatch_hit_crit: the 5th argument from Unit::flushOffenderHitAward is a repeat-flush flag rather than a kill flag, which dropped follow-up aircraft hits because fixed-wing units flush exclusively through the timer path. Add a same-team guard to match the severe-damage hook. Verified: MSVC build.ps1 (0 warnings in project code), check-patches (14/14) and 12/12 native module resolution on 2.61.0.37 and 2.61.0.58. Pending in-game acceptance.
96 lines
5.4 KiB
C
96 lines
5.4 KiB
C
/*
|
|
* What the LocalMP modules need from aces.exe, as resolved by the build (patches/native/*.jsonc,
|
|
* @wto/patcher native-resolve.ts) and handed over in wto_ws.cfg. Nothing here is a constant of a
|
|
* game build: functions and globals are absolute addresses in this process, structure offsets are
|
|
* what the definitions captured from the code.
|
|
*
|
|
* lmp_values_load(module) fills the fields of one module (local_mp_values.c); a module whose values
|
|
* are not all present is left off. The build only writes the values of modules that resolved
|
|
* completely together with the modules they require.
|
|
*/
|
|
#pragma once
|
|
|
|
#include <stddef.h>
|
|
#include <stdint.h>
|
|
|
|
typedef struct LmpValues {
|
|
/* local_mp_core */
|
|
uint8_t *do_respawn_player, *get_player_country, *refl_dtor, *aircraft_change_result, *set_player_gui_state;
|
|
uint8_t *get_unit_by_eid, *set_owning_mplayer, *iground_on_dead, *datablock_get_str, *datablock_set_from;
|
|
uint8_t *mp_construct_local, *gui_state_update, *unit_change_aircraft, *dagmem_alloc, *unit_on_event;
|
|
uint8_t *multiplayer, *app, *local_mplayer, *hero, *mission_settings, *stdmem, *player_count, *player_table;
|
|
size_t mp_is_host, mp_is_local_mp, mp_chat_host, mp_pid, mp_user_id, mp_team, mp_broken_slots, mp_unit_eid;
|
|
size_t match_team, app_score_rules, app_econ_holder, econ_state, econ_change_req;
|
|
size_t unit_type, unit_mplayer, unit_info, unit_info_name, mis_custom_bots;
|
|
|
|
/* local_mp_players */
|
|
uint8_t *mplayer_init_matching, *is_slot_ready_at_host;
|
|
size_t mp_gui_state, mp_used_spares, mis_allies_country, mis_axis_country, mis_arcade_country;
|
|
|
|
/* local_mp_loadout */
|
|
uint8_t *sem_change_aircraft_send, *refl_ctor, *datablock_dtor, *bullet_vec_assign, *get_decals_blk;
|
|
uint8_t *get_attachables_blk, *str_hash_fnv1, *namemap_add_name_id;
|
|
size_t refl_bullets, refl_disabled_mods, refl_enabled_mods, refl_custom_preset, refl_attachables, refl_decals;
|
|
size_t refl_custom_skin, refl_skin, refl_weapon, refl_unit, refl_flags, refl_gun_convergence;
|
|
size_t refl_vertical_targeting, refl_bomb_fuse, refl_fuel;
|
|
size_t mp_resp_base_id, mp_spawn_delay_a, mp_spawn_delay_b, mp_spawn_pos_x, mp_spawn_pos_y, mp_spawn_pos_z;
|
|
/* Change request members: captured as offsets in the economic state, used relative to the request. */
|
|
size_t econ_req_slot_id, econ_req_bullets_begin, econ_req_bullets_end;
|
|
size_t req_slot_id, req_bullets_begin, req_bullets_end;
|
|
|
|
/* local_mp_actions */
|
|
uint8_t *mp_init_chat;
|
|
size_t mp_chat, mp_team1_countries, mp_team2_countries;
|
|
|
|
/* local_mp_awards */
|
|
uint8_t *blk_ctor, *blk_set_str, *blk_to_owned, *blk_set_int, *hud_notify_script, *blk_dtor, *game_save_data;
|
|
size_t gsd_hud_queue, unit_info_exp_class;
|
|
|
|
/* local_mp_scores */
|
|
uint8_t *datablock_get_real;
|
|
size_t mis_custom_score_params;
|
|
|
|
/* local_mp_kills */
|
|
uint8_t *mplayer_add_score, *net_mark_dirty, *on_unit_dead_once, *iground_award_assists;
|
|
size_t mp_score, mp_stat_dirty, mp_stat_payload, unit_skip_kill, unit_severe_idx, unit_severe_uid, unit_severe_pid;
|
|
size_t igm_already_dead, igm_dead_silent, igm_bailout_dead, igm_offenders_count, igm_offenders, offender_size;
|
|
size_t igm_killer, igm_killer_uid, igm_killer_pid, igm_killer_army, unit_vtf_choose_offender;
|
|
size_t unit_army, offender_army, offender_uid, offender_pid;
|
|
size_t mp_kills, mp_ground_kills, mp_human_kills, mp_naval_kills, mp_team_kills, mp_ai_kills;
|
|
size_t mp_ai_ground_kills, mp_ai_naval_kills, mp_assists, mp_deaths, mp_capture_zone, mp_fallback_score;
|
|
size_t mp_award_damage, mp_air_severe_dmg, mp_ship_severe_dmg;
|
|
|
|
/* local_mp_events */
|
|
uint8_t *dispatch_assist, *dispatch_capture_zone, *dispatch_hit_crit, *dispatch_severe_damage, *dispatch_naval_damage;
|
|
size_t offender_assist_sent;
|
|
|
|
/* local_mp_nuke */
|
|
uint8_t *shell_launch, *shell_explode, *cta_logic_action;
|
|
size_t shell_launch_record, shell_rec_instant_win, mission_vars_data, mission_vars_count, mission_var_stride;
|
|
ptrdiff_t mission_var_bias, mission_var_name_disp, mission_var_value_disp;
|
|
size_t mission_var_name, mission_var_value;
|
|
|
|
/* local_mp_support */
|
|
uint8_t *set_controlled_unit;
|
|
size_t mp_support_unit_eid, mp_support_unit_ptr;
|
|
|
|
/* local_mp_damage_notifications */
|
|
uint8_t *barrel_damage, *breech_fire_update, *barrel_notice_deliver, *breech_notice_deliver, *mplayer_controlled_unit;
|
|
uint8_t *hud_damage_deliver, *avionics_damage, *avionics_exit_optic;
|
|
uint8_t *watched_hero, *enqueue_enemy_parts, *hit_cam_important, *naval_hit_state, *local_mpi_dispatch;
|
|
size_t barrel_unit_ref, breech_unit, barrel_notice_id, breech_notice_id, avionics_unit, hit_event_offender;
|
|
size_t mpi_msg_id_off, enemy_part_dmg_mpi_id, enemy_part_hit_mpi_id;
|
|
|
|
/* local_mp_air_events */
|
|
uint8_t *prepare_local_mission, *use_kill_streaks, *gameplay, *kill_streak_name_map, *add_kill_streak_points;
|
|
uint8_t *air_event_battle_center, *mission_max_rank, *air_event_terrain_height, *air_event_switch_unit;
|
|
uint8_t *air_event_orientation, *send_unit_respawn, *mpi_sendto;
|
|
size_t mis_mode_name, gp_ks_rules, gp_ks_rule_count, ks_rule_tag, ks_rule_air_ai_mult, ks_rule_ground_ai_mult;
|
|
size_t ks_rule_spawn_pos, ks_rule_spawn_pos_count, ks_spawn_pos_stride, mp_ks_progress, app_terrain;
|
|
} LmpValues;
|
|
|
|
extern LmpValues g_lmp;
|
|
|
|
/* Fill the values of `module` ("local_mp_core", ...); returns 0 and logs the first missing one. */
|
|
int lmp_values_load(const char *module);
|