Jump to content
  • 0

[ask] Box limit only for Online pg


Question

Posted

I have a server with 2 max client per IP limit, but I want to set the server like: MAX 2 client per IP (ONLINE) and Infinite disconnected (sell/buy/privatecreation) pg per IP...

 

How can I set this?

10 answers to this question

Recommended Posts

  • 0
Posted

Check Enterworld.java and put condition

if(!activeChar.isOnline) 

u serious? this is not going to work.

 

You will need to do such check in EnterWorld at the beginning

String ip = activeChar.getClient().getConnection().getInetAddress().getHostAddress()
int onlinePerIp = 0;
for(L2PcInstance player : L2World.getInstance().getAllPlayers())//not sure about getAllPlayers, i dont remember method name.
if(player.getClient().getConnection().getInetAddress().getHostAddress().equals(ip))
{
onlinePerIp++;
if(onlinePerIp>=1)
{
getClient().closeNow();
return;
}

thats it i think, good luck :)

  • 0
Posted

@Jokkerino

I think that condition is useless. How is supposed anyone to be offline while logging in? O.o...

 

@author

Should be one method when a char logout that remove it from being found by dualbox limit.

You must find it and add into offline trader method.

 

Edit: maybe it's what vampir posted, it depends on how is your code working, did u show it to us?

  • 0
Posted

I don't see the path that has enterworld.java Q_Q

 

i dont know what u mean, enterworld is in client packets in network as i remember, u need to add my code after setting activeChar.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock