From 98d120bd0633e4e0717d584cae5514132a18516b Mon Sep 17 00:00:00 2001
From: Junjie <DELL@qq.com>
Date: 星期四, 18 十二月 2025 13:36:09 +0800
Subject: [PATCH] #
---
src/main/java/com/zy/core/network/fake/ZyCrnFakeConnect.java | 23 +++++++++++++++++++++--
1 files changed, 21 insertions(+), 2 deletions(-)
diff --git a/src/main/java/com/zy/core/network/fake/ZyCrnFakeConnect.java b/src/main/java/com/zy/core/network/fake/ZyCrnFakeConnect.java
index 1a3be97..570b9aa 100644
--- a/src/main/java/com/zy/core/network/fake/ZyCrnFakeConnect.java
+++ b/src/main/java/com/zy/core/network/fake/ZyCrnFakeConnect.java
@@ -29,6 +29,7 @@
@Override
public boolean disconnect() {
+ try { executor.shutdownNow(); } catch (Exception ignore) {}
return true;
}
@@ -90,6 +91,9 @@
moveZ(this.crnStatus.getLevel(), sourcePosZ);
this.crnStatus.setStatus(CrnStatusType.FETCHING.id);
sleep(2000);
+ if (Thread.currentThread().isInterrupted()) {
+ return;
+ }
this.crnStatus.setLoaded(1);
this.crnStatus.setStatus(CrnStatusType.PUT_MOVING.id);
@@ -97,6 +101,9 @@
moveZ(this.crnStatus.getLevel(), destinationPosZ);
this.crnStatus.setStatus(CrnStatusType.PUTTING.id);
sleep(2000);
+ if (Thread.currentThread().isInterrupted()) {
+ return;
+ }
this.crnStatus.setLoaded(0);
this.crnStatus.setStatus(CrnStatusType.WAITING.id);
}
@@ -109,6 +116,9 @@
initSourcePosZ++;
this.crnStatus.setLevel(initSourcePosZ);
sleep(1000);
+ if (Thread.currentThread().isInterrupted()) {
+ return;
+ }
}
}else {
int moveLength = sourcePosZ - destinationPosZ;
@@ -117,6 +127,9 @@
initSourcePosZ--;
this.crnStatus.setLevel(initSourcePosZ);
sleep(1000);
+ if (Thread.currentThread().isInterrupted()) {
+ return;
+ }
}
}
}
@@ -129,6 +142,9 @@
initSourcePosY++;
this.crnStatus.setBay(initSourcePosY);
sleep(1000);
+ if (Thread.currentThread().isInterrupted()) {
+ return;
+ }
}
}else {
int moveLength = sourcePosY - destinationPosY;
@@ -137,15 +153,18 @@
initSourcePosY--;
this.crnStatus.setBay(initSourcePosY);
sleep(1000);
+ if (Thread.currentThread().isInterrupted()) {
+ return;
+ }
}
}
}
- private void sleep(long ms) {
+ private void sleep(long ms) {
try {
Thread.sleep(ms);
} catch (InterruptedException e) {
- e.printStackTrace();
+ Thread.currentThread().interrupt();
}
}
}
--
Gitblit v1.9.1