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 rg_client_full_connect #327

Open
TheKrytyk opened this issue Aug 22, 2024 · 1 comment
Open

Add rg_client_full_connect #327

TheKrytyk opened this issue Aug 22, 2024 · 1 comment

Comments

@TheKrytyk
Copy link

TheKrytyk commented Aug 22, 2024

Hello,

At the moment we have 3 events:

a) client_connect
b) client_authorized
c) client_putinserver

and the problem is reading the values from nvault, when after changing the client_authorized map it is not always able to immediately verify whether, for example, it has flags added by the shop ( not users.ini ). Example:

public client_authorized( id )
{	
	if( get_user_flags( id ) & ADMIN_FLAG_W )
	{
		get_user_name( id, szUserAuthID[ id ], charsmax( szUserAuthID[ ] ) );	
		nvault_settings( id, NVAULT_READ, "client_authorized" );
	}
}

In order to read the values correctly you need to duplicate the code in the client_putinserver, so my suggestion is to add a new event rg_client_full_connect( index ) so that it executes after authorization ( reading the STEAMID ) and connecting the player to the server ( during team selection ).

It is still possible to add a set_task( 1.0, "nvault", id ) in client_authorised, but the player may leave the server. Also, the client_putinserver MAY sometimes execute BEFORE client_authorized ( from my observations and logs, 95% execute AFTER client_authorized, so a forward after the player is fully connected would be useful ).

Would it be possible to add something like this?

@NiceFeatures
Copy link

Set a task to a new function and

if(is_user_authorized(index))
{
    code...
}
else
{
 function()
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants