Jump to content
  • 0

Help IP limit for 1 ip can online 2 cha online Request


aonniemnoi
 Share

Question

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
Link to comment
Share on other sites

6 answers to this question

Recommended Posts

  • 1

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

 

Link to comment
Share on other sites

  • 0

@Kara

 

you can restrict by config if you add a client guard (witch you should add) to protect you from client hacks

Link to comment
Share on other sites

  • 0
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

Link to comment
Share on other sites

  • 0
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.

Link to comment
Share on other sites

  • 0
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

Link to comment
Share on other sites

  • 0
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;
}
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

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.

 Share



×
×
  • 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 Disbaled AdBlock