Hello Java-Gaming!
I’m trying to enable logging on my android app using kryonet (in Android Studio).
My main activity onCreate is just simple, already tried adding this:
Log.set(Log.LEVEL_TRACE);
Didn’t work so I decided to create a main method:
public static void main(String [] args){
Log.set(Log.LEVEL_TRACE);
}
Still not working. My problem is kinda strange. I’m updating players positions on two connected devices (server instantly after receiving, sends to the second player). After some time, one client just disconnects (just drops the connection, there is no app crash). My only idea is that the packets are being sent too often:
public class GamePacketSender extends Thread
{
@Override
public void run(){
while(matchRunning){
MoveCharacter object = new MoveCharacter();
object.x = casualGameHolder.gameLoop.player_me.x_percent;
object.y = casualGameHolder.gameLoop.player_me.y_percent;
ClientSingleton.getInstance().client.sendUDP(object);
}
}
}
If there is anyone experienced, I would be grateful for help.