This commit is contained in:
sirjonasxx 2021-04-29 00:51:04 +02:00
parent 869d39cf86
commit ff981e3cc7
2 changed files with 15 additions and 12 deletions

View File

@ -162,7 +162,7 @@ public class ExtensionHandler {
awaitManipulation.put(hMessage, new HashSet<>(gEarthExtensions)); awaitManipulation.put(hMessage, new HashSet<>(gEarthExtensions));
for (GEarthExtension extension : gEarthExtensions) { for (GEarthExtension extension : gEarthExtensions) {
extension.packetIntercept(hMessage); extension.packetIntercept(new HMessage(hMessage));
} }
} }
} }

View File

@ -9,10 +9,7 @@ import gearth.ui.logger.loggerdisplays.PacketLogger;
import javafx.application.Platform; import javafx.application.Platform;
import javafx.event.ActionEvent; import javafx.event.ActionEvent;
import javafx.fxml.Initializable; import javafx.fxml.Initializable;
import javafx.scene.control.CheckMenuItem; import javafx.scene.control.*;
import javafx.scene.control.Label;
import javafx.scene.control.MenuItem;
import javafx.scene.control.RadioMenuItem;
import javafx.scene.layout.BorderPane; import javafx.scene.layout.BorderPane;
import javafx.scene.layout.FlowPane; import javafx.scene.layout.FlowPane;
import javafx.stage.FileChooser; import javafx.stage.FileChooser;
@ -279,12 +276,19 @@ public class UiLoggerController implements Initializable {
} }
if (packet.length() <= 2000) { if (packet.length() <= 2000) {
String expr = packet.toExpression(isIncoming ? HMessage.Direction.TOCLIENT : HMessage.Direction.TOSERVER, packetInfoManager, chkUseNewStructures.isSelected()); try {
String cleaned = cleanTextContent(expr); String expr = packet.toExpression(isIncoming ? HMessage.Direction.TOCLIENT : HMessage.Direction.TOSERVER, packetInfoManager, chkUseNewStructures.isSelected());
if (cleaned.equals(expr)) { String cleaned = cleanTextContent(expr);
if (!expr.equals("") && chkDisplayStructure.isSelected()) if (cleaned.equals(expr)) {
elements.add(new Element("\n" + cleanTextContent(expr), "structure")); if (!expr.equals("") && chkDisplayStructure.isSelected())
elements.add(new Element("\n" + cleanTextContent(expr), "structure"));
}
} }
catch (Exception e) {
System.out.println(packet.toString());
System.out.println("if you see this message pls report it");
}
} }
@ -313,12 +317,11 @@ public class UiLoggerController implements Initializable {
} }
int oldLen = area.getLength(); int oldLen = area.getLength();
area.appendText(sb.toString()); area.appendText(sb.toString());
// System.out.println(sb.toString());
area.setStyleSpans(oldLen, styleSpansBuilder.create()); area.setStyleSpans(oldLen, styleSpansBuilder.create());
if (chkAutoscroll.isSelected()) { if (chkAutoscroll.isSelected()) {
// area.moveTo(area.getLength());
area.requestFollowCaret(); area.requestFollowCaret();
} }
}); });