Jump to content
  • 0

Request some java help


Question

Posted

Hi, this topic is specially for developers..Or for the ppl who used it before..

I'm using acis pack.. also i added Hyperfilter protection..

What changes should i make in pack to disable the ip protections since all players got same ip??

 

Would be rly helpfull if anyone know to configure it somehow..Thanks!

11 answers to this question

Recommended Posts

  • 0
Posted

You just need to find which class object is counting the IPs in the source and disable it... generally it does a check '<= 3', so you should be able to find it.

  • 0
Posted

Hi, this topic is specially for developers..Or for the ppl who used it before..

I'm using acis pack.. also i added Hyperfilter protection..

What changes should i make in pack to disable the ip protections since all players got same ip??

 

Would be rly helpfull if anyone know to configure it somehow..Thanks!

 

i had same problem ;@

  • 0
Posted

Go to :

 

IPV4Filter.java

 

Change :

 

@Override
public boolean accept(SocketChannel sc)
{
	InetAddress addr = sc.socket().getInetAddress();
	int h = hash(addr.getAddress());

	long current = System.currentTimeMillis();
	Flood f;
	synchronized (_ipFloodMap)
	{
		f = _ipFloodMap.get(h);
	}
	if (f != null)
	{
		if (f.trys == -1)
		{
			f.lastAccess = current;
			return false;
		}

		if (f.lastAccess + 1000 > current)
		{
			f.lastAccess = current;

			if (f.trys >= 3)
			{
				f.trys = -1;
				return false;
			}

			f.trys++;
		}
		else
		{
			f.lastAccess = current;
		}
	}
	else
	{
		synchronized (_ipFloodMap)
		{
			_ipFloodMap.put(h, new Flood());
		}
	}

	return true;
}

 

By :

 

@Override
public boolean accept(SocketChannel sc)
{
	InetAddress addr = sc.socket().getInetAddress();
	int h = hash(addr.getAddress());

	long current = System.currentTimeMillis();
	Flood f;
	synchronized (_ipFloodMap)
	{
		f = _ipFloodMap.get(h);
	}
	if (f != null)
	{
		if (f.trys == -1)
		{
			f.lastAccess = current;
			return true;
		}

		if (f.lastAccess + 1000 > current)
		{
			f.lastAccess = current;

			if (f.trys >= 3)
			{
				f.trys = -1;
				return true;
			}

			f.trys++;
		}
		else
		{
			f.lastAccess = current;
		}
	}
	else
	{
		synchronized (_ipFloodMap)
		{
			_ipFloodMap.put(h, new Flood());
		}
	}

	return true;
}

 

Recompile both servers and GG...

 

(This is just for HyperFilter, since they already 'do' IP Protection for you, so you don't need L2J one...).

  • 0
Posted

Go to :

 

IPV4Filter.java

 

Change :

 

@Override
public boolean accept(SocketChannel sc)
{
	InetAddress addr = sc.socket().getInetAddress();
	int h = hash(addr.getAddress());

	long current = System.currentTimeMillis();
	Flood f;
	synchronized (_ipFloodMap)
	{
		f = _ipFloodMap.get(h);
	}
	if (f != null)
	{
		if (f.trys == -1)
		{
			f.lastAccess = current;
			return false;
		}

		if (f.lastAccess + 1000 > current)
		{
			f.lastAccess = current;

			if (f.trys >= 3)
			{
				f.trys = -1;
				return false;
			}

			f.trys++;
		}
		else
		{
			f.lastAccess = current;
		}
	}
	else
	{
		synchronized (_ipFloodMap)
		{
			_ipFloodMap.put(h, new Flood());
		}
	}

	return true;
}

 

By :

 

@Override
public boolean accept(SocketChannel sc)
{
	InetAddress addr = sc.socket().getInetAddress();
	int h = hash(addr.getAddress());

	long current = System.currentTimeMillis();
	Flood f;
	synchronized (_ipFloodMap)
	{
		f = _ipFloodMap.get(h);
	}
	if (f != null)
	{
		if (f.trys == -1)
		{
			f.lastAccess = current;
			return true;
		}

		if (f.lastAccess + 1000 > current)
		{
			f.lastAccess = current;

			if (f.trys >= 3)
			{
				f.trys = -1;
				return true;
			}

			f.trys++;
		}
		else
		{
			f.lastAccess = current;
		}
	}
	else
	{
		synchronized (_ipFloodMap)
		{
			_ipFloodMap.put(h, new Flood());
		}
	}

	return true;
}

 

Recompile both servers and GG...

 

(This is just for HyperFilter, since they already 'do' IP Protection for you, so you don't need L2J one...).

 

Edit: Now i see

  • 0
Posted

Maybe if you check with attention, you will notice :P, it is just a small 'hacky fix' :D.

 

I saw...

				return false;

 

to

				return true;

  • 0
Posted

Thanks alot! I've fixed it.

Apreciate your help.

Soz for the wrong side but i was rly need a fast help and i got it ^^

Guest
This topic is now closed to further replies.


×
×
  • Create New...