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;
}

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...