mirror of
https://github.com/sirjonasxx/G-Earth.git
synced 2024-11-30 04:00:50 +01:00
Reset to correct read index
This commit is contained in:
parent
b6689ffcea
commit
8d495347ba
@ -62,7 +62,7 @@ public abstract class GEarthExtension {
|
|||||||
protected void sendManipulatedPacket(HMessage hMessage) {
|
protected void sendManipulatedPacket(HMessage hMessage) {
|
||||||
int orgIndex = hMessage.getPacket().getReadIndex();
|
int orgIndex = hMessage.getPacket().getReadIndex();
|
||||||
extensionObservable.fireEvent(listener -> {
|
extensionObservable.fireEvent(listener -> {
|
||||||
hMessage.getPacket().setReadIndex(6);
|
hMessage.getPacket().resetReadIndex();
|
||||||
listener.manipulatedPacket(hMessage);
|
listener.manipulatedPacket(hMessage);
|
||||||
});
|
});
|
||||||
hMessage.getPacket().setReadIndex(orgIndex);
|
hMessage.getPacket().setReadIndex(orgIndex);
|
||||||
@ -73,7 +73,7 @@ public abstract class GEarthExtension {
|
|||||||
protected void sendMessage(HMessage.Direction direction, HPacket packet) {
|
protected void sendMessage(HMessage.Direction direction, HPacket packet) {
|
||||||
int orgIndex = packet.getReadIndex();
|
int orgIndex = packet.getReadIndex();
|
||||||
extensionObservable.fireEvent(listener -> {
|
extensionObservable.fireEvent(listener -> {
|
||||||
packet.setReadIndex(6);
|
packet.resetReadIndex();
|
||||||
listener.sendMessage(direction, packet);
|
listener.sendMessage(direction, packet);
|
||||||
});
|
});
|
||||||
packet.setReadIndex(orgIndex);
|
packet.setReadIndex(orgIndex);
|
||||||
@ -88,7 +88,7 @@ public abstract class GEarthExtension {
|
|||||||
protected void packetToStringRequest(HPacket packet) {
|
protected void packetToStringRequest(HPacket packet) {
|
||||||
int orgIndex = packet.getReadIndex();
|
int orgIndex = packet.getReadIndex();
|
||||||
extensionObservable.fireEvent(listener -> {
|
extensionObservable.fireEvent(listener -> {
|
||||||
packet.setReadIndex(6);
|
packet.resetReadIndex();
|
||||||
listener.packetToStringRequest(packet);
|
listener.packetToStringRequest(packet);
|
||||||
});
|
});
|
||||||
packet.setReadIndex(orgIndex);
|
packet.setReadIndex(orgIndex);
|
||||||
|
Loading…
Reference in New Issue
Block a user