Jump to content
  • 0

[ask] Box limit only for Online pg


KriminalMind

Question

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?

Link to comment
Share on other sites

10 answers to this question

Recommended Posts

  • 0

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 :)

Link to comment
Share on other sites

  • 0

@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?

Link to comment
Share on other sites

  • 0

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.

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now


×
×
  • Create New...