Raised This Month: $ Target: $400
 0% 

Drop players with restricted port


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Racoon
Senior Member
Join Date: Mar 2008
Location: Ukraine
Old 01-08-2011 , 08:07   Drop players with restricted port
Reply With Quote #1

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.
Racoon is offline
Send a message via ICQ to Racoon
reinert
Veteran Member
Join Date: Feb 2007
Old 01-08-2011 , 08:16   Re: Drop players with restricted port
Reply With Quote #2

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 ...
reinert is offline
Elusive138
Senior Member
Join Date: Dec 2010
Old 01-08-2011 , 08:19   Re: Drop players with restricted port
Reply With Quote #3

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?
Elusive138 is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 01-08-2011 , 08:27   Re: Drop players with restricted port
Reply With Quote #4

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

__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 01-08-2011 , 08:41   Re: Drop players with restricted port
Reply With Quote #5

May i ask why?
__________________
xPaw is offline
Racoon
Senior Member
Join Date: Mar 2008
Location: Ukraine
Old 01-08-2011 , 08:48   Re: Drop players with restricted port
Reply With Quote #6

Thanks, Connor!
Quote:
Originally Posted by Elusive138 View Post
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.

Last edited by Racoon; 01-08-2011 at 08:53.
Racoon is offline
Send a message via ICQ to Racoon
Reply


Thread Tools
Display Modes

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 02:02.


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