mirror of
https://github.com/jwdeveloper/TikTokLiveJava.git
synced 2026-02-28 09:19:40 -05:00
Compare commits
22 Commits
develop-1-
...
1.0.9-Rele
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2e37b6627b | ||
|
|
c4f0d63b43 | ||
|
|
15550ed703 | ||
|
|
c7d84218f2 | ||
|
|
1ecd192539 | ||
|
|
d6c0d50ac3 | ||
|
|
b4997da0a8 | ||
|
|
82990665b8 | ||
|
|
155b47977d | ||
|
|
3e262773a4 | ||
|
|
89fbeb848b | ||
|
|
aa99c5929b | ||
|
|
4dd866c6cc | ||
|
|
0d384f0fdc | ||
|
|
4f3ec1c6d9 | ||
|
|
31075e5f09 | ||
|
|
33a3f7afb8 | ||
|
|
6c888c5d5b | ||
|
|
214aa3b1ff | ||
|
|
3f2c9083d5 | ||
|
|
450014759c | ||
|
|
790f568244 |
@@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>TikTokLiveJava</artifactId>
|
<artifactId>TikTokLiveJava</artifactId>
|
||||||
<groupId>io.github.jwdeveloper.tiktok</groupId>
|
<groupId>io.github.jwdeveloper.tiktok</groupId>
|
||||||
<version>1.0.6-Release</version>
|
<version>1.0.8-Release</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<artifactId>API</artifactId>
|
<artifactId>API</artifactId>
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ import io.github.jwdeveloper.tiktok.messages.webcast.WebcastGiftMessage;
|
|||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* Triggered when user sends gifts that has
|
* Triggered when user sends gifts that has
|
||||||
* no combo (most of expensive gifts)
|
* no combo (most of expensive gifts)
|
||||||
* or if combo has finished
|
* or if combo has finished
|
||||||
@@ -43,11 +43,13 @@ import lombok.Getter;
|
|||||||
public class TikTokGiftEvent extends TikTokHeaderEvent {
|
public class TikTokGiftEvent extends TikTokHeaderEvent {
|
||||||
private final Gift gift;
|
private final Gift gift;
|
||||||
private final User user;
|
private final User user;
|
||||||
|
private final User toUser;
|
||||||
private final int combo;
|
private final int combo;
|
||||||
public TikTokGiftEvent(Gift gift, WebcastGiftMessage msg) {
|
public TikTokGiftEvent(Gift gift, WebcastGiftMessage msg) {
|
||||||
super(msg.getCommon());
|
super(msg.getCommon());
|
||||||
this.gift = gift;
|
this.gift = gift;
|
||||||
user = User.map(msg.getUser(), msg.getUserIdentity());
|
user = User.map(msg.getUser(), msg.getUserIdentity());
|
||||||
|
toUser = User.map(msg.getToUser());
|
||||||
combo = msg.getComboCount();
|
combo = msg.getComboCount();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,3 +1,25 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2023-2023 jwdeveloper jacekwoln@gmail.com
|
||||||
|
*
|
||||||
|
* 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 io.github.jwdeveloper.tiktok.mappers;
|
package io.github.jwdeveloper.tiktok.mappers;
|
||||||
|
|
||||||
import com.google.protobuf.GeneratedMessageV3;
|
import com.google.protobuf.GeneratedMessageV3;
|
||||||
|
|||||||
@@ -1,3 +1,25 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2023-2023 jwdeveloper jacekwoln@gmail.com
|
||||||
|
*
|
||||||
|
* 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 io.github.jwdeveloper.tiktok.utils;
|
package io.github.jwdeveloper.tiktok.utils;
|
||||||
|
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
|
|||||||
@@ -1,3 +1,25 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2023-2023 jwdeveloper jacekwoln@gmail.com
|
||||||
|
*
|
||||||
|
* 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 io.github.jwdeveloper.tiktok.utils;
|
package io.github.jwdeveloper.tiktok.utils;
|
||||||
|
|
||||||
import com.google.gson.GsonBuilder;
|
import com.google.gson.GsonBuilder;
|
||||||
|
|||||||
@@ -1,3 +1,25 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2023-2023 jwdeveloper jacekwoln@gmail.com
|
||||||
|
*
|
||||||
|
* 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 io.github.jwdeveloper.tiktok.utils;
|
package io.github.jwdeveloper.tiktok.utils;
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
|
|||||||
@@ -1,3 +1,25 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2023-2023 jwdeveloper jacekwoln@gmail.com
|
||||||
|
*
|
||||||
|
* 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 io.github.jwdeveloper.tiktok.utils;
|
package io.github.jwdeveloper.tiktok.utils;
|
||||||
|
|
||||||
import com.google.protobuf.ByteString;
|
import com.google.protobuf.ByteString;
|
||||||
|
|||||||
@@ -1000,7 +1000,7 @@ message LinkerCreateContent {
|
|||||||
|
|
||||||
message LinkerEnterContent {
|
message LinkerEnterContent {
|
||||||
repeated User LinkedUsersList = 1;
|
repeated User LinkedUsersList = 1;
|
||||||
//LinkmicMultiLiveEnum AnchorMultiLiveEnum = 2;
|
// LinkmicMultiLiveEnum AnchorMultiLiveEnum = 2;
|
||||||
// Data.LinkmicUserSettingInfo AnchorSettingInfo = 3;
|
// Data.LinkmicUserSettingInfo AnchorSettingInfo = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1130,3 +1130,387 @@ message LinkerUpdateUserSettingContent {
|
|||||||
message LinkerWaitingListChangeContent {
|
message LinkerWaitingListChangeContent {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
message LinkmicUserSettingInfo {
|
||||||
|
int64 userId = 1;
|
||||||
|
int64 layout = 2; // @warning Enum not found, should be Layout
|
||||||
|
int64 fixMicNum = 3; // @warning Enum not found, should be FixMicNum
|
||||||
|
int64 allowRequestFromUser = 4; // @warning Enum not found, should be AllowRequestFromUser
|
||||||
|
int64 allowRequestFromFollowerOnly = 5; // @warning Enum not found, should be AllowRequestFromFollowerOnly
|
||||||
|
LinkmicApplierSortSetting applierSortSetting = 7; // Enum
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
message Player {
|
||||||
|
int64 roomId = 1;
|
||||||
|
int64 userId = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
message AllListUser {
|
||||||
|
repeated LinkLayerListUser linkedList = 2;
|
||||||
|
repeated LinkLayerListUser appliedList = 3;
|
||||||
|
repeated LinkLayerListUser invitedList = 4;
|
||||||
|
repeated LinkLayerListUser readyList = 5;
|
||||||
|
}
|
||||||
|
|
||||||
|
message LinkLayerListUser {
|
||||||
|
User user = 1;
|
||||||
|
string linkmicId = 2;
|
||||||
|
Position pos = 3;
|
||||||
|
int64 linkedTimeNano = 4;
|
||||||
|
string appVersion = 5;
|
||||||
|
}
|
||||||
|
|
||||||
|
message Position {
|
||||||
|
int32 type = 1;
|
||||||
|
LinkPosition link = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
message LinkPosition {
|
||||||
|
int32 position = 1;
|
||||||
|
int32 opt = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
message GroupPlayer {
|
||||||
|
int64 channelId = 1;
|
||||||
|
User user = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
message DSLConfig {
|
||||||
|
int32 sceneVersion = 1;
|
||||||
|
string layoutId = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
message GroupChannelAllUser {
|
||||||
|
int64 groupChannelId = 1;
|
||||||
|
repeated GroupChannelUser userList = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
message GroupChannelUser {
|
||||||
|
int64 channelId = 1;
|
||||||
|
GroupStatus status = 2; // Enum
|
||||||
|
TextType type = 3; // Enum
|
||||||
|
AllListUser allUser = 4;
|
||||||
|
int64 joinTime = 5;
|
||||||
|
int64 linkedTime = 6;
|
||||||
|
GroupPlayer ownerUser = 7;
|
||||||
|
}
|
||||||
|
|
||||||
|
message RTCExtraInfo {
|
||||||
|
RTCEngineConfig liveRtcEngineConfig = 1;
|
||||||
|
repeated RTCLiveVideoParam liveRtcVideoParamList = 2;
|
||||||
|
RTCBitrateMap rtcBitrateMap = 3;
|
||||||
|
int32 rtcFps = 4;
|
||||||
|
string rtcBusinessId = 8;
|
||||||
|
int32 interactClientType = 10;
|
||||||
|
|
||||||
|
message RTCEngineConfig {
|
||||||
|
string rtcAppId = 1;
|
||||||
|
string rtcUserId = 2;
|
||||||
|
string rtcToken = 3;
|
||||||
|
int64 rtcChannelId = 4;
|
||||||
|
}
|
||||||
|
|
||||||
|
message RTCLiveVideoParam {
|
||||||
|
int32 strategyId = 1;
|
||||||
|
RTCVideoParam params = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
message RTCVideoParam {
|
||||||
|
int32 width = 1;
|
||||||
|
int32 height = 2;
|
||||||
|
int32 fps = 3;
|
||||||
|
int32 bitrateKbps = 4;
|
||||||
|
}
|
||||||
|
|
||||||
|
message RTCBitrateMap {
|
||||||
|
int32 xx1 = 1;
|
||||||
|
int32 xx2 = 2;
|
||||||
|
int32 xx3 = 3;
|
||||||
|
int32 xx4 = 4;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
message CreateChannelContent {
|
||||||
|
Player owner = 1;
|
||||||
|
string ownerLinkMicId = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
message ListChangeContent {
|
||||||
|
TextType type = 1; // Enum
|
||||||
|
AllListUser list = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
message MultiLiveContent {
|
||||||
|
InviteBizContent inviteBizContent = 2;
|
||||||
|
ReplyBizContent replyBizContent = 3;
|
||||||
|
PermitBizContent permitBizContent = 4;
|
||||||
|
KickOutBizContent kickOutBizContent = 6;
|
||||||
|
|
||||||
|
|
||||||
|
message InviteBizContent {
|
||||||
|
LinkmicUserSettingInfo anchorSettingInfo = 1;
|
||||||
|
int64 inviteSource = 2; // @warning Enum not found, should be InviteSource
|
||||||
|
User operatorUserInfo = 3;
|
||||||
|
int64 operatorLinkAdminType = 4; // @warning Enum not found, should be OperatorLinkAdminType
|
||||||
|
User inviteeUserInfo = 5;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
message ReplyBizContent {
|
||||||
|
int32 linkType = 1;
|
||||||
|
int32 isTurnOffInvitation = 2;
|
||||||
|
User replyUserInfo = 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
message PermitBizContent {
|
||||||
|
LinkmicUserSettingInfo anchorSettingInfo = 1;
|
||||||
|
int64 expireTimestamp = 2;
|
||||||
|
User operatorUserInfo = 3;
|
||||||
|
int64 operatorLinkAdminType = 4; // @warning Enum not found, should be OperatorLinkAdminType
|
||||||
|
}
|
||||||
|
|
||||||
|
message KickOutBizContent {
|
||||||
|
User operatorUserInfo = 1;
|
||||||
|
int64 operatorLinkAdminType = 2; // @warning Enum not found, should be OperatorLinkAdminType
|
||||||
|
User kickPlayerUserInfo = 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
message InviteContent {
|
||||||
|
Player invitor = 1;
|
||||||
|
RTCExtraInfo inviteeRtcExtInfo = 2;
|
||||||
|
string invitorLinkMicId = 3;
|
||||||
|
string inviteeLinkMicId = 4;
|
||||||
|
bool isOwner = 5;
|
||||||
|
Position pos = 6;
|
||||||
|
DSLConfig dsl = 7;
|
||||||
|
User invitee = 8;
|
||||||
|
User operator = 9;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// @ApplyContent
|
||||||
|
// proto.webcast.im
|
||||||
|
// C:\Users\ja\RiderProjects\TikTokProBufferGenerator\Application\output\sources\test.js
|
||||||
|
message ApplyContent {
|
||||||
|
Player applier = 1;
|
||||||
|
string applierLinkMicId = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// @PermitApplyContent
|
||||||
|
// proto.webcast.im
|
||||||
|
// C:\Users\ja\RiderProjects\TikTokProBufferGenerator\Application\output\sources\test.js
|
||||||
|
message PermitApplyContent {
|
||||||
|
Player permiter = 1;
|
||||||
|
string permiterLinkMicId = 2;
|
||||||
|
Position applierPos = 3;
|
||||||
|
ReplyStatus replyStatus = 4; // Enum
|
||||||
|
DSLConfig dsl = 5;
|
||||||
|
User applier = 6;
|
||||||
|
User operator = 7;
|
||||||
|
string applierLinkMicId = 8;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// @ReplyInviteContent
|
||||||
|
// proto.webcast.im
|
||||||
|
// C:\Users\ja\RiderProjects\TikTokProBufferGenerator\Application\output\sources\test.js
|
||||||
|
message ReplyInviteContent {
|
||||||
|
Player invitee = 1;
|
||||||
|
ReplyStatus replyStatus = 2; // Enum
|
||||||
|
string inviteeLinkMicId = 3;
|
||||||
|
Position inviteePos = 4;
|
||||||
|
Player inviteOperatorUser = 5;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// @KickOutContent
|
||||||
|
// proto.webcast.im
|
||||||
|
// C:\Users\ja\RiderProjects\TikTokProBufferGenerator\Application\output\sources\test.js
|
||||||
|
message KickOutContent {
|
||||||
|
Player offliner = 1;
|
||||||
|
KickoutReason kickoutReason = 2; // Enum
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// @CancelApplyContent
|
||||||
|
// proto.webcast.im
|
||||||
|
// C:\Users\ja\RiderProjects\TikTokProBufferGenerator\Application\output\sources\test.js
|
||||||
|
message CancelApplyContent {
|
||||||
|
Player applier = 1;
|
||||||
|
string applierLinkMicId = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// @CancelInviteContent
|
||||||
|
// proto.webcast.im
|
||||||
|
// C:\Users\ja\RiderProjects\TikTokProBufferGenerator\Application\output\sources\test.js
|
||||||
|
message CancelInviteContent {
|
||||||
|
Player invitor = 1;
|
||||||
|
string invitorLinkMicId = 2;
|
||||||
|
string inviteeLinkMicId = 3;
|
||||||
|
int64 inviteSeqId = 4;
|
||||||
|
Player invitee = 5;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// @LeaveContent
|
||||||
|
// proto.webcast.im
|
||||||
|
// C:\Users\ja\RiderProjects\TikTokProBufferGenerator\Application\output\sources\test.js
|
||||||
|
message LeaveContent {
|
||||||
|
Player leaver = 1;
|
||||||
|
int64 leaveReason = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// @FinishChannelContent
|
||||||
|
// proto.webcast.im
|
||||||
|
// C:\Users\ja\RiderProjects\TikTokProBufferGenerator\Application\output\sources\test.js
|
||||||
|
message FinishChannelContent {
|
||||||
|
Player owner = 1;
|
||||||
|
int64 finishReason = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// @JoinDirectContent
|
||||||
|
// proto.webcast.im
|
||||||
|
// C:\Users\ja\RiderProjects\TikTokProBufferGenerator\Application\output\sources\test.js
|
||||||
|
message JoinDirectContent {
|
||||||
|
LinkLayerListUser joiner = 1;
|
||||||
|
AllListUser allUsers = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// @LeaveJoinGroupContent
|
||||||
|
// proto.webcast.im
|
||||||
|
// C:\Users\ja\RiderProjects\TikTokProBufferGenerator\Application\output\sources\test.js
|
||||||
|
message LeaveJoinGroupContent {
|
||||||
|
GroupPlayer operator = 1;
|
||||||
|
int64 groupChannelId = 2;
|
||||||
|
string leaveSource = 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// @PermitJoinGroupContent
|
||||||
|
// proto.webcast.im
|
||||||
|
message PermitJoinGroupContent {
|
||||||
|
GroupPlayer approver = 1;
|
||||||
|
AgreeStatus agreeStatus = 2; // Enum
|
||||||
|
TextType type = 3; // Enum
|
||||||
|
repeated RTCExtraInfo groupExtInfoList = 4;
|
||||||
|
GroupChannelAllUser groupUser = 5;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// @CancelJoinGroupContent
|
||||||
|
// proto.webcast.im
|
||||||
|
message CancelJoinGroupContent {
|
||||||
|
repeated GroupPlayer leaverList = 1;
|
||||||
|
GroupPlayer operator = 2;
|
||||||
|
TextType type = 3; // Enum
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
message P2PGroupChangeContent {
|
||||||
|
repeated RTCExtraInfo groupExtInfoList = 1;
|
||||||
|
GroupChannelAllUser groupUser = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
message BusinessContent {
|
||||||
|
int64 overLength = 1;
|
||||||
|
MultiLiveContent multiLiveContent = 100;
|
||||||
|
CohostContent cohostContent = 200;
|
||||||
|
|
||||||
|
message CohostContent {
|
||||||
|
JoinGroupBizContent joinGroupBizContent = 1;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
message JoinGroupBizContent {
|
||||||
|
int32 fromRoomAgeRestricted = 1;
|
||||||
|
Tag fromTag = 2;
|
||||||
|
PerceptionDialogInfo dialog = 3;
|
||||||
|
PunishEventInfo punishInfo = 4;
|
||||||
|
JoinGroupMessageExtra joinGroupMsgExtra = 101;
|
||||||
|
}
|
||||||
|
|
||||||
|
message Tag {
|
||||||
|
int32 tagType = 1;
|
||||||
|
string tagValue = 2;
|
||||||
|
string tagText = 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
message PerceptionDialogInfo {
|
||||||
|
int64 iconType = 1; // @warning Enum not found, should be IconType
|
||||||
|
Text title = 2;
|
||||||
|
Text subTitle = 3;
|
||||||
|
Text adviceActionText = 4;
|
||||||
|
Text defaultActionText = 5;
|
||||||
|
string violationDetailUrl = 6;
|
||||||
|
int32 scene = 7;
|
||||||
|
int64 targetUserId = 8;
|
||||||
|
int64 targetRoomId = 9;
|
||||||
|
int64 countDownTime = 10;
|
||||||
|
bool showFeedback = 11;
|
||||||
|
repeated PerceptionFeedbackOption feedbackOptionsList = 12;
|
||||||
|
int64 policyTip = 13;
|
||||||
|
}
|
||||||
|
|
||||||
|
message PerceptionFeedbackOption {
|
||||||
|
int64 id = 1;
|
||||||
|
string contentKey = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
message JoinGroupMessageExtra {
|
||||||
|
int64 sourceType = 1;
|
||||||
|
RivalExtra extra = 2;
|
||||||
|
repeated RivalExtra otherUsersList = 3;
|
||||||
|
|
||||||
|
|
||||||
|
// @RivalExtra
|
||||||
|
// proto.webcast.im.JoinGroupMessageExtra
|
||||||
|
// C:\Users\ja\RiderProjects\TikTokProBufferGenerator\Application\output\sources\test.js
|
||||||
|
message RivalExtra {
|
||||||
|
int64 userCount = 4;
|
||||||
|
Image avatarThumb = 5;
|
||||||
|
string displayId = 6;
|
||||||
|
AuthenticationInfo authenticationInfo = 7;
|
||||||
|
string nickname = 8;
|
||||||
|
int64 followStatus = 9;
|
||||||
|
Hashtag hashtag = 10;
|
||||||
|
TopHostInfo topHostInfo = 11;
|
||||||
|
int64 userId = 12;
|
||||||
|
bool isBestTeammate = 13;
|
||||||
|
|
||||||
|
message AuthenticationInfo {
|
||||||
|
string customVerify = 1;
|
||||||
|
string enterpriseVerifyReason = 2;
|
||||||
|
Image authenticationBadge = 3;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
message Hashtag {
|
||||||
|
int64 id = 1;
|
||||||
|
string title = 2;
|
||||||
|
Image image = 3;
|
||||||
|
HashtagNamespace namespace = 4; // Enum
|
||||||
|
}
|
||||||
|
|
||||||
|
message TopHostInfo {
|
||||||
|
string rankType = 1;
|
||||||
|
int64 topIndex = 2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
message JoinGroupContent {
|
||||||
|
GroupChannelAllUser groupUser = 1;
|
||||||
|
GroupPlayer joinUser = 2;
|
||||||
|
TextType type = 3; // Enum
|
||||||
|
}
|
||||||
@@ -25,6 +25,85 @@ enum EmotePrivateType {
|
|||||||
EMOTE_PRIVATE_TYPE_SUB_WAVE = 1;
|
EMOTE_PRIVATE_TYPE_SUB_WAVE = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum TextType {
|
||||||
|
DISPLAY_TEXT = 0;
|
||||||
|
CONTENT = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
enum LinkmicApplierSortSetting {
|
||||||
|
LINKMIC_APPLIER_SORT_SETTING_NONE = 0;
|
||||||
|
LINKMIC_APPLIER_SORT_SETTING_BY_GIFT_SCORE = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
enum HashtagNamespace {
|
||||||
|
GLOBAL = 0;
|
||||||
|
GAMING = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
enum AgreeStatus {
|
||||||
|
AGREE_UNKNOWN = 0;
|
||||||
|
AGREE = 1;
|
||||||
|
REJECT = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
enum KickoutReason {
|
||||||
|
KICKOUT_REASON_UNKNOWN = 0;
|
||||||
|
KICKOUT_REASON_FIRST_FRAME_TIMEOUT = 1;
|
||||||
|
KICKOUT_REASON_BY_HOST = 2;
|
||||||
|
KICKOUT_REASON_RTC_LOST_CONNECTION = 3;
|
||||||
|
KICKOUT_REASON_BY_PUNISH = 4;
|
||||||
|
KICKOUT_REASON_BY_ADMIN = 5;
|
||||||
|
KICKOUT_REASON_HOST_REMOVE_ALL_GUESTS = 6;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
enum GroupStatus {
|
||||||
|
GROUP_STATUS_UNKNOWN = 0;
|
||||||
|
GROUP_STATUS_WAITING = 1;
|
||||||
|
GROUP_STATUS_LINKED = 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
enum BusinessCase {
|
||||||
|
BUSINESS_NOT_SET = 0;
|
||||||
|
APPLY_BIZ_CONTENT = 1;
|
||||||
|
INVITE_BIZ_CONTENT = 2;
|
||||||
|
REPLY_BIZ_CONTENT = 3;
|
||||||
|
PERMIT_BIZ_CONTENT = 4;
|
||||||
|
JOIN_DIRECT_BIZ_CONTENT = 5;
|
||||||
|
KICK_OUT_BIZ_CONTENT = 6;
|
||||||
|
LIST_CHANGE_BIZ_CONTENT = 11;
|
||||||
|
MULTI_LIVE_CONTENT = 100;
|
||||||
|
COHOST_CONTENT = 200;
|
||||||
|
}
|
||||||
|
|
||||||
|
enum ReplyStatus {
|
||||||
|
REPLY_STATUS_UNKNOWN = 0;
|
||||||
|
REPLY_STATUS_AGREE = 1;
|
||||||
|
REPLY_STATUS_REFUSE_PERSONALLY = 2;
|
||||||
|
REPLY_STATUS_REFUSE_TYPE_NOT_SUPPORT = 3;
|
||||||
|
REPLY_STATUS_REFUSE_PROCESSING_INVITATION = 4;
|
||||||
|
REPLY_STATUS_REFUSE_BY_TIMEOUT = 5;
|
||||||
|
REPLY_STATUS_REFUSE_EXCEPTION = 6;
|
||||||
|
REPLY_STATUS_REFUSE_SYSTEM_NOT_SUPPORTED = 7;
|
||||||
|
REPLY_STATUS_REFUSE_SUBTYPE_DIFFERENCE = 8;
|
||||||
|
REPLY_STATUS_REFUSE_IN_MICROOM = 9;
|
||||||
|
REPLY_STATUS_REFUSE_NOT_LOAD_PLUGIN = 10;
|
||||||
|
REPLY_STATUS_REFUSE_IN_MULTI_GUEST = 11;
|
||||||
|
REPLY_STATUS_REFUSE_PAUSE_LIVE = 12;
|
||||||
|
REPLY_STATUS_REFUSE_OPEN_CAMERA_DIALOG_SHOWING = 13;
|
||||||
|
REPLY_STATUS_REFUSE_DRAW_GUESSING = 14;
|
||||||
|
REPLY_STATUS_REFUSE_RANDOM_MATCHING = 15;
|
||||||
|
REPLY_STATUS_REFUSE_IN_MATCH_PROCESSING = 16;
|
||||||
|
REPLY_STATUS_REFUSE_IN_MICROOM_FOR_MULTI_COHOST = 17;
|
||||||
|
REPLY_STATUS_REFUSE_COHOST_FINISHED = 18;
|
||||||
|
REPLY_STATUS_REFUSE_NOT_CONNECTED = 19;
|
||||||
|
REPLY_STATUS_REFUSE_LINKMIC_FULL = 20;
|
||||||
|
REPLY_STATUS_REFUSE_ARC_INCOMPATIBLE = 21;
|
||||||
|
REPLY_STATUS_REFUSE_PROCESSING_OTHER_INVITE = 22;
|
||||||
|
REPLY_STATUS_REFUSE_PROCESSING_OTHER_APPLY = 23;
|
||||||
|
REPLY_STATUS_REFUSE_IN_ANCHOR_COHOST = 24;
|
||||||
|
REPLY_STATUS_REFUSE_TOPIC_PAIRING = 25;
|
||||||
|
}
|
||||||
|
|
||||||
enum SubscribeType {
|
enum SubscribeType {
|
||||||
SUBSCRIBETYPE_ONCE = 0;
|
SUBSCRIBETYPE_ONCE = 0;
|
||||||
@@ -137,3 +216,50 @@ enum EnvelopeDisplay
|
|||||||
EnvelopeDisplayNew = 1;
|
EnvelopeDisplayNew = 1;
|
||||||
EnvelopeDisplayHide = 2;
|
EnvelopeDisplayHide = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
enum CommonContentCase {
|
||||||
|
COMMON_CONTENT_NOT_SET = 0;
|
||||||
|
CREATE_CHANNEL_CONTENT = 100;
|
||||||
|
LIST_CHANGE_CONTENT = 102;
|
||||||
|
INVITE_CONTENT = 103;
|
||||||
|
APPLY_CONTENT = 104;
|
||||||
|
PERMIT_APPLY_CONTENT = 105;
|
||||||
|
REPLY_INVITE_CONTENT = 106;
|
||||||
|
KICK_OUT_CONTENT = 107;
|
||||||
|
CANCEL_APPLY_CONTENT = 108;
|
||||||
|
CANCEL_INVITE_CONTENT = 109;
|
||||||
|
LEAVE_CONTENT = 110;
|
||||||
|
FINISH_CONTENT = 111;
|
||||||
|
JOIN_DIRECT_CONTENT = 112;
|
||||||
|
JOIN_GROUP_CONTENT = 113;
|
||||||
|
PERMIT_GROUP_CONTENT = 114;
|
||||||
|
CANCEL_GROUP_CONTENT = 115;
|
||||||
|
LEAVE_GROUP_CONTENT = 116;
|
||||||
|
P2P_GROUP_CHANGE_CONTENT = 117;
|
||||||
|
GROUP_CHANGE_CONTENT = 118;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
enum MessageType {
|
||||||
|
MESSAGETYPE_SUBSUCCESS = 0;
|
||||||
|
MESSAGETYPE_ANCHORREMINDER = 1;
|
||||||
|
MESSAGETYPE_ENTERROOMEXPIRESOON = 2;
|
||||||
|
MESSAGETYPE_SUBGOALCREATETOANCHOR = 3;
|
||||||
|
MESSAGETYPE_SUBGOALCOMPLETETOAUDIENCE = 4;
|
||||||
|
MESSAGETYPE_SUBGOALCOMPLETETOANCHOR = 5;
|
||||||
|
MESSAGETYPE_SUBGIFTTIKTOK2USERNOTICE = 6;
|
||||||
|
MESSAGETYPE_SUBGIFTTIKTOK2ANCHORNOTICE = 7;
|
||||||
|
MESSAGETYPE_SUBGIFTTRECEIVESENDNOTICE = 8;
|
||||||
|
MESSAGETYPE_SUBGIFTSENDSUCCEEDROOMMESSAGE = 9;
|
||||||
|
MESSAGETYPE_SUBGIFTSENDSUCCEEDANCHORNOTICE = 10;
|
||||||
|
MESSAGETYPE_SUBGIFTLOWVERSIONUPGRADENOTICE = 11;
|
||||||
|
MESSAGETYPE_SUBGIFTUSERBUYAUTHNOTICE = 12;
|
||||||
|
}
|
||||||
|
|
||||||
|
enum Scene {
|
||||||
|
SCENE_UNKNOWN = 0;
|
||||||
|
SCENE_CO_HOST = 2;
|
||||||
|
SCENE_MULTI_LIVE = 4;
|
||||||
|
}
|
||||||
@@ -442,7 +442,7 @@ message WebcastMemberMessage {
|
|||||||
//@WebcastPollMessage
|
//@WebcastPollMessage
|
||||||
message WebcastPollMessage {
|
message WebcastPollMessage {
|
||||||
Common common = 1;
|
Common common = 1;
|
||||||
int32 messageType = 2;
|
MessageType messageType = 2;
|
||||||
int64 pollId = 3;
|
int64 pollId = 3;
|
||||||
PollStartContent startContent = 4;
|
PollStartContent startContent = 4;
|
||||||
PollEndContent endContent = 5;
|
PollEndContent endContent = 5;
|
||||||
@@ -576,7 +576,7 @@ message WebcastLinkMicFanTicketMethod {
|
|||||||
//@WebcastLinkMicMethod
|
//@WebcastLinkMicMethod
|
||||||
message WebcastLinkMicMethod {
|
message WebcastLinkMicMethod {
|
||||||
Common common = 1;
|
Common common = 1;
|
||||||
int64 messageType = 2;
|
MessageType messageType = 2;
|
||||||
string accessKey = 3;
|
string accessKey = 3;
|
||||||
int64 anchorLinkmicId = 4;
|
int64 anchorLinkmicId = 4;
|
||||||
int64 userId = 5;
|
int64 userId = 5;
|
||||||
@@ -610,7 +610,7 @@ message WebcastUnauthorizedMemberMessage {
|
|||||||
string nickName = 4;
|
string nickName = 4;
|
||||||
Text enterText = 5;
|
Text enterText = 5;
|
||||||
}
|
}
|
||||||
S
|
|
||||||
//@WebcastMsgDetectMessage
|
//@WebcastMsgDetectMessage
|
||||||
message WebcastMsgDetectMessage {
|
message WebcastMsgDetectMessage {
|
||||||
Common common = 1;
|
Common common = 1;
|
||||||
@@ -683,9 +683,9 @@ message WebcastSystemMessage {
|
|||||||
//@WebcastLinkMessage
|
//@WebcastLinkMessage
|
||||||
message WebcastLinkMessage {
|
message WebcastLinkMessage {
|
||||||
Common common = 1;
|
Common common = 1;
|
||||||
int64 MessageType = 2;
|
MessageType MessageType = 2;
|
||||||
int64 LinkerId = 3;
|
int64 LinkerId = 3;
|
||||||
int64 Scene = 4;
|
Scene Scene = 4;
|
||||||
LinkerInviteContent InviteContent = 5;
|
LinkerInviteContent InviteContent = 5;
|
||||||
LinkerReplyContent ReplyContent = 6;
|
LinkerReplyContent ReplyContent = 6;
|
||||||
LinkerCreateContent CreateContent = 7;
|
LinkerCreateContent CreateContent = 7;
|
||||||
@@ -712,14 +712,34 @@ message WebcastLinkMessage {
|
|||||||
string TransferExtra = 202;
|
string TransferExtra = 202;
|
||||||
}
|
}
|
||||||
|
|
||||||
//@WebcastLinkLayerMessage
|
|
||||||
|
// @WebcastLinkLayerMessage
|
||||||
message WebcastLinkLayerMessage {
|
message WebcastLinkLayerMessage {
|
||||||
Common common = 1;
|
Common common = 1;
|
||||||
LinkLayerMessageType messageType = 2;
|
MessageType messageType = 2; // Enum
|
||||||
int64 channelId = 3;
|
int64 channelId = 3;
|
||||||
|
Scene scene = 4; // Enum
|
||||||
|
CreateChannelContent createChannelContent = 100;
|
||||||
|
ListChangeContent listChangeContent = 102;
|
||||||
|
InviteContent inviteContent = 103;
|
||||||
|
ApplyContent applyContent = 104;
|
||||||
|
PermitApplyContent permitApplyContent = 105;
|
||||||
|
ReplyInviteContent replyInviteContent = 106;
|
||||||
|
KickOutContent kickOutContent = 107;
|
||||||
|
CancelApplyContent cancelApplyContent = 108;
|
||||||
|
CancelInviteContent cancelInviteContent = 109;
|
||||||
|
LeaveContent leaveContent = 110;
|
||||||
|
FinishChannelContent finishContent = 111;
|
||||||
|
JoinDirectContent joinDirectContent = 112;
|
||||||
|
JoinGroupContent joinGroupContent = 113;
|
||||||
|
PermitJoinGroupContent permitGroupContent = 114;
|
||||||
|
CancelJoinGroupContent cancelGroupContent = 115;
|
||||||
|
LeaveJoinGroupContent leaveGroupContent = 116;
|
||||||
|
P2PGroupChangeContent p2pGroupChangeContent = 117;
|
||||||
|
BusinessContent businessContent = 200;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// @RoomVerifyMessage
|
||||||
message RoomVerifyMessage {
|
message RoomVerifyMessage {
|
||||||
Common common = 1;
|
Common common = 1;
|
||||||
int32 action = 2;
|
int32 action = 2;
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>TikTokLiveJava</artifactId>
|
<artifactId>TikTokLiveJava</artifactId>
|
||||||
<groupId>io.github.jwdeveloper.tiktok</groupId>
|
<groupId>io.github.jwdeveloper.tiktok</groupId>
|
||||||
<version>1.0.6-Release</version>
|
<version>1.0.8-Release</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,25 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2023-2023 jwdeveloper jacekwoln@gmail.com
|
||||||
|
*
|
||||||
|
* 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 io.github.jwdeveloper.tiktok.mappers;
|
package io.github.jwdeveloper.tiktok.mappers;
|
||||||
|
|
||||||
import com.google.protobuf.GeneratedMessageV3;
|
import com.google.protobuf.GeneratedMessageV3;
|
||||||
|
|||||||
@@ -1,3 +1,25 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2023-2023 jwdeveloper jacekwoln@gmail.com
|
||||||
|
*
|
||||||
|
* 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 io.github.jwdeveloper.tiktok.mappers.events;
|
package io.github.jwdeveloper.tiktok.mappers.events;
|
||||||
|
|
||||||
import io.github.jwdeveloper.tiktok.data.events.*;
|
import io.github.jwdeveloper.tiktok.data.events.*;
|
||||||
@@ -43,9 +65,9 @@ public class TikTokCommonEventHandler
|
|||||||
public TikTokEvent handlePollEvent(byte[] msg) {
|
public TikTokEvent handlePollEvent(byte[] msg) {
|
||||||
var poolMessage = WebcastPollMessage.parseFrom(msg);
|
var poolMessage = WebcastPollMessage.parseFrom(msg);
|
||||||
return switch (poolMessage.getMessageType()) {
|
return switch (poolMessage.getMessageType()) {
|
||||||
case 0 -> new TikTokPollStartEvent(poolMessage);
|
case MESSAGETYPE_SUBSUCCESS -> new TikTokPollStartEvent(poolMessage);
|
||||||
case 1 -> new TikTokPollEndEvent(poolMessage);
|
case MESSAGETYPE_ANCHORREMINDER -> new TikTokPollEndEvent(poolMessage);
|
||||||
case 2 -> new TikTokPollUpdateEvent(poolMessage);
|
case MESSAGETYPE_ENTERROOMEXPIRESOON -> new TikTokPollUpdateEvent(poolMessage);
|
||||||
default -> new TikTokPollEvent(poolMessage);
|
default -> new TikTokPollEvent(poolMessage);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,7 +41,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>TikTokLiveJava</artifactId>
|
<artifactId>TikTokLiveJava</artifactId>
|
||||||
<groupId>io.github.jwdeveloper.tiktok</groupId>
|
<groupId>io.github.jwdeveloper.tiktok</groupId>
|
||||||
<version>1.0.6-Release</version>
|
<version>1.0.8-Release</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|||||||
@@ -1,3 +1,25 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2023-2023 jwdeveloper jacekwoln@gmail.com
|
||||||
|
*
|
||||||
|
* 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 io.github.jwdeveloper.tiktok;
|
package io.github.jwdeveloper.tiktok;
|
||||||
|
|
||||||
import io.github.jwdeveloper.tiktok.data.events.TikTokErrorEvent;
|
import io.github.jwdeveloper.tiktok.data.events.TikTokErrorEvent;
|
||||||
|
|||||||
@@ -0,0 +1,35 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2023-2023 jwdeveloper jacekwoln@gmail.com
|
||||||
|
*
|
||||||
|
* 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 io.github.jwdeveloper.tiktok;
|
||||||
|
|
||||||
|
public class Examplee
|
||||||
|
{
|
||||||
|
public static void main(String[] args)
|
||||||
|
{
|
||||||
|
TikTokLive.newClient("skullchefasmr")
|
||||||
|
.onGift((liveClient, event) ->
|
||||||
|
{
|
||||||
|
System.out.println("Dzięki za gifta "+event.getGift().getName());
|
||||||
|
}).buildAndConnect();
|
||||||
|
}
|
||||||
|
}
|
||||||
31
README.md
31
README.md
@@ -1,7 +1,6 @@
|
|||||||
<div align="center" >
|
<div align="center" >
|
||||||
<a target="blank" >
|
<a target="blank" >
|
||||||
<img src="https://raw.githubusercontent.com/jwdeveloper/TikTokLiveJava/develop-1_0_0/Tools-ReadmeGenerator/src/main/resources/logo.svg" width="15%" >
|
<img src="https://raw.githubusercontent.com/jwdeveloper/TikTokLiveJava/develop-1_0_0/Tools-ReadmeGenerator/src/main/resources/logo.svg" width="15%" >
|
||||||
</img>
|
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<div align="center" >
|
<div align="center" >
|
||||||
@@ -12,18 +11,15 @@
|
|||||||
<div align="center" >
|
<div align="center" >
|
||||||
<a href="https://jitpack.io/#jwdeveloper/TikTok-Live-Java" target="blank" >
|
<a href="https://jitpack.io/#jwdeveloper/TikTok-Live-Java" target="blank" >
|
||||||
<img src="https://jitpack.io/v/jwdeveloper/TikTok-Live-Java.svg" width="20%" >
|
<img src="https://jitpack.io/v/jwdeveloper/TikTok-Live-Java.svg" width="20%" >
|
||||||
</img>
|
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
|
|
||||||
<a href="https://discord.gg/e2XwPNTBBr" target="blank" >
|
<a href="https://discord.gg/e2XwPNTBBr" target="blank" >
|
||||||
<img src="https://img.shields.io/badge/Discord-%235865F2.svg?style=for-the-badge&logo=discord&logoColor=white" >
|
<img src="https://img.shields.io/badge/Discord-%235865F2.svg?style=for-the-badge&logo=discord&logoColor=white" >
|
||||||
</img>
|
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<a target="blank" >
|
<a target="blank" >
|
||||||
<img src="https://img.shields.io/badge/java-%23ED8B00.svg?style=for-the-badge&logo=openjdk&logoColor=white" >
|
<img src="https://img.shields.io/badge/java-%23ED8B00.svg?style=for-the-badge&logo=openjdk&logoColor=white" >
|
||||||
</img>
|
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -33,6 +29,9 @@ A Java library inspired by [TikTokLive](https://github.com/isaackogan/TikTokLive
|
|||||||
The library includes a wrapper that connects to the WebCast service using just the username (`uniqueId`). This allows you to connect to your own live chat as well as the live chat of other streamers.
|
The library includes a wrapper that connects to the WebCast service using just the username (`uniqueId`). This allows you to connect to your own live chat as well as the live chat of other streamers.
|
||||||
No credentials are required. Events such as [Members Joining](#member), [Gifts](#gift), [Subscriptions](#subscribe), [Viewers](#roomuser), [Follows](#social), [Shares](#social), [Questions](#questionnew), [Likes](#like) and [Battles](#linkmicbattle) can be tracked.
|
No credentials are required. Events such as [Members Joining](#member), [Gifts](#gift), [Subscriptions](#subscribe), [Viewers](#roomuser), [Follows](#social), [Shares](#social), [Questions](#questionnew), [Likes](#like) and [Battles](#linkmicbattle) can be tracked.
|
||||||
|
|
||||||
|
# Contributors
|
||||||
|
[Library documentation for contributors](https://github.com/jwdeveloper/TikTokLiveJava/wiki)
|
||||||
|
|
||||||
<div align="center">
|
<div align="center">
|
||||||
<a href="https://www.youtube.com/watch?v=eerWGgUKc6c" align="right" target="blank"><img src="https://img.youtube.com/vi/eerWGgUKc6c/hqdefault.jpg" alt="IMAGE ALT TEXT" width="38%" align="right"></a>
|
<a href="https://www.youtube.com/watch?v=eerWGgUKc6c" align="right" target="blank"><img src="https://img.youtube.com/vi/eerWGgUKc6c/hqdefault.jpg" alt="IMAGE ALT TEXT" width="38%" align="right"></a>
|
||||||
</div>
|
</div>
|
||||||
@@ -55,8 +54,9 @@ Do you prefer other programming languages?
|
|||||||
|
|
||||||
## Getting started
|
## Getting started
|
||||||
|
|
||||||
1. Install the package via Maven
|
1. Install the package
|
||||||
|
|
||||||
|
Maven
|
||||||
```xml
|
```xml
|
||||||
<repositories>
|
<repositories>
|
||||||
<repository>
|
<repository>
|
||||||
@@ -69,12 +69,27 @@ Do you prefer other programming languages?
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.github.jwdeveloper.TikTok-Live-Java</groupId>
|
<groupId>com.github.jwdeveloper.TikTok-Live-Java</groupId>
|
||||||
<artifactId>Client</artifactId>
|
<artifactId>Client</artifactId>
|
||||||
<version>1.0.6-Release</version>
|
<version>1.0.8-Release</version>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Gradle
|
||||||
|
```gradle
|
||||||
|
dependencyResolutionManagement {
|
||||||
|
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
|
||||||
|
repositories {
|
||||||
|
mavenCentral()
|
||||||
|
maven { url 'https://jitpack.io' }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
implementation 'com.github.jwdeveloper.TikTok-Live-Java:Client:1.0.8-Release'
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
2. Create your first chat connection
|
2. Create your first chat connection
|
||||||
|
|
||||||
```java
|
```java
|
||||||
@@ -419,9 +434,9 @@ Triggered every time gift is sent
|
|||||||
<p>>Combo: 1 -> comboState = GiftSendType.Begin</p>
|
<p>>Combo: 1 -> comboState = GiftSendType.Begin</p>
|
||||||
<p>Combo: 4 -> comboState = GiftSendType.Active</p>
|
<p>Combo: 4 -> comboState = GiftSendType.Active</p>
|
||||||
<p>Combo: 8 -> comboState = GiftSendType.Active</p>
|
<p>Combo: 8 -> comboState = GiftSendType.Active</p>
|
||||||
<p>Combo: 12 -> comboState = GiftSendType.Finsihed</p>
|
<p>Combo: 12 -> comboState = GiftSendType.Finished</p>
|
||||||
|
|
||||||
Remember if comboState is Finsihed both TikTokGiftComboEvent and TikTokGiftEvent event gets triggered
|
Remember if comboState is Finished both TikTokGiftComboEvent and TikTokGiftEvent event gets triggered
|
||||||
|
|
||||||
|
|
||||||
```java
|
```java
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>TikTokLiveJava</artifactId>
|
<artifactId>TikTokLiveJava</artifactId>
|
||||||
<groupId>io.github.jwdeveloper.tiktok</groupId>
|
<groupId>io.github.jwdeveloper.tiktok</groupId>
|
||||||
<version>1.0.6-Release</version>
|
<version>1.0.8-Release</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>TikTokLiveJava</artifactId>
|
<artifactId>TikTokLiveJava</artifactId>
|
||||||
<groupId>io.github.jwdeveloper.tiktok</groupId>
|
<groupId>io.github.jwdeveloper.tiktok</groupId>
|
||||||
<version>1.0.6-Release</version>
|
<version>1.0.8-Release</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<artifactId>Tools-EventsWebViewer</artifactId>
|
<artifactId>Tools-EventsWebViewer</artifactId>
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>TikTokLiveJava</artifactId>
|
<artifactId>TikTokLiveJava</artifactId>
|
||||||
<groupId>io.github.jwdeveloper.tiktok</groupId>
|
<groupId>io.github.jwdeveloper.tiktok</groupId>
|
||||||
<version>1.0.6-Release</version>
|
<version>1.0.8-Release</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>TikTokLiveJava</artifactId>
|
<artifactId>TikTokLiveJava</artifactId>
|
||||||
<groupId>io.github.jwdeveloper.tiktok</groupId>
|
<groupId>io.github.jwdeveloper.tiktok</groupId>
|
||||||
<version>1.0.6-Release</version>
|
<version>1.0.8-Release</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
167
collaboration.md
167
collaboration.md
@@ -19,76 +19,185 @@ Are you willing to help or improve TikTokLiveJava?
|
|||||||
|
|
||||||
We can divide working of library to 4 important parts
|
We can divide working of library to 4 important parts
|
||||||
|
|
||||||
- Getting info about live from TikTok
|
- Getting info about live from TikTok. Library is making 3 https requests
|
||||||
Library is making 3 https
|
|
||||||
- first for getting live `Room_ID`
|
- first for getting live `Room_ID`
|
||||||
- second for getting more specific live metadata such as live title, host name...
|
- second for getting more specific live metadata such as live title, host name...
|
||||||
- third to `Sign API` that returns access token that is later use for connecting
|
- third to `Sign API` that returns access token that is later use for connecting
|
||||||
to TikTok websocket
|
to TikTok websocket
|
||||||
- Connecting to TikTok websocket (PushServer)
|
- Connecting to TikTok websocket (PushServer)
|
||||||
After successful connection TikTok starts to send `ProtocolBuffer`
|
|
||||||
messages in binary format. This is very important to understand `ProtocolBuffer`
|
After successful connection to TikTok, `pushServer` starts to send `ProtocolBuffer`
|
||||||
it is not complicated :). All the proto files are included under `API/src/main/proto`
|
messages in binary format. This is very important to understand `ProtocolBuffer`. Don't worry it is not complicated :).
|
||||||
After using `Maven compile` command on project, java classes are generated from
|
All the proto files are included under `API/src/main/proto` After using `Maven compile` command on project, java classes are generated from
|
||||||
those files. so then we can easily map incoming bytes to class, for examples
|
those files. so then we can easily map incoming bytes to classes, for examples
|
||||||
`WebcastGiftMessage message = WebcastGiftMessage.parseFrom(incomingBytesArray)`
|
`WebcastGiftMessage message = WebcastGiftMessage.parseFrom(incomingBytesArray)`
|
||||||
|
|
||||||
- Mapping TikTok data to events
|
- Mapping TikTok data to events
|
||||||
at this point we have TikTok data inside protocol-buffer classes now we want
|
|
||||||
to map it to TikTokLiveJava events. Why? because `protocol-buffer classes` might
|
At this point we have TikTok data inside protocol-buffer classes now we want
|
||||||
be changed at any point, but we want to keep library code structure keep consistent
|
to map it to events. Why? because `protocol-buffer classes` might be changed at any point,
|
||||||
so for example `WebcastGiftMessage` is mapped manually to `TikTokGiftEvent`
|
but we want to keep library code structure consistent across versions.
|
||||||
|
so for example `WebcastGiftMessage` is mapped to `TikTokGiftEvent`
|
||||||
|
|
||||||
- trigger events
|
- trigger events
|
||||||
when the events objects are done last step is to trigger then and that's it
|
|
||||||
|
When the events objects are done last step is to trigger them. And that's it!
|
||||||
`tikTokEventObserver.publish(liveClient, tiktokGiftEvent)`
|
`tikTokEventObserver.publish(liveClient, tiktokGiftEvent)`
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### Project structure
|
### Project structure
|
||||||
project is made from few modules the most important one are
|
Project is made from few modules the most important one are
|
||||||
|
|
||||||
#### API
|
#### API
|
||||||
|
|
||||||
Contains interfaces and data classes, all code that is ment
|
Contains interfaces and data classes. All code included in this
|
||||||
to be visible and use for the Library user should be included
|
project is ment to be visible to people that are using library.
|
||||||
in this project
|
|
||||||
|
|
||||||
- All the events can be found user `io.github.jwdeveloper.tiktok.data.events`
|
- All the events can be found user `io.github.jwdeveloper.tiktok.data.events`
|
||||||
- All the class data that are used in events is under `io.github.jwdeveloper.tiktok.data.models`
|
- All the class data that are used in events is under `io.github.jwdeveloper.tiktok.data.models`
|
||||||
|
- All the protocol-buffer classes will be generated at namespack `io.github.jwdeveloper.tiktok.messages` they are at location `API\target\classes\io\github\jwdeveloper\tiktok\messages`
|
||||||
|
|
||||||
#### Client
|
#### Client
|
||||||
|
|
||||||
Contains implementation of `API` modules interfaces and all the code
|
Contains implementation of `API` modules interfaces and all the code
|
||||||
important classes
|
important classes
|
||||||
|
|
||||||
- `TikTokLiveClient` core class that is use to connect/disconnect from TikTok
|
- `TikTokLiveClient` core class that is use to mangae connection disconnection
|
||||||
- `TikTokLiveClientBuilder` preparing `TikTokLiveClient` class
|
- `TikTokLiveClientBuilder` preparing and creating `TikTokLiveClient` class
|
||||||
- `TikTokApiService` use for Http requests to TikTok/Sign API
|
- `TikTokApiService` use for Http requests to TikTok/Sign API
|
||||||
- `TikTokWebSocketClient` receiving all ProtocolBuffer messages from TikTok
|
- `TikTokWebSocketClient` receiving all ProtocolBuffer messages from TikTok
|
||||||
- `TikTokMessageHandlerRegistration` register all mappings TikTok data -> TikTokLiveJava events
|
- `TikTokMessageHandler` **heart of library** it finds suitable mapper for incoming data and triggers its mapping handler as result list of events
|
||||||
|
is created and published. **check out** `TikTokMessageHandler.handleSingleMessage`
|
||||||
|
- `TikTokMessageHandlerRegistration` register all mappings `protol-buffer` classes -> `events`
|
||||||
- `TikTokEventObserver` used to register and trigger TikTok events
|
- `TikTokEventObserver` used to register and trigger TikTok events
|
||||||
|
|
||||||
There are also few more modules made purely for testing and debbuging code
|
|
||||||
|
### There are also few more modules made purely for testing and debbuging code
|
||||||
|
|
||||||
#### Examples
|
#### Examples
|
||||||
Project made to show up new features and present basic
|
Project is made to show up new features and present basic
|
||||||
example for library. While developing new features you
|
example of library. While developing you can use it this project as playground
|
||||||
can use it as playground
|
|
||||||
|
|
||||||
#### Tools
|
#### Tools
|
||||||
Project that contains code generators for automation teadios boilder plate
|
Project that contains code generators.
|
||||||
It contains very useful class `GenerateGiftsEnum` that download gifts json from TikTok
|
The most useful one is class `GenerateGiftsEnum` that download gifts json from TikTok
|
||||||
and generates code for `Gift` enum that is later added to `API` module at path `io.github.jwdeveloper.tiktok.data.models.gifts.Gift`
|
and generates code for `Gift` enum that is later added to `API` module at path `io.github.jwdeveloper.tiktok.data.models.gifts.Gift`
|
||||||
|
|
||||||
#### Tools-EventsCollector
|
#### Tools-EventsCollector
|
||||||
Tool that can be used to store all events from live to sqlLite database or Json file
|
Tool that can be used to store all `protocol-buffer` and `events` from live to `sqlLite` database or `Json` file
|
||||||
It is very handy for later debuging events data
|
It is very handy for later debuging `protocol-buffer` and `events` data
|
||||||
|
|
||||||
#### Tools-EventsWebViewer
|
#### Tools-EventsWebViewer
|
||||||
Tools that runs website that collects and display pure data from TikTok incoming events
|
Tools that runs website that collects and display pure data from TikTok
|
||||||
very useful for debuging
|
very useful for debuging
|
||||||
|
|
||||||
#### Tools-ReadmeGenerator
|
#### Tools-ReadmeGenerator
|
||||||
Generates readme file from template
|
Generates readme file from template
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### How to add new Event?
|
||||||
|
|
||||||
|
First step is to create class that represends event. Remember, all the events classes must be located in the `io.github.jwdeveloper.tiktok.data.events` package
|
||||||
|
|
||||||
|
```java
|
||||||
|
package io.github.jwdeveloper.tiktok.data.events;
|
||||||
|
|
||||||
|
import io.github.jwdeveloper.tiktok.annotations.EventMeta;
|
||||||
|
import io.github.jwdeveloper.tiktok.annotations.EventType;
|
||||||
|
import io.github.jwdeveloper.tiktok.data.events.common.TikTokHeaderEvent;
|
||||||
|
import io.github.jwdeveloper.tiktok.messages.data.User;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
|
||||||
|
@Data //lombok annotation
|
||||||
|
@EventMeta(eventType = EventType.Message) //this annotation is used by readme generater code
|
||||||
|
public class CustomEvent extends TikTokHeaderEvent
|
||||||
|
{
|
||||||
|
private final User user;
|
||||||
|
private final String title;
|
||||||
|
|
||||||
|
public CustomEvent(User user,String title)
|
||||||
|
{
|
||||||
|
this.user = user;
|
||||||
|
this.title = title;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
Now we can jump to the `io.github.jwdeveloper.tiktok.handlers.TikTokMessageHandlerRegistration` class. It is used
|
||||||
|
to define mappings from incoming protocolbuffer data to Events.
|
||||||
|
Note that all classes that starts with `Webcast` represents protocolbuffer data that is coming from tiktok
|
||||||
|
Note all `Webcast` classes are generated from `proto` file that is defined in `API/src/main/proto/webcast.proto` I recommand to use `protocolbuffer` plugin for inteliji
|
||||||
|
|
||||||
|
|
||||||
|
For this example we registered new mapping that is triggered every time `WebcastGiftMessage` is comming
|
||||||
|
from TikTok.
|
||||||
|
|
||||||
|
```java
|
||||||
|
public void init() {
|
||||||
|
|
||||||
|
registerMapping(WebcastGiftMessage.class, bytes ->
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
WebcastGiftMessage tiktokData = WebcastGiftMessage.parseFrom(bytes);
|
||||||
|
|
||||||
|
io.github.jwdeveloper.tiktok.messages.data.User tiktokProtocolBufferUser = tiktokData.getUser();
|
||||||
|
io.github.jwdeveloper.tiktok.data.models.users.User tiktokLiveJavaUser = User.map(tiktokProtocolBufferUser);
|
||||||
|
|
||||||
|
return new CustomEvent(tiktokLiveJavaUser, "hello word");
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new TikTokLiveException("Unable to parse our custom event", e);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
//ConnectionEvents events
|
||||||
|
registerMapping(WebcastControlMessage.class, this::handleWebcastControlMessage);
|
||||||
|
|
||||||
|
//Room status events
|
||||||
|
registerMapping(WebcastLiveIntroMessage.class, roomInfoHandler::handleIntro);
|
||||||
|
registerMapping(WebcastRoomUserSeqMessage.class, roomInfoHandler::handleUserRanking);
|
||||||
|
|
||||||
|
registerMapping(WebcastCaptionMessage.class, TikTokCaptionEvent.class);
|
||||||
|
//... more mappings down there
|
||||||
|
}
|
||||||
|
```
|
||||||
|

|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Next step is to open `TikTokLiveClientBuilder` and add method for handling our new event
|
||||||
|
|
||||||
|
``` java
|
||||||
|
|
||||||
|
public LiveClientBuilder onCustomEvent(EventConsumer<CustomEvent> event) {
|
||||||
|
tikTokEventHandler.subscribe(CustomEvent.class, event);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
```
|
||||||
|

|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
To make `onCustomEvent` method visible from `TikTokLive.newClient("asds").onCustomEvent()` we
|
||||||
|
need to also include it to interface `EventsBuilder`
|
||||||
|
|
||||||
|
``` java
|
||||||
|
T onCustomEvent(EventConsumer<CustomEvent> event);
|
||||||
|
```
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Finally we are good to go, our event has been included!
|
||||||
|
|
||||||
|

|
||||||
2
pom.xml
2
pom.xml
@@ -7,7 +7,7 @@
|
|||||||
<groupId>io.github.jwdeveloper.tiktok</groupId>
|
<groupId>io.github.jwdeveloper.tiktok</groupId>
|
||||||
<artifactId>TikTokLiveJava</artifactId>
|
<artifactId>TikTokLiveJava</artifactId>
|
||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
<version>1.0.6-Release</version>
|
<version>1.0.8-Release</version>
|
||||||
<modules>
|
<modules>
|
||||||
<module>API</module>
|
<module>API</module>
|
||||||
<module>Client</module>
|
<module>Client</module>
|
||||||
|
|||||||
Reference in New Issue
Block a user