更新大量【proto定义】并勘误

This commit is contained in:
社会易姐QwQ
2021-07-06 21:28:36 +08:00
parent 129b9bc88b
commit ce8d00fcd0
36 changed files with 2951 additions and 2099 deletions

View File

@@ -0,0 +1,30 @@
syntax = "proto3";
package bilibili.broadcast.message.editor;
import "google/protobuf/empty.proto";
//
service OperationNotify {
//
rpc OperationNotify(google.protobuf.Empty) returns (stream Notify);
}
message Notify {
// 消息唯一标示
int64 msg_id = 1;
// 消息类型
int32 msg_type = 2;
// 接收方uid
int64 receiver_uid = 3;
//接收方类型
int32 receiver_type = 4;
// 故事的版本
int64 story_version = 5;
// 操作结果的hash值
int64 op_hash = 6;
// 操作产生用户的uid
int64 op_sender = 7;
// patch内容
string op_content = 8;
}

View File

@@ -0,0 +1,8 @@
syntax = "proto3";
package bilibili.broadcast.message.esports;
message Notify {
// cid
int64 cid = 1;
}

View File

@@ -0,0 +1,18 @@
syntax = "proto3";
package bilibili.broadcast.message.fission;
import "google/protobuf/empty.proto";
//
service Fission {
//
rpc GameNotify(google.protobuf.Empty) returns (stream GameNotifyReply);
}
message GameNotifyReply {
// 类型字段
uint32 type = 1;
// 数据字段
string data = 2;
}

View File

@@ -0,0 +1,99 @@
syntax = "proto3";
package bilibili.broadcast.message.im;
import "google/protobuf/empty.proto";
//
service Notify {
//
rpc WatchNotify(google.protobuf.Empty) returns (stream NotifyRsp);
}
//
enum PLType {
//
EN_PAYLOAD_NORMAL = 0;
//
EN_PAYLOAD_BASE64 = 1;
}
//
enum CmdId {
// 非法cmd
EN_CMD_ID_INVALID = 0;
// 服务端主动发起
EN_CMD_ID_MSG_NOTIFY = 1;
//
EN_CMD_ID_KICK_OUT = 2;
}
//
message NotifyRsp {
//
uint64 uid=1;
// 命令id
uint64 cmd=2;
//
bytes payload=3;
//
PLType payload_type=4;
}
//
message Msg {
// 发送方uid
uint64 sender_uid = 1;
// 接收方类型
int32 receiver_type = 2;
// 接收方id
uint64 receiver_id = 3;
// 客户端的序列id 用于服务端去重
uint64 cli_msg_id = 4;
// 消息类型
int32 msg_type = 5;
// 消息内容
string content = 6;
// 服务端的序列号
uint64 msg_seqno = 7;
// 消息发送时间(服务端时间)
uint64 timestamp = 8;
// at用户列表
repeated uint64 at_uids = 9;
// 多人消息
repeated uint64 recver_ids = 10;
// 消息唯一标示
uint64 msg_key = 11;
// 消息状态
uint32 msg_status = 12;
// 是否为系统撤销
bool sys_cancel = 13;
// 是否是多聊消息 目前群通知管理员的部分通知属于该类消息
uint32 is_multi_chat = 14;
// 表示撤回的消息的session_seqno 用以后续的比较 实现未读数的正确显示
uint64 withdraw_seqno = 15;
// 通知码
string notify_code =16;
// 消息来源
uint32 msg_source = 17;
}
//
message NotifyInfo {
//
uint32 msg_type = 1;
//
uint64 talker_id = 2;
//
uint32 session_type =3;
}
//
message ReqServerNotify {
// 最新序列号
uint64 lastest_seqno = 1;
// 即时消息 该类消息主要用于系统通知 当客户端sync msg时 不会sync到此类消息
Msg instant_msg = 2;
//
NotifyInfo notify_info = 3;
}

View File

@@ -1,189 +0,0 @@
syntax = "proto3";
package bilibili.broadcast.message.main;
import "google/protobuf/empty.proto";
//
service NativePage {
//
//
rpc watchNotify (google.protobuf.Empty) returns (NativePageEvent);
}
//
service Resource {
//
//
rpc topActivity (google.protobuf.Empty) returns (TopActivityReply);
}
//
message NativePageEvent {
//
int64 pageID = 1;
//
repeated EventItem items = 2;
}
//
message TopActivityReply {
//
TopOnline online = 1;
//
string hash = 2;
}
//
message Animate {
//
string icon = 1;
//
string json = 2;
//
string svg = 3;
//
int32 loop = 4;
}
//
message CommandDm {
//
int64 id = 1;
//
int64 oid = 2;
//
int64 mid = 3;
//
int32 type = 4;
//
string command = 5;
//
string content = 6;
//
int32 state = 7;
//
int32 progress = 8;
//
string ctime = 9;
//
string mtime = 10;
//
string extra = 11;
//
string idStr = 12;
}
//
message DanmakuElem {
//
int64 id = 1;
//
int32 progress = 2;
//
int32 mode = 3;
//
int32 fontsize = 4;
//
uint32 color = 5;
//
string midHash = 6;
//
string content = 7;
//
int64 ctime = 8;
//
string action = 9;
//
int32 pool = 10;
//
string idStr = 11;
}
//
message DanmukuEvent {
//
DanmakuElem elems = 1;
}
//
message EventItem {
//
int64 itemID = 1;
//
string type = 2;
//
int64 num = 3;
//
string displayNum = 4;
//
string webKey = 5;
//
int64 dimension = 6;
}
//
message RedDot {
//
int32 type = 1;
//
int32 number = 2;
}
//
message TopOnline {
//
int32 type = 1;
//
string icon = 2;
//
string uri = 3;
//
string uniqueId = 4;
//
Animate animate = 5;
//
RedDot redDot = 6;
//
string name = 7;
//
int64 interval = 8;
}

View File

@@ -0,0 +1,63 @@
syntax = "proto3";
package bilibili.broadcast.message.main;
// 实时弹幕事件
message DanmukuEvent {
// 弹幕列表
repeated DanmakuElem elems = 1;
}
// 弹幕条目
message DanmakuElem {
// 弹幕dmid
int64 id = 1;
// 弹幕出现位置(单位为ms)
int32 progress = 2;
// 弹幕类型
int32 mode = 3;
// 弹幕字号
int32 fontsize = 4;
// 弹幕颜色
uint32 color = 5;
// 发送着mid hash
string mid_hash = 6;
// 弹幕正文
string content = 7;
// 发送时间
int64 ctime = 8;
// 弹幕动作
string action = 9;
// 弹幕池
int32 pool = 10;
// 弹幕id str
string id_str = 11;
}
// 互动弹幕
message CommandDm {
// 弹幕id
int64 id = 1;
// 对象视频cid
int64 oid = 2;
// 发送者mid
int64 mid = 3;
//
int32 type = 4;
// 互动弹幕指令
string command = 5;
// 互动弹幕正文
string content = 6;
// 弹幕状态
int32 state = 7;
// 出现时间
int32 progress = 8;
// 创建时间
string ctime = 9;
// 发布时间
string mtime = 10;
// 扩展json数据
string extra = 11;
// 弹幕id str类型
string idStr = 12;
}

View File

@@ -0,0 +1,36 @@
syntax = "proto3";
package bilibili.broadcast.message.main;
import "google/protobuf/empty.proto";
//
service NativePage {
//
rpc WatchNotify(google.protobuf.Empty) returns (stream NativePageEvent);
}
//
message NativePageEvent {
// Native页ID
int64 PageID = 1;
//
repeated EventItem Items = 2;
}
//
message EventItem {
// 组件标识
int64 ItemID = 1;
// 组件类型
string Type = 2;
// 进度条数值
int64 Num = 3;
// 进度条展示数值
string DisplayNum = 4;
// h5的组件标识
string WebKey = 5;
// 活动统计维度
// 0:用户维度 1:规则维度
int64 dimension = 6;
}

View File

@@ -0,0 +1,61 @@
syntax = "proto3";
package bilibili.broadcast.message.main;
import "google/protobuf/empty.proto";
//
service Resource {
//
rpc TopActivity(google.protobuf.Empty) returns (stream TopActivityReply);
}
//
message TopActivityReply {
// 当前生效的资源
TopOnline online = 1;
// 对online内容进行hash和上次结果一样则不重新加载
string hash = 2;
}
// 当前生效的资源
message TopOnline {
// 活动类型
// 1:七日活动 2:后台配置
int32 type = 1;
// 图标
string icon = 2;
// 跳转链接
string uri = 3;
// 资源状态标识(后台配置)
string unique_id = 4;
// 动画资源
Animate animate = 5;
// 红点
RedDot red_dot = 6;
// 活动名称
string name = 7;
// 轮询间隔 单位秒
int64 interval = 8;
}
// 动画资源
message Animate {
// 动效结束展示icon
string icon = 1;
// 7日活动动画
string json = 2;
// s10活动svg动画
string svg = 3;
// 循环次数(默认0不返回 表示无限循环)
int32 loop = 4;
}
// 红点
message RedDot {
// 红点类型
// 1:纯红点 2:数字红点
int32 type = 1;
// 如果是数字红点 显示的数字
int32 number = 2;
}

View File

@@ -0,0 +1,11 @@
syntax = "proto3";
package bilibili.broadcast.message.note;
//
message Sync {
// 笔记id
int64 note_id = 1;
// 唯一标示
string hash = 2;
}

View File

@@ -0,0 +1,228 @@
syntax = "proto3";
package bilibili.broadcast.message.ogv;
// 播放状态
enum PlayStatus {
// 暂停
Pause = 0;
// 播放
Play = 1;
// 终止
End = 2;
}
// 房间类型
enum RoomType {
// 私密
Private = 0;
// 公开
Open = 1;
}
// 信息通知发送领域
enum MessageDomain {
// 默认
DefaultDomain = 0;
// 房间用户
RoomMid = 1;
// 系统通知
SystemInfo = 2;
}
// 通知信息类型
enum MessageType {
// 默认
DefaultType = 0;
// 房间用户
ChatMessage = 1;
// 系统通知
SystemMessage = 2;
}
// 触发通知类型
enum TriggerType {
// 默认
DefaultTrigger = 0;
// 关注、取消关注
Relation = 1;
}
// 房间人员变更事件
message RoomMemberChangeEvent {
// 房间id
int64 room_id = 1;
// 房主id
int64 owner_id = 2;
// 房间成员列表
repeated UserInfoProto members = 3;
// 提示信息
MessageProto message = 4;
}
// 播放进度同步事件
message ProgressSyncEvent {
// 房间id
int64 room_id = 1;
// 播放中的season_id
int64 season_id = 2;
// 播放中的episode_id
int64 episode_id = 3;
// 播放状态
PlayStatus status = 4;
// 房主播放进度
int64 progress = 5;
// 提示信息
MessageProto message = 6;
}
// 房间状态更新
message RoomUpdateEvent {
// 房间id
int64 room_id = 1;
// 房间变更状态
RoomType type = 2;
// 提示信息
MessageProto message = 3;
}
// 房间销毁通知
message RoomDestroyEvent {
// 房间id
int64 room_id = 1;
// 提示信息
MessageProto message = 4;
}
// 房间触发通知
message RoomTriggerEvent {
// 操作人
int64 mid = 1;
// 提示信息
MessageProto message = 2;
// 触发类型
TriggerType trigger = 3;
}
//用户信息
message UserInfoProto {
// 用户id
int64 mid = 1;
// 用户头像url
string face = 2;
// 昵称
string nickname = 3;
// 等级
int32 level = 4;
// 签名
string sign = 5;
// 大会员信息
VipProto vip = 6;
// 身份认证信息
OfficialProto official = 7;
// 挂件信息
PendantProto pendant = 8;
// 设备buvid
string buvid = 9;
}
//通知信息
message MessageProto {
// 可带占位符匹配的消息体 ep "还没有其他小伙伴,[去邀请>]<https://big.bilibili.com/mobile/giftIndex?mid=123>"
string content = 1;
// 消息体类型
// 0:json格式的文本消息 1:支持全文本可点(破冰)
int32 content_type = 2;
}
//大会员信息
message VipProto {
int32 type = 1;
int32 status = 2;
int64 due_date = 3;
int32 vip_pay_type = 4;
int32 theme_type = 5;
// 大会员角标
// 0:无角标 1:粉色大会员角标 2:绿色小会员角标
int32 avatar_subscript = 6;
// 昵称色值,可能为空,色值示例:#FFFB9E60
string nickname_color = 7;
}
//认证信息
message OfficialProto {
int32 role = 1;
string title = 2;
string desc = 3;
int32 type = 4;
}
//挂件信息
message PendantProto {
int32 pid = 1;
string name = 2;
string image = 3;
int64 expire = 4;
string image_enhance = 5;
}
// 通用信息通知
message MessageEvent {
// 房间id
int64 room_id = 1;
// 消息id
int64 msg_id = 2;
// 消息发送服务端时间 时间戳 单位秒
int64 ts = 3;
// 信息通知发送主体id
int64 oid = 4;
// 信息通知发送领域
MessageDomain domain = 5;
// 通知信息类型
MessageType type = 6;
// 提示信息
MessageProto message = 7;
// 消息发送用户信息
UserInfoProto user = 8;
// 消息id str类型
string msg_id2 = 9;
}
// 聊天信息清除通知
message RemoveChatEvent {
// 房间id
int64 room_id = 1;
// 撤回的聊天信息id
int64 msg_id = 2;
// 提示信息
MessageProto message = 3;
}
// "一起看"房间事件
message FreyaEventBody {
// 房间id
int64 room_id = 1;
// 接收事件消息的白名单用户
repeated int64 white_mid = 2;
// 不处理信息的黑名单用户 优先级低于白名单 当白名单有数据时 忽略黑名单
repeated int64 ignore_mid = 3;
//命令类型
oneof event {
// 房间人员变更事件
RoomMemberChangeEvent member_change = 4;
// 播放进度同步事件
ProgressSyncEvent progress = 5;
// 房间状态更新
RoomUpdateEvent room_update = 6;
// 通用信息通知
MessageEvent message = 7;
// 聊天信息清除通知
RemoveChatEvent remove_chat = 8;
// 房间销毁通知
RoomDestroyEvent room_destroy = 9;
// 房间触发通知
RoomTriggerEvent room_trigger = 10;
}
// 消息序列号
int64 sequence_id = 100;
}

View File

@@ -0,0 +1,44 @@
syntax = "proto3";
package bilibili.broadcast.message.ogv;
// 开播事件
message LiveStartEvent {}
// 直播中止事件
message LiveEndEvent {}
// 在线人数事件
message LiveOnlineEvent {
//在线人数
int64 online = 1;
}
// 变更通知
message LiveUpdateEvent {
// 直播后状态
// 1:下线 2:转点播
int32 after_premiere_type = 1;
// 直播开始绝对时间 单位ms
int64 start_time = 2;
// id
string id = 3;
// 服务端播放进度,未打散,负数表示距离开播时间,正数表示已开播时间,单位:毫秒
// 用户实际播放进度progress - delay_time
int64 progress = 4;
}
// 直播间事件
message CMDBody {
//命令类型
oneof event {
// 开播事件
LiveStartEvent start = 1;
// 直播中止事件
LiveEndEvent emergency = 2;
// 在线人数事件
LiveOnlineEvent online = 3;
// 变更通知
LiveUpdateEvent update = 4;
}
}

View File

@@ -0,0 +1,21 @@
syntax = "proto3";
package bilibili.broadcast.message.ticket;
//
enum RoomStatus {
// 暂停:
Pause = 0;
// 播放:
Play = 1;
// 终止:
End = 2;
}
// 推送选项
message RoomEvent {
// RoomStatus 类型
RoomStatus room_status = 1;
//
string room_message = 2;
}

View File

@@ -0,0 +1,77 @@
syntax = "proto3";
package bilibili.broadcast.message.tv;
import "google/protobuf/empty.proto";
//
service Tv {
// 投屏
rpc Proj(google.protobuf.Empty) returns (stream ProjReply);
// 直播状态
rpc LiveStatus(google.protobuf.Empty) returns (stream LiveStatusNotify);
// 赛事比分通知
rpc Esports(google.protobuf.Empty) returns (stream EsportsNotify);
// 直播插卡
rpc Publicity(google.protobuf.Empty) returns (stream PublicityNotify);
// 直转点
rpc LiveSkip(google.protobuf.Empty) returns (stream LiveSkipNotify);
}
// 投屏
message ProjReply {
// 投屏命令
// 1:起播 2:快进 3:快退 4:seek播放进度 5:暂停 6:暂停恢复
int64 cmd_type = 1;
// 用户id
int64 mid = 2;
// 稿件id
int64 aid = 3;
// 视频id
int64 cid = 4;
// 视频类型
// 0:ugc 1:pgc 2:pugv
int64 video_type = 5;
// 单集idpgc和pugv需要传
int64 ep_id = 6;
// 剧集id
int64 season_id = 7;
// seek 的位置cmd位seek时有值单位秒
int64 seek_ts = 8;
// 其他指令对应内容
string extra = 9;
}
// 直播状态
message LiveStatusNotify {
// 直播状态
// 1:开播 2:关播 3:截流 4:截流恢复
int64 status = 1;
// 文案
string msg = 2;
// 直播房间号
int64 cid = 3;
}
//
message EsportsNotify {
// 直播房间号
int64 cid = 1;
}
// 直播插卡
message PublicityNotify {
// 插卡id
int64 publicity_id = 1;
// 直播房间号
int64 room_id = 2;
// 直播间状态
// 0:未开播 1:直播中 2:轮播中
int64 status = 3;
}
// 直转点
message LiveSkipNotify {
// 直播id
int64 live_id = 1;
}