fix(battle): restore LocalMP Ground Arcade air events
Copy allowedKillStreaks and set useKillStreaks for Ground Arcade in battle-mission-settings.ts, and add a dedicated dynamic native module (local_mp_air_events) that preserves MissionSettings.useKillStreaks across prepare_local_mission, credits local player AI kills toward native killstreak counters, delivers UnitRespawn (0xf030) to the LocalMP host via shared unit_on_event, and recovers invalid surface poses from gameplay.blk spawnPos parameters for the match rank. Based on PR #3 by Rivfflot, who diagnosed the LocalMP Ground Arcade air-event gaps and verified the fix in-game; refactored here onto patches/native dynamic resolution for cross-version and MSVC build compatibility. Checked: root and launcher typecheck, MSVC native/wto-net/build.ps1, native resolution across 2.61.0.37 and 2.61.0.58 (12/12 modules), 2.61.0.58 check-patches (14/14), and temporary 2.61.0.58 copy build all passed. Pending in-game acceptance on the refactored module. Co-authored-by: Alem Bek <[email protected]>
This commit is contained in:
1 parent
4999c7f5a3
commit
e8122d7c6b
12 files changed
+743
-20
No files matched your search
@@ -7,7 +7,7 @@
|
||||
* copied here from the mission file, base values first and then the sub-block for the battle's
|
||||
* difficulty. `_gameMode` is left to the client, which takes it from its own native constants.
|
||||
*/
|
||||
import { emptyBlock, ensureBlock, setParam, appendParam, type BlkBlock, type BlkParam, type BlkValue } from '@wto/blk';
|
||||
import { emptyBlock, ensureBlock, findParam, setParam, appendParam, type BlkBlock, type BlkParam, type BlkValue } from '@wto/blk';
|
||||
import { UNLIMITED_RESPAWNS } from '../game-modes/mode-definition.ts';
|
||||
import type { ExtraBattleSlot } from './battle-extra-slots.ts';
|
||||
import type { BattleLaunchPlan } from './battle-matchmaker.ts';
|
||||
@@ -23,6 +23,7 @@ const RULE_KEYS: readonly string[] = [
|
||||
'scoreLimit', 'timeLimit', 'killLimit', 'deathPenaltyMul',
|
||||
'ctaCaptureZoneEqualPenaltyMul', 'ctaCaptureZonePenaltyMul', 'captureZonePenaltyMul', 'scorePerSec',
|
||||
'ctaInstantDecreaseTicketsWhenNoRespawn', 'randomSpawnTeams', 'remapAiTankModels', 'useAlternativeMapCoord',
|
||||
'allowedKillStreaks',
|
||||
];
|
||||
|
||||
/** Game type switches of a versus battle with tickets, capture zones and session rewards. */
|
||||
@@ -39,6 +40,13 @@ const VERSUS_SWITCHES: readonly string[] = [
|
||||
export function battleMissionSettings(plan: BattleLaunchPlan, scores: Readonly<Record<string, number>>): BlkBlock {
|
||||
const settings = emptyBlock();
|
||||
copyMissionParams(settings, plan);
|
||||
// Enable Ground Arcade air events when the mission allows killstreaks; the LocalMP host preserves
|
||||
// MissionSettings.useKillStreaks across prepare_local_mission (local_mp_air_events.c).
|
||||
const allowedKillStreaks = findParam(settings, 'allowedKillStreaks')?.value;
|
||||
if (plan.modeName === 'tank_event_in_random_battles_arcade'
|
||||
&& allowedKillStreaks?.type === 'bool' && allowedKillStreaks.value) {
|
||||
setParam(settings, 'useKillStreaks', flag(true));
|
||||
}
|
||||
if (plan.level !== undefined) setParam(settings, 'level', text(plan.level));
|
||||
if (plan.environment !== undefined) setParam(settings, 'environment', text(plan.environment));
|
||||
if (plan.weather !== undefined) setParam(settings, 'weather', text(plan.weather));
|
||||
|
||||
@@ -23,7 +23,7 @@ New-Item -ItemType Directory -Force $obj | Out-Null
|
||||
$sources = @(
|
||||
"$src\dll_main.c", "$src\hook_config.c", "$src\redirect_rules.c", "$src\resolver_hooks.c", "$src\connection_hooks.c",
|
||||
"$src\local_mp_core.c", "$src\local_mp_values.c", "$src\local_mp_players.c", "$src\local_mp_loadout.c", "$src\local_mp_actions.c", "$src\local_mp_awards.c", "$src\local_mp_kills.c", "$src\local_mp_events.c", "$src\local_mp_scores.c", "$src\local_mp_nuke.c", "$src\local_mp_support.c",
|
||||
"$src\local_mp_damage_notifications.c",
|
||||
"$src\local_mp_damage_notifications.c", "$src\local_mp_air_events.c",
|
||||
"$mh\src\hook.c", "$mh\src\buffer.c", "$mh\src\trampoline.c", "$mh\src\hde\hde64.c"
|
||||
) | ForEach-Object { '"' + (Resolve-Path $_) + '"' }
|
||||
|
||||
|
||||
@@ -0,0 +1,323 @@
|
||||
/*
|
||||
* Ground Arcade air events (fighter/attacker/bomber killstreaks) on a LocalMP host.
|
||||
*
|
||||
* Four gaps keep stock Ground Arcade air events from running in LocalMP:
|
||||
* 1. prepare_local_mission clears MissionSettings.useKillStreaks during LocalMP setup.
|
||||
* 2. Local AI kills go through local_mp_kills.c and do not advance native killstreak counters.
|
||||
* 3. BombingKillStreakEvent::switchPlayerUnit spawns the aircraft only by broadcasting
|
||||
* UnitRespawn (0xf030) through mpi::sendto, which has no local receiver on a LocalMP host.
|
||||
* 4. If a LocalMP air-event respawn ever supplies a ground-level pose, we rebuild an airborne
|
||||
* approach using the stock gameplay.blk spawnPos parameters for the match rank.
|
||||
*/
|
||||
#include "hooks.h"
|
||||
#include "hook_config.h"
|
||||
#include "local_mp_internal.h"
|
||||
#include "local_mp_offsets.h"
|
||||
#include "local_mp_values.h"
|
||||
|
||||
#include <windows.h>
|
||||
#include <math.h>
|
||||
#include <stddef.h>
|
||||
#include <string.h>
|
||||
|
||||
typedef struct LocalMpAirSpawn {
|
||||
double position[3];
|
||||
float orientation[4];
|
||||
float velocity[3];
|
||||
uint8_t options[0x14];
|
||||
} LocalMpAirSpawn;
|
||||
|
||||
C_ASSERT(offsetof(LocalMpAirSpawn, orientation) == 0x18);
|
||||
C_ASSERT(offsetof(LocalMpAirSpawn, velocity) == 0x28);
|
||||
C_ASSERT(sizeof(LocalMpAirSpawn) == 0x48);
|
||||
|
||||
typedef void (__fastcall *PrepareLocalMissionFn)(void *mission);
|
||||
typedef void (__fastcall *AddKillStreakPointsFn)(uint8_t *player, uint32_t rule, int32_t points, int32_t related_rule);
|
||||
typedef void (__fastcall *SwitchPlayerUnitFn)(void *event_mgr, void *participant, uint8_t to_air);
|
||||
typedef void (__fastcall *SendUnitRespawnFn)(uint8_t *unit, const LocalMpAirSpawn *spawn);
|
||||
typedef void (__fastcall *MpiSendToFn)(void *message, uint8_t recipient);
|
||||
typedef uint64_t (__fastcall *UnitOnEventFn)(void *unit, const void *event, void *arg3, void *arg4);
|
||||
typedef void (__fastcall *GetBattleCenterFn)(float center[2]);
|
||||
typedef uint8_t (__fastcall *GetTerrainHeightFn)(const void *terrain, float x, float z, float *height,
|
||||
void *normal, void *material);
|
||||
typedef void (__fastcall *GetOrientationFn)(float quaternion[4], const float transform[12]);
|
||||
|
||||
static PrepareLocalMissionFn orig_prepare_local_mission;
|
||||
static SwitchPlayerUnitFn orig_switch_player_unit;
|
||||
static SendUnitRespawnFn orig_send_unit_respawn;
|
||||
static MpiSendToFn orig_mpi_sendto;
|
||||
|
||||
static __declspec(thread) int g_in_air_event_switch;
|
||||
static __declspec(thread) uint8_t *g_respawn_unit;
|
||||
static int g_air_events_active;
|
||||
static int g_credit_log_count;
|
||||
|
||||
enum { AIR_EVENT_CREDIT_LOG_LIMIT = 12 };
|
||||
|
||||
static int ground_arcade_air_events_enabled(void)
|
||||
{
|
||||
const uint8_t *settings = g_local_mp_mission_settings;
|
||||
const char *mode;
|
||||
|
||||
if (!g_air_events_active || settings == NULL || !local_mp_is_host())
|
||||
return 0;
|
||||
if (*g_lmp.use_kill_streaks != 1)
|
||||
return 0;
|
||||
mode = *(const char *const *)(settings + LMP_MIS_OFF_MODE_NAME);
|
||||
return mode != NULL && strcmp(mode, "tank_event_in_random_battles_arcade") == 0;
|
||||
}
|
||||
|
||||
/* Resolve a killstreak tag id through Dagor's FastNameMap string table layout. */
|
||||
static const char *kill_streak_rule_tag(uint32_t id)
|
||||
{
|
||||
const uint8_t *nm = g_lmp.kill_streak_name_map;
|
||||
const uint64_t *entries;
|
||||
uint32_t count, packed, page, page_count;
|
||||
unsigned shift;
|
||||
const uint8_t *pages, *page_slot;
|
||||
const char *strings;
|
||||
|
||||
if (nm == NULL)
|
||||
return NULL;
|
||||
entries = *(const uint64_t *const *)(nm + LMP_NAMEMAP_OFF_ENTRIES);
|
||||
count = *(const uint32_t *)(nm + LMP_NAMEMAP_OFF_COUNT);
|
||||
shift = nm[LMP_NAMEMAP_OFF_SHIFT];
|
||||
if (entries == NULL || id >= count || shift >= 32u)
|
||||
return NULL;
|
||||
packed = (uint32_t)entries[id];
|
||||
page = packed >> shift;
|
||||
page_count = *(const uint32_t *)(nm + LMP_NAMEMAP_OFF_PAGE_COUNT);
|
||||
pages = *(const uint8_t *const *)(nm + LMP_NAMEMAP_OFF_PAGES);
|
||||
if (page == page_count)
|
||||
page_slot = nm + LMP_NAMEMAP_OFF_TAIL_PAGE;
|
||||
else if (page < page_count && pages != NULL)
|
||||
page_slot = pages + (size_t)page * 16u;
|
||||
else
|
||||
return NULL;
|
||||
strings = *(const char *const *)page_slot;
|
||||
return strings != NULL ? strings + (packed & ((1u << shift) - 1u)) : NULL;
|
||||
}
|
||||
|
||||
static int is_air_event_tag(const char *tag)
|
||||
{
|
||||
return tag != NULL && (strcmp(tag, "fighter") == 0 || strcmp(tag, "attacker") == 0 || strcmp(tag, "bomber") == 0);
|
||||
}
|
||||
|
||||
static float surface_height(const void *terrain, float x, float z)
|
||||
{
|
||||
float height = 0.0f;
|
||||
GetTerrainHeightFn query = (GetTerrainHeightFn)g_lmp.air_event_terrain_height;
|
||||
|
||||
if (query != NULL && query(terrain, x, z, &height, NULL, NULL) && isfinite(height) && height > 0.0f)
|
||||
return height;
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
/* Read stock spawn distance, altitude and speed from gameplay.blk's spawnPos table for this rank. */
|
||||
static int lookup_stock_spawn_params(float *out_dist, float *out_alt, float *out_speed_mps)
|
||||
{
|
||||
const uint8_t *gameplay = g_lmp.gameplay ? *(const uint8_t *const *)g_lmp.gameplay : NULL;
|
||||
const uint8_t *rules;
|
||||
uint32_t rule_count, i;
|
||||
int32_t rank;
|
||||
|
||||
if (gameplay == NULL || g_lmp.mission_max_rank == NULL || LMP_KS_SPAWN_POS_STRIDE < 0x50u)
|
||||
return 0;
|
||||
rules = *(const uint8_t *const *)(gameplay + LMP_GP_OFF_KS_RULES);
|
||||
rule_count = *(const uint32_t *)(gameplay + LMP_GP_OFF_KS_RULE_COUNT);
|
||||
rank = *(const int32_t *)g_lmp.mission_max_rank;
|
||||
if (rules == NULL || rule_count > 256u)
|
||||
return 0;
|
||||
for (i = 0; i < rule_count; i++) {
|
||||
const uint8_t *rule = rules + (size_t)i * LMP_KS_RULE_STRIDE;
|
||||
const char *tag = kill_streak_rule_tag(*(const uint32_t *)(rule + LMP_KS_RULE_OFF_TAG));
|
||||
const uint8_t *table;
|
||||
uint32_t count, j;
|
||||
|
||||
if (tag == NULL || (strcmp(tag, "attacker") != 0 && strcmp(tag, "bomber") != 0))
|
||||
continue;
|
||||
table = *(const uint8_t *const *)(rule + LMP_KS_RULE_OFF_SPAWN_POS);
|
||||
count = *(const uint32_t *)(rule + LMP_KS_RULE_OFF_SPAWN_POS_CNT);
|
||||
if (table == NULL || count > 64u)
|
||||
continue;
|
||||
for (j = 0; j < count; j++) {
|
||||
const uint8_t *row = table + (size_t)j * LMP_KS_SPAWN_POS_STRIDE;
|
||||
int32_t min_r = *(const int32_t *)(row + LMP_KS_SP_OFF_MIN_RANK);
|
||||
int32_t max_r = *(const int32_t *)(row + LMP_KS_SP_OFF_MAX_RANK);
|
||||
if (rank >= min_r && rank <= max_r) {
|
||||
float dist = *(const float *)(row + LMP_KS_SP_OFF_INIT_DIST);
|
||||
float alt = *(const float *)(row + LMP_KS_SP_OFF_INIT_ALT);
|
||||
float kmh = *(const float *)(row + LMP_KS_SP_OFF_INIT_SPEED_KMH);
|
||||
if (isfinite(dist) && dist > 100.0f && isfinite(alt) && alt > 100.0f && isfinite(kmh) && kmh > 50.0f) {
|
||||
*out_dist = dist;
|
||||
*out_alt = alt;
|
||||
*out_speed_mps = kmh / 3.6f;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Rebuild an airborne pose from stock gameplay.blk spawnPos only when LocalMP supplied a surface pose. */
|
||||
static int repair_air_spawn_if_invalid(LocalMpAirSpawn *spawn)
|
||||
{
|
||||
const uint8_t *app = g_local_mp_app ? *g_local_mp_app : NULL;
|
||||
const void *terrain = app ? *(const void *const *)(app + LMP_APP_OFF_TERRAIN) : NULL;
|
||||
float x = (float)spawn->position[0], y = (float)spawn->position[1], z = (float)spawn->position[2];
|
||||
float dx = spawn->velocity[0], dz = spawn->velocity[2];
|
||||
float speed = sqrtf(dx * dx + dz * dz);
|
||||
int valid_speed = isfinite(speed) && speed >= 25.0f;
|
||||
float center[2], approach, alt, stock_speed, highest = 0.0f;
|
||||
float transform[12];
|
||||
unsigned i;
|
||||
|
||||
if (terrain == NULL || *(const void *const *)(app + LMP_APP_OFF_SCORE_RULES) == NULL)
|
||||
return 0;
|
||||
if (valid_speed && fabsf(x) < 1e7f && fabsf(z) < 1e7f && isfinite(y) &&
|
||||
y >= surface_height(terrain, x, z) + 100.0f)
|
||||
return 0;
|
||||
if (!lookup_stock_spawn_params(&approach, &alt, &stock_speed))
|
||||
return 0;
|
||||
((GetBattleCenterFn)g_lmp.air_event_battle_center)(center);
|
||||
if (!isfinite(center[0]) || !isfinite(center[1]))
|
||||
return 0;
|
||||
|
||||
dx = valid_speed ? dx / speed : 1.0f;
|
||||
dz = valid_speed ? dz / speed : 0.0f;
|
||||
for (i = 0; i <= 14u; i++) {
|
||||
float d = approach * (float)i / 14.0f;
|
||||
float h = surface_height(terrain, center[0] - dx * d, center[1] - dz * d);
|
||||
if (h > highest)
|
||||
highest = h;
|
||||
}
|
||||
x = center[0] - dx * approach;
|
||||
y = highest + alt;
|
||||
z = center[1] - dz * approach;
|
||||
speed = valid_speed ? speed : stock_speed;
|
||||
memset(transform, 0, sizeof(transform));
|
||||
transform[0] = dx; transform[2] = dz; transform[4] = 1.0f;
|
||||
transform[6] = -dz; transform[8] = dx;
|
||||
transform[9] = x; transform[10] = y; transform[11] = z;
|
||||
((GetOrientationFn)g_lmp.air_event_orientation)(spawn->orientation, transform);
|
||||
spawn->position[0] = x;
|
||||
spawn->position[1] = y;
|
||||
spawn->position[2] = z;
|
||||
spawn->velocity[0] = dx * speed;
|
||||
spawn->velocity[1] = 0.0f;
|
||||
spawn->velocity[2] = dz * speed;
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void __fastcall hook_prepare_local_mission(void *mission)
|
||||
{
|
||||
int restore = ground_arcade_air_events_enabled();
|
||||
|
||||
orig_prepare_local_mission(mission);
|
||||
if (restore && local_mp_is_host()) {
|
||||
*g_lmp.use_kill_streaks = 1;
|
||||
log_line("local_mp: preserved MissionSettings.useKillStreaks for Ground Arcade");
|
||||
}
|
||||
}
|
||||
|
||||
static void __fastcall hook_switch_player_unit(void *event_mgr, void *participant, uint8_t to_air)
|
||||
{
|
||||
int previous = g_in_air_event_switch;
|
||||
|
||||
if (to_air != 0 && ground_arcade_air_events_enabled())
|
||||
g_in_air_event_switch = 1;
|
||||
orig_switch_player_unit(event_mgr, participant, to_air);
|
||||
g_in_air_event_switch = previous;
|
||||
}
|
||||
|
||||
static void __fastcall hook_send_unit_respawn(uint8_t *unit, const LocalMpAirSpawn *spawn)
|
||||
{
|
||||
uint8_t *previous;
|
||||
__declspec(align(16)) LocalMpAirSpawn recovered;
|
||||
|
||||
if (!g_in_air_event_switch || unit == NULL || spawn == NULL || !ground_arcade_air_events_enabled()) {
|
||||
orig_send_unit_respawn(unit, spawn);
|
||||
return;
|
||||
}
|
||||
previous = g_respawn_unit;
|
||||
g_respawn_unit = unit;
|
||||
recovered = *spawn;
|
||||
if (repair_air_spawn_if_invalid(&recovered)) {
|
||||
log_line("local_mp: rebuilt Ground Arcade air spawn from (%.1f, %.1f, %.1f) to (%.1f, %.1f, %.1f)",
|
||||
spawn->position[0], spawn->position[1], spawn->position[2],
|
||||
recovered.position[0], recovered.position[1], recovered.position[2]);
|
||||
spawn = &recovered;
|
||||
}
|
||||
orig_send_unit_respawn(unit, spawn);
|
||||
g_respawn_unit = previous;
|
||||
}
|
||||
|
||||
static void __fastcall hook_mpi_sendto(void *message, uint8_t recipient)
|
||||
{
|
||||
uint8_t *unit = g_respawn_unit;
|
||||
const uint8_t *packet = (const uint8_t *)message;
|
||||
|
||||
if (unit == NULL || recipient != 0xffu || packet == NULL ||
|
||||
*(uint8_t *const *)(packet + LMP_MPI_MSG_OFF_OBJ) != unit ||
|
||||
*(const uint16_t *)(packet + LMP_MPI_MSG_OFF_ID) != LMP_MPI_MSG_UNIT_RESPAWN) {
|
||||
orig_mpi_sendto(message, recipient);
|
||||
return;
|
||||
}
|
||||
/* Clear scope while delivering so nested messages follow the normal mpi::sendto path. */
|
||||
g_respawn_unit = NULL;
|
||||
((UnitOnEventFn)g_lmp.unit_on_event)(unit, message, NULL, NULL);
|
||||
g_respawn_unit = unit;
|
||||
}
|
||||
|
||||
void local_mp_credit_air_event_kill(uint8_t *player, int aircraft_victim)
|
||||
{
|
||||
const uint8_t *gameplay, *rules, *progress;
|
||||
uint32_t rule_count, player_rule_count, i;
|
||||
AddKillStreakPointsFn add_points = (AddKillStreakPointsFn)g_lmp.add_kill_streak_points;
|
||||
|
||||
if (add_points == NULL || player == NULL || !ground_arcade_air_events_enabled())
|
||||
return;
|
||||
gameplay = *(const uint8_t *const *)g_lmp.gameplay;
|
||||
progress = *(const uint8_t *const *)(player + LMP_MP_OFF_KS_PROGRESS + LMP_TAB_OFF_DATA);
|
||||
player_rule_count = *(const uint32_t *)(player + LMP_MP_OFF_KS_PROGRESS + LMP_TAB_OFF_COUNT);
|
||||
if (gameplay == NULL || progress == NULL || player_rule_count == 0u)
|
||||
return;
|
||||
rules = *(const uint8_t *const *)(gameplay + LMP_GP_OFF_KS_RULES);
|
||||
rule_count = *(const uint32_t *)(gameplay + LMP_GP_OFF_KS_RULE_COUNT);
|
||||
if (rules == NULL || rule_count > 256u || player_rule_count > rule_count)
|
||||
return;
|
||||
|
||||
for (i = 0; i < player_rule_count; i++) {
|
||||
const uint8_t *rule = rules + (size_t)i * LMP_KS_RULE_STRIDE;
|
||||
const char *tag = kill_streak_rule_tag(*(const uint32_t *)(rule + LMP_KS_RULE_OFF_TAG));
|
||||
int32_t points;
|
||||
|
||||
if (!is_air_event_tag(tag))
|
||||
continue;
|
||||
points = *(const int32_t *)(rule + (aircraft_victim ? LMP_KS_RULE_OFF_AIR_AI_MULT : LMP_KS_RULE_OFF_GROUND_AI_MULT));
|
||||
if (points > 0) {
|
||||
add_points(player, i, points, -1);
|
||||
if (g_credit_log_count < AIR_EVENT_CREDIT_LOG_LIMIT) {
|
||||
++g_credit_log_count;
|
||||
log_line("local_mp: Ground Arcade air event %s +%d (counter %u)", tag, (int)points,
|
||||
(unsigned)progress[(size_t)i * LMP_KS_PROGRESS_STRIDE]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int install_local_mp_air_event_hooks(void)
|
||||
{
|
||||
const LocalMpHookSpec hooks[] = {
|
||||
{ "prepare_local_mission", g_lmp.prepare_local_mission, (void *)&hook_prepare_local_mission, (void **)&orig_prepare_local_mission },
|
||||
{ "air_event_switch_unit", g_lmp.air_event_switch_unit, (void *)&hook_switch_player_unit, (void **)&orig_switch_player_unit },
|
||||
{ "send_unit_respawn", g_lmp.send_unit_respawn, (void *)&hook_send_unit_respawn, (void **)&orig_send_unit_respawn },
|
||||
{ "mpi_sendto", g_lmp.mpi_sendto, (void *)&hook_mpi_sendto, (void **)&orig_mpi_sendto },
|
||||
};
|
||||
|
||||
if (!local_mp_queue_hooks("local_mp_air_events", hooks, sizeof(hooks) / sizeof(hooks[0])))
|
||||
return 0;
|
||||
g_air_events_active = 1;
|
||||
return 1;
|
||||
}
|
||||
@@ -142,6 +142,7 @@ static const LocalMpModule MODULES[] = {
|
||||
{ "local_mp_nuke", install_local_mp_nuke_hooks },
|
||||
{ "local_mp_support", install_local_mp_support_hooks },
|
||||
{ "local_mp_damage_notifications", install_local_mp_damage_notification_hooks },
|
||||
{ "local_mp_air_events", install_local_mp_air_event_hooks },
|
||||
};
|
||||
|
||||
static void use_core_values(void)
|
||||
|
||||
@@ -68,6 +68,7 @@ void local_mp_report_airfield_spawn(const char *unit_name, int32_t base_id);
|
||||
/* A destroyed unit that is some player's mission support unit: its reference is freed once the
|
||||
* player has been given back control (local_mp_support.c). */
|
||||
void local_mp_support_unit_dead(const uint8_t *victim);
|
||||
void local_mp_credit_air_event_kill(uint8_t *player, int aircraft_victim);
|
||||
const char *local_mp_unit_exp_class(const uint8_t *unit);
|
||||
|
||||
/* Mission scores of combat events from the mission settings (local_mp_scores.c). */
|
||||
@@ -104,3 +105,4 @@ int install_local_mp_score_reader(void);
|
||||
int install_local_mp_nuke_hooks(void);
|
||||
int install_local_mp_support_hooks(void);
|
||||
int install_local_mp_damage_notification_hooks(void);
|
||||
int install_local_mp_air_event_hooks(void);
|
||||
@@ -95,6 +95,8 @@ static void record_enemy_kill(uint8_t *killer_mp, uint8_t *victim, int is_pvp)
|
||||
|
||||
if (local_mp_is_local_mplayer(killer_mp)) {
|
||||
LocalMpAwardEvent award = { ev, victim, is_pvp, 0, own_sev ? "from_severe_damage" : NULL, 0 };
|
||||
if (!is_ship && !is_human)
|
||||
local_mp_credit_air_event_kill(killer_mp, is_air);
|
||||
local_mp_report_award_event(&award);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,6 +68,7 @@
|
||||
#define LMP_MP_MGR_OFF_CHAT_HOST (g_lmp.mp_chat_host)
|
||||
|
||||
/* App and the economic state */
|
||||
#define LMP_APP_OFF_TERRAIN (g_lmp.app_terrain)
|
||||
#define LMP_APP_OFF_SCORE_RULES (g_lmp.app_score_rules)
|
||||
#define LMP_APP_OFF_ECON_HOLDER (g_lmp.app_econ_holder)
|
||||
#define LMP_ECON_HOLDER_OFF_STATE (g_lmp.econ_state)
|
||||
@@ -77,6 +78,7 @@
|
||||
#define LMP_REQ_OFF_SLOT_ID (g_lmp.req_slot_id)
|
||||
|
||||
/* MissionSettings and the matching info */
|
||||
#define LMP_MIS_OFF_MODE_NAME (g_lmp.mis_mode_name)
|
||||
#define LMP_MIS_OFF_AXIS_COUNTRY (g_lmp.mis_axis_country)
|
||||
#define LMP_MIS_OFF_ALLIES_COUNTRY (g_lmp.mis_allies_country)
|
||||
#define LMP_MIS_OFF_ARCADE_COUNTRY (g_lmp.mis_arcade_country)
|
||||
@@ -173,3 +175,31 @@
|
||||
|
||||
/* GameSaveData HUD script event queue */
|
||||
#define LMP_GSD_OFF_HUD_QUEUE (g_lmp.gsd_hud_queue)
|
||||
|
||||
/* Ground Arcade air events: DagorEngine library layouts (mpi::Message, FastNameMap) and captured
|
||||
* gameplay/MPlayer killstreak fields (local_mp_air_events.c). */
|
||||
#define LMP_MPI_MSG_OFF_OBJ 0x08u
|
||||
#define LMP_MPI_MSG_OFF_ID 0x20u
|
||||
#define LMP_MPI_MSG_UNIT_RESPAWN 0xf030u
|
||||
#define LMP_NAMEMAP_OFF_ENTRIES 0x00u
|
||||
#define LMP_NAMEMAP_OFF_COUNT 0x08u
|
||||
#define LMP_NAMEMAP_OFF_TAIL_PAGE 0x10u
|
||||
#define LMP_NAMEMAP_OFF_PAGES 0x20u
|
||||
#define LMP_NAMEMAP_OFF_PAGE_COUNT 0x28u
|
||||
#define LMP_NAMEMAP_OFF_SHIFT 0x32u
|
||||
#define LMP_KS_RULE_STRIDE 0x90u
|
||||
#define LMP_KS_PROGRESS_STRIDE 0x10u
|
||||
#define LMP_KS_SP_OFF_MIN_RANK 0x00u
|
||||
#define LMP_KS_SP_OFF_MAX_RANK 0x04u
|
||||
#define LMP_KS_SP_OFF_INIT_DIST 0x08u
|
||||
#define LMP_KS_SP_OFF_INIT_ALT 0x0cu
|
||||
#define LMP_KS_SP_OFF_INIT_SPEED_KMH 0x48u
|
||||
#define LMP_GP_OFF_KS_RULES (g_lmp.gp_ks_rules)
|
||||
#define LMP_GP_OFF_KS_RULE_COUNT (g_lmp.gp_ks_rule_count)
|
||||
#define LMP_KS_RULE_OFF_TAG (g_lmp.ks_rule_tag)
|
||||
#define LMP_KS_RULE_OFF_AIR_AI_MULT (g_lmp.ks_rule_air_ai_mult)
|
||||
#define LMP_KS_RULE_OFF_GROUND_AI_MULT (g_lmp.ks_rule_ground_ai_mult)
|
||||
#define LMP_KS_RULE_OFF_SPAWN_POS (g_lmp.ks_rule_spawn_pos)
|
||||
#define LMP_KS_RULE_OFF_SPAWN_POS_CNT (g_lmp.ks_rule_spawn_pos_count)
|
||||
#define LMP_KS_SPAWN_POS_STRIDE (g_lmp.ks_spawn_pos_stride)
|
||||
#define LMP_MP_OFF_KS_PROGRESS (g_lmp.mp_ks_progress)
|
||||
@@ -40,6 +40,7 @@ typedef struct LmpValueSpec {
|
||||
#define NUKE "local_mp_nuke"
|
||||
#define SUPPORT "local_mp_support"
|
||||
#define DAMAGE_NOTICES "local_mp_damage_notifications"
|
||||
#define AIR_EVENTS "local_mp_air_events"
|
||||
|
||||
static const LmpValueSpec SPECS[] = {
|
||||
A(CORE, "do_respawn_player", do_respawn_player), O(CORE, "do_respawn_player.app_score_rules", app_score_rules),
|
||||
@@ -65,6 +66,7 @@ static const LmpValueSpec SPECS[] = {
|
||||
O(CORE, "unit_info_name.unit_info", unit_info), O(CORE, "unit_info_name.info_name", unit_info_name),
|
||||
O(CORE, "unit_mplayer.unit_mplayer", unit_mplayer), O(CORE, "mission_custom_bots.custom_bots", mis_custom_bots),
|
||||
O(CORE, "mplayer_unit_eid.unit_eid", mp_unit_eid),
|
||||
A(CORE, "unit_on_event", unit_on_event),
|
||||
|
||||
A(PLAYERS, "mplayer_init_matching", mplayer_init_matching), A(PLAYERS, "is_slot_ready_at_host", is_slot_ready_at_host),
|
||||
O(PLAYERS, "mplayer_gui_state.gui_state", mp_gui_state), O(PLAYERS, "mplayer_used_spares.used_spares", mp_used_spares),
|
||||
@@ -151,11 +153,35 @@ static const LmpValueSpec SPECS[] = {
|
||||
A(DAMAGE_NOTICES, "hud_damage_deliver", hud_damage_deliver),
|
||||
A(DAMAGE_NOTICES, "avionics_damage", avionics_damage), O(DAMAGE_NOTICES, "avionics_damage.unit", avionics_unit),
|
||||
A(DAMAGE_NOTICES, "avionics_exit_optic.call", avionics_exit_optic),
|
||||
A(DAMAGE_NOTICES, "unit_on_event", unit_on_event), O(DAMAGE_NOTICES, "hit_event_offender.offender", hit_event_offender),
|
||||
O(DAMAGE_NOTICES, "hit_event_offender.offender", hit_event_offender),
|
||||
A(DAMAGE_NOTICES, "hit_watched_hero.watched_hero", watched_hero),
|
||||
A(DAMAGE_NOTICES, "hit_parts_feedback.enqueue_enemy_parts", enqueue_enemy_parts),
|
||||
A(DAMAGE_NOTICES, "hit_parts_feedback.hit_cam_important", hit_cam_important),
|
||||
A(DAMAGE_NOTICES, "hit_parts_feedback.naval_hit_state", naval_hit_state),
|
||||
|
||||
O(AIR_EVENTS, "mission_mode_name.mode_name", mis_mode_name),
|
||||
A(AIR_EVENTS, "prepare_local_mission", prepare_local_mission),
|
||||
A(AIR_EVENTS, "prepare_local_mission_clear.use_kill_streaks", use_kill_streaks),
|
||||
A(AIR_EVENTS, "kill_streak_rules.gameplay", gameplay),
|
||||
O(AIR_EVENTS, "kill_streak_rules.rule_count", gp_ks_rule_count),
|
||||
O(AIR_EVENTS, "kill_streak_rules.rules", gp_ks_rules),
|
||||
O(AIR_EVENTS, "kill_streak_rules.rule_tag", ks_rule_tag),
|
||||
A(AIR_EVENTS, "kill_streak_rules.name_map", kill_streak_name_map),
|
||||
A(AIR_EVENTS, "add_kill_streak_points", add_kill_streak_points),
|
||||
O(AIR_EVENTS, "mplayer_streak_progress.progress", mp_ks_progress),
|
||||
O(AIR_EVENTS, "kill_streak_ai_mults.air_ai_mult", ks_rule_air_ai_mult),
|
||||
O(AIR_EVENTS, "kill_streak_ai_mults.ground_ai_mult", ks_rule_ground_ai_mult),
|
||||
A(AIR_EVENTS, "air_event_spawn_table.battle_center", air_event_battle_center),
|
||||
O(AIR_EVENTS, "air_event_spawn_table.spawn_pos_count", ks_rule_spawn_pos_count),
|
||||
A(AIR_EVENTS, "air_event_spawn_table.max_rank", mission_max_rank),
|
||||
O(AIR_EVENTS, "air_event_spawn_table.spawn_pos", ks_rule_spawn_pos),
|
||||
O(AIR_EVENTS, "air_event_spawn_table.spawn_pos_stride", ks_spawn_pos_stride),
|
||||
O(AIR_EVENTS, "air_event_terrain.app_terrain", app_terrain),
|
||||
A(AIR_EVENTS, "air_event_terrain.terrain_height", air_event_terrain_height),
|
||||
A(AIR_EVENTS, "air_event_switch_unit", air_event_switch_unit),
|
||||
A(AIR_EVENTS, "air_event_orientation.call", air_event_orientation),
|
||||
A(AIR_EVENTS, "send_unit_respawn", send_unit_respawn),
|
||||
A(AIR_EVENTS, "send_unit_respawn_broadcast.mpi_sendto", mpi_sendto),
|
||||
};
|
||||
|
||||
static void store(const LmpValueSpec *spec, int64_t value, uint8_t *base)
|
||||
|
||||
@@ -17,7 +17,7 @@ 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;
|
||||
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;
|
||||
@@ -77,8 +77,15 @@ typedef struct LmpValues {
|
||||
/* 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 *unit_on_event, *watched_hero, *enqueue_enemy_parts, *hit_cam_important, *naval_hit_state;
|
||||
uint8_t *watched_hero, *enqueue_enemy_parts, *hit_cam_important, *naval_hit_state;
|
||||
size_t barrel_unit_ref, breech_unit, barrel_notice_id, breech_notice_id, avionics_unit, hit_event_offender;
|
||||
|
||||
/* 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;
|
||||
|
||||
@@ -0,0 +1,323 @@
|
||||
// Ground Arcade air events (fighter/attacker/bomber killstreaks) on a LocalMP host
|
||||
// (native/wto-net/src/local_mp_air_events.c).
|
||||
// Why the local server cannot do this alone: LocalMP initialization clears MissionSettings.useKillStreaks,
|
||||
// local AI kill attribution does not advance native killstreak counters, and BombingKillStreakEvent
|
||||
// broadcasts UnitRespawn via mpi::sendto without delivering it to the LocalMP host.
|
||||
// Without it: Ground Arcade air-event action bar slots stay unavailable or spawn without UnitRespawn.
|
||||
{
|
||||
"module": "local_mp_air_events",
|
||||
"features": [
|
||||
"K-Additional vehicles"
|
||||
],
|
||||
"requires": [
|
||||
"local_mp_core",
|
||||
"local_mp_kills"
|
||||
],
|
||||
"sites": {
|
||||
// MissionSettings gameModeName offset, captured where mission_settings_load reads "gameModeName".
|
||||
// 2.61.0.58: 0x126c4c8 (mode_name = 0x48).
|
||||
"mission_mode_name": {
|
||||
"variants": [
|
||||
{
|
||||
"written_for": "2.61.0.58",
|
||||
"locate": {
|
||||
"method": "string_ref",
|
||||
"string": "gameModeName",
|
||||
"pattern": "48 8d 15 ?? ?? ?? ?? 4c 8d 44 24 50 4c 89 e9 e8 ?? ?? ?? ?? 48 8b 56 ??",
|
||||
"lea_at": 0,
|
||||
"captures": {
|
||||
"mode_name": {
|
||||
"offset": 23,
|
||||
"type": "u8"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
// LocalMP mission preparation helper: clears MissionSettings.useKillStreaks at its tail.
|
||||
// 2.61.0.58: 0x12bf540.
|
||||
"prepare_local_mission": {
|
||||
"variants": [
|
||||
{
|
||||
"written_for": "2.61.0.58",
|
||||
"locate": {
|
||||
"method": "signature",
|
||||
"pattern": "48 83 ec 48 48 8b 05 ?? ?? ?? ?? 80 b8 80 04 00 00 01 0f 85 ?? ?? ?? ?? 0f 1f 84 00 00 00 00 00 b9 10 00 00 00 e8 ?? ?? ?? ??"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
// Tail store in prepare_local_mission that clears MissionSettings.useKillStreaks to 0.
|
||||
// 2.61.0.58: 0x12bf5d6 (use_kill_streaks = 0x7bc66b7).
|
||||
"prepare_local_mission_clear": {
|
||||
"variants": [
|
||||
{
|
||||
"written_for": "2.61.0.58",
|
||||
"locate": {
|
||||
"method": "within",
|
||||
"in": "prepare_local_mission",
|
||||
"pattern": "c6 05 ?? ?? ?? ?? 00 48 83 c4 48 c3",
|
||||
"captures": {
|
||||
"use_kill_streaks": {
|
||||
"offset": 2,
|
||||
"type": "rel32",
|
||||
"end": 7
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
// kill_streak_fighter_revert_es_event_handler: accesses gameplay killstreak rules, the killstreak
|
||||
// NameMap, and calls MPlayer::addKillStreakPoints.
|
||||
// 2.61.0.58: 0x33c9d0.
|
||||
"kill_streak_revert": {
|
||||
"variants": [
|
||||
{
|
||||
"written_for": "2.61.0.58",
|
||||
"locate": {
|
||||
"method": "string_ref",
|
||||
"string": "kill_streak_fighter_revert_es_event_handler",
|
||||
"target": "function"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
// Gameplay global, killstreak rules vector (data/count), rule tag id offset, and tag NameMap.
|
||||
// 2.61.0.58: 0x33ca72 (gameplay = 0x7bbe730, rule_count = 0x3818, rules = 0x3808, rule_tag = 0x3c, name_map = 0x7bbe670).
|
||||
"kill_streak_rules": {
|
||||
"variants": [
|
||||
{
|
||||
"written_for": "2.61.0.58",
|
||||
"locate": {
|
||||
"method": "within",
|
||||
"in": "kill_streak_revert",
|
||||
"pattern": "48 8b 0d ?? ?? ?? ?? 48 63 81 ?? ?? ?? ?? 41 39 c5 73 ?? 48 8b 81 ?? ?? ?? ?? 42 8b 4c 30 ?? 3b 0d ?? ?? ?? ?? 73 ?? 48 8b 15 ?? ?? ?? ??",
|
||||
"captures": {
|
||||
"gameplay": {
|
||||
"offset": 3,
|
||||
"type": "rel32"
|
||||
},
|
||||
"rule_count": {
|
||||
"offset": 10,
|
||||
"type": "u32"
|
||||
},
|
||||
"rules": {
|
||||
"offset": 22,
|
||||
"type": "u32"
|
||||
},
|
||||
"rule_tag": {
|
||||
"offset": 30,
|
||||
"type": "u8"
|
||||
},
|
||||
"name_map": {
|
||||
"offset": 42,
|
||||
"type": "rel32"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
// MPlayer::addKillStreakPoints(player, ruleIndex, points, relatedRule).
|
||||
// 2.61.0.58: 0x59e8a0 (called at 0x33cc47).
|
||||
"add_kill_streak_points": {
|
||||
"variants": [
|
||||
{
|
||||
"written_for": "2.61.0.58",
|
||||
"locate": {
|
||||
"method": "signature",
|
||||
"pattern": "41 57 41 56 41 54 56 57 55 53 48 83 ec 20 48 89 ce 48 8b 05 ?? ?? ?? ?? 0f b6 ca 39 88 ?? ?? ?? ?? 0f 86 ?? ?? ?? ?? 48 8b 98 ?? ?? ?? ?? 89 c8 4c 8d 34 c0 41 c1 e6 04"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
// MPlayer killstreak progress dag::Vector offset (data at +0x00, count at +0x10).
|
||||
// 2.61.0.58: 0x59e98e (progress = 0x788).
|
||||
"mplayer_streak_progress": {
|
||||
"variants": [
|
||||
{
|
||||
"written_for": "2.61.0.58",
|
||||
"locate": {
|
||||
"method": "within",
|
||||
"in": "add_kill_streak_points",
|
||||
"pattern": "4c 8b 96 ?? ?? ?? ?? 89 d2 48 c1 e2 04 41 0f b6 04 12",
|
||||
"captures": {
|
||||
"progress": {
|
||||
"offset": 3,
|
||||
"type": "u32"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
// Gameplay killstreak parser: airAiKillsMult and groundAiKillsMult offsets in a rule entry (stride 0x90).
|
||||
// 2.61.0.58: 0xeb097d (air_ai_mult = 0x28, ground_ai_mult = 0x2c).
|
||||
"kill_streak_ai_mults": {
|
||||
"variants": [
|
||||
{
|
||||
"written_for": "2.61.0.58",
|
||||
"locate": {
|
||||
"method": "string_ref",
|
||||
"string": "airAiKillsMult",
|
||||
"pattern": "48 8d 15 ?? ?? ?? ?? 49 89 f8 e8 ?? ?? ?? ?? 89 46 ?? c7 44 24 30 01 00 00 00 4c 89 e1 48 8d 15 ?? ?? ?? ?? 49 89 f8 e8 ?? ?? ?? ?? 89 46 ??",
|
||||
"lea_at": 0,
|
||||
"captures": {
|
||||
"air_ai_mult": {
|
||||
"offset": 17,
|
||||
"type": "u8"
|
||||
},
|
||||
"ground_ai_mult": {
|
||||
"offset": 46,
|
||||
"type": "u8"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
// BombingKillStreakEvent::initiateEvent: computes the initiator spawn position from gameplay.blk spawnPos.
|
||||
// 2.61.0.58: 0x1283c10.
|
||||
"air_event_initiate": {
|
||||
"variants": [
|
||||
{
|
||||
"written_for": "2.61.0.58",
|
||||
"locate": {
|
||||
"method": "string_ref",
|
||||
"string": "%s: reject - event (%d) unavailable active %d, timeToStart %f",
|
||||
"target": "function"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
// Battle-area center helper, room max rank global, and rule spawnPos table offsets in initiateEvent.
|
||||
// 2.61.0.58: 0x1283e05 (battle_center = 0x1284140, spawn_pos_count = 0x60, max_rank = 0x7bc666c, spawn_pos = 0x50, stride = 0x64).
|
||||
"air_event_spawn_table": {
|
||||
"variants": [
|
||||
{
|
||||
"written_for": "2.61.0.58",
|
||||
"locate": {
|
||||
"method": "within",
|
||||
"in": "air_event_initiate",
|
||||
"pattern": "48 8d 4c 24 4c e8 ?? ?? ?? ?? 45 8b 47 ?? f3 44 0f 10 0d ?? ?? ?? ?? 45 0f 28 d1 45 0f 28 c1 4d 85 c0 4c 89 e0 0f 84 ?? ?? ?? ?? 8b 15 ?? ?? ?? ?? 49 8b 4f ?? 4d 6b c8 ??",
|
||||
"captures": {
|
||||
"battle_center": {
|
||||
"offset": 6,
|
||||
"type": "rel32"
|
||||
},
|
||||
"spawn_pos_count": {
|
||||
"offset": 13,
|
||||
"type": "u8"
|
||||
},
|
||||
"max_rank": {
|
||||
"offset": 45,
|
||||
"type": "rel32"
|
||||
},
|
||||
"spawn_pos": {
|
||||
"offset": 52,
|
||||
"type": "u8"
|
||||
},
|
||||
"spawn_pos_stride": {
|
||||
"offset": 56,
|
||||
"type": "u8"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
// App terrain pointer offset and terrain height query call in initiateEvent.
|
||||
// 2.61.0.58: 0x1283f95 (app_terrain = 0x3d8, terrain_height = 0xf9bcd0).
|
||||
"air_event_terrain": {
|
||||
"variants": [
|
||||
{
|
||||
"written_for": "2.61.0.58",
|
||||
"locate": {
|
||||
"method": "within",
|
||||
"in": "air_event_initiate",
|
||||
"pattern": "48 8b 05 ?? ?? ?? ?? 48 8b 88 ?? ?? ?? ?? 0f 57 c0 0f 11 44 24 20 e8 ?? ?? ?? ??",
|
||||
"captures": {
|
||||
"app_terrain": {
|
||||
"offset": 10,
|
||||
"type": "u32"
|
||||
},
|
||||
"terrain_height": {
|
||||
"offset": 23,
|
||||
"type": "rel32"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
// BombingKillStreakEvent::switchPlayerUnit: switches the player to/from the event aircraft and calls sendUnitRespawn.
|
||||
// 2.61.0.58: 0x1287020.
|
||||
"air_event_switch_unit": {
|
||||
"variants": [
|
||||
{
|
||||
"written_for": "2.61.0.58",
|
||||
"locate": {
|
||||
"method": "signature",
|
||||
"pattern": "41 57 41 56 41 54 56 57 55 53 48 81 ec f0 00 00 00 44 89 c5 48 89 d6 48 89 cf 48 8b 1a 44 8b 83 ?? ?? ?? ?? 8b 05 ?? ?? ?? ?? 48 8b 93 ?? ?? ?? ??"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
// Matrix-to-quaternion orientation helper called by switchPlayerUnit when building the respawn pose.
|
||||
// 2.61.0.58: 0x1287309 (get_orientation = 0x280710).
|
||||
"air_event_orientation": {
|
||||
"variants": [
|
||||
{
|
||||
"written_for": "2.61.0.58",
|
||||
"locate": {
|
||||
"method": "within",
|
||||
"in": "air_event_switch_unit",
|
||||
"pattern": "48 8d 8c 24 88 00 00 00 48 8d 54 24 40 e8 ?? ?? ?? ??",
|
||||
"captures": {
|
||||
"call": {
|
||||
"offset": 14,
|
||||
"type": "rel32"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
// Unit::sendUnitRespawn: packs UnitRespawn (0xf030) and broadcasts it via mpi::sendto.
|
||||
// 2.61.0.58: 0xff13a0.
|
||||
"send_unit_respawn": {
|
||||
"variants": [
|
||||
{
|
||||
"written_for": "2.61.0.58",
|
||||
"locate": {
|
||||
"method": "string_ref",
|
||||
"string": "sending unit respawn uid:%i name:%s ptr:%p at (%f, %f, %f)",
|
||||
"target": "function"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
// mpi::sendto broadcast call at the end of Unit::sendUnitRespawn.
|
||||
// 2.61.0.58: 0xff17a1 (mpi_sendto = 0x30a0650).
|
||||
"send_unit_respawn_broadcast": {
|
||||
"variants": [
|
||||
{
|
||||
"written_for": "2.61.0.58",
|
||||
"locate": {
|
||||
"method": "within",
|
||||
"in": "send_unit_respawn",
|
||||
"pattern": "48 8d 74 24 30 48 89 f1 e8 ?? ?? ?? ?? 48 89 f1 b2 ff e8 ?? ?? ?? ??",
|
||||
"captures": {
|
||||
"mpi_sendto": {
|
||||
"offset": 19,
|
||||
"type": "rel32"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -487,6 +487,20 @@
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
// Unit::onEvent: dispatches unit network messages (hits, respawns, state events) on a Unit.
|
||||
// Shared by local_mp_damage_notifications and local_mp_air_events.
|
||||
// 2.61.0.37: 0x103fbc0; 2.61.0.43: 0x1043fe0; 2.61.0.58: 0x1044650.
|
||||
"unit_on_event": {
|
||||
"variants": [
|
||||
{
|
||||
"written_for": "2.61.0.37",
|
||||
"locate": {
|
||||
"method": "signature",
|
||||
"pattern": "41 57 41 56 41 55 41 54 56 57 55 53 48 81 ec c8 04 00 00 44 0f 29 bc 24 b0 04 00 00 44 0f 29 b4 24 a0 04 00 00 44 0f 29 ac 24 90 04 00 00 44 0f 29 a4 24 80 04 00 00 44 0f 29 9c 24 70 04 00 00 44 0f 29 94 24 60 04 00 00 44 0f 29 8c 24 50 04 00 00 44 0f 29 84 24 40 04 00 00 0f 29 bc 24 30 04 00 00 0f 29 b4 24 20 04 00 00 48 89 d7 49 89 cd 0f b7 42 20"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -139,21 +139,8 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
// Unit::onEvent: receives hit events for every unit on a LocalMP host and falls through into
|
||||
// enemy parts-list and hit-camera special-event delivery even when the attacker is an AI unit.
|
||||
// 2.61.0.37: 0x103fbc0; 2.61.0.43: 0x1043fe0.
|
||||
"unit_on_event": {
|
||||
"variants": [
|
||||
{
|
||||
"written_for": "2.61.0.37",
|
||||
"locate": {
|
||||
"method": "signature",
|
||||
"pattern": "41 57 41 56 41 55 41 54 56 57 55 53 48 81 ec c8 04 00 00 44 0f 29 bc 24 b0 04 00 00 44 0f 29 b4 24 a0 04 00 00 44 0f 29 ac 24 90 04 00 00 44 0f 29 a4 24 80 04 00 00 44 0f 29 9c 24 70 04 00 00 44 0f 29 94 24 60 04 00 00 44 0f 29 8c 24 50 04 00 00 44 0f 29 84 24 40 04 00 00 0f 29 bc 24 30 04 00 00 0f 29 b4 24 20 04 00 00 48 89 d7 49 89 cd 0f b7 42 20"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
// Hit event attacker Unit* offset loaded before comparing against g_hero in Unit::onEvent.
|
||||
// Hit event attacker Unit* offset loaded before comparing against g_hero in Unit::onEvent
|
||||
// (unit_on_event is resolved in local_mp_core).
|
||||
// 2.61.0.37: 0x104495d (offender=0xd0); 2.61.0.43: 0x1048d7d (offender=0xd0).
|
||||
"hit_event_offender": {
|
||||
"variants": [
|
||||
|
||||
Reference in new issue
Block a user