Skip to content

Commit 60f071f

Browse files
3vcloudclaude
andcommitted
fix(dat): request files with flag 0 (no flush) like the client's own preloads
RE of the request call sites: FUN_008e3a40 just returns static preload lists (not a per-file transform), so our FUN_0082da30(1,&id,flags) is correct. But the client's own file requests use flags 0 / 0x10000 / 0x10008 and never the 0x2 'flush' we added - it isn't how it kicks a download and clearing that flag mid-play may interfere. Use flag 0 (matches FUN_0082dd80): a plain queued request the client downloads when it next processes its queue (map change), which the read retry then picks up. On-the-fly download during play doesn't appear achievable via this API. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 67e05b4 commit 60f071f

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

GWToolboxdll/Modules/GwDatModule.cpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,15 @@
2020

2121
namespace {
2222

23-
// Asks the client to fetch a file id and flush the download queue so it sends now, not at the next
24-
// map change (the client's request+flush wrapper, 0x2 flag). Resolved from a unique call site via
25-
// FunctionFromNearCall, which survives byte shifts better than a prologue scan.
23+
// Asks the client to queue a file id for download (the same FUN_0082da30 the client uses for its
24+
// own preloads). Resolved from a unique call site via FunctionFromNearCall, which survives byte
25+
// shifts better than a prologue scan.
2626
using RequestFiles_pt = void(__cdecl*)(uint32_t count, const uint32_t* file_ids, uint32_t flags);
27-
// 0x2 = enqueue + flush, non-cancelable (stores no handle). Don't add 0x1/0x10000 - they return a
28-
// handle that leaks unless released.
29-
constexpr uint32_t kTriggerFlags = 0x2;
27+
// 0 = plain non-cancelable request (matches the client's own FUN_0082dd80). The client downloads it
28+
// when it next processes its queue (a map transition); we retry the read until it lands. Not 0x2
29+
// (a "flush" the client itself never uses, and which doesn't force an on-the-fly download); not
30+
// 0x1/0x10000 (cancel-tracking, which returns a handle that leaks unless released).
31+
constexpr uint32_t kTriggerFlags = 0;
3032
RequestFiles_pt RequestFiles_Func = nullptr;
3133

3234
void ResolveRequestFn()

0 commit comments

Comments
 (0)