From 251ebe1a0c495b127e4af95b40e065ef7d682916 Mon Sep 17 00:00:00 2001 From: Yutousama <583819556@qq.com> Date: Mon, 27 Sep 2021 09:15:45 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E9=83=A8=E5=88=86=E7=9B=B4?= =?UTF-8?q?=E6=92=AD=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Web/html/body/user.html | 2 +- pom.xml | 19 + .../com/yutou/bilibili/BiliBili/Live.java | 401 +++++++++--------- .../yutou/bilibili/BilibiliApplication.java | 2 +- .../yutou/bilibili/Tools/ApplicationInit.java | 1 + .../java/com/yutou/bilibili/Tools/Log.java | 2 +- 6 files changed, 221 insertions(+), 206 deletions(-) diff --git a/Web/html/body/user.html b/Web/html/body/user.html index 28f28d4..6f3d32d 100644 --- a/Web/html/body/user.html +++ b/Web/html/body/user.html @@ -11,7 +11,7 @@
diff --git a/pom.xml b/pom.xml index 62cfeda..07dbc96 100644 --- a/pom.xml +++ b/pom.xml @@ -124,6 +124,25 @@+ + org.apache.maven.plugins +maven-antrun-plugin +1.8 ++ ++ +test ++ +run ++ ++ +复制正式文件 ++ org.jetbrains.kotlin kotlin-maven-plugin diff --git a/src/main/java/com/yutou/bilibili/BiliBili/Live.java b/src/main/java/com/yutou/bilibili/BiliBili/Live.java index 4e2f8ac..9a81b2b 100644 --- a/src/main/java/com/yutou/bilibili/BiliBili/Live.java +++ b/src/main/java/com/yutou/bilibili/BiliBili/Live.java @@ -133,7 +133,7 @@ public class Live implements ApplicationContextAware { private void start() throws Exception { run = true; if (LiveUtils.isLivePlayer(roomId)) { - upData.setLive(1); + upData.setLive(-1); } String url = LiveUtils.getLiveUrl(roomId); if (url == null) { @@ -227,14 +227,6 @@ public class Live implements ApplicationContextAware { } }; client.connect(); - new Timer().schedule(new TimerTask() { - @Override - public void run() { - if (client == null || client.isClosed()) { - stop(); - } - } - }, 0, 60 * 1000); } public void stop() { @@ -290,6 +282,7 @@ public class Live implements ApplicationContextAware { outputStream.flush(); // LiveUtils.printHex(outputStream.toByteArray()); client.send(outputStream.toByteArray()); + checkLive(); } /** @@ -306,11 +299,11 @@ public class Live implements ApplicationContextAware { if (data.length > 32) { Listlist = LiveUtils.getMsgList(LiveUtils.dec(bytes), new ArrayList<>(), true); String tmp = ""; - for (int i = 0; i < list.size(); i++) { + for (int i=0;i