IP connection limit

Results 1 to 7 of 7
  1. #1
    Apprentice Haarhus is offline
    MemberRank
    Mar 2015 Join Date
    19Posts

    IP connection limit

    Hey guys is there a way to limit the connection from the same ip to 2 connections ? to avoid perhaps multiboxing e.t.c ? Couldnt really find anything about that in the forum nor in the google , if there is something i probably missed it .


  2. #2

    Re: IP connection limit

    maybe @Mecanik can answer u that

  3. #3
    LiveGuard Software Ltd Mecanik is offline
    MemberRank
    Jan 2012 Join Date
    404 Not FoundLocation
    343Posts

    Re: IP connection limit

    Yes there is, depends on your server, are you using webzen IOCP ?

  4. #4
    Apprentice Haarhus is offline
    MemberRank
    Mar 2015 Join Date
    19Posts

    Re: IP connection limit

    Zteam s8 files , they have glitch with the data server bugging when there are more than ~90 people online and i want to make a temporal limit so everybody can join not just 5 people with 50 accs until it get fixed

  5. #5
    LiveGuard Software Ltd Mecanik is offline
    MemberRank
    Jan 2012 Join Date
    404 Not FoundLocation
    343Posts

    Re: IP connection limit

    Well limiting people from entering the game is not a solution lol...
    Debug the dataserver to see what`s causing the problem.

  6. #6
    Apprentice Haarhus is offline
    MemberRank
    Mar 2015 Join Date
    19Posts

    Re: IP connection limit

    We solved part of the problem , it still happens but we needed a temporal solution so it doesnt bug while we try to fix it.

  7. #7
    LiveGuard Software Ltd Mecanik is offline
    MemberRank
    Jan 2012 Join Date
    404 Not FoundLocation
    343Posts

    Re: IP connection limit

    Well then you could just search through your object list, and if the ip is there allready, refuse it ( return -1 )
    If you don`t know how to do that, create a function/class like this:

    Code:
    bool CheckIpAddress(char* IpAddress)
    {
    	std::map<std::string,IP_ADDRESS_INFO>::iterator it = this->m_IpAddressInfo.find(std::string(IpAddress));
    
    	if(it == this->m_IpAddressInfo.end())
    	{
    		return ((MaxIpConnection==0)?0:1);
    	}
    	else
    	{
    		return ((it->second.IpAddressCount>=MaxIpConnection)?0:1);
    	}
    }
    
    void InsertIpAddress(char* IpAddress)
    {
    	IP_ADDRESS_INFO info;
    
    	strcpy_s(info.IpAddress,IpAddress);
    
    	info.IpAddressCount = 1;
    
    	std::map<std::string,IP_ADDRESS_INFO>::iterator it = this->m_IpAddressInfo.find(std::string(IpAddress));
    
    	if(it == this->m_IpAddressInfo.end())
    	{
    		this->m_IpAddressInfo.insert(std::pair<std::string,IP_ADDRESS_INFO>(std::string(IpAddress),info));
    	}
    	else
    	{
    		it->second.IpAddressCount++;
    	}
    }
    
    void RemoveIpAddress(char* IpAddress)
    {
    	std::map<std::string,IP_ADDRESS_INFO>::iterator it = this->m_IpAddressInfo.find(std::string(IpAddress));
    
    	if(it != this->m_IpAddressInfo.end())
    	{
    		if((--it->second.IpAddressCount) == 0)
    		{
    			this->m_IpAddressInfo.erase(it);
    		}
    	}
    }
    And use it in your server manager on new connection / add object:

    Code:
    InsertIpAddress(IPADDRESS);
    Sorry I`m at work, and this code is just taken from another source, hope you understand.



Advertisement