Jump to content
  • 0

IP limit for 1 ip can online 2 cha online Request


Question

Posted (edited)

Hi i want to know how to set 1 ip can play 2 char online only . If use 3 cha will get disconnect on 3nd cha  can help me please?

i try many code but cannot noting happen.🥲🥲🥲

can some one how to create and where to use the code in please

 

Edited by aonniemnoi

6 answers to this question

Recommended Posts

  • 1
Posted

Editing GameClient.java is harder for you, so i guest you add a simple line check at file EnterWorld.java

such as:

 

if (L2World.getInstance().getPlayers().stream().filter(s -> s.IP().equalsIgnoreCase(activeChar.getIP()).count() > 2)
{
   activeChar.close(false);
   return;
}

 

  • 0
Posted
27 minutes ago, Kara said:

Editing GameClient.java is harder for you, so i guest you add a simple line check at file EnterWorld.java

such as:

 

if (L2World.getInstance().getPlayers().stream().filter(s -> s.IP().equalsIgnoreCase(activeChar.getIP()).count() > 2)
{
   activeChar.close(false);
   return;
}

 

here I add then show this. how to fix this please?

Untitled.png

  • 0
Posted
1 hour ago, aonniemnoi said:

here I add then show this. how to fix this please?

Untitled.png

The code i gave you was handwritten. You can't just copy paste. I just gave you the idea.

There is a missing ) in the end but still the getIP() is not existing. You need replace the getIP() with what method retrieve your char's IP.

  • 0
Posted
58 minutes ago, Kara said:

The code i gave you was handwritten. You can't just copy paste. I just gave you the idea.

There is a missing ) in the end but still the getIP() is not existing. You need replace the getIP() with what method retrieve your char's IP.

Can you help me example for me please? I no have any idea

  • 0
Posted
On 9/8/2021 at 12:00 AM, Kara said:

The code i gave you was handwritten. You can't just copy paste. I just gave you the idea.

There is a missing ) in the end but still the getIP() is not existing. You need replace the getIP() with what method retrieve your char's IP.

Like this?

 

if (L2World.getInstance().getPlayers().stream().filter(s -> s.IP().equalsIgnoreCase(activeChar.getIP(0.0.0.0)).count() > 2)
{
   activeChar.close(false);
   return;
}

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