Repository navigation
lod114d: getTradeInfo(1) returns the trade partner's name - #77
Merged
Merged
Conversation
GetTradeInfo(RecentTradeName) returned our own name (BnetData szPlayerName) as a stand-in. It now reads the partner's name the client stores when handling S2C 0x78 (assign player to trade): d2client::gwszRecentTradeName, wchar_t[16] at RVA 0x3C0E84, converted to UTF-8; an empty buffer gives nullopt. The whole function now reads under a GameReadLock. reference/d2bs/D2Ptrs.h only carries a commented-out pre-1.14d value for RecentTradeName, so the address was found by disassembling the 1.14d Game.exe: the S2C 0x78 handler copies the packet name (16 chars) there and stores the partner unit id at 0x3C0E60; 0x4B9060 is its getter, and a static initialiser zeroes exactly 32 bytes. The buffer sits 8 bytes past gnRecentTradeId, in the same trade state block. Not exercised in a live trade. Script-visible behaviour: getTradeInfo(1) returns the name of the player most recently assigned as trade partner (null before any trade this session) instead of the local character's name. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
getTradeInfo(1)(RecentTradeName) returned the local character's own name as a stand-in. It now reads the partner name the client stores when handling S2C 0x78 (assign player to trade):d2client::gwszRecentTradeName,wchar_t[16]at RVA0x3C0E84, converted to UTF-8; an empty buffer givesnull. The function reads under oneGameReadLock.The reference only has a commented-out pre-1.14d offset, so the address comes from disassembling the 1.14d
Game.exe: the 0x78 handler copies the 16-char packet name there and stores the partner id just before it, a getter returns the buffer, and a static initialiser zeroes exactly 32 bytes. It sits 8 bytes pastgnRecentTradeIdin the same trade-state block.Script-visible:
getTradeInfo(1)returns the most recent trade partner's name (null before any trade this session). Not yet exercised in a live trade.Verification
build.ps1 Release(Win32, the 1.14d DLL): buildsbuild.ps1 test: 169/169 passbuild.ps1 check-format: clean🤖 Generated with Claude Code