mirror of
https://github.com/czp3009/bilibili-api.git
synced 2025-01-20 20:40:42 +08:00
增加弹幕推送流的数据包类型 ROOM_SHIELD
This commit is contained in:
parent
4b4ee68cfc
commit
44fc73108f
@ -332,6 +332,7 @@ API 文档
|
||||
| ReceiveDataPackageDebugEvent | 该事件用于调试, 收到任何 Data 数据包时都会触发 |
|
||||
| RoomAdminsPackageEvent | 收到 ROOM_ADMINS 数据包 |
|
||||
| RoomBlockMsgPackageEvent | 收到 ROOM_BLOCK_MSG 数据包 |
|
||||
| RoomShieldPackageEvent | 收到 ROOM_SHIELD 数据包 |
|
||||
| RoomSilentOffPackageEvent | 收到 ROOM_SILENT_OFF 数据包 |
|
||||
| RoomSilentOnPackageEvent | 收到 ROOM_SILENT_ON 数据包 |
|
||||
| SendGiftPackageEvent | 收到 SEND_GIFT 数据包 |
|
||||
|
11
record/bullet_screen_stream_json/ROOM_SHIELD.json
Normal file
11
record/bullet_screen_stream_json/ROOM_SHIELD.json
Normal file
@ -0,0 +1,11 @@
|
||||
{
|
||||
"cmd": "ROOM_SHIELD",
|
||||
"type": 1,
|
||||
"user": [],
|
||||
"keyword": [
|
||||
"暗号",
|
||||
"摄像头",
|
||||
"色相头"
|
||||
],
|
||||
"roomid": 505447
|
||||
}
|
@ -0,0 +1,67 @@
|
||||
package com.hiczp.bilibili.api.live.socket.entity;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class RoomShieldEntity implements DataEntity {
|
||||
/**
|
||||
* cmd : ROOM_SHIELD
|
||||
* type : 1
|
||||
* user : []
|
||||
* keyword : ["暗号","摄像头","色相头"]
|
||||
* roomid : 505447
|
||||
*/
|
||||
|
||||
@SerializedName("cmd")
|
||||
private String cmd;
|
||||
@SerializedName("type")
|
||||
private int type;
|
||||
@SerializedName("roomid")
|
||||
private long roomid;
|
||||
@SerializedName("user")
|
||||
private List<String> user;
|
||||
@SerializedName("keyword")
|
||||
private List<String> keyword;
|
||||
|
||||
@Override
|
||||
public String getCmd() {
|
||||
return cmd;
|
||||
}
|
||||
|
||||
public void setCmd(String cmd) {
|
||||
this.cmd = cmd;
|
||||
}
|
||||
|
||||
public int getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(int type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public long getRoomid() {
|
||||
return roomid;
|
||||
}
|
||||
|
||||
public void setRoomid(long roomid) {
|
||||
this.roomid = roomid;
|
||||
}
|
||||
|
||||
public List<String> getUser() {
|
||||
return user;
|
||||
}
|
||||
|
||||
public void setUser(List<String> user) {
|
||||
this.user = user;
|
||||
}
|
||||
|
||||
public List<String> getKeyword() {
|
||||
return keyword;
|
||||
}
|
||||
|
||||
public void setKeyword(List<String> keyword) {
|
||||
this.keyword = keyword;
|
||||
}
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
package com.hiczp.bilibili.api.live.socket.event;
|
||||
|
||||
import com.hiczp.bilibili.api.live.socket.entity.RoomShieldEntity;
|
||||
|
||||
public class RoomShieldPackageEvent extends ReceiveDataPackageEvent<RoomShieldEntity> {
|
||||
public RoomShieldPackageEvent(Object source, RoomShieldEntity entity) {
|
||||
super(source, entity);
|
||||
}
|
||||
}
|
@ -187,6 +187,11 @@ public class LiveClientHandler extends SimpleChannelInboundHandler<Package> {
|
||||
eventCreationExpression = () -> new PreparingPackageEvent(this, GSON.fromJson(jsonObject, PreparingEntity.class));
|
||||
}
|
||||
break;
|
||||
//房间屏蔽
|
||||
case "ROOM_SHIELD": {
|
||||
eventCreationExpression = () -> new RoomShieldPackageEvent(this, GSON.fromJson(jsonObject, RoomShieldEntity.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