From a42cc0ed7c694cb1a442f0a726d7b4ca1443d77d Mon Sep 17 00:00:00 2001 From: Yutousama <583819556@qq.com> Date: Thu, 20 May 2021 21:49:26 +0800 Subject: [PATCH] update --- .../java/com/yutou/bilibili/BiliBili/Live.java | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/yutou/bilibili/BiliBili/Live.java b/src/main/java/com/yutou/bilibili/BiliBili/Live.java index 9e0cc10..b0f4ccc 100644 --- a/src/main/java/com/yutou/bilibili/BiliBili/Live.java +++ b/src/main/java/com/yutou/bilibili/BiliBili/Live.java @@ -174,8 +174,8 @@ public class Live implements ApplicationContextAware { heartBeattimer.schedule(new sendHeartbeat(), 2000, 20000); init = false; } - Log.i(AppTools.getToDayTimeToString(startTime),roomId,LiveUtils.getHex(bytes.array()).substring(0,16)); decompress(bytes.array()); + Log.i(AppTools.getToDayTimeToString(startTime),roomId,LiveUtils.getHex(bytes.array()).substring(16,32)); } @Override @@ -538,10 +538,16 @@ public class Live implements ApplicationContextAware { JSONObject.parseObject(new String(bytes, StandardCharsets.UTF_8)); processData(new String(bytes, StandardCharsets.UTF_8), null); } catch (Exception e2) { - Log.e(e2); - com.yutou.bilibili.Tools.Log.i(msg); - com.yutou.bilibili.Tools.Log.i("---------ERROR !!-----"); - LiveUtils.printHex(bytes); + try { + JSONObject.parseObject(msg); + processData(msg,bytes); + }catch (Exception e3) { + Log.e(e2); + com.yutou.bilibili.Tools.Log.i("---------ERROR !! start-----"); + com.yutou.bilibili.Tools.Log.i(msg); + com.yutou.bilibili.Tools.Log.i("---------ERROR !! end-----"); + // LiveUtils.printHex(bytes); + } } }