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

    • buenas no puedo poner el server On para que entren mis amigos   LoginServer # ================================================= # Settings authorization server # ================================================= # Host and port for client connections LoginserverHostname = 127.0.0.1 LoginserverPort = 2106 # Host and port for game servers LoginHost = 192.168.100.25 ( mi Ip interna) LoginPort = 9014     GameServer   # =============================== # Network Configuration Server  # # =============================== # IP which Bind Game server, * - all possible GameserverHostname = * GameserverPort = 7777 # This is transmitted to the clients connecting from an external network, so it has to be a public IP or resolvable hostname ExternalHostname = 186.158.144.71 ( Ip externa ovbio) # This is transmitted to the client from the same network, so it has to be a local IP or resolvable host name InternalHostname = 192.168.100.25 # AdvIpSystem Make more GameServerIDs. Every Ip should be Protected by a DDoS Guard. # Your Server will have Success with this system Online. AdvIPSystem = False # Address \ port LS LoginPort = 9014 LoginHost = 192.168.100.25 LoginUseCrypt = true # How to request ID of LS RequestServerID = 4 # Permission to take a different id, if requested busy AcceptAlternateID = False     en que estaria fallando ?    
    • mporeis na valeis l2jaCis i kapoio etimo project  free sources gia aCis edw https://acis.i-live.eu/index.php?topic=1974.0 server install ktl edw https://acis.i-live.eu/index.php?topic=10190.0 an dn vgaleis akrh steile mou discord margazeas2
    • Hello! I am new to l2 server creation and i need your help please!!! I want to make my own l2 interlude c6 server with custom thing in it.  I need help with where to start. What source pack to pick to start and what to do. Please if you can help me i would appreciate it very much !!!
    • Need Discord with rare badge? VISIT US AND SHOP WITH US! NEW STOCK   Aged, Early Supporter Discord Accounts I sell HQ Aged and Early, Discord Accounts that are inactive and not flagged by discord at cheap prices   If you want to contact me, you can add me on discord: worldcoldwar Features: Format - age : email : pass : token Not flagged and undetected by discord HQ % With OGE Emails, password etc can be changed Unverified Early Supporter 24M Boost Badge HypeSquad Events Early Verified Bot Developer Early Supporters SHOP LINK: disvault1.mypaylix.gg/ For PayPal payments, please open a ticket. If you experience any problems with cryptocurrency payments, please open a ticket as well.
  • 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..