mirror of
https://github.com/czp3009/bilibili-api.git
synced 2024-12-21 20:30:28 +08:00
增加弹幕推送流的数据包类型 CUT_OFF
This commit is contained in:
parent
44fc73108f
commit
f585e2be75
@ -321,6 +321,7 @@ API 文档
|
||||
| ActivityEventPackageEvent | 收到 ACTIVITY_EVENT 数据包 |
|
||||
| ConnectionCloseEvent | 连接断开(主动或被动) |
|
||||
| ConnectSucceedEvent | 进房成功 |
|
||||
| CutOffPackageEvent | 收到 CUT_OFF 数据包 |
|
||||
| DanMuMsgPackageEvent | 收到 DANMU_MSG 数据包 |
|
||||
| EventCmdPackageEvent | 收到 EVENT_CMD 数据包 |
|
||||
| GuardBuyPackageEvent | 收到 GUARD_BUY 数据包 |
|
||||
|
5
record/bullet_screen_stream_json/CUT_OFF.json
Normal file
5
record/bullet_screen_stream_json/CUT_OFF.json
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"cmd": "CUT_OFF",
|
||||
"msg": "禁播游戏",
|
||||
"roomid": 8446134
|
||||
}
|
@ -0,0 +1,43 @@
|
||||
package com.hiczp.bilibili.api.live.socket.entity;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
public class CutOffEntity implements DataEntity {
|
||||
/**
|
||||
* cmd : CUT_OFF
|
||||
* msg : 禁播游戏
|
||||
* roomid : 8446134
|
||||
*/
|
||||
|
||||
@SerializedName("cmd")
|
||||
private String cmd;
|
||||
@SerializedName("msg")
|
||||
private String msg;
|
||||
@SerializedName("roomid")
|
||||
private int roomid;
|
||||
|
||||
@Override
|
||||
public String getCmd() {
|
||||
return cmd;
|
||||
}
|
||||
|
||||
public void setCmd(String cmd) {
|
||||
this.cmd = cmd;
|
||||
}
|
||||
|
||||
public String getMsg() {
|
||||
return msg;
|
||||
}
|
||||
|
||||
public void setMsg(String msg) {
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
public int getRoomid() {
|
||||
return roomid;
|
||||
}
|
||||
|
||||
public void setRoomid(int roomid) {
|
||||
this.roomid = roomid;
|
||||
}
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
package com.hiczp.bilibili.api.live.socket.event;
|
||||
|
||||
import com.hiczp.bilibili.api.live.socket.entity.CutOffEntity;
|
||||
|
||||
public class CutOffPackageEvent extends ReceiveDataPackageEvent<CutOffEntity> {
|
||||
public CutOffPackageEvent(Object source, CutOffEntity entity) {
|
||||
super(source, entity);
|
||||
}
|
||||
}
|
@ -192,6 +192,11 @@ public class LiveClientHandler extends SimpleChannelInboundHandler<Package> {
|
||||
eventCreationExpression = () -> new RoomShieldPackageEvent(this, GSON.fromJson(jsonObject, RoomShieldEntity.class));
|
||||
}
|
||||
break;
|
||||
//被 B站 管理员强制中断
|
||||
case "CUT_OFF": {
|
||||
eventCreationExpression = () -> new CutOffPackageEvent(this, GSON.fromJson(jsonObject, CutOffEntity.class));
|
||||
}
|
||||
break;
|
||||
default: {
|
||||
LOGGER.error("Received unknown json below: \n{}", formatJson(jsonObject));
|
||||
eventCreationExpression = () -> new UnknownPackageEvent(this, jsonObject);
|
||||
|
Loading…
Reference in New Issue
Block a user