Jump to content

Recommended Posts

Posted

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. :)

Posted

but, shouldn't this return the MS between server - player ? cause I only see pinging back to server,

 

nvm thanks for share

Posted

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

Posted

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[])

Guest
This topic is now closed to further replies.


  • Posts

    • ➡ Discount for your purchase: APRIL (10% discount) ➡ Our Online Shop: https://socnet.store ✅ ➡ Our SMM-Boosting Panel: https://socnet.pro ✅ ➡ Telegram Shop Bot: https://socnet.shop ✅ ➡ Telegram Support: https://t.me/solomon_bog ✅ ➡ Telegram Channel: https://t.me/accsforyou_shop ✅ ➡ Discord Support: @AllSocialNetworksShop ✅ ➡ Discord Server: https://discord.gg/y9AStFFsrh ✅ ➡ WhatsApp Support: https://wa.me/79051904467✅ ➡ WhatsApp Channel: https://whatsapp.com/channel/0029Vau0CMX002TGkD4uHa2n ✅ ➡ Email Support: solomonbog@socnet.store ✅
    • ➡ Discount for your purchase: APRIL (10% discount) ➡ Our Online Shop: https://socnet.store ✅ ➡ Our SMM-Boosting Panel: https://socnet.pro ✅ ➡ Telegram Shop Bot: https://socnet.shop ✅ ➡ Telegram Support: https://t.me/solomon_bog ✅ ➡ Telegram Channel: https://t.me/accsforyou_shop ✅ ➡ Discord Support: @AllSocialNetworksShop ✅ ➡ Discord Server: https://discord.gg/y9AStFFsrh ✅ ➡ WhatsApp Support: https://wa.me/79051904467✅ ➡ WhatsApp Channel: https://whatsapp.com/channel/0029Vau0CMX002TGkD4uHa2n ✅ ➡ Email Support: solomonbog@socnet.store ✅
    • Hey. I've been looking all over the internet about this but not being able to find anything about it. I have edited systemmsg using MSG editor changing colors etc. But now I want to change and add some of the sounds as well. But I need the sound IDs for each audiofile and I dont know how to find them. Ive found all the audio files but I cant use the filename as someone said in a thread here, it only seem to take numbers. I have looked into every guide about systemmsg on this website and no one mention anything about the sound, just that its possible to add sound but nothing more. So, do anyone know how to find these sound IDs? Preferably together with the soundname of the audio file that it plays so I know which ID to use for each soundfile. Thanks in advance!
    • We are certainly not an ambulance, but we will definitely cure you of blacklists and empty pockets. Live freely with SX! Each of you will receive a trial version of SX to familiarize yourself with the product, all you have to do is post in this thread
  • Topics

×
×
  • Create New...