update
This commit is contained in:
@@ -100,7 +100,7 @@ public class BiliLiveDatabase extends SQLiteManager {
|
||||
}
|
||||
|
||||
public void addSource(WSData bean) {
|
||||
Log.i("BiliLiveDatabase.addSource");
|
||||
Log.i("BiliLiveDatabase.addSource",config.getRoomId());
|
||||
add(new LiveSourceDatabaseBean(bean));
|
||||
addData(bean);
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ import com.yutou.biliapi.api.LiveApi;
|
||||
import com.yutou.biliapi.bean.live.LiveDanmuInfo;
|
||||
import com.yutou.biliapi.bean.live.LiveRoomConfig;
|
||||
import com.yutou.biliapi.bean.live.LiveRoomInfo;
|
||||
import com.yutou.biliapi.bean.login.LoginCookieDatabaseBean;
|
||||
import com.yutou.biliapi.bean.websocket.WebSocketBody;
|
||||
import com.yutou.biliapi.bean.websocket.WebSocketHeader;
|
||||
import com.yutou.biliapi.bean.websocket.live.WSData;
|
||||
@@ -66,6 +67,7 @@ public class WebSocketManager {
|
||||
array.addAll(roomMap.keySet());
|
||||
return array;
|
||||
}
|
||||
|
||||
public void clearUserStopList() {
|
||||
userStopList.clear();
|
||||
}
|
||||
@@ -170,7 +172,7 @@ public class WebSocketManager {
|
||||
heartbeatTask.setSocket(this);
|
||||
heartbeatTask.sendInitAuthData();
|
||||
new Timer().schedule(heartbeatTask, 1000, 30000);
|
||||
Log.i("WebSocketClientTh.onOpen");
|
||||
Log.i("WebSocketClientTh.onOpen", roomConfig);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -180,15 +182,14 @@ public class WebSocketManager {
|
||||
|
||||
@Override
|
||||
public void onMessage(ByteBuffer bytes) {
|
||||
// Log.i("WebSocketClientTh.onMessage: " + roomConfig.getAnchorName());
|
||||
// Log.i("WebSocketClientTh.onMessage: " + roomConfig.getAnchorName());
|
||||
super.onMessage(bytes);
|
||||
decompress(bytes.array());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClose(int i, String s, boolean b) {
|
||||
Log.i("WebSocketClientTh.onClose");
|
||||
Log.i("i = " + i + ", s = " + s + ", b = " + b);
|
||||
Log.e("WebSocketClientTh.onClose", "i = " + i + ", s = " + s + ", b = " + b, roomConfig.getRoomId(), heartbeatTask.socket.isOpen());
|
||||
WebSocketManager.getInstance().roomMap.remove(roomConfig);
|
||||
liveDatabase.close();
|
||||
heartbeatTask.cancel();
|
||||
@@ -196,7 +197,7 @@ public class WebSocketManager {
|
||||
|
||||
@Override
|
||||
public void onError(Exception e) {
|
||||
Log.i("WebSocketClientTh.onError");
|
||||
Log.i("WebSocketClientTh.onError", roomConfig.getRoomId());
|
||||
Log.e(e);
|
||||
WebSocketManager.getInstance().roomMap.remove(roomConfig);
|
||||
liveDatabase.close();
|
||||
@@ -280,7 +281,9 @@ public class WebSocketManager {
|
||||
} else {
|
||||
json.put("uid", 0);
|
||||
}
|
||||
String buvid = BiliUserUtils.getBuvid(BiliBiliLoginDatabase.getInstance().getCookie(roomConfig.getLoginUid()));
|
||||
LoginCookieDatabaseBean cookie = BiliBiliLoginDatabase.getInstance().getCookie(roomConfig.getLoginUid());
|
||||
Log.d("cookie:", cookie, "RoomId:" + roomConfig);
|
||||
String buvid = BiliUserUtils.getBuvid(cookie);
|
||||
if (buvid != null) {
|
||||
try {
|
||||
json.put("roomid", new BigInteger(roomConfig.getRoomId()));
|
||||
@@ -298,7 +301,7 @@ public class WebSocketManager {
|
||||
outputStream.write(json.toJSONString().getBytes(StandardCharsets.UTF_8));
|
||||
outputStream.flush();
|
||||
// BytesUtils.printHex(outputStream.toByteArray());
|
||||
Log.i(socket.isOpen());
|
||||
Log.i(socket.isOpen(), json.toString());
|
||||
socket.send(outputStream.toByteArray());
|
||||
|
||||
} catch (Exception e) {
|
||||
|
||||
Reference in New Issue
Block a user