From 4e005e4936039fca16bfd1679942daa416a21986 Mon Sep 17 00:00:00 2001
From: Junjie <fallin.jie@qq.com>
Date: 星期四, 20 十一月 2025 14:27:47 +0800
Subject: [PATCH] #

---
 src/main/java/com/zy/core/network/fake/ZyCrnFakeConnect.java |   44 ++++++++++++++------------------------------
 1 files changed, 14 insertions(+), 30 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 4737144..a91560b 100644
--- a/src/main/java/com/zy/core/network/fake/ZyCrnFakeConnect.java
+++ b/src/main/java/com/zy/core/network/fake/ZyCrnFakeConnect.java
@@ -89,22 +89,14 @@
         moveY(this.crnStatus.getBay(), sourcePosY);
         moveZ(this.crnStatus.getLevel(), sourcePosZ);
         this.crnStatus.setStatus(CrnStatusType.FETCHING.id);
-        try {
-            Thread.sleep(2000);
-        } catch (InterruptedException e) {
-            e.printStackTrace();
-        }
+        sleep(2000);
 
         this.crnStatus.setLoaded(1);
         this.crnStatus.setStatus(CrnStatusType.PUT_MOVING.id);
         moveY(this.crnStatus.getBay(), destinationPosY);
         moveZ(this.crnStatus.getLevel(), destinationPosZ);
         this.crnStatus.setStatus(CrnStatusType.PUTTING.id);
-        try {
-            Thread.sleep(2000);
-        } catch (InterruptedException e) {
-            e.printStackTrace();
-        }
+        sleep(2000);
         this.crnStatus.setLoaded(0);
         this.crnStatus.setStatus(CrnStatusType.WAITING.id);
     }
@@ -116,11 +108,7 @@
             for(int i = 0; i < moveLength; i++) {
                 initSourcePosZ++;
                 this.crnStatus.setLevel(initSourcePosZ);
-                try {
-                    Thread.sleep(1000);
-                } catch (InterruptedException e) {
-                    e.printStackTrace();
-                }
+                sleep(1000);
             }
         }else {
             int moveLength = sourcePosZ - destinationPosZ;
@@ -128,11 +116,7 @@
             for(int i = 0; i < moveLength; i++) {
                 initSourcePosZ--;
                 this.crnStatus.setLevel(initSourcePosZ);
-                try {
-                    Thread.sleep(1000);
-                } catch (InterruptedException e) {
-                    e.printStackTrace();
-                }
+                sleep(1000);
             }
         }
     }
@@ -144,11 +128,7 @@
             for(int i = 0; i < moveLength; i++) {
                 initSourcePosY++;
                 this.crnStatus.setBay(initSourcePosY);
-                try {
-                    Thread.sleep(1000);
-                } catch (InterruptedException e) {
-                    e.printStackTrace();
-                }
+                sleep(1000);
             }
         }else {
             int moveLength = sourcePosY - destinationPosY;
@@ -156,12 +136,16 @@
             for(int i = 0; i < moveLength; i++) {
                 initSourcePosY--;
                 this.crnStatus.setBay(initSourcePosY);
-                try {
-                    Thread.sleep(1000);
-                } catch (InterruptedException e) {
-                    e.printStackTrace();
-                }
+                sleep(1000);
             }
         }
     }
+
+    private void sleep(long ms) {
+        try {
+            Thread.sleep(ms);
+        } catch (InterruptedException e) {
+            e.printStackTrace();
+        }
+    }
 }

--
Gitblit v1.9.1