AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Drop players with restricted port (https://forums.alliedmods.net/showthread.php?t=147351)

Racoon 01-08-2011 08:07

Drop players with restricted port
 
The default client port is 27005. How is it possible to check its value when a player connects? So, if the client's port doesn't match 27005 the he will be kicked.

reinert 01-08-2011 08:16

Re: Drop players with restricted port
 
get_user_ip(), the last input should be 0, then it also gets port, then you have to check:

does IP contains 27005, if not kick him ...

Elusive138 01-08-2011 08:19

Re: Drop players with restricted port
 
Use query_client_cvar with the cvar clientport.

May I ask why you would want to kick people who want/have to use different ports?

ConnorMcLeod 01-08-2011 08:27

Re: Drop players with restricted port
 
PHP Code:

    new szIp[22], szPort[6]
    
get_user_ip(idszIpcharsmax(szIp))
    
strtok(szIpszIp1szPortcharsmax(szPort), ':')
    if( !
equal(szPort"27005") )
    {
        
// kick player here
    



xPaw 01-08-2011 08:41

Re: Drop players with restricted port
 
May i ask why?

Racoon 01-08-2011 08:48

Re: Drop players with restricted port
 
Thanks, Connor!
Quote:

Originally Posted by Elusive138 (Post 1388841)
Use query_client_cvar with the cvar clientport.

May I ask why you would want to kick people who want/have to use different ports?

Fake players keep flooding the servers. They change their names & Ip very quickly, so it's almost impossible to ban them... But they connect via different ports, like 2230, 4011, etc. I don't have access to my provider's router. So for now it's kinda solution to accept only 27005 connections thanks to this brief code.


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

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