Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

plugins/l4d: total revamp and identity support #2609

Conversation

@davidebeatrici
Copy link
Member

commented Oct 30, 2016

  • Correct avatar position (the one used before was the camera one)
  • Camera position
  • State value
  • Context based on server ID
  • Host address in identity (it was in context)
  • Map name in identity
  • Player SteamID in identity

Game version: 1.0.3.1
http://www.l4d.com/blog/post.php?id=20984

@davidebeatrici davidebeatrici force-pushed the davidebeatrici:left-4-dead-positional-audio-plugin branch from 0a39075 to c70e1b0 Oct 30, 2016


procptr32_t posptr, rotptr;
procptr32_t steamclient, engine; // Variables to contain modules addresses

This comment has been minimized.

Copy link
@mkrautz

mkrautz Oct 30, 2016

Member

Should be static procptr32_t


// State pointers
procptr32_t state_base = peekProc<procptr32_t>(pModule + 0x5A7354);
if (!state_base) return false;

This comment has been minimized.

Copy link
@mkrautz

mkrautz Oct 30, 2016

Member

I'd prefer if (state_base == 0).

procptr32_t state_base = peekProc<procptr32_t>(pModule + 0x5A7354);
if (!state_base) return false;
procptr32_t state_offset = peekProc<procptr32_t>(state_base + 0x5C);
if (!state_offset) return false;

This comment has been minimized.

Copy link
@mkrautz

mkrautz Oct 30, 2016

Member

Ditto for state_offset.

if (!state_offset) return false;

// Peekproc and assign game addresses to our containers, so we can retrieve positional data
ok = peekProc(state_offset + 0x8, &state, 1) && // Magical state value: 0 when not playing and 1 when in-game.

This comment has been minimized.

Copy link
@mkrautz

mkrautz Oct 30, 2016

Member

For all of these peekProcs:

Please use the short form peekProc: https://github.com/mumble-voip/mumble/blob/master/plugins/mumble_plugin_win32_ptr_type.h#L84

It will automatically use the correct size for the target.

So:

peekProc(pModule + 0x512264, avatar_pos_corrector, 12)
becomes
peekProc(pModule + 0x512264, avatar_pos_corrector)

etc.

// Server ID
steamclient = getModuleAddr(L"steamclient.dll"); // Retrieve "steamclient.dll" module's memory address
// This prevents the plugin from linking to the game in case something goes wrong during module's memory address retrieval.
if (!steamclient)

This comment has been minimized.

Copy link
@mkrautz

mkrautz Oct 30, 2016

Member

I would prefer if (steamclient == 0) since it's a pointer.

// Host & Player ID
engine = getModuleAddr(L"engine.dll"); // Retrieve "engine.dll" module's memory address
// This prevents the plugin from linking to the game in case something goes wrong during module's memory address retrieval.
if (!engine)

This comment has been minimized.

Copy link
@mkrautz

mkrautz Oct 30, 2016

Member

I would prefer if (engine == 0) since it's a pointer.

plugins/l4d: total revamp and identity support
- Correct avatar position (the one used before was the camera one)
- Camera position
- State value
- Context based on server ID
- Host address in identity (it was in context)
- Map name in identity
- Player SteamID in identity

Game version: 1.0.3.1
http://www.l4d.com/blog/post.php?id=20984

@davidebeatrici davidebeatrici force-pushed the davidebeatrici:left-4-dead-positional-audio-plugin branch from 478334a to dead5a7 Oct 30, 2016

@davidebeatrici davidebeatrici merged commit f836ed4 into mumble-voip:master Oct 30, 2016

@davidebeatrici davidebeatrici deleted the davidebeatrici:left-4-dead-positional-audio-plugin branch Oct 30, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.