更新 DANMU_MSG 数据包结构

This commit is contained in:
czp 2018-03-10 14:55:07 +08:00
parent 5453008056
commit 5ab15b2e3e
4 changed files with 21 additions and 8 deletions

View File

@ -32,7 +32,8 @@
0, 0,
// svip // svip
10000, 10000,
1 1,
""
], ],
//(, JsonArray ) //(, JsonArray )
[ [
@ -41,9 +42,9 @@
"夏沫", "夏沫",
// //
"乄夏沫丶", "乄夏沫丶",
// //
"1547306", "1547306",
// //
16746162, 16746162,
"" ""
], ],
@ -62,7 +63,10 @@
"title-131-1" "title-131-1"
], ],
0, 0,
0 0,
{
"uname_color": ""
}
], ],
"cmd": "DANMU_MSG" "cmd": "DANMU_MSG"
} }

View File

@ -19,7 +19,8 @@
1, 1,
0, 0,
10000, 10000,
1 1,
""
], ],
[ [
13, 13,
@ -37,7 +38,10 @@
], ],
[], [],
0, 0,
0 0,
{
"uname_color": ""
}
], ],
"cmd": "DANMU_MSG" "cmd": "DANMU_MSG"
} }

View File

@ -15,7 +15,7 @@ public class DanMuMsgEntity implements DataEntity {
}.getType(); }.getType();
/** /**
* info : [[0,1,25,16777215,1510498713,"1510498712",0,"8a0f75dc",0],"网易云音乐库在当前直播间已停留0天0时39分41秒",[39042255,"夏沫丶琉璃浅梦",0,1,0,10000,1],[13,"夏沫","乄夏沫丶","1547306",16746162,""],[41,0,16746162,6603],[],0,0] * info : [[0,1,25,16777215,1520664535,1662637384,0,"88874b7b",0],"czpnb",[15723776,"Dough君",0,0,0,"10000",1,""],[],[10,0,9868950,">50000"],[],0,0,{"uname_color":""}]
* cmd : DANMU_MSG * cmd : DANMU_MSG
*/ */
@ -152,4 +152,9 @@ public class DanMuMsgEntity implements DataEntity {
public List<String> getUserTitles() { public List<String> getUserTitles() {
return GSON.fromJson(info.get(5), STRING_LIST_TYPE); return GSON.fromJson(info.get(5), STRING_LIST_TYPE);
} }
//获得用户名颜色
public String getUsernameColor() {
return info.get(8).getAsJsonObject().get("uname_color").getAsString();
}
} }

View File

@ -5,7 +5,7 @@ import com.hiczp.bilibili.api.live.entity.BulletScreenEntity;
import org.junit.Test; import org.junit.Test;
public class SendBulletScreenTest { public class SendBulletScreenTest {
private static final long ROOM_ID = 29434; private static final long ROOM_ID = 1110317;
private static final BilibiliAPI BILIBILI_API = Config.getBilibiliAPI(); private static final BilibiliAPI BILIBILI_API = Config.getBilibiliAPI();
@Test @Test