mirror of
https://github.com/czp3009/bilibili-api.git
synced 2025-01-20 20:40:42 +08:00
添加弹幕推送数据包种类 ROOM_LOCK
This commit is contained in:
parent
6109d5f33e
commit
29d6460f62
@ -334,6 +334,7 @@ API 文档
|
||||
| ReceiveDataPackageDebugEvent | 该事件用于调试, 收到任何 Data 数据包时都会触发 |
|
||||
| RoomAdminsPackageEvent | 收到 ROOM_ADMINS 数据包 |
|
||||
| RoomBlockMsgPackageEvent | 收到 ROOM_BLOCK_MSG 数据包 |
|
||||
| RoomLockPackageEvent | 收到 ROOM_LOCK 数据包 |
|
||||
| RoomShieldPackageEvent | 收到 ROOM_SHIELD 数据包 |
|
||||
| RoomSilentOffPackageEvent | 收到 ROOM_SILENT_OFF 数据包 |
|
||||
| RoomSilentOnPackageEvent | 收到 ROOM_SILENT_ON 数据包 |
|
||||
|
5
record/bullet_screen_stream_json/ROOM_LOCK.json
Normal file
5
record/bullet_screen_stream_json/ROOM_LOCK.json
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"cmd": "ROOM_LOCK",
|
||||
"expire": "2018-03-15 10:24:18",
|
||||
"roomid": 6477301
|
||||
}
|
@ -0,0 +1,43 @@
|
||||
package com.hiczp.bilibili.api.live.socket.entity;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
public class RoomLockEntity implements DataEntity {
|
||||
/**
|
||||
* cmd : ROOM_LOCK
|
||||
* expire : 2018-03-15 10:24:18
|
||||
* roomid : 6477301
|
||||
*/
|
||||
|
||||
@SerializedName("cmd")
|
||||
private String cmd;
|
||||
@SerializedName("expire")
|
||||
private String expire;
|
||||
@SerializedName("roomid")
|
||||
private int roomid;
|
||||
|
||||
@Override
|
||||
public String getCmd() {
|
||||
return cmd;
|
||||
}
|
||||
|
||||
public void setCmd(String cmd) {
|
||||
this.cmd = cmd;
|
||||
}
|
||||
|
||||
public String getExpire() {
|
||||
return expire;
|
||||
}
|
||||
|
||||
public void setExpire(String expire) {
|
||||
this.expire = expire;
|
||||
}
|
||||
|
||||
public int getRoomid() {
|
||||
return roomid;
|
||||
}
|
||||
|
||||
public void setRoomid(int roomid) {
|
||||
this.roomid = roomid;
|
||||
}
|
||||
}
|
@ -0,0 +1,10 @@
|
||||
package com.hiczp.bilibili.api.live.socket.event;
|
||||
|
||||
import com.hiczp.bilibili.api.live.socket.LiveClient;
|
||||
import com.hiczp.bilibili.api.live.socket.entity.RoomLockEntity;
|
||||
|
||||
public class RoomLockPackageEvent extends ReceiveDataPackageEvent<RoomLockEntity> {
|
||||
public RoomLockPackageEvent(LiveClient source, RoomLockEntity entity) {
|
||||
super(source, entity);
|
||||
}
|
||||
}
|
@ -206,6 +206,11 @@ public class LiveClientHandler extends SimpleChannelInboundHandler<Package> {
|
||||
eventCreationExpression = () -> new CutOffPackageEvent(liveClient, GSON.fromJson(jsonObject, CutOffEntity.class));
|
||||
}
|
||||
break;
|
||||
//房间被封
|
||||
case "ROOM_LOCK": {
|
||||
eventCreationExpression = () -> new RoomLockPackageEvent(liveClient, GSON.fromJson(jsonObject, RoomLockEntity.class));
|
||||
}
|
||||
break;
|
||||
default: {
|
||||
LOGGER.error("Received unknown json below: \n{}", formatJson(jsonObject));
|
||||
eventCreationExpression = () -> new UnknownPackageEvent(liveClient, jsonObject);
|
||||
|
Loading…
Reference in New Issue
Block a user