Jump to content
  • 0

Question

Posted

i try to add at my Event dualbox check, i put at "addParticipant " this:

	      String ip = playerInstance.getClient().getConnection().getInetAddress().getHostAddress();
	      {
	          if (playerInstance.getClient().getConnection().getInetAddress().getHostAddress().equalsIgnoreCase(ip))
	          {
	             playerInstance.sendMessage("You have already joined the event with another character.");
	              return false;
	          }
	      }

and now i cant join at my event with one window, not even with dual box :P

maybe some one know whats wrong with this code?

Recommended Posts

  • 0
Posted (edited)

i try to add at my Event dualbox check, i put at "addParticipant " this:

	      String ip = playerInstance.getClient().getConnection().getInetAddress().getHostAddress();
	      {
	          if (playerInstance.getClient().getConnection().getInetAddress().getHostAddress().equalsIgnoreCase(ip))
	          {
	             playerInstance.sendMessage("You have already joined the event with another character.");
	              return false;
	          }
	      }

and now i cant join at my event with one window, not even with dual box :P

maybe some one know whats wrong with this code?

The whole code lol.. you get your IP and then you check if your IP matches with IP to decline enter in event..

You need make a Map and store the player's IP and if someone try enter, get his IP do a loop at the array and if IP exists then reject his enter, else allow him and store his IP on the map. And in case he unregister remember to remove his IP from the map.

Edited by AccessDenied
  • 0
Posted (edited)

Ultimately you need to store all the joined players' ips in a list and then check if the list contains the joining players ip. If it does then reject him.

However if he is playing on net cafes, the whole net cafe if fucked.

 

 

The whole code lol.. you get your IP and then you check if your IP matches with IP to decline enter in event..

You need make a Map and store the player's IP and if someone try enter, get his IP do a loop at the array and if IP exists then reject his enter, else allow him and store his IP on the map. And in case he unregister remember to remove his IP from the map.

 

Why the hell would you need a Map?? You don't need a key,value. Every ip is meant to be unique in itself lol.

 

 

"You need to make a map and loop at the array" - Access 2016

Edited by .Elfocrash
  • 0
Posted (edited)

Ultimately you need to store all the joined players' ips in a list and then check if the list contains the joining players ip. If it does then reject him.

However if he is playing on net cafes, the whole net cafe if fucked.

 

 

Why the hell would you need a Map?? You don't need a key,value. Every ip is meant to be unique in itself lol.

 

Lel i meant List , i started map i ended up list lol, anyway he got the point fuck the map i meant list. i was doing a party re-join in case of DC system that using map and stayed in my mind.

 

List<InetAddress> _ips = new ArrayList<InetAddress>(); //this anyway..

 

Stop being bad at me all the time :'( i hate youuuuuu >.> 

Edited by AccessDenied
  • 0
Posted

Lel i meant List , i started map i ended up list lol, anyway he got the point fuck the map i meant list. i was doing a party re-join in case of DC system that using map and stayed in my mind.

 

List<InetAddress> _ips = new ArrayList<InetAddress>(); //this anyway..

 

Stop being bad at me all the time :'( i hate youuuuuu >.> 

no ofc not this way. .getHostAddress() is a string.

You don't wanna check on a higher level because the InetAddress class holds more stuff that what you need to do the comparison so you would still need to do a string comparison.

  • 0
Posted (edited)

no ofc not this way. .getHostAddress() is a string.

You don't wanna check on a higher level because the InetAddress class holds more stuff that what you need to do the comparison so you would still need to do a string comparison.

ye ye ok >.> i didn't check the String ip

 

So again to the owner of topic since Tessa and Elfo both united against me cause they hate me do this:

List<String> _ips = new ArrayList<String>(); //legs ftw

String ip = playerInstance.getClient().getConnection().getInetAddress().getHostAddress();
{
   if (_ips.contain(ip))
   {
     playerInstance.sendMessage("You have already joined the event with another character.");
	 return false;
   }
  else
   {
     _ips.add(ip);
	 /Code in case of success
   }
}

Or use a HashSet like this

 

HashSet<String> hset = new HashSet<String>();

Edited by AccessDenied
  • 0
Posted

OH fuck you all -.- whats this a crew vs accessdenied? Elfo, justice, sweets,tessa  who else? >.< i hate you all ! Imma go to my bed and watch Everything wrong with xmen last stand :'( assholes!

  • 0
Posted

ye ye ok >.> i didn't check the String ip

 

So again to the owner of topic since Tessa and Elfo both united against me cause they hate me do this:

List<String> _ips = new ArrayList<String>(); //legs ftw

String ip = playerInstance.getClient().getConnection().getInetAddress().getHostAddress();
{
   if (_ips.contain(ip))
   {
     playerInstance.sendMessage("You have already joined the event with another character.");
	 return false;
   }
  else
   {
     _ips.add(ip);
	 /Code in case of success
   }
}

Or use a HashSet like this

 

HashSet<String> hset = new HashSet<String>();

 

After i add this lines:

http://prnt.sc/c0gk1o

Guest
This topic is now closed to further replies.



  • Posts

    • NEW SEASON GRAND OPENING FROM - 10/07/2026, FRIDAY, 20:00 +3 GMT !
    • System folder is indeed missing @eMommy
    • No complicated KYC, instant setup after purchase!  Boost your connection speed and secure your privacy today!  Official Website: https://novproxy.com?kwd=tt-max
    • I don't know this guy and I don't care about him or the server. What I want to say I already do it. And yes, it does seem like he has some mental problems to make up these stories. 
    • L2JForge Edition Update Revision: V1.0.119  Update: 15 June – 1 July 2026  Fixes & Improvements Fixed PawnShop pagination and inactive Community Board actions. Added thread-safe caching to the PawnShop system. Fixed MMOTopVote vote tracking. Fixed PvP Event participant cleanup. Restored the missing PvP Ranking broadcast. Improved CTF flag handling and zone validation. Added Try Skin / Hat Preview handlers to the Community Board. Improved character skin appearance refreshes without requiring a restart. Improved NPC positioning to reduce train and collision abuse. Fixed Seal of Ruler casting from invalid artifact positions. Added stricter castle artifact, range and height validation. Fixed character restoration stability during Enter World. Reworked Community Board Home, Shop, Bosses and Events sections. Added live Raid/Epic Boss status and respawn information. Added upcoming PvP and GvG event schedules. Integrated character services, settings and statistics into the Community Board. Moved Vote Rewards from a voiced command into the Character Menu in Community Board. Removed the obsolete Achievements / .rewards system.  Removed unused multilingual resources and simplified datapack loading. Improved datapack startup and HTML cache stability. Added automatic build revision and build-date metadata. Reorganized runtime libraries and standardized generated server jars. Refined the Player, Creature, GameClient, Clan and Frintezza systems. Performed extensive source cleanup and reliability improvements. Updated build configuration and repository exclusions.  Work in Progress Development continues with additional gameplay fixes, performance improvements, system cleanup and more upgrades already in progress..
  • Topics

×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..