Files
WT-Offline/native/wto-net/src/local_mp_values.h
T
N0VAN0M4LY 264c5c59b8 fix(hud): filter ground part feedback by player
Check the intended recipient of ground part damage messages in the LocalMP proxy. Keep the firing player's slot available when the ground model sends damage feedback directly to the HUD.

Verified both TypeScript projects, the native DLL build, executable patch checks on .37, .60, and .64, and native patch resolution on .37, .58, .60, and .64. Built .37 and .64 copies and checked local service health on .64. In-game verification is pending.
2026-12-05 22:37:50 +08:00

118 lines
6.3 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_hit, *dispatch_severe_damage, *dispatch_naval_damage;
size_t offender_assist_sent;
/* local_mp_captures */
uint8_t *capture_cta_logic, *capture_set_owner, *capture_complete_call, *capture_complete_set_owner;
uint8_t *capture_team_power, *capture_unit_power;
size_t capture_owner;
/* 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, *respawn_spectator_active;
uint8_t *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_ground_part_feedback */
uint8_t *apply_part_damage, *show_ground_part_damage;
size_t ground_part_damage_source_pid, ground_part_damage_mpi_id;
/* local_mp_hit_feedback */
uint8_t *hit_mark_send, *hit_shell_hint_call, *hit_shell_hint_notify;
/* local_mp_zones */
uint8_t *apply_zone_damage;
size_t zone_health, zone_max_health, zone_team, zone_flags, zone_airfield_mask;
/* 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;
/* local_mp_ground_ai */
uint8_t *ground_ai_mission_action, *ground_ai_as_ground_model, *ground_ai_drive_to_pos_update;
size_t ground_ai_move_system, ground_ai_move_inactive;
/* local_mp_air_ai_sync */
uint8_t *air_ai_add_unsorted_plane;
} 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);