Skip to content

Support CS:S x86_64 - #28

Open
cmer81 wants to merge 2 commits into
masterfrom
feat/linux64
Open

cmer81 wants to merge 2 commits into
masterfrom
feat/linux64

Conversation

@cmer81

@cmer81 cmer81 commented Oct 19, 2026

Copy link
Copy Markdown
Member

Part of moving our ZE server to the CS:S x86_64 build (SourceMod 1.13.0.7427 + srcdslab/sourcemod#9 + srcdslab/metamod-source#4).

Problems on x86_64

  • CBaseServer::GetClient returns an IClient* through SDKType_PlainOldData, which is 32-bit, so the pointer gets truncated.
  • GetBaseClient() subtracts 4 to go from IClient back to CBaseClient (multiple inheritance). On x86_64 it's 8.
  • gamedata has no linux64 keys, and SourceMod doesn't fall back to linux.

Changes

  • GetClient uses SDKType_Address. With SourceMod 1.13 Address is 64-bit and the result comes back through a by-ref argument.
  • The IClient adjustment is now read from gamedata (CBaseClient::IClient: 4 on x86/windows/mac, 8 on linux64).
  • gamedata: linux64 entries. @sv exists on x86_64, and CBaseServer::GetClient (7) and CGameClient::UpdateAcknowledgedFramecount (44) have the same engine vtable index.
  • CI: compile with SourceMod 1.13.0.7427 (setup-sp 1.13.7427). That's what production runs, and it's the first version with 64-bit Address. 1.12 includes can't express this.

Testing

On CS:S build 11003710, both x86 and x86_64: a probe redoing GetBaseClient() on a client checks that the resulting object's vtable is CGameClient's. It is OK on both (offset 4 / 8).

- CBaseServer::GetClient returns a pointer: use SDKType_Address (64-bit Address,
  result through a by-ref argument) instead of PlainOldData, which truncated it.
- The IClient -> CBaseClient adjustment is 8 on x86_64, not 4: read it from
  gamedata (CBaseClient::IClient).
- gamedata: linux64 entries (same symbol and engine vtable indices as linux).
- CI: build with SourceMod 1.13.0.7427 (production), the first with 64-bit Address.

Checked on CS:S x86 and x86_64 (build 11003710): the computed CBaseClient's
vtable is CGameClient's.
@cmer81 cmer81 added x86_64 CS:S x86_64 (64-bit srcds) support requires SM 1.13 Built with SourceMod 1.13 includes; does not load on 1.12 labels Oct 19, 2026
@cmer81

cmer81 commented Oct 19, 2026

Copy link
Copy Markdown
Member Author

The plugin is now built with SourceMod 1.13 includes (64-bit Address). Releases will not load on SourceMod 1.12 servers anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

requires SM 1.13 Built with SourceMod 1.13 includes; does not load on 1.12 x86_64 CS:S x86_64 (64-bit srcds) support

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant