Server packet priority fix
This commit is contained in:
@@ -322,7 +322,7 @@ public class NetClient implements ApplicationListener{
|
||||
ui.join.connect(ip, port);
|
||||
}
|
||||
|
||||
@Remote(targets = Loc.client)
|
||||
@Remote(targets = Loc.client, priority = PacketPriority.high)
|
||||
public static void ping(Player player, long time){
|
||||
Call.pingResponse(player.con, time);
|
||||
}
|
||||
|
||||
@@ -632,7 +632,7 @@ public class NetServer implements ApplicationListener{
|
||||
return Float.isInfinite(f) || Float.isNaN(f);
|
||||
}
|
||||
|
||||
@Remote(targets = Loc.client, unreliable = true)
|
||||
@Remote(targets = Loc.client, unreliable = true, priority = PacketPriority.high)
|
||||
public static void clientSnapshot(
|
||||
Player player,
|
||||
int snapshotID,
|
||||
@@ -830,7 +830,7 @@ public class NetServer implements ApplicationListener{
|
||||
}
|
||||
}
|
||||
|
||||
@Remote(targets = Loc.client)
|
||||
@Remote(targets = Loc.client, priority = PacketPriority.high)
|
||||
public static void connectConfirm(Player player){
|
||||
if(player.con.kicked) return;
|
||||
|
||||
|
||||
@@ -306,14 +306,17 @@ public class Net{
|
||||
* Call to handle a packet being received for the server.
|
||||
*/
|
||||
public void handleServerReceived(NetConnection connection, Packet object){
|
||||
object.handled();
|
||||
|
||||
try{
|
||||
//handle object normally
|
||||
if(serverListeners.get(object.getClass()) != null){
|
||||
serverListeners.get(object.getClass()).get(connection, object);
|
||||
}else{
|
||||
object.handleServer(connection);
|
||||
if(connection.hasConnected || object.getPriority() == Packet.priorityHigh){
|
||||
object.handled();
|
||||
|
||||
//handle object normally
|
||||
if(serverListeners.get(object.getClass()) != null){
|
||||
serverListeners.get(object.getClass()).get(connection, object);
|
||||
}else{
|
||||
object.handleServer(connection);
|
||||
}
|
||||
}
|
||||
}catch(ValidateException e){
|
||||
//ignore invalid actions
|
||||
|
||||
@@ -157,5 +157,10 @@ public class Packets{
|
||||
mods.add(TypeIO.readString(buffer));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getPriority(){
|
||||
return priorityHigh;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user