Skip to content

aowlspt_invui.h

Source: abi/aowlspt_invui.h — 499 lines, 41 file-scope functions.

What this header owns

Reproduced verbatim from the header's own banner comment — these notes are frequently the only written record of why the subsystem is shaped the way it is.

text
 aowlspt_invui.h -- the shared surface for the NATIVE INVENTORY / ITEM-SPAWNER
screen: our inventory on one side, a searchable "everything" stash on the
other, and a mint that moves a row from the right side into the left.

## Why a SECOND region and not a bigger `aowlspt_admin.h`

Everything here could have been appended to `AowlAdminShared`. It is not, for
two measured reasons:

  1. `AowlAdminShared` is mapped by THREE modules (the admin mod on both
     sides, and the overlay). Appending to it changes `sizeof`, which changes
     what `CreateFileMappingA` reserves, which means an old overlay and a new
     mod map two different-sized views of one name. `AOWL_ADM_VERSION` exists
     to catch that, and bumping it turns EVERY existing admin feature off
     until all three modules are rebuilt together. A new screen must not be
     able to break ESP.
  2. The row tables here are ~11 KB. The admin region is on the ESP hot path
     and is read every Present; there is no reason to drag an inventory list
     through that cache line budget.

So: a separate name, a separate version, and NO dependency in either
direction. If this region never gets mapped the native screen renders its
"nothing is answering" state and the F6 spawner is completely unaffected.

## The two sides and who owns what

| field group | written by | read by |
|---|---|---|
| `query`, `*Req`, `mintTpl`, `mintCount` | the HOST (native UI, Unity thread) | the backend |
| `stash*`, `inv*`, `*Ack`, `note`, `mintVerdict` | the BACKEND (admin mod, server side) | the host |

The request/ack pair IS the ownership token for the row tables, exactly as
`spawnReq`/`spawnAck` is for `spawnQuery` in `aowlspt_admin.h`. While
`req != ack` the tables belong to the backend and the host must not read
them; when `req == ack` they belong to the host and the backend must not
write them. That is why there is no seqlock here: there is no window in which
both sides may touch one table, so there is nothing to retry.

`InterlockedExchange` on the ack is the release: every row byte is written
BEFORE the ack moves, and the interlocked store is a full barrier on x86-64,
so a host that observes `ack == req` observes every row written before it.

## The mint verdict is a READBACK, not an acknowledgement

`mintVerdict` is deliberately not "the call returned OK". The backend counts
how many of `mintTpl` are in the profile BEFORE the mint and again AFTER, and
reports PASS only if the count went UP. A mint that returned success and put
nothing in the stash is the single failure this project keeps paying for, and
an ack-shaped verdict cannot tell those apart. INCONCLUSIVE is a real outcome
and is what a profile that could not be read reports -- never PASS.

## Safety

Pure Win32 + stdint. No IL2CPP call, no game pointer, no allocation, no
dereference of anything a participant supplied. Every accessor CLAMPS rather
than trusting the region: this struct lives in a named section any process on
the box can open, so a length longer than its buffer is a thing that CAN
happen and must read as a short string, never as a walk off the end.

Constants

  • AOWLSPT_INVUI_H
  • AOWL_IU_MAGIC
  • AOWL_IU_MAX_ROWS
  • AOWL_IU_MV_FAIL
  • AOWL_IU_MV_INCONCLUSIVE
  • AOWL_IU_MV_NONE
  • AOWL_IU_MV_PASS
  • AOWL_IU_NAME_LEN
  • AOWL_IU_NOTE_LEN
  • AOWL_IU_OP_SEARCH
  • AOWL_IU_QUERY_LEN
  • AOWL_IU_REGION_NAME
  • AOWL_IU_TPL_LEN
  • AOWL_IU_VERSION

Functions

SignatureLine
AowlInvUiShared aowl_invui_map(void)152
int32_t aowl_invui_compatible(AowlInvUiShared* s)179
void aowl_iu_put_str(char* dst, int32_t cap, const char* src)191
void aowl_iu_get_str(const char* src, int32_t srcCap, char* out, int32_t outCap)204
int32_t aowl_invui_ask_stash(AowlInvUiShared* s, const char* q)225
int32_t aowl_invui_ask_inv(AowlInvUiShared* s)238
int32_t aowl_invui_ask_mint(AowlInvUiShared* s, const char* tpl, int32_t count, int32_t condition)248
int32_t aowl_invui_stash_ready(AowlInvUiShared* s)270
int32_t aowl_invui_inv_ready(AowlInvUiShared* s)273
int32_t aowl_invui_mint_busy(AowlInvUiShared* s)276
int32_t aowl_invui_stash_count(AowlInvUiShared* s)283
int32_t aowl_invui_stash_matched(AowlInvUiShared* s)291
int32_t aowl_invui_inv_count(AowlInvUiShared* s)297
int32_t aowl_invui_inv_total(AowlInvUiShared* s)305
void aowl_invui_stash_name(AowlInvUiShared* s, int32_t i, char* out, int32_t outCap)312
void aowl_invui_stash_tpl(AowlInvUiShared* s, int32_t i, char* out, int32_t outCap)318
void aowl_invui_inv_name(AowlInvUiShared* s, int32_t i, char* out, int32_t outCap)324
void aowl_invui_inv_tpl(AowlInvUiShared* s, int32_t i, char* out, int32_t outCap)330
int32_t aowl_invui_inv_qty(AowlInvUiShared* s, int32_t i)336
void aowl_invui_note(AowlInvUiShared* s, char* out, int32_t outCap)341
int32_t aowl_invui_verdict(AowlInvUiShared* s)346
int32_t aowl_invui_mint_before(AowlInvUiShared* s)349
int32_t aowl_invui_mint_after(AowlInvUiShared* s)352
int32_t aowl_invui_heartbeat(AowlInvUiShared* s)355
int32_t aowl_invui_stash_pending(AowlInvUiShared* s)364
int32_t aowl_invui_inv_pending(AowlInvUiShared* s)369
int32_t aowl_invui_mint_pending(AowlInvUiShared* s)374
void aowl_invui_get_query(AowlInvUiShared* s, char* out, int32_t outCap)380
void aowl_invui_get_mint_tpl(AowlInvUiShared* s, char* out, int32_t outCap)385
int32_t aowl_invui_get_mint_count(AowlInvUiShared* s)390
int32_t aowl_invui_get_mint_condition(AowlInvUiShared* s)398
void aowl_invui_stash_begin(AowlInvUiShared* s)411
void aowl_invui_inv_begin(AowlInvUiShared* s)417
int32_t aowl_invui_stash_add(AowlInvUiShared* s, const char* tpl, const char* name)427
int32_t aowl_invui_inv_add(AowlInvUiShared* s, const char* tpl, const char* name, int32_t qty)439
void aowl_invui_stash_matched_set(AowlInvUiShared* s, int32_t n)451
void aowl_invui_inv_total_set(AowlInvUiShared* s, int32_t n)454
void aowl_invui_set_note(AowlInvUiShared* s, const char* msg)458
void aowl_invui_stash_done(AowlInvUiShared* s, int32_t req)466
void aowl_invui_inv_done(AowlInvUiShared* s, int32_t req)471
void aowl_invui_mint_done(AowlInvUiShared* s, int32_t req, int32_t before, int32_t after, int32_t readable, const char* msg)481

aoughwl — self-hosted platform for things n stuff. Contact / Support on Discord for access to the private backends.