diff --git a/G-Earth/src/main/java/gearth/protocol/packethandler/PacketHandler.java b/G-Earth/src/main/java/gearth/protocol/packethandler/PacketHandler.java index 01c5552..54d2226 100644 --- a/G-Earth/src/main/java/gearth/protocol/packethandler/PacketHandler.java +++ b/G-Earth/src/main/java/gearth/protocol/packethandler/PacketHandler.java @@ -11,14 +11,12 @@ public abstract class PacketHandler { protected final ExtensionHandler extensionHandler; private final Object[] trafficObservables; //get notified on packet send - protected final PayloadBuffer payloadBuffer; protected volatile int currentIndex = 0; protected final Object sendLock = new Object(); protected PacketHandler(ExtensionHandler extensionHandler, Object[] trafficObservables) { this.extensionHandler = extensionHandler; this.trafficObservables = trafficObservables; - this.payloadBuffer = new PayloadBuffer(); } diff --git a/G-Earth/src/main/java/gearth/protocol/packethandler/flash/FlashPacketHandler.java b/G-Earth/src/main/java/gearth/protocol/packethandler/flash/FlashPacketHandler.java index b894343..245422f 100644 --- a/G-Earth/src/main/java/gearth/protocol/packethandler/flash/FlashPacketHandler.java +++ b/G-Earth/src/main/java/gearth/protocol/packethandler/flash/FlashPacketHandler.java @@ -32,10 +32,13 @@ public abstract class FlashPacketHandler extends PacketHandler { private volatile List tempEncryptedBuffer = new ArrayList<>(); volatile boolean isEncryptedStream = false; + private final PayloadBuffer payloadBuffer; + FlashPacketHandler(OutputStream outputStream, Object[] trafficObservables, ExtensionHandler extensionHandler) { super(extensionHandler, trafficObservables); out = outputStream; + this.payloadBuffer = new PayloadBuffer(); } public boolean isDataStream() {return isDataStream;}