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

server: Remove uses of Autohook from serverauthentication.cpp #820

Conversation

ASpoonPlaysGames
Copy link
Contributor

Code review:

  • The original function is prefixed with o_p so any times where the old AUTOHOOK was calling the original function it should now be calling that instead.
  • The hook function is prefixed with h_ so any times where we would be wanting to call the hooked function from other functions should now be calling that instead
  • Something to note is that we get a pointer to CBaseClient__Disconnect in another file as well, hence the weird name on the original hook. Potentially any calls we were making to CBaseClient__Disconnect instead of _CBaseClient__Disconnect are bypassing the hook? Something worth investigating at some point, shouldn't affect this PR though.

Testing:

  • Check logs to make sure that all of the changed hooks are being created properly
  • Make sure that players can still auth, join and leave a server with their persistence being written etc.

@github-actions github-actions bot added needs testing Changes from the PR still need to be tested needs code review Changes from PR still need to be reviewed in code labels Sep 8, 2024
Copy link
Member

@F1F7Y F1F7Y left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look good

@F1F7Y F1F7Y added almost ready to merge Apart from any small remaining other issues addressed by other labels, this would be ready to merge and removed needs code review Changes from PR still need to be reviewed in code labels Sep 15, 2024
Copy link
Member

@GeckoEidechse GeckoEidechse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works in quick testing. Just hosted a server with this PR and joined it, played a bit, and left again.

@GeckoEidechse GeckoEidechse merged commit 41583e4 into R2Northstar:main Oct 30, 2024
4 checks passed
@GeckoEidechse GeckoEidechse changed the title Remove uses of Autohook from serverauthentication.cpp server: Remove uses of Autohook from serverauthentication.cpp Oct 30, 2024
wolf109909 pushed a commit to R2NorthstarCN/NorthstarLauncher that referenced this pull request Nov 12, 2024
…rthstar#820)

Manually hook
- `CBaseServer__ConnectClient`
- `CBaseClient__Connect`
- `CBaseClient__ActivatePlayer`
- `CBaseClient__Disconnect`

Remove `AUTOHOOK_INIT` and `AUTOHOOK_DISPATCH`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
almost ready to merge Apart from any small remaining other issues addressed by other labels, this would be ready to merge needs testing Changes from the PR still need to be tested
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants