Fixed campaign idle boss spoofing

This commit is contained in:
Anuken
2020-12-03 10:05:52 -05:00
parent 6686584003
commit 9fa2691b02
7 changed files with 45 additions and 24 deletions

View File

@@ -27,6 +27,8 @@ import java.util.zip.*;
import static mindustry.Vars.*;
public class LogicBlock extends Block{
private static final int maxByteLen = 1024 * 500;
public int maxInstructionScale = 5;
public int instructionsPerTick = 1;
public float range = 8 * 10;
@@ -137,6 +139,9 @@ public class LogicBlock extends Block{
stream.read();
int bytelen = stream.readInt();
if(bytelen > maxByteLen) throw new RuntimeException("Malformed logic data! Length: " + bytelen);
byte[] bytes = new byte[bytelen];
stream.readFully(bytes);
@@ -197,6 +202,7 @@ public class LogicBlock extends Block{
int version = stream.read();
int bytelen = stream.readInt();
if(bytelen > maxByteLen) throw new RuntimeException("Malformed logic data! Length: " + bytelen);
byte[] bytes = new byte[bytelen];
stream.readFully(bytes);