Skip to content

Add ClientConnected() hook#223

Merged
wopox1337 merged 1 commit intorehlds:masterfrom
bionext03:bionext03/reapi
Oct 20, 2021
Merged

Add ClientConnected() hook#223
wopox1337 merged 1 commit intorehlds:masterfrom
bionext03:bionext03/reapi

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.

@wopox1337 wopox1337 self-requested a review October 20, 2021 16:08
@wopox1337 wopox1337 added the Type: 🚀 enhancement Improvement or addition of a new feature. label Oct 20, 2021
@wopox1337 wopox1337 changed the title Add ClientConnected hook Add ClientConnected() hook Oct 20, 2021
@wopox1337 wopox1337 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