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;
|
||||
}
|
||||
|
||||
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) {
|
||||
if (isCorrupted() || identifier == null) return false;
|
||||
|
||||
|
@ -231,13 +231,7 @@ public class ExtensionHandler {
|
||||
@Override
|
||||
protected void stringToPacketRequest(String string) {
|
||||
HPacket packet = new HPacket(string);
|
||||
PacketInfoManager packetInfoManager = 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);
|
||||
}
|
||||
packet.maybeCompletePacket(hConnection.getPacketInfoManager());
|
||||
extension.stringToPacketResponse(packet);
|
||||
}
|
||||
};
|
||||
|
@ -153,13 +153,7 @@ public class InjectionController extends SubForm {
|
||||
|
||||
// complete packet to show correct headerId
|
||||
if (!packets[0].isPacketComplete()) {
|
||||
HPacket packet = packets[0];
|
||||
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);
|
||||
}
|
||||
packets[0].maybeCompletePacket(packetInfoManager);
|
||||
}
|
||||
|
||||
lbl_pcktInfo.setText("header (id:" + packets[0].headerId() + ", length:" +
|
||||
|
Loading…
Reference in New Issue
Block a user