From d8dbd6e9850e902b80a93d34a60369ee64c67ef3 Mon Sep 17 00:00:00 2001 From: iMoHax Date: Fri, 9 Oct 2015 11:50:07 +0300 Subject: [PATCH] update profile in FX thread --- client/src/main/java/ru/trader/EDCE.java | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/client/src/main/java/ru/trader/EDCE.java b/client/src/main/java/ru/trader/EDCE.java index ccdaae6..617e46b 100644 --- a/client/src/main/java/ru/trader/EDCE.java +++ b/client/src/main/java/ru/trader/EDCE.java @@ -64,18 +64,20 @@ public class EDCE { if (cache.size() > CACHE_LIMIT){ cache.remove(0); } - checkCmd(packet.getCommander()); - if (checkSystem(packet.getLastSystem())){ - if (packet.getCommander().isDocked()) { - checkStarport(packet.getLastStarport()); - profile.setDocked(true); - } else { - profile.setDocked(false); - profile.setStation(ModelFabric.NONE_STATION); + Platform.runLater(() -> { + checkCmd(packet.getCommander()); + if (checkSystem(packet.getLastSystem())){ + if (packet.getCommander().isDocked()) { + checkStarport(packet.getLastStarport()); + profile.setDocked(true); + } else { + profile.setDocked(false); + profile.setStation(ModelFabric.NONE_STATION); + } } - } - checkShip(packet.getShip()); - forceUpdate = false; + checkShip(packet.getShip()); + forceUpdate = false; + }); } catch (IOException e) { LOG.warn("Error on parse json:"); LOG.warn("{}", json);