Initial commit

main
lzCodeGarden 2 years ago
commit c2b900b593

@ -0,0 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: 👀 Github论坛 | GitHub Discussions
url: https://github.com/OrdinaryRoad-Project/ordinaryroad-live-chat-client/discussions
about: 如果您的问题不是功能或者错误,请转到讨论面板并在提交之前检索您的问题是否已经存在。

@ -0,0 +1,22 @@
---
name: 🙋 问题交流 | Question Report
about: 在文档或讨论中没有回答的使用问题 | Usage question that isn't answered in docs or discussion
title: "🙋 问题交流。。。 | [Question] Some question..."
labels: [ "question" ]
---
## Question Report
- 搜索打开和关闭的 [GitHub 问题](https://github.com/OrdinaryRoad-Project/ordinaryroad-live-chat-client/issues)
请在提交问题之前回答这些问题,谢谢。 | Please answer these questions before submitting them. Thank you.
### 你使用了哪个版本? | Which version did you use?
### 预期行为 | Expected behavior
### 实际行为 | Actual behavior
### 原因分析(如果可以) | Cause analysis (if possible)
### 问题重现步骤 | Steps to reproduce the problem

@ -0,0 +1,18 @@
---
name: 🐛 错误报告 | Bug Report
about: 请详细描述您使用过程中遇到的问题。| Please describe in detail the problems you encountered in the process of using.
title: "🐛 一些问题。。。 | [Bug] Some problem..."
labels: [ "bug" ]
---
<!-- 请在您提交 bug 之前,回答以下这些问题。 | Please answer these questions before you submit a bug. -->
#### 您使用的版本? | Your usage version?
#### 您使用的场景? | Your usage scenarios?
#### 您做了什么操作? | What did you do?
#### 您遇到了什么问题? | What are your problems?
#### 您期望的结果是怎样的? | What is your expected outcome?

@ -0,0 +1,12 @@
---
name: 🚀 功能请求 | Feature Request
about: 请详细描述您期望的功能。 | Please describe in detail the features you expect.
title: "🚀 一些功能。。。 | [Feature]Some feature..."
labels: [ "enhancement" ]
---
<!-- 请在您提交期望的功能之前,回答以下这些问题。 | Please answer these questions before you submit the desired feature. -->
#### 您使用的场景? | 1. Your usage scenarios?
#### 您期望的结果是怎样的? | 2. What is your expected outcome?

@ -0,0 +1,14 @@
<!-- 请务必在创建PR前在右侧 Labels 选项中加上label的其中一个: [feature]、[fix]、[documentation] 。以便于Actions自动生成Releases时自动对PR进行归类。-->
**在提出此拉取请求时,我确认了以下几点(请复选框):**
- [ ] 我已阅读并理解[贡献者指南]()。
- [ ] 我已检查没有与此请求重复的拉取请求。
- [ ] 我已经考虑过,并确认这份呈件对其他人很有价值。
- [ ] 我接受此提交可能不会被使用,并根据维护人员的意愿关闭拉取请求。
**填写PR内容**
-
-
-

@ -0,0 +1,43 @@
# Configuration for Release Drafter: https://github.com/toolmantim/release-drafter
name-template: 'v$NEXT_PATCH_VERSION 🌈'
tag-template: 'v$NEXT_PATCH_VERSION'
version-template: $MAJOR.$MINOR.$PATCH
autolabeler:
- label: 'chore'
files:
- '*.md'
- label: 'bug'
branch:
- '/fix.+/'
- label: 'enhancement'
branch:
- '/feat.+/'
- '/perf.+/'
- label: 'cicd'
branch:
- '/cicd.+/'
- label: 'refactor'
branch:
- '/refactor.+/'
# Emoji reference: https://gitmoji.carloscuesta.me/
categories:
- title: '🚀 Features'
labels:
- 'enhancement'
- title: '🐛 Bug Fixes'
labels:
- 'bug'
- title: '🧰 Maintenance'
labels:
- 'cicd'
- 'chore'
- 'refactor'
exclude-labels:
- reverted
- no-changelog
- skip-changelog
- invalid
change-template: '- $TITLE (#$NUMBER) @$AUTHOR'
template: |
## Whats Changed
$CHANGES

@ -0,0 +1,23 @@
name: Update Maven Dependency Graph
on:
workflow_dispatch:
push:
branches:
- main
pull_request:
types: [ opened, reopened, synchronize ]
permissions:
contents: read
jobs:
update_maven_dependency_graph:
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Submit Dependency Snapshot
uses: advanced-security/maven-dependency-submission-action@v3

@ -0,0 +1,22 @@
name: Release Drafter
on:
push:
branches:
- main
pull_request:
types: [ opened, reopened, synchronize ]
permissions:
contents: read
jobs:
update_release_draft:
permissions:
contents: write # for release-drafter/release-drafter to create a github release
pull-requests: write # for release-drafter/release-drafter to add label to PR
runs-on: ubuntu-latest
steps:
- uses: release-drafter/release-drafter@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

102
.gitignore vendored

@ -0,0 +1,102 @@
### Maven template
target/
pom.xml.tag
pom.xml.releaseBackup
pom.xml.versionsBackup
pom.xml.next
release.properties
dependency-reduced-pom.xml
buildNumber.properties
.mvn/timing.properties
# https://github.com/takari/maven-wrapper#usage-without-binary-jar
.mvn/wrapper/maven-wrapper.jar
# Eclipse m2e generated files
# Eclipse Core
.project
# JDT-specific (Eclipse Java Development Tools)
.classpath
### JetBrains template
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
# User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf
# AWS User-specific
.idea/**/aws.xml
# Generated files
.idea/**/contentModel.xml
# Sensitive or high-churn files
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml
# Gradle
.idea/**/gradle.xml
.idea/**/libraries
# Gradle and Maven with auto-import
# When using Gradle or Maven with auto-import, you should exclude module files,
# since they will be recreated, and may cause churn. Uncomment if using
# auto-import.
# .idea/artifacts
# .idea/compiler.xml
# .idea/jarRepositories.xml
# .idea/modules.xml
# .idea/*.iml
# .idea/modules
# *.iml
# *.ipr
# CMake
cmake-build-*/
# Mongo Explorer plugin
.idea/**/mongoSettings.xml
# File-based project format
*.iws
# IntelliJ
out/
# mpeltonen/sbt-idea plugin
.idea_modules/
# JIRA plugin
atlassian-ide-plugin.xml
# Cursive Clojure plugin
.idea/replstate.xml
# SonarLint plugin
.idea/sonarlint/
# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties
# Editor-based Rest Client
.idea/httpRequests
# Android studio 3.1+ serialized cache file
.idea/caches/build_file_checksums.ser
.idea
**/src/main/resources/proto/**/*.java

@ -0,0 +1,25 @@
#
# MIT License
#
# Copyright (c) 2023 OrdinaryRoad
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
#
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.6/apache-maven-3.8.6-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2023 OrdinaryRoad
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

@ -0,0 +1,507 @@
# ordinaryroad-live-chat-client
![license](https://img.shields.io/github/license/OrdinaryRoad-Project/ordinaryroad-live-chat-client) ![release](https://img.shields.io/github/v/release/OrdinaryRoad-Project/ordinaryroad-live-chat-client?include_prereleases) ![Maven Central](https://img.shields.io/maven-central/v/tech.ordinaryroad/live-chat-client)
> This project is in progress... 👨‍💻,有问题欢迎[提交issuse](https://github.com/OrdinaryRoad-Project/ordinaryroad-live-chat-client/issues/new/choose)
> 觉得有用的话可以点个小星星⭐️鼓励一下,感谢
>
> 如果对项目感兴趣也欢迎[加入QQ频道](https://pd.qq.com/s/3id0n7fvs)交流讨论,
> 提交PR
>
> ToDo List: [https://github.com/orgs/OrdinaryRoad-Project/projects/1](https://github.com/orgs/OrdinaryRoad-Project/projects/1)
>
> **更新日志:**[https://github.com/OrdinaryRoad-Project/ordinaryroad-live-chat-client/releases](https://github.com/OrdinaryRoad-Project/ordinaryroad-live-chat-client/releases)
---
Live room WebSocket chat client
- Feature 0: Netty
- Feature 1: 消息中的未知属性统一放到单独的MAP中JSON格式消息
- Feature 2: 支持自动重连
- Feature 3: 支持同时监听多个直播间
- Feature 4: 支持短直播间id
- Feature 5*: 支持弹幕发送、为主播点赞
- Feature 6*: 内置收到弹幕、收到礼物、收到醒目留言、用户入房、收到点赞、状态变化回调
- Feature 7: 支持消息转发
- Feature 8: 支持单独引入编解码模块
- Feature 9: 支持网络代理
> *存在平台差异
> - ✅: 平台支持且已完成
> - ☑️️: 平台支持但未实现
> - ❌: 平台网页端暂不支持
平台适配情况表
| 平台 | LiveChatClient | Cookie | 短直播间id | 发送弹幕 | 为主播点赞 |
|-------------|----------------|--------|--------|------|-------|
| Bilibili B站 | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| Douyu 斗鱼 | ✅ | ✅ | ✅ | ✅ | ❌ |
| Huya 虎牙 | ✅ | ✅ | ✅ | ✅ | ❌ |
| Douyin 抖音 | ✅ | ☑️️ | ✅ | ☑️ | ☑️️ |
| Kuaishou 快手 | ✅ | ✅ | ✅ | ✅ | ✅ |
平台直播间消息适配情况表
| 平台 | 弹幕 | 礼物 | 醒目留言 | 进入房间 | 点赞 | 状态变化 | 统计信息 |
|-------------|----|-----------|------|---------|---------|------|--------------------|
| Bilibili B站 | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅(点赞数、当前人数、累计观看人数) |
| Douyu 斗鱼 | ✅ | ✅ | ☑️ | ✅ | ❌ | ☑️ | ❌ |
| Huya 虎牙 | ✅ | ✅ | ❌ | ✅(高级用户) | ❌ | ☑️ | ❌ |
| Douyin 抖音 | ✅ | ✅ | ❌ | ✅ | ✅(点赞个数) | ✅ | ✅(点赞数、当前人数) |
| Kuaishou 快手 | ✅ | ✅(礼物信息不全) | ❌ | ❌ | ✅(首次点赞) | ❌ | ✅(点赞数、当前人数) |
消息接口内置的方法见 [https://github.com/OrdinaryRoad-Project/ordinaryroad-live-chat-client/tree/main/live-chat-client-commons/live-chat-client-commons-base/src/main/java/tech/ordinaryroad/live/chat/client/commons/base/msg](https://github.com/OrdinaryRoad-Project/ordinaryroad-live-chat-client/tree/main/live-chat-client-commons/live-chat-client-commons-base/src/main/java/tech/ordinaryroad/live/chat/client/commons/base/msg)
运行效果图
![运行效果](assets/运行效果.png)
---
[//]: # ([在线文档]&#40;https://ordinaryroad.tech/or_module/live-chat-client/&#41;)
## [⭐BarrageFly——让弹幕飞](https://barragefly.ordinaryroad.tech/),基于该项目的一个弹幕转发、过滤、处理平台
## 0 原理
抓取浏览器的WebSocket二进制流然后分析模拟浏览器的行为这种方式的优点是不需要开发者认证缺点是没有官方文档分析过程比较费时费力并且需要适配不同平台的流程变化不会经常变化
以后可能会考虑支持平台的开放协议
## 1 安装
> JDK ≥ 8
### B站
```xml
<dependency>
<groupId>tech.ordinaryroad</groupId>
<artifactId>live-chat-client-bilibili</artifactId>
<!-- 参考github release版本不需要前缀`v` -->
<version>${ordinaryroad-live-chat-client.version}</version>
</dependency>
```
> Gradle用户注意自从`0.3.2`版本开始B站Client配置中压缩方式默认为`NORMAL_BROTLI`当使用Gradle引入时还需要引入操作系统对应的brotli4j native包详见https://github.com/hyperxpro/Brotli4j?tab=readme-ov-file#gradle
例如:
```groovy
val liveChatClientBrotliVersion = "1.16.0"
// Windows
implementation("com.aayushatharva.brotli4j:native-windows-x86_64:$liveChatClientBrotliVersion")
implementation("com.aayushatharva.brotli4j:native-windows-aarch64:$liveChatClientBrotliVersion")
// Linux
implementation("com.aayushatharva.brotli4j:native-linux-armv7:$liveChatClientBrotliVersion")
implementation("com.aayushatharva.brotli4j:native-linux-aarch64:$liveChatClientBrotliVersion")
implementation("com.aayushatharva.brotli4j:native-linux-x86_64:$liveChatClientBrotliVersion")
implementation("com.aayushatharva.brotli4j:native-linux-s390x:$liveChatClientBrotliVersion")
implementation("com.aayushatharva.brotli4j:native-linux-riscv64:$liveChatClientBrotliVersion")
implementation("com.aayushatharva.brotli4j:native-linux-ppc64le:$liveChatClientBrotliVersion")
// Mac
implementation("com.aayushatharva.brotli4j:native-osx-aarch64:$liveChatClientBrotliVersion")
implementation("com.aayushatharva.brotli4j:native-osx-x86_64:$liveChatClientBrotliVersion")
```
如果引入后仍无法使用请修改protover配置项例如改为`NORMAL_ZLIB``BilibiliLiveChatClientConfig.builder().protover(ProtoverEnum.NORMAL_ZLIB).roomId("xxx").build()`
### 斗鱼
```xml
<dependency>
<groupId>tech.ordinaryroad</groupId>
<artifactId>live-chat-client-douyu</artifactId>
<!-- 参考github release版本不需要前缀`v` -->
<version>${ordinaryroad-live-chat-client.version}</version>
</dependency>
```
### 虎牙
```xml
<dependency>
<groupId>tech.ordinaryroad</groupId>
<artifactId>live-chat-client-huya</artifactId>
<!-- 参考github release版本不需要前缀`v` -->
<version>${ordinaryroad-live-chat-client.version}</version>
</dependency>
```
### 抖音
```xml
<dependency>
<groupId>tech.ordinaryroad</groupId>
<artifactId>live-chat-client-douyin</artifactId>
<!-- 参考github release版本不需要前缀`v` -->
<version>${ordinaryroad-live-chat-client.version}</version>
</dependency>
```
### 快手
```xml
<dependency>
<groupId>tech.ordinaryroad</groupId>
<artifactId>live-chat-client-kuaishou</artifactId>
<!-- 参考github release版本不需要前缀`v` -->
<version>${ordinaryroad-live-chat-client.version}</version>
</dependency>
```
## 2 使用
> 测试类包含了多种样例,可供参考
### 2.0 不同平台的CMD定义
- B站[BilibiliCmdEnum](https://github.com/OrdinaryRoad-Project/ordinaryroad-live-chat-client/blob/main/live-chat-client-codec/live-chat-client-codec-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/codec/bilibili/constant/BilibiliCmdEnum.java)
- 斗鱼:[DouyuCmdEnum](https://github.com/OrdinaryRoad-Project/ordinaryroad-live-chat-client/blob/main/live-chat-client-codec/live-chat-client-codec-douyu/src/main/java/tech/ordinaryroad/live/chat/client/codec/douyu/constant/DouyuCmdEnum.java)
- 虎牙:[HuyaCmdEnum](https://github.com/OrdinaryRoad-Project/ordinaryroad-live-chat-client/blob/main/live-chat-client-codec/live-chat-client-codec-huya/src/main/java/tech/ordinaryroad/live/chat/client/codec/huya/constant/HuyaCmdEnum.java)
- 抖音:[DouyinCmdEnum](https://github.com/OrdinaryRoad-Project/ordinaryroad-live-chat-client/blob/main/live-chat-client-codec/live-chat-client-codec-douyin/src/main/java/tech/ordinaryroad/live/chat/client/codec/douyin/constant/DouyinCmdEnum.java)
- 快手:[PayloadTypeOuterClass](https://github.com/OrdinaryRoad-Project/ordinaryroad-live-chat-client/blob/main/live-chat-client-codec/live-chat-client-codec-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/codec/kuaishou/protobuf/PayloadTypeOuterClass.java)
可以重写`onCmdMsg(收到的所有CMD消息)`或`onOtherCmdMsg(框架未处理的CMD消息)`回调方法判断CMD来监听框架已经定义的CMD类型
如果要监听的消息枚举类中未定义,可以考虑重写`onUnknownCmdMsg(未知CMD消息)`方法
ICmdMsg类型转换对应关系
- B站MessageMsg
- 斗鱼DouyuCmdMsg
- 虎牙WSPushMessage 或 WSMsgItem
- 抖音DouyinCmdMsg 或 DouyinSocialMsg(计划下个版本增加ISocialMsg)
- 快手KuaishouCmdMsg
```java
@Override
public void onOtherCmdMsg(BilibiliCmdEnum cmd, ICmdMsg<BilibiliCmdEnum> cmdMsg) {
switch (cmd) {
case GUARD_BUY: {
// 有人上舰
MessageMsg messageMsg = (MessageMsg) cmdMsg;
...
break;
}
case SUPER_CHAT_MESSAGE_DELETE: {
// 删除醒目留言
MessageMsg messageMsg = (MessageMsg) cmdMsg;
...
break;
}
default: {
// ignore
}
}
}
```
### 2.1 Client模式
> Spring Boot 示例 [client-example](https://github.com/OrdinaryRoad-Project/ordinaryroad-live-chat-client/tree/main/live-chat-client-examples/client-example)
1. 创建配置
2. 创建Client并传入配置、添加消息回调
3. 开始监听直播间
> 如果需要查看其他平台的效果,请将`Bilibili`改为其他平台对应的英文,并修改消息回调接口的函数签名
```java
public class ClientModeExample {
public static void main(String[] args) {
String cookie = System.getenv("cookie");
// 1. 创建配置
BilibiliLiveChatClientConfig config = BilibiliLiveChatClientConfig.builder()
// TODO 消息转发地址
.forwardWebsocketUri("")
// TODO 浏览器Cookie
.cookie(cookie)
// TODO 直播间id支持短id
.roomId(7777)
.build();
// 2. 创建Client并传入配置、添加消息回调
BilibiliLiveChatClient client = new BilibiliLiveChatClient(config, new IBilibiliMsgListener() {
@Override
public void onDanmuMsg(BilibiliBinaryFrameHandler binaryFrameHandler, DanmuMsgMsg msg) {
IBilibiliMsgListener.super.onDanmuMsg(binaryFrameHandler, msg);
System.out.printf("%s 收到弹幕 %s %s(%s)%s\n", binaryFrameHandler.getRoomId(), msg.getBadgeLevel() != 0 ? msg.getBadgeLevel() + msg.getBadgeName() : "", msg.getUsername(), msg.getUid(), msg.getContent());
}
@Override
public void onGiftMsg(BilibiliBinaryFrameHandler binaryFrameHandler, SendGiftMsg msg) {
IBilibiliMsgListener.super.onGiftMsg(binaryFrameHandler, msg);
System.out.printf("%s 收到礼物 %s %s(%s) %s %s(%s)x%s(%s)\n", binaryFrameHandler.getRoomId(), msg.getBadgeLevel() != 0 ? msg.getBadgeLevel() + msg.getBadgeName() : "", msg.getUsername(), msg.getUid(), msg.getData().getAction(), msg.getGiftName(), msg.getGiftId(), msg.getGiftCount(), msg.getGiftPrice());
}
@Override
public void onSuperChatMsg(BilibiliBinaryFrameHandler binaryFrameHandler, SuperChatMessageMsg msg) {
IBilibiliMsgListener.super.onSuperChatMsg(binaryFrameHandler, msg);
System.out.printf("%s 收到醒目留言 %s(%s)%s\n", binaryFrameHandler.getRoomId(), msg.getUsername(), msg.getUid(), msg.getContent());
}
@Override
public void onEnterRoomMsg(InteractWordMsg msg) {
System.out.printf("%s %s(%s) 进入直播间\n", msg.getBadgeLevel() != 0 ? msg.getBadgeLevel() + msg.getBadgeName() : "", msg.getUsername(), msg.getUid());
}
@Override
public void onLikeMsg(BilibiliBinaryFrameHandler binaryFrameHandler, LikeInfoV3ClickMsg msg) {
IBilibiliMsgListener.super.onLikeMsg(binaryFrameHandler, msg);
System.out.printf("%s 收到点赞 %s %s(%s)\n", binaryFrameHandler.getRoomId(), msg.getBadgeLevel() != 0 ? msg.getBadgeLevel() + msg.getBadgeName() : "", msg.getUsername(), msg.getUid());
}
@Override
public void onLiveStatusMsg(BilibiliBinaryFrameHandler binaryFrameHandler, BilibiliLiveStatusChangeMsg msg) {
IBilibiliMsgListener.super.onLiveStatusMsg(binaryFrameHandler, msg);
System.out.printf("%s 状态变化 %s\n", binaryFrameHandler.getRoomId(), msg.getLiveStatusAction());
}
@Override
public void onRoomStatsMsg(BilibiliBinaryFrameHandler binaryFrameHandler, BilibiliRoomStatsMsg msg) {
IBilibiliMsgListener.super.onRoomStatsMsg(binaryFrameHandler, msg);
System.out.printf("%s 统计信息 累计点赞数: %s, 当前观看人数: %s, 累计观看人数: %s\n", binaryFrameHandler.getRoomId(), msg.getLikedCount(), msg.getWatchingCount(), msg.getWatchedCount());
}
});
// 添加客户端连接状态回调
client.addStatusChangeListener((evt, oldStatus, newStatus) -> {
if (newStatus == ClientStatusEnums.CONNECTED) {
// TODO 要发送的弹幕内容,请注意控制发送频率;框架内置支持设置发送弹幕的最少时间间隔,小于时将忽略该次发送
client.sendDanmu("666666" + RandomUtil.randomNumbers(1));
}
});
// 3. 开始监听直播间
client.connect();
}
}
```
#### 2.1.1 Client相关API
- 连接
- `void connect(Runnable success, Consumer<Throwable> failed)`
- `void connect(Runnable success)`
- `void connect()`
- 断开连接
- `void disconnect(boolean cancelReconnect)`
- `void disconnect()`
- 销毁
- `void destroy()`
- 发送消息
- `void send(Object msg, Runnable success, Consumer<Throwable> failed)`
- `void send(Object msg, Runnable success)`
- `void send(Object msg, Consumer<Throwable> failed)`
- `void send(Object msg)`
- 发送弹幕
- `void sendDanmu(Object danmu, Runnable success, Consumer<Throwable> failed)`
- `void sendDanmu(Object danmu, Runnable success)`
- `void sendDanmu(Object danmu, Consumer<Throwable> failed)`
- `void sendDanmu(Object danmu)`
- 为主播点赞
- `void clickLike(int count, Runnable success, Consumer<Throwable> failed)`
- `void clickLike(int count, Runnable success)`
- `void clickLike(int count, Consumer<Throwable> failed)`
- `void clickLike(int count)`
- 添加消息监听器
- `boolean addMsgListener(MsgListener msgListener)`
- `boolean addMsgListeners(List<MsgListener> msgListeners)`
- 移除消息监听器
- `boolean removeMsgListener(MsgListener msgListener)`
- `boolean removeMsgListeners(List<MsgListener> msgListeners)`
- 获取当前状态
- `ClientStatusEnums getStatus()`
- 添加状态变化监听器
- `void addStatusChangeListener(IClientStatusChangeListener listener)`
- 移除状态变化监听器
- `void removeStatusChangeListener(IClientStatusChangeListener listener)`
### 2.2 高级模式
> 参考 [BilibiliHandlerModeExample](https://github.com/OrdinaryRoad-Project/ordinaryroad-live-chat-client/tree/main/live-chat-client-examples/handler-example/src/main/java/tech/ordinaryroad/live/chat/client/example/handler/BilibiliHandlerModeExample.java)
### 2.3 单独引入编解码模块
> 参考 [codec-example](https://github.com/OrdinaryRoad-Project/ordinaryroad-live-chat-client/tree/main/live-chat-client-examples/codec-example/src/main/java/tech/ordinaryroad/live/chat/client/example/codec/BilibiliCodecExample.java)
B站示例其他平台只需修改`bilibili`即可
> 使用Gradle引入B站编解码模块时参考[#B站](#B站)
```xml
<dependency>
<groupId>tech.ordinaryroad</groupId>
<artifactId>live-chat-client-codec-bilibili</artifactId>
<!-- 参考github release版本不需要前缀`v` -->
<version>${ordinaryroad-live-chat-client.version}</version>
</dependency>
```
### 2.4 设置代理
> 生效范围:仅项目自身,不会影响引用该项目的父项目
在代码中修改Config`socks5ProxyHost("127.0.0.1")`, `socks5ProxyPort("1080")`
身份认证(暂未测试)
- `socks5ProxyUsername("username")`, `socks5ProxyPassword("password")`
[![image](https://github.com/OrdinaryRoad-Project/ordinaryroad-live-chat-client/assets/43869694/8d62ffe3-7ce1-4c72-bbd8-b7b98f68e757)【极光HTTP代理】企业级代理IP云服务商48小时线下技术支持仅0.006元/IP- 无效IP不计费](https://www.jghttp.com/?invitation_code=8888956353)
## 3 项目说明
### 3.1 commons模块
主要是抽象接口、抽象类的定义
#### 3.1.1 commons-base
定义了一些基础的接口、抽象类:消息、消息监听器、连接连监听器
- 消息接口
- IMsg所有msg都应该实现该接口
- ICmdMsg有些平台的一些消息正文中没有消息类型cmd字段例如B站的心跳包因此再细分为cmdMsg
- IDanmuMsg: 内置获取用户ID、用户名、用户头像、粉丝牌名称、粉丝牌等级、弹幕内容等方法
- ISuperChatMsg醒目留言内置获取持续时间方法
- IGiftMsg: 内置获取发送方ID、发送方用户名、发送方头像、接收方ID、接收方用户名、礼物名称、礼物图片、礼物ID、礼物个数、礼物单价等方法
- IEnterRoomMsg: 内置获取用户ID、用户名、用户头像、粉丝牌名称、粉丝牌等级方法
- ILikeMsg: 内置获取用户ID、用户名、用户头像、粉丝牌名称、粉丝牌等级、点赞数方法
- ILiveStatusChangeMsg: 内置获取状态变化方法
- 消息监听器
- IBaseMsgListener所有平台都支持其他消息监听器存在平台差异
- onMsg所有消息不管消息内容都会调用不包括由该消息的某个字段派生出的消息例如快手的弹幕礼物等消息是`SC_FEED_PUSH`中的字段因此onMsg中不会出现处理后的弹幕、礼物消息而是包含弹幕、礼物等的`SCWebFeedPush`CMD消息
- onCmdMsgcmd消息消息体中有表示消息类型的字段时并且该类型需要处理例如心跳回复包不需要处理时调用
- onOtherCmdMsg该消息类型不需要处理例如PK、点赞数更新等类型时调用
- onUnknownCmd该消息类型未知没有对应的枚举类时调用
- IDanmuMsgListener所有平台
- onDanmuMsg收到弹幕消息
- IGiftMsgListener所有平台快手礼物消息不全缺少礼物单价、接收方信息
- onGiftMsg收到礼物消息抖音、快手平台需要判断礼物个数是否大于0
- ISuperChatMsgListenerB站
- onSuperChatMsg收到醒目留言
- IEnterRoomMsgListenerB站、斗鱼、抖音虎牙只能接收到高级用户的入房回调
- onEnterRoomMsg进入房间消息回调
- ILikeMsgListenerB站、快手、抖音支持获取点赞的个数
- onLikeMsg收到点赞消息
- ILiveStatusChangeListenerB站、抖音测试只有下播消息
- onLiveStatusMsg收到状态变化消息
- IRoomStatsMsgListenerB站抖音和快手没有累计观看人数信息
- onRoomStatsMsg收到信息统计消息
#### 3.1.2 commons-client
- 定义了Client的配置连接地址、房间id、Cookie、心跳、自动重连等相关参数
- 定义了Client的一些方法初始化、销毁、连接、断开、添加消息回调、移除消息回调、发送弹幕、为主播点赞等
- 定义了Client的生命周期
#### 3.1.3 commons-util
- 一些工具类时间、反射、Cookie
### 3.2 servers模块
对所使用的连接工具的抽象
#### 3.2.1 servers-netty
- 定义了连接处理Handler
- 定义了数据处理Handler
#### 3.2.2 servers-netty-client
基于`Netty`实现的Client
- 扩展了Client、ClientConfig
- 扩展Handler增加了Client成员变量
### 3.3 clients模块
对使用`Netty`作为连接工具的`servers-netty-client`的具体实现
- client-bilibili
- client-douyu
- client-huya
- client-douyin
- client-kuaishou
- client-websocket
### 3.4 codec模块
1. 解码decode根据平台协议对收到的二进制流进行解码
2. 编码encode根据平台协议将消息编码为二进制流
- codec-bilibili
- BilibiliCodecUtil
- BilibiliMsgFactory
- codec-douyu
- DouyuCodecUtil
- DouyuMsgFactory
- codec-huya
- HuyaCodecUtil
- HuyaMsgFactory
- codec-douyin
- codec-kuaishou
> 由于抖音和快手使用的都是Protobuf协议目前版本暂未实现CodecUtil工具类可以参考`DouyinCodecHandler`和`KuaishouCodecHandler`中的编解码实现
## 交流讨论
扫描二维码<img src="assets/QQ频道.jpg" width="200px">
或点击链接加入QQ频道【OrdinaryRoad】https://pd.qq.com/s/3id0n7fvs
## 捐赠
> 开源不易,您的认可与支持是我不断更新的最大动力!
>
> 扫码或者访问[https://dwz.tax/ucWb](https://dwz.tax/ucWb)进行捐赠
>
> <img src="assets/donate.png" width="200px">
| 日期 | 捐赠人 | 金额 | 留言 | 渠道 |
|------------|----:|------:|:-----|-----|
| 2024-03-06 | **睿 | 88.88 | 佬 加油 | ZFB |
| 2024-03-10 | **豪 | 88.8 | 大佬加油 | ZFB |
| 2024-03-25 | **波 | 188.8 | / | ZFB |
| 2024-04-02 | **豪 | 30 | / | ZFB |
| 2024-04-30 | *h | 100 | 大佬牛逼 | WX |
| ... | ... | ... | ... | ... |
## Star History
<a href="https://star-history.com/#OrdinaryRoad-Project/ordinaryroad-live-chat-client&Date">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=OrdinaryRoad-Project/ordinaryroad-live-chat-client&type=Date&theme=dark" />
<source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/svg?repos=OrdinaryRoad-Project/ordinaryroad-live-chat-client&type=Date" />
<img alt="Star History Chart" src="https://api.star-history.com/svg?repos=OrdinaryRoad-Project/ordinaryroad-live-chat-client&type=Date" />
</picture>
</a>
## 感谢
- [douyu-crawler-demo](https://github.com/cj1128/douyu-crawler-demo)(斗鱼登录状态的请求包构建)
- [Kain-90/huya-danmu](https://github.com/Kain-90/huya-danmu)
虎牙流程参考最新lib库[vplayerUI.js](https://a.msstatic.com/huya/h5player/room/2309271152/vplayerUI.js)、[taf-signal.global.0.0.4.prod.js](https://hd2.huya.com/fedbasic/huyabaselibs/taf-signal/taf-signal.global.0.0.4.prod.js)
- [saermart/DouyinLiveWebFetcher](https://github.com/saermart/DouyinLiveWebFetcher)(抖音流程参考)
- https://blog.ordinaryroad.tech/1/article/1743829866426630144 快手直播间WebSocket的Protobuf协议分析
## 免责声明
免责声明:仅供学术研究使用。对于违反相关法律、造成危害的滥用行为,开发者不负任何责任。
## 另附各个平台的开放平台地址
- B站开放平台https://openhome.bilibili.com
- 斗鱼开放平台https://open.douyu.com
- 虎牙开放平台https://open.huya.com
- 快手开放平台https://open.kuaishou.com
- 抖音开放平台https://open.douyin.com

Binary file not shown.

After

Width:  |  Height:  |  Size: 278 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 122 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 604 KiB

@ -0,0 +1,55 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>tech.ordinaryroad</groupId>
<artifactId>live-chat-client-codec</artifactId>
<version>0.7.0</version>
</parent>
<packaging>jar</packaging>
<artifactId>live-chat-client-codec-bilibili</artifactId>
<name>live-chat-client-codec-bilibili</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>tech.ordinaryroad</groupId>
<artifactId>live-chat-client-commons-base</artifactId>
</dependency>
<dependency>
<groupId>tech.ordinaryroad</groupId>
<artifactId>live-chat-client-commons-util</artifactId>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-codec</artifactId>
</dependency>
<dependency>
<groupId>com.aayushatharva.brotli4j</groupId>
<artifactId>brotli4j</artifactId>
</dependency>
<dependency>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java</artifactId>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>${junit-jupiter.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>

@ -0,0 +1,355 @@
/*
* MIT License
*
* Copyright (c) 2023 OrdinaryRoad
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package tech.ordinaryroad.live.chat.client.codec.bilibili.api;
import cn.hutool.cache.impl.TimedCache;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.thread.ThreadUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.http.HttpResponse;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonNode;
import lombok.*;
import lombok.extern.slf4j.Slf4j;
import tech.ordinaryroad.live.chat.client.codec.bilibili.api.request.BilibiliLikeReportV3Request;
import tech.ordinaryroad.live.chat.client.codec.bilibili.api.request.BilibiliSendMsgRequest;
import tech.ordinaryroad.live.chat.client.codec.bilibili.constant.BilibiliLiveStatusEnum;
import tech.ordinaryroad.live.chat.client.commons.base.exception.BaseException;
import tech.ordinaryroad.live.chat.client.commons.util.OrJacksonUtil;
import tech.ordinaryroad.live.chat.client.commons.util.OrLiveChatCookieUtil;
import tech.ordinaryroad.live.chat.client.commons.util.OrLiveChatHttpUtil;
import java.time.ZoneId;
import java.time.ZonedDateTime;
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;
/**
* BAPI
*
* @author mjz
* @date 2023/5/5
*/
@Slf4j
public class BilibiliApis {
public static final TimedCache<Long, String> GIFT_IMG_CACHE = new TimedCache<>(TimeUnit.DAYS.toMillis(1));
public static final String KEY_COOKIE_CSRF = "bili_jct";
public static final String KEY_UID = "DedeUserID";
public static final String PATTERN_REAL_ROOM_ID = "\\\"roomInitRes\\\".+\\{\\\"room_id\\\":(\\d+)";
private static final String API_FRONTEND_FINGER_SPI = "https://api.bilibili.com/x/frontend/finger/spi";
private static final String API_V = "https://data.bilibili.com/v/";
private static final String API_WEB_INTERFACE_NAV = "https://api.bilibili.com/x/web-interface/nav";
private static final String API_DANMU_INFO = "https://api.live.bilibili.com/xlive/web-room/v1/index/getDanmuInfo";
private static final String API_ROOM_PLAY_INFO = "https://api.live.bilibili.com/xlive/web-room/v2/index/getRoomPlayInfo";
@SneakyThrows
public static RoomInitResult roomInit(long roomId, String cookie) {
RoomPlayInfoResult roomPlayInfo = getRoomPlayInfo(roomId, cookie);
long realRoomId = roomPlayInfo.room_id;
// frontendFingerSpi();
String b_3 = OrLiveChatCookieUtil.getCookieByName(cookie, "buvid3", BilibiliApis::v);
// webInterfaceNav(cookie);
DanmuinfoResult danmuInfo = getDanmuInfo(realRoomId, cookie);
return new RoomInitResult.RoomInitResultBuilder()
.buvid3(b_3)
.uid(OrLiveChatCookieUtil.getCookieByName(cookie, "DedeUserID", () -> "0"))
.danmuinfoResult(danmuInfo)
.roomPlayInfoResult(roomPlayInfo)
.build();
}
public static JsonNode roomGiftConfig(long roomId, String cookie) {
@Cleanup
HttpResponse response = OrLiveChatHttpUtil.createGet("https://api.live.bilibili.com/xlive/web-room/v1/giftPanel/roomGiftConfig?platform=pc&source=live&build=0&global_version=0&room_id=" + roomId)
.cookie(cookie)
.execute();
return responseInterceptor(response.body());
}
/**
* {
* "code": 0,
* "data": {
* "b_3": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxBAC9C3C049561infoc",
* "b_4": "xxxxxxx-xxxx-xxxx-xxxx-xxxx0EE06EC549561-xxxx32009-xxxxgQAMrcCGKkaytpzZwg=="
* },
* "message": "ok"
* }
*/
@SneakyThrows
public static JsonNode frontendFingerSpi() {
@Cleanup
HttpResponse response = OrLiveChatHttpUtil.createGet(API_FRONTEND_FINGER_SPI).execute();
return responseInterceptor(response.body());
}
/**
* buvid3
*/
@SneakyThrows
public static String v() {
@Cleanup
HttpResponse response = OrLiveChatHttpUtil.createGet(API_V).execute();
return response.getCookieValue("buvid3");
}
@SneakyThrows
public static void webInterfaceNav(String cookie) {
@Cleanup
HttpResponse response = OrLiveChatHttpUtil.createGet(API_WEB_INTERFACE_NAV)
.cookie(cookie)
.execute();
}
/**
* @param roomId
* @param type 0
* @return <pre>{@code
* {
* "group": "live",
* "business_id": 0,
* "refresh_row_factor": 0.125,
* "refresh_rate": 100,
* "max_delay": 5000,
* "token": "-wm5-Qo4BBAztd1qp5ZJpgyTMRBhCc7yikz5d9rAd63PV46G9BMwl0R10kMM8Ilb-UieZGjLtipPrz4Cvi0DdhGFwOi8PJpFN9K-LoXh6Z_4yjEIwgRerDiMIstHzJ80J3B7wnRisAYkWA==",
* "host_list": [{
* "host": "ali-bj-live-comet-09.chat.bilibili.com",
* "port": 2243,
* "wss_port": 443,
* "ws_port": 2244
* }, {
* "host": "ali-gz-live-comet-02.chat.bilibili.com",
* "port": 2243,
* "wss_port": 443,
* "ws_port": 2244
* }, {
* "host": "broadcastlv.chat.bilibili.com",
* "port": 2243,
* "wss_port": 443,
* "ws_port": 2244
* }]
* }
* }</pre>
*/
@SneakyThrows
public static DanmuinfoResult getDanmuInfo(long roomId, int type, String cookie) {
@Cleanup
HttpResponse response = OrLiveChatHttpUtil.createGet(API_DANMU_INFO + "?id=" + roomId + "&type=" + type)
.cookie(cookie)
.execute();
return OrJacksonUtil.getInstance().readValue(responseInterceptor(response.body()).toString(), DanmuinfoResult.class);
}
@SneakyThrows
public static DanmuinfoResult getDanmuInfo(long roomId, String cookie) {
return getDanmuInfo(roomId, 0, cookie);
}
@SneakyThrows
public static RoomPlayInfoResult getRoomPlayInfo(long roomId, int no_playurl, String cookie) {
@Cleanup
HttpResponse response = OrLiveChatHttpUtil.createGet(API_ROOM_PLAY_INFO + "?room_id=" + roomId + "&no_playurl=" + no_playurl + "&mask=1&qn=0&platform=web&protocol=0,1&format=0,1,2&codec=0,1,2&dolby=5&panorama=1")
.cookie(cookie)
.execute();
return OrJacksonUtil.getInstance().readValue(responseInterceptor(response.body()).toString(), RoomPlayInfoResult.class);
}
@SneakyThrows
public static RoomPlayInfoResult getRoomPlayInfo(long roomId, String cookie) {
return getRoomPlayInfo(roomId, 1, cookie);
}
public static String getGiftImgById(long giftId, long roomId) {
if (!GIFT_IMG_CACHE.containsKey(giftId)) {
ThreadUtil.execAsync(() -> {
updateGiftImgCache(roomId, null);
});
}
return GIFT_IMG_CACHE.get(giftId);
}
/**
*
*/
public static void updateGiftImgCache(long roomId, String cookie) {
JsonNode jsonNode = roomGiftConfig(roomId, cookie);
for (JsonNode node : jsonNode.get("global_gift").get("list")) {
long giftId = node.get("id").asLong();
String giftImgUrl = node.get("webp").asText();
GIFT_IMG_CACHE.put(giftId, giftImgUrl);
}
}
/**
*
*
* @param request {@link BilibiliSendMsgRequest}
* @param cookie Cookie
*/
public static void sendMsg(BilibiliSendMsgRequest request, String cookie) {
if (StrUtil.isBlank(cookie)) {
throw new BaseException("发送弹幕接口cookie不能为空");
}
Map<String, Object> stringObjectMap = BeanUtil.beanToMap(request);
@Cleanup HttpResponse execute = OrLiveChatHttpUtil.createPost("https://api.live.bilibili.com/msg/send")
.cookie(cookie)
.form(stringObjectMap)
.execute();
responseInterceptor(execute.body());
}
/**
*
*
* @param msg
* @param realRoomId id
* @param cookie Cookie
*/
public static void sendMsg(String msg, long realRoomId, String cookie) {
String biliJct = OrLiveChatCookieUtil.getCookieByName(cookie, KEY_COOKIE_CSRF, () -> {
throw new BaseException("cookie中缺少参数" + KEY_COOKIE_CSRF);
});
BilibiliSendMsgRequest request = new BilibiliSendMsgRequest(msg, StrUtil.toString(ZonedDateTime.now(ZoneId.of("Asia/Shanghai")).toEpochSecond()), realRoomId, biliJct, biliJct);
sendMsg(request, cookie);
}
/**
*
*
* @param request {@link BilibiliLikeReportV3Request}
* @param cookie Cookie
*/
public static void likeReportV3(BilibiliLikeReportV3Request request, String cookie) {
if (StrUtil.isBlank(cookie)) {
throw new BaseException("为主播点赞接口cookie不能为空");
}
Map<String, Object> stringObjectMap = BeanUtil.beanToMap(request);
@Cleanup HttpResponse execute = OrLiveChatHttpUtil.createPost("https://api.live.bilibili.com/xlive/app-ucenter/v1/like_info_v3/like/likeReportV3")
.cookie(cookie)
.form(stringObjectMap)
.execute();
responseInterceptor(execute.body());
}
/**
*
*
* @param anchor_id Uid {@link RoomPlayInfoResult#uid}
* @param realRoomId Id {@link RoomPlayInfoResult#room_id}
* @param cookie Cookie
*/
public static void likeReportV3(long anchor_id, long realRoomId, String cookie) {
String uid = OrLiveChatCookieUtil.getCookieByName(cookie, KEY_UID, () -> {
throw new BaseException("cookie中缺少参数" + KEY_UID);
});
String biliJct = OrLiveChatCookieUtil.getCookieByName(cookie, KEY_COOKIE_CSRF, () -> {
throw new BaseException("cookie中缺少参数" + KEY_COOKIE_CSRF);
});
BilibiliLikeReportV3Request request = new BilibiliLikeReportV3Request(realRoomId, uid, anchor_id, biliJct, biliJct);
likeReportV3(request, cookie);
}
private static JsonNode responseInterceptor(String responseString) {
try {
JsonNode jsonNode = OrJacksonUtil.getInstance().readTree(responseString);
int code = jsonNode.get("code").asInt();
if (code == 0) {
// 成功
return jsonNode.get("data");
} else {
throw new BaseException(jsonNode.get("message").asText());
}
} catch (JsonProcessingException e) {
throw new BaseException(e);
}
}
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public static class DanmuinfoResult {
private String group;
private int business_id;
private double refresh_row_factor;
private int refresh_rate;
private int max_delay;
private String token;
private List<Host_list> host_list;
}
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public static class Host_list {
private String host;
private int port;
private int wss_port;
private int ws_port;
}
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public static class RoomPlayInfoResult {
private long room_id;
private int short_id;
private long uid;
private boolean is_hidden;
private boolean is_locked;
private boolean is_portrait;
private BilibiliLiveStatusEnum live_status;
private int hidden_till;
private int lock_till;
private boolean encrypted;
private boolean pwd_verified;
private long live_time;
private int room_shield;
private List<Integer> all_special_types;
private JsonNode playurl_info;
private int official_type;
private int official_room_id;
private int risk_with_delay;
}
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public static class RoomInitResult {
private String buvid3;
private String uid;
private DanmuinfoResult danmuinfoResult = new DanmuinfoResult();
private RoomPlayInfoResult roomPlayInfoResult = new RoomPlayInfoResult();
}
}

@ -0,0 +1,74 @@
/*
* MIT License
*
* Copyright (c) 2023 OrdinaryRoad
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package tech.ordinaryroad.live.chat.client.codec.bilibili.api.request;
import cn.hutool.core.util.StrUtil;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @author mjz
* @date 2024/1/31
*/
@Data
@NoArgsConstructor
public class BilibiliLikeReportV3Request {
/**
*
*/
private int click_time = 1;
/**
* ID
*/
private long room_id;
/**
* CookieDedeUserID
*/
private String uid;
/**
* RoomInitResultuid
*/
private long anchor_id;
/**
* Cookiebili_jct
*/
private String csrf;
/**
* Cookiebili_jct
*/
private String csrf_token;
/**
*
*/
private String visit_id = StrUtil.EMPTY;
public BilibiliLikeReportV3Request(long room_id, String uid, long anchor_id, String csrf, String csrf_token) {
this.room_id = room_id;
this.uid = uid;
this.anchor_id = anchor_id;
this.csrf = csrf;
this.csrf_token = csrf_token;
}
}

@ -0,0 +1,77 @@
/*
* MIT License
*
* Copyright (c) 2023 OrdinaryRoad
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package tech.ordinaryroad.live.chat.client.codec.bilibili.api.request;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @author mjz
* @date 2023/9/7
*/
@Data
@NoArgsConstructor
public class BilibiliSendMsgRequest {
private String bubble = "0";
/**
*
*/
private String msg;
/**
*
*/
private String color = "16777215";
private String mode = "1";
private String room_type = "0";
private String jumpfrom = "0";
/**
*
*/
private String fontsize = "25";
/**
*
*/
private String rnd;
/**
* ID
*/
private long roomid;
/**
* Cookiebili_jct
*/
private String csrf;
/**
* Cookiebili_jct
*/
private String csrf_token;
public BilibiliSendMsgRequest(String msg, String rnd, long roomid, String csrf, String csrf_token) {
this.msg = msg;
this.rnd = rnd;
this.roomid = roomid;
this.csrf = csrf;
this.csrf_token = csrf_token;
}
}

@ -0,0 +1,297 @@
/*
* MIT License
*
* Copyright (c) 2023 OrdinaryRoad
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package tech.ordinaryroad.live.chat.client.codec.bilibili.constant;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
/**
* @author mjz
* @date 2023/1/6
*/
@Getter
@RequiredArgsConstructor
public enum BilibiliCmdEnum {
// region 最新CMD
BIG_R_WELCOME,
CHANGE_ROOM_INFO,
/**
*
*/
COMBO_SEND,
CUT_OFF,
DANMU_GIFT_LOTTERY_START,
DANMU_GIFT_LOTTERY_END,
DANMU_GIFT_LOTTERY_AWARD,
WARNING,
/**
*
*/
DANMU_MSG,
/**
* 5id
*/
LOG_IN_NOTICE,
USER_TOAST_MSG,
GUARD_ACHIEVEMENT_ROOM,
/**
*
*/
LIVE,
REENTER_LIVE_ROOM,
MESSAGEBOX_USER_GAIN_MEDAL,
MESSAGEBOX_USER_MEDAL_CHANGE,
MESSAGEBOX_USER_MEDAL_COMPENSATION,
LITTLE_TIPS,
LITTLE_MESSAGE_BOX,
NOTICE_MSG,
PK_MATCH,
PK_PRE,
PK_START,
PK_PROCESS,
PK_END,
PK_SETTLE,
PK_AGAIN,
PK_MIC_END,
PK_BATTLE_PRE_NEW,
PK_BATTLE_START_NEW,
PK_BATTLE_PROCESS_NEW,
PK_BATTLE_FINAL_PROCESS,
PK_BATTLE_PRO_TYPE,
PK_BATTLE_GIFT,
PK_BATTLE_SPECIAL_GIFT,
PK_BATTLE_CRIT,
PK_BATTLE_VOTES_ADD,
PK_BATTLE_END,
PK_BATTLE_SETTLE_NEW,
PK_BATTLE_PUNISH_END,
PK_BATTLE_VIDEO_PUNISH_BEGIN,
PK_BATTLE_VIDEO_PUNISH_END,
PK_BATTLE_RANK_CHANGE,
PK_BATTLE_ABNORMAL,
PK_BATTLE_MULTIPLE_BEGIN,
PK_BATTLE_MULTIPLE_RES,
PK_BATTLE_MULTIPLE_DRAW_RES,
PK_BATTLE_MULTIPLE_AWARD,
/**
*
*/
PREPARING,
ROOM_REFRESH,
ROOM_SKIN_MSG,
TV_START,
RAFFLE_START,
TV_END,
RAFFLE_END,
PK_LOTTERY_START,
GUARD_LOTTERY_START,
ROOM_BLOCK_INTO,
ROOM_BLOCK_MSG,
ROOM_KICKOUT,
ROOM_LOCK,
ROOM_LIMIT,
ROOM_SILENT_ON,
ROOM_SILENT_OFF,
/**
*
*/
SEND_GIFT,
SEND_GIFT_V2,
SEND_TOP,
SPECIAL_GIFT,
GIFT_PANEL_PLAN,
INTERACT_WORD,
/**
* (?)
*/
ENTRY_EFFECT,
ENTRY_EFFECT_MUST_RECEIVE,
BOX_ACTIVITY_START,
WIN_ACTIVITY,
WIN_ACTIVITY_USER,
ROOM_RANK,
HOUR_RANK_AWARDS,
LOL_ACTIVITY,
ROOM_REAL_TIME_MESSAGE_UPDATE,
VOICE_JOIN_STATUS,
ROOM_CHANGE,
/**
*
*/
SUPER_CHAT_MESSAGE,
/**
*
*/
SUPER_CHAT_MESSAGE_DELETE,
SUPER_CHAT_ENTRANCE,
SUPER_CHAT_AUDIT,
ANCHOR_LOT_CHECKSTATUS,
ANCHOR_LOT_START,
ANCHOR_LOT_END,
ANCHOR_LOT_AWARD,
ANCHOR_LOTTERY_ACTIVITY,
CHASE_FRAME_SWITCH,
WATCH_LPL_EXPIRED,
VIDEO_CONNECTION_JOIN_START,
VIDEO_CONNECTION_JOIN_END,
VIDEO_CONNECTION_MSG,
ROOM_BANNER,
WIDGET_BANNER,
ONLINE_RANK_V2,
ONLINE_RANK_TOP3,
HOT_RANK_CHANGED_V2,
HOT_RANK_SETTLEMENT_V2,
POPULAR_RANK_CHANGED,
AREA_RANK_CHANGED,
VTR_GIFT_LOTTERY,
COMMON_NOTICE_DANMAKU,
RED_POCKET_START,
FULL_SCREEN_SPECIAL_EFFECT,
POPULARITY_RED_POCKET_V2_START,
POPULARITY_RED_POCKET_V2_WINNER_LIST,
POPULARITY_RED_POCKET_V2_NEW,
USER_PANEL_RED_ALARM,
SHOPPING_CART_SHOW,
Revenue_PayLimit,
THERMAL_STORM_DANMU_BEGIN,
THERMAL_STORM_DANMU_UPDATE,
THERMAL_STORM_DANMU_CANCEL,
THERMAL_STORM_DANMU_OVER,
MILESTONE_UPDATE_EVENT,
WEB_REPORT_CONTROL,
RANK_REM,
LIVE_PLAYER_LOG_RECYCLE,
LIVE_INTERNAL_ROOM_LOGIN,
LIVE_OPEN_PLATFORM_GAME,
/**
*
*/
WATCHED_CHANGE,
USER_TITLE_GET,
GUARD_BENEFIT_RECEIVE,
GUARD_HONOR_THOUSAND,
PLAY_TOGETHER,
LIVE_OPEN_PLATFORM_CLOUD_GAME,
DANMU_AGGREGATION,
GIFT_STAR_PROCESS,
WIDGET_GIFT_STAR_PROCESS,
WIDGET_WISH_LIST,
COLLECTION_PRAISE_STATUS,
COLLECTION_PRAISE_UPDATE_PROCESS,
USER_VIRTUAL_MVP,
ROOM_SWITCH_INFO_CONFIG_CHANGE,
LIKE_SO_HOT,
/**
*
*/
LIKE_INFO_V3_UPDATE,
/**
*
*/
LIKE_INFO_V3_CLICK,
LIKE_GUIDE_USER,
STARLIVE_PK_MSG,
MULTI_VOICE_STATUS_SYNC,
LIVE_PANEL_ICON_INFO,
PLAYTOGETHER_SERVICE_CARD_CHANGE,
OFFICIAL_ROOM_EVENT,
MULTI_VOICE_PK_STATUS,
MULTI_VOICE_OPERATIN,
VOICE_CHAT_UPDATE,
MULTI_VOICE_PK_HAT_STATUS,
MULTI_VOICE_OWNER_LEAVE,
MULTI_VOICE_SEND_EMOJI,
WEALTH_NOTIFY,
REDIRECT_EMPTY_PAGE,
INTERACT_JOIN,
INTERACT_OPERATION,
MULTI_VOICE_APPLICATION,
INTERACT_LEAVE,
LPL_REALTIME_STATUS_CHANGED,
SUPER_VIP_CONNECT_DIG,
DM_INTERACTION,
POPULAR_RANK_GUIDE_CARD,
MULTI_CONN_BEHAVIOR,
LIVE_INTERACT_GAME_STATE_CHANGE,
GUARD_LEADER_NOTICE,
PK_INFO,
UNIVERSAL_EVENT_GIFT,
SYS_MSG,
SYS_GIFT,
GUARD_MSG,
END,
CLOSE,
BLOCK,
ROUND,
WELCOME,
REFRESH,
ACTIVITY_RED_PACKET,
HOT_ROOM_NOTIFY,
PLAY_TAG,
PLAY_PROGRESS_BAR,
// endregion
// region 旧版CMD可能已经无效
/**
*
*/
GUARD_BUY,
/**
*
*/
WELCOME_GUARD,
HOT_RANK_CHANGED,
LIVE_INTERACTIVE_GAME,
/**
*
*/
ONLINE_RANK_COUNT,
PK_BATTLE_PROCESS,
PK_BATTLE_SETTLE,
PK_BATTLE_SETTLE_USER,
PK_BATTLE_SETTLE_V2,
/**
* ID
*/
STOP_LIVE_ROOM_LIST,
SUPER_CHAT_MESSAGE_JPN,
LIVE_MULTI_VIEW_CHANGE,
RECOMMEND_CARD,
PK_BATTLE_ENTRANCE,
PK_BATTLE_START,
PK_BATTLE_PRE,
// endregion
;
public static BilibiliCmdEnum getByString(String cmd) {
try {
return BilibiliCmdEnum.valueOf(cmd);
} catch (Exception e) {
return null;
}
}
}

@ -0,0 +1,66 @@
/*
* MIT License
*
* Copyright (c) 2023 OrdinaryRoad
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package tech.ordinaryroad.live.chat.client.codec.bilibili.constant;
import com.fasterxml.jackson.annotation.JsonValue;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
/**
* @author mjz
* @date 2024/3/11
*/
@Getter
@RequiredArgsConstructor
public enum BilibiliLiveStatusEnum {
/**
*
*/
STOPPED(0),
/**
*
*/
LIVING(1),
/**
* 稿
*/
CAROUSEL(2),
;
@JsonValue
private final int code;
public static BilibiliLiveStatusEnum getByCode(int code) {
for (BilibiliLiveStatusEnum value : values()) {
if (value.getCode() == code) {
return value;
}
}
return null;
}
}

@ -0,0 +1,89 @@
/*
* MIT License
*
* Copyright (c) 2023 OrdinaryRoad
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package tech.ordinaryroad.live.chat.client.codec.bilibili.constant;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
/**
* @author mjz
* @date 2023/1/5
*/
@Getter
@RequiredArgsConstructor
public enum OperationEnum {
/**
*
*/
HEARTBEAT(2),
/**
*
*/
HEARTBEAT_REPLY(3),
/**
*
*/
MESSAGE(5),
/**
*
*/
USER_AUTHENTICATION(7),
/**
*
*/
CONNECT_SUCCESS(8),
HANDSHAKE(0),
HANDSHAKE_REPLY(1),
SEND_MSG(4),
DISCONNECT_REPLY(6),
RAW(9),
PROTO_READY(10),
PROTO_FINISH(11),
CHANGE_ROOM(12),
CHANGE_ROOM_REPLY(13),
REGISTER(14),
REGISTER_REPLY(15),
UNREGISTER(16),
UNREGISTER_REPLY(17),
;
private final int code;
public static OperationEnum getByCode(int code) {
for (OperationEnum value : OperationEnum.values()) {
if (value.code == code) {
return value;
}
}
return null;
}
}

@ -0,0 +1,67 @@
/*
* MIT License
*
* Copyright (c) 2023 OrdinaryRoad
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package tech.ordinaryroad.live.chat.client.codec.bilibili.constant;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
/**
* @author mjz
* @date 2023/1/5
*/
@Getter
@RequiredArgsConstructor
public enum ProtoverEnum {
/**
* 使
*/
NORMAL_NO_COMPRESSION(0),
/**
* 使
*/
HEARTBEAT_AUTH_NO_COMPRESSION(1),
/**
* 使zlib
*/
NORMAL_ZLIB(2),
/**
* 使brotli,0
*/
NORMAL_BROTLI(3),
;
private final int code;
public static ProtoverEnum getByCode(int code) {
for (ProtoverEnum value : ProtoverEnum.values()) {
if (value.code == code) {
return value;
}
}
return null;
}
}

@ -0,0 +1,86 @@
/*
* MIT License
*
* Copyright (c) 2023 OrdinaryRoad
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package tech.ordinaryroad.live.chat.client.codec.bilibili.msg;
import cn.hutool.core.lang.Pair;
import cn.hutool.core.util.NumberUtil;
import cn.hutool.core.util.StrUtil;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.node.ArrayNode;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import tech.ordinaryroad.live.chat.client.codec.bilibili.constant.OperationEnum;
import tech.ordinaryroad.live.chat.client.codec.bilibili.msg.base.BaseBilibiliCmdMsg;
import tech.ordinaryroad.live.chat.client.commons.base.constant.LiveStatusAction;
import tech.ordinaryroad.live.chat.client.commons.base.msg.ILiveStatusChangeMsg;
/**
* @author mjz
* @date 2024/3/11
*/
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class BilibiliLiveStatusChangeMsg extends BaseBilibiliCmdMsg implements ILiveStatusChangeMsg {
/**
*
*/
private Pair<Object, Object> roomIdPair;
private JsonNode data;
@Override
public OperationEnum getOperationEnum() {
return OperationEnum.MESSAGE;
}
@Override
public LiveStatusAction getLiveStatusAction() {
switch (getCmdEnum()) {
case LIVE: {
return LiveStatusAction.BEGIN;
}
case STOP_LIVE_ROOM_LIST: {
Object roomId = roomIdPair.getKey();
Object shortRoomId = roomIdPair.getValue();
if (data == null || !data.has("room_id_list")) {
return null;
}
ArrayNode roomIdList = data.withArray("room_id_list");
for (JsonNode jsonNode : roomIdList) {
long aLong = jsonNode.asLong();
if (aLong == NumberUtil.parseLong(StrUtil.toStringOrNull(roomId)) || aLong == NumberUtil.parseLong(StrUtil.toStringOrNull(shortRoomId))) {
return LiveStatusAction.END;
}
}
}
}
return null;
}
}

@ -0,0 +1,85 @@
/*
* MIT License
*
* Copyright (c) 2023 OrdinaryRoad
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package tech.ordinaryroad.live.chat.client.codec.bilibili.msg;
import com.fasterxml.jackson.databind.JsonNode;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import tech.ordinaryroad.live.chat.client.codec.bilibili.constant.BilibiliCmdEnum;
import tech.ordinaryroad.live.chat.client.codec.bilibili.constant.OperationEnum;
import tech.ordinaryroad.live.chat.client.codec.bilibili.msg.base.BaseBilibiliCmdMsg;
import tech.ordinaryroad.live.chat.client.commons.base.msg.IRoomStatsMsg;
/**
* BilibiliRoomStatsMsg
*
* @author mjz
* @date 2024/4/24
*/
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class BilibiliRoomStatsMsg extends BaseBilibiliCmdMsg implements IRoomStatsMsg {
private JsonNode data;
@Override
public String getWatchingCount() {
if (getCmdEnum() == BilibiliCmdEnum.ONLINE_RANK_COUNT) {
if (data != null && data.has("online_count")) {
return data.get("online_count").asText();
}
}
return null;
}
@Override
public String getWatchedCount() {
if (getCmdEnum() == BilibiliCmdEnum.WATCHED_CHANGE) {
if (data != null && data.has("num")) {
return data.get("num").asText();
}
}
return null;
}
@Override
public String getLikedCount() {
if (getCmdEnum() == BilibiliCmdEnum.LIKE_INFO_V3_UPDATE) {
if (data != null && data.has("click_count")) {
return data.get("click_count").asText();
}
}
return null;
}
@Override
public OperationEnum getOperationEnum() {
return OperationEnum.MESSAGE;
}
}

@ -0,0 +1,63 @@
/*
* MIT License
*
* Copyright (c) 2023 OrdinaryRoad
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package tech.ordinaryroad.live.chat.client.codec.bilibili.msg;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import tech.ordinaryroad.live.chat.client.codec.bilibili.constant.OperationEnum;
import tech.ordinaryroad.live.chat.client.codec.bilibili.constant.ProtoverEnum;
import tech.ordinaryroad.live.chat.client.codec.bilibili.msg.base.BaseBilibiliMsg;
/**
* @author mjz
* @date 2023/1/6
*/
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class ConnectSuccessMsg extends BaseBilibiliMsg {
/**
* 0: OK,-101: TOKEN_ERROR
*/
private int code;
@JsonIgnore
private int protover;
@Override
public ProtoverEnum getProtoverEnum() {
return ProtoverEnum.getByCode(protover);
}
@Override
public OperationEnum getOperationEnum() {
return OperationEnum.CONNECT_SUCCESS;
}
}

@ -0,0 +1,108 @@
/*
* MIT License
*
* Copyright (c) 2023 OrdinaryRoad
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package tech.ordinaryroad.live.chat.client.codec.bilibili.msg;
import cn.hutool.core.codec.Base64;
import cn.hutool.core.util.StrUtil;
import com.fasterxml.jackson.databind.JsonNode;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import tech.ordinaryroad.live.chat.client.codec.bilibili.constant.OperationEnum;
import tech.ordinaryroad.live.chat.client.codec.bilibili.msg.base.BaseBilibiliMsg;
import tech.ordinaryroad.live.chat.client.codec.bilibili.protobuf.DmV2;
import tech.ordinaryroad.live.chat.client.commons.base.msg.IDanmuMsg;
/**
* @author mjz
* @date 2023/9/8
*/
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class DanmuMsgMsg extends BaseBilibiliMsg implements IDanmuMsg {
private JsonNode info;
private String dm_v2;
@Override
public OperationEnum getOperationEnum() {
return OperationEnum.MESSAGE;
}
@Override
public String getBadgeName() {
JsonNode jsonNode3 = info.get(3);
if (jsonNode3.isEmpty()) {
return "";
}
return jsonNode3.get(1).asText();
}
@Override
public byte getBadgeLevel() {
JsonNode jsonNode3 = info.get(3);
if (jsonNode3.isEmpty()) {
return 0;
}
return (byte) jsonNode3.get(0).asInt();
}
@Override
public String getUid() {
JsonNode jsonNode2 = info.get(2);
return jsonNode2.get(0).asText();
}
@Override
public String getUsername() {
JsonNode jsonNode2 = info.get(2);
return jsonNode2.get(1).asText();
}
@Override
public String getUserAvatar() {
String avatar = null;
try {
DmV2.dm_v2 dmV2 = DmV2.dm_v2.parseFrom(Base64.decode(dm_v2));
avatar = dmV2.getDmV220().getAvatar();
if (StrUtil.isBlank(avatar)) {
avatar = info.get(0).get(15).get("user").get("base").get("face").asText();
}
} catch (Exception e) {
// ignore
}
return avatar;
}
@Override
public String getContent() {
JsonNode jsonNode1 = info.get(1);
return jsonNode1.asText();
}
}

@ -0,0 +1,58 @@
/*
* MIT License
*
* Copyright (c) 2023 OrdinaryRoad
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package tech.ordinaryroad.live.chat.client.codec.bilibili.msg;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import tech.ordinaryroad.live.chat.client.codec.bilibili.constant.OperationEnum;
import tech.ordinaryroad.live.chat.client.codec.bilibili.constant.ProtoverEnum;
import tech.ordinaryroad.live.chat.client.codec.bilibili.msg.base.BaseBilibiliMsg;
/**
* @author mjz
* @date 2023/1/6
*/
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class HeartbeatMsg extends BaseBilibiliMsg {
@JsonIgnore
private int protover;
@Override
public ProtoverEnum getProtoverEnum() {
return ProtoverEnum.getByCode(protover);
}
@Override
public OperationEnum getOperationEnum() {
return OperationEnum.HEARTBEAT;
}
}

@ -0,0 +1,60 @@
/*
* MIT License
*
* Copyright (c) 2023 OrdinaryRoad
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package tech.ordinaryroad.live.chat.client.codec.bilibili.msg;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import tech.ordinaryroad.live.chat.client.codec.bilibili.constant.OperationEnum;
import tech.ordinaryroad.live.chat.client.codec.bilibili.constant.ProtoverEnum;
import tech.ordinaryroad.live.chat.client.codec.bilibili.msg.base.BaseBilibiliMsg;
/**
* @author mjz
* @date 2023/1/6
*/
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class HeartbeatReplyMsg extends BaseBilibiliMsg {
private int popularity;
@JsonIgnore
private int protover;
@Override
public ProtoverEnum getProtoverEnum() {
return ProtoverEnum.getByCode(protover);
}
@Override
public OperationEnum getOperationEnum() {
return OperationEnum.HEARTBEAT_REPLY;
}
}

@ -0,0 +1,396 @@
/*
* MIT License
*
* Copyright (c) 2023 OrdinaryRoad
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package tech.ordinaryroad.live.chat.client.codec.bilibili.msg;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.databind.JsonNode;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import tech.ordinaryroad.live.chat.client.codec.bilibili.constant.OperationEnum;
import tech.ordinaryroad.live.chat.client.codec.bilibili.msg.base.BaseBilibiliMsg;
import tech.ordinaryroad.live.chat.client.commons.base.msg.IEnterRoomMsg;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @author mjz
* @date 2023/12/26
*/
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class InteractWordMsg extends BaseBilibiliMsg implements IEnterRoomMsg {
private Data data;
@Override
public OperationEnum getOperationEnum() {
return OperationEnum.MESSAGE;
}
@Override
public String getBadgeName() {
if (data == null || data.fans_medal == null) {
return null;
}
return data.fans_medal.medal_name;
}
@Override
public byte getBadgeLevel() {
if (data == null || data.fans_medal == null) {
return 0;
}
return data.fans_medal.medal_level;
}
@Override
public String getUid() {
if (data == null) {
return null;
}
return Long.toString(data.uid);
}
@Override
public String getUsername() {
if (data == null) {
return null;
}
return data.uname;
}
@Override
public String getUserAvatar() {
if (data == null || data.uinfo == null || data.uinfo.base == null) {
return null;
}
return data.uinfo.base.face;
}
@lombok.Data
public static class Data {
private Contribution contribution;
private Contribution_v2 contribution_v2;
private int core_user_type;
private int dmscore;
private Fans_medal fans_medal;
private String group_medal;
private List<Integer> identities;
private boolean is_mystery;
private int is_spread;
private int msg_type;
private int privilege_type;
private long roomid;
private long score;
private String spread_desc;
private String spread_info;
private int tail_icon;
private String tail_text;
private long timestamp;
private long trigger_time;
private long uid;
private Uinfo uinfo;
private String uname;
private String uname_color;
/**
*
*/
private final Map<String, JsonNode> unknownProperties = new HashMap<>();
@JsonAnyGetter
public Map<String, JsonNode> getUnknownProperties() {
return unknownProperties;
}
@JsonAnySetter
public void setOther(String key, JsonNode value) {
this.unknownProperties.put(key, value);
}
}
@lombok.Data
public static class Contribution {
private int grade;
/**
*
*/
private final Map<String, JsonNode> unknownProperties = new HashMap<>();
@JsonAnyGetter
public Map<String, JsonNode> getUnknownProperties() {
return unknownProperties;
}
@JsonAnySetter
public void setOther(String key, JsonNode value) {
this.unknownProperties.put(key, value);
}
}
@lombok.Data
public static class Contribution_v2 {
private int grade;
private String rank_type;
private String text;
/**
*
*/
private final Map<String, JsonNode> unknownProperties = new HashMap<>();
@JsonAnyGetter
public Map<String, JsonNode> getUnknownProperties() {
return unknownProperties;
}
@JsonAnySetter
public void setOther(String key, JsonNode value) {
this.unknownProperties.put(key, value);
}
}
@lombok.Data
public static class Fans_medal {
private long anchor_roomid;
private int guard_level;
private int icon_id;
private int is_lighted;
private long medal_color;
private long medal_color_border;
private long medal_color_end;
private long medal_color_start;
private byte medal_level;
private String medal_name;
private long score;
private String special;
private long target_id;
/**
*
*/
private final Map<String, JsonNode> unknownProperties = new HashMap<>();
@JsonAnyGetter
public Map<String, JsonNode> getUnknownProperties() {
return unknownProperties;
}
@JsonAnySetter
public void setOther(String key, JsonNode value) {
this.unknownProperties.put(key, value);
}
}
@lombok.Data
public static class Origin_info {
private String face;
private String name;
/**
*
*/
private final Map<String, JsonNode> unknownProperties = new HashMap<>();
@JsonAnyGetter
public Map<String, JsonNode> getUnknownProperties() {
return unknownProperties;
}
@JsonAnySetter
public void setOther(String key, JsonNode value) {
this.unknownProperties.put(key, value);
}
}
@lombok.Data
public static class Risk_ctrl_info {
private String face;
private String name;
/**
*
*/
private final Map<String, JsonNode> unknownProperties = new HashMap<>();
@JsonAnyGetter
public Map<String, JsonNode> getUnknownProperties() {
return unknownProperties;
}
@JsonAnySetter
public void setOther(String key, JsonNode value) {
this.unknownProperties.put(key, value);
}
}
@lombok.Data
public static class Official_info {
private int role;
private String title;
private String desc;
private int type;
/**
*
*/
private final Map<String, JsonNode> unknownProperties = new HashMap<>();
@JsonAnyGetter
public Map<String, JsonNode> getUnknownProperties() {
return unknownProperties;
}
@JsonAnySetter
public void setOther(String key, JsonNode value) {
this.unknownProperties.put(key, value);
}
}
@lombok.Data
public static class Base {
private String face;
private boolean is_mystery;
private String name;
private int name_color;
private Origin_info origin_info;
private Risk_ctrl_info risk_ctrl_info;
private Official_info official_info;
/**
*
*/
private final Map<String, JsonNode> unknownProperties = new HashMap<>();
@JsonAnyGetter
public Map<String, JsonNode> getUnknownProperties() {
return unknownProperties;
}
@JsonAnySetter
public void setOther(String key, JsonNode value) {
this.unknownProperties.put(key, value);
}
}
@lombok.Data
public static class Medal {
private String name;
private int level;
private long color_start;
private long color_end;
private long color_border;
private long color;
private int id;
private int typ;
private int is_light;
private long ruid;
private int guard_level;
private int score;
private String guard_icon;
private String honor_icon;
/**
*
*/
private final Map<String, JsonNode> unknownProperties = new HashMap<>();
@JsonAnyGetter
public Map<String, JsonNode> getUnknownProperties() {
return unknownProperties;
}
@JsonAnySetter
public void setOther(String key, JsonNode value) {
this.unknownProperties.put(key, value);
}
}
@lombok.Data
public static class Guard {
private int level;
private String expired_str;
/**
*
*/
private final Map<String, JsonNode> unknownProperties = new HashMap<>();
@JsonAnyGetter
public Map<String, JsonNode> getUnknownProperties() {
return unknownProperties;
}
@JsonAnySetter
public void setOther(String key, JsonNode value) {
this.unknownProperties.put(key, value);
}
}
@lombok.Data
public static class Uinfo {
private long uid;
private Base base;
private Medal medal;
private JsonNode wealth;
private String title;
private Guard guard;
/**
*
*/
private final Map<String, JsonNode> unknownProperties = new HashMap<>();
@JsonAnyGetter
public Map<String, JsonNode> getUnknownProperties() {
return unknownProperties;
}
@JsonAnySetter
public void setOther(String key, JsonNode value) {
this.unknownProperties.put(key, value);
}
}
}

@ -0,0 +1,158 @@
/*
* MIT License
*
* Copyright (c) 2023 OrdinaryRoad
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package tech.ordinaryroad.live.chat.client.codec.bilibili.msg;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.databind.JsonNode;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import tech.ordinaryroad.live.chat.client.codec.bilibili.constant.OperationEnum;
import tech.ordinaryroad.live.chat.client.codec.bilibili.msg.base.BaseBilibiliMsg;
import tech.ordinaryroad.live.chat.client.commons.base.msg.ILikeMsg;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @author mjz
* @date 2024/1/31
*/
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class LikeInfoV3ClickMsg extends BaseBilibiliMsg implements ILikeMsg {
private Data data;
@Override
public OperationEnum getOperationEnum() {
return OperationEnum.MESSAGE;
}
@Override
public String getBadgeName() {
if (this.data == null || this.data.getFans_medal() == null) {
return null;
}
return this.data.getFans_medal().getMedal_name();
}
@Override
public byte getBadgeLevel() {
if (this.data == null || this.data.getFans_medal() == null) {
return 0;
}
return this.data.getFans_medal().getMedal_level();
}
@Override
public String getUid() {
if (this.data == null) {
return null;
}
return Long.toString(this.data.getUid());
}
@Override
public String getUsername() {
if (this.data == null) {
return "";
}
return this.data.getUname();
}
@Override
public String getUserAvatar() {
if (this.data == null || this.data.getUinfo() == null || this.data.getUinfo().getBase() == null) {
return "";
}
return this.data.getUinfo().getBase().getFace();
}
@lombok.Data
public static class Data {
private int show_area;
private int msg_type;
private String like_icon;
private long uid;
private String like_text;
private String uname;
private String uname_color;
private List<Integer> identities;
private InteractWordMsg.Fans_medal fans_medal;
private Contribution_info contribution_info;
private int dmscore;
private String group_medal;
private boolean is_mystery;
private InteractWordMsg.Uinfo uinfo;
/**
*
*/
private final Map<String, JsonNode> unknownProperties = new HashMap<>();
@JsonAnyGetter
public Map<String, JsonNode> getUnknownProperties() {
return unknownProperties;
}
@JsonAnySetter
public void setOther(String key, JsonNode value) {
this.unknownProperties.put(key, value);
}
}
@lombok.Data
public static class Contribution_info {
private int grade;
/**
*
*/
private final Map<String, JsonNode> unknownProperties = new HashMap<>();
@JsonAnyGetter
public Map<String, JsonNode> getUnknownProperties() {
return unknownProperties;
}
@JsonAnySetter
public void setOther(String key, JsonNode value) {
this.unknownProperties.put(key, value);
}
}
}

@ -0,0 +1,81 @@
/*
* MIT License
*
* Copyright (c) 2023 OrdinaryRoad
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package tech.ordinaryroad.live.chat.client.codec.bilibili.msg;
import com.fasterxml.jackson.databind.JsonNode;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import tech.ordinaryroad.live.chat.client.codec.bilibili.constant.OperationEnum;
import tech.ordinaryroad.live.chat.client.codec.bilibili.msg.base.BaseBilibiliCmdMsg;
/**
* @author mjz
* @date 2023/1/6
*/
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class MessageMsg extends BaseBilibiliCmdMsg {
private Long id;
private String name;
private JsonNode full;
private JsonNode half;
private JsonNode side;
private JsonNode data;
private JsonNode info;
private JsonNode msg_common;
private JsonNode msg_self;
private JsonNode link_url;
private JsonNode msg_type;
private JsonNode shield_uid;
private JsonNode business_id;
private JsonNode scatter;
private long roomid;
private long real_roomid;
@Override
public OperationEnum getOperationEnum() {
return OperationEnum.MESSAGE;
}
}

@ -0,0 +1,351 @@
/*
* MIT License
*
* Copyright (c) 2023 OrdinaryRoad
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package tech.ordinaryroad.live.chat.client.codec.bilibili.msg;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.JsonNode;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import tech.ordinaryroad.live.chat.client.codec.bilibili.api.BilibiliApis;
import tech.ordinaryroad.live.chat.client.codec.bilibili.constant.OperationEnum;
import tech.ordinaryroad.live.chat.client.codec.bilibili.msg.base.BaseBilibiliMsg;
import tech.ordinaryroad.live.chat.client.codec.bilibili.msg.dto.MedalInfo;
import tech.ordinaryroad.live.chat.client.commons.base.msg.IGiftMsg;
import java.util.HashMap;
import java.util.Map;
/**
* @author mjz
* @date 2023/9/8
*/
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class SendGiftMsg extends BaseBilibiliMsg implements IGiftMsg {
private Data data;
/**
*
*/
private long roomId;
@Override
public String getBadgeName() {
if (data == null || data.medal_info == null) {
return IGiftMsg.super.getBadgeName();
}
return data.medal_info.getMedal_name();
}
@Override
public byte getBadgeLevel() {
if (data == null || data.medal_info == null) {
return IGiftMsg.super.getBadgeLevel();
}
return data.medal_info.getMedal_level();
}
@Override
public String getUid() {
if (this.data == null) {
return null;
}
return Long.toString(this.data.getUid());
}
@Override
public String getUsername() {
if (this.data == null) {
return "";
}
return this.data.getUname();
}
@Override
public String getUserAvatar() {
if (this.data == null) {
return "";
}
return this.data.getFace();
}
@Override
public String getGiftName() {
if (this.data == null) {
return "未知礼物";
}
return this.data.getGiftName();
}
@Override
public String getGiftImg() {
return BilibiliApis.getGiftImgById(this.data.giftId, this.roomId);
}
@Override
public String getGiftId() {
if (this.data == null) {
return null;
}
return Long.toString(data.getGiftId());
}
@Override
public int getGiftCount() {
if (this.data == null) {
return 0;
}
return data.getNum();
}
@Override
public int getGiftPrice() {
if (this.data == null) {
return -1;
}
return data.getPrice();
}
@Override
public String getReceiveUid() {
if (this.data == null || this.data.getReceive_user_info() == null) {
return null;
}
return Long.toString(data.getReceive_user_info().getUid());
}
@Override
public String getReceiveUsername() {
if (this.data == null || this.data.getReceive_user_info() == null) {
return "";
}
return data.getReceive_user_info().getUname();
}
@Override
public OperationEnum getOperationEnum() {
return OperationEnum.MESSAGE;
}
@lombok.Data
public static class Data {
private int draw;
private int gold;
private int silver;
private int num;
private int total_coin;
private int effect;
private int broadcast_id;
private int crit_prob;
private int guard_level;
private long rcost;
private long uid;
private long timestamp;
private int giftId;
private int giftType;
@JsonProperty("super")
private int _super;
private int super_gift_num;
private int super_batch_gift_num;
private int remain;
private int discount_price;
private int price;
private String beatId;
private String biz_source;
private String action;
private String coin_type;
private String uname;
private String face;
private String batch_combo_id;
private String rnd;
private String giftName;
private String original_gift_name;
private Combo_send combo_send;
private Batch_combo_send batch_combo_send;
private String tag_image;
private String top_list;
private String send_master;
private boolean is_first;
private int demarcation;
private int combo_stay_time;
private int combo_total_coin;
private String tid;
private int effect_block;
private int is_special_batch;
private int combo_resources_id;
private int magnification;
private String name_color;
private MedalInfo medal_info;
private int svga_block;
private JsonNode blind_gift;
private int float_sc_resource_id;
@JsonProperty("switch")
private boolean _switch;
private int face_effect_type;
private int face_effect_id;
private boolean is_naming;
private Receive_user_info receive_user_info;
private boolean is_join_receiver;
private Bag_gift bag_gift;
private int wealth_level;
/**
*
*/
private final Map<String, JsonNode> unknownProperties = new HashMap<>();
@JsonAnyGetter
public Map<String, JsonNode> getUnknownProperties() {
return unknownProperties;
}
@JsonAnySetter
public void setOther(String key, JsonNode value) {
this.unknownProperties.put(key, value);
}
}
@lombok.Data
public static class Combo_send {
private long uid;
private int gift_num;
private int combo_num;
private int gift_id;
private String combo_id;
private String gift_name;
private String action;
private String uname;
private String send_master;
/**
*
*/
private final Map<String, JsonNode> unknownProperties = new HashMap<>();
@JsonAnyGetter
public Map<String, JsonNode> getUnknownProperties() {
return unknownProperties;
}
@JsonAnySetter
public void setOther(String key, JsonNode value) {
this.unknownProperties.put(key, value);
}
}
@lombok.Data
public static class Receive_user_info {
private String uname;
private long uid;
/**
*
*/
private final Map<String, JsonNode> unknownProperties = new HashMap<>();
@JsonAnyGetter
public Map<String, JsonNode> getUnknownProperties() {
return unknownProperties;
}
@JsonAnySetter
public void setOther(String key, JsonNode value) {
this.unknownProperties.put(key, value);
}
}
@lombok.Data
public static class Batch_combo_send {
private long uid;
private int gift_num;
private int batch_combo_num;
private int gift_id;
private String batch_combo_id;
private String gift_name;
private String action;
private String uname;
private String send_master;
private JsonNode blind_gift;
/**
*
*/
private final Map<String, JsonNode> unknownProperties = new HashMap<>();
@JsonAnyGetter
public Map<String, JsonNode> getUnknownProperties() {
return unknownProperties;
}
@JsonAnySetter
public void setOther(String key, JsonNode value) {
this.unknownProperties.put(key, value);
}
}
@lombok.Data
public static class Bag_gift {
private int show_price;
private int price_for_show;
/**
*
*/
private final Map<String, JsonNode> unknownProperties = new HashMap<>();
@JsonAnyGetter
public Map<String, JsonNode> getUnknownProperties() {
return unknownProperties;
}
@JsonAnySetter
public void setOther(String key, JsonNode value) {
this.unknownProperties.put(key, value);
}
}
}

@ -0,0 +1,202 @@
/*
* MIT License
*
* Copyright (c) 2023 OrdinaryRoad
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package tech.ordinaryroad.live.chat.client.codec.bilibili.msg;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.databind.JsonNode;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import tech.ordinaryroad.live.chat.client.codec.bilibili.constant.OperationEnum;
import tech.ordinaryroad.live.chat.client.codec.bilibili.msg.base.BaseBilibiliMsg;
import tech.ordinaryroad.live.chat.client.codec.bilibili.msg.dto.MedalInfo;
import tech.ordinaryroad.live.chat.client.commons.base.msg.ISuperChatMsg;
import java.util.HashMap;
import java.util.Map;
/**
* @author mjz
* @date 2023/9/24
*/
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class SuperChatMessageMsg extends BaseBilibiliMsg implements ISuperChatMsg {
private long roomid;
private Data data;
@Override
public OperationEnum getOperationEnum() {
return OperationEnum.MESSAGE;
}
@Override
public String getUid() {
if (this.data == null) {
return null;
}
return Long.toString(this.data.uid);
}
@Override
public String getUsername() {
if (this.data == null || this.data.getUser_info() == null) {
return "";
}
return this.data.user_info.uname;
}
@Override
public String getUserAvatar() {
if (this.data == null || this.data.getUser_info() == null) {
return "";
}
return this.data.user_info.face;
}
@Override
public String getContent() {
if (this.data == null) {
return "";
}
return this.data.message;
}
@Override
public int getDuration() {
if (this.data == null) {
return 0;
}
return this.data.time;
}
@lombok.Data
public static class Data {
private String background_bottom_color;
private String background_color;
private String background_color_end;
private String background_color_start;
private String background_icon;
private String background_image;
private String background_price_color;
private double color_point;
private int dmscore;
private long end_time;
private Gift gift;
private long id;
private int is_ranked;
private int is_send_audit;
private MedalInfo medal_info;
private String message;
private String message_font_color;
private String message_trans;
private int price;
private int rate;
private long start_time;
private int time;
private String token;
private int trans_mark;
private long ts;
private long uid;
private User_info user_info;
/**
*
*/
private final Map<String, JsonNode> unknownProperties = new HashMap<>();
@JsonAnyGetter
public Map<String, JsonNode> getUnknownProperties() {
return unknownProperties;
}
@JsonAnySetter
public void setOther(String key, JsonNode value) {
this.unknownProperties.put(key, value);
}
}
@lombok.Data
public static class Gift {
private int gift_id;
private String gift_name;
private int num;
/**
*
*/
private final Map<String, JsonNode> unknownProperties = new HashMap<>();
@JsonAnyGetter
public Map<String, JsonNode> getUnknownProperties() {
return unknownProperties;
}
@JsonAnySetter
public void setOther(String key, JsonNode value) {
this.unknownProperties.put(key, value);
}
}
@lombok.Data
public static class User_info {
private String face;
private String face_frame;
private int guard_level;
private int is_main_vip;
private int is_svip;
private int is_vip;
private String level_color;
private int manager;
private String name_color;
private String title;
private String uname;
private int user_level;
/**
*
*/
private final Map<String, JsonNode> unknownProperties = new HashMap<>();
@JsonAnyGetter
public Map<String, JsonNode> getUnknownProperties() {
return unknownProperties;
}
@JsonAnySetter
public void setOther(String key, JsonNode value) {
this.unknownProperties.put(key, value);
}
}
}

@ -0,0 +1,92 @@
/*
* MIT License
*
* Copyright (c) 2023 OrdinaryRoad
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package tech.ordinaryroad.live.chat.client.codec.bilibili.msg;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import lombok.Setter;
import tech.ordinaryroad.live.chat.client.codec.bilibili.constant.OperationEnum;
import tech.ordinaryroad.live.chat.client.codec.bilibili.constant.ProtoverEnum;
import tech.ordinaryroad.live.chat.client.codec.bilibili.msg.base.BaseBilibiliMsg;
/**
* @author mjz
* @date 2023/1/6
*/
@Getter
@Setter
@RequiredArgsConstructor
public class UserAuthenticationMsg extends BaseBilibiliMsg {
/**
* uid0
*/
private long uid;
/**
* id room_idid short_id
* urlidid
* example: <a href="https://api.live.bilibili.com/room/v1/Room/room_init?id=6">https://api.live.bilibili.com/room/v1/Room/room_init?id=6</a>
*/
private final long roomid;
/**
*
*
* @see ProtoverEnum#getCode()
*/
private final int protover;
/**
*
*/
private String platform = "web";
private int type = 2;
/**
*
*
* @since 2023-08-19
*/
private final String buvid;
/**
*
*
* @since @since 2023-08-19
*/
private final String key;
@Override
public ProtoverEnum getProtoverEnum() {
return ProtoverEnum.getByCode(this.protover);
}
@Override
public OperationEnum getOperationEnum() {
return OperationEnum.USER_AUTHENTICATION;
}
}

@ -0,0 +1,68 @@
/*
* MIT License
*
* Copyright (c) 2023 OrdinaryRoad
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package tech.ordinaryroad.live.chat.client.codec.bilibili.msg.base;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import tech.ordinaryroad.live.chat.client.codec.bilibili.constant.BilibiliCmdEnum;
import tech.ordinaryroad.live.chat.client.codec.bilibili.constant.ProtoverEnum;
import tech.ordinaryroad.live.chat.client.commons.base.msg.ICmdMsg;
/**
* @author mjz
* @date 2023/1/6
*/
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public abstract class BaseBilibiliCmdMsg extends BaseBilibiliMsg implements ICmdMsg<BilibiliCmdEnum> {
private int protover;
private String cmd;
@Override
public String getCmd() {
return this.cmd;
}
@Override
public void setCmd(String cmd) {
this.cmd = cmd;
}
@Override
public BilibiliCmdEnum getCmdEnum() {
return BilibiliCmdEnum.getByString(getCmd());
}
@Override
public ProtoverEnum getProtoverEnum() {
return ProtoverEnum.getByCode(this.protover);
}
}

@ -0,0 +1,88 @@
/*
* MIT License
*
* Copyright (c) 2023 OrdinaryRoad
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package tech.ordinaryroad.live.chat.client.codec.bilibili.msg.base;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import tech.ordinaryroad.live.chat.client.codec.bilibili.constant.ProtoverEnum;
import tech.ordinaryroad.live.chat.client.commons.base.exception.BaseException;
import java.util.HashMap;
import java.util.Map;
/**
* @author mjz
* @date 2023/1/6
*/
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public abstract class BaseBilibiliMsg implements IBilibiliMsg {
public static final ObjectMapper OBJECT_MAPPER = new ObjectMapper()
.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false)
.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false);
/**
*
*/
private final Map<String, JsonNode> unknownProperties = new HashMap<>();
private int protover;
@JsonAnyGetter
public Map<String, JsonNode> getUnknownProperties() {
return unknownProperties;
}
@JsonAnySetter
public void setOther(String key, JsonNode value) {
this.unknownProperties.put(key, value);
}
@Override
public ProtoverEnum getProtoverEnum() {
return ProtoverEnum.getByCode(protover);
}
@Override
public String toString() {
try {
return OBJECT_MAPPER.writeValueAsString(this);
} catch (JsonProcessingException e) {
throw new BaseException(e);
}
}
}

@ -0,0 +1,44 @@
/*
* MIT License
*
* Copyright (c) 2023 OrdinaryRoad
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package tech.ordinaryroad.live.chat.client.codec.bilibili.msg.base;
import com.fasterxml.jackson.annotation.JsonIgnore;
import tech.ordinaryroad.live.chat.client.codec.bilibili.constant.OperationEnum;
import tech.ordinaryroad.live.chat.client.codec.bilibili.constant.ProtoverEnum;
import tech.ordinaryroad.live.chat.client.commons.base.msg.IMsg;
/**
* @author mjz
* @date 2023/8/26
*/
public interface IBilibiliMsg extends IMsg {
@JsonIgnore
ProtoverEnum getProtoverEnum();
@JsonIgnore
OperationEnum getOperationEnum();
}

@ -0,0 +1,66 @@
/*
* MIT License
*
* Copyright (c) 2023 OrdinaryRoad
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package tech.ordinaryroad.live.chat.client.codec.bilibili.msg.dto;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.databind.JsonNode;
import lombok.Data;
import java.util.HashMap;
import java.util.Map;
@Data
public class MedalInfo {
private long target_id;
private String special;
private int icon_id;
private String anchor_uname;
private int anchor_roomid;
private byte medal_level;
private String medal_name;
private String medal_color;
private long medal_color_start;
private long medal_color_end;
private long medal_color_border;
private int is_lighted;
private int guard_level;
/**
*
*/
private final Map<String, JsonNode> unknownProperties = new HashMap<>();
@JsonAnyGetter
public Map<String, JsonNode> getUnknownProperties() {
return unknownProperties;
}
@JsonAnySetter
public void setOther(String key, JsonNode value) {
this.unknownProperties.put(key, value);
}
}

@ -0,0 +1,93 @@
/*
* MIT License
*
* Copyright (c) 2023 OrdinaryRoad
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package tech.ordinaryroad.live.chat.client.codec.bilibili.msg.factory;
import cn.hutool.cache.impl.TimedCache;
import cn.hutool.core.util.NumberUtil;
import tech.ordinaryroad.live.chat.client.codec.bilibili.api.BilibiliApis;
import tech.ordinaryroad.live.chat.client.codec.bilibili.constant.ProtoverEnum;
import tech.ordinaryroad.live.chat.client.codec.bilibili.msg.HeartbeatMsg;
import tech.ordinaryroad.live.chat.client.codec.bilibili.msg.UserAuthenticationMsg;
import tech.ordinaryroad.live.chat.client.commons.base.exception.BaseException;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.TimeUnit;
/**
* @author mjz
* @date 2023/1/5
*/
public class BilibiliMsgFactory {
private static final TimedCache<Long, BilibiliMsgFactory> FACTORY_CACHE = new TimedCache<>(TimeUnit.DAYS.toMillis(1), new ConcurrentHashMap<>());
private static final TimedCache<ProtoverEnum, HeartbeatMsg> HEARTBEAT_MSG_CACHE = new TimedCache<>(TimeUnit.DAYS.toMillis(1), new ConcurrentHashMap<>());
/**
* idid
*/
private final long roomId;
public BilibiliMsgFactory(long roomId) {
this.roomId = roomId;
}
public static BilibiliMsgFactory getInstance(long roomId) {
if (!FACTORY_CACHE.containsKey(roomId)) {
FACTORY_CACHE.put(roomId, new BilibiliMsgFactory(roomId));
}
return FACTORY_CACHE.get(roomId);
}
/**
*
*
* @param protover {@link ProtoverEnum}
* @return AuthWebSocketFrame
*/
public UserAuthenticationMsg createAuth(ProtoverEnum protover, BilibiliApis.RoomInitResult roomInitResult) {
try {
String buvid3 = roomInitResult.getBuvid3();
long realRoomId = roomInitResult.getRoomPlayInfoResult().getRoom_id();
UserAuthenticationMsg userAuthenticationMsg = new UserAuthenticationMsg(realRoomId, protover.getCode(), buvid3, roomInitResult.getDanmuinfoResult().getToken());
userAuthenticationMsg.setUid(NumberUtil.parseLong(roomInitResult.getUid()));
return userAuthenticationMsg;
} catch (Exception e) {
throw new BaseException(String.format("认证包创建失败请检查房间号是否正确。roomId: %d, msg: %s", roomId, e.getMessage()));
}
}
/**
*
*
* @param protover {@link ProtoverEnum}
* @return AuthWebSocketFrame
*/
public HeartbeatMsg createHeartbeat(ProtoverEnum protover) {
if (!HEARTBEAT_MSG_CACHE.containsKey(protover)) {
HEARTBEAT_MSG_CACHE.put(protover, new HeartbeatMsg(protover.getCode()));
}
return HEARTBEAT_MSG_CACHE.get(protover);
}
}

@ -0,0 +1,264 @@
/*
* MIT License
*
* Copyright (c) 2023 OrdinaryRoad
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package tech.ordinaryroad.live.chat.client.codec.bilibili.util;
import cn.hutool.core.util.StrUtil;
import com.aayushatharva.brotli4j.Brotli4jLoader;
import com.aayushatharva.brotli4j.decoder.BrotliInputStream;
import com.fasterxml.jackson.core.JsonProcessingException;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.ByteBufAllocator;
import io.netty.buffer.Unpooled;
import lombok.extern.slf4j.Slf4j;
import tech.ordinaryroad.live.chat.client.codec.bilibili.constant.OperationEnum;
import tech.ordinaryroad.live.chat.client.codec.bilibili.constant.ProtoverEnum;
import tech.ordinaryroad.live.chat.client.codec.bilibili.msg.ConnectSuccessMsg;
import tech.ordinaryroad.live.chat.client.codec.bilibili.msg.HeartbeatMsg;
import tech.ordinaryroad.live.chat.client.codec.bilibili.msg.HeartbeatReplyMsg;
import tech.ordinaryroad.live.chat.client.codec.bilibili.msg.MessageMsg;
import tech.ordinaryroad.live.chat.client.codec.bilibili.msg.base.BaseBilibiliMsg;
import tech.ordinaryroad.live.chat.client.codec.bilibili.msg.base.IBilibiliMsg;
import tech.ordinaryroad.live.chat.client.commons.base.exception.BaseException;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.math.BigInteger;
import java.nio.charset.StandardCharsets;
import java.util.*;
import java.util.zip.DataFormatException;
import java.util.zip.Inflater;
/**
* @author mjz
* @date 2023/1/6
*/
@Slf4j
public class BilibiliCodecUtil {
public static int sequence = 0;
public static final short FRAME_HEADER_LENGTH = 16;
public static ByteBuf encode(IBilibiliMsg msg, ByteBuf out) {
String bodyJsonString = StrUtil.EMPTY;
// HeartbeatMsg不需要正文如果序列化后得到`{}`,则替换为空字符串
if (!(msg instanceof HeartbeatMsg)) {
bodyJsonString = msg.toString();
if (StrUtil.EMPTY_JSON.equals(bodyJsonString)) {
bodyJsonString = StrUtil.EMPTY;
}
}
byte[] bodyBytes = bodyJsonString.getBytes(StandardCharsets.UTF_8);
int length = bodyBytes.length + FRAME_HEADER_LENGTH;
out.writeInt(length);
out.writeShort(FRAME_HEADER_LENGTH);
out.writeShort(msg.getProtoverEnum().getCode());
out.writeInt(msg.getOperationEnum().getCode());
out.writeInt(++sequence);
out.writeBytes(bodyBytes);
return out;
}
public static ByteBuf encode(IBilibiliMsg msg) {
return encode(msg, ByteBufAllocator.DEFAULT.buffer(FRAME_HEADER_LENGTH));
}
public static List<IBilibiliMsg> decode(ByteBuf in, List<IBilibiliMsg> msgList) {
Queue<ByteBuf> pendingByteBuf = new LinkedList<>();
do {
Optional<IBilibiliMsg> msg = doDecode(in, pendingByteBuf);
msg.ifPresent(msgList::add);
in = pendingByteBuf.poll();
} while (in != null);
return msgList;
}
public static List<IBilibiliMsg> decode(ByteBuf in) {
return decode(in, new ArrayList<>());
}
/**
*
*
* @param in handler
* @param pendingByteBuf ByteBuf
* @return Optional<IBilibiliMsg> {@link OperationEnum}{@link ProtoverEnum}{@link #parse(OperationEnum, String)}
* @see OperationEnum
* @see ProtoverEnum
*/
private static Optional<IBilibiliMsg> doDecode(ByteBuf in, Queue<ByteBuf> pendingByteBuf) {
int length = in.readInt();
short frameHeaderLength = in.readShort();
short protoverCode = in.readShort();
int operationCode = in.readInt();
int sequence = in.readInt();
int contentLength = length - frameHeaderLength;
byte[] inputBytes = new byte[contentLength];
in.readBytes(inputBytes);
if (in.readableBytes() != 0) {
// log.error("in.readableBytes() {}", in.readableBytes());
pendingByteBuf.offer(in);
}
OperationEnum operationEnum = OperationEnum.getByCode(operationCode);
if (operationEnum == null) {
throw new BaseException(String.format("未知operation: %d", operationCode));
}
if (protoverCode == ProtoverEnum.NORMAL_ZLIB.getCode()) {
switch (operationEnum) {
case MESSAGE: {
// Decompress the bytes
Inflater inflater = new Inflater();
inflater.reset();
inflater.setInput(inputBytes);
// TODO 改用池化,并处理内存泄漏问题
ByteBuf buffer = Unpooled.buffer();
try {
byte[] bytes = new byte[1024];
while (!inflater.finished()) {
int count = inflater.inflate(bytes);
buffer.writeBytes(bytes, 0, count);
}
} catch (DataFormatException e) {
throw new BaseException(e);
} finally {
inflater.end();
}
return doDecode(buffer, pendingByteBuf);
}
case HEARTBEAT_REPLY: {
BigInteger bigInteger = new BigInteger(inputBytes);
return parse(operationEnum, String.format("{\"popularity\":%d}", bigInteger));
}
default: {
String s = new String(inputBytes, StandardCharsets.UTF_8);
return parse(operationEnum, s);
}
}
} else if (protoverCode == ProtoverEnum.NORMAL_NO_COMPRESSION.getCode()) {
switch (operationEnum) {
case HEARTBEAT_REPLY: {
BigInteger bigInteger = new BigInteger(inputBytes);
return parse(operationEnum, String.format("{\"popularity\":%d}", bigInteger));
}
default: {
String s = new String(inputBytes, StandardCharsets.UTF_8);
return parse(operationEnum, s);
}
}
} else if (protoverCode == ProtoverEnum.HEARTBEAT_AUTH_NO_COMPRESSION.getCode()) {
switch (operationEnum) {
case HEARTBEAT_REPLY: {
BigInteger bigInteger = new BigInteger(inputBytes);
return parse(operationEnum, String.format("{\"popularity\":%d}", bigInteger));
}
default: {
String s = new String(inputBytes, StandardCharsets.UTF_8);
return parse(operationEnum, s);
}
}
} else if (protoverCode == ProtoverEnum.NORMAL_BROTLI.getCode()) {
switch (operationEnum) {
case MESSAGE: {
// Load the native library
Brotli4jLoader.ensureAvailability();
ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(inputBytes);
// TODO 改用池化,并处理内存泄漏问题
ByteBuf buffer = Unpooled.buffer();
byte[] bytes = new byte[1024];
BrotliInputStream brotliInputStream = null;
try {
brotliInputStream = new BrotliInputStream(byteArrayInputStream);
int count;
while ((count = brotliInputStream.read(bytes)) > -1) {
buffer.writeBytes(bytes, 0, count);
}
} catch (IOException e) {
throw new BaseException(e);
} finally {
try {
// Close the BrotliInputStream. This also closes the InputStream.
if (brotliInputStream != null) {
brotliInputStream.close();
}
} catch (IOException e) {
log.error("解压失败", e);
}
}
return doDecode(buffer, pendingByteBuf);
}
case HEARTBEAT_REPLY: {
BigInteger bigInteger = new BigInteger(inputBytes);
return parse(operationEnum, String.format("{\"popularity\":%d}", bigInteger));
}
default: {
String s = new String(inputBytes, StandardCharsets.UTF_8);
return parse(operationEnum, s);
}
}
} else {
if (log.isWarnEnabled()) {
log.warn("暂不支持的版本:{}", protoverCode);
}
return Optional.empty();
}
}
public static Optional<IBilibiliMsg> parse(OperationEnum operation, String jsonString) {
switch (operation) {
case MESSAGE: {
try {
return Optional.ofNullable(BaseBilibiliMsg.OBJECT_MAPPER.readValue(jsonString, MessageMsg.class));
} catch (JsonProcessingException e) {
throw new BaseException(e);
}
}
case CONNECT_SUCCESS: {
try {
return Optional.ofNullable(BaseBilibiliMsg.OBJECT_MAPPER.readValue(jsonString, ConnectSuccessMsg.class));
} catch (JsonProcessingException e) {
throw new BaseException(e);
}
}
case HEARTBEAT_REPLY: {
try {
return Optional.ofNullable(BaseBilibiliMsg.OBJECT_MAPPER.readValue(jsonString, HeartbeatReplyMsg.class));
} catch (JsonProcessingException e) {
throw new BaseException(e);
}
}
default: {
if (log.isWarnEnabled()) {
log.warn("暂不支持 {}", operation);
}
return Optional.empty();
}
}
}
}

@ -0,0 +1,13 @@
syntax = "proto3";
package tech.ordinaryroad.live.chat.client.codec.bilibili.protobuf;
option java_package = "tech.ordinaryroad.live.chat.client.codec.bilibili.protobuf";
message dm_v2 {
dm_v2_20 _dm_v2_20 = 20;
message dm_v2_20 {
string avatar = 4;
}
}

@ -0,0 +1,24 @@
package tech.ordinaryroad.live.chat.client.codec.bilibili.api;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
/**
* @author mjz
* @date 2023/9/7
*/
class BilibiliApisTest {
@Test
void sendMsg() {
String cookie = System.getenv("cookie");
BilibiliApis.sendMsg("666", 545068, cookie);
}
@Test
void getRoomPlayInfo() {
assertEquals(545068, BilibiliApis.getRoomPlayInfo(7777, null).getRoom_id());
assertEquals(7734200, BilibiliApis.getRoomPlayInfo(6, null).getRoom_id());
}
}

@ -0,0 +1,98 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>tech.ordinaryroad</groupId>
<artifactId>live-chat-client-codec</artifactId>
<version>0.7.0</version>
</parent>
<packaging>jar</packaging>
<artifactId>live-chat-client-codec-douyin</artifactId>
<name>live-chat-client-codec-douyin</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>tech.ordinaryroad</groupId>
<artifactId>live-chat-client-commons-base</artifactId>
</dependency>
<dependency>
<groupId>tech.ordinaryroad</groupId>
<artifactId>live-chat-client-commons-util</artifactId>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-codec</artifactId>
</dependency>
<dependency>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java</artifactId>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
</dependency>
<dependency>
<groupId>org.graalvm.js</groupId>
<artifactId>js</artifactId>
<version>21.0.0</version>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>${junit-jupiter.version}</version>
<scope>test</scope>
</dependency>
<!-- <dependency>-->
<!-- <groupId>org.apache.httpcomponents.client5</groupId>-->
<!-- <artifactId>httpclient5</artifactId>-->
<!-- <version>5.1</version>-->
<!-- </dependency>-->
<!-- HttpClient -->
<dependency>
<groupId>org.apache.httpcomponents.client5</groupId>
<artifactId>httpclient5</artifactId>
<version>5.1</version>
</dependency>
<!-- GraalVM JavaScript -->
<dependency>
<groupId>org.graalvm.sdk</groupId>
<artifactId>graal-sdk</artifactId>
<version>20.3.0</version> <!-- 使用你安装的 GraalVM 版本 -->
</dependency>
<dependency>
<groupId>org.graalvm.js</groupId>
<artifactId>js</artifactId>
<version>20.3.0</version> <!-- 使用你安装的 GraalVM 版本 -->
</dependency>
<dependency>
<groupId>org.graalvm.js</groupId>
<artifactId>js-scriptengine</artifactId>
<version>20.3.0</version> <!-- 使用你安装的 GraalVM 版本 -->
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>5.2.2</version>
</dependency>
<dependency>
<groupId>edu.stanford.nlp</groupId>
<artifactId>stanford-corenlp</artifactId>
<version>4.5.1</version>
</dependency>
<dependency>
<groupId>edu.stanford.nlp</groupId>
<artifactId>stanford-corenlp</artifactId>
<version>4.5.1</version>
<classifier>models</classifier>
</dependency>
</dependencies>
</project>

@ -0,0 +1,337 @@
/*
* MIT License
*
* Copyright (c) 2023 OrdinaryRoad
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package tech.ordinaryroad.live.chat.client.codec.douyin.api;
import cn.hutool.core.util.*;
import cn.hutool.http.*;
import cn.hutool.http.Header;
import cn.hutool.json.JSON;
import cn.hutool.json.JSONObject;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonNode;
import com.oracle.truffle.js.builtins.JSONBuiltins;
import io.netty.util.internal.StringUtil;
import lombok.*;
import lombok.extern.slf4j.Slf4j;
import org.apache.poi.ss.usermodel.*;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.graalvm.polyglot.Source;
import tech.ordinaryroad.live.chat.client.codec.douyin.constant.DouyinRoomStatusEnum;
import tech.ordinaryroad.live.chat.client.codec.douyin.msg.DouyinGiftMsg;
import tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.DouyinWebcastGiftMessageMsgOuterClass;
import tech.ordinaryroad.live.chat.client.commons.base.exception.BaseException;
import tech.ordinaryroad.live.chat.client.commons.util.OrJacksonUtil;
import tech.ordinaryroad.live.chat.client.commons.util.OrLiveChatCookieUtil;
import tech.ordinaryroad.live.chat.client.commons.util.OrLiveChatHttpUtil;
import org.graalvm.polyglot.Context;
import org.graalvm.polyglot.Value;
import javax.script.Invocable;
import javax.script.ScriptEngine;
import javax.script.ScriptEngineManager;
import javax.script.ScriptException;
import java.io.*;
import java.net.URLEncoder;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
* @author mjz
* @date 2024/1/3
*/
@Slf4j
public class DouyinApis {
public static final String KEY_COOKIE_TTWID = "ttwid";
public static final String KEY_COOKIE_MS_TOKEN = "msToken";
public static final String KEY_COOKIE_AC_NONCE = "__ac_nonce";
public static final String A_BOGUS="a_bogus";
public static final String MS_TOKEN_BASE_STRING = RandomUtil.BASE_CHAR_NUMBER_LOWER + "=_";
public static final int MS_TOKEN_LENGTH = 107;
public static final int AC_NONCE_LENGTH = 21;
public static final String PATTERN_USER_UNIQUE_ID = "\\\\\"user_unique_id\\\\\":\\\\\"(\\d+)\\\\\"";
public static final String PATTERN_ROOM_ID = "\\\\\"roomId\\\\\":\\\\\"(\\d+)\\\\\"";
public static final String A_ID ="(?i)\\b(?:aid)\\b\\s*:\\s*(\\d+)";
public static final String PATTERN_ROOM_STATUS = "\\\\\"roomInfo\\\\\".+\\\\\"status\\\\\":(\\d+)";
// public static final String USER_AGENT = GlobalHeaders.INSTANCE.header(Header.USER_AGENT).replace("Hutool", "");
public static final String USER_AGENT="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36";
public static List<JSONObject> initialScript(String excel){
String excelFilePath = excel; // 修改为你上传的文件路径
List<JSONObject> jsonObjects = new ArrayList<>();
try (FileInputStream fis = new FileInputStream(new File(excelFilePath));
Workbook workbook = new XSSFWorkbook(fis)) {
// 假设我们读取第一个Sheet
Sheet sheet = workbook.getSheetAt(0);
Iterator<Row> rowIterator = sheet.iterator();
// 获取表头
Row headerRow = rowIterator.next();
List<String> headers = new ArrayList<>();
for (Cell cell : headerRow) {
headers.add(cell.getStringCellValue());
}
// 迭代每一行创建JSON对象
while (rowIterator.hasNext()) {
Row row = rowIterator.next();
JSONObject jsonObject = new JSONObject();
for (int i = 0; i < headers.size(); i++) {
Cell cell = row.getCell(i, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK);
switch (cell.getCellType()) {
case STRING:
jsonObject.put(headers.get(i), cell.getStringCellValue());
break;
case NUMERIC:
if (DateUtil.isCellDateFormatted(cell)) {
jsonObject.put(headers.get(i), cell.getDateCellValue());
} else {
jsonObject.put(headers.get(i), cell.getNumericCellValue());
}
break;
case BOOLEAN:
jsonObject.put(headers.get(i), cell.getBooleanCellValue());
break;
case FORMULA:
jsonObject.put(headers.get(i), cell.getCellFormula());
break;
default:
jsonObject.put(headers.get(i), "");
break;
}
}
jsonObjects.add(jsonObject);
}
} catch (IOException e) {
e.printStackTrace();
}
Map<String,JSONObject> map=new HashMap<>();
// 输出结果
for (JSONObject jsonObject : jsonObjects) {
System.out.println(jsonObject.toString());
String value = jsonObject.getStr("留资操作疑问");
map.put(value,jsonObject);
}
return jsonObjects;
}
public static RoomInitResult roomInit(Object roomId, String cookie) {
Map<String, String> cookieMap = OrLiveChatCookieUtil.parseCookieString(cookie);
List<JSONObject> jsonObjects = initialScript("D:\\工作\\抖音AI\\回答总结.xlsx");
Map<String,JSONObject> map=new HashMap<>();
// 输出结果
for (JSONObject jsonObject : jsonObjects) {
System.out.println(jsonObject.toString());
String value = jsonObject.getStr("留资操作疑问");
map.put(value,jsonObject);
}
@Cleanup
HttpResponse response1 = OrLiveChatHttpUtil.createGet("https://live.douyin.com/").cookie(cookie).execute();
String ttwid = OrLiveChatCookieUtil.getCookieByName(cookieMap, KEY_COOKIE_TTWID, () -> response1.getCookie(KEY_COOKIE_TTWID).getValue());
String msToken = OrLiveChatCookieUtil.getCookieByName(cookieMap, KEY_COOKIE_MS_TOKEN, () -> RandomUtil.randomString(MS_TOKEN_BASE_STRING, MS_TOKEN_LENGTH));
String __ac_nonce = OrLiveChatCookieUtil.getCookieByName(cookieMap, KEY_COOKIE_AC_NONCE, () -> RandomUtil.randomString(AC_NONCE_LENGTH));
@Cleanup
HttpResponse response2 = OrLiveChatHttpUtil.createGet("https://live.douyin.com/" + roomId)
.cookie(StrUtil.emptyToDefault(cookie, KEY_COOKIE_TTWID + "=" + ttwid + "; " + KEY_COOKIE_MS_TOKEN + "=" + msToken + "; " + KEY_COOKIE_AC_NONCE + "=" + __ac_nonce))
.execute();
if (response2.getStatus() != HttpStatus.HTTP_OK) {
throw new BaseException("获取" + roomId + "真实房间ID失败");
}
String body2 = response2.body();
String user_unique_id = StrUtil.emptyToDefault(ReUtil.getGroup1(PATTERN_USER_UNIQUE_ID, body2), RandomUtil.randomNumbers(19));
long realRoomId;
String realRoomIdString = ReUtil.getGroup1(PATTERN_ROOM_ID, body2);
try {
realRoomId = NumberUtil.parseLong(realRoomIdString);
} catch (Exception e) {
throw new BaseException("获取" + roomId + "真实房间ID失败");
}
String aid = ReUtil.getGroup1(A_ID, body2);
int roomStatus;
String roomStatusString = ReUtil.getGroup1(PATTERN_ROOM_STATUS, body2);
try {
roomStatus = NumberUtil.parseInt(roomStatusString);
} catch (Exception e) {
throw new BaseException("获取" + roomId + "直播间状态失败");
}
return RoomInitResult.builder()
.ttwid(ttwid)
.msToken(msToken)
.acNonce(__ac_nonce)
.realRoomId(realRoomId)
.aid(aid)
.userUniqueId(user_unique_id)
.jsonObjectMap(map)
.roomStatus(DouyinRoomStatusEnum.getByCode(roomStatus))
.build();
}
public static RoomInitResult roomInit(Object roomId) {
return roomInit(roomId, null);
}
/**
*
*
* @param msg KuaishouGiftMsg
* @return
*/
public static int calculateGiftCount(DouyinGiftMsg msg) {
if (msg == null || msg.getMsg() == null) {
return 0;
}
long giftCount;
DouyinWebcastGiftMessageMsgOuterClass.DouyinWebcastGiftMessageMsg douyinWebcastGiftMessageMsg = msg.getMsg();
if (douyinWebcastGiftMessageMsg.getGift().getCombo() && douyinWebcastGiftMessageMsg.getRepeatEnd() != 1) {// 连击中
return 0;
}
long comboCount = douyinWebcastGiftMessageMsg.getComboCount();
if (douyinWebcastGiftMessageMsg.getGroupCount() != 1L) {// 每点击一次送礼的数量不是1时
comboCount = douyinWebcastGiftMessageMsg.getGroupCount() * comboCount;
}
giftCount = comboCount;
msg.setCalculatedGiftCount((int) giftCount);
return (int) giftCount;
}
public static String getBogus(String url,String respData,String userAgent) {
String a_bogus="";
Context context = Context.newBuilder("js").allowAllAccess(true).build();
try {
File jsFile = new File("D:\\workspace\\ordinaryroad-live-chat-client\\live-chat-client-codec\\live-chat-client-codec-douyin\\src\\main\\resources\\a-bogus.js");
String jsCode = new String(Files.readAllBytes(jsFile.toPath()));
Source source = Source.newBuilder("js", jsCode, "a-bogus1.js").build();
context.eval(source);
// 获取 JavaScript 中导出的函数
Value bindings = context.getBindings("js");
Value getBogusFunction = bindings.getMember("getABogus");
Value result = getBogusFunction.execute(url,respData,userAgent);
System.out.println("Result from get_bogus: " + result.asString());
a_bogus=result.asString();
} catch (IOException e) {
e.printStackTrace();
}
return a_bogus;
}
@SneakyThrows
public static JsonNode sendComment(String cookie, Object roomId,Object realRoomId,String aid, SendCommentRequest request) {
request.setContent(!StringUtil.isNullOrEmpty(request.getContent())?URLEncoder.encode(request.getContent(), "UTF-8"):"");
Map<String, String> cookieMap = OrLiveChatCookieUtil.parseCookieString(cookie);
String msToken = OrLiveChatCookieUtil.getCookieByName(cookieMap, KEY_COOKIE_MS_TOKEN, () -> RandomUtil.randomString(MS_TOKEN_BASE_STRING, MS_TOKEN_LENGTH));
String url="https://live.douyin.com/webcast/room/chat/?aid="+aid+"&app_name=douyin_web&live_id=1&device_platform=web&language=zh-CN&enter_from=web_homepage_follow&cookie_enabled=true&screen_width=1920&screen_height=1080&browser_language=zh-CN&browser_platform=Win32&browser_name=Chrome&browser_version=123.0.0.0&room_id="+realRoomId+"&content="+request.getContent()+"&type=0&msToken="+msToken+"&msToken="+msToken;
String path=url+"&"+A_BOGUS+"="+getBogus(url,"",USER_AGENT);
@Cleanup
HttpResponse response = createGetRequest(path, cookie)
.header(Header.REFERER, "https://live.douyin.com/" + roomId)
.header(Header.ACCEPT,"application/json, text/plain, */*")
.header(Header.USER_AGENT,USER_AGENT)
.execute();
System.out.println(response.body());
return responseInterceptor(response.body());
}
public static HttpRequest createGetRequest(String url, String cookie) {
return createRequest(Method.GET, url, cookie);
}
public static HttpRequest createRequest(Method method, String url, String cookie) {
return OrLiveChatHttpUtil.createRequest(method, url)
.cookie(cookie)
.header(Header.HOST, URLUtil.url(url).getHost())
.header(Header.USER_AGENT, USER_AGENT);
}
private static JsonNode responseInterceptor(String responseString) {
try {
JsonNode jsonNode = OrJacksonUtil.getInstance().readTree(responseString);
if (jsonNode.has("status_code")) {
int result = jsonNode.get("status_code").asInt();
if (result != 0) {
String message = "";
switch (result) {
case 2: {
message = "请求过快,请稍后重试";
break;
}
case 400002: {
message = "需要进行验证";
break;
}
default: {
message = "";
}
}
throwExceptionWithTip("接口访问失败:" + message + ",返回结果:" + jsonNode);
}
}
return jsonNode;
} catch (JsonProcessingException e) {
throw new BaseException(e);
}
}
private static void throwExceptionWithTip(String message) {
throw new BaseException("『可能已触发滑块验证建议配置Cookie或打开浏览器进行滑块验证后重试』" + message);
}
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public static class SendCommentRequest {
private String liveStreamId;
private String content;
private String color;
}
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
@Builder
public static class RoomInitResult {
private String ttwid;
private String aid;
private String msToken;
private String acNonce;
private long realRoomId;
private String userUniqueId;
private DouyinRoomStatusEnum roomStatus;
private Map<String,JSONObject> jsonObjectMap;
}
}

@ -0,0 +1,75 @@
package tech.ordinaryroad.live.chat.client.codec.douyin.api;
import org.apache.hc.core5.http.ParseException;
import org.graalvm.polyglot.Context;
import org.graalvm.polyglot.Value;
import org.apache.hc.client5.http.classic.methods.HttpGet;
import org.apache.hc.client5.http.impl.classic.CloseableHttpClient;
import org.apache.hc.client5.http.impl.classic.CloseableHttpResponse;
import org.apache.hc.client5.http.impl.classic.HttpClients;
import org.apache.hc.core5.http.io.entity.EntityUtils;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.HashMap;
import java.util.Map;
public class MediaCrawler {
private static String loadJavaScript(String path) throws IOException {
return new String(Files.readAllBytes(Paths.get(path)));
}
private static Context initJsContext(String jsCode) {
Context context = Context.newBuilder("js").allowAllAccess(true).build();
context.eval("js", jsCode);
return context;
}
public static void main(String[] args) throws IOException {
// Load and initialize JavaScript context
String jsCode = loadJavaScript("D:\\workspace\\ordinaryroad-live-chat-client\\live-chat-client-codec\\live-chat-client-codec-douyin\\src\\main\\resources\\a-bogus1.js");
Context context = initJsContext(jsCode);
// Define headers and cookies
String cookies = "ttwid=1%7CU6YHr6wKj_WHHXYfelzk5jc7uAg-yN0k2k4yTm1Uo-s%7C1704965821%7Cf48a7874351c69357f4f5f531416c9ad43385f9059fe7c57a5bbb9732b5f5add; store-region-src=uid; live_use_vvc=%22false%22; xgplayer_user_id=657157399276; passport_csrf_token=8be74ec699ab18095dca4f5702e616f9; passport_csrf_token_default=8be74ec699ab18095dca4f5702e616f9; bd_ticket_guard_client_web_domain=2; _bd_ticket_crypt_doamin=2; __security_server_data_status=1; my_rd=2; publish_badge_show_info=%220%2C0%2C0%2C1715773185377%22; FORCE_LOGIN=%7B%22videoConsumedRemainSeconds%22%3A180%2C%22isForcePopClose%22%3A1%7D; SEARCH_RESULT_LIST_TYPE=%22single%22; download_guide=%222%2F20240516%2F0%22; passport_assist_user=CjwjtEjeQtOp4Cv_wosZ7DtwEtUwHH_jeTuTFOAtl41NpaLgvp2vuqX2CWO8YRW4bl6ZpT1kW82jgLbqhEwaSgo8h_8os20HEgPmVLztaUEVY3DIXJl6lwetx9-JB8jtD-t7ahjgNTdRxNvpnIDNT25jXl2fvzM2MCy1iZRYENq10Q0Yia_WVCABIgEDb4YVGQ%3D%3D; n_mh=q7yfwiSq87rdYvSKcxHn_fwIoPyQ2pa_2oa26gtgGnE; sso_uid_tt=d83cddbc4b03a4e3071260ecfaa00567; sso_uid_tt_ss=d83cddbc4b03a4e3071260ecfaa00567; toutiao_sso_user=7e856d5dcbe9b55fbfea27ab9abfa141; toutiao_sso_user_ss=7e856d5dcbe9b55fbfea27ab9abfa141; sid_ucp_sso_v1=1.0.0-KDY5YTIyNTlkMTk5MGQ5ZDEyZGZmMjc1NGVlMWVjNDVkNWEwNGI0MjgKHQjAnsTM_AEQpJmWsgYY7zEgDDCioaDNBTgGQPQHGgJscSIgN2U4NTZkNWRjYmU5YjU1ZmJmZWEyN2FiOWFiZmExNDE; ssid_ucp_sso_v1=1.0.0-KDY5YTIyNTlkMTk5MGQ5ZDEyZGZmMjc1NGVlMWVjNDVkNWEwNGI0MjgKHQjAnsTM_AEQpJmWsgYY7zEgDDCioaDNBTgGQPQHGgJscSIgN2U4NTZkNWRjYmU5YjU1ZmJmZWEyN2FiOWFiZmExNDE; passport_auth_status=fba0b2a35313b10a9e2e6c5d8f4d0f5f%2Cf3f2fbe505be6e05bcbc18118e5eb692; passport_auth_status_ss=fba0b2a35313b10a9e2e6c5d8f4d0f5f%2Cf3f2fbe505be6e05bcbc18118e5eb692; uid_tt=fc7b8cb7c4319654ef8da389ae142402; uid_tt_ss=fc7b8cb7c4319654ef8da389ae142402; sid_tt=8001e5f3e7a8f1222572de448a3bcc44; sessionid=8001e5f3e7a8f1222572de448a3bcc44; sessionid_ss=8001e5f3e7a8f1222572de448a3bcc44; _bd_ticket_crypt_cookie=f2e36f6fdf947c3c48887c1df24b34a5; sid_guard=8001e5f3e7a8f1222572de448a3bcc44%7C1715834032%7C5183991%7CMon%2C+15-Jul-2024+04%3A33%3A43+GMT; sid_ucp_v1=1.0.0-KDc0MjFmYzUzMzM1ZThkNjhmY2U2MGRhZDMxNGRkM2NiM2ZiZTA1MzcKGQjAnsTM_AEQsJmWsgYY7zEgDDgGQPQHSAQaAmxxIiA4MDAxZTVmM2U3YThmMTIyMjU3MmRlNDQ4YTNiY2M0NA; ssid_ucp_v1=1.0.0-KDc0MjFmYzUzMzM1ZThkNjhmY2U2MGRhZDMxNGRkM2NiM2ZiZTA1MzcKGQjAnsTM_AEQsJmWsgYY7zEgDDgGQPQHSAQaAmxxIiA4MDAxZTVmM2U3YThmMTIyMjU3MmRlNDQ4YTNiY2M0NA; LOGIN_STATUS=1; pwa2=%220%7C0%7C3%7C0%22; volume_info=%7B%22isUserMute%22%3Atrue%2C%22isMute%22%3Atrue%2C%22volume%22%3A0.298%7D; WallpaperGuide=%7B%22showTime%22%3A1715773828584%2C%22closeTime%22%3A0%2C%22showCount%22%3A1%2C%22cursor1%22%3A44%2C%22cursor2%22%3A0%7D; __live_version__=%221.1.2.226%22; strategyABtestKey=%221715909224.526%22; store-region=cn-sx; has_avx2=null; device_web_cpu_core=12; device_web_memory_size=8; csrf_session_id=c0e8a5e872a6f46fc9f680d648d0506c; webcast_leading_last_show_time=1715909236351; webcast_leading_total_show_times=1; passport_fe_beating_status=true; stream_recommend_feed_params=%22%7B%5C%22cookie_enabled%5C%22%3Atrue%2C%5C%22screen_width%5C%22%3A1920%2C%5C%22screen_height%5C%22%3A1080%2C%5C%22browser_online%5C%22%3Atrue%2C%5C%22cpu_core_num%5C%22%3A12%2C%5C%22device_memory%5C%22%3A8%2C%5C%22downlink%5C%22%3A1.45%2C%5C%22effective_type%5C%22%3A%5C%223g%5C%22%2C%5C%22round_trip_time%5C%22%3A800%7D%22; FOLLOW_LIVE_POINT_INFO=%22MS4wLjABAAAAiiu56eDUtaMvfNC6hdKR27mQJqv4XdECCRf2z1SZ5a4%2F1715961600000%2F0%2F0%2F1715916967891%22; FOLLOW_NUMBER_YELLOW_POINT_INFO=%22MS4wLjABAAAAiiu56eDUtaMvfNC6hdKR27mQJqv4XdECCRf2z1SZ5a4%2F1715961600000%2F0%2F1715916367891%2F0%22; stream_player_status_params=%22%7B%5C%22is_auto_play%5C%22%3A0%2C%5C%22is_full_screen%5C%22%3A0%2C%5C%22is_full_webscreen%5C%22%3A0%2C%5C%22is_mute%5C%22%3A1%2C%5C%22is_speed%5C%22%3A1%2C%5C%22is_visible%5C%22%3A1%7D%22; home_can_add_dy_2_desktop=%221%22; __ac_nonce=06646d246006dcf6c24ef; __ac_signature=_02B4Z6wo00f010SjtrgAAIDCToVtEfb9Gp9Eg7IAALd530; xg_device_score=6.706596267646972; live_can_add_dy_2_desktop=%221%22; bd_ticket_guard_client_data=eyJiZC10aWNrZXQtZ3VhcmQtdmVyc2lvbiI6MiwiYmQtdGlja2V0LWd1YXJkLWl0ZXJhdGlvbi12ZXJzaW9uIjoxLCJiZC10aWNrZXQtZ3VhcmQtcmVlLXB1YmxpYy1rZXkiOiJCR1NCbXBuQWhMRFg3TERDUVZqZnRDSHJXa1FTNzZNR1ZPcDI4YXB1WmhTd3B0YnArM1NKRCt1b2lZTFFacENDS2JaMEZkaFZUcEtyei9sU0ZzNTlWNUk9IiwiYmQtdGlja2V0LWd1YXJkLXdlYi12ZXJzaW9uIjoxfQ%3D%3D; odin_tt=2443abfcc082b15ffd770a6f1de88eb3f89f73b386c1f73db07f46169555362a27d2456d45c785f73ccf9e0febe854f5; IsDouyinActive=true; msToken=eNlm7XjhUwl8_RFbbjc9iObiL2XV3cvGjD5d4h7zaK-EBGJptp4MdunpwYHdxwkt8Wfp7_ZF9JAFmu_axosLiN00ohMSxWfHklvDGIHv09PTPNZ6pDTBCLGCKg2o";
Map<String, String> headers = new HashMap<>();
headers.put("accept", "application/json, text/plain, */*");
headers.put("accept-language", "zh-CN,zh;q=0.9");
headers.put("user-agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36\n" +
"Easter egg\n" +
"There's an Easter egg somewhere in DevTools, behind a colorful \uD83D\uDCAB emoji. Can you find it?\n" +
"Emulate a focused page in Elements > Styles\n" +
"The Elements > Styles tab gets an option to emulate a focused page under the element state (:hov) toggle.\n" +
"Lighthouse\n" +
"The Lighthouse panel now runs Lighthouse 11.5.0 with a new audit that estimates root causes for layout shifts.");
String url = "https://live.douyin.com/webcast/ranklist/audience/";
String query = "aid=6383&app_name=douyin_web&live_id=1&device_platform=web&language=zh-CN&enter_from=page_refresh&cookie_enabled=true&screen_width=1920&screen_height=1080&browser_language=zh-CN&browser_platform=Win32&browser_name=Chrome&browser_version=123.0.0.0&webcast_sdk_version=2450&room_id=7369814552730651432&anchor_id=103738238270&sec_anchor_id=MS4wLjABAAAAUnCoOCj5YJGvnWGL52RpDyLgb1CBI5JCbDfi68AKXEw&rank_type=30&msToken=g8BFTC18zsgtCCloEcatR_Fa1NQEjtxyrUAwmhPYAt0DnixdEDqlUpWC0DPHubeDT5PiGb4wDvZytI9d7kVi0_kwx1aublpMQoGy_pJsDe5r9bGV9b8yc2mYIO6i";
// Generate the `a_bogus` parameter using the JavaScript context
Value generateABogusFunction = context.getBindings("js").getMember("generate_a_bogus");
String aBogus = generateABogusFunction.execute(query, "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36").asString();
// Add the `a_bogus` parameter to the query
query += "&a_bogus=" + aBogus;
System.out.println("a_bogus:"+aBogus);
// Make HTTP GET request
try (CloseableHttpClient httpClient = HttpClients.createDefault()) {
HttpGet request = new HttpGet(url + "?" + query);
// Add headers to the request
headers.forEach(request::addHeader);
// Add cookies to the request
request.addHeader("Cookie", cookies);
try (CloseableHttpResponse response = httpClient.execute(request)) {
String responseBody = EntityUtils.toString(response.getEntity());
System.out.println(responseBody);
} catch (ParseException e) {
throw new RuntimeException(e);
}
}
}
}

@ -0,0 +1,62 @@
package tech.ordinaryroad.live.chat.client.codec.douyin.api;
import cn.hutool.json.JSONObject;
import edu.stanford.nlp.ling.CoreLabel;
import edu.stanford.nlp.ling.Word;
import edu.stanford.nlp.pipeline.CoreDocument;
import edu.stanford.nlp.pipeline.StanfordCoreNLP;
import edu.stanford.nlp.process.PTBTokenizer;
import edu.stanford.nlp.process.Tokenizer;
import edu.stanford.nlp.process.TokenizerFactory;
import java.io.StringReader;
import java.util.*;
/**
* @Title:
* @Description:
* @Author
* @Date 2024-05-22 14:19
* @Version V1.0
*/
public class VehicleRecognition {
public static void main(String[] args) {
// 设置StanfordCoreNLP的属性
Properties props = new Properties();
props.setProperty("annotators", "tokenize");
StanfordCoreNLP pipeline = new StanfordCoreNLP(props);
// 输入文本
String text = "海鸥有没有优惠";
// 创建CoreDocument
CoreDocument document = new CoreDocument(text);
// 运行所有的注释器
pipeline.annotate(document);
List<JSONObject> jsonObjects = DouyinApis.initialScript("D:\\工作\\抖音AI\\车型库1214.xlsx");
System.out.println(jsonObjects);
// 自定义车辆品牌和车系的关键词
List<String> brands=new ArrayList<>();
List<String> models=new ArrayList<>();
for(JSONObject jsonObject:jsonObjects){
brands.add(jsonObject.getStr("品牌名称"));
models.add(jsonObject.getStr("车系名称"));
}
Set<String> vehicleBrands = new HashSet<>(brands);
Set<String> vehicleModels = new HashSet<>(models);
TokenizerFactory<Word> factory = PTBTokenizer.factory();
factory.setOptions("invertible=true");
Tokenizer<Word> tokenizer = factory.getTokenizer(new StringReader(text));
// 遍历分词结果并输出
List<String> vehicleMentions = new ArrayList<>();
List<Word> tokens = tokenizer.tokenize();
for (Word token : tokens) {
String word = token.word();
if (vehicleBrands.contains(word) || vehicleModels.contains(word)) {
vehicleMentions.add(word);
}
}
// 输出结果
System.out.println("Vehicle Mentions: " + vehicleMentions);
}
}

@ -0,0 +1,86 @@
/*
* MIT License
*
* Copyright (c) 2023 OrdinaryRoad
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package tech.ordinaryroad.live.chat.client.codec.douyin.constant;
import cn.hutool.core.util.StrUtil;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
/**
* @author mjz
* @date 2024/1/2
*/
@Getter
@RequiredArgsConstructor
public enum DouyinCmdEnum {
/**
*
*/
WebcastChatMessage,
/**
*
*/
WebcastGiftMessage,
/**
*
*/
WebcastLikeMessage,
/**
*
*/
WebcastMemberMessage,
/**
*
*/
WebcastRoomStatsMessage,
/**
* {@link tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.DouyinWebcastSocialMessageMsgOuterClass.DouyinWebcastSocialMessageMsg#getAction()}=1{@link tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.DouyinWebcastSocialMessageMsgOuterClass.DouyinWebcastSocialMessageMsg#getAction()}=3
*/
WebcastSocialMessage,
WebcastRoomUserSeqMessage,
/**
*
*/
WebcastFansclubMessage,
/**
*
*/
WebcastControlMessage,
;
public static DouyinCmdEnum getByName(String name) {
if (StrUtil.isBlank(name)) {
return null;
}
for (DouyinCmdEnum value : values()) {
if (value.name().equals(name)) {
return value;
}
}
return null;
}
}

@ -0,0 +1,65 @@
/*
* MIT License
*
* Copyright (c) 2023 OrdinaryRoad
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package tech.ordinaryroad.live.chat.client.codec.douyin.constant;
import cn.hutool.core.util.StrUtil;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
/**
* @author mjz
* @date 2024/3/10
*/
@Getter
@RequiredArgsConstructor
public enum DouyinPayloadTypeEnum {
/**
*
*/
HB("hb"),
/**
*
*/
MSG("msg"),
ACK("ack"),
;
private final String code;
public static DouyinPayloadTypeEnum getByCode(String code) {
if (StrUtil.isBlank(code)) {
return null;
}
for (DouyinPayloadTypeEnum value : values()) {
if (value.getCode().equals(code)) {
return value;
}
}
return null;
}
}

@ -0,0 +1,60 @@
/*
* MIT License
*
* Copyright (c) 2023 OrdinaryRoad
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package tech.ordinaryroad.live.chat.client.codec.douyin.constant;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
/**
* @author mjz
* @date 2024/3/10
*/
@Getter
@RequiredArgsConstructor
public enum DouyinRoomStatusEnum {
/**
*
*/
STOPPED(4),
/**
*
*/
LIVING(2),
;
private final int code;
public static DouyinRoomStatusEnum getByCode(int code) {
for (DouyinRoomStatusEnum value : values()) {
if (value.getCode() == code) {
return value;
}
}
return null;
}
}

@ -0,0 +1,68 @@
/*
* MIT License
*
* Copyright (c) 2023 OrdinaryRoad
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package tech.ordinaryroad.live.chat.client.codec.douyin.msg;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import tech.ordinaryroad.live.chat.client.codec.douyin.constant.DouyinCmdEnum;
import tech.ordinaryroad.live.chat.client.codec.douyin.msg.base.IDouyinCmdMsg;
import tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.DouyinCmdMsgOuterClass;
/**
* @author mjz
* @date 2024/4/26
*/
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class DouyinCmdMsg implements IDouyinCmdMsg {
private DouyinCmdMsgOuterClass.DouyinCmdMsg msg;
@Override
public String getCmd() {
if (msg == null) {
return null;
}
return msg.getMethod();
}
@Override
public void setCmd(String cmd) {
// ignore
// method_ = cmd;
}
@Override
public DouyinCmdEnum getCmdEnum() {
if (msg == null) {
return null;
}
return DouyinCmdEnum.getByName(msg.getMethod());
}
}

@ -0,0 +1,60 @@
/*
* MIT License
*
* Copyright (c) 2023 OrdinaryRoad
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package tech.ordinaryroad.live.chat.client.codec.douyin.msg;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import tech.ordinaryroad.live.chat.client.codec.douyin.msg.base.IDouyinMsg;
import tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.DouyinWebcastControlMessageMsgOuterClass;
import tech.ordinaryroad.live.chat.client.commons.base.constant.LiveStatusAction;
import tech.ordinaryroad.live.chat.client.commons.base.msg.ILiveStatusChangeMsg;
/**
* @author mjz
* @date 2024/3/10
*/
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class DouyinControlMsg implements IDouyinMsg, ILiveStatusChangeMsg {
private DouyinWebcastControlMessageMsgOuterClass.DouyinWebcastControlMessageMsg msg;
@Override
public LiveStatusAction getLiveStatusAction() {
if (msg.getStatus() == 3) {
return LiveStatusAction.END;
}
return null;
}
@Override
public String toString() {
return msg.toString();
}
}

@ -0,0 +1,82 @@
/*
* MIT License
*
* Copyright (c) 2023 OrdinaryRoad
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package tech.ordinaryroad.live.chat.client.codec.douyin.msg;
import cn.hutool.core.collection.CollUtil;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import tech.ordinaryroad.live.chat.client.codec.douyin.msg.base.IDouyinMsg;
import tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.DouyinWebcastChatMessageMsgOuterClass;
import tech.ordinaryroad.live.chat.client.commons.base.msg.IDanmuMsg;
/**
* @author mjz
* @date 2024/1/9
*/
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class DouyinDanmuMsg implements IDouyinMsg, IDanmuMsg {
private DouyinWebcastChatMessageMsgOuterClass.DouyinWebcastChatMessageMsg msg;
@Override
public String getBadgeName() {
return msg.getUser().getFansClub().getData().getClubName();
}
@Override
public byte getBadgeLevel() {
return (byte) msg.getUser().getFansClub().getData().getLevel();
}
@Override
public String getUid() {
return Long.toString(msg.getUser().getId());
}
@Override
public String getUsername() {
return msg.getUser().getNickname();
}
@Override
public String getUserAvatar() {
return CollUtil.getFirst(msg.getUser().getAvatarThumb().getUrlListListList());
}
@Override
public String getContent() {
return msg.getContent();
}
@Override
public String toString() {
return msg.toString();
}
}

@ -0,0 +1,77 @@
/*
* MIT License
*
* Copyright (c) 2023 OrdinaryRoad
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package tech.ordinaryroad.live.chat.client.codec.douyin.msg;
import cn.hutool.core.collection.CollUtil;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import tech.ordinaryroad.live.chat.client.codec.douyin.msg.base.IDouyinMsg;
import tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.DouyinWebcastMemberMessageMsgOuterClass;
import tech.ordinaryroad.live.chat.client.commons.base.msg.IEnterRoomMsg;
/**
* @author mjz
* @date 2024/1/9
*/
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class DouyinEnterRoomMsg implements IDouyinMsg, IEnterRoomMsg {
private DouyinWebcastMemberMessageMsgOuterClass.DouyinWebcastMemberMessageMsg msg;
@Override
public String getBadgeName() {
return msg.getUser().getFansClub().getData().getClubName();
}
@Override
public byte getBadgeLevel() {
return (byte) msg.getUser().getFansClub().getData().getLevel();
}
@Override
public String getUid() {
return Long.toString(msg.getUser().getId());
}
@Override
public String getUsername() {
return msg.getUser().getNickname();
}
@Override
public String getUserAvatar() {
return CollUtil.getFirst(msg.getUser().getAvatarThumb().getUrlListListList());
}
@Override
public String toString() {
return msg.toString();
}
}

@ -0,0 +1,120 @@
/*
* MIT License
*
* Copyright (c) 2023 OrdinaryRoad
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package tech.ordinaryroad.live.chat.client.codec.douyin.msg;
import cn.hutool.core.collection.CollUtil;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import tech.ordinaryroad.live.chat.client.codec.douyin.msg.base.IDouyinMsg;
import tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.DouyinWebcastGiftMessageMsgOuterClass;
import tech.ordinaryroad.live.chat.client.commons.base.msg.IGiftMsg;
/**
* @author mjz
* @date 2024/1/9
*/
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class DouyinGiftMsg implements IDouyinMsg, IGiftMsg {
private DouyinWebcastGiftMessageMsgOuterClass.DouyinWebcastGiftMessageMsg msg;
/**
*
*/
private int calculatedGiftCount;
public DouyinGiftMsg(DouyinWebcastGiftMessageMsgOuterClass.DouyinWebcastGiftMessageMsg msg) {
this.msg = msg;
}
@Override
public String getBadgeName() {
return msg.getUser().getFansClub().getData().getClubName();
}
@Override
public byte getBadgeLevel() {
return (byte) msg.getUser().getFansClub().getData().getLevel();
}
@Override
public String getUid() {
return Long.toString(msg.getUser().getId());
}
@Override
public String getUsername() {
return msg.getUser().getNickname();
}
@Override
public String getUserAvatar() {
return CollUtil.getFirst(msg.getUser().getAvatarThumb().getUrlListListList());
}
@Override
public String getGiftName() {
return msg.getGift().getName();
}
@Override
public String getGiftImg() {
return CollUtil.getFirst(msg.getGift().getImage().getUrlListListList());
}
@Override
public String getGiftId() {
return Long.toString(msg.getLongGiftId());
}
@Override
public int getGiftCount() {
return this.calculatedGiftCount;
}
@Override
public int getGiftPrice() {
return msg.getGift().getDiamondCount();
}
@Override
public String getReceiveUid() {
return Long.toString(msg.getToUser().getId());
}
@Override
public String getReceiveUsername() {
return msg.getToUser().getNickname();
}
@Override
public String toString() {
return msg.toString();
}
}

@ -0,0 +1,82 @@
/*
* MIT License
*
* Copyright (c) 2023 OrdinaryRoad
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package tech.ordinaryroad.live.chat.client.codec.douyin.msg;
import cn.hutool.core.collection.CollUtil;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import tech.ordinaryroad.live.chat.client.codec.douyin.msg.base.IDouyinMsg;
import tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.DouyinWebcastLikeMessageMsgOuterClass;
import tech.ordinaryroad.live.chat.client.commons.base.msg.ILikeMsg;
/**
* @author mjz
* @date 2024/1/31
*/
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class DouyinLikeMsg implements IDouyinMsg, ILikeMsg {
private DouyinWebcastLikeMessageMsgOuterClass.DouyinWebcastLikeMessageMsg msg;
@Override
public String getBadgeName() {
return msg.getUser().getFansClub().getData().getClubName();
}
@Override
public byte getBadgeLevel() {
return (byte) msg.getUser().getFansClub().getData().getLevel();
}
@Override
public String getUid() {
return Long.toString(msg.getUser().getId());
}
@Override
public String getUsername() {
return msg.getUser().getNickname();
}
@Override
public String getUserAvatar() {
return CollUtil.getFirst(msg.getUser().getAvatarThumb().getUrlListListList());
}
@Override
public int getClickCount() {
return (int) msg.getCount();
}
@Override
public String toString() {
return msg.toString();
}
}

@ -0,0 +1,46 @@
/*
* MIT License
*
* Copyright (c) 2023 OrdinaryRoad
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package tech.ordinaryroad.live.chat.client.codec.douyin.msg;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import tech.ordinaryroad.live.chat.client.codec.douyin.msg.base.IDouyinMsg;
import tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.DouyinWebsocketFrameOuterClass;
/**
* @author mjz
* @date 2024/4/26
*/
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class DouyinMsg implements IDouyinMsg {
private DouyinWebsocketFrameOuterClass.DouyinWebsocketFrame msg;
}

@ -0,0 +1,65 @@
/*
* MIT License
*
* Copyright (c) 2023 OrdinaryRoad
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package tech.ordinaryroad.live.chat.client.codec.douyin.msg;
import cn.hutool.core.util.NumberUtil;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import tech.ordinaryroad.live.chat.client.codec.douyin.msg.base.IDouyinMsg;
import tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.DouyinWebcastRoomStatsMessageMsgOuterClass;
import tech.ordinaryroad.live.chat.client.commons.base.msg.IRoomStatsMsg;
/**
* @author mjz
* @date 2024/3/28
*/
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class DouyinRoomStatsMsg implements IDouyinMsg, IRoomStatsMsg {
/**
* {@link tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.DouyinWebcastLikeMessageMsgOuterClass.DouyinWebcastLikeMessageMsg#getTotal()}
*/
private String likedCount;
private DouyinWebcastRoomStatsMessageMsgOuterClass.DouyinWebcastRoomStatsMessageMsg msg;
@Override
public String getLikedCount() {
return this.likedCount;
}
@Override
public String getWatchingCount() {
if (msg != null) {
return NumberUtil.toStr(msg.getTotal());
}
return null;
}
}

@ -0,0 +1,61 @@
/*
* MIT License
*
* Copyright (c) 2023 OrdinaryRoad
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package tech.ordinaryroad.live.chat.client.codec.douyin.msg;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import tech.ordinaryroad.live.chat.client.codec.douyin.constant.DouyinCmdEnum;
import tech.ordinaryroad.live.chat.client.codec.douyin.msg.base.IDouyinCmdMsg;
import tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.DouyinWebcastSocialMessageMsgOuterClass;
/**
* @author mjz
* @date 2024/3/28
*/
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class DouyinSocialMsg implements IDouyinCmdMsg {
private DouyinWebcastSocialMessageMsgOuterClass.DouyinWebcastSocialMessageMsg msg;
@Override
public String getCmd() {
return getCmdEnum().name();
}
@Override
public void setCmd(String cmd) {
// ignore
}
@Override
public DouyinCmdEnum getCmdEnum() {
return DouyinCmdEnum.WebcastSocialMessage;
}
}

@ -0,0 +1,35 @@
/*
* MIT License
*
* Copyright (c) 2023 OrdinaryRoad
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package tech.ordinaryroad.live.chat.client.codec.douyin.msg.base;
import tech.ordinaryroad.live.chat.client.codec.douyin.constant.DouyinCmdEnum;
import tech.ordinaryroad.live.chat.client.commons.base.msg.ICmdMsg;
/**
* @author mjz
* @date 2024/1/2
*/
public interface IDouyinCmdMsg extends IDouyinMsg, ICmdMsg<DouyinCmdEnum> {
}

@ -0,0 +1,34 @@
/*
* MIT License
*
* Copyright (c) 2023 OrdinaryRoad
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package tech.ordinaryroad.live.chat.client.codec.douyin.msg.base;
import tech.ordinaryroad.live.chat.client.commons.base.msg.IMsg;
/**
* @author mjz
* @date 2024/1/2
*/
public interface IDouyinMsg extends IMsg {
}

@ -0,0 +1,763 @@
/*
* MIT License
*
* Copyright (c) 2023 OrdinaryRoad
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: DouyinWebcastControlMessageMsg.proto
// Protobuf Java Version: 3.25.3
package tech.ordinaryroad.live.chat.client.codec.douyin.protobuf;
public final class DouyinWebcastControlMessageMsgOuterClass {
private DouyinWebcastControlMessageMsgOuterClass() {}
public static void registerAllExtensions(
com.google.protobuf.ExtensionRegistryLite registry) {
}
public static void registerAllExtensions(
com.google.protobuf.ExtensionRegistry registry) {
registerAllExtensions(
(com.google.protobuf.ExtensionRegistryLite) registry);
}
public interface DouyinWebcastControlMessageMsgOrBuilder extends
// @@protoc_insertion_point(interface_extends:tech.ordinaryroad.live.chat.client.douyin.protobuf.DouyinWebcastControlMessageMsg)
com.google.protobuf.MessageOrBuilder {
/**
* <code>.Common common = 1;</code>
* @return Whether the common field is set.
*/
boolean hasCommon();
/**
* <code>.Common common = 1;</code>
* @return The common.
*/
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.CommonOuterClass.Common getCommon();
/**
* <code>.Common common = 1;</code>
*/
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.CommonOuterClass.CommonOrBuilder getCommonOrBuilder();
/**
* <code>int32 status = 2;</code>
* @return The status.
*/
int getStatus();
}
/**
* Protobuf type {@code tech.ordinaryroad.live.chat.client.douyin.protobuf.DouyinWebcastControlMessageMsg}
*/
public static final class DouyinWebcastControlMessageMsg extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:tech.ordinaryroad.live.chat.client.douyin.protobuf.DouyinWebcastControlMessageMsg)
DouyinWebcastControlMessageMsgOrBuilder {
private static final long serialVersionUID = 0L;
// Use DouyinWebcastControlMessageMsg.newBuilder() to construct.
private DouyinWebcastControlMessageMsg(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
super(builder);
}
private DouyinWebcastControlMessageMsg() {
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(
UnusedPrivateParameter unused) {
return new DouyinWebcastControlMessageMsg();
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.DouyinWebcastControlMessageMsgOuterClass.internal_static_tech_ordinaryroad_live_chat_client_douyin_protobuf_DouyinWebcastControlMessageMsg_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.DouyinWebcastControlMessageMsgOuterClass.internal_static_tech_ordinaryroad_live_chat_client_douyin_protobuf_DouyinWebcastControlMessageMsg_fieldAccessorTable
.ensureFieldAccessorsInitialized(
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.DouyinWebcastControlMessageMsgOuterClass.DouyinWebcastControlMessageMsg.class, tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.DouyinWebcastControlMessageMsgOuterClass.DouyinWebcastControlMessageMsg.Builder.class);
}
private int bitField0_;
public static final int COMMON_FIELD_NUMBER = 1;
private tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.CommonOuterClass.Common common_;
/**
* <code>.Common common = 1;</code>
* @return Whether the common field is set.
*/
@java.lang.Override
public boolean hasCommon() {
return ((bitField0_ & 0x00000001) != 0);
}
/**
* <code>.Common common = 1;</code>
* @return The common.
*/
@java.lang.Override
public tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.CommonOuterClass.Common getCommon() {
return common_ == null ? tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.CommonOuterClass.Common.getDefaultInstance() : common_;
}
/**
* <code>.Common common = 1;</code>
*/
@java.lang.Override
public tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.CommonOuterClass.CommonOrBuilder getCommonOrBuilder() {
return common_ == null ? tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.CommonOuterClass.Common.getDefaultInstance() : common_;
}
public static final int STATUS_FIELD_NUMBER = 2;
private int status_ = 0;
/**
* <code>int32 status = 2;</code>
* @return The status.
*/
@java.lang.Override
public int getStatus() {
return status_;
}
private byte memoizedIsInitialized = -1;
@java.lang.Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
if (((bitField0_ & 0x00000001) != 0)) {
output.writeMessage(1, getCommon());
}
if (status_ != 0) {
output.writeInt32(2, status_);
}
getUnknownFields().writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (((bitField0_ & 0x00000001) != 0)) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(1, getCommon());
}
if (status_ != 0) {
size += com.google.protobuf.CodedOutputStream
.computeInt32Size(2, status_);
}
size += getUnknownFields().getSerializedSize();
memoizedSize = size;
return size;
}
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.DouyinWebcastControlMessageMsgOuterClass.DouyinWebcastControlMessageMsg)) {
return super.equals(obj);
}
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.DouyinWebcastControlMessageMsgOuterClass.DouyinWebcastControlMessageMsg other = (tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.DouyinWebcastControlMessageMsgOuterClass.DouyinWebcastControlMessageMsg) obj;
if (hasCommon() != other.hasCommon()) return false;
if (hasCommon()) {
if (!getCommon()
.equals(other.getCommon())) return false;
}
if (getStatus()
!= other.getStatus()) return false;
if (!getUnknownFields().equals(other.getUnknownFields())) return false;
return true;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
if (hasCommon()) {
hash = (37 * hash) + COMMON_FIELD_NUMBER;
hash = (53 * hash) + getCommon().hashCode();
}
hash = (37 * hash) + STATUS_FIELD_NUMBER;
hash = (53 * hash) + getStatus();
hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.DouyinWebcastControlMessageMsgOuterClass.DouyinWebcastControlMessageMsg parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.DouyinWebcastControlMessageMsgOuterClass.DouyinWebcastControlMessageMsg parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.DouyinWebcastControlMessageMsgOuterClass.DouyinWebcastControlMessageMsg parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.DouyinWebcastControlMessageMsgOuterClass.DouyinWebcastControlMessageMsg parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.DouyinWebcastControlMessageMsgOuterClass.DouyinWebcastControlMessageMsg parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.DouyinWebcastControlMessageMsgOuterClass.DouyinWebcastControlMessageMsg parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.DouyinWebcastControlMessageMsgOuterClass.DouyinWebcastControlMessageMsg parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.DouyinWebcastControlMessageMsgOuterClass.DouyinWebcastControlMessageMsg parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.DouyinWebcastControlMessageMsgOuterClass.DouyinWebcastControlMessageMsg parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.DouyinWebcastControlMessageMsgOuterClass.DouyinWebcastControlMessageMsg parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.DouyinWebcastControlMessageMsgOuterClass.DouyinWebcastControlMessageMsg parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.DouyinWebcastControlMessageMsgOuterClass.DouyinWebcastControlMessageMsg parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
@java.lang.Override
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.DouyinWebcastControlMessageMsgOuterClass.DouyinWebcastControlMessageMsg prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@java.lang.Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* Protobuf type {@code tech.ordinaryroad.live.chat.client.douyin.protobuf.DouyinWebcastControlMessageMsg}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
// @@protoc_insertion_point(builder_implements:tech.ordinaryroad.live.chat.client.douyin.protobuf.DouyinWebcastControlMessageMsg)
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.DouyinWebcastControlMessageMsgOuterClass.DouyinWebcastControlMessageMsgOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.DouyinWebcastControlMessageMsgOuterClass.internal_static_tech_ordinaryroad_live_chat_client_douyin_protobuf_DouyinWebcastControlMessageMsg_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.DouyinWebcastControlMessageMsgOuterClass.internal_static_tech_ordinaryroad_live_chat_client_douyin_protobuf_DouyinWebcastControlMessageMsg_fieldAccessorTable
.ensureFieldAccessorsInitialized(
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.DouyinWebcastControlMessageMsgOuterClass.DouyinWebcastControlMessageMsg.class, tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.DouyinWebcastControlMessageMsgOuterClass.DouyinWebcastControlMessageMsg.Builder.class);
}
// Construct using tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.DouyinWebcastControlMessageMsgOuterClass.DouyinWebcastControlMessageMsg.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
getCommonFieldBuilder();
}
}
@java.lang.Override
public Builder clear() {
super.clear();
bitField0_ = 0;
common_ = null;
if (commonBuilder_ != null) {
commonBuilder_.dispose();
commonBuilder_ = null;
}
status_ = 0;
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.DouyinWebcastControlMessageMsgOuterClass.internal_static_tech_ordinaryroad_live_chat_client_douyin_protobuf_DouyinWebcastControlMessageMsg_descriptor;
}
@java.lang.Override
public tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.DouyinWebcastControlMessageMsgOuterClass.DouyinWebcastControlMessageMsg getDefaultInstanceForType() {
return tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.DouyinWebcastControlMessageMsgOuterClass.DouyinWebcastControlMessageMsg.getDefaultInstance();
}
@java.lang.Override
public tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.DouyinWebcastControlMessageMsgOuterClass.DouyinWebcastControlMessageMsg build() {
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.DouyinWebcastControlMessageMsgOuterClass.DouyinWebcastControlMessageMsg result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.DouyinWebcastControlMessageMsgOuterClass.DouyinWebcastControlMessageMsg buildPartial() {
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.DouyinWebcastControlMessageMsgOuterClass.DouyinWebcastControlMessageMsg result = new tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.DouyinWebcastControlMessageMsgOuterClass.DouyinWebcastControlMessageMsg(this);
if (bitField0_ != 0) { buildPartial0(result); }
onBuilt();
return result;
}
private void buildPartial0(tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.DouyinWebcastControlMessageMsgOuterClass.DouyinWebcastControlMessageMsg result) {
int from_bitField0_ = bitField0_;
int to_bitField0_ = 0;
if (((from_bitField0_ & 0x00000001) != 0)) {
result.common_ = commonBuilder_ == null
? common_
: commonBuilder_.build();
to_bitField0_ |= 0x00000001;
}
if (((from_bitField0_ & 0x00000002) != 0)) {
result.status_ = status_;
}
result.bitField0_ |= to_bitField0_;
}
@java.lang.Override
public Builder clone() {
return super.clone();
}
@java.lang.Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.setField(field, value);
}
@java.lang.Override
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, java.lang.Object value) {
return super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.addRepeatedField(field, value);
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.DouyinWebcastControlMessageMsgOuterClass.DouyinWebcastControlMessageMsg) {
return mergeFrom((tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.DouyinWebcastControlMessageMsgOuterClass.DouyinWebcastControlMessageMsg)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.DouyinWebcastControlMessageMsgOuterClass.DouyinWebcastControlMessageMsg other) {
if (other == tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.DouyinWebcastControlMessageMsgOuterClass.DouyinWebcastControlMessageMsg.getDefaultInstance()) return this;
if (other.hasCommon()) {
mergeCommon(other.getCommon());
}
if (other.getStatus() != 0) {
setStatus(other.getStatus());
}
this.mergeUnknownFields(other.getUnknownFields());
onChanged();
return this;
}
@java.lang.Override
public final boolean isInitialized() {
return true;
}
@java.lang.Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 10: {
input.readMessage(
getCommonFieldBuilder().getBuilder(),
extensionRegistry);
bitField0_ |= 0x00000001;
break;
} // case 10
case 16: {
status_ = input.readInt32();
bitField0_ |= 0x00000002;
break;
} // case 16
default: {
if (!super.parseUnknownField(input, extensionRegistry, tag)) {
done = true; // was an endgroup tag
}
break;
} // default:
} // switch (tag)
} // while (!done)
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.unwrapIOException();
} finally {
onChanged();
} // finally
return this;
}
private int bitField0_;
private tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.CommonOuterClass.Common common_;
private com.google.protobuf.SingleFieldBuilderV3<
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.CommonOuterClass.Common, tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.CommonOuterClass.Common.Builder, tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.CommonOuterClass.CommonOrBuilder> commonBuilder_;
/**
* <code>.Common common = 1;</code>
* @return Whether the common field is set.
*/
public boolean hasCommon() {
return ((bitField0_ & 0x00000001) != 0);
}
/**
* <code>.Common common = 1;</code>
* @return The common.
*/
public tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.CommonOuterClass.Common getCommon() {
if (commonBuilder_ == null) {
return common_ == null ? tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.CommonOuterClass.Common.getDefaultInstance() : common_;
} else {
return commonBuilder_.getMessage();
}
}
/**
* <code>.Common common = 1;</code>
*/
public Builder setCommon(tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.CommonOuterClass.Common value) {
if (commonBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
common_ = value;
} else {
commonBuilder_.setMessage(value);
}
bitField0_ |= 0x00000001;
onChanged();
return this;
}
/**
* <code>.Common common = 1;</code>
*/
public Builder setCommon(
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.CommonOuterClass.Common.Builder builderForValue) {
if (commonBuilder_ == null) {
common_ = builderForValue.build();
} else {
commonBuilder_.setMessage(builderForValue.build());
}
bitField0_ |= 0x00000001;
onChanged();
return this;
}
/**
* <code>.Common common = 1;</code>
*/
public Builder mergeCommon(tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.CommonOuterClass.Common value) {
if (commonBuilder_ == null) {
if (((bitField0_ & 0x00000001) != 0) &&
common_ != null &&
common_ != tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.CommonOuterClass.Common.getDefaultInstance()) {
getCommonBuilder().mergeFrom(value);
} else {
common_ = value;
}
} else {
commonBuilder_.mergeFrom(value);
}
if (common_ != null) {
bitField0_ |= 0x00000001;
onChanged();
}
return this;
}
/**
* <code>.Common common = 1;</code>
*/
public Builder clearCommon() {
bitField0_ = (bitField0_ & ~0x00000001);
common_ = null;
if (commonBuilder_ != null) {
commonBuilder_.dispose();
commonBuilder_ = null;
}
onChanged();
return this;
}
/**
* <code>.Common common = 1;</code>
*/
public tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.CommonOuterClass.Common.Builder getCommonBuilder() {
bitField0_ |= 0x00000001;
onChanged();
return getCommonFieldBuilder().getBuilder();
}
/**
* <code>.Common common = 1;</code>
*/
public tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.CommonOuterClass.CommonOrBuilder getCommonOrBuilder() {
if (commonBuilder_ != null) {
return commonBuilder_.getMessageOrBuilder();
} else {
return common_ == null ?
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.CommonOuterClass.Common.getDefaultInstance() : common_;
}
}
/**
* <code>.Common common = 1;</code>
*/
private com.google.protobuf.SingleFieldBuilderV3<
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.CommonOuterClass.Common, tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.CommonOuterClass.Common.Builder, tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.CommonOuterClass.CommonOrBuilder>
getCommonFieldBuilder() {
if (commonBuilder_ == null) {
commonBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.CommonOuterClass.Common, tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.CommonOuterClass.Common.Builder, tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.CommonOuterClass.CommonOrBuilder>(
getCommon(),
getParentForChildren(),
isClean());
common_ = null;
}
return commonBuilder_;
}
private int status_ ;
/**
* <code>int32 status = 2;</code>
* @return The status.
*/
@java.lang.Override
public int getStatus() {
return status_;
}
/**
* <code>int32 status = 2;</code>
* @param value The status to set.
* @return This builder for chaining.
*/
public Builder setStatus(int value) {
status_ = value;
bitField0_ |= 0x00000002;
onChanged();
return this;
}
/**
* <code>int32 status = 2;</code>
* @return This builder for chaining.
*/
public Builder clearStatus() {
bitField0_ = (bitField0_ & ~0x00000002);
status_ = 0;
onChanged();
return this;
}
@java.lang.Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@java.lang.Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:tech.ordinaryroad.live.chat.client.douyin.protobuf.DouyinWebcastControlMessageMsg)
}
// @@protoc_insertion_point(class_scope:tech.ordinaryroad.live.chat.client.douyin.protobuf.DouyinWebcastControlMessageMsg)
private static final tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.DouyinWebcastControlMessageMsgOuterClass.DouyinWebcastControlMessageMsg DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.DouyinWebcastControlMessageMsgOuterClass.DouyinWebcastControlMessageMsg();
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.DouyinWebcastControlMessageMsgOuterClass.DouyinWebcastControlMessageMsg getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser<DouyinWebcastControlMessageMsg>
PARSER = new com.google.protobuf.AbstractParser<DouyinWebcastControlMessageMsg>() {
@java.lang.Override
public DouyinWebcastControlMessageMsg parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
Builder builder = newBuilder();
try {
builder.mergeFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(builder.buildPartial());
} catch (com.google.protobuf.UninitializedMessageException e) {
throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(e)
.setUnfinishedMessage(builder.buildPartial());
}
return builder.buildPartial();
}
};
public static com.google.protobuf.Parser<DouyinWebcastControlMessageMsg> parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser<DouyinWebcastControlMessageMsg> getParserForType() {
return PARSER;
}
@java.lang.Override
public tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.DouyinWebcastControlMessageMsgOuterClass.DouyinWebcastControlMessageMsg getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
private static final com.google.protobuf.Descriptors.Descriptor
internal_static_tech_ordinaryroad_live_chat_client_douyin_protobuf_DouyinWebcastControlMessageMsg_descriptor;
private static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_tech_ordinaryroad_live_chat_client_douyin_protobuf_DouyinWebcastControlMessageMsg_fieldAccessorTable;
public static com.google.protobuf.Descriptors.FileDescriptor
getDescriptor() {
return descriptor;
}
private static com.google.protobuf.Descriptors.FileDescriptor
descriptor;
static {
java.lang.String[] descriptorData = {
"\n$DouyinWebcastControlMessageMsg.proto\0222" +
"tech.ordinaryroad.live.chat.client.douyi" +
"n.protobuf\032\014Common.proto\"I\n\036DouyinWebcas" +
"tControlMessageMsg\022\027\n\006common\030\001 \001(\0132\007.Com" +
"mon\022\016\n\006status\030\002 \001(\005B:\n8tech.ordinaryroad" +
".live.chat.client.codec.douyin.protobufb" +
"\006proto3"
};
descriptor = com.google.protobuf.Descriptors.FileDescriptor
.internalBuildGeneratedFileFrom(descriptorData,
new com.google.protobuf.Descriptors.FileDescriptor[] {
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.CommonOuterClass.getDescriptor(),
});
internal_static_tech_ordinaryroad_live_chat_client_douyin_protobuf_DouyinWebcastControlMessageMsg_descriptor =
getDescriptor().getMessageTypes().get(0);
internal_static_tech_ordinaryroad_live_chat_client_douyin_protobuf_DouyinWebcastControlMessageMsg_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_tech_ordinaryroad_live_chat_client_douyin_protobuf_DouyinWebcastControlMessageMsg_descriptor,
new java.lang.String[] { "Common", "Status", });
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.CommonOuterClass.getDescriptor();
}
// @@protoc_insertion_point(outer_class_scope)
}

@ -0,0 +1,768 @@
/*
* MIT License
*
* Copyright (c) 2023 OrdinaryRoad
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: DoubleLikeDetail.proto
// Protobuf Java Version: 3.25.3
package tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto;
public final class DoubleLikeDetailOuterClass {
private DoubleLikeDetailOuterClass() {}
public static void registerAllExtensions(
com.google.protobuf.ExtensionRegistryLite registry) {
}
public static void registerAllExtensions(
com.google.protobuf.ExtensionRegistry registry) {
registerAllExtensions(
(com.google.protobuf.ExtensionRegistryLite) registry);
}
public interface DoubleLikeDetailOrBuilder extends
// @@protoc_insertion_point(interface_extends:DoubleLikeDetail)
com.google.protobuf.MessageOrBuilder {
/**
* <code>bool doubleFlag = 1;</code>
* @return The doubleFlag.
*/
boolean getDoubleFlag();
/**
* <code>uint32 seqId = 2;</code>
* @return The seqId.
*/
int getSeqId();
/**
* <code>uint32 renewalsNum = 3;</code>
* @return The renewalsNum.
*/
int getRenewalsNum();
/**
* <code>uint32 triggersNum = 4;</code>
* @return The triggersNum.
*/
int getTriggersNum();
}
/**
* Protobuf type {@code DoubleLikeDetail}
*/
public static final class DoubleLikeDetail extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:DoubleLikeDetail)
DoubleLikeDetailOrBuilder {
private static final long serialVersionUID = 0L;
// Use DoubleLikeDetail.newBuilder() to construct.
private DoubleLikeDetail(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
super(builder);
}
private DoubleLikeDetail() {
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(
UnusedPrivateParameter unused) {
return new DoubleLikeDetail();
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.DoubleLikeDetailOuterClass.internal_static_DoubleLikeDetail_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.DoubleLikeDetailOuterClass.internal_static_DoubleLikeDetail_fieldAccessorTable
.ensureFieldAccessorsInitialized(
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.DoubleLikeDetailOuterClass.DoubleLikeDetail.class, tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.DoubleLikeDetailOuterClass.DoubleLikeDetail.Builder.class);
}
public static final int DOUBLEFLAG_FIELD_NUMBER = 1;
private boolean doubleFlag_ = false;
/**
* <code>bool doubleFlag = 1;</code>
* @return The doubleFlag.
*/
@java.lang.Override
public boolean getDoubleFlag() {
return doubleFlag_;
}
public static final int SEQID_FIELD_NUMBER = 2;
private int seqId_ = 0;
/**
* <code>uint32 seqId = 2;</code>
* @return The seqId.
*/
@java.lang.Override
public int getSeqId() {
return seqId_;
}
public static final int RENEWALSNUM_FIELD_NUMBER = 3;
private int renewalsNum_ = 0;
/**
* <code>uint32 renewalsNum = 3;</code>
* @return The renewalsNum.
*/
@java.lang.Override
public int getRenewalsNum() {
return renewalsNum_;
}
public static final int TRIGGERSNUM_FIELD_NUMBER = 4;
private int triggersNum_ = 0;
/**
* <code>uint32 triggersNum = 4;</code>
* @return The triggersNum.
*/
@java.lang.Override
public int getTriggersNum() {
return triggersNum_;
}
private byte memoizedIsInitialized = -1;
@java.lang.Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
if (doubleFlag_ != false) {
output.writeBool(1, doubleFlag_);
}
if (seqId_ != 0) {
output.writeUInt32(2, seqId_);
}
if (renewalsNum_ != 0) {
output.writeUInt32(3, renewalsNum_);
}
if (triggersNum_ != 0) {
output.writeUInt32(4, triggersNum_);
}
getUnknownFields().writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (doubleFlag_ != false) {
size += com.google.protobuf.CodedOutputStream
.computeBoolSize(1, doubleFlag_);
}
if (seqId_ != 0) {
size += com.google.protobuf.CodedOutputStream
.computeUInt32Size(2, seqId_);
}
if (renewalsNum_ != 0) {
size += com.google.protobuf.CodedOutputStream
.computeUInt32Size(3, renewalsNum_);
}
if (triggersNum_ != 0) {
size += com.google.protobuf.CodedOutputStream
.computeUInt32Size(4, triggersNum_);
}
size += getUnknownFields().getSerializedSize();
memoizedSize = size;
return size;
}
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.DoubleLikeDetailOuterClass.DoubleLikeDetail)) {
return super.equals(obj);
}
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.DoubleLikeDetailOuterClass.DoubleLikeDetail other = (tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.DoubleLikeDetailOuterClass.DoubleLikeDetail) obj;
if (getDoubleFlag()
!= other.getDoubleFlag()) return false;
if (getSeqId()
!= other.getSeqId()) return false;
if (getRenewalsNum()
!= other.getRenewalsNum()) return false;
if (getTriggersNum()
!= other.getTriggersNum()) return false;
if (!getUnknownFields().equals(other.getUnknownFields())) return false;
return true;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
hash = (37 * hash) + DOUBLEFLAG_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(
getDoubleFlag());
hash = (37 * hash) + SEQID_FIELD_NUMBER;
hash = (53 * hash) + getSeqId();
hash = (37 * hash) + RENEWALSNUM_FIELD_NUMBER;
hash = (53 * hash) + getRenewalsNum();
hash = (37 * hash) + TRIGGERSNUM_FIELD_NUMBER;
hash = (53 * hash) + getTriggersNum();
hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.DoubleLikeDetailOuterClass.DoubleLikeDetail parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.DoubleLikeDetailOuterClass.DoubleLikeDetail parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.DoubleLikeDetailOuterClass.DoubleLikeDetail parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.DoubleLikeDetailOuterClass.DoubleLikeDetail parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.DoubleLikeDetailOuterClass.DoubleLikeDetail parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.DoubleLikeDetailOuterClass.DoubleLikeDetail parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.DoubleLikeDetailOuterClass.DoubleLikeDetail parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.DoubleLikeDetailOuterClass.DoubleLikeDetail parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.DoubleLikeDetailOuterClass.DoubleLikeDetail parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.DoubleLikeDetailOuterClass.DoubleLikeDetail parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.DoubleLikeDetailOuterClass.DoubleLikeDetail parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.DoubleLikeDetailOuterClass.DoubleLikeDetail parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
@java.lang.Override
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.DoubleLikeDetailOuterClass.DoubleLikeDetail prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@java.lang.Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* Protobuf type {@code DoubleLikeDetail}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
// @@protoc_insertion_point(builder_implements:DoubleLikeDetail)
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.DoubleLikeDetailOuterClass.DoubleLikeDetailOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.DoubleLikeDetailOuterClass.internal_static_DoubleLikeDetail_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.DoubleLikeDetailOuterClass.internal_static_DoubleLikeDetail_fieldAccessorTable
.ensureFieldAccessorsInitialized(
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.DoubleLikeDetailOuterClass.DoubleLikeDetail.class, tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.DoubleLikeDetailOuterClass.DoubleLikeDetail.Builder.class);
}
// Construct using tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.DoubleLikeDetailOuterClass.DoubleLikeDetail.newBuilder()
private Builder() {
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
}
@java.lang.Override
public Builder clear() {
super.clear();
bitField0_ = 0;
doubleFlag_ = false;
seqId_ = 0;
renewalsNum_ = 0;
triggersNum_ = 0;
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.DoubleLikeDetailOuterClass.internal_static_DoubleLikeDetail_descriptor;
}
@java.lang.Override
public tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.DoubleLikeDetailOuterClass.DoubleLikeDetail getDefaultInstanceForType() {
return tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.DoubleLikeDetailOuterClass.DoubleLikeDetail.getDefaultInstance();
}
@java.lang.Override
public tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.DoubleLikeDetailOuterClass.DoubleLikeDetail build() {
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.DoubleLikeDetailOuterClass.DoubleLikeDetail result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.DoubleLikeDetailOuterClass.DoubleLikeDetail buildPartial() {
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.DoubleLikeDetailOuterClass.DoubleLikeDetail result = new tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.DoubleLikeDetailOuterClass.DoubleLikeDetail(this);
if (bitField0_ != 0) { buildPartial0(result); }
onBuilt();
return result;
}
private void buildPartial0(tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.DoubleLikeDetailOuterClass.DoubleLikeDetail result) {
int from_bitField0_ = bitField0_;
if (((from_bitField0_ & 0x00000001) != 0)) {
result.doubleFlag_ = doubleFlag_;
}
if (((from_bitField0_ & 0x00000002) != 0)) {
result.seqId_ = seqId_;
}
if (((from_bitField0_ & 0x00000004) != 0)) {
result.renewalsNum_ = renewalsNum_;
}
if (((from_bitField0_ & 0x00000008) != 0)) {
result.triggersNum_ = triggersNum_;
}
}
@java.lang.Override
public Builder clone() {
return super.clone();
}
@java.lang.Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.setField(field, value);
}
@java.lang.Override
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, java.lang.Object value) {
return super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.addRepeatedField(field, value);
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.DoubleLikeDetailOuterClass.DoubleLikeDetail) {
return mergeFrom((tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.DoubleLikeDetailOuterClass.DoubleLikeDetail)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.DoubleLikeDetailOuterClass.DoubleLikeDetail other) {
if (other == tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.DoubleLikeDetailOuterClass.DoubleLikeDetail.getDefaultInstance()) return this;
if (other.getDoubleFlag() != false) {
setDoubleFlag(other.getDoubleFlag());
}
if (other.getSeqId() != 0) {
setSeqId(other.getSeqId());
}
if (other.getRenewalsNum() != 0) {
setRenewalsNum(other.getRenewalsNum());
}
if (other.getTriggersNum() != 0) {
setTriggersNum(other.getTriggersNum());
}
this.mergeUnknownFields(other.getUnknownFields());
onChanged();
return this;
}
@java.lang.Override
public final boolean isInitialized() {
return true;
}
@java.lang.Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 8: {
doubleFlag_ = input.readBool();
bitField0_ |= 0x00000001;
break;
} // case 8
case 16: {
seqId_ = input.readUInt32();
bitField0_ |= 0x00000002;
break;
} // case 16
case 24: {
renewalsNum_ = input.readUInt32();
bitField0_ |= 0x00000004;
break;
} // case 24
case 32: {
triggersNum_ = input.readUInt32();
bitField0_ |= 0x00000008;
break;
} // case 32
default: {
if (!super.parseUnknownField(input, extensionRegistry, tag)) {
done = true; // was an endgroup tag
}
break;
} // default:
} // switch (tag)
} // while (!done)
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.unwrapIOException();
} finally {
onChanged();
} // finally
return this;
}
private int bitField0_;
private boolean doubleFlag_ ;
/**
* <code>bool doubleFlag = 1;</code>
* @return The doubleFlag.
*/
@java.lang.Override
public boolean getDoubleFlag() {
return doubleFlag_;
}
/**
* <code>bool doubleFlag = 1;</code>
* @param value The doubleFlag to set.
* @return This builder for chaining.
*/
public Builder setDoubleFlag(boolean value) {
doubleFlag_ = value;
bitField0_ |= 0x00000001;
onChanged();
return this;
}
/**
* <code>bool doubleFlag = 1;</code>
* @return This builder for chaining.
*/
public Builder clearDoubleFlag() {
bitField0_ = (bitField0_ & ~0x00000001);
doubleFlag_ = false;
onChanged();
return this;
}
private int seqId_ ;
/**
* <code>uint32 seqId = 2;</code>
* @return The seqId.
*/
@java.lang.Override
public int getSeqId() {
return seqId_;
}
/**
* <code>uint32 seqId = 2;</code>
* @param value The seqId to set.
* @return This builder for chaining.
*/
public Builder setSeqId(int value) {
seqId_ = value;
bitField0_ |= 0x00000002;
onChanged();
return this;
}
/**
* <code>uint32 seqId = 2;</code>
* @return This builder for chaining.
*/
public Builder clearSeqId() {
bitField0_ = (bitField0_ & ~0x00000002);
seqId_ = 0;
onChanged();
return this;
}
private int renewalsNum_ ;
/**
* <code>uint32 renewalsNum = 3;</code>
* @return The renewalsNum.
*/
@java.lang.Override
public int getRenewalsNum() {
return renewalsNum_;
}
/**
* <code>uint32 renewalsNum = 3;</code>
* @param value The renewalsNum to set.
* @return This builder for chaining.
*/
public Builder setRenewalsNum(int value) {
renewalsNum_ = value;
bitField0_ |= 0x00000004;
onChanged();
return this;
}
/**
* <code>uint32 renewalsNum = 3;</code>
* @return This builder for chaining.
*/
public Builder clearRenewalsNum() {
bitField0_ = (bitField0_ & ~0x00000004);
renewalsNum_ = 0;
onChanged();
return this;
}
private int triggersNum_ ;
/**
* <code>uint32 triggersNum = 4;</code>
* @return The triggersNum.
*/
@java.lang.Override
public int getTriggersNum() {
return triggersNum_;
}
/**
* <code>uint32 triggersNum = 4;</code>
* @param value The triggersNum to set.
* @return This builder for chaining.
*/
public Builder setTriggersNum(int value) {
triggersNum_ = value;
bitField0_ |= 0x00000008;
onChanged();
return this;
}
/**
* <code>uint32 triggersNum = 4;</code>
* @return This builder for chaining.
*/
public Builder clearTriggersNum() {
bitField0_ = (bitField0_ & ~0x00000008);
triggersNum_ = 0;
onChanged();
return this;
}
@java.lang.Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@java.lang.Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:DoubleLikeDetail)
}
// @@protoc_insertion_point(class_scope:DoubleLikeDetail)
private static final tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.DoubleLikeDetailOuterClass.DoubleLikeDetail DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.DoubleLikeDetailOuterClass.DoubleLikeDetail();
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.DoubleLikeDetailOuterClass.DoubleLikeDetail getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser<DoubleLikeDetail>
PARSER = new com.google.protobuf.AbstractParser<DoubleLikeDetail>() {
@java.lang.Override
public DoubleLikeDetail parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
Builder builder = newBuilder();
try {
builder.mergeFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(builder.buildPartial());
} catch (com.google.protobuf.UninitializedMessageException e) {
throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(e)
.setUnfinishedMessage(builder.buildPartial());
}
return builder.buildPartial();
}
};
public static com.google.protobuf.Parser<DoubleLikeDetail> parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser<DoubleLikeDetail> getParserForType() {
return PARSER;
}
@java.lang.Override
public tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.DoubleLikeDetailOuterClass.DoubleLikeDetail getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
private static final com.google.protobuf.Descriptors.Descriptor
internal_static_DoubleLikeDetail_descriptor;
private static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_DoubleLikeDetail_fieldAccessorTable;
public static com.google.protobuf.Descriptors.FileDescriptor
getDescriptor() {
return descriptor;
}
private static com.google.protobuf.Descriptors.FileDescriptor
descriptor;
static {
java.lang.String[] descriptorData = {
"\n\026DoubleLikeDetail.proto\"_\n\020DoubleLikeDe" +
"tail\022\022\n\ndoubleFlag\030\001 \001(\010\022\r\n\005seqId\030\002 \001(\r\022" +
"\023\n\013renewalsNum\030\003 \001(\r\022\023\n\013triggersNum\030\004 \001(" +
"\rB>\n<tech.ordinaryroad.live.chat.client." +
"codec.douyin.protobuf.dtob\006proto3"
};
descriptor = com.google.protobuf.Descriptors.FileDescriptor
.internalBuildGeneratedFileFrom(descriptorData,
new com.google.protobuf.Descriptors.FileDescriptor[] {
});
internal_static_DoubleLikeDetail_descriptor =
getDescriptor().getMessageTypes().get(0);
internal_static_DoubleLikeDetail_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_DoubleLikeDetail_descriptor,
new java.lang.String[] { "DoubleFlag", "SeqId", "RenewalsNum", "TriggersNum", });
}
// @@protoc_insertion_point(outer_class_scope)
}

@ -0,0 +1,817 @@
/*
* MIT License
*
* Copyright (c) 2023 OrdinaryRoad
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: GiftIMPriority.proto
// Protobuf Java Version: 3.25.3
package tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto;
public final class GiftIMPriorityOuterClass {
private GiftIMPriorityOuterClass() {}
public static void registerAllExtensions(
com.google.protobuf.ExtensionRegistryLite registry) {
}
public static void registerAllExtensions(
com.google.protobuf.ExtensionRegistry registry) {
registerAllExtensions(
(com.google.protobuf.ExtensionRegistryLite) registry);
}
public interface GiftIMPriorityOrBuilder extends
// @@protoc_insertion_point(interface_extends:GiftIMPriority)
com.google.protobuf.MessageOrBuilder {
/**
* <code>repeated uint64 queue_sizes_list = 1;</code>
* @return A list containing the queueSizesList.
*/
java.util.List<java.lang.Long> getQueueSizesListList();
/**
* <code>repeated uint64 queue_sizes_list = 1;</code>
* @return The count of queueSizesList.
*/
int getQueueSizesListCount();
/**
* <code>repeated uint64 queue_sizes_list = 1;</code>
* @param index The index of the element to return.
* @return The queueSizesList at the given index.
*/
long getQueueSizesList(int index);
/**
* <code>uint64 self_queue_priority = 2;</code>
* @return The selfQueuePriority.
*/
long getSelfQueuePriority();
/**
* <code>uint64 priority = 3;</code>
* @return The priority.
*/
long getPriority();
}
/**
* Protobuf type {@code GiftIMPriority}
*/
public static final class GiftIMPriority extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:GiftIMPriority)
GiftIMPriorityOrBuilder {
private static final long serialVersionUID = 0L;
// Use GiftIMPriority.newBuilder() to construct.
private GiftIMPriority(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
super(builder);
}
private GiftIMPriority() {
queueSizesList_ = emptyLongList();
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(
UnusedPrivateParameter unused) {
return new GiftIMPriority();
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.GiftIMPriorityOuterClass.internal_static_GiftIMPriority_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.GiftIMPriorityOuterClass.internal_static_GiftIMPriority_fieldAccessorTable
.ensureFieldAccessorsInitialized(
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.GiftIMPriorityOuterClass.GiftIMPriority.class, tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.GiftIMPriorityOuterClass.GiftIMPriority.Builder.class);
}
public static final int QUEUE_SIZES_LIST_FIELD_NUMBER = 1;
@SuppressWarnings("serial")
private com.google.protobuf.Internal.LongList queueSizesList_ =
emptyLongList();
/**
* <code>repeated uint64 queue_sizes_list = 1;</code>
* @return A list containing the queueSizesList.
*/
@java.lang.Override
public java.util.List<java.lang.Long>
getQueueSizesListList() {
return queueSizesList_;
}
/**
* <code>repeated uint64 queue_sizes_list = 1;</code>
* @return The count of queueSizesList.
*/
public int getQueueSizesListCount() {
return queueSizesList_.size();
}
/**
* <code>repeated uint64 queue_sizes_list = 1;</code>
* @param index The index of the element to return.
* @return The queueSizesList at the given index.
*/
public long getQueueSizesList(int index) {
return queueSizesList_.getLong(index);
}
private int queueSizesListMemoizedSerializedSize = -1;
public static final int SELF_QUEUE_PRIORITY_FIELD_NUMBER = 2;
private long selfQueuePriority_ = 0L;
/**
* <code>uint64 self_queue_priority = 2;</code>
* @return The selfQueuePriority.
*/
@java.lang.Override
public long getSelfQueuePriority() {
return selfQueuePriority_;
}
public static final int PRIORITY_FIELD_NUMBER = 3;
private long priority_ = 0L;
/**
* <code>uint64 priority = 3;</code>
* @return The priority.
*/
@java.lang.Override
public long getPriority() {
return priority_;
}
private byte memoizedIsInitialized = -1;
@java.lang.Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
getSerializedSize();
if (getQueueSizesListList().size() > 0) {
output.writeUInt32NoTag(10);
output.writeUInt32NoTag(queueSizesListMemoizedSerializedSize);
}
for (int i = 0; i < queueSizesList_.size(); i++) {
output.writeUInt64NoTag(queueSizesList_.getLong(i));
}
if (selfQueuePriority_ != 0L) {
output.writeUInt64(2, selfQueuePriority_);
}
if (priority_ != 0L) {
output.writeUInt64(3, priority_);
}
getUnknownFields().writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
{
int dataSize = 0;
for (int i = 0; i < queueSizesList_.size(); i++) {
dataSize += com.google.protobuf.CodedOutputStream
.computeUInt64SizeNoTag(queueSizesList_.getLong(i));
}
size += dataSize;
if (!getQueueSizesListList().isEmpty()) {
size += 1;
size += com.google.protobuf.CodedOutputStream
.computeInt32SizeNoTag(dataSize);
}
queueSizesListMemoizedSerializedSize = dataSize;
}
if (selfQueuePriority_ != 0L) {
size += com.google.protobuf.CodedOutputStream
.computeUInt64Size(2, selfQueuePriority_);
}
if (priority_ != 0L) {
size += com.google.protobuf.CodedOutputStream
.computeUInt64Size(3, priority_);
}
size += getUnknownFields().getSerializedSize();
memoizedSize = size;
return size;
}
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.GiftIMPriorityOuterClass.GiftIMPriority)) {
return super.equals(obj);
}
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.GiftIMPriorityOuterClass.GiftIMPriority other = (tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.GiftIMPriorityOuterClass.GiftIMPriority) obj;
if (!getQueueSizesListList()
.equals(other.getQueueSizesListList())) return false;
if (getSelfQueuePriority()
!= other.getSelfQueuePriority()) return false;
if (getPriority()
!= other.getPriority()) return false;
if (!getUnknownFields().equals(other.getUnknownFields())) return false;
return true;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
if (getQueueSizesListCount() > 0) {
hash = (37 * hash) + QUEUE_SIZES_LIST_FIELD_NUMBER;
hash = (53 * hash) + getQueueSizesListList().hashCode();
}
hash = (37 * hash) + SELF_QUEUE_PRIORITY_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
getSelfQueuePriority());
hash = (37 * hash) + PRIORITY_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
getPriority());
hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.GiftIMPriorityOuterClass.GiftIMPriority parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.GiftIMPriorityOuterClass.GiftIMPriority parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.GiftIMPriorityOuterClass.GiftIMPriority parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.GiftIMPriorityOuterClass.GiftIMPriority parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.GiftIMPriorityOuterClass.GiftIMPriority parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.GiftIMPriorityOuterClass.GiftIMPriority parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.GiftIMPriorityOuterClass.GiftIMPriority parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.GiftIMPriorityOuterClass.GiftIMPriority parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.GiftIMPriorityOuterClass.GiftIMPriority parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.GiftIMPriorityOuterClass.GiftIMPriority parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.GiftIMPriorityOuterClass.GiftIMPriority parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.GiftIMPriorityOuterClass.GiftIMPriority parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
@java.lang.Override
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.GiftIMPriorityOuterClass.GiftIMPriority prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@java.lang.Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* Protobuf type {@code GiftIMPriority}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
// @@protoc_insertion_point(builder_implements:GiftIMPriority)
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.GiftIMPriorityOuterClass.GiftIMPriorityOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.GiftIMPriorityOuterClass.internal_static_GiftIMPriority_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.GiftIMPriorityOuterClass.internal_static_GiftIMPriority_fieldAccessorTable
.ensureFieldAccessorsInitialized(
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.GiftIMPriorityOuterClass.GiftIMPriority.class, tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.GiftIMPriorityOuterClass.GiftIMPriority.Builder.class);
}
// Construct using tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.GiftIMPriorityOuterClass.GiftIMPriority.newBuilder()
private Builder() {
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
}
@java.lang.Override
public Builder clear() {
super.clear();
bitField0_ = 0;
queueSizesList_ = emptyLongList();
selfQueuePriority_ = 0L;
priority_ = 0L;
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.GiftIMPriorityOuterClass.internal_static_GiftIMPriority_descriptor;
}
@java.lang.Override
public tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.GiftIMPriorityOuterClass.GiftIMPriority getDefaultInstanceForType() {
return tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.GiftIMPriorityOuterClass.GiftIMPriority.getDefaultInstance();
}
@java.lang.Override
public tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.GiftIMPriorityOuterClass.GiftIMPriority build() {
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.GiftIMPriorityOuterClass.GiftIMPriority result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.GiftIMPriorityOuterClass.GiftIMPriority buildPartial() {
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.GiftIMPriorityOuterClass.GiftIMPriority result = new tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.GiftIMPriorityOuterClass.GiftIMPriority(this);
if (bitField0_ != 0) { buildPartial0(result); }
onBuilt();
return result;
}
private void buildPartial0(tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.GiftIMPriorityOuterClass.GiftIMPriority result) {
int from_bitField0_ = bitField0_;
if (((from_bitField0_ & 0x00000001) != 0)) {
queueSizesList_.makeImmutable();
result.queueSizesList_ = queueSizesList_;
}
if (((from_bitField0_ & 0x00000002) != 0)) {
result.selfQueuePriority_ = selfQueuePriority_;
}
if (((from_bitField0_ & 0x00000004) != 0)) {
result.priority_ = priority_;
}
}
@java.lang.Override
public Builder clone() {
return super.clone();
}
@java.lang.Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.setField(field, value);
}
@java.lang.Override
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, java.lang.Object value) {
return super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.addRepeatedField(field, value);
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.GiftIMPriorityOuterClass.GiftIMPriority) {
return mergeFrom((tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.GiftIMPriorityOuterClass.GiftIMPriority)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.GiftIMPriorityOuterClass.GiftIMPriority other) {
if (other == tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.GiftIMPriorityOuterClass.GiftIMPriority.getDefaultInstance()) return this;
if (!other.queueSizesList_.isEmpty()) {
if (queueSizesList_.isEmpty()) {
queueSizesList_ = other.queueSizesList_;
queueSizesList_.makeImmutable();
bitField0_ |= 0x00000001;
} else {
ensureQueueSizesListIsMutable();
queueSizesList_.addAll(other.queueSizesList_);
}
onChanged();
}
if (other.getSelfQueuePriority() != 0L) {
setSelfQueuePriority(other.getSelfQueuePriority());
}
if (other.getPriority() != 0L) {
setPriority(other.getPriority());
}
this.mergeUnknownFields(other.getUnknownFields());
onChanged();
return this;
}
@java.lang.Override
public final boolean isInitialized() {
return true;
}
@java.lang.Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 8: {
long v = input.readUInt64();
ensureQueueSizesListIsMutable();
queueSizesList_.addLong(v);
break;
} // case 8
case 10: {
int length = input.readRawVarint32();
int limit = input.pushLimit(length);
ensureQueueSizesListIsMutable();
while (input.getBytesUntilLimit() > 0) {
queueSizesList_.addLong(input.readUInt64());
}
input.popLimit(limit);
break;
} // case 10
case 16: {
selfQueuePriority_ = input.readUInt64();
bitField0_ |= 0x00000002;
break;
} // case 16
case 24: {
priority_ = input.readUInt64();
bitField0_ |= 0x00000004;
break;
} // case 24
default: {
if (!super.parseUnknownField(input, extensionRegistry, tag)) {
done = true; // was an endgroup tag
}
break;
} // default:
} // switch (tag)
} // while (!done)
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.unwrapIOException();
} finally {
onChanged();
} // finally
return this;
}
private int bitField0_;
private com.google.protobuf.Internal.LongList queueSizesList_ = emptyLongList();
private void ensureQueueSizesListIsMutable() {
if (!queueSizesList_.isModifiable()) {
queueSizesList_ = makeMutableCopy(queueSizesList_);
}
bitField0_ |= 0x00000001;
}
/**
* <code>repeated uint64 queue_sizes_list = 1;</code>
* @return A list containing the queueSizesList.
*/
public java.util.List<java.lang.Long>
getQueueSizesListList() {
queueSizesList_.makeImmutable();
return queueSizesList_;
}
/**
* <code>repeated uint64 queue_sizes_list = 1;</code>
* @return The count of queueSizesList.
*/
public int getQueueSizesListCount() {
return queueSizesList_.size();
}
/**
* <code>repeated uint64 queue_sizes_list = 1;</code>
* @param index The index of the element to return.
* @return The queueSizesList at the given index.
*/
public long getQueueSizesList(int index) {
return queueSizesList_.getLong(index);
}
/**
* <code>repeated uint64 queue_sizes_list = 1;</code>
* @param index The index to set the value at.
* @param value The queueSizesList to set.
* @return This builder for chaining.
*/
public Builder setQueueSizesList(
int index, long value) {
ensureQueueSizesListIsMutable();
queueSizesList_.setLong(index, value);
bitField0_ |= 0x00000001;
onChanged();
return this;
}
/**
* <code>repeated uint64 queue_sizes_list = 1;</code>
* @param value The queueSizesList to add.
* @return This builder for chaining.
*/
public Builder addQueueSizesList(long value) {
ensureQueueSizesListIsMutable();
queueSizesList_.addLong(value);
bitField0_ |= 0x00000001;
onChanged();
return this;
}
/**
* <code>repeated uint64 queue_sizes_list = 1;</code>
* @param values The queueSizesList to add.
* @return This builder for chaining.
*/
public Builder addAllQueueSizesList(
java.lang.Iterable<? extends java.lang.Long> values) {
ensureQueueSizesListIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(
values, queueSizesList_);
bitField0_ |= 0x00000001;
onChanged();
return this;
}
/**
* <code>repeated uint64 queue_sizes_list = 1;</code>
* @return This builder for chaining.
*/
public Builder clearQueueSizesList() {
queueSizesList_ = emptyLongList();
bitField0_ = (bitField0_ & ~0x00000001);
onChanged();
return this;
}
private long selfQueuePriority_ ;
/**
* <code>uint64 self_queue_priority = 2;</code>
* @return The selfQueuePriority.
*/
@java.lang.Override
public long getSelfQueuePriority() {
return selfQueuePriority_;
}
/**
* <code>uint64 self_queue_priority = 2;</code>
* @param value The selfQueuePriority to set.
* @return This builder for chaining.
*/
public Builder setSelfQueuePriority(long value) {
selfQueuePriority_ = value;
bitField0_ |= 0x00000002;
onChanged();
return this;
}
/**
* <code>uint64 self_queue_priority = 2;</code>
* @return This builder for chaining.
*/
public Builder clearSelfQueuePriority() {
bitField0_ = (bitField0_ & ~0x00000002);
selfQueuePriority_ = 0L;
onChanged();
return this;
}
private long priority_ ;
/**
* <code>uint64 priority = 3;</code>
* @return The priority.
*/
@java.lang.Override
public long getPriority() {
return priority_;
}
/**
* <code>uint64 priority = 3;</code>
* @param value The priority to set.
* @return This builder for chaining.
*/
public Builder setPriority(long value) {
priority_ = value;
bitField0_ |= 0x00000004;
onChanged();
return this;
}
/**
* <code>uint64 priority = 3;</code>
* @return This builder for chaining.
*/
public Builder clearPriority() {
bitField0_ = (bitField0_ & ~0x00000004);
priority_ = 0L;
onChanged();
return this;
}
@java.lang.Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@java.lang.Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:GiftIMPriority)
}
// @@protoc_insertion_point(class_scope:GiftIMPriority)
private static final tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.GiftIMPriorityOuterClass.GiftIMPriority DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.GiftIMPriorityOuterClass.GiftIMPriority();
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.GiftIMPriorityOuterClass.GiftIMPriority getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser<GiftIMPriority>
PARSER = new com.google.protobuf.AbstractParser<GiftIMPriority>() {
@java.lang.Override
public GiftIMPriority parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
Builder builder = newBuilder();
try {
builder.mergeFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(builder.buildPartial());
} catch (com.google.protobuf.UninitializedMessageException e) {
throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(e)
.setUnfinishedMessage(builder.buildPartial());
}
return builder.buildPartial();
}
};
public static com.google.protobuf.Parser<GiftIMPriority> parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser<GiftIMPriority> getParserForType() {
return PARSER;
}
@java.lang.Override
public tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.GiftIMPriorityOuterClass.GiftIMPriority getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
private static final com.google.protobuf.Descriptors.Descriptor
internal_static_GiftIMPriority_descriptor;
private static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_GiftIMPriority_fieldAccessorTable;
public static com.google.protobuf.Descriptors.FileDescriptor
getDescriptor() {
return descriptor;
}
private static com.google.protobuf.Descriptors.FileDescriptor
descriptor;
static {
java.lang.String[] descriptorData = {
"\n\024GiftIMPriority.proto\"Y\n\016GiftIMPriority" +
"\022\030\n\020queue_sizes_list\030\001 \003(\004\022\033\n\023self_queue" +
"_priority\030\002 \001(\004\022\020\n\010priority\030\003 \001(\004B>\n<tec" +
"h.ordinaryroad.live.chat.client.codec.do" +
"uyin.protobuf.dtob\006proto3"
};
descriptor = com.google.protobuf.Descriptors.FileDescriptor
.internalBuildGeneratedFileFrom(descriptorData,
new com.google.protobuf.Descriptors.FileDescriptor[] {
});
internal_static_GiftIMPriority_descriptor =
getDescriptor().getMessageTypes().get(0);
internal_static_GiftIMPriority_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_GiftIMPriority_descriptor,
new java.lang.String[] { "QueueSizesList", "SelfQueuePriority", "Priority", });
}
// @@protoc_insertion_point(outer_class_scope)
}

@ -0,0 +1,774 @@
/*
* MIT License
*
* Copyright (c) 2023 OrdinaryRoad
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: PatternRef.proto
// Protobuf Java Version: 3.25.3
package tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto;
public final class PatternRefOuterClass {
private PatternRefOuterClass() {}
public static void registerAllExtensions(
com.google.protobuf.ExtensionRegistryLite registry) {
}
public static void registerAllExtensions(
com.google.protobuf.ExtensionRegistry registry) {
registerAllExtensions(
(com.google.protobuf.ExtensionRegistryLite) registry);
}
public interface PatternRefOrBuilder extends
// @@protoc_insertion_point(interface_extends:PatternRef)
com.google.protobuf.MessageOrBuilder {
/**
* <code>string key = 1;</code>
* @return The key.
*/
java.lang.String getKey();
/**
* <code>string key = 1;</code>
* @return The bytes for key.
*/
com.google.protobuf.ByteString
getKeyBytes();
/**
* <code>string default_pattern = 2;</code>
* @return The defaultPattern.
*/
java.lang.String getDefaultPattern();
/**
* <code>string default_pattern = 2;</code>
* @return The bytes for defaultPattern.
*/
com.google.protobuf.ByteString
getDefaultPatternBytes();
}
/**
* Protobuf type {@code PatternRef}
*/
public static final class PatternRef extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:PatternRef)
PatternRefOrBuilder {
private static final long serialVersionUID = 0L;
// Use PatternRef.newBuilder() to construct.
private PatternRef(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
super(builder);
}
private PatternRef() {
key_ = "";
defaultPattern_ = "";
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(
UnusedPrivateParameter unused) {
return new PatternRef();
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.PatternRefOuterClass.internal_static_PatternRef_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.PatternRefOuterClass.internal_static_PatternRef_fieldAccessorTable
.ensureFieldAccessorsInitialized(
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.PatternRefOuterClass.PatternRef.class, tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.PatternRefOuterClass.PatternRef.Builder.class);
}
public static final int KEY_FIELD_NUMBER = 1;
@SuppressWarnings("serial")
private volatile java.lang.Object key_ = "";
/**
* <code>string key = 1;</code>
* @return The key.
*/
@java.lang.Override
public java.lang.String getKey() {
java.lang.Object ref = key_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
key_ = s;
return s;
}
}
/**
* <code>string key = 1;</code>
* @return The bytes for key.
*/
@java.lang.Override
public com.google.protobuf.ByteString
getKeyBytes() {
java.lang.Object ref = key_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
key_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int DEFAULT_PATTERN_FIELD_NUMBER = 2;
@SuppressWarnings("serial")
private volatile java.lang.Object defaultPattern_ = "";
/**
* <code>string default_pattern = 2;</code>
* @return The defaultPattern.
*/
@java.lang.Override
public java.lang.String getDefaultPattern() {
java.lang.Object ref = defaultPattern_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
defaultPattern_ = s;
return s;
}
}
/**
* <code>string default_pattern = 2;</code>
* @return The bytes for defaultPattern.
*/
@java.lang.Override
public com.google.protobuf.ByteString
getDefaultPatternBytes() {
java.lang.Object ref = defaultPattern_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
defaultPattern_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
private byte memoizedIsInitialized = -1;
@java.lang.Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(key_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, key_);
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(defaultPattern_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 2, defaultPattern_);
}
getUnknownFields().writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(key_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, key_);
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(defaultPattern_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, defaultPattern_);
}
size += getUnknownFields().getSerializedSize();
memoizedSize = size;
return size;
}
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.PatternRefOuterClass.PatternRef)) {
return super.equals(obj);
}
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.PatternRefOuterClass.PatternRef other = (tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.PatternRefOuterClass.PatternRef) obj;
if (!getKey()
.equals(other.getKey())) return false;
if (!getDefaultPattern()
.equals(other.getDefaultPattern())) return false;
if (!getUnknownFields().equals(other.getUnknownFields())) return false;
return true;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
hash = (37 * hash) + KEY_FIELD_NUMBER;
hash = (53 * hash) + getKey().hashCode();
hash = (37 * hash) + DEFAULT_PATTERN_FIELD_NUMBER;
hash = (53 * hash) + getDefaultPattern().hashCode();
hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.PatternRefOuterClass.PatternRef parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.PatternRefOuterClass.PatternRef parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.PatternRefOuterClass.PatternRef parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.PatternRefOuterClass.PatternRef parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.PatternRefOuterClass.PatternRef parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.PatternRefOuterClass.PatternRef parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.PatternRefOuterClass.PatternRef parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.PatternRefOuterClass.PatternRef parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.PatternRefOuterClass.PatternRef parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.PatternRefOuterClass.PatternRef parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.PatternRefOuterClass.PatternRef parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.PatternRefOuterClass.PatternRef parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
@java.lang.Override
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.PatternRefOuterClass.PatternRef prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@java.lang.Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* Protobuf type {@code PatternRef}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
// @@protoc_insertion_point(builder_implements:PatternRef)
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.PatternRefOuterClass.PatternRefOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.PatternRefOuterClass.internal_static_PatternRef_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.PatternRefOuterClass.internal_static_PatternRef_fieldAccessorTable
.ensureFieldAccessorsInitialized(
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.PatternRefOuterClass.PatternRef.class, tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.PatternRefOuterClass.PatternRef.Builder.class);
}
// Construct using tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.PatternRefOuterClass.PatternRef.newBuilder()
private Builder() {
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
}
@java.lang.Override
public Builder clear() {
super.clear();
bitField0_ = 0;
key_ = "";
defaultPattern_ = "";
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.PatternRefOuterClass.internal_static_PatternRef_descriptor;
}
@java.lang.Override
public tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.PatternRefOuterClass.PatternRef getDefaultInstanceForType() {
return tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.PatternRefOuterClass.PatternRef.getDefaultInstance();
}
@java.lang.Override
public tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.PatternRefOuterClass.PatternRef build() {
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.PatternRefOuterClass.PatternRef result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.PatternRefOuterClass.PatternRef buildPartial() {
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.PatternRefOuterClass.PatternRef result = new tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.PatternRefOuterClass.PatternRef(this);
if (bitField0_ != 0) { buildPartial0(result); }
onBuilt();
return result;
}
private void buildPartial0(tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.PatternRefOuterClass.PatternRef result) {
int from_bitField0_ = bitField0_;
if (((from_bitField0_ & 0x00000001) != 0)) {
result.key_ = key_;
}
if (((from_bitField0_ & 0x00000002) != 0)) {
result.defaultPattern_ = defaultPattern_;
}
}
@java.lang.Override
public Builder clone() {
return super.clone();
}
@java.lang.Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.setField(field, value);
}
@java.lang.Override
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, java.lang.Object value) {
return super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.addRepeatedField(field, value);
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.PatternRefOuterClass.PatternRef) {
return mergeFrom((tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.PatternRefOuterClass.PatternRef)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.PatternRefOuterClass.PatternRef other) {
if (other == tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.PatternRefOuterClass.PatternRef.getDefaultInstance()) return this;
if (!other.getKey().isEmpty()) {
key_ = other.key_;
bitField0_ |= 0x00000001;
onChanged();
}
if (!other.getDefaultPattern().isEmpty()) {
defaultPattern_ = other.defaultPattern_;
bitField0_ |= 0x00000002;
onChanged();
}
this.mergeUnknownFields(other.getUnknownFields());
onChanged();
return this;
}
@java.lang.Override
public final boolean isInitialized() {
return true;
}
@java.lang.Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 10: {
key_ = input.readStringRequireUtf8();
bitField0_ |= 0x00000001;
break;
} // case 10
case 18: {
defaultPattern_ = input.readStringRequireUtf8();
bitField0_ |= 0x00000002;
break;
} // case 18
default: {
if (!super.parseUnknownField(input, extensionRegistry, tag)) {
done = true; // was an endgroup tag
}
break;
} // default:
} // switch (tag)
} // while (!done)
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.unwrapIOException();
} finally {
onChanged();
} // finally
return this;
}
private int bitField0_;
private java.lang.Object key_ = "";
/**
* <code>string key = 1;</code>
* @return The key.
*/
public java.lang.String getKey() {
java.lang.Object ref = key_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
key_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
* <code>string key = 1;</code>
* @return The bytes for key.
*/
public com.google.protobuf.ByteString
getKeyBytes() {
java.lang.Object ref = key_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
key_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <code>string key = 1;</code>
* @param value The key to set.
* @return This builder for chaining.
*/
public Builder setKey(
java.lang.String value) {
if (value == null) { throw new NullPointerException(); }
key_ = value;
bitField0_ |= 0x00000001;
onChanged();
return this;
}
/**
* <code>string key = 1;</code>
* @return This builder for chaining.
*/
public Builder clearKey() {
key_ = getDefaultInstance().getKey();
bitField0_ = (bitField0_ & ~0x00000001);
onChanged();
return this;
}
/**
* <code>string key = 1;</code>
* @param value The bytes for key to set.
* @return This builder for chaining.
*/
public Builder setKeyBytes(
com.google.protobuf.ByteString value) {
if (value == null) { throw new NullPointerException(); }
checkByteStringIsUtf8(value);
key_ = value;
bitField0_ |= 0x00000001;
onChanged();
return this;
}
private java.lang.Object defaultPattern_ = "";
/**
* <code>string default_pattern = 2;</code>
* @return The defaultPattern.
*/
public java.lang.String getDefaultPattern() {
java.lang.Object ref = defaultPattern_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
defaultPattern_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
* <code>string default_pattern = 2;</code>
* @return The bytes for defaultPattern.
*/
public com.google.protobuf.ByteString
getDefaultPatternBytes() {
java.lang.Object ref = defaultPattern_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
defaultPattern_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <code>string default_pattern = 2;</code>
* @param value The defaultPattern to set.
* @return This builder for chaining.
*/
public Builder setDefaultPattern(
java.lang.String value) {
if (value == null) { throw new NullPointerException(); }
defaultPattern_ = value;
bitField0_ |= 0x00000002;
onChanged();
return this;
}
/**
* <code>string default_pattern = 2;</code>
* @return This builder for chaining.
*/
public Builder clearDefaultPattern() {
defaultPattern_ = getDefaultInstance().getDefaultPattern();
bitField0_ = (bitField0_ & ~0x00000002);
onChanged();
return this;
}
/**
* <code>string default_pattern = 2;</code>
* @param value The bytes for defaultPattern to set.
* @return This builder for chaining.
*/
public Builder setDefaultPatternBytes(
com.google.protobuf.ByteString value) {
if (value == null) { throw new NullPointerException(); }
checkByteStringIsUtf8(value);
defaultPattern_ = value;
bitField0_ |= 0x00000002;
onChanged();
return this;
}
@java.lang.Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@java.lang.Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:PatternRef)
}
// @@protoc_insertion_point(class_scope:PatternRef)
private static final tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.PatternRefOuterClass.PatternRef DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.PatternRefOuterClass.PatternRef();
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.PatternRefOuterClass.PatternRef getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser<PatternRef>
PARSER = new com.google.protobuf.AbstractParser<PatternRef>() {
@java.lang.Override
public PatternRef parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
Builder builder = newBuilder();
try {
builder.mergeFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(builder.buildPartial());
} catch (com.google.protobuf.UninitializedMessageException e) {
throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(e)
.setUnfinishedMessage(builder.buildPartial());
}
return builder.buildPartial();
}
};
public static com.google.protobuf.Parser<PatternRef> parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser<PatternRef> getParserForType() {
return PARSER;
}
@java.lang.Override
public tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.PatternRefOuterClass.PatternRef getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
private static final com.google.protobuf.Descriptors.Descriptor
internal_static_PatternRef_descriptor;
private static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_PatternRef_fieldAccessorTable;
public static com.google.protobuf.Descriptors.FileDescriptor
getDescriptor() {
return descriptor;
}
private static com.google.protobuf.Descriptors.FileDescriptor
descriptor;
static {
java.lang.String[] descriptorData = {
"\n\020PatternRef.proto\"2\n\nPatternRef\022\013\n\003key\030" +
"\001 \001(\t\022\027\n\017default_pattern\030\002 \001(\tB>\n<tech.o" +
"rdinaryroad.live.chat.client.codec.douyi" +
"n.protobuf.dtob\006proto3"
};
descriptor = com.google.protobuf.Descriptors.FileDescriptor
.internalBuildGeneratedFileFrom(descriptorData,
new com.google.protobuf.Descriptors.FileDescriptor[] {
});
internal_static_PatternRef_descriptor =
getDescriptor().getMessageTypes().get(0);
internal_static_PatternRef_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_PatternRef_descriptor,
new java.lang.String[] { "Key", "DefaultPattern", });
}
// @@protoc_insertion_point(outer_class_scope)
}

@ -0,0 +1,836 @@
/*
* MIT License
*
* Copyright (c) 2023 OrdinaryRoad
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: PublicAreaCommon.proto
// Protobuf Java Version: 3.25.3
package tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto;
public final class PublicAreaCommonOuterClass {
private PublicAreaCommonOuterClass() {}
public static void registerAllExtensions(
com.google.protobuf.ExtensionRegistryLite registry) {
}
public static void registerAllExtensions(
com.google.protobuf.ExtensionRegistry registry) {
registerAllExtensions(
(com.google.protobuf.ExtensionRegistryLite) registry);
}
public interface PublicAreaCommonOrBuilder extends
// @@protoc_insertion_point(interface_extends:PublicAreaCommon)
com.google.protobuf.MessageOrBuilder {
/**
* <code>.Image user_label = 1;</code>
* @return Whether the userLabel field is set.
*/
boolean hasUserLabel();
/**
* <code>.Image user_label = 1;</code>
* @return The userLabel.
*/
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.ImageOuterClass.Image getUserLabel();
/**
* <code>.Image user_label = 1;</code>
*/
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder getUserLabelOrBuilder();
/**
* <code>uint64 user_consume_in_room = 2;</code>
* @return The userConsumeInRoom.
*/
long getUserConsumeInRoom();
/**
* <code>uint64 user_send_gift_cnt_in_room = 3;</code>
* @return The userSendGiftCntInRoom.
*/
long getUserSendGiftCntInRoom();
}
/**
* Protobuf type {@code PublicAreaCommon}
*/
public static final class PublicAreaCommon extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:PublicAreaCommon)
PublicAreaCommonOrBuilder {
private static final long serialVersionUID = 0L;
// Use PublicAreaCommon.newBuilder() to construct.
private PublicAreaCommon(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
super(builder);
}
private PublicAreaCommon() {
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(
UnusedPrivateParameter unused) {
return new PublicAreaCommon();
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.PublicAreaCommonOuterClass.internal_static_PublicAreaCommon_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.PublicAreaCommonOuterClass.internal_static_PublicAreaCommon_fieldAccessorTable
.ensureFieldAccessorsInitialized(
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.PublicAreaCommonOuterClass.PublicAreaCommon.class, tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.PublicAreaCommonOuterClass.PublicAreaCommon.Builder.class);
}
private int bitField0_;
public static final int USER_LABEL_FIELD_NUMBER = 1;
private tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.ImageOuterClass.Image userLabel_;
/**
* <code>.Image user_label = 1;</code>
* @return Whether the userLabel field is set.
*/
@java.lang.Override
public boolean hasUserLabel() {
return ((bitField0_ & 0x00000001) != 0);
}
/**
* <code>.Image user_label = 1;</code>
* @return The userLabel.
*/
@java.lang.Override
public tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.ImageOuterClass.Image getUserLabel() {
return userLabel_ == null ? tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : userLabel_;
}
/**
* <code>.Image user_label = 1;</code>
*/
@java.lang.Override
public tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder getUserLabelOrBuilder() {
return userLabel_ == null ? tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : userLabel_;
}
public static final int USER_CONSUME_IN_ROOM_FIELD_NUMBER = 2;
private long userConsumeInRoom_ = 0L;
/**
* <code>uint64 user_consume_in_room = 2;</code>
* @return The userConsumeInRoom.
*/
@java.lang.Override
public long getUserConsumeInRoom() {
return userConsumeInRoom_;
}
public static final int USER_SEND_GIFT_CNT_IN_ROOM_FIELD_NUMBER = 3;
private long userSendGiftCntInRoom_ = 0L;
/**
* <code>uint64 user_send_gift_cnt_in_room = 3;</code>
* @return The userSendGiftCntInRoom.
*/
@java.lang.Override
public long getUserSendGiftCntInRoom() {
return userSendGiftCntInRoom_;
}
private byte memoizedIsInitialized = -1;
@java.lang.Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
if (((bitField0_ & 0x00000001) != 0)) {
output.writeMessage(1, getUserLabel());
}
if (userConsumeInRoom_ != 0L) {
output.writeUInt64(2, userConsumeInRoom_);
}
if (userSendGiftCntInRoom_ != 0L) {
output.writeUInt64(3, userSendGiftCntInRoom_);
}
getUnknownFields().writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (((bitField0_ & 0x00000001) != 0)) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(1, getUserLabel());
}
if (userConsumeInRoom_ != 0L) {
size += com.google.protobuf.CodedOutputStream
.computeUInt64Size(2, userConsumeInRoom_);
}
if (userSendGiftCntInRoom_ != 0L) {
size += com.google.protobuf.CodedOutputStream
.computeUInt64Size(3, userSendGiftCntInRoom_);
}
size += getUnknownFields().getSerializedSize();
memoizedSize = size;
return size;
}
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.PublicAreaCommonOuterClass.PublicAreaCommon)) {
return super.equals(obj);
}
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.PublicAreaCommonOuterClass.PublicAreaCommon other = (tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.PublicAreaCommonOuterClass.PublicAreaCommon) obj;
if (hasUserLabel() != other.hasUserLabel()) return false;
if (hasUserLabel()) {
if (!getUserLabel()
.equals(other.getUserLabel())) return false;
}
if (getUserConsumeInRoom()
!= other.getUserConsumeInRoom()) return false;
if (getUserSendGiftCntInRoom()
!= other.getUserSendGiftCntInRoom()) return false;
if (!getUnknownFields().equals(other.getUnknownFields())) return false;
return true;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
if (hasUserLabel()) {
hash = (37 * hash) + USER_LABEL_FIELD_NUMBER;
hash = (53 * hash) + getUserLabel().hashCode();
}
hash = (37 * hash) + USER_CONSUME_IN_ROOM_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
getUserConsumeInRoom());
hash = (37 * hash) + USER_SEND_GIFT_CNT_IN_ROOM_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
getUserSendGiftCntInRoom());
hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.PublicAreaCommonOuterClass.PublicAreaCommon parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.PublicAreaCommonOuterClass.PublicAreaCommon parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.PublicAreaCommonOuterClass.PublicAreaCommon parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.PublicAreaCommonOuterClass.PublicAreaCommon parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.PublicAreaCommonOuterClass.PublicAreaCommon parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.PublicAreaCommonOuterClass.PublicAreaCommon parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.PublicAreaCommonOuterClass.PublicAreaCommon parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.PublicAreaCommonOuterClass.PublicAreaCommon parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.PublicAreaCommonOuterClass.PublicAreaCommon parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.PublicAreaCommonOuterClass.PublicAreaCommon parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.PublicAreaCommonOuterClass.PublicAreaCommon parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.PublicAreaCommonOuterClass.PublicAreaCommon parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
@java.lang.Override
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.PublicAreaCommonOuterClass.PublicAreaCommon prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@java.lang.Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* Protobuf type {@code PublicAreaCommon}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
// @@protoc_insertion_point(builder_implements:PublicAreaCommon)
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.PublicAreaCommonOuterClass.PublicAreaCommonOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.PublicAreaCommonOuterClass.internal_static_PublicAreaCommon_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.PublicAreaCommonOuterClass.internal_static_PublicAreaCommon_fieldAccessorTable
.ensureFieldAccessorsInitialized(
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.PublicAreaCommonOuterClass.PublicAreaCommon.class, tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.PublicAreaCommonOuterClass.PublicAreaCommon.Builder.class);
}
// Construct using tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.PublicAreaCommonOuterClass.PublicAreaCommon.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
getUserLabelFieldBuilder();
}
}
@java.lang.Override
public Builder clear() {
super.clear();
bitField0_ = 0;
userLabel_ = null;
if (userLabelBuilder_ != null) {
userLabelBuilder_.dispose();
userLabelBuilder_ = null;
}
userConsumeInRoom_ = 0L;
userSendGiftCntInRoom_ = 0L;
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.PublicAreaCommonOuterClass.internal_static_PublicAreaCommon_descriptor;
}
@java.lang.Override
public tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.PublicAreaCommonOuterClass.PublicAreaCommon getDefaultInstanceForType() {
return tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.PublicAreaCommonOuterClass.PublicAreaCommon.getDefaultInstance();
}
@java.lang.Override
public tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.PublicAreaCommonOuterClass.PublicAreaCommon build() {
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.PublicAreaCommonOuterClass.PublicAreaCommon result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.PublicAreaCommonOuterClass.PublicAreaCommon buildPartial() {
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.PublicAreaCommonOuterClass.PublicAreaCommon result = new tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.PublicAreaCommonOuterClass.PublicAreaCommon(this);
if (bitField0_ != 0) { buildPartial0(result); }
onBuilt();
return result;
}
private void buildPartial0(tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.PublicAreaCommonOuterClass.PublicAreaCommon result) {
int from_bitField0_ = bitField0_;
int to_bitField0_ = 0;
if (((from_bitField0_ & 0x00000001) != 0)) {
result.userLabel_ = userLabelBuilder_ == null
? userLabel_
: userLabelBuilder_.build();
to_bitField0_ |= 0x00000001;
}
if (((from_bitField0_ & 0x00000002) != 0)) {
result.userConsumeInRoom_ = userConsumeInRoom_;
}
if (((from_bitField0_ & 0x00000004) != 0)) {
result.userSendGiftCntInRoom_ = userSendGiftCntInRoom_;
}
result.bitField0_ |= to_bitField0_;
}
@java.lang.Override
public Builder clone() {
return super.clone();
}
@java.lang.Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.setField(field, value);
}
@java.lang.Override
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, java.lang.Object value) {
return super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.addRepeatedField(field, value);
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.PublicAreaCommonOuterClass.PublicAreaCommon) {
return mergeFrom((tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.PublicAreaCommonOuterClass.PublicAreaCommon)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.PublicAreaCommonOuterClass.PublicAreaCommon other) {
if (other == tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.PublicAreaCommonOuterClass.PublicAreaCommon.getDefaultInstance()) return this;
if (other.hasUserLabel()) {
mergeUserLabel(other.getUserLabel());
}
if (other.getUserConsumeInRoom() != 0L) {
setUserConsumeInRoom(other.getUserConsumeInRoom());
}
if (other.getUserSendGiftCntInRoom() != 0L) {
setUserSendGiftCntInRoom(other.getUserSendGiftCntInRoom());
}
this.mergeUnknownFields(other.getUnknownFields());
onChanged();
return this;
}
@java.lang.Override
public final boolean isInitialized() {
return true;
}
@java.lang.Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 10: {
input.readMessage(
getUserLabelFieldBuilder().getBuilder(),
extensionRegistry);
bitField0_ |= 0x00000001;
break;
} // case 10
case 16: {
userConsumeInRoom_ = input.readUInt64();
bitField0_ |= 0x00000002;
break;
} // case 16
case 24: {
userSendGiftCntInRoom_ = input.readUInt64();
bitField0_ |= 0x00000004;
break;
} // case 24
default: {
if (!super.parseUnknownField(input, extensionRegistry, tag)) {
done = true; // was an endgroup tag
}
break;
} // default:
} // switch (tag)
} // while (!done)
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.unwrapIOException();
} finally {
onChanged();
} // finally
return this;
}
private int bitField0_;
private tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.ImageOuterClass.Image userLabel_;
private com.google.protobuf.SingleFieldBuilderV3<
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.ImageOuterClass.Image, tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.ImageOuterClass.Image.Builder, tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder> userLabelBuilder_;
/**
* <code>.Image user_label = 1;</code>
* @return Whether the userLabel field is set.
*/
public boolean hasUserLabel() {
return ((bitField0_ & 0x00000001) != 0);
}
/**
* <code>.Image user_label = 1;</code>
* @return The userLabel.
*/
public tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.ImageOuterClass.Image getUserLabel() {
if (userLabelBuilder_ == null) {
return userLabel_ == null ? tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : userLabel_;
} else {
return userLabelBuilder_.getMessage();
}
}
/**
* <code>.Image user_label = 1;</code>
*/
public Builder setUserLabel(tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.ImageOuterClass.Image value) {
if (userLabelBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
userLabel_ = value;
} else {
userLabelBuilder_.setMessage(value);
}
bitField0_ |= 0x00000001;
onChanged();
return this;
}
/**
* <code>.Image user_label = 1;</code>
*/
public Builder setUserLabel(
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.ImageOuterClass.Image.Builder builderForValue) {
if (userLabelBuilder_ == null) {
userLabel_ = builderForValue.build();
} else {
userLabelBuilder_.setMessage(builderForValue.build());
}
bitField0_ |= 0x00000001;
onChanged();
return this;
}
/**
* <code>.Image user_label = 1;</code>
*/
public Builder mergeUserLabel(tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.ImageOuterClass.Image value) {
if (userLabelBuilder_ == null) {
if (((bitField0_ & 0x00000001) != 0) &&
userLabel_ != null &&
userLabel_ != tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance()) {
getUserLabelBuilder().mergeFrom(value);
} else {
userLabel_ = value;
}
} else {
userLabelBuilder_.mergeFrom(value);
}
if (userLabel_ != null) {
bitField0_ |= 0x00000001;
onChanged();
}
return this;
}
/**
* <code>.Image user_label = 1;</code>
*/
public Builder clearUserLabel() {
bitField0_ = (bitField0_ & ~0x00000001);
userLabel_ = null;
if (userLabelBuilder_ != null) {
userLabelBuilder_.dispose();
userLabelBuilder_ = null;
}
onChanged();
return this;
}
/**
* <code>.Image user_label = 1;</code>
*/
public tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.ImageOuterClass.Image.Builder getUserLabelBuilder() {
bitField0_ |= 0x00000001;
onChanged();
return getUserLabelFieldBuilder().getBuilder();
}
/**
* <code>.Image user_label = 1;</code>
*/
public tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder getUserLabelOrBuilder() {
if (userLabelBuilder_ != null) {
return userLabelBuilder_.getMessageOrBuilder();
} else {
return userLabel_ == null ?
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : userLabel_;
}
}
/**
* <code>.Image user_label = 1;</code>
*/
private com.google.protobuf.SingleFieldBuilderV3<
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.ImageOuterClass.Image, tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.ImageOuterClass.Image.Builder, tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder>
getUserLabelFieldBuilder() {
if (userLabelBuilder_ == null) {
userLabelBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.ImageOuterClass.Image, tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.ImageOuterClass.Image.Builder, tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder>(
getUserLabel(),
getParentForChildren(),
isClean());
userLabel_ = null;
}
return userLabelBuilder_;
}
private long userConsumeInRoom_ ;
/**
* <code>uint64 user_consume_in_room = 2;</code>
* @return The userConsumeInRoom.
*/
@java.lang.Override
public long getUserConsumeInRoom() {
return userConsumeInRoom_;
}
/**
* <code>uint64 user_consume_in_room = 2;</code>
* @param value The userConsumeInRoom to set.
* @return This builder for chaining.
*/
public Builder setUserConsumeInRoom(long value) {
userConsumeInRoom_ = value;
bitField0_ |= 0x00000002;
onChanged();
return this;
}
/**
* <code>uint64 user_consume_in_room = 2;</code>
* @return This builder for chaining.
*/
public Builder clearUserConsumeInRoom() {
bitField0_ = (bitField0_ & ~0x00000002);
userConsumeInRoom_ = 0L;
onChanged();
return this;
}
private long userSendGiftCntInRoom_ ;
/**
* <code>uint64 user_send_gift_cnt_in_room = 3;</code>
* @return The userSendGiftCntInRoom.
*/
@java.lang.Override
public long getUserSendGiftCntInRoom() {
return userSendGiftCntInRoom_;
}
/**
* <code>uint64 user_send_gift_cnt_in_room = 3;</code>
* @param value The userSendGiftCntInRoom to set.
* @return This builder for chaining.
*/
public Builder setUserSendGiftCntInRoom(long value) {
userSendGiftCntInRoom_ = value;
bitField0_ |= 0x00000004;
onChanged();
return this;
}
/**
* <code>uint64 user_send_gift_cnt_in_room = 3;</code>
* @return This builder for chaining.
*/
public Builder clearUserSendGiftCntInRoom() {
bitField0_ = (bitField0_ & ~0x00000004);
userSendGiftCntInRoom_ = 0L;
onChanged();
return this;
}
@java.lang.Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@java.lang.Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:PublicAreaCommon)
}
// @@protoc_insertion_point(class_scope:PublicAreaCommon)
private static final tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.PublicAreaCommonOuterClass.PublicAreaCommon DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.PublicAreaCommonOuterClass.PublicAreaCommon();
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.PublicAreaCommonOuterClass.PublicAreaCommon getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser<PublicAreaCommon>
PARSER = new com.google.protobuf.AbstractParser<PublicAreaCommon>() {
@java.lang.Override
public PublicAreaCommon parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
Builder builder = newBuilder();
try {
builder.mergeFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(builder.buildPartial());
} catch (com.google.protobuf.UninitializedMessageException e) {
throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(e)
.setUnfinishedMessage(builder.buildPartial());
}
return builder.buildPartial();
}
};
public static com.google.protobuf.Parser<PublicAreaCommon> parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser<PublicAreaCommon> getParserForType() {
return PARSER;
}
@java.lang.Override
public tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.PublicAreaCommonOuterClass.PublicAreaCommon getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
private static final com.google.protobuf.Descriptors.Descriptor
internal_static_PublicAreaCommon_descriptor;
private static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_PublicAreaCommon_fieldAccessorTable;
public static com.google.protobuf.Descriptors.FileDescriptor
getDescriptor() {
return descriptor;
}
private static com.google.protobuf.Descriptors.FileDescriptor
descriptor;
static {
java.lang.String[] descriptorData = {
"\n\026PublicAreaCommon.proto\032\013Image.proto\"p\n" +
"\020PublicAreaCommon\022\032\n\nuser_label\030\001 \001(\0132\006." +
"Image\022\034\n\024user_consume_in_room\030\002 \001(\004\022\"\n\032u" +
"ser_send_gift_cnt_in_room\030\003 \001(\004B>\n<tech." +
"ordinaryroad.live.chat.client.codec.douy" +
"in.protobuf.dtob\006proto3"
};
descriptor = com.google.protobuf.Descriptors.FileDescriptor
.internalBuildGeneratedFileFrom(descriptorData,
new com.google.protobuf.Descriptors.FileDescriptor[] {
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.ImageOuterClass.getDescriptor(),
});
internal_static_PublicAreaCommon_descriptor =
getDescriptor().getMessageTypes().get(0);
internal_static_PublicAreaCommon_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_PublicAreaCommon_descriptor,
new java.lang.String[] { "UserLabel", "UserConsumeInRoom", "UserSendGiftCntInRoom", });
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.ImageOuterClass.getDescriptor();
}
// @@protoc_insertion_point(outer_class_scope)
}

@ -0,0 +1,890 @@
/*
* MIT License
*
* Copyright (c) 2023 OrdinaryRoad
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: TextEffect.proto
// Protobuf Java Version: 3.25.3
package tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto;
public final class TextEffectOuterClass {
private TextEffectOuterClass() {}
public static void registerAllExtensions(
com.google.protobuf.ExtensionRegistryLite registry) {
}
public static void registerAllExtensions(
com.google.protobuf.ExtensionRegistry registry) {
registerAllExtensions(
(com.google.protobuf.ExtensionRegistryLite) registry);
}
public interface TextEffectOrBuilder extends
// @@protoc_insertion_point(interface_extends:TextEffect)
com.google.protobuf.MessageOrBuilder {
/**
* <code>.TextEffectDetail portrait = 1;</code>
* @return Whether the portrait field is set.
*/
boolean hasPortrait();
/**
* <code>.TextEffectDetail portrait = 1;</code>
* @return The portrait.
*/
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetail getPortrait();
/**
* <code>.TextEffectDetail portrait = 1;</code>
*/
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetailOrBuilder getPortraitOrBuilder();
/**
* <code>.TextEffectDetail landscape = 2;</code>
* @return Whether the landscape field is set.
*/
boolean hasLandscape();
/**
* <code>.TextEffectDetail landscape = 2;</code>
* @return The landscape.
*/
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetail getLandscape();
/**
* <code>.TextEffectDetail landscape = 2;</code>
*/
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetailOrBuilder getLandscapeOrBuilder();
}
/**
* Protobuf type {@code TextEffect}
*/
public static final class TextEffect extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:TextEffect)
TextEffectOrBuilder {
private static final long serialVersionUID = 0L;
// Use TextEffect.newBuilder() to construct.
private TextEffect(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
super(builder);
}
private TextEffect() {
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(
UnusedPrivateParameter unused) {
return new TextEffect();
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextEffectOuterClass.internal_static_TextEffect_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextEffectOuterClass.internal_static_TextEffect_fieldAccessorTable
.ensureFieldAccessorsInitialized(
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextEffectOuterClass.TextEffect.class, tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextEffectOuterClass.TextEffect.Builder.class);
}
private int bitField0_;
public static final int PORTRAIT_FIELD_NUMBER = 1;
private tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetail portrait_;
/**
* <code>.TextEffectDetail portrait = 1;</code>
* @return Whether the portrait field is set.
*/
@java.lang.Override
public boolean hasPortrait() {
return ((bitField0_ & 0x00000001) != 0);
}
/**
* <code>.TextEffectDetail portrait = 1;</code>
* @return The portrait.
*/
@java.lang.Override
public tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetail getPortrait() {
return portrait_ == null ? tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetail.getDefaultInstance() : portrait_;
}
/**
* <code>.TextEffectDetail portrait = 1;</code>
*/
@java.lang.Override
public tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetailOrBuilder getPortraitOrBuilder() {
return portrait_ == null ? tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetail.getDefaultInstance() : portrait_;
}
public static final int LANDSCAPE_FIELD_NUMBER = 2;
private tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetail landscape_;
/**
* <code>.TextEffectDetail landscape = 2;</code>
* @return Whether the landscape field is set.
*/
@java.lang.Override
public boolean hasLandscape() {
return ((bitField0_ & 0x00000002) != 0);
}
/**
* <code>.TextEffectDetail landscape = 2;</code>
* @return The landscape.
*/
@java.lang.Override
public tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetail getLandscape() {
return landscape_ == null ? tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetail.getDefaultInstance() : landscape_;
}
/**
* <code>.TextEffectDetail landscape = 2;</code>
*/
@java.lang.Override
public tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetailOrBuilder getLandscapeOrBuilder() {
return landscape_ == null ? tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetail.getDefaultInstance() : landscape_;
}
private byte memoizedIsInitialized = -1;
@java.lang.Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
if (((bitField0_ & 0x00000001) != 0)) {
output.writeMessage(1, getPortrait());
}
if (((bitField0_ & 0x00000002) != 0)) {
output.writeMessage(2, getLandscape());
}
getUnknownFields().writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (((bitField0_ & 0x00000001) != 0)) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(1, getPortrait());
}
if (((bitField0_ & 0x00000002) != 0)) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(2, getLandscape());
}
size += getUnknownFields().getSerializedSize();
memoizedSize = size;
return size;
}
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextEffectOuterClass.TextEffect)) {
return super.equals(obj);
}
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextEffectOuterClass.TextEffect other = (tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextEffectOuterClass.TextEffect) obj;
if (hasPortrait() != other.hasPortrait()) return false;
if (hasPortrait()) {
if (!getPortrait()
.equals(other.getPortrait())) return false;
}
if (hasLandscape() != other.hasLandscape()) return false;
if (hasLandscape()) {
if (!getLandscape()
.equals(other.getLandscape())) return false;
}
if (!getUnknownFields().equals(other.getUnknownFields())) return false;
return true;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
if (hasPortrait()) {
hash = (37 * hash) + PORTRAIT_FIELD_NUMBER;
hash = (53 * hash) + getPortrait().hashCode();
}
if (hasLandscape()) {
hash = (37 * hash) + LANDSCAPE_FIELD_NUMBER;
hash = (53 * hash) + getLandscape().hashCode();
}
hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextEffectOuterClass.TextEffect parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextEffectOuterClass.TextEffect parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextEffectOuterClass.TextEffect parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextEffectOuterClass.TextEffect parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextEffectOuterClass.TextEffect parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextEffectOuterClass.TextEffect parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextEffectOuterClass.TextEffect parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextEffectOuterClass.TextEffect parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextEffectOuterClass.TextEffect parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextEffectOuterClass.TextEffect parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextEffectOuterClass.TextEffect parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextEffectOuterClass.TextEffect parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
@java.lang.Override
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextEffectOuterClass.TextEffect prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@java.lang.Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* Protobuf type {@code TextEffect}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
// @@protoc_insertion_point(builder_implements:TextEffect)
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextEffectOuterClass.TextEffectOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextEffectOuterClass.internal_static_TextEffect_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextEffectOuterClass.internal_static_TextEffect_fieldAccessorTable
.ensureFieldAccessorsInitialized(
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextEffectOuterClass.TextEffect.class, tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextEffectOuterClass.TextEffect.Builder.class);
}
// Construct using tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextEffectOuterClass.TextEffect.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
getPortraitFieldBuilder();
getLandscapeFieldBuilder();
}
}
@java.lang.Override
public Builder clear() {
super.clear();
bitField0_ = 0;
portrait_ = null;
if (portraitBuilder_ != null) {
portraitBuilder_.dispose();
portraitBuilder_ = null;
}
landscape_ = null;
if (landscapeBuilder_ != null) {
landscapeBuilder_.dispose();
landscapeBuilder_ = null;
}
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextEffectOuterClass.internal_static_TextEffect_descriptor;
}
@java.lang.Override
public tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextEffectOuterClass.TextEffect getDefaultInstanceForType() {
return tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextEffectOuterClass.TextEffect.getDefaultInstance();
}
@java.lang.Override
public tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextEffectOuterClass.TextEffect build() {
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextEffectOuterClass.TextEffect result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextEffectOuterClass.TextEffect buildPartial() {
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextEffectOuterClass.TextEffect result = new tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextEffectOuterClass.TextEffect(this);
if (bitField0_ != 0) { buildPartial0(result); }
onBuilt();
return result;
}
private void buildPartial0(tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextEffectOuterClass.TextEffect result) {
int from_bitField0_ = bitField0_;
int to_bitField0_ = 0;
if (((from_bitField0_ & 0x00000001) != 0)) {
result.portrait_ = portraitBuilder_ == null
? portrait_
: portraitBuilder_.build();
to_bitField0_ |= 0x00000001;
}
if (((from_bitField0_ & 0x00000002) != 0)) {
result.landscape_ = landscapeBuilder_ == null
? landscape_
: landscapeBuilder_.build();
to_bitField0_ |= 0x00000002;
}
result.bitField0_ |= to_bitField0_;
}
@java.lang.Override
public Builder clone() {
return super.clone();
}
@java.lang.Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.setField(field, value);
}
@java.lang.Override
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, java.lang.Object value) {
return super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.addRepeatedField(field, value);
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextEffectOuterClass.TextEffect) {
return mergeFrom((tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextEffectOuterClass.TextEffect)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextEffectOuterClass.TextEffect other) {
if (other == tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextEffectOuterClass.TextEffect.getDefaultInstance()) return this;
if (other.hasPortrait()) {
mergePortrait(other.getPortrait());
}
if (other.hasLandscape()) {
mergeLandscape(other.getLandscape());
}
this.mergeUnknownFields(other.getUnknownFields());
onChanged();
return this;
}
@java.lang.Override
public final boolean isInitialized() {
return true;
}
@java.lang.Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 10: {
input.readMessage(
getPortraitFieldBuilder().getBuilder(),
extensionRegistry);
bitField0_ |= 0x00000001;
break;
} // case 10
case 18: {
input.readMessage(
getLandscapeFieldBuilder().getBuilder(),
extensionRegistry);
bitField0_ |= 0x00000002;
break;
} // case 18
default: {
if (!super.parseUnknownField(input, extensionRegistry, tag)) {
done = true; // was an endgroup tag
}
break;
} // default:
} // switch (tag)
} // while (!done)
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.unwrapIOException();
} finally {
onChanged();
} // finally
return this;
}
private int bitField0_;
private tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetail portrait_;
private com.google.protobuf.SingleFieldBuilderV3<
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetail, tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetail.Builder, tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetailOrBuilder> portraitBuilder_;
/**
* <code>.TextEffectDetail portrait = 1;</code>
* @return Whether the portrait field is set.
*/
public boolean hasPortrait() {
return ((bitField0_ & 0x00000001) != 0);
}
/**
* <code>.TextEffectDetail portrait = 1;</code>
* @return The portrait.
*/
public tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetail getPortrait() {
if (portraitBuilder_ == null) {
return portrait_ == null ? tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetail.getDefaultInstance() : portrait_;
} else {
return portraitBuilder_.getMessage();
}
}
/**
* <code>.TextEffectDetail portrait = 1;</code>
*/
public Builder setPortrait(tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetail value) {
if (portraitBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
portrait_ = value;
} else {
portraitBuilder_.setMessage(value);
}
bitField0_ |= 0x00000001;
onChanged();
return this;
}
/**
* <code>.TextEffectDetail portrait = 1;</code>
*/
public Builder setPortrait(
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetail.Builder builderForValue) {
if (portraitBuilder_ == null) {
portrait_ = builderForValue.build();
} else {
portraitBuilder_.setMessage(builderForValue.build());
}
bitField0_ |= 0x00000001;
onChanged();
return this;
}
/**
* <code>.TextEffectDetail portrait = 1;</code>
*/
public Builder mergePortrait(tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetail value) {
if (portraitBuilder_ == null) {
if (((bitField0_ & 0x00000001) != 0) &&
portrait_ != null &&
portrait_ != tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetail.getDefaultInstance()) {
getPortraitBuilder().mergeFrom(value);
} else {
portrait_ = value;
}
} else {
portraitBuilder_.mergeFrom(value);
}
if (portrait_ != null) {
bitField0_ |= 0x00000001;
onChanged();
}
return this;
}
/**
* <code>.TextEffectDetail portrait = 1;</code>
*/
public Builder clearPortrait() {
bitField0_ = (bitField0_ & ~0x00000001);
portrait_ = null;
if (portraitBuilder_ != null) {
portraitBuilder_.dispose();
portraitBuilder_ = null;
}
onChanged();
return this;
}
/**
* <code>.TextEffectDetail portrait = 1;</code>
*/
public tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetail.Builder getPortraitBuilder() {
bitField0_ |= 0x00000001;
onChanged();
return getPortraitFieldBuilder().getBuilder();
}
/**
* <code>.TextEffectDetail portrait = 1;</code>
*/
public tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetailOrBuilder getPortraitOrBuilder() {
if (portraitBuilder_ != null) {
return portraitBuilder_.getMessageOrBuilder();
} else {
return portrait_ == null ?
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetail.getDefaultInstance() : portrait_;
}
}
/**
* <code>.TextEffectDetail portrait = 1;</code>
*/
private com.google.protobuf.SingleFieldBuilderV3<
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetail, tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetail.Builder, tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetailOrBuilder>
getPortraitFieldBuilder() {
if (portraitBuilder_ == null) {
portraitBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetail, tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetail.Builder, tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetailOrBuilder>(
getPortrait(),
getParentForChildren(),
isClean());
portrait_ = null;
}
return portraitBuilder_;
}
private tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetail landscape_;
private com.google.protobuf.SingleFieldBuilderV3<
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetail, tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetail.Builder, tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetailOrBuilder> landscapeBuilder_;
/**
* <code>.TextEffectDetail landscape = 2;</code>
* @return Whether the landscape field is set.
*/
public boolean hasLandscape() {
return ((bitField0_ & 0x00000002) != 0);
}
/**
* <code>.TextEffectDetail landscape = 2;</code>
* @return The landscape.
*/
public tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetail getLandscape() {
if (landscapeBuilder_ == null) {
return landscape_ == null ? tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetail.getDefaultInstance() : landscape_;
} else {
return landscapeBuilder_.getMessage();
}
}
/**
* <code>.TextEffectDetail landscape = 2;</code>
*/
public Builder setLandscape(tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetail value) {
if (landscapeBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
landscape_ = value;
} else {
landscapeBuilder_.setMessage(value);
}
bitField0_ |= 0x00000002;
onChanged();
return this;
}
/**
* <code>.TextEffectDetail landscape = 2;</code>
*/
public Builder setLandscape(
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetail.Builder builderForValue) {
if (landscapeBuilder_ == null) {
landscape_ = builderForValue.build();
} else {
landscapeBuilder_.setMessage(builderForValue.build());
}
bitField0_ |= 0x00000002;
onChanged();
return this;
}
/**
* <code>.TextEffectDetail landscape = 2;</code>
*/
public Builder mergeLandscape(tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetail value) {
if (landscapeBuilder_ == null) {
if (((bitField0_ & 0x00000002) != 0) &&
landscape_ != null &&
landscape_ != tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetail.getDefaultInstance()) {
getLandscapeBuilder().mergeFrom(value);
} else {
landscape_ = value;
}
} else {
landscapeBuilder_.mergeFrom(value);
}
if (landscape_ != null) {
bitField0_ |= 0x00000002;
onChanged();
}
return this;
}
/**
* <code>.TextEffectDetail landscape = 2;</code>
*/
public Builder clearLandscape() {
bitField0_ = (bitField0_ & ~0x00000002);
landscape_ = null;
if (landscapeBuilder_ != null) {
landscapeBuilder_.dispose();
landscapeBuilder_ = null;
}
onChanged();
return this;
}
/**
* <code>.TextEffectDetail landscape = 2;</code>
*/
public tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetail.Builder getLandscapeBuilder() {
bitField0_ |= 0x00000002;
onChanged();
return getLandscapeFieldBuilder().getBuilder();
}
/**
* <code>.TextEffectDetail landscape = 2;</code>
*/
public tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetailOrBuilder getLandscapeOrBuilder() {
if (landscapeBuilder_ != null) {
return landscapeBuilder_.getMessageOrBuilder();
} else {
return landscape_ == null ?
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetail.getDefaultInstance() : landscape_;
}
}
/**
* <code>.TextEffectDetail landscape = 2;</code>
*/
private com.google.protobuf.SingleFieldBuilderV3<
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetail, tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetail.Builder, tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetailOrBuilder>
getLandscapeFieldBuilder() {
if (landscapeBuilder_ == null) {
landscapeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetail, tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetail.Builder, tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetailOrBuilder>(
getLandscape(),
getParentForChildren(),
isClean());
landscape_ = null;
}
return landscapeBuilder_;
}
@java.lang.Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@java.lang.Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:TextEffect)
}
// @@protoc_insertion_point(class_scope:TextEffect)
private static final tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextEffectOuterClass.TextEffect DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextEffectOuterClass.TextEffect();
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextEffectOuterClass.TextEffect getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser<TextEffect>
PARSER = new com.google.protobuf.AbstractParser<TextEffect>() {
@java.lang.Override
public TextEffect parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
Builder builder = newBuilder();
try {
builder.mergeFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(builder.buildPartial());
} catch (com.google.protobuf.UninitializedMessageException e) {
throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(e)
.setUnfinishedMessage(builder.buildPartial());
}
return builder.buildPartial();
}
};
public static com.google.protobuf.Parser<TextEffect> parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser<TextEffect> getParserForType() {
return PARSER;
}
@java.lang.Override
public tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextEffectOuterClass.TextEffect getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
private static final com.google.protobuf.Descriptors.Descriptor
internal_static_TextEffect_descriptor;
private static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_TextEffect_fieldAccessorTable;
public static com.google.protobuf.Descriptors.FileDescriptor
getDescriptor() {
return descriptor;
}
private static com.google.protobuf.Descriptors.FileDescriptor
descriptor;
static {
java.lang.String[] descriptorData = {
"\n\020TextEffect.proto\032\026TextEffectDetail.pro" +
"to\"W\n\nTextEffect\022#\n\010portrait\030\001 \001(\0132\021.Tex" +
"tEffectDetail\022$\n\tlandscape\030\002 \001(\0132\021.TextE" +
"ffectDetailB>\n<tech.ordinaryroad.live.ch" +
"at.client.codec.douyin.protobuf.dtob\006pro" +
"to3"
};
descriptor = com.google.protobuf.Descriptors.FileDescriptor
.internalBuildGeneratedFileFrom(descriptorData,
new com.google.protobuf.Descriptors.FileDescriptor[] {
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextEffectDetailOuterClass.getDescriptor(),
});
internal_static_TextEffect_descriptor =
getDescriptor().getMessageTypes().get(0);
internal_static_TextEffect_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_TextEffect_descriptor,
new java.lang.String[] { "Portrait", "Landscape", });
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextEffectDetailOuterClass.getDescriptor();
}
// @@protoc_insertion_point(outer_class_scope)
}

@ -0,0 +1,762 @@
/*
* MIT License
*
* Copyright (c) 2023 OrdinaryRoad
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: TextPieceGift.proto
// Protobuf Java Version: 3.25.3
package tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto;
public final class TextPieceGiftOuterClass {
private TextPieceGiftOuterClass() {}
public static void registerAllExtensions(
com.google.protobuf.ExtensionRegistryLite registry) {
}
public static void registerAllExtensions(
com.google.protobuf.ExtensionRegistry registry) {
registerAllExtensions(
(com.google.protobuf.ExtensionRegistryLite) registry);
}
public interface TextPieceGiftOrBuilder extends
// @@protoc_insertion_point(interface_extends:TextPieceGift)
com.google.protobuf.MessageOrBuilder {
/**
* <code>uint64 gift_id = 1;</code>
* @return The giftId.
*/
long getGiftId();
/**
* <code>.PatternRef name_ref = 2;</code>
* @return Whether the nameRef field is set.
*/
boolean hasNameRef();
/**
* <code>.PatternRef name_ref = 2;</code>
* @return The nameRef.
*/
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.PatternRefOuterClass.PatternRef getNameRef();
/**
* <code>.PatternRef name_ref = 2;</code>
*/
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.PatternRefOuterClass.PatternRefOrBuilder getNameRefOrBuilder();
}
/**
* Protobuf type {@code TextPieceGift}
*/
public static final class TextPieceGift extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:TextPieceGift)
TextPieceGiftOrBuilder {
private static final long serialVersionUID = 0L;
// Use TextPieceGift.newBuilder() to construct.
private TextPieceGift(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
super(builder);
}
private TextPieceGift() {
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(
UnusedPrivateParameter unused) {
return new TextPieceGift();
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceGiftOuterClass.internal_static_TextPieceGift_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceGiftOuterClass.internal_static_TextPieceGift_fieldAccessorTable
.ensureFieldAccessorsInitialized(
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceGiftOuterClass.TextPieceGift.class, tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceGiftOuterClass.TextPieceGift.Builder.class);
}
private int bitField0_;
public static final int GIFT_ID_FIELD_NUMBER = 1;
private long giftId_ = 0L;
/**
* <code>uint64 gift_id = 1;</code>
* @return The giftId.
*/
@java.lang.Override
public long getGiftId() {
return giftId_;
}
public static final int NAME_REF_FIELD_NUMBER = 2;
private tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.PatternRefOuterClass.PatternRef nameRef_;
/**
* <code>.PatternRef name_ref = 2;</code>
* @return Whether the nameRef field is set.
*/
@java.lang.Override
public boolean hasNameRef() {
return ((bitField0_ & 0x00000001) != 0);
}
/**
* <code>.PatternRef name_ref = 2;</code>
* @return The nameRef.
*/
@java.lang.Override
public tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.PatternRefOuterClass.PatternRef getNameRef() {
return nameRef_ == null ? tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.PatternRefOuterClass.PatternRef.getDefaultInstance() : nameRef_;
}
/**
* <code>.PatternRef name_ref = 2;</code>
*/
@java.lang.Override
public tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.PatternRefOuterClass.PatternRefOrBuilder getNameRefOrBuilder() {
return nameRef_ == null ? tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.PatternRefOuterClass.PatternRef.getDefaultInstance() : nameRef_;
}
private byte memoizedIsInitialized = -1;
@java.lang.Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
if (giftId_ != 0L) {
output.writeUInt64(1, giftId_);
}
if (((bitField0_ & 0x00000001) != 0)) {
output.writeMessage(2, getNameRef());
}
getUnknownFields().writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (giftId_ != 0L) {
size += com.google.protobuf.CodedOutputStream
.computeUInt64Size(1, giftId_);
}
if (((bitField0_ & 0x00000001) != 0)) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(2, getNameRef());
}
size += getUnknownFields().getSerializedSize();
memoizedSize = size;
return size;
}
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceGiftOuterClass.TextPieceGift)) {
return super.equals(obj);
}
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceGiftOuterClass.TextPieceGift other = (tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceGiftOuterClass.TextPieceGift) obj;
if (getGiftId()
!= other.getGiftId()) return false;
if (hasNameRef() != other.hasNameRef()) return false;
if (hasNameRef()) {
if (!getNameRef()
.equals(other.getNameRef())) return false;
}
if (!getUnknownFields().equals(other.getUnknownFields())) return false;
return true;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
hash = (37 * hash) + GIFT_ID_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
getGiftId());
if (hasNameRef()) {
hash = (37 * hash) + NAME_REF_FIELD_NUMBER;
hash = (53 * hash) + getNameRef().hashCode();
}
hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceGiftOuterClass.TextPieceGift parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceGiftOuterClass.TextPieceGift parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceGiftOuterClass.TextPieceGift parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceGiftOuterClass.TextPieceGift parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceGiftOuterClass.TextPieceGift parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceGiftOuterClass.TextPieceGift parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceGiftOuterClass.TextPieceGift parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceGiftOuterClass.TextPieceGift parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceGiftOuterClass.TextPieceGift parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceGiftOuterClass.TextPieceGift parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceGiftOuterClass.TextPieceGift parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceGiftOuterClass.TextPieceGift parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
@java.lang.Override
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceGiftOuterClass.TextPieceGift prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@java.lang.Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* Protobuf type {@code TextPieceGift}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
// @@protoc_insertion_point(builder_implements:TextPieceGift)
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceGiftOuterClass.TextPieceGiftOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceGiftOuterClass.internal_static_TextPieceGift_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceGiftOuterClass.internal_static_TextPieceGift_fieldAccessorTable
.ensureFieldAccessorsInitialized(
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceGiftOuterClass.TextPieceGift.class, tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceGiftOuterClass.TextPieceGift.Builder.class);
}
// Construct using tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceGiftOuterClass.TextPieceGift.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
getNameRefFieldBuilder();
}
}
@java.lang.Override
public Builder clear() {
super.clear();
bitField0_ = 0;
giftId_ = 0L;
nameRef_ = null;
if (nameRefBuilder_ != null) {
nameRefBuilder_.dispose();
nameRefBuilder_ = null;
}
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceGiftOuterClass.internal_static_TextPieceGift_descriptor;
}
@java.lang.Override
public tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceGiftOuterClass.TextPieceGift getDefaultInstanceForType() {
return tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceGiftOuterClass.TextPieceGift.getDefaultInstance();
}
@java.lang.Override
public tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceGiftOuterClass.TextPieceGift build() {
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceGiftOuterClass.TextPieceGift result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceGiftOuterClass.TextPieceGift buildPartial() {
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceGiftOuterClass.TextPieceGift result = new tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceGiftOuterClass.TextPieceGift(this);
if (bitField0_ != 0) { buildPartial0(result); }
onBuilt();
return result;
}
private void buildPartial0(tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceGiftOuterClass.TextPieceGift result) {
int from_bitField0_ = bitField0_;
if (((from_bitField0_ & 0x00000001) != 0)) {
result.giftId_ = giftId_;
}
int to_bitField0_ = 0;
if (((from_bitField0_ & 0x00000002) != 0)) {
result.nameRef_ = nameRefBuilder_ == null
? nameRef_
: nameRefBuilder_.build();
to_bitField0_ |= 0x00000001;
}
result.bitField0_ |= to_bitField0_;
}
@java.lang.Override
public Builder clone() {
return super.clone();
}
@java.lang.Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.setField(field, value);
}
@java.lang.Override
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, java.lang.Object value) {
return super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.addRepeatedField(field, value);
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceGiftOuterClass.TextPieceGift) {
return mergeFrom((tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceGiftOuterClass.TextPieceGift)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceGiftOuterClass.TextPieceGift other) {
if (other == tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceGiftOuterClass.TextPieceGift.getDefaultInstance()) return this;
if (other.getGiftId() != 0L) {
setGiftId(other.getGiftId());
}
if (other.hasNameRef()) {
mergeNameRef(other.getNameRef());
}
this.mergeUnknownFields(other.getUnknownFields());
onChanged();
return this;
}
@java.lang.Override
public final boolean isInitialized() {
return true;
}
@java.lang.Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 8: {
giftId_ = input.readUInt64();
bitField0_ |= 0x00000001;
break;
} // case 8
case 18: {
input.readMessage(
getNameRefFieldBuilder().getBuilder(),
extensionRegistry);
bitField0_ |= 0x00000002;
break;
} // case 18
default: {
if (!super.parseUnknownField(input, extensionRegistry, tag)) {
done = true; // was an endgroup tag
}
break;
} // default:
} // switch (tag)
} // while (!done)
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.unwrapIOException();
} finally {
onChanged();
} // finally
return this;
}
private int bitField0_;
private long giftId_ ;
/**
* <code>uint64 gift_id = 1;</code>
* @return The giftId.
*/
@java.lang.Override
public long getGiftId() {
return giftId_;
}
/**
* <code>uint64 gift_id = 1;</code>
* @param value The giftId to set.
* @return This builder for chaining.
*/
public Builder setGiftId(long value) {
giftId_ = value;
bitField0_ |= 0x00000001;
onChanged();
return this;
}
/**
* <code>uint64 gift_id = 1;</code>
* @return This builder for chaining.
*/
public Builder clearGiftId() {
bitField0_ = (bitField0_ & ~0x00000001);
giftId_ = 0L;
onChanged();
return this;
}
private tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.PatternRefOuterClass.PatternRef nameRef_;
private com.google.protobuf.SingleFieldBuilderV3<
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.PatternRefOuterClass.PatternRef, tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.PatternRefOuterClass.PatternRef.Builder, tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.PatternRefOuterClass.PatternRefOrBuilder> nameRefBuilder_;
/**
* <code>.PatternRef name_ref = 2;</code>
* @return Whether the nameRef field is set.
*/
public boolean hasNameRef() {
return ((bitField0_ & 0x00000002) != 0);
}
/**
* <code>.PatternRef name_ref = 2;</code>
* @return The nameRef.
*/
public tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.PatternRefOuterClass.PatternRef getNameRef() {
if (nameRefBuilder_ == null) {
return nameRef_ == null ? tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.PatternRefOuterClass.PatternRef.getDefaultInstance() : nameRef_;
} else {
return nameRefBuilder_.getMessage();
}
}
/**
* <code>.PatternRef name_ref = 2;</code>
*/
public Builder setNameRef(tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.PatternRefOuterClass.PatternRef value) {
if (nameRefBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
nameRef_ = value;
} else {
nameRefBuilder_.setMessage(value);
}
bitField0_ |= 0x00000002;
onChanged();
return this;
}
/**
* <code>.PatternRef name_ref = 2;</code>
*/
public Builder setNameRef(
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.PatternRefOuterClass.PatternRef.Builder builderForValue) {
if (nameRefBuilder_ == null) {
nameRef_ = builderForValue.build();
} else {
nameRefBuilder_.setMessage(builderForValue.build());
}
bitField0_ |= 0x00000002;
onChanged();
return this;
}
/**
* <code>.PatternRef name_ref = 2;</code>
*/
public Builder mergeNameRef(tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.PatternRefOuterClass.PatternRef value) {
if (nameRefBuilder_ == null) {
if (((bitField0_ & 0x00000002) != 0) &&
nameRef_ != null &&
nameRef_ != tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.PatternRefOuterClass.PatternRef.getDefaultInstance()) {
getNameRefBuilder().mergeFrom(value);
} else {
nameRef_ = value;
}
} else {
nameRefBuilder_.mergeFrom(value);
}
if (nameRef_ != null) {
bitField0_ |= 0x00000002;
onChanged();
}
return this;
}
/**
* <code>.PatternRef name_ref = 2;</code>
*/
public Builder clearNameRef() {
bitField0_ = (bitField0_ & ~0x00000002);
nameRef_ = null;
if (nameRefBuilder_ != null) {
nameRefBuilder_.dispose();
nameRefBuilder_ = null;
}
onChanged();
return this;
}
/**
* <code>.PatternRef name_ref = 2;</code>
*/
public tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.PatternRefOuterClass.PatternRef.Builder getNameRefBuilder() {
bitField0_ |= 0x00000002;
onChanged();
return getNameRefFieldBuilder().getBuilder();
}
/**
* <code>.PatternRef name_ref = 2;</code>
*/
public tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.PatternRefOuterClass.PatternRefOrBuilder getNameRefOrBuilder() {
if (nameRefBuilder_ != null) {
return nameRefBuilder_.getMessageOrBuilder();
} else {
return nameRef_ == null ?
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.PatternRefOuterClass.PatternRef.getDefaultInstance() : nameRef_;
}
}
/**
* <code>.PatternRef name_ref = 2;</code>
*/
private com.google.protobuf.SingleFieldBuilderV3<
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.PatternRefOuterClass.PatternRef, tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.PatternRefOuterClass.PatternRef.Builder, tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.PatternRefOuterClass.PatternRefOrBuilder>
getNameRefFieldBuilder() {
if (nameRefBuilder_ == null) {
nameRefBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.PatternRefOuterClass.PatternRef, tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.PatternRefOuterClass.PatternRef.Builder, tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.PatternRefOuterClass.PatternRefOrBuilder>(
getNameRef(),
getParentForChildren(),
isClean());
nameRef_ = null;
}
return nameRefBuilder_;
}
@java.lang.Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@java.lang.Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:TextPieceGift)
}
// @@protoc_insertion_point(class_scope:TextPieceGift)
private static final tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceGiftOuterClass.TextPieceGift DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceGiftOuterClass.TextPieceGift();
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceGiftOuterClass.TextPieceGift getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser<TextPieceGift>
PARSER = new com.google.protobuf.AbstractParser<TextPieceGift>() {
@java.lang.Override
public TextPieceGift parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
Builder builder = newBuilder();
try {
builder.mergeFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(builder.buildPartial());
} catch (com.google.protobuf.UninitializedMessageException e) {
throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(e)
.setUnfinishedMessage(builder.buildPartial());
}
return builder.buildPartial();
}
};
public static com.google.protobuf.Parser<TextPieceGift> parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser<TextPieceGift> getParserForType() {
return PARSER;
}
@java.lang.Override
public tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceGiftOuterClass.TextPieceGift getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
private static final com.google.protobuf.Descriptors.Descriptor
internal_static_TextPieceGift_descriptor;
private static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_TextPieceGift_fieldAccessorTable;
public static com.google.protobuf.Descriptors.FileDescriptor
getDescriptor() {
return descriptor;
}
private static com.google.protobuf.Descriptors.FileDescriptor
descriptor;
static {
java.lang.String[] descriptorData = {
"\n\023TextPieceGift.proto\032\020PatternRef.proto\"" +
"?\n\rTextPieceGift\022\017\n\007gift_id\030\001 \001(\004\022\035\n\010nam" +
"e_ref\030\002 \001(\0132\013.PatternRefB>\n<tech.ordinar" +
"yroad.live.chat.client.codec.douyin.prot" +
"obuf.dtob\006proto3"
};
descriptor = com.google.protobuf.Descriptors.FileDescriptor
.internalBuildGeneratedFileFrom(descriptorData,
new com.google.protobuf.Descriptors.FileDescriptor[] {
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.PatternRefOuterClass.getDescriptor(),
});
internal_static_TextPieceGift_descriptor =
getDescriptor().getMessageTypes().get(0);
internal_static_TextPieceGift_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_TextPieceGift_descriptor,
new java.lang.String[] { "GiftId", "NameRef", });
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.PatternRefOuterClass.getDescriptor();
}
// @@protoc_insertion_point(outer_class_scope)
}

@ -0,0 +1,626 @@
/*
* MIT License
*
* Copyright (c) 2023 OrdinaryRoad
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: TextPieceHeart.proto
// Protobuf Java Version: 3.25.3
package tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto;
public final class TextPieceHeartOuterClass {
private TextPieceHeartOuterClass() {}
public static void registerAllExtensions(
com.google.protobuf.ExtensionRegistryLite registry) {
}
public static void registerAllExtensions(
com.google.protobuf.ExtensionRegistry registry) {
registerAllExtensions(
(com.google.protobuf.ExtensionRegistryLite) registry);
}
public interface TextPieceHeartOrBuilder extends
// @@protoc_insertion_point(interface_extends:TextPieceHeart)
com.google.protobuf.MessageOrBuilder {
/**
* <code>string color = 1;</code>
* @return The color.
*/
java.lang.String getColor();
/**
* <code>string color = 1;</code>
* @return The bytes for color.
*/
com.google.protobuf.ByteString
getColorBytes();
}
/**
* Protobuf type {@code TextPieceHeart}
*/
public static final class TextPieceHeart extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:TextPieceHeart)
TextPieceHeartOrBuilder {
private static final long serialVersionUID = 0L;
// Use TextPieceHeart.newBuilder() to construct.
private TextPieceHeart(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
super(builder);
}
private TextPieceHeart() {
color_ = "";
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(
UnusedPrivateParameter unused) {
return new TextPieceHeart();
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceHeartOuterClass.internal_static_TextPieceHeart_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceHeartOuterClass.internal_static_TextPieceHeart_fieldAccessorTable
.ensureFieldAccessorsInitialized(
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceHeartOuterClass.TextPieceHeart.class, tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceHeartOuterClass.TextPieceHeart.Builder.class);
}
public static final int COLOR_FIELD_NUMBER = 1;
@SuppressWarnings("serial")
private volatile java.lang.Object color_ = "";
/**
* <code>string color = 1;</code>
* @return The color.
*/
@java.lang.Override
public java.lang.String getColor() {
java.lang.Object ref = color_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
color_ = s;
return s;
}
}
/**
* <code>string color = 1;</code>
* @return The bytes for color.
*/
@java.lang.Override
public com.google.protobuf.ByteString
getColorBytes() {
java.lang.Object ref = color_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
color_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
private byte memoizedIsInitialized = -1;
@java.lang.Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(color_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, color_);
}
getUnknownFields().writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(color_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, color_);
}
size += getUnknownFields().getSerializedSize();
memoizedSize = size;
return size;
}
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceHeartOuterClass.TextPieceHeart)) {
return super.equals(obj);
}
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceHeartOuterClass.TextPieceHeart other = (tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceHeartOuterClass.TextPieceHeart) obj;
if (!getColor()
.equals(other.getColor())) return false;
if (!getUnknownFields().equals(other.getUnknownFields())) return false;
return true;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
hash = (37 * hash) + COLOR_FIELD_NUMBER;
hash = (53 * hash) + getColor().hashCode();
hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceHeartOuterClass.TextPieceHeart parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceHeartOuterClass.TextPieceHeart parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceHeartOuterClass.TextPieceHeart parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceHeartOuterClass.TextPieceHeart parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceHeartOuterClass.TextPieceHeart parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceHeartOuterClass.TextPieceHeart parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceHeartOuterClass.TextPieceHeart parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceHeartOuterClass.TextPieceHeart parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceHeartOuterClass.TextPieceHeart parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceHeartOuterClass.TextPieceHeart parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceHeartOuterClass.TextPieceHeart parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceHeartOuterClass.TextPieceHeart parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
@java.lang.Override
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceHeartOuterClass.TextPieceHeart prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@java.lang.Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* Protobuf type {@code TextPieceHeart}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
// @@protoc_insertion_point(builder_implements:TextPieceHeart)
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceHeartOuterClass.TextPieceHeartOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceHeartOuterClass.internal_static_TextPieceHeart_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceHeartOuterClass.internal_static_TextPieceHeart_fieldAccessorTable
.ensureFieldAccessorsInitialized(
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceHeartOuterClass.TextPieceHeart.class, tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceHeartOuterClass.TextPieceHeart.Builder.class);
}
// Construct using tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceHeartOuterClass.TextPieceHeart.newBuilder()
private Builder() {
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
}
@java.lang.Override
public Builder clear() {
super.clear();
bitField0_ = 0;
color_ = "";
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceHeartOuterClass.internal_static_TextPieceHeart_descriptor;
}
@java.lang.Override
public tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceHeartOuterClass.TextPieceHeart getDefaultInstanceForType() {
return tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceHeartOuterClass.TextPieceHeart.getDefaultInstance();
}
@java.lang.Override
public tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceHeartOuterClass.TextPieceHeart build() {
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceHeartOuterClass.TextPieceHeart result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceHeartOuterClass.TextPieceHeart buildPartial() {
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceHeartOuterClass.TextPieceHeart result = new tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceHeartOuterClass.TextPieceHeart(this);
if (bitField0_ != 0) { buildPartial0(result); }
onBuilt();
return result;
}
private void buildPartial0(tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceHeartOuterClass.TextPieceHeart result) {
int from_bitField0_ = bitField0_;
if (((from_bitField0_ & 0x00000001) != 0)) {
result.color_ = color_;
}
}
@java.lang.Override
public Builder clone() {
return super.clone();
}
@java.lang.Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.setField(field, value);
}
@java.lang.Override
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, java.lang.Object value) {
return super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.addRepeatedField(field, value);
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceHeartOuterClass.TextPieceHeart) {
return mergeFrom((tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceHeartOuterClass.TextPieceHeart)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceHeartOuterClass.TextPieceHeart other) {
if (other == tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceHeartOuterClass.TextPieceHeart.getDefaultInstance()) return this;
if (!other.getColor().isEmpty()) {
color_ = other.color_;
bitField0_ |= 0x00000001;
onChanged();
}
this.mergeUnknownFields(other.getUnknownFields());
onChanged();
return this;
}
@java.lang.Override
public final boolean isInitialized() {
return true;
}
@java.lang.Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 10: {
color_ = input.readStringRequireUtf8();
bitField0_ |= 0x00000001;
break;
} // case 10
default: {
if (!super.parseUnknownField(input, extensionRegistry, tag)) {
done = true; // was an endgroup tag
}
break;
} // default:
} // switch (tag)
} // while (!done)
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.unwrapIOException();
} finally {
onChanged();
} // finally
return this;
}
private int bitField0_;
private java.lang.Object color_ = "";
/**
* <code>string color = 1;</code>
* @return The color.
*/
public java.lang.String getColor() {
java.lang.Object ref = color_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
color_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
* <code>string color = 1;</code>
* @return The bytes for color.
*/
public com.google.protobuf.ByteString
getColorBytes() {
java.lang.Object ref = color_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
color_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <code>string color = 1;</code>
* @param value The color to set.
* @return This builder for chaining.
*/
public Builder setColor(
java.lang.String value) {
if (value == null) { throw new NullPointerException(); }
color_ = value;
bitField0_ |= 0x00000001;
onChanged();
return this;
}
/**
* <code>string color = 1;</code>
* @return This builder for chaining.
*/
public Builder clearColor() {
color_ = getDefaultInstance().getColor();
bitField0_ = (bitField0_ & ~0x00000001);
onChanged();
return this;
}
/**
* <code>string color = 1;</code>
* @param value The bytes for color to set.
* @return This builder for chaining.
*/
public Builder setColorBytes(
com.google.protobuf.ByteString value) {
if (value == null) { throw new NullPointerException(); }
checkByteStringIsUtf8(value);
color_ = value;
bitField0_ |= 0x00000001;
onChanged();
return this;
}
@java.lang.Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@java.lang.Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:TextPieceHeart)
}
// @@protoc_insertion_point(class_scope:TextPieceHeart)
private static final tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceHeartOuterClass.TextPieceHeart DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceHeartOuterClass.TextPieceHeart();
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceHeartOuterClass.TextPieceHeart getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser<TextPieceHeart>
PARSER = new com.google.protobuf.AbstractParser<TextPieceHeart>() {
@java.lang.Override
public TextPieceHeart parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
Builder builder = newBuilder();
try {
builder.mergeFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(builder.buildPartial());
} catch (com.google.protobuf.UninitializedMessageException e) {
throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(e)
.setUnfinishedMessage(builder.buildPartial());
}
return builder.buildPartial();
}
};
public static com.google.protobuf.Parser<TextPieceHeart> parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser<TextPieceHeart> getParserForType() {
return PARSER;
}
@java.lang.Override
public tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceHeartOuterClass.TextPieceHeart getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
private static final com.google.protobuf.Descriptors.Descriptor
internal_static_TextPieceHeart_descriptor;
private static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_TextPieceHeart_fieldAccessorTable;
public static com.google.protobuf.Descriptors.FileDescriptor
getDescriptor() {
return descriptor;
}
private static com.google.protobuf.Descriptors.FileDescriptor
descriptor;
static {
java.lang.String[] descriptorData = {
"\n\024TextPieceHeart.proto\"\037\n\016TextPieceHeart" +
"\022\r\n\005color\030\001 \001(\tB>\n<tech.ordinaryroad.liv" +
"e.chat.client.codec.douyin.protobuf.dtob" +
"\006proto3"
};
descriptor = com.google.protobuf.Descriptors.FileDescriptor
.internalBuildGeneratedFileFrom(descriptorData,
new com.google.protobuf.Descriptors.FileDescriptor[] {
});
internal_static_TextPieceHeart_descriptor =
getDescriptor().getMessageTypes().get(0);
internal_static_TextPieceHeart_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_TextPieceHeart_descriptor,
new java.lang.String[] { "Color", });
}
// @@protoc_insertion_point(outer_class_scope)
}

@ -0,0 +1,763 @@
/*
* MIT License
*
* Copyright (c) 2023 OrdinaryRoad
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: TextPieceImage.proto
// Protobuf Java Version: 3.25.3
package tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto;
public final class TextPieceImageOuterClass {
private TextPieceImageOuterClass() {}
public static void registerAllExtensions(
com.google.protobuf.ExtensionRegistryLite registry) {
}
public static void registerAllExtensions(
com.google.protobuf.ExtensionRegistry registry) {
registerAllExtensions(
(com.google.protobuf.ExtensionRegistryLite) registry);
}
public interface TextPieceImageOrBuilder extends
// @@protoc_insertion_point(interface_extends:TextPieceImage)
com.google.protobuf.MessageOrBuilder {
/**
* <code>.Image image = 1;</code>
* @return Whether the image field is set.
*/
boolean hasImage();
/**
* <code>.Image image = 1;</code>
* @return The image.
*/
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.ImageOuterClass.Image getImage();
/**
* <code>.Image image = 1;</code>
*/
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder getImageOrBuilder();
/**
* <code>float scaling_rate = 2;</code>
* @return The scalingRate.
*/
float getScalingRate();
}
/**
* Protobuf type {@code TextPieceImage}
*/
public static final class TextPieceImage extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:TextPieceImage)
TextPieceImageOrBuilder {
private static final long serialVersionUID = 0L;
// Use TextPieceImage.newBuilder() to construct.
private TextPieceImage(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
super(builder);
}
private TextPieceImage() {
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(
UnusedPrivateParameter unused) {
return new TextPieceImage();
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceImageOuterClass.internal_static_TextPieceImage_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceImageOuterClass.internal_static_TextPieceImage_fieldAccessorTable
.ensureFieldAccessorsInitialized(
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceImageOuterClass.TextPieceImage.class, tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceImageOuterClass.TextPieceImage.Builder.class);
}
private int bitField0_;
public static final int IMAGE_FIELD_NUMBER = 1;
private tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.ImageOuterClass.Image image_;
/**
* <code>.Image image = 1;</code>
* @return Whether the image field is set.
*/
@java.lang.Override
public boolean hasImage() {
return ((bitField0_ & 0x00000001) != 0);
}
/**
* <code>.Image image = 1;</code>
* @return The image.
*/
@java.lang.Override
public tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.ImageOuterClass.Image getImage() {
return image_ == null ? tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : image_;
}
/**
* <code>.Image image = 1;</code>
*/
@java.lang.Override
public tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder getImageOrBuilder() {
return image_ == null ? tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : image_;
}
public static final int SCALING_RATE_FIELD_NUMBER = 2;
private float scalingRate_ = 0F;
/**
* <code>float scaling_rate = 2;</code>
* @return The scalingRate.
*/
@java.lang.Override
public float getScalingRate() {
return scalingRate_;
}
private byte memoizedIsInitialized = -1;
@java.lang.Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
if (((bitField0_ & 0x00000001) != 0)) {
output.writeMessage(1, getImage());
}
if (java.lang.Float.floatToRawIntBits(scalingRate_) != 0) {
output.writeFloat(2, scalingRate_);
}
getUnknownFields().writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (((bitField0_ & 0x00000001) != 0)) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(1, getImage());
}
if (java.lang.Float.floatToRawIntBits(scalingRate_) != 0) {
size += com.google.protobuf.CodedOutputStream
.computeFloatSize(2, scalingRate_);
}
size += getUnknownFields().getSerializedSize();
memoizedSize = size;
return size;
}
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceImageOuterClass.TextPieceImage)) {
return super.equals(obj);
}
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceImageOuterClass.TextPieceImage other = (tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceImageOuterClass.TextPieceImage) obj;
if (hasImage() != other.hasImage()) return false;
if (hasImage()) {
if (!getImage()
.equals(other.getImage())) return false;
}
if (java.lang.Float.floatToIntBits(getScalingRate())
!= java.lang.Float.floatToIntBits(
other.getScalingRate())) return false;
if (!getUnknownFields().equals(other.getUnknownFields())) return false;
return true;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
if (hasImage()) {
hash = (37 * hash) + IMAGE_FIELD_NUMBER;
hash = (53 * hash) + getImage().hashCode();
}
hash = (37 * hash) + SCALING_RATE_FIELD_NUMBER;
hash = (53 * hash) + java.lang.Float.floatToIntBits(
getScalingRate());
hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceImageOuterClass.TextPieceImage parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceImageOuterClass.TextPieceImage parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceImageOuterClass.TextPieceImage parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceImageOuterClass.TextPieceImage parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceImageOuterClass.TextPieceImage parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceImageOuterClass.TextPieceImage parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceImageOuterClass.TextPieceImage parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceImageOuterClass.TextPieceImage parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceImageOuterClass.TextPieceImage parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceImageOuterClass.TextPieceImage parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceImageOuterClass.TextPieceImage parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceImageOuterClass.TextPieceImage parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
@java.lang.Override
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceImageOuterClass.TextPieceImage prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@java.lang.Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* Protobuf type {@code TextPieceImage}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
// @@protoc_insertion_point(builder_implements:TextPieceImage)
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceImageOuterClass.TextPieceImageOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceImageOuterClass.internal_static_TextPieceImage_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceImageOuterClass.internal_static_TextPieceImage_fieldAccessorTable
.ensureFieldAccessorsInitialized(
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceImageOuterClass.TextPieceImage.class, tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceImageOuterClass.TextPieceImage.Builder.class);
}
// Construct using tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceImageOuterClass.TextPieceImage.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
getImageFieldBuilder();
}
}
@java.lang.Override
public Builder clear() {
super.clear();
bitField0_ = 0;
image_ = null;
if (imageBuilder_ != null) {
imageBuilder_.dispose();
imageBuilder_ = null;
}
scalingRate_ = 0F;
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceImageOuterClass.internal_static_TextPieceImage_descriptor;
}
@java.lang.Override
public tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceImageOuterClass.TextPieceImage getDefaultInstanceForType() {
return tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceImageOuterClass.TextPieceImage.getDefaultInstance();
}
@java.lang.Override
public tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceImageOuterClass.TextPieceImage build() {
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceImageOuterClass.TextPieceImage result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceImageOuterClass.TextPieceImage buildPartial() {
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceImageOuterClass.TextPieceImage result = new tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceImageOuterClass.TextPieceImage(this);
if (bitField0_ != 0) { buildPartial0(result); }
onBuilt();
return result;
}
private void buildPartial0(tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceImageOuterClass.TextPieceImage result) {
int from_bitField0_ = bitField0_;
int to_bitField0_ = 0;
if (((from_bitField0_ & 0x00000001) != 0)) {
result.image_ = imageBuilder_ == null
? image_
: imageBuilder_.build();
to_bitField0_ |= 0x00000001;
}
if (((from_bitField0_ & 0x00000002) != 0)) {
result.scalingRate_ = scalingRate_;
}
result.bitField0_ |= to_bitField0_;
}
@java.lang.Override
public Builder clone() {
return super.clone();
}
@java.lang.Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.setField(field, value);
}
@java.lang.Override
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, java.lang.Object value) {
return super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.addRepeatedField(field, value);
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceImageOuterClass.TextPieceImage) {
return mergeFrom((tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceImageOuterClass.TextPieceImage)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceImageOuterClass.TextPieceImage other) {
if (other == tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceImageOuterClass.TextPieceImage.getDefaultInstance()) return this;
if (other.hasImage()) {
mergeImage(other.getImage());
}
if (other.getScalingRate() != 0F) {
setScalingRate(other.getScalingRate());
}
this.mergeUnknownFields(other.getUnknownFields());
onChanged();
return this;
}
@java.lang.Override
public final boolean isInitialized() {
return true;
}
@java.lang.Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 10: {
input.readMessage(
getImageFieldBuilder().getBuilder(),
extensionRegistry);
bitField0_ |= 0x00000001;
break;
} // case 10
case 21: {
scalingRate_ = input.readFloat();
bitField0_ |= 0x00000002;
break;
} // case 21
default: {
if (!super.parseUnknownField(input, extensionRegistry, tag)) {
done = true; // was an endgroup tag
}
break;
} // default:
} // switch (tag)
} // while (!done)
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.unwrapIOException();
} finally {
onChanged();
} // finally
return this;
}
private int bitField0_;
private tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.ImageOuterClass.Image image_;
private com.google.protobuf.SingleFieldBuilderV3<
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.ImageOuterClass.Image, tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.ImageOuterClass.Image.Builder, tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder> imageBuilder_;
/**
* <code>.Image image = 1;</code>
* @return Whether the image field is set.
*/
public boolean hasImage() {
return ((bitField0_ & 0x00000001) != 0);
}
/**
* <code>.Image image = 1;</code>
* @return The image.
*/
public tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.ImageOuterClass.Image getImage() {
if (imageBuilder_ == null) {
return image_ == null ? tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : image_;
} else {
return imageBuilder_.getMessage();
}
}
/**
* <code>.Image image = 1;</code>
*/
public Builder setImage(tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.ImageOuterClass.Image value) {
if (imageBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
image_ = value;
} else {
imageBuilder_.setMessage(value);
}
bitField0_ |= 0x00000001;
onChanged();
return this;
}
/**
* <code>.Image image = 1;</code>
*/
public Builder setImage(
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.ImageOuterClass.Image.Builder builderForValue) {
if (imageBuilder_ == null) {
image_ = builderForValue.build();
} else {
imageBuilder_.setMessage(builderForValue.build());
}
bitField0_ |= 0x00000001;
onChanged();
return this;
}
/**
* <code>.Image image = 1;</code>
*/
public Builder mergeImage(tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.ImageOuterClass.Image value) {
if (imageBuilder_ == null) {
if (((bitField0_ & 0x00000001) != 0) &&
image_ != null &&
image_ != tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance()) {
getImageBuilder().mergeFrom(value);
} else {
image_ = value;
}
} else {
imageBuilder_.mergeFrom(value);
}
if (image_ != null) {
bitField0_ |= 0x00000001;
onChanged();
}
return this;
}
/**
* <code>.Image image = 1;</code>
*/
public Builder clearImage() {
bitField0_ = (bitField0_ & ~0x00000001);
image_ = null;
if (imageBuilder_ != null) {
imageBuilder_.dispose();
imageBuilder_ = null;
}
onChanged();
return this;
}
/**
* <code>.Image image = 1;</code>
*/
public tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.ImageOuterClass.Image.Builder getImageBuilder() {
bitField0_ |= 0x00000001;
onChanged();
return getImageFieldBuilder().getBuilder();
}
/**
* <code>.Image image = 1;</code>
*/
public tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder getImageOrBuilder() {
if (imageBuilder_ != null) {
return imageBuilder_.getMessageOrBuilder();
} else {
return image_ == null ?
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : image_;
}
}
/**
* <code>.Image image = 1;</code>
*/
private com.google.protobuf.SingleFieldBuilderV3<
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.ImageOuterClass.Image, tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.ImageOuterClass.Image.Builder, tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder>
getImageFieldBuilder() {
if (imageBuilder_ == null) {
imageBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.ImageOuterClass.Image, tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.ImageOuterClass.Image.Builder, tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder>(
getImage(),
getParentForChildren(),
isClean());
image_ = null;
}
return imageBuilder_;
}
private float scalingRate_ ;
/**
* <code>float scaling_rate = 2;</code>
* @return The scalingRate.
*/
@java.lang.Override
public float getScalingRate() {
return scalingRate_;
}
/**
* <code>float scaling_rate = 2;</code>
* @param value The scalingRate to set.
* @return This builder for chaining.
*/
public Builder setScalingRate(float value) {
scalingRate_ = value;
bitField0_ |= 0x00000002;
onChanged();
return this;
}
/**
* <code>float scaling_rate = 2;</code>
* @return This builder for chaining.
*/
public Builder clearScalingRate() {
bitField0_ = (bitField0_ & ~0x00000002);
scalingRate_ = 0F;
onChanged();
return this;
}
@java.lang.Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@java.lang.Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:TextPieceImage)
}
// @@protoc_insertion_point(class_scope:TextPieceImage)
private static final tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceImageOuterClass.TextPieceImage DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceImageOuterClass.TextPieceImage();
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceImageOuterClass.TextPieceImage getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser<TextPieceImage>
PARSER = new com.google.protobuf.AbstractParser<TextPieceImage>() {
@java.lang.Override
public TextPieceImage parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
Builder builder = newBuilder();
try {
builder.mergeFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(builder.buildPartial());
} catch (com.google.protobuf.UninitializedMessageException e) {
throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(e)
.setUnfinishedMessage(builder.buildPartial());
}
return builder.buildPartial();
}
};
public static com.google.protobuf.Parser<TextPieceImage> parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser<TextPieceImage> getParserForType() {
return PARSER;
}
@java.lang.Override
public tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceImageOuterClass.TextPieceImage getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
private static final com.google.protobuf.Descriptors.Descriptor
internal_static_TextPieceImage_descriptor;
private static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_TextPieceImage_fieldAccessorTable;
public static com.google.protobuf.Descriptors.FileDescriptor
getDescriptor() {
return descriptor;
}
private static com.google.protobuf.Descriptors.FileDescriptor
descriptor;
static {
java.lang.String[] descriptorData = {
"\n\024TextPieceImage.proto\032\013Image.proto\"=\n\016T" +
"extPieceImage\022\025\n\005image\030\001 \001(\0132\006.Image\022\024\n\014" +
"scaling_rate\030\002 \001(\002B>\n<tech.ordinaryroad." +
"live.chat.client.codec.douyin.protobuf.d" +
"tob\006proto3"
};
descriptor = com.google.protobuf.Descriptors.FileDescriptor
.internalBuildGeneratedFileFrom(descriptorData,
new com.google.protobuf.Descriptors.FileDescriptor[] {
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.ImageOuterClass.getDescriptor(),
});
internal_static_TextPieceImage_descriptor =
getDescriptor().getMessageTypes().get(0);
internal_static_TextPieceImage_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_TextPieceImage_descriptor,
new java.lang.String[] { "Image", "ScalingRate", });
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.ImageOuterClass.getDescriptor();
}
// @@protoc_insertion_point(outer_class_scope)
}

@ -0,0 +1,774 @@
/*
* MIT License
*
* Copyright (c) 2023 OrdinaryRoad
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: TextPiecePatternRef.proto
// Protobuf Java Version: 3.25.3
package tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto;
public final class TextPiecePatternRefOuterClass {
private TextPiecePatternRefOuterClass() {}
public static void registerAllExtensions(
com.google.protobuf.ExtensionRegistryLite registry) {
}
public static void registerAllExtensions(
com.google.protobuf.ExtensionRegistry registry) {
registerAllExtensions(
(com.google.protobuf.ExtensionRegistryLite) registry);
}
public interface TextPiecePatternRefOrBuilder extends
// @@protoc_insertion_point(interface_extends:TextPiecePatternRef)
com.google.protobuf.MessageOrBuilder {
/**
* <code>string key = 1;</code>
* @return The key.
*/
java.lang.String getKey();
/**
* <code>string key = 1;</code>
* @return The bytes for key.
*/
com.google.protobuf.ByteString
getKeyBytes();
/**
* <code>string default_pattern = 2;</code>
* @return The defaultPattern.
*/
java.lang.String getDefaultPattern();
/**
* <code>string default_pattern = 2;</code>
* @return The bytes for defaultPattern.
*/
com.google.protobuf.ByteString
getDefaultPatternBytes();
}
/**
* Protobuf type {@code TextPiecePatternRef}
*/
public static final class TextPiecePatternRef extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:TextPiecePatternRef)
TextPiecePatternRefOrBuilder {
private static final long serialVersionUID = 0L;
// Use TextPiecePatternRef.newBuilder() to construct.
private TextPiecePatternRef(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
super(builder);
}
private TextPiecePatternRef() {
key_ = "";
defaultPattern_ = "";
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(
UnusedPrivateParameter unused) {
return new TextPiecePatternRef();
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPiecePatternRefOuterClass.internal_static_TextPiecePatternRef_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPiecePatternRefOuterClass.internal_static_TextPiecePatternRef_fieldAccessorTable
.ensureFieldAccessorsInitialized(
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPiecePatternRefOuterClass.TextPiecePatternRef.class, tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPiecePatternRefOuterClass.TextPiecePatternRef.Builder.class);
}
public static final int KEY_FIELD_NUMBER = 1;
@SuppressWarnings("serial")
private volatile java.lang.Object key_ = "";
/**
* <code>string key = 1;</code>
* @return The key.
*/
@java.lang.Override
public java.lang.String getKey() {
java.lang.Object ref = key_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
key_ = s;
return s;
}
}
/**
* <code>string key = 1;</code>
* @return The bytes for key.
*/
@java.lang.Override
public com.google.protobuf.ByteString
getKeyBytes() {
java.lang.Object ref = key_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
key_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int DEFAULT_PATTERN_FIELD_NUMBER = 2;
@SuppressWarnings("serial")
private volatile java.lang.Object defaultPattern_ = "";
/**
* <code>string default_pattern = 2;</code>
* @return The defaultPattern.
*/
@java.lang.Override
public java.lang.String getDefaultPattern() {
java.lang.Object ref = defaultPattern_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
defaultPattern_ = s;
return s;
}
}
/**
* <code>string default_pattern = 2;</code>
* @return The bytes for defaultPattern.
*/
@java.lang.Override
public com.google.protobuf.ByteString
getDefaultPatternBytes() {
java.lang.Object ref = defaultPattern_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
defaultPattern_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
private byte memoizedIsInitialized = -1;
@java.lang.Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(key_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, key_);
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(defaultPattern_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 2, defaultPattern_);
}
getUnknownFields().writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(key_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, key_);
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(defaultPattern_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, defaultPattern_);
}
size += getUnknownFields().getSerializedSize();
memoizedSize = size;
return size;
}
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPiecePatternRefOuterClass.TextPiecePatternRef)) {
return super.equals(obj);
}
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPiecePatternRefOuterClass.TextPiecePatternRef other = (tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPiecePatternRefOuterClass.TextPiecePatternRef) obj;
if (!getKey()
.equals(other.getKey())) return false;
if (!getDefaultPattern()
.equals(other.getDefaultPattern())) return false;
if (!getUnknownFields().equals(other.getUnknownFields())) return false;
return true;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
hash = (37 * hash) + KEY_FIELD_NUMBER;
hash = (53 * hash) + getKey().hashCode();
hash = (37 * hash) + DEFAULT_PATTERN_FIELD_NUMBER;
hash = (53 * hash) + getDefaultPattern().hashCode();
hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPiecePatternRefOuterClass.TextPiecePatternRef parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPiecePatternRefOuterClass.TextPiecePatternRef parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPiecePatternRefOuterClass.TextPiecePatternRef parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPiecePatternRefOuterClass.TextPiecePatternRef parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPiecePatternRefOuterClass.TextPiecePatternRef parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPiecePatternRefOuterClass.TextPiecePatternRef parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPiecePatternRefOuterClass.TextPiecePatternRef parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPiecePatternRefOuterClass.TextPiecePatternRef parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPiecePatternRefOuterClass.TextPiecePatternRef parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPiecePatternRefOuterClass.TextPiecePatternRef parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPiecePatternRefOuterClass.TextPiecePatternRef parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPiecePatternRefOuterClass.TextPiecePatternRef parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
@java.lang.Override
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPiecePatternRefOuterClass.TextPiecePatternRef prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@java.lang.Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* Protobuf type {@code TextPiecePatternRef}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
// @@protoc_insertion_point(builder_implements:TextPiecePatternRef)
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPiecePatternRefOuterClass.TextPiecePatternRefOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPiecePatternRefOuterClass.internal_static_TextPiecePatternRef_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPiecePatternRefOuterClass.internal_static_TextPiecePatternRef_fieldAccessorTable
.ensureFieldAccessorsInitialized(
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPiecePatternRefOuterClass.TextPiecePatternRef.class, tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPiecePatternRefOuterClass.TextPiecePatternRef.Builder.class);
}
// Construct using tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPiecePatternRefOuterClass.TextPiecePatternRef.newBuilder()
private Builder() {
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
}
@java.lang.Override
public Builder clear() {
super.clear();
bitField0_ = 0;
key_ = "";
defaultPattern_ = "";
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPiecePatternRefOuterClass.internal_static_TextPiecePatternRef_descriptor;
}
@java.lang.Override
public tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPiecePatternRefOuterClass.TextPiecePatternRef getDefaultInstanceForType() {
return tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPiecePatternRefOuterClass.TextPiecePatternRef.getDefaultInstance();
}
@java.lang.Override
public tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPiecePatternRefOuterClass.TextPiecePatternRef build() {
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPiecePatternRefOuterClass.TextPiecePatternRef result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPiecePatternRefOuterClass.TextPiecePatternRef buildPartial() {
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPiecePatternRefOuterClass.TextPiecePatternRef result = new tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPiecePatternRefOuterClass.TextPiecePatternRef(this);
if (bitField0_ != 0) { buildPartial0(result); }
onBuilt();
return result;
}
private void buildPartial0(tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPiecePatternRefOuterClass.TextPiecePatternRef result) {
int from_bitField0_ = bitField0_;
if (((from_bitField0_ & 0x00000001) != 0)) {
result.key_ = key_;
}
if (((from_bitField0_ & 0x00000002) != 0)) {
result.defaultPattern_ = defaultPattern_;
}
}
@java.lang.Override
public Builder clone() {
return super.clone();
}
@java.lang.Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.setField(field, value);
}
@java.lang.Override
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, java.lang.Object value) {
return super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.addRepeatedField(field, value);
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPiecePatternRefOuterClass.TextPiecePatternRef) {
return mergeFrom((tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPiecePatternRefOuterClass.TextPiecePatternRef)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPiecePatternRefOuterClass.TextPiecePatternRef other) {
if (other == tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPiecePatternRefOuterClass.TextPiecePatternRef.getDefaultInstance()) return this;
if (!other.getKey().isEmpty()) {
key_ = other.key_;
bitField0_ |= 0x00000001;
onChanged();
}
if (!other.getDefaultPattern().isEmpty()) {
defaultPattern_ = other.defaultPattern_;
bitField0_ |= 0x00000002;
onChanged();
}
this.mergeUnknownFields(other.getUnknownFields());
onChanged();
return this;
}
@java.lang.Override
public final boolean isInitialized() {
return true;
}
@java.lang.Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 10: {
key_ = input.readStringRequireUtf8();
bitField0_ |= 0x00000001;
break;
} // case 10
case 18: {
defaultPattern_ = input.readStringRequireUtf8();
bitField0_ |= 0x00000002;
break;
} // case 18
default: {
if (!super.parseUnknownField(input, extensionRegistry, tag)) {
done = true; // was an endgroup tag
}
break;
} // default:
} // switch (tag)
} // while (!done)
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.unwrapIOException();
} finally {
onChanged();
} // finally
return this;
}
private int bitField0_;
private java.lang.Object key_ = "";
/**
* <code>string key = 1;</code>
* @return The key.
*/
public java.lang.String getKey() {
java.lang.Object ref = key_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
key_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
* <code>string key = 1;</code>
* @return The bytes for key.
*/
public com.google.protobuf.ByteString
getKeyBytes() {
java.lang.Object ref = key_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
key_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <code>string key = 1;</code>
* @param value The key to set.
* @return This builder for chaining.
*/
public Builder setKey(
java.lang.String value) {
if (value == null) { throw new NullPointerException(); }
key_ = value;
bitField0_ |= 0x00000001;
onChanged();
return this;
}
/**
* <code>string key = 1;</code>
* @return This builder for chaining.
*/
public Builder clearKey() {
key_ = getDefaultInstance().getKey();
bitField0_ = (bitField0_ & ~0x00000001);
onChanged();
return this;
}
/**
* <code>string key = 1;</code>
* @param value The bytes for key to set.
* @return This builder for chaining.
*/
public Builder setKeyBytes(
com.google.protobuf.ByteString value) {
if (value == null) { throw new NullPointerException(); }
checkByteStringIsUtf8(value);
key_ = value;
bitField0_ |= 0x00000001;
onChanged();
return this;
}
private java.lang.Object defaultPattern_ = "";
/**
* <code>string default_pattern = 2;</code>
* @return The defaultPattern.
*/
public java.lang.String getDefaultPattern() {
java.lang.Object ref = defaultPattern_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
defaultPattern_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
* <code>string default_pattern = 2;</code>
* @return The bytes for defaultPattern.
*/
public com.google.protobuf.ByteString
getDefaultPatternBytes() {
java.lang.Object ref = defaultPattern_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
defaultPattern_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <code>string default_pattern = 2;</code>
* @param value The defaultPattern to set.
* @return This builder for chaining.
*/
public Builder setDefaultPattern(
java.lang.String value) {
if (value == null) { throw new NullPointerException(); }
defaultPattern_ = value;
bitField0_ |= 0x00000002;
onChanged();
return this;
}
/**
* <code>string default_pattern = 2;</code>
* @return This builder for chaining.
*/
public Builder clearDefaultPattern() {
defaultPattern_ = getDefaultInstance().getDefaultPattern();
bitField0_ = (bitField0_ & ~0x00000002);
onChanged();
return this;
}
/**
* <code>string default_pattern = 2;</code>
* @param value The bytes for defaultPattern to set.
* @return This builder for chaining.
*/
public Builder setDefaultPatternBytes(
com.google.protobuf.ByteString value) {
if (value == null) { throw new NullPointerException(); }
checkByteStringIsUtf8(value);
defaultPattern_ = value;
bitField0_ |= 0x00000002;
onChanged();
return this;
}
@java.lang.Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@java.lang.Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:TextPiecePatternRef)
}
// @@protoc_insertion_point(class_scope:TextPiecePatternRef)
private static final tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPiecePatternRefOuterClass.TextPiecePatternRef DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPiecePatternRefOuterClass.TextPiecePatternRef();
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPiecePatternRefOuterClass.TextPiecePatternRef getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser<TextPiecePatternRef>
PARSER = new com.google.protobuf.AbstractParser<TextPiecePatternRef>() {
@java.lang.Override
public TextPiecePatternRef parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
Builder builder = newBuilder();
try {
builder.mergeFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(builder.buildPartial());
} catch (com.google.protobuf.UninitializedMessageException e) {
throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(e)
.setUnfinishedMessage(builder.buildPartial());
}
return builder.buildPartial();
}
};
public static com.google.protobuf.Parser<TextPiecePatternRef> parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser<TextPiecePatternRef> getParserForType() {
return PARSER;
}
@java.lang.Override
public tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPiecePatternRefOuterClass.TextPiecePatternRef getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
private static final com.google.protobuf.Descriptors.Descriptor
internal_static_TextPiecePatternRef_descriptor;
private static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_TextPiecePatternRef_fieldAccessorTable;
public static com.google.protobuf.Descriptors.FileDescriptor
getDescriptor() {
return descriptor;
}
private static com.google.protobuf.Descriptors.FileDescriptor
descriptor;
static {
java.lang.String[] descriptorData = {
"\n\031TextPiecePatternRef.proto\";\n\023TextPiece" +
"PatternRef\022\013\n\003key\030\001 \001(\t\022\027\n\017default_patte" +
"rn\030\002 \001(\tB>\n<tech.ordinaryroad.live.chat." +
"client.codec.douyin.protobuf.dtob\006proto3"
};
descriptor = com.google.protobuf.Descriptors.FileDescriptor
.internalBuildGeneratedFileFrom(descriptorData,
new com.google.protobuf.Descriptors.FileDescriptor[] {
});
internal_static_TextPiecePatternRef_descriptor =
getDescriptor().getMessageTypes().get(0);
internal_static_TextPiecePatternRef_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_TextPiecePatternRef_descriptor,
new java.lang.String[] { "Key", "DefaultPattern", });
}
// @@protoc_insertion_point(outer_class_scope)
}

@ -0,0 +1,762 @@
/*
* MIT License
*
* Copyright (c) 2023 OrdinaryRoad
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: TextPieceUser.proto
// Protobuf Java Version: 3.25.3
package tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto;
public final class TextPieceUserOuterClass {
private TextPieceUserOuterClass() {}
public static void registerAllExtensions(
com.google.protobuf.ExtensionRegistryLite registry) {
}
public static void registerAllExtensions(
com.google.protobuf.ExtensionRegistry registry) {
registerAllExtensions(
(com.google.protobuf.ExtensionRegistryLite) registry);
}
public interface TextPieceUserOrBuilder extends
// @@protoc_insertion_point(interface_extends:TextPieceUser)
com.google.protobuf.MessageOrBuilder {
/**
* <code>.User user = 1;</code>
* @return Whether the user field is set.
*/
boolean hasUser();
/**
* <code>.User user = 1;</code>
* @return The user.
*/
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.UserOuterClass.User getUser();
/**
* <code>.User user = 1;</code>
*/
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.UserOuterClass.UserOrBuilder getUserOrBuilder();
/**
* <code>bool with_colon = 2;</code>
* @return The withColon.
*/
boolean getWithColon();
}
/**
* Protobuf type {@code TextPieceUser}
*/
public static final class TextPieceUser extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:TextPieceUser)
TextPieceUserOrBuilder {
private static final long serialVersionUID = 0L;
// Use TextPieceUser.newBuilder() to construct.
private TextPieceUser(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
super(builder);
}
private TextPieceUser() {
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(
UnusedPrivateParameter unused) {
return new TextPieceUser();
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceUserOuterClass.internal_static_TextPieceUser_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceUserOuterClass.internal_static_TextPieceUser_fieldAccessorTable
.ensureFieldAccessorsInitialized(
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceUserOuterClass.TextPieceUser.class, tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceUserOuterClass.TextPieceUser.Builder.class);
}
private int bitField0_;
public static final int USER_FIELD_NUMBER = 1;
private tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.UserOuterClass.User user_;
/**
* <code>.User user = 1;</code>
* @return Whether the user field is set.
*/
@java.lang.Override
public boolean hasUser() {
return ((bitField0_ & 0x00000001) != 0);
}
/**
* <code>.User user = 1;</code>
* @return The user.
*/
@java.lang.Override
public tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.UserOuterClass.User getUser() {
return user_ == null ? tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.UserOuterClass.User.getDefaultInstance() : user_;
}
/**
* <code>.User user = 1;</code>
*/
@java.lang.Override
public tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.UserOuterClass.UserOrBuilder getUserOrBuilder() {
return user_ == null ? tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.UserOuterClass.User.getDefaultInstance() : user_;
}
public static final int WITH_COLON_FIELD_NUMBER = 2;
private boolean withColon_ = false;
/**
* <code>bool with_colon = 2;</code>
* @return The withColon.
*/
@java.lang.Override
public boolean getWithColon() {
return withColon_;
}
private byte memoizedIsInitialized = -1;
@java.lang.Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
if (((bitField0_ & 0x00000001) != 0)) {
output.writeMessage(1, getUser());
}
if (withColon_ != false) {
output.writeBool(2, withColon_);
}
getUnknownFields().writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (((bitField0_ & 0x00000001) != 0)) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(1, getUser());
}
if (withColon_ != false) {
size += com.google.protobuf.CodedOutputStream
.computeBoolSize(2, withColon_);
}
size += getUnknownFields().getSerializedSize();
memoizedSize = size;
return size;
}
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceUserOuterClass.TextPieceUser)) {
return super.equals(obj);
}
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceUserOuterClass.TextPieceUser other = (tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceUserOuterClass.TextPieceUser) obj;
if (hasUser() != other.hasUser()) return false;
if (hasUser()) {
if (!getUser()
.equals(other.getUser())) return false;
}
if (getWithColon()
!= other.getWithColon()) return false;
if (!getUnknownFields().equals(other.getUnknownFields())) return false;
return true;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
if (hasUser()) {
hash = (37 * hash) + USER_FIELD_NUMBER;
hash = (53 * hash) + getUser().hashCode();
}
hash = (37 * hash) + WITH_COLON_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(
getWithColon());
hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceUserOuterClass.TextPieceUser parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceUserOuterClass.TextPieceUser parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceUserOuterClass.TextPieceUser parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceUserOuterClass.TextPieceUser parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceUserOuterClass.TextPieceUser parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceUserOuterClass.TextPieceUser parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceUserOuterClass.TextPieceUser parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceUserOuterClass.TextPieceUser parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceUserOuterClass.TextPieceUser parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceUserOuterClass.TextPieceUser parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceUserOuterClass.TextPieceUser parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceUserOuterClass.TextPieceUser parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
@java.lang.Override
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceUserOuterClass.TextPieceUser prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@java.lang.Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* Protobuf type {@code TextPieceUser}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
// @@protoc_insertion_point(builder_implements:TextPieceUser)
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceUserOuterClass.TextPieceUserOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceUserOuterClass.internal_static_TextPieceUser_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceUserOuterClass.internal_static_TextPieceUser_fieldAccessorTable
.ensureFieldAccessorsInitialized(
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceUserOuterClass.TextPieceUser.class, tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceUserOuterClass.TextPieceUser.Builder.class);
}
// Construct using tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceUserOuterClass.TextPieceUser.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
getUserFieldBuilder();
}
}
@java.lang.Override
public Builder clear() {
super.clear();
bitField0_ = 0;
user_ = null;
if (userBuilder_ != null) {
userBuilder_.dispose();
userBuilder_ = null;
}
withColon_ = false;
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceUserOuterClass.internal_static_TextPieceUser_descriptor;
}
@java.lang.Override
public tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceUserOuterClass.TextPieceUser getDefaultInstanceForType() {
return tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceUserOuterClass.TextPieceUser.getDefaultInstance();
}
@java.lang.Override
public tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceUserOuterClass.TextPieceUser build() {
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceUserOuterClass.TextPieceUser result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceUserOuterClass.TextPieceUser buildPartial() {
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceUserOuterClass.TextPieceUser result = new tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceUserOuterClass.TextPieceUser(this);
if (bitField0_ != 0) { buildPartial0(result); }
onBuilt();
return result;
}
private void buildPartial0(tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceUserOuterClass.TextPieceUser result) {
int from_bitField0_ = bitField0_;
int to_bitField0_ = 0;
if (((from_bitField0_ & 0x00000001) != 0)) {
result.user_ = userBuilder_ == null
? user_
: userBuilder_.build();
to_bitField0_ |= 0x00000001;
}
if (((from_bitField0_ & 0x00000002) != 0)) {
result.withColon_ = withColon_;
}
result.bitField0_ |= to_bitField0_;
}
@java.lang.Override
public Builder clone() {
return super.clone();
}
@java.lang.Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.setField(field, value);
}
@java.lang.Override
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, java.lang.Object value) {
return super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.addRepeatedField(field, value);
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceUserOuterClass.TextPieceUser) {
return mergeFrom((tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceUserOuterClass.TextPieceUser)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceUserOuterClass.TextPieceUser other) {
if (other == tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceUserOuterClass.TextPieceUser.getDefaultInstance()) return this;
if (other.hasUser()) {
mergeUser(other.getUser());
}
if (other.getWithColon() != false) {
setWithColon(other.getWithColon());
}
this.mergeUnknownFields(other.getUnknownFields());
onChanged();
return this;
}
@java.lang.Override
public final boolean isInitialized() {
return true;
}
@java.lang.Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 10: {
input.readMessage(
getUserFieldBuilder().getBuilder(),
extensionRegistry);
bitField0_ |= 0x00000001;
break;
} // case 10
case 16: {
withColon_ = input.readBool();
bitField0_ |= 0x00000002;
break;
} // case 16
default: {
if (!super.parseUnknownField(input, extensionRegistry, tag)) {
done = true; // was an endgroup tag
}
break;
} // default:
} // switch (tag)
} // while (!done)
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.unwrapIOException();
} finally {
onChanged();
} // finally
return this;
}
private int bitField0_;
private tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.UserOuterClass.User user_;
private com.google.protobuf.SingleFieldBuilderV3<
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.UserOuterClass.User, tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.UserOuterClass.User.Builder, tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.UserOuterClass.UserOrBuilder> userBuilder_;
/**
* <code>.User user = 1;</code>
* @return Whether the user field is set.
*/
public boolean hasUser() {
return ((bitField0_ & 0x00000001) != 0);
}
/**
* <code>.User user = 1;</code>
* @return The user.
*/
public tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.UserOuterClass.User getUser() {
if (userBuilder_ == null) {
return user_ == null ? tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.UserOuterClass.User.getDefaultInstance() : user_;
} else {
return userBuilder_.getMessage();
}
}
/**
* <code>.User user = 1;</code>
*/
public Builder setUser(tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.UserOuterClass.User value) {
if (userBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
user_ = value;
} else {
userBuilder_.setMessage(value);
}
bitField0_ |= 0x00000001;
onChanged();
return this;
}
/**
* <code>.User user = 1;</code>
*/
public Builder setUser(
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.UserOuterClass.User.Builder builderForValue) {
if (userBuilder_ == null) {
user_ = builderForValue.build();
} else {
userBuilder_.setMessage(builderForValue.build());
}
bitField0_ |= 0x00000001;
onChanged();
return this;
}
/**
* <code>.User user = 1;</code>
*/
public Builder mergeUser(tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.UserOuterClass.User value) {
if (userBuilder_ == null) {
if (((bitField0_ & 0x00000001) != 0) &&
user_ != null &&
user_ != tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.UserOuterClass.User.getDefaultInstance()) {
getUserBuilder().mergeFrom(value);
} else {
user_ = value;
}
} else {
userBuilder_.mergeFrom(value);
}
if (user_ != null) {
bitField0_ |= 0x00000001;
onChanged();
}
return this;
}
/**
* <code>.User user = 1;</code>
*/
public Builder clearUser() {
bitField0_ = (bitField0_ & ~0x00000001);
user_ = null;
if (userBuilder_ != null) {
userBuilder_.dispose();
userBuilder_ = null;
}
onChanged();
return this;
}
/**
* <code>.User user = 1;</code>
*/
public tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.UserOuterClass.User.Builder getUserBuilder() {
bitField0_ |= 0x00000001;
onChanged();
return getUserFieldBuilder().getBuilder();
}
/**
* <code>.User user = 1;</code>
*/
public tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.UserOuterClass.UserOrBuilder getUserOrBuilder() {
if (userBuilder_ != null) {
return userBuilder_.getMessageOrBuilder();
} else {
return user_ == null ?
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.UserOuterClass.User.getDefaultInstance() : user_;
}
}
/**
* <code>.User user = 1;</code>
*/
private com.google.protobuf.SingleFieldBuilderV3<
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.UserOuterClass.User, tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.UserOuterClass.User.Builder, tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.UserOuterClass.UserOrBuilder>
getUserFieldBuilder() {
if (userBuilder_ == null) {
userBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.UserOuterClass.User, tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.UserOuterClass.User.Builder, tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.UserOuterClass.UserOrBuilder>(
getUser(),
getParentForChildren(),
isClean());
user_ = null;
}
return userBuilder_;
}
private boolean withColon_ ;
/**
* <code>bool with_colon = 2;</code>
* @return The withColon.
*/
@java.lang.Override
public boolean getWithColon() {
return withColon_;
}
/**
* <code>bool with_colon = 2;</code>
* @param value The withColon to set.
* @return This builder for chaining.
*/
public Builder setWithColon(boolean value) {
withColon_ = value;
bitField0_ |= 0x00000002;
onChanged();
return this;
}
/**
* <code>bool with_colon = 2;</code>
* @return This builder for chaining.
*/
public Builder clearWithColon() {
bitField0_ = (bitField0_ & ~0x00000002);
withColon_ = false;
onChanged();
return this;
}
@java.lang.Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@java.lang.Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:TextPieceUser)
}
// @@protoc_insertion_point(class_scope:TextPieceUser)
private static final tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceUserOuterClass.TextPieceUser DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceUserOuterClass.TextPieceUser();
}
public static tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceUserOuterClass.TextPieceUser getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser<TextPieceUser>
PARSER = new com.google.protobuf.AbstractParser<TextPieceUser>() {
@java.lang.Override
public TextPieceUser parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
Builder builder = newBuilder();
try {
builder.mergeFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(builder.buildPartial());
} catch (com.google.protobuf.UninitializedMessageException e) {
throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(e)
.setUnfinishedMessage(builder.buildPartial());
}
return builder.buildPartial();
}
};
public static com.google.protobuf.Parser<TextPieceUser> parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser<TextPieceUser> getParserForType() {
return PARSER;
}
@java.lang.Override
public tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.TextPieceUserOuterClass.TextPieceUser getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
private static final com.google.protobuf.Descriptors.Descriptor
internal_static_TextPieceUser_descriptor;
private static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_TextPieceUser_fieldAccessorTable;
public static com.google.protobuf.Descriptors.FileDescriptor
getDescriptor() {
return descriptor;
}
private static com.google.protobuf.Descriptors.FileDescriptor
descriptor;
static {
java.lang.String[] descriptorData = {
"\n\023TextPieceUser.proto\032\nUser.proto\"8\n\rTex" +
"tPieceUser\022\023\n\004user\030\001 \001(\0132\005.User\022\022\n\nwith_" +
"colon\030\002 \001(\010B>\n<tech.ordinaryroad.live.ch" +
"at.client.codec.douyin.protobuf.dtob\006pro" +
"to3"
};
descriptor = com.google.protobuf.Descriptors.FileDescriptor
.internalBuildGeneratedFileFrom(descriptorData,
new com.google.protobuf.Descriptors.FileDescriptor[] {
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.UserOuterClass.getDescriptor(),
});
internal_static_TextPieceUser_descriptor =
getDescriptor().getMessageTypes().get(0);
internal_static_TextPieceUser_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_TextPieceUser_descriptor,
new java.lang.String[] { "User", "WithColon", });
tech.ordinaryroad.live.chat.client.codec.douyin.protobuf.dto.UserOuterClass.getDescriptor();
}
// @@protoc_insertion_point(outer_class_scope)
}

@ -0,0 +1,323 @@
function get_arr(t,a) {
reg = {
"chunk": [],
"reg": [1937774191, 1226093241, 388252375, 3666478592, 2842636476, 372324522, 3817729613, 2969243214],
"size": 0,
"write": function (e) {
var o = typeof e === "string" ? function (e) {
var n = encodeURIComponent(e).replace(/%([0-9A-F]{2})/g, function (e, t) {
return String.fromCharCode("0x" + t);
}),
o = new Array(n.length);
return Array.prototype.forEach.call(n, function (e, t) {
o[t] = e.charCodeAt(0);
}), o;
}(e) : e;
this.size += o.length;
var i = 64 - this.chunk.length;
if (o.length < i) this.chunk = this.chunk.concat(o); else for (this.chunk = this.chunk.concat(o.slice(0, i)); this.chunk.length >= 64;) this._compress(this.chunk), i < o.length ? this.chunk = o.slice(i, Math.min(i + 64, o.length)) : this.chunk = [], i += 64;
},
"sum": function (r, n) {
r && (this.reset(), this.write(r)), this._fill();
for (var a = 0; a < this.chunk.length; a += 64) this._compress(this.chunk.slice(a, a + 64));
var c = null;
if (n == "hex") {
c = "";
for (a = 0; a < 8; a++) c += gt(this.reg[a].toString(16), 8, "0");
} else for (c = new Array(32), a = 0; a < 8; a++) {
var f = this.reg[a];
c[4 * a + 3] = (255 & f) >>> 0, f >>>= 8, c[4 * a + 2] = (255 & f) >>> 0, f >>>= 8, c[4 * a + 1] = (255 & f) >>> 0, f >>>= 8, c[4 * a] = (255 & f) >>> 0;
}
return this.reset(), c;
},
"_compress": function (r) {
if (r < 64) console.error("compress error: not enough data"); else {
for (var o = function (e) {
for (var t = new Array(132), r = 0; r < 16; r++) t[r] = e[4 * r] << 24, t[r] |= e[4 * r + 1] << 16, t[r] |= e[4 * r + 2] << 8, t[r] |= e[4 * r + 3], t[r] >>>= 0;
for (var n = 16; n < 68; n++) {
var o = t[n - 16] ^ t[n - 9] ^ Ct(t[n - 3], 15);
o = o ^ Ct(o, 15) ^ Ct(o, 23), t[n] = (o ^ Ct(t[n - 13], 7) ^ t[n - 6]) >>> 0;
}
for (n = 0; n < 64; n++) t[n + 68] = (t[n] ^ t[n + 4]) >>> 0;
return t;
}(r), i = this.reg.slice(0), a = 0; a < 64; a++) {
var c = Ct(i[0], 12) + i[4] + Ct(St(a), a),
f = ((c = Ct(c = (4294967295 & c) >>> 0, 7)) ^ Ct(i[0], 12)) >>> 0,
u = kt(a, i[0], i[1], i[2]);
u = (4294967295 & (u = u + i[3] + f + o[a + 68])) >>> 0;
var s = xt(a, i[4], i[5], i[6]);
s = (4294967295 & (s = s + i[7] + c + o[a])) >>> 0, i[3] = i[2], i[2] = Ct(i[1], 9), i[1] = i[0], i[0] = u, i[7] = i[6], i[6] = Ct(i[5], 19), i[5] = i[4], i[4] = (s ^ Ct(s, 9) ^ Ct(s, 17)) >>> 0;
}
for (var l = 0; l < 8; l++) this.reg[l] = (this.reg[l] ^ i[l]) >>> 0;
}
},
"_fill": function () {
var o = 8 * this.size,
i = this.chunk.push(128) % 64;
for (64 - i < 8 && (i -= 64); i < 56; i++) this.chunk.push(0);
for (var a = 0; a < 4; a++) {
var c = Math.floor(o / 4294967296);
this.chunk.push(c >>> 8 * (3 - a) & 255);
}
for (a = 0; a < 4; a++) this.chunk.push(o >>> 8 * (3 - a) & 255);
}
}
reg.write(t)
reg._fill();
function Ct(e, t) {
return (e << (t %= 32) | e >>> 32 - t) >>> 0;
}
function St(e) {
return 0 <= e && e < 16 ? 2043430169 : 16 <= e && e < 64 ? 2055708042 : void console.error("invalid j for constant Tj");
}
function kt(e, t, r, n) {
return 0 <= e && e < 16 ? (t ^ r ^ n) >>> 0 : 16 <= e && e < 64 ? (t & r | t & n | r & n) >>> 0 : (console.error("invalid j for bool function FF"), 0);
}
function xt(e, t, r, n) {
return 0 <= e && e < 16 ? (t ^ r ^ n) >>> 0 : 16 <= e && e < 64 ? (t & r | ~t & n) >>> 0 : (console.error("invalid j for bool function GG"), 0);
}
for (var i = 0; i < reg["chunk"]["length"]; i += 64) {
reg["_compress"](reg["chunk"]["slice"](i, i + 64));
}
var o = null;
if (a == "hex") {
o = "";
for (i = 0; i < 8; i++)
o += oe(reg["reg"][i]["toString"](16), 8, "0")
} else {
for (o = new Array(32),
i = 0; i < 8; i++) {
var c = reg.reg[i];
o[4 * i + 3] = (255 & c) >>> 0,
c >>>= 8,
o[4 * i + 2] = (255 & c) >>> 0,
c >>>= 8,
o[4 * i + 1] = (255 & c) >>> 0,
c >>>= 8,
o[4 * i] = (255 & c) >>> 0
}
}
return o;
}
function getABogus(url,data,userAgent){
// 生成乱码字符串
var params = url.slice(url.indexOf("?") + 1) + "cus";
data += "cus";
var garbledString = getGarbledString(params,data,userAgent);
var short_str = "Dkdpgh2ZmsQB80/MfvV36XI1R45-WUAlEixNLwoqYTOPuzKFjJnry79HbGcaStCe"
var ABogus = "";
// 依次生成七组字符串
let j = 0
for (var i = 0; i <= garbledString.length;i += 3) {
if (i + 3 < garbledString.length) {
var charCodeAtNum0 = garbledString.charCodeAt(i);
var charCodeAtNum1 = garbledString.charCodeAt(i + 1);
var charCodeAtNum2 = garbledString.charCodeAt(i + 2);
var baseNum = charCodeAtNum2 | charCodeAtNum1 << 8 | charCodeAtNum0 << 16;
var str1 = short_str[(baseNum & 16515072) >> 18];
var str2 = short_str[(baseNum & 258048) >> 12];
var str3 = short_str[(baseNum & 4032) >> 6];
var str4 = short_str[baseNum & 63];
ABogus += str1 + str2 + str3 + str4;
}
if (i + 3 > garbledString.length){
let u = garbledString.length - j
if (u === 2){
var charCodeAtNum0 = garbledString.charCodeAt(j);
var charCodeAtNum1 = garbledString.charCodeAt(j + 1);
var baseNum = charCodeAtNum1 << 8 | charCodeAtNum0 << 16;
var str1 = short_str[(baseNum & 16515072) >> 18];
var str2 = short_str[(baseNum & 258048) >> 12];
var str3 = short_str[(baseNum & 4032) >> 6];
ABogus += str1 + str2 + str3 + '=';
}
if (u === 1){
var charCodeAtNum0 = garbledString.charCodeAt(j);
var baseNum = 0 | charCodeAtNum0 << 16;
var str1 = short_str[(baseNum & 16515072) >> 18];
var str2 = short_str[(baseNum & 258048) >> 12];
ABogus += str1 + str2 + '=' + '=';
}
}
j +=3
}
return ABogus;
}
function getGarbledString(params,data,userAgent) {
let timestamp1 = Date.now(),timestamp2 = timestamp1 - Math.floor(Math.random() * 1000);
let arr_29 = get_arr29(timestamp1,timestamp2,params,data,userAgent)
let a = randomGarbledCharactersArrayList();
let b = abGarbledCharacters(String.fromCharCode.apply(null,arr_29))
return a + b;
}
function abGarbledCharacters(userAgent) {
let arr_256 = ab_arr_256();
let n4 = 0;
let ans = "";
for (let i = 0; i < userAgent.length; i++) {
let n2 = i + 1;
let n3 = n4 + arr_256[n2]
n4 = n3 % 256
let old_arr_n2 = arr_256[n2]
arr_256[n2] = arr_256[n4]
arr_256[n4] = old_arr_n2
let n5 = userAgent.charCodeAt(i);
let n6 = arr_256[n2] + old_arr_n2;
let n7 = n6 % 256
let n8 = n5 ^ arr_256[n7]
ans += String.fromCharCode(n8)
}
return ans;
}
function ab_arr_256() {
let nums = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255]
let previousValue = 0;
let lm = String.fromCharCode(121);
for (let i = 0; i < nums.length; i++) {
previousValue = (previousValue+nums[i]+lm.charCodeAt(0)) % 256
let tmp = nums[i];
nums[i] = nums[previousValue]
nums[previousValue] = tmp
}
return nums;
}
function get_arr29(dateTime1,dateTime2,params,data,userAgent) {
let parArr = get_arr(get_arr(params))
let dataArr = get_arr(get_arr(data))
let ua_salt = userAgent.includes('Win') ? 0 : 12;
var browser_arr = get_arr(encryptionUa(uaGarbledCharacters(userAgent,ua_salt)));
let num = [50,48,53,54,124,49,48,56,55,124,50,48,53,54,124,49,50,48,56,124,48,124,52,52,124,48,124,48,124,50,48,53,54,124,49,50,48,57,124,50,48,53,54,124,49,51,50,57,124,50,48,53,54,124,49,48,56,55,124,51,48,124,51,48,124,77,97,99,73,110,116,101,108];
let arr2 = [44, dateTime1 >> 24 & 255, 0, 0, 0, 0 & 255, 10, parArr[21], dataArr[21], 0, browser_arr[23], dateTime1 >> 16 & 255, 0, 0, 0, 1, 0 & 255, 71, parArr[22], dataArr[22], browser_arr[24], dateTime1 >> 8 & 255, 0, 0, 0, 0 & 255, dateTime1 >> 0 & 255, 0, 0, ua_salt & 255, dateTime2 >> 24 & 255, dateTime2 >> 16 & 255, 0, dateTime2 >> 8 & 255, dateTime2 >> 0 & 255, 3, 397, 1, 397, 1, num.length, 0, 0, 0];
let newArr = [...arr2,...num]
newArr.push(44^(dateTime1>>24&255)^parArr[21]^dataArr[21]^browser_arr[23]^(dateTime1>>16&255)^1^parArr[22]^dataArr[22]^browser_arr[24]^(dateTime1>>8&255)^(dateTime1>>0&255)^ua_salt^(dateTime2>>24&255)^(dateTime2>>16&255)^(dateTime2>>8&255)^(dateTime2>>0&255)^3^397^1^397^1^71^10^num.length)
return newArr;
}
function randomGarbledCharactersArrayList() {
function randomGarbledCharactersArray1() {
let arr = []
random = Math.random() * 10000
num1 = random & 255
num2 = random >> 8 & 255
arr.push((num1 & 170) | (3 & 85))
arr.push((num1 & 85) | (3 & 170))
arr.push((num2 & 170) | (45 & 85))
arr.push((num2 & 85) | (45 & 170))
return String.fromCharCode.apply(null,arr);
}
function randomGarbledCharactersArray2() {
let arr = []
random = Math.random() * 10000
num1 = random & 255
num2 = random >> 8 & 255
arr.push((num1 & 170) | (1 & 85))
arr.push((num1 & 85) | (1 & 170))
arr.push((num2 & 170) | (0 & 85))
arr.push((num2 & 85) | (0 & 170))
return String.fromCharCode.apply(null,arr);
}
function randomGarbledCharactersArray3() {
let arr = []
random = Math.random() * 10000
num1 = random & 255
num2 = random >> 8 & 255
arr.push((num1 & 170) | (1 & 85))
arr.push((num1 & 85) | (1 & 170))
arr.push((num2 & 170) | (1 & 85))
arr.push((num2 & 85) | (1 & 170))
return String.fromCharCode.apply(null,arr);
}
return randomGarbledCharactersArray1()+randomGarbledCharactersArray2()+randomGarbledCharactersArray3()
}
function encryptionUa(ss) {
let str = "ckdp1h4ZKsUB80/Mfvw36XIgR25+WQAlEi7NLboqYTOPuzmFjJnryx9HVGDaStCe";
let uaEncryption = "";
let j = 0
for (let i = 0; i < ss.length; i+=3) {
if (i + 3 <= ss.length) {
let number = (((ss.charCodeAt(i) & 255) << 16) | ((ss.charCodeAt(i+1) & 255) << 8)) | ((ss.charCodeAt(i+2) & 255) << 0);
uaEncryption += str.charAt((number & 16515072) >> 18);
uaEncryption += str.charAt((number & 258048) >> 12);
uaEncryption += str.charAt((number & 4032) >> 6);
uaEncryption += str.charAt((number & 63) >> 0);
}
if (i + 3 > ss.length){
let u = ss.length - j
if (u === 2){
var charCodeAtNum0 = ss.charCodeAt(j);
var charCodeAtNum1 = ss.charCodeAt(j + 1);
var baseNum = charCodeAtNum1 << 8 | charCodeAtNum0 << 16;
var str1 = str[(baseNum & 16515072) >> 18];
var str2 = str[(baseNum & 258048) >> 12];
var str3 = str[(baseNum & 4032) >> 6];
uaEncryption += str1 + str2 + str3 + '=';
}
if (u === 1){
var charCodeAtNum0 = ss.charCodeAt(j);
var baseNum = 0 | charCodeAtNum0 << 16;
var str1 = str[(baseNum & 16515072) >> 18];
var str2 = str[(baseNum & 258048) >> 12];
uaEncryption += str1 + str2 + '=' + '=';
}
}
j +=3
}
return uaEncryption
}
function uaGarbledCharacters(userAgent,ua_salt) {
let arr_256 = ua_arr_256(userAgent,ua_salt);
let n4 = 0;
let ans = "";
for (let i = 0; i < userAgent.length; i++) {
let n2 = (i + 1) % 256;
let n3 = n4 + arr_256[n2]
n4 = n3 % 256
let old_arr_n2 = arr_256[n2]
arr_256[n2] = arr_256[n4]
arr_256[n4] = old_arr_n2
let n5 = userAgent.charCodeAt(i);
let n6 = arr_256[n2] + old_arr_n2;
let n7 = n6 % 256
let n8 = n5 ^ arr_256[n7]
ans += String.fromCharCode(n8)
}
return ans;
}
function ua_arr_256(userAgent,ua_salt) {
let nums = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255]
let previousValue = 0;
let lm = String.fromCharCode(0.00390625,1,ua_salt);
for (let i = 0; i < nums.length; i++) {
previousValue = (previousValue+nums[i]+lm.charCodeAt(i % 3)) % 256
let tmp = nums[i];
nums[i] = nums[previousValue]
nums[previousValue] = tmp
}
return nums;
}
// url = "verifyFp=verify_lpz97yt4_MDJFZ4sp_0U0q_4Edn_9dmS_8qk9Xgz5IYNJ&fp=verify_lpz97yt4_MDJFZ4sp_0U0q_4Edn_9dmS_8qk9Xgz5IYNJ&msToken=7nhPTiAgSOMgSHalkSMCExWwOO8v4F3pK4zfs71Tz5dgUsDl93VoqK--P7EVZHJnRkZon8FDlBR4s6rmfOqDaR-6yJnLsEFEP9RidsI3bNxNCDFjLzuGP3tXkxzeY-pu&msToken=7nhPTiAgSOMgSHalkSMCExWwOO8v4F3pK4zfs71Tz5dgUsDl93VoqK--P7EVZHJnRkZon8FDlBR4s6rmfOqDaR-6yJnLsEFEP9RidsI3bNxNCDFjLzuGP3tXkxzeY-pucus"
// data = "{\"page_type\":0,\"page\":1,\"page_size\":60,\"rec_page\":1,\"rec_page_size\":60,\"search_text\":\"充电宝\",\"search_id\":\"\",\"input_query\":\"车厘子\",\"is_product_distribution\":false,\"is_delivery_guarantee\":false,\"is_ladder_cos\":false,\"common_filter\":null}cus"
// userAgent = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36'
// console.log(getABogus(url, data, userAgent))
// console.log([50,48,53,54,124,54,53,48,124,50,48,53,54,124,49,50,48,56,124,48,124,52,52,124,48,124,48,124,50,48,53,54,124,49,50,48,57,124,50,48,53,54,124,49,51,50,57,124,50,48,53,54,124,54,53,48,124,51,48,124,51,48,124,87,105,110,54,52].length)

File diff suppressed because one or more lines are too long

@ -0,0 +1,401 @@
Please see also http://phantomjs.org/releases.html.
2016-01-23: Version 2.1.0
New features
* Upgraded Qt to 5.5.1 (issue #13377)
* Added support for SSL Client Authentication (issue #11275)
* Added support for context menu event (issue #11429)
* Allow remote debugging to use random port assigned by the OS (issue #13432)
Improvements
* Allow outer context to access arbitrary URLs (issue #11217)
* Fixed --local-storage-path and localStoragePath config option (issue #11596)
* Restored --local-url-access=no regression (issue #13412)
* Fixed an issue with loading JS modules contains a last-line comment (issue #12868)
* Fixed an issue with returning binary content in WebServer module (issue #13026)
* Fixed encoded URL loading on Windows (issue #12953)
* Fixed building with GCC 5 (issue #13518)
* Fixed file upload (issue #12506)
* Fixed latest OS detection (issue #13829)
2015-01-23: Version 2.0.0
New features
* Switched to Qt 5 and updated WebKit (issue 10448)
* Implemented clearing of memory cache (issue 10357)
* Added support for HTTP header change for every request (issue 11299)
Improvements
* Fixed rendering of CJK text by always linking the codecs (issue 10249)
* Ensured onResourceReceived is still fired on an error (issue 11163)
* Fixed possible crash in handling network requests (issue 11252)
* Removed hardcoded GhostDriver launching message (issue 12681)
* Allowed disk cache more than 2 GB (issue 12303)
Examples
* Netsniff example should exit when fails to load (issue 11333)
2014-01-25: Version 1.9.7
* Reverted to GhostDriver 1.1.0 instead of 1.1.1 (issue 11915)
* Fixed another warning of obsolete userSpaceScaleFactor on OS X 10.9 (issue 11612)
2014-01-20: Version 1.9.6
* Updated GhostDriver to version 1.1.1 (issue 11877, 11893)
2014-01-19: Version 1.9.3
* Fixed CoreText performance note on OS X 10.9 (issue 11418)
* Fixed warning of obsolete userSpaceScaleFactor on OS X 10.9 (issue 11612)
2013-09-06: Version 1.9.2
* Fixed graphical artifacts with transparent background on Windows (issue 11276, 11007, 11366)
* Updated GhostDriver to version 1.0.4 (issue 11452)
2013-06-04: Version 1.9.1
Critical bug fixes:
* Fixed problems with specifying proxy server (issue 10811, 11117)
* Fixed UTF-8 encoding with system.stdout and system.stderr (issue 11162)
* Ensured that onResourceReceived will be always invoked (issue 11163)
* Fixed module loading from an absolute path on Windows (issue 11165)
* Fixed typo in the command-line option for setting the cache size (11219)
* Fixed possible crash when handling network requests (issue 11252, 11338)
2013-03-20: Version 1.9.0 "Sakura"
New features
* Added spawn and execFile to execute external programs (issue 10219)
* Added the ability to abort network requests (issue 10230)
* Added system access to stdin, stdout, and stderr (issue 10333)
* Added support for custom CA certificates location (issue 10916)
* Added seek function to the File stream (issue 10937)
* Implemented file read for a specified number of bytes (issue 10938)
* Added a callback to handle network error (issue 10954, 10997)
* Added custom encoding support when opening a page (issue 11043)
* Implemented require.stub() support for a factory function (issue 11044)
* Added page loading indicator and progress (issue 11091)
* Added a timeout option for network requests (issue 11129)
Improvements
* Fixed the build on FreeBSD (issue 10597)
* Ensured a consistent 72 dpi for Linux headless rendering (issue 10659)
* Fixed possible PDF error due to invalid CreationDate field (issue 10663)
* Fixed crash when uploading non existing files (issue 10941)
* Improved the autocomplete internal of the interactive/REPL mode (issue 10943)
* Fixed possible crash when accessing inline frames (issue 10947)
* Changed Linux binary package setup to be built on CentOS 5 (issue 10963)
* Extended SSL ignore setting to synchronous XHR (issue 10985)
* Added convenient constants for modifier keys (issue 11056)
* Fixed incorrect date handling in the cookies (issue 11068)
* Updated GhostDriver to version 1.0.3 (issue 11146)
Examples
* Fixed invalid data URI in the netsniff example (issue 10740)
* Implemented a new weather example (issue 10794)
* Fixed rendering issues in render_multi_url (issue 11021)
* Fixed proper event sequence in page_events example (issue 11028)
* Miscellanous tweaks (issue 11082)
2013-03-02: Version 1.8.2
Critical bug fixes:
* Fixed possible PDF error due to invalid CreationDate field (issue 663)
* Fixed crash when uploading non existing files (issue 941)
* Fixed possible crash when accessing inline frames (issue 947)
* Extended SSL ignore setting to synchronous XHR (issue 985)
* Fixed incorrect date handling in the cookies (issue 1068)
2013-01-06: Version 1.8.1
Critical bug fix:
* Mac OS X: Fix possible crash when using some TrueType fonts (issue 690)
2012-12-21: Version 1.8.0 "Blue Winter Rose"
New features
* Integrated GhostDriver as the WebDriver implementation (issue 49)
* Added an option to specify the SSL protocol (issue 174)
* Added encoding support for WebServer's response (issue 505)
* Added process ID (PID) to the System module (issue 769)
* Added properties to obtain page and frame title (issue 799)
* Added page navigation methods (issue 808)
* Added support for modifier keys in keyboard events (issue 835)
* Added onFilePicker callback for more generic file upload API (issue 843)
* Added the ability to set the page content and location (issue 909)
Improvements
* Fixed date parsing in ISO8601 format (issue 187, 267)
* Fixed window.location (issue 530, 632)
* Deregistered multiple callback handler (issue 807)
* Fixed sending of double-click events (issue 848)
* Increases maximum number of redirects (issue 849)
* Fixed keycodes sent for lowercase characters (issue 852)
* Fixed a regression in table row page break (issue 880)
* Completed the CoffeeScript version of the examples (issue 907)
* Updated Qt to version 4.8.4 (issue 918)
* Fixed potential hang in some example scripts (issue 922)
2012-09-22: Version 1.7.0 "Blazing Star"
New features
* Added a module system modelled after CommonJS/Node.js (issue 47)
* Added support for window pop-up (issue 151)
* Static build on Linux (issue 413)
* Added run-time detection of SSL support (issue 484)
* Added more events support (issue 492, 712)
* Added support for disabling automatic proxy detection (issue 580)
* Provided page closing callback (issue 678)
* Added methods to access URL, frames URL, frame Content (issue 758)
* Added more cookies-related API (issue 761)
Improvements
* Refactored command-line options handling (issue 55)
* Improved the workflow for producing release builds (issue 599)
* Improved cookies API and implementation (issue 603, 761)
* Improved frame switching API (issue 654)
* Fixed iframe handling regression (issue 683)
* Fixed OS version number with Windows 8 and Mountain Lion (issue 684, 688)
* Fixed HAR navigation info in the netsniff example (issue 733)
* Fixed compile warnings with Visual Studio (issue 744)
* Removed hacks for static linking on Windows (issue 753)
* Added ICO image handling on Windows (issue 779)
* Fixed font antialiasing on Windows (issue 785)
* Improved Jasmine test runner for Jasmine 1.2 (issue 792)
2012-07-22: Version 1.6.1
Bug fixes
* Don't build the deploy in debug mode (issue 599)
* Fixed building on Windows (issue 424)
* Fixed remote inspector when building statically (issue 430)
2012-06-20: Version 1.6.0 "Lavender"
New features
* Added support for passing arguments to WebPage's evaluate (issue 132)
* Added callbacks for JavaScript onConfirm and onPrompt (issue 133)
* Added stack trace when error occurs (issue 166)
* Added support for local storage path and quota (issue 300)
* Added initial support for cookies handling (issue 354)
* Added support for header footer when printing the page (issue 410, 512)
* Added headers support in the loading request (issue 452)
* Added support to render the web page as base64-encoded string (issue 547)
* Added hooks for navigation event (issue 562)
* Added command-line option to show debug messages (issue 575)
* Added support for the zoom factor for web page rendering (issue 579)
* Added crash reporter for Mac OS X and Linux, based on Google Breakpad (issue 576)
* Added 'os' object to the system module (issue 585)
* Added support for asynchronous evaluation (issue 593)
Improvements
* Fixed remote debugging to work on Mac OS X and Windows (issue 430)
* Fixed web server getting the dropped connection for empty response (issue 451)
* Fixed text rendered as boxes (squares) on headless Linux (issue 460)
* Updated Qt to version 4.8.2 (issue 495)
* Updated CoffeeScript compiler to version 1.3.3 (issue 496)
* Fixed the build script to detect and use MAKEFLAGS (issue 503)
* Fixed the build script to properly pass Qt config flags (issue 507)
* Changed Info.plist to be embedded in Mac OS X executable (issue 528)
* Fixed wrong module require in the imagebin example (issue 536)
* Fixed example scripts to exit with the right exit code (issue 544)
* Fixed build failure with glib 2.31.0+ (issue 559)
* Fixed error handler failures in some cases (issue 589)
* Fixed Twitter-related examples to work with the new site (issue 609)
2012-03-20: Version 1.5.0 "Ghost Flower"
New features
* Added interactive mode, also known as REPL (issue 252)
* Added setting for web security, to allow cross domain XHR (issue 28)
* Added error handler for WebPage object (issue 166)
* Added support for custom HTTP header in the network request (issue 77)
* Added support for read write encoding in the file system module (issue 367)
* Added remote debugging support on Linux (issue 6)
* Added support for proxy authentication (issue 105)
* Added System module, to retrieve environment variables (issue 271) and arguments (issue 276)
* Added fs.readLink function (issue 329)
* Added support for reading and writing binary data (issue 400)
* Added support to retrieve request data in the WebServer? module (issue 340)
* Added support for individual top/bottom/left/right print margins (issue 388)
* Added command-line option --help (issue 347)
* Added short command-line options -v and -h (issue 408)
* Removed support for Flash and other plugins (issue 418)
Bug fixes
* Fixed multiple console.log arguments (issue 36)
* Fixed file upload (issue 307)
* Fixed the web server instance to be asynchronous (issue 326) and still support Keep Alive (issue 416)
* Workaround Qt 4.8.0 crash due to empty URL scheme (issue 365)
* Fixed a Content-Type problem where POST does not work (issue 337)
* Fixed reading body request in the web server even without specific Content-Type (issue 439)
* Fixed Jasmine test runner with Jasmine 1.1 (issue 402)
* Fixed request URL formatting in the web server (issue 437)
* Don't display debugging and warning messages (issue 323)
2011-12-31: Version 1.4.1
Bug fixes
* Fix setting the proxy type (issue 266)
* Workaround for file upload regression (issue 307)
* Fix extraneous messsages in non-debug mode (issue 323)
2011-12-22: Version 1.4.0 "Glory of the Snow"
New features
* Added embedded HTTP server (issue 115)
* Added convenient build script for Linux (issue 197)
* Added support for SOCKS5 proxy (issue 266)
* Updated CoffeeScript compiler to version 1.2 (issue 312)
Bug fixes
* Fix potential crash in QUrl with Qt 4.8 (issue 304)
* Fix bug in CookieJar with QSettings and string (PyPhantomJS issue 10)
* Prevent showing the icon on Mac OS X Dock (issue 281)
Examples
* Added a new example to detect browsers sniffing (issue 263)
* Added HTTP server example (issue 115)
2011-09-23: Version 1.3.0 "Water Lily"
Bug fixes
* Fixed open() and POST method, without specifying the finished handler
* Fixed script execution warning dialog (issue 165)
* Added WebPage.release() to free the web page from memory (issue 154)
* Added special handling of about:blank (issue 235)
* Made a separate network access manager for each page (issue 190)
New features
* Introduced file system API based on CommonJS Filesystem proposal (issue 129)
* Added support for persistent cookies (issue 91)
* Added event handling, currently only for mouse events (issue 234)
* Added page scroll position (issue 162)
* Added HTTP authentication support (issue 45)
* Added callback for page initialization (issue 143)
* Added support to specify script and output encoding (issue 186)
* Added option to allow local content to do cross-domain access (issue 28)
* Added support to apply configurations from a JSON file (issue 180)
* Added a convenient WebPage initialization construction (issue 206)
* Added option to limit the size of disk cache (issue 220)
Examples
* Added a new example on using Modernizr to detect features (issue 144)
* Fixed pizza.js example to use Mobile Yelp (issue 200)
* Fixed netsniff.coffee example due to wrong indentation (issue 225)
* Added an example to show live network traffic (issue 227)
* Added an example demonstrating different output encodings (issue 186)
2011-06-21: Version 1.2.0 "Birds of Paradise"
Version 1.2.0 is a major update. It introduces a whole set of new API.
Bug fixes
* Fixed rendering a very large web page (issue 54)
* Fixed reporting of CoffeeScript compile error (issue 125)
New features
* Added callback for console message (issue 12)
* Improved security model via WebPage object (issue 41)
* Added support for POST, HEAD, PUT, and DELETE (issue 88)
* Scripts filename is now passed as phantom.scriptName
* Added callback to capture resource requests and responses (issue 2)
* Added the ability to load external JavaScript (issue 32)
Examples
* Ported examples to use WebPage object
* Added a new example to upload an image to imagebin.org
* Added a new example to show HTTP POST feature
* Added a new example to sniff network traffic and save it in HAR format
2011-04-27: Version 1.1.0 "Cherry Blossom"
Fixed the script loading to use UTF-8 encoding (Yasuhiro Matsumoto).
Added check for system proxy setting (Yasuhiro Matsumoto).
Fixed building with Cygwin and Qt 4.5 (John Dalton).
Added a new example: driver for QUnit tests (Łukasz Korecki).
Fixed issue #20: problem with JPG transparent color (Alessandro Portale).
Fixed issue #9: ignore first line starting with #! (Matthias, aka fourplusone).
Fixed issue #7: support for file upload for form submission (Matthias, aka fourplusone).
Fixed issue #35: support for disabling images loading (Ariya Hidayat).
Fixed issue #14: enable or disable plugins (Ariya Hidayat).
Added a new example: using Canvas to produce the color wheel (Ariya Hidayat).
Added support for rasterizing as GIF image (Ariya Hidayat).
Added support for CoffeeScript (Ariya Hidayat).
Fixed issue #19: option for setting the proxy (Clint Berry, Ariya Hidayat).
Python implementation using PyQt (James Roe).
Fixed issue #17: Specify paper size for PDF export (Alessandro Portale).
Fixed issue #60: Win32 and OS/2 icon files (Salvador Parra Camacho).
Added clipping rectangle to the render function (Wouter de Bie).
Added an example on sychronous waiting (Gabor Torok).
Added command line option to use disk cache (Jon Turner).
Added text extracting example (Weston Ruter).
Fixed issue #93: Build with Qt < 4.7 (Ariya Hidayat).
Ported all examples to CoffeeScript (Robert Gieseke).
2011-01-17: Version 1.0.0
Initial launch.
The API is centralized at the 'phantom' object (as child of
window object) which has the properties: args, content,
loadStatus, state, userAgent, version, viewportSize, and
the following functions: exit, open, render, sleep.
Several examples are included, among others: web page rasterizer,
weather service, headless test framework driver, and many others.

@ -0,0 +1,22 @@
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of the <organization> nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

@ -0,0 +1,29 @@
# [PhantomJS](http://phantomjs.org) - Scriptable Headless WebKit
PhantomJS ([phantomjs.org](http://phantomjs.org)) is a headless WebKit scriptable with JavaScript. The latest [stable release](http://phantomjs.org/release-2.0.html) is version 2.0.
**Note**: Please **do not** create a GitHub pull request **without** reading the [Contribution Guide](https://github.com/ariya/phantomjs/blob/master/CONTRIBUTING.md) first. Failure to do so may result in the rejection of the pull request.
## Use Cases
- **Headless web testing**. Lightning-fast testing without the browser is now possible!
- **Page automation**. [Access and manipulate](http://phantomjs.org/page-automation.html) web pages with the standard DOM API, or with usual libraries like jQuery.
- **Screen capture**. Programmatically [capture web contents](http://phantomjs.org/screen-capture.html), including CSS, SVG and Canvas. Build server-side web graphics apps, from a screenshot service to a vector chart rasterizer.
- **Network monitoring**. Automate performance analysis, track [page loading](http://phantomjs.org/network-monitoring.html) and export as standard HAR format.
## Features
- **Multiplatform**, available on major operating systems: Windows, Mac OS X, Linux, and other Unices.
- **Fast and native implementation** of web standards: DOM, CSS, JavaScript, Canvas, and SVG. No emulation!
- **Pure headless (no X11) on Linux**, ideal for continuous integration systems. Also runs on Amazon EC2, Heroku, and Iron.io.
- **Easy to install**: [Download](http://phantomjs.org/download.html), unpack, and start having fun in just 5 minutes.
## Questions?
- Explore the complete [documentation](http://phantomjs.org/documentation/).
- Read tons of [user articles](http://phantomjs.org/buzz.html) on using PhantomJS.
- Join the [mailing-list](http://groups.google.com/group/phantomjs) and discuss with other PhantomJS fans.
PhantomJS is free software/open source, and is distributed under the [BSD license](http://opensource.org/licenses/BSD-3-Clause). It contains third-party code, see the included `third-party.txt` file for the license information on third-party code.
PhantomJS is created and maintained by [Ariya Hidayat](http://ariya.ofilabs.com/about) (Twitter: [@ariyahidayat](http://twitter.com/ariyahidayat)), with the help of [many contributors](https://github.com/ariya/phantomjs/contributors). Follow the official Twitter stream [@PhantomJS](http://twitter.com/PhantomJS) to get the frequent development updates.

@ -0,0 +1,10 @@
"use strict";
var system = require('system');
if (system.args.length === 1) {
console.log('Try to pass some args when invoking this script!');
} else {
system.args.forEach(function (arg, i) {
console.log(i + ': ' + arg);
});
}
phantom.exit();

@ -0,0 +1,28 @@
"use strict";
var spawn = require("child_process").spawn
var execFile = require("child_process").execFile
var child = spawn("ls", ["-lF", "/rooot"])
child.stdout.on("data", function (data) {
console.log("spawnSTDOUT:", JSON.stringify(data))
})
child.stderr.on("data", function (data) {
console.log("spawnSTDERR:", JSON.stringify(data))
})
child.on("exit", function (code) {
console.log("spawnEXIT:", code)
})
//child.kill("SIGKILL")
execFile("ls", ["-lF", "/usr"], null, function (err, stdout, stderr) {
console.log("execFileSTDOUT:", JSON.stringify(stdout))
console.log("execFileSTDERR:", JSON.stringify(stderr))
})
setTimeout(function () {
phantom.exit(0)
}, 2000)

@ -0,0 +1,52 @@
"use strict";
var page = require('webpage').create();
page.viewportSize = { width: 400, height : 400 };
page.content = '<html><body><canvas id="surface"></canvas></body></html>';
page.evaluate(function() {
var el = document.getElementById('surface'),
context = el.getContext('2d'),
width = window.innerWidth,
height = window.innerHeight,
cx = width / 2,
cy = height / 2,
radius = width / 2.3,
imageData,
pixels,
hue, sat, value,
i = 0, x, y, rx, ry, d,
f, g, p, u, v, w, rgb;
el.width = width;
el.height = height;
imageData = context.createImageData(width, height);
pixels = imageData.data;
for (y = 0; y < height; y = y + 1) {
for (x = 0; x < width; x = x + 1, i = i + 4) {
rx = x - cx;
ry = y - cy;
d = rx * rx + ry * ry;
if (d < radius * radius) {
hue = 6 * (Math.atan2(ry, rx) + Math.PI) / (2 * Math.PI);
sat = Math.sqrt(d) / radius;
g = Math.floor(hue);
f = hue - g;
u = 255 * (1 - sat);
v = 255 * (1 - sat * f);
w = 255 * (1 - sat * (1 - f));
pixels[i] = [255, v, u, u, w, 255, 255][g];
pixels[i + 1] = [w, 255, 255, v, u, u, w][g];
pixels[i + 2] = [u, u, w, 255, 255, v, u][g];
pixels[i + 3] = 255;
}
}
}
context.putImageData(imageData, 0, 0);
document.body.style.backgroundColor = 'white';
document.body.style.margin = '0px';
});
page.render('colorwheel.png');
phantom.exit();

@ -0,0 +1,10 @@
"use strict";
var t = 10,
interval = setInterval(function(){
if ( t > 0 ) {
console.log(t--);
} else {
console.log("BLAST OFF!");
phantom.exit();
}
}, 1000);

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save