syntax = "proto3";

package kuaishouPubf;

// 进入房间
message CSWebEnterRoom {
  int64 payloadType = 1;
  message Payload {
    string token = 1;
    string liveStreamId = 2;
    uint32 reconnectCount = 3;
    uint32 lastErrorCode = 4;
    string expTag = 5;
    string attach = 6;
    string pageId = 7;
  }
  Payload payload = 3;
}

// 进入房间后应答包
message SCWebEnterRoomAck {
  uint64 minReconnectMs = 1;
  uint64 maxReconnectMs = 2;
  uint64 heartbeatIntervalMs = 3;
}

// 用户信息包
message SimpleUserInfo {
  string principalId = 1;
  string userName = 2;
  string headUrl = 3;
}

// 观看用户信息
message WebWatchingUserInfo {
  SimpleUserInfo user = 1;
  bool offline = 2;
  bool tuhao = 3;
  WebLiveAssistantType liveAssistantType = 4;
  string displayKsCoin = 5;
}

// 观看用户数
message SCWebLiveWatchingUsers {
  repeated WebWatchingUserInfo watchingUser = 1;
  string displayWatchingCount = 2;
  uint64 pendingDuration = 3;
}

// 心跳包
message CSWebHeartbeat {
  int64 payloadType = 1;
  message Payload {
    uint64 timestamp = 1;
  }
  Payload payload = 3;
}

// 消息主体包
message SocketMessage {
  PayloadType payloadType = 1;
  CompressionType compressionType = 2;
  bytes payload = 3;
}

// 心跳包响应
message SCHeartbeatAck {
  uint64 timestamp = 1;
  uint64 clientTimestamp = 2;
}

message WebCommentFeed {
  string id = 1;
  SimpleUserInfo user = 2;
  string content = 3;
  string deviceHash = 4;
  uint64 sortRank = 5;
  string color = 6;
  WebCommentFeedShowType showType = 7;
  LiveAudienceState senderState = 8;
}

message LiveAudienceState {
  bool isFromFansTop = 1;
  bool isKoi = 2;
  AssistantType assistantType = 3;
  uint32 fansGroupIntimacyLevel = 4;
  GzoneNameplate nameplate = 5;
  LiveFansGroupState liveFansGroupState = 6;
  uint32 wealthGrade = 7;
  string badgeKey = 8;
}

message LiveFansGroupState {
  uint32 intimacyLevel = 1;
  uint32 enterRoomSpecialEffect = 2;
}

message GzoneNameplate {
  int64 id = 1;
  string name = 2;
  repeated PicUrl urls = 3;
}

message PicUrl {
  string cdn = 1;
  string url = 2;
  string urlPattern = 3;
  string ip = 4;

}


message SCWebFeedPush {
  string displayWatchingCount = 1;
  string displayLikeCount = 2;
  uint64 pendingLikeCount = 3;
  uint64 pushInterval = 4;
  repeated WebCommentFeed commentFeeds = 5;
  string commentCursor = 6;
  repeated WebComboCommentFeed comboCommentFeed = 7;
  repeated WebLikeFeed likeFeeds = 8;
  repeated  WebGiftFeed giftFeeds = 9;
  string giftCursor = 10;
  repeated WebSystemNoticeFeed systemNoticeFeeds = 11;
  repeated WebShareFeed shareFeeds = 12;

}

message WebShareFeed {
  string id = 1;
  SimpleUserInfo user = 2;
  uint64 time = 3;
  uint32 thirdPartyPlatform = 4;
  uint64 sortRank = 5;
  WebLiveAssistantType liveAssistantType = 6;
  string deviceHash = 7;
}

message WebSystemNoticeFeed {
  string id = 1;
  SimpleUserInfo user = 2;
  uint64 time = 3;
  string content = 4;
  uint64 displayDuration = 5;
  uint64 sortRank = 6;
  DisplayType displayType = 7;
}

message WebGiftFeed {
  string id = 1;
  SimpleUserInfo user = 2;
  uint64 time = 3;
  uint32 giftId = 4;
  uint64 sortRank = 5;
  string mergeKey = 6;
  uint32 batchSize = 7;
  uint32 comboCount = 8;
  uint32 rank = 9;
  uint64 expireDuration = 10;
  uint64 clientTimestamp = 11;
  uint64 slotDisplayDuration = 12;
  uint32 starLevel = 13;
  StyleType styleType = 14;
  WebLiveAssistantType liveAssistantType = 15;
  string deviceHash = 16;
  bool danmakuDisplay = 17;

}

message WebLikeFeed {
  string id = 1;
  SimpleUserInfo user = 2;
  uint64 sortRank = 3;
  string deviceHash = 4;
}

message WebComboCommentFeed {
  string id = 1;
  string content = 2;
  uint32 comboCount = 3;
}
enum CompressionType {
  COMPRESSION_TYPE_UNKNOWN = 0;
  NONE = 1;
  GZIP = 2;
  AES = 3;
}

// 弹幕数据包返回类型
enum PayloadType {
 PAYLOAD_TYPE_UNKNOWN = 0;
 CS_HEARTBEAT = 1;
 CS_ERROR = 3;
 CS_PING = 4;
 PS_HOST_INFO = 51;
 SC_HEARTBEAT_ACK = 101;
 SC_ECHO = 102;
 SC_ERROR = 103;
 SC_PING_ACK = 104;
 SC_INFO = 105;
 CS_ENTER_ROOM = 200;
 CS_USER_PAUSE = 201;
 CS_USER_EXIT = 202;
 CS_AUTHOR_PUSH_TRAFFIC_ZERO = 203;
 CS_HORSE_RACING = 204;
 CS_RACE_LOSE = 205;
 CS_VOIP_SIGNAL = 206;
 SC_ENTER_ROOM_ACK = 300;
 SC_AUTHOR_PAUSE = 301;
 SC_AUTHOR_RESUME = 302;
 SC_AUTHOR_PUSH_TRAFFIC_ZERO = 303;
 SC_AUTHOR_HEARTBEAT_MISS = 304;
 SC_PIP_STARTED = 305;
 SC_PIP_ENDED = 306;
 SC_HORSE_RACING_ACK = 307;
 SC_VOIP_SIGNAL = 308;
 SC_FEED_PUSH = 310;
 SC_ASSISTANT_STATUS = 311;
 SC_REFRESH_WALLET = 312;
 SC_LIVE_CHAT_CALL = 320;
 SC_LIVE_CHAT_CALL_ACCEPTED = 321;
 SC_LIVE_CHAT_CALL_REJECTED = 322;
 SC_LIVE_CHAT_READY = 323;
 SC_LIVE_CHAT_GUEST_END = 324;
 SC_LIVE_CHAT_ENDED = 325;
 SC_RENDERING_MAGIC_FACE_DISABLE = 326;
 SC_RENDERING_MAGIC_FACE_ENABLE = 327;
 SC_RED_PACK_FEED = 330;
 SC_LIVE_WATCHING_LIST = 340;
 SC_LIVE_QUIZ_QUESTION_ASKED = 350;
 SC_LIVE_QUIZ_QUESTION_REVIEWED = 351;
 SC_LIVE_QUIZ_SYNC = 352;
 SC_LIVE_QUIZ_ENDED = 353;
 SC_LIVE_QUIZ_WINNERS = 354;
 SC_SUSPECTED_VIOLATION = 355;
 SC_SHOP_OPENED = 360;
 SC_SHOP_CLOSED = 361;
 SC_GUESS_OPENED = 370;
 SC_GUESS_CLOSED = 371;
 SC_PK_INVITATION = 380;
 SC_PK_STATISTIC = 381;
 SC_RIDDLE_OPENED = 390;
 SC_RIDDLE_CLOESED = 391;
 SC_RIDE_CHANGED = 412;
 SC_BET_CHANGED = 441;
 SC_BET_CLOSED = 442;
 SC_LIVE_SPECIAL_ACCOUNT_CONFIG_STATE = 645;
 SC_LIVE_WARNING_MASK_STATUS_CHANGED_AUDIENCE = 758;
}

enum WebLiveAssistantType {
  WEB_LIVE_ASSISTANT_TYPE_UNKNOWN_ASSISTANT_TYPE = 0;
  SUPER = 1;
  JUNIOR = 2;
}

enum WebCommentFeedShowType {
  FEED_SHOW_UNKNOWN = 0;
  FEED_SHOW_NORMAL = 1;
  FEED_HIDDEN = 2;
}

enum AssistantType {
  UNKNOWN_ASSISTANT_TYPE = 0;
  ASSISTANT_SUPER = 1;
  ASSISTANT_JUNIOR = 2;
}

enum StyleType {
  UNKNOWN_STYLE = 0;
  BATCH_STAR_0 = 1;
  BATCH_STAR_1 = 2;
  BATCH_STAR_2 = 3;
  BATCH_STAR_3 = 4;
  BATCH_STAR_4 = 5;
  BATCH_STAR_5 = 6;
  BATCH_STAR_6 = 7;
}

enum DisplayType {
  UNKNOWN_DISPLAY_TYPE = 0;
  COMMENT = 1;
  ALERT = 2;
  TOAST  =3;
}