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

Add ClientConnected() hook #223

Merged
merged 1 commit into from
Oct 20, 2021
Merged

Conversation

bionext03
Copy link
Contributor

Add ClientConnected hook. Called after processing a client connection request.

Add ClientConnected hook. Called after processing a client connection request.
@Giferns
Copy link
Contributor

Giferns commented Oct 8, 2021

@bionext03 we have problem with this hook, that I didn't notice at the first test. When server starts from offline, log on my connect is

L 10/08/2021 - 04:12:09: [AIB DEBUG] RH_ClientConnected_Post(): (taskid: 39711)
L 10/08/2021 - 04:12:09: [AIB DEBUG] client_connect(): 85.249.45.145 (warned? taskid not found!)

but when i reconnect i get

L 10/08/2021 - 04:12:24: [AIB DEBUG] RH_ClientConnected_Post(): 85.249.45.145 (taskid: 64257)
L 10/08/2021 - 04:12:24: [AIB DEBUG] client_connect(): 85.249.45.145 (taskid: 64257, elapsed 0.066801)

In other words, IP provided by get_user_ip() in this hook will give us previous connection IP, not current. Sorry that i didn’t notice this at first test, I tested your version by reconnecting to the server, and I just didn’t notice the problem.

To get IP from this hook we need something like #221
Implementing it just for our purpose is a weird idea... Now i think bug need to be closed through ReAuthCheck, as intended to be.

@bionext03
Copy link
Contributor Author

AMXX updates the client's ip address in the ClientConnect_Post metamod hook. We just need to add IRehldsServerData::GetNetFrom() to this hook to get the ip of the current client.

@SergeyShorokhov SergeyShorokhov self-requested a review October 20, 2021 16:08
@SergeyShorokhov SergeyShorokhov added the Type: 🚀 enhancement Improvement or addition of a new feature. label Oct 20, 2021
@SergeyShorokhov SergeyShorokhov changed the title Add ClientConnected hook Add ClientConnected() hook Oct 20, 2021
@SergeyShorokhov SergeyShorokhov merged commit 36d6311 into rehlds:master Oct 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: 🚀 enhancement Improvement or addition of a new feature.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants