mirror of
https://github.com/sirjonasxx/G-Earth.git
synced 2024-11-23 08:50:52 +01:00
yes
This commit is contained in:
parent
35d18da4da
commit
0132978fb9
@ -108,6 +108,15 @@ public class HPacket implements StringifyAble {
|
|||||||
isEdited = wasEdited;
|
isEdited = wasEdited;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void maybeCompletePacket(PacketInfoManager packetInfoManager) {
|
||||||
|
if (canComplete(HMessage.Direction.TOCLIENT, packetInfoManager) && !canComplete(HMessage.Direction.TOSERVER, packetInfoManager)) {
|
||||||
|
completePacket(HMessage.Direction.TOCLIENT, packetInfoManager);
|
||||||
|
}
|
||||||
|
else if (!canComplete(HMessage.Direction.TOCLIENT, packetInfoManager) && canComplete(HMessage.Direction.TOSERVER, packetInfoManager)) {
|
||||||
|
completePacket(HMessage.Direction.TOSERVER, packetInfoManager);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public boolean canComplete(HMessage.Direction direction, PacketInfoManager packetInfoManager) {
|
public boolean canComplete(HMessage.Direction direction, PacketInfoManager packetInfoManager) {
|
||||||
if (isCorrupted() || identifier == null) return false;
|
if (isCorrupted() || identifier == null) return false;
|
||||||
|
|
||||||
|
@ -231,13 +231,7 @@ public class ExtensionHandler {
|
|||||||
@Override
|
@Override
|
||||||
protected void stringToPacketRequest(String string) {
|
protected void stringToPacketRequest(String string) {
|
||||||
HPacket packet = new HPacket(string);
|
HPacket packet = new HPacket(string);
|
||||||
PacketInfoManager packetInfoManager = hConnection.getPacketInfoManager();
|
packet.maybeCompletePacket(hConnection.getPacketInfoManager());
|
||||||
if (packet.canComplete(HMessage.Direction.TOCLIENT, packetInfoManager) && !packet.canComplete(HMessage.Direction.TOSERVER, packetInfoManager)) {
|
|
||||||
packet.completePacket(HMessage.Direction.TOCLIENT, packetInfoManager);
|
|
||||||
}
|
|
||||||
else if (!packet.canComplete(HMessage.Direction.TOCLIENT, packetInfoManager) && packet.canComplete(HMessage.Direction.TOSERVER, packetInfoManager)) {
|
|
||||||
packet.completePacket(HMessage.Direction.TOSERVER, packetInfoManager);
|
|
||||||
}
|
|
||||||
extension.stringToPacketResponse(packet);
|
extension.stringToPacketResponse(packet);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -153,13 +153,7 @@ public class InjectionController extends SubForm {
|
|||||||
|
|
||||||
// complete packet to show correct headerId
|
// complete packet to show correct headerId
|
||||||
if (!packets[0].isPacketComplete()) {
|
if (!packets[0].isPacketComplete()) {
|
||||||
HPacket packet = packets[0];
|
packets[0].maybeCompletePacket(packetInfoManager);
|
||||||
if (packet.canComplete(HMessage.Direction.TOCLIENT, packetInfoManager) && !packet.canComplete(HMessage.Direction.TOSERVER, packetInfoManager)) {
|
|
||||||
packet.completePacket(HMessage.Direction.TOCLIENT, packetInfoManager);
|
|
||||||
}
|
|
||||||
else if (!packet.canComplete(HMessage.Direction.TOCLIENT, packetInfoManager) && packet.canComplete(HMessage.Direction.TOSERVER, packetInfoManager)) {
|
|
||||||
packet.completePacket(HMessage.Direction.TOSERVER, packetInfoManager);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
lbl_pcktInfo.setText("header (id:" + packets[0].headerId() + ", length:" +
|
lbl_pcktInfo.setText("header (id:" + packets[0].headerId() + ", length:" +
|
||||||
|
Loading…
Reference in New Issue
Block a user