split server #3

This commit is contained in:
Sen 2025-05-03 23:14:58 +02:00
parent 8f8abfa0d3
commit 19f3813338
6 changed files with 83 additions and 5 deletions

View file

@ -101,6 +101,7 @@ import game.packet.SPacketMapChunkBulk;
import game.packet.SPacketMessage;
import game.packet.SPacketMessage.Type;
import game.packet.SPacketPlayerPosLook;
import game.packet.SPacketServerTick;
import game.packet.SPacketSetExperience;
import game.packet.SPacketSkin;
import game.packet.SPacketTrades;
@ -188,6 +189,7 @@ public class Player extends NetHandler implements ICrafting, Executor
private int ping;
private boolean deleted;
private String password;
private boolean profiling;
private int selectionDim = Integer.MIN_VALUE;
private ClipboardBlock[][][] clipboard;
@ -274,8 +276,8 @@ public class Player extends NetHandler implements ICrafting, Executor
this.pingKey = (int)this.lastPingTime;
this.sendPacket(new SPacketKeepAlive(this.pingKey));
}
// if(this.local)
if(this.admin && this.profiling)
this.sendPacket(new SPacketServerTick((int)this.server.getLastTick()));
if(this.respawnTimer > 0) {
if(--this.respawnTimer == 0) {
this.respawnPlayer();
@ -2895,6 +2897,16 @@ public class Player extends NetHandler implements ICrafting, Executor
});
}
break;
case START_PROFILING:
if(this.admin)
this.profiling = true;
break;
case STOP_PROFILING:
if(this.admin)
this.profiling = false;
break;
default:
throw new IllegalArgumentException("Ungültige Aktion!");