SteamWar/FightSystem
Archiviert
13
1

Fix schemId 0 with autoselected schem
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Signed-off-by: Lixfel <agga-games@gmx.de>
Dieser Commit ist enthalten in:
Lixfel 2022-12-14 16:00:49 +01:00
Ursprung 6d574bd89d
Commit 5ec0fc20e6

Datei anzeigen

@ -425,6 +425,8 @@ public class PacketProcessor {
private void pasteSchem(FightTeam team) throws IOException {
int schemId = source.readInt();
if(schemId == 0)
return;
execSync(() -> team.pasteSchem(SchematicNode.getSchematicNode(schemId)));
}
@ -556,6 +558,11 @@ public class PacketProcessor {
try{
while(!source.isClosed() && !tickFinished){
int packetType = Byte.toUnsignedInt(source.readByte());
lastPackets.add(packetType);
if (lastPackets.size() > 10)
lastPackets.remove(0);
PacketParser parser = packetDecoder[packetType];
if(parser != null){
parser.process();
@ -563,9 +570,6 @@ public class PacketProcessor {
Bukkit.getLogger().log(Level.SEVERE, "Unknown packet " + packetType + " recieved, closing. LastPacket: " + Arrays.toString(lastPackets.toArray()));
source.close();
}
lastPackets.add(packetType);
if (lastPackets.size() > 10)
lastPackets.remove(0);
}
} catch (EOFException e) {
Bukkit.getLogger().log(Level.INFO, "The FightServer is offline");