Jump to content

Recommended Posts

Posted

Wouldn't it be better with sockets? I used to face problems trading datagram packets between machines who belong to different networks.

choose DatagramSockets because Sockets had a limitation in connection(only 1 client can connect)  because of  streams 

Posted

choose DatagramSockets because Sockets had a limitation in connection(only 1 client can connect)  because of  streams 

 

In combination with threads you can connect to multiple clients. But, in this occasions, it seems that Datagrams are fine, by the time packet order doesn't matter.

 

Also, you propably forgot to send the online data back to the client, at the online command.

Posted

In combination with threads you can connect to multiple clients. But, in this occasions, it seems that Datagrams are fine, by the time packet order doesn't matter.

I was afraid of packet loss/order but most of people going to use it through localhost and if machine I think machine have connection speed enough to send and recieve data without any problems.

 

Also, you propably forgot to send the online data back to the client, at the online command.

updated thanks

Posted

U guys suck at channels and threading.

 

Datagram = (unreliable connection - that's its naming, but its a good thing!) simple minded. Connection - W <-> R, end; Perfect for telnets. Or command servers.

TCP = (Transport Protocol) bad for such a thing, you need to maintain a connection, that is always vulnerable.

 

You guys should check out SocketChannels and Datagram channels in the nio package.

 

Edit: Dat http://docs.oracle.com/javase/7/docs/api/java/nio/channels/package-summary.html

Posted

Also, you MUST add some more server-side checks about the password, because in that way if someone codes his own gui, which doesn't ask for a password, he would be able to send commands normally.

 

A good idea is that after password check, the server should accept packets only by the approved ip address.

Posted

Also, you MUST add some more server-side checks about the password, because in that way if someone codes his own gui, which doesn't ask for a password, he would be able to send commands normally.

 

A good idea is that after password check, the server should accept packets only by the approved ip address.

Just a boolean in server-side code.

Posted

Sorry, for keep messing with this one, but you reminded me to add a telnet system to pes, and while I was working on it I also realised that your client is not working too. But, the sample client that I coded worked fine.

 

telnet

 

package com.pauler;

import java.io.IOException;
import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.net.InetAddress;
import java.net.SocketException;
import java.net.UnknownHostException;

public class TelnetClient {

DatagramSocket socket;

public TelnetClient() {
	while (true) {
		try {
			socket = new DatagramSocket();
		} catch (SocketException e1) {
			// TODO Auto-generated catch block
			e1.printStackTrace();
		}

		try {
			sendData("wswsws".getBytes(), InetAddress.getByName("127.0.0.1"), 1234);
		} catch (UnknownHostException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

		try {
			Thread.sleep(3000);
		} catch (InterruptedException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
}

public static void main(String[] args) {
	getInstance();
}

public static TelnetClient getInstance() {
	return SingletonHandler._instance;
}

public void sendData(byte[] data, InetAddress ipAddress, int packetPort)
{
	DatagramPacket packet = new DatagramPacket(data, data.length, ipAddress, packetPort);
	try
	{
		socket.send(packet);
	}
	catch (IOException e)
	{
		e.printStackTrace();
	}
	System.out.println("sent : " + new String(data));
}

private static class SingletonHandler {
	protected static final TelnetClient _instance = new TelnetClient();
}
}

 

 

Posted

Sorry, for keep messing with this one, but you reminded me to add a telnet system to pes, and while I was working on it I also realised that your client is not working too. But, the sample client that I coded worked fine.

 

telnet

 

package com.pauler;

import java.io.IOException;
import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.net.InetAddress;
import java.net.SocketException;
import java.net.UnknownHostException;

public class TelnetClient {

DatagramSocket socket;

public TelnetClient() {
	while (true) {
		try {
			socket = new DatagramSocket();
		} catch (SocketException e1) {
			// TODO Auto-generated catch block
			e1.printStackTrace();
		}

		try {
			sendData("wswsws".getBytes(), InetAddress.getByName("127.0.0.1"), 1234);
		} catch (UnknownHostException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

		try {
			Thread.sleep(3000);
		} catch (InterruptedException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
}

public static void main(String[] args) {
	getInstance();
}

public static TelnetClient getInstance() {
	return SingletonHandler._instance;
}

public void sendData(byte[] data, InetAddress ipAddress, int packetPort)
{
	DatagramPacket packet = new DatagramPacket(data, data.length, ipAddress, packetPort);
	try
	{
		socket.send(packet);
	}
	catch (IOException e)
	{
		e.printStackTrace();
	}
	System.out.println("sent : " + new String(data));
}

private static class SingletonHandler {
	protected static final TelnetClient _instance = new TelnetClient();
}
}

 

 

Damn, forgot to add port when you connect . im fking idiot

so the jar was sending to other port this is why the server didn't respond.

Updated the jar

bq8s.png

download : http://www.4shared.com/file/jMwT12D0/Telnet.html

code : http://pastebin.com/gcH4J8Xz

 

Also added a boolean check if connected to be more secured

 

really sorry i dont know how i forgot to add the port

 

Posted

Damn, forgot to add port when you connect . im fking idiot

so the jar was sending to other port this is why the server didn't respond.

Updated the jar

bq8s.png

download : http://www.4shared.com/file/jMwT12D0/Telnet.html

code : http://pastebin.com/gcH4J8Xz

 

Also added a boolean check if connected to be more secured

 

really sorry i dont know how i forgot to add the port

 

Again, it is not secured. Once it gets to true, everyone would be able to connect by a custom client.
Posted

Again, it is not secured. Once it gets to true, everyone would be able to connect by a custom client.

So only 1 connection to server ?

 

added video

 

Guest
This topic is now closed to further replies.


  • Posts

    • I wouldn't expect something less, since you work with Psadek (or I maybe mistake you with NightW0lf from itopz, in that case soz) Let's throw rocks at Java Golds and elevate "original L2OFF Golds", no?
    • We are delighted to announce our partnership with the leading resource, Active Anticheat, specializing in protection against bot programs, clickers, and additional modules for the game client that enhance the experience for both you and the players!   When you purchase Active Anticheat for our product, you will also receive a $50 discount.   Here's a brief overview of the features of Active Anticheat: Best protection against bots, including private and premium versions. Window limitation. HWID spoofing protection. Virtual machine protection. File hash protection for client files, preventing players from modifying them (e.g., interface files). Encryption of any game files. Integration with Discord to attract new players! Additional plugins: - Window with saved player logins/passwords. Players no longer need to enter them every time! - HWID sending to the game server. - Game window optimizer for quick switching. - Background FPS adjustment. - Window name customization in the format "%character_name% - %server_name%". - Ctrl+C/V permission. - Login and password saving (for Interlude -> High Five). - Launching the browser via server packets. - Launching interface events via server packets. - Interlude: fixing a known game bug (History: UpdateAnimation <- AActor::Tick <- TickAllActors <- ULevel::Tick <- (NetMode=0) <- TickLevel <- UGameEngine::Tick <- UpdateWorld <- MainLoop). - Interlude: debuff feature. 9) All of this is available without modifying the game server code (some plugins may require minor changes). Take note of newest plugin, which is highly useful: Guides section
    • The Lucera2 Multiprotocol is an advanced server branch for Lineage 2 that enables seamless support for multiple client versions on a single server instance. This allows players to connect and play using either the legacy (old) client or the newer Classic client simultaneously, without any compatibility issues or loss of functionality. Key Benefits Dual Client Support: Both the old Interlude client and Classic: Secret of Empire 2.6 client can run concurrently on the same server. All features from the Classic client (e.g., enhanced UI, new mechanics) remain fully available, while the old client retains its alternative features (e.g., simplified interfaces for lower-end hardware). Expanded Player Base: Ideal for regions with limited access to modern gaming setups, as it accommodates a wider range of devices and preferences, merging Legacy and Classic communities into one forum section for unified discussions. No Functionality Gaps: Extensive testing ensures zero disruptions—players on either client experience complete game integrity, including quests, PvP, raids, and custom Lucera2 subsystems. You can fully test and explore all aspects of Multiprotocol on the dedicated Test Server. Supported Protocols C6 (Old Client): Protocol versions 740–770. Classic Client (Secret of Empire 2.6): Protocol versions 166–192.
    • Connect to the server you need to >>>download<<< game client launch from /system_en/. Login server setup on auto registration, admin rights in game by default . Or you can use a patch specifying the l2.ini Connect to address classic.lucera2.com if you already have a game client Download updated patch All major/minor subsystems operate in a proper view. Absolutely ready to combat the server.
  • Topics

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