Kryonet Connection ID Safety

Context: (SERVER-SIDE) Server uses Listener.class to process Client requests via:

public void received (Connection connection, Object object);

Question: with the following function call (from com.esotericsoftware.kryonet.Connection.class):

connection.getID();

…is integer variable ‘id’ uneditable by respective Connection, and can thereby be used by Server as a secure identifier for any given Connection under any and all circumstances?

I believe Kroynet gives each new connection a incremental connection ID. So the first client will have ID: 0, the second client ID: 2 and so on.

Connections ID’s aren’t persistent, so client A won’t have the same ID each time they login.

Well you can have the client send an packet that will have the id (login packet) and the server would have a txt file where the id will be stored and if it has that id the server will send a packet (conform login packet) and if not server would disconnect the client. Simple.

The ID can’t change once generated. Each client has its own but after disconnecting and reconnecting it won’t be the same.
So you can use the ID to identify the client until it disconnects and it works well, you don’t have to worry about that.

Check that since your saying
1st) 0
2Nd) 2 :stuck_out_tongue:

This is the answer I was looking for - cheers.