#Problem with java netty and Timers
1 messages · Page 1 of 1 (latest)
no place rn
have to make another message wait
I dispatch every stuffs by switch
public void dispatchServiceActivity(ChannelHandlerContext ctx, ByteBuf buf)
{
var activity = new ServiceActivity(ctx);
byte id = buf.readByte();
switch (id)
{
case ServiceActivity.move -> {
//future: check collision etc
var player = activity.getMovePlayer(buf,server.players);
server.playerToMove.add(player);
}
default -> System.out.println("Activity, Wrong id: "+id);
}
}
``` thats my system, I m just addint it to list and it should do it 20 times per second with timer
but
i dont know why, but there are issue, it updates only at time when i send another packets.
Its very crazy cause Im clearing this list very fast
at client it should update very fast too
cause its just
public void serviceMovement(ByteBuf buf, ChannelHandlerContext ctx)
{
byte id = buf.readByte();
var activity = new ServiceActivity(ctx);
switch (id)
{
case ServiceActivity.move -> {
// activity.getMovePlayer(buf,client.gamePlayers);
}
case ServiceActivity.bMove -> {
activity.readMovePlayer(buf,client.gamePlayers);
}
default -> System.out.println("Wrong packet, ServiceActivity");
}
}