Jump to content

Ping System(ping count)


Recommended Posts

i was selling this. now its for free i don't want to sell it any more.

 

take a look here:

 

 

L2PcInstance.java

 

			public class PingP implements Runnable
		{
			@Override
			public void run()
			{
				try
				{
					ping("www.google.gr");
				}
				catch (Exception e)
				{
					e.printStackTrace();
				}
				ThreadPoolManager.getInstance().scheduleGeneral(new PingP(), 4 * 1000);

			}

		 public void ping(String addr) throws Exception 
		 {

		        final Socket socket = new Socket();	 
		        final long startTime = System.currentTimeMillis();
		        socket.connect(new InetSocketAddress(addr, 80));			       	                		        		       
		        final long endTime = System.currentTimeMillis();		        
		        final int ping = ((int) (endTime-startTime));
                    sendPacket(new ExShowScreenMessage(1,0,ExShowScreenMessage.SMPOS.TOP_RIGHT,false,1,0,0,false,9999,false,"Ping: " + ping));
		        socket.close();
		        
		   }

		}
		public void startPing()
		{
			ThreadPoolManager.getInstance().scheduleGeneral(new PingP(), 4 * 1000);
		}

 

EntreWorld.java

 

activeChar.startPing();

 

tips: just change the ip(put your server no-ip) and the port. also you can change the style you can put it in a window at the top(right) of the screen(like pc bang points) or dunno do anything you want i just gave the idea. :)

Link to comment
Share on other sites

So basically this 'ping' is just the number of milliseconds passed to make a socket connection with a site...?

 

yeap, and as it seems it has nothing to do with the L2PcInstance class ... so for every L2PcInstance object that very same algorithm is cast, it should'nt come with L2PcInstance I think but with a different public class

Link to comment
Share on other sites

yeap, and as it seems it has nothing to do with the L2PcInstance class ... so for every L2PcInstance object that very same algorithm is cast, it should'nt come with L2PcInstance I think but with a different public class

Lol, read that: http://maxcheaters.com/forum/index.php?topic=274764.0 mr public class guy, also about field/method modifiers on oracle XD

 

It can be anywhare that, cool thing, but it gets u the ping of a site? You need to specify the socket that u are using the player's inet adress if u wanna do it server side, but it should be done client side really. Aaaand its totally done wrong. check this: http://docs.oracle.com/javase/6/docs/api/java/net/InetAddress.html#isReachable(int). Thats a ping test, with a timeout :), It halts the thread so u can use the same method with system.milis. You can get the inet like so: InetAdress.getByAddress(new byte[] {127, 0, 0, 1});// 127  0 0 1 being the ip that u replace; you cna get it from the player's connection then getting his address as byte array or as string(and then splitting it so: \\..split("\\.")), depends what ur l2jmmoco.e supports.

 

See: http://docs.oracle.com/javase/6/docs/api/java/net/InetAddress.html#getByAddress(byte[])

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.


  • Posts

    • 📢 𝗦𝐭𝐚𝐫𝐭 𝐨𝐧 𝟐𝟲/𝟏𝟎/𝟐𝟎𝟐𝟒  𝟏6:𝟎𝟎 𝑳𝒐𝒏𝒅𝒐𝒏 𝑻𝒊𝒎𝒆 ⚔️ 𝗥𝗮𝘁𝗲𝘀: 𝗫𝗣 𝟐𝟱𝐗, 𝗔𝗱𝗲𝗻𝗮 𝟏𝟎𝐗, 𝗦𝗽𝗼𝗶𝗹 𝟏𝟎𝐗, 𝗗𝗿𝗼𝗽 7𝐗, 💬 𝗠𝗮𝘅 𝗲𝗻𝗰𝗵𝗮𝗻𝘁 +𝟭𝟲 𝘄𝗶𝘁𝗵 𝟱𝟎% 𝗻𝗼𝗿𝗺𝗮𝗹 𝗮𝗻𝗱 𝟲𝟎% 𝗯𝗹𝗲𝘀𝘀𝗲𝗱, 👉 𝗔𝘂𝘁𝗼 𝗲𝘃𝗲𝗻𝘁𝘀 🌍 𝗪𝗲𝗯𝗦𝗶𝘁𝗲: https://l2glorious.online/
    • Well, I'm looking for errors like the 1599 bug in attack speed bro Well, I'm looking for errors like the 1599 bug in attack speed bro
    • Hey! I’ve run into similar issues before. They usually track you through IPs, cookies, and sometimes even browser fingerprints, so just changing your MAC or IP probably won’t do the trick. I found that using a VPN really helps mask your IP, and clearing your cookies regularly makes a big difference. Also, browsing in incognito mode or using something like the Brave browser can help keep things private.
    • If you're trying to boost your attack speed in Interlude, I'd recommend focusing on optimizing your gear and skills instead of hunting for bugs. I’ve found that mixing up your equipment and looking for buffs that enhance attack speed can make a big difference. It’s also worth experimenting with different skill combos to maximize your damage output.
    • That code is shared of "Server Shares & Files [L2J]" section. Requires Java source of the server and interface modification.
  • Topics

×
×
  • Create New...