Raised This Month: $32 Target: $400
 8% 

Help with anti-retry plugin not working as expected


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
rtxa
Senior Member
Join Date: Mar 2018
Location: Argentina
Old 02-08-2019 , 18:17   Help with anti-retry plugin not working as expected
Reply With Quote #1

I have an strange issue with my anti-retry plugin, isn't working as expected, when player download map from FastDL, when they finish to download it, they join and get kicked by the anti-retry, according to this quote, that is the reason, how to fix it?

Quote:
Players that download the map directly from the server are still connected, however, if they download the map from the sv_downloadurl address, they're disconnected from the server while downloading and then reconnected.

Last edited by rtxa; 02-08-2019 at 18:17.
rtxa is offline
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 02-08-2019 , 18:20   Re: Help with anti-retry plugin not working as expected
Reply With Quote #2

Without plugin source we can't help you.
__________________








CrazY. is offline
rtxa
Senior Member
Join Date: Mar 2018
Location: Argentina
Old 02-08-2019 , 18:57   Re: Help with anti-retry plugin not working as expected
Reply With Quote #3

PHP Code:
#include <amxmodx>

/* ===========================================================================​​=============================
 *         [ Plugin initiation ]
 * ===========================================================================​​===========================*/
 
#define IsUserAdmin(%1) ( get_user_flags( %1 ) & ADMIN_KICK )

const RETRY_DURATION 60;

new 
Trie:g_tPlayer;

public 
plugin_init( )
{
    
register_plugin"Anti retry","1.0b","Manu" );
    
    
g_tPlayer TrieCreate( );
}

public 
plugin_end( )
    
TrieDestroyg_tPlayer );

/* ===========================================================================​​=============================
 *         [ Functions ]
 * ===========================================================================​​===========================*/

public client_putinserveriId )
{
    static 
szIp22 ],iTimeget_user_ipiId,szIp,charsmaxszIp ),);
    
    if( 
TrieKeyExistsg_tPlayer,szIp ) )
    {
        
TrieGetCellg_tPlayer,szIp,iTime );
        
        if( 
get_systime( ) < iTime )
            
server_cmd"kick #%d ^"Tiempo de esperA: %d segundos ]^"",get_user_useridiId ),iTime get_systime( ) );
        else
            
TrieDeleteKeyg_tPlayer,szIp );
    }
}

public 
client_disconnectiId )
{
    if( 
IsUserAdminiId ) )
        return;
    
    static 
szIp22 ]; get_user_ipiId,szIp,charsmaxszIp ),);
    
    if( !
TrieKeyExistsg_tPlayer,szIp ) )
        
TrieSetCellg_tPlayer,szIp,get_systime( ) + RETRY_DURATION );

Now help me

Last edited by rtxa; 02-08-2019 at 18:58.
rtxa is offline
SomewhereLost
AlliedModders Donor
Join Date: Mar 2014
Location: Tomorrowland
Old 02-08-2019 , 20:02   Re: Help with anti-retry plugin not working as expected
Reply With Quote #4

https://forums.alliedmods.net/showthread.php?t=63484

Use this.
__________________
SomewhereLost is offline
Send a message via Skype™ to SomewhereLost
DjSoftero
Veteran Member
Join Date: Nov 2014
Location: Lithuania
Old 02-08-2019 , 20:46   Re: Help with anti-retry plugin not working as expected
Reply With Quote #5

PHP Code:
public client_disconnectiId 

    if( 
IsUserAdminiId ) || entity_get_int(idEV_INT_team) == 
        return; 
     
    static 
szIp22 ]; get_user_ipiId,szIp,charsmaxszIp ),); 
     
    if( !
TrieKeyExistsg_tPlayer,szIp ) ) 
        
TrieSetCellg_tPlayer,szIp,get_systime( ) + RETRY_DURATION ); 

do not add the player to the reconnect blacklist if he never chose a team. This might not work tho. Player entity is still valid, but not sure about the players team validity.

Last edited by DjSoftero; 02-08-2019 at 21:00.
DjSoftero is offline
rtxa
Senior Member
Join Date: Mar 2018
Location: Argentina
Old 02-09-2019 , 23:01   Re: Help with anti-retry plugin not working as expected
Reply With Quote #6

Quote:
Originally Posted by SomewhereLost View Post
That doesn't fix the issue, player is being reconnected anyway, so it will not work as expected.
rtxa is offline
rtxa
Senior Member
Join Date: Mar 2018
Location: Argentina
Old 02-09-2019 , 23:03   Re: Help with anti-retry plugin not working as expected
Reply With Quote #7

Quote:
Originally Posted by DjSoftero View Post
PHP Code:
public client_disconnectiId 

    if( 
IsUserAdminiId ) || entity_get_int(idEV_INT_team) == 
        return; 
     
    static 
szIp22 ]; get_user_ipiId,szIp,charsmaxszIp ),); 
     
    if( !
TrieKeyExistsg_tPlayer,szIp ) ) 
        
TrieSetCellg_tPlayer,szIp,get_systime( ) + RETRY_DURATION ); 

do not add the player to the reconnect blacklist if he never chose a team. This might not work tho. Player entity is still valid, but not sure about the players team validity.
Thanks, player entity is still valid, so that has to work anyway.
rtxa is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 02-11-2019 , 15:51   Re: Help with anti-retry plugin not working as expected
Reply With Quote #8

PHP Code:
#include <amxmodx> 

/* ===========================================================================​​============================= 
 *         [ Plugin initiation ] 
 * ===========================================================================​​===========================*/ 
  
#define IsUserAdmin(%1) ( get_user_flags( %1 ) & ADMIN_KICK ) 

const RETRY_DURATION 60

new 
Trie:g_tPlayer

static 
szIp[33][22];

public 
plugin_init( ) 

    
register_plugin"Anti retry","1.0b","Manu" ); 
     
    
g_tPlayer TrieCreate( ); 


public 
plugin_end( ) 
    
TrieDestroyg_tPlayer ); 

/* ===========================================================================​​============================= 
 *         [ Functions ] 
 * ===========================================================================​​===========================*/ 

public client_putinserveriId 
{
    if(
is_user_botiId)) return;
    
    static 
iTimeget_user_ipiId,szIp[iId],charsmaxszIp[] ),); 
     
    if( 
TrieKeyExistsg_tPlayer,szIp ) ) 
    { 
        
TrieGetCellg_tPlayer,szIp[iId],iTime ); 
         
        if( 
get_systime( ) < iTime )  {
            
server_cmd"kick #%d ^"Tiempo de esperA: %d segundos ]^"",get_user_useridiId ),iTime get_systime( ) ); }
    } 


public 
client_disconnectiId 

    if( 
IsUserAdminiId ) ) 
        return; 
      
        
TrieSetCellg_tPlayer,szIp[iId],get_systime( ) + RETRY_DURATION ); 

__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 02-11-2019 at 15:51.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 02-12-2019 , 04:06   Re: Help with anti-retry plugin not working as expected
Reply With Quote #9

You should only mark the client as "disconnected and will be kicked next time they enter" only after client_putinserver, i.e. if they are fully connected. client_disconnect can be called before client_putinserver, as is in your case.
__________________
klippy is offline
rtxa
Senior Member
Join Date: Mar 2018
Location: Argentina
Old 02-15-2019 , 00:50   Re: Help with anti-retry plugin not working as expected
Reply With Quote #10

Quote:
Originally Posted by KliPPy View Post
You should only mark the client as "disconnected and will be kicked next time they enter" only after client_putinserver, i.e. if they are fully connected. client_disconnect can be called before client_putinserver, as is in your case.
I think I have already done something like that, the difference was that I will only kick him if he has already spawn, but issue still not fixed. Maybe another way can be wait like 15 seconds after client_putinserver and then mark him for kick?

Last edited by rtxa; 02-15-2019 at 00:53.
rtxa is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 15:10.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode