Skip to content

Add 64-bit support using int64 Address#71

Open
Mikusch wants to merge 38 commits into
FlaminSarge:masterfrom
Mikusch:x64
Open

Add 64-bit support using int64 Address#71
Mikusch wants to merge 38 commits into
FlaminSarge:masterfrom
Mikusch:x64

Conversation

@Mikusch

@Mikusch Mikusch commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Based on #67, this completes the x64 migration using the new int64-based Address type.

This requires 1.13.0.7377 or higher for alliedmodders/sourcemod#2487, which fixes a crash this plugin will run into otherwise.


The test suite added by @Malifox runs with no issues on 32-bit and 64-bit servers alike and I've even extended it a bit for greater test coverage.

No natives were removed. There are some caveats however:
String/non-networked attributes aren't supported on x64. There is no safe way to set string attributes from an x64 server plugin. Previous hacks won't work and there is not enough space for the 8-byte pointer. There is some hacky route involving writing to SOC, but that only works on actual GC-backed items unless we are willing to manually construct a CEconItem (let's not).

As such, all functions that can deal with these non-networked or string attributes are no-ops or throw native errors on 64-bit servers. TF2Attrib_HookValueString is the only string native that remains fully functional on x64.

If it were up to me, TF2Attrib_SetFromStringValue and TF2Attrib_UnsafeGetStringValue should be deprecated, urging users to use other methods. As far as I'm aware, usage of these two natives is relatively sparse, with the biggest use case being values read from configs passed into TF2Attrib_SetFromStringValue for ease of use. But unless you are actually trying to target string attributes, setting attributes as float seems better to me anyway.

Malifox and others added 30 commits October 29, 2025 17:19
…irtualAddress (unconditionally), SDKType_PlainOldData -> SDKType_VirtualAddress
…mmented out earlier, comment the SDKCall setup too
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants