From 1cc8a5af1b93bf2024a580de8e181b4393674e42 Mon Sep 17 00:00:00 2001 From: kohlerpop1 Date: Wed, 16 Apr 2025 22:25:22 -0400 Subject: [PATCH] Adapt everything to newly updated proto and fix all mappings for those events. --- API/pom.xml | 2 +- .../data/events/TikTokCaptionEvent.java | 29 +- .../data/events/TikTokCommentEvent.java | 2 +- .../data/events/TikTokGoalUpdateEvent.java | 10 +- .../data/events/TikTokInRoomBannerEvent.java | 5 +- .../data/events/TikTokLinkMicArmiesEvent.java | 36 +- .../data/events/TikTokLinkMicBattleEvent.java | 152 ++- .../data/events/TikTokQuestionEvent.java | 8 +- .../data/events/TikTokSubscribeEvent.java | 4 +- .../data/events/common/TikTokHeaderEvent.java | 6 +- .../events/link/TikTokLinkEnterEvent.java | 3 +- .../link/TikTokLinkMediaChangeEvent.java | 7 +- .../data/events/link/TikTokLinkMuteEvent.java | 8 +- .../data/events/room/TikTokRoomPinEvent.java | 2 +- .../data/events/social/TikTokFollowEvent.java | 2 +- .../data/events/social/TikTokJoinEvent.java | 2 +- .../data/events/social/TikTokLikeEvent.java | 4 +- .../data/events/social/TikTokShareEvent.java | 6 +- .../TikTokWebsocketMessageEvent.java | 16 +- .../TikTokWebsocketResponseEvent.java | 12 +- .../TikTokWebsocketUnhandledMessageEvent.java | 8 +- .../tiktok/data/models/LinkMicArmy.java | 24 +- .../tiktok/data/models/badges/Badge.java | 2 +- .../tiktok/data/models/battles/Team.java | 92 +- .../tiktok/data/models/battles/Team1v1.java | 45 - .../tiktok/data/models/battles/Team2v2.java | 50 - .../tiktok/data/models/battles/Viewer.java | 39 - .../tiktok/data/models/users/ListUser.java | 18 +- .../tiktok/data/models/users/User.java | 11 +- .../data/requests/LiveConnectionData.java | 8 +- .../TikTokLiveMessageException.java | 12 +- .../tiktok/live/LiveMessagesHandler.java | 6 +- .../tiktok/utils/ProtocolUtils.java | 14 +- API/src/main/proto/data.proto | 1137 +++++++++++++---- API/src/main/proto/enums.proto | 564 +++++++- API/src/main/proto/webcast.proto | 1014 ++++++++++++--- .../jwdeveloper/tiktok/TikTokLiveClient.java | 6 +- .../tiktok/TikTokLiveHttpClient.java | 4 +- .../tiktok/TikTokLiveHttpOfflineClient.java | 9 +- .../tiktok/TikTokLiveMessageHandler.java | 14 +- .../handlers/TikTokCommonEventHandler.java | 12 +- .../websocket/TikTokWebSocketListener.java | 6 +- examples/pom.xml | 6 - extension-collector/pom.xml | 6 - .../collector/impl/DataCollectorListener.java | 12 +- 45 files changed, 2541 insertions(+), 894 deletions(-) delete mode 100644 API/src/main/java/io/github/jwdeveloper/tiktok/data/models/battles/Team1v1.java delete mode 100644 API/src/main/java/io/github/jwdeveloper/tiktok/data/models/battles/Team2v2.java delete mode 100644 API/src/main/java/io/github/jwdeveloper/tiktok/data/models/battles/Viewer.java diff --git a/API/pom.xml b/API/pom.xml index 3dd1174..f4df980 100644 --- a/API/pom.xml +++ b/API/pom.xml @@ -80,4 +80,4 @@ - + \ No newline at end of file diff --git a/API/src/main/java/io/github/jwdeveloper/tiktok/data/events/TikTokCaptionEvent.java b/API/src/main/java/io/github/jwdeveloper/tiktok/data/events/TikTokCaptionEvent.java index d58c50e..7afaab7 100644 --- a/API/src/main/java/io/github/jwdeveloper/tiktok/data/events/TikTokCaptionEvent.java +++ b/API/src/main/java/io/github/jwdeveloper/tiktok/data/events/TikTokCaptionEvent.java @@ -22,25 +22,36 @@ */ 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.annotations.*; import io.github.jwdeveloper.tiktok.data.events.common.TikTokHeaderEvent; import io.github.jwdeveloper.tiktok.messages.webcast.WebcastCaptionMessage; import lombok.Value; +import java.util.*; + @Value @EventMeta(eventType = EventType.Message) public class TikTokCaptionEvent extends TikTokHeaderEvent { Long captionTimeStamp; - - String iSOLanguage; - - String text; + List contents; public TikTokCaptionEvent(WebcastCaptionMessage msg) { super(msg.getCommon()); - captionTimeStamp = msg.getTimeStamp(); - iSOLanguage = msg.getCaptionData().getLanguage(); - text = msg.getCaptionData().getText(); + captionTimeStamp = msg.getTimestampMs(); + contents = new ArrayList<>(); + for (WebcastCaptionMessage.CaptionContent captionContent : msg.getContentList()) + contents.add(new CaptionContent(captionContent)); + } + + @Value + public static class CaptionContent { + String iSOLanguage; + + String text; + + public CaptionContent(WebcastCaptionMessage.CaptionContent captionContent) { + this.iSOLanguage = captionContent.getLang(); + this.text = captionContent.getContent(); + } } } \ No newline at end of file diff --git a/API/src/main/java/io/github/jwdeveloper/tiktok/data/events/TikTokCommentEvent.java b/API/src/main/java/io/github/jwdeveloper/tiktok/data/events/TikTokCommentEvent.java index aa91cda..db21a9c 100644 --- a/API/src/main/java/io/github/jwdeveloper/tiktok/data/events/TikTokCommentEvent.java +++ b/API/src/main/java/io/github/jwdeveloper/tiktok/data/events/TikTokCommentEvent.java @@ -58,7 +58,7 @@ public class TikTokCommentEvent extends TikTokHeaderEvent { var builder = WebcastChatMessage.newBuilder(); builder.setUser(io.github.jwdeveloper.tiktok.messages.data.User.newBuilder() .setNickname(userName) - .setDisplayId(userName) + .setUsername(userName) .build()); builder.setContentLanguage("en"); builder.setVisibleToSender(true); diff --git a/API/src/main/java/io/github/jwdeveloper/tiktok/data/events/TikTokGoalUpdateEvent.java b/API/src/main/java/io/github/jwdeveloper/tiktok/data/events/TikTokGoalUpdateEvent.java index 036bbcd..5335d8c 100644 --- a/API/src/main/java/io/github/jwdeveloper/tiktok/data/events/TikTokGoalUpdateEvent.java +++ b/API/src/main/java/io/github/jwdeveloper/tiktok/data/events/TikTokGoalUpdateEvent.java @@ -47,9 +47,9 @@ public class TikTokGoalUpdateEvent extends TikTokHeaderEvent { goalId = msg.getGoal().getId(); description = msg.getGoal().getDescription(); users = msg.getGoal() - .getContributorsListList() - .stream() - .map(u -> new User(u.getUserId(), u.getDisplayId(), Picture.map(u.getAvatar()))) - .toList(); + .getContributorsList() + .stream() + .map(u -> new User(u.getUserId(), u.getDisplayId(), Picture.map(u.getAvatar()))) + .toList(); } -} +} \ No newline at end of file diff --git a/API/src/main/java/io/github/jwdeveloper/tiktok/data/events/TikTokInRoomBannerEvent.java b/API/src/main/java/io/github/jwdeveloper/tiktok/data/events/TikTokInRoomBannerEvent.java index 8b7fb21..a60a7fb 100644 --- a/API/src/main/java/io/github/jwdeveloper/tiktok/data/events/TikTokInRoomBannerEvent.java +++ b/API/src/main/java/io/github/jwdeveloper/tiktok/data/events/TikTokInRoomBannerEvent.java @@ -22,8 +22,7 @@ */ 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.annotations.*; import io.github.jwdeveloper.tiktok.data.events.common.TikTokHeaderEvent; import io.github.jwdeveloper.tiktok.messages.webcast.WebcastInRoomBannerMessage; import lombok.Getter; @@ -35,6 +34,6 @@ public class TikTokInRoomBannerEvent extends TikTokHeaderEvent { public TikTokInRoomBannerEvent(WebcastInRoomBannerMessage msg) { super(msg.getHeader()); - json = msg.getJson(); + json = msg.getExtraMap().toString(); } } \ No newline at end of file diff --git a/API/src/main/java/io/github/jwdeveloper/tiktok/data/events/TikTokLinkMicArmiesEvent.java b/API/src/main/java/io/github/jwdeveloper/tiktok/data/events/TikTokLinkMicArmiesEvent.java index b6375f3..c7a90f3 100644 --- a/API/src/main/java/io/github/jwdeveloper/tiktok/data/events/TikTokLinkMicArmiesEvent.java +++ b/API/src/main/java/io/github/jwdeveloper/tiktok/data/events/TikTokLinkMicArmiesEvent.java @@ -22,16 +22,14 @@ */ 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.annotations.*; import io.github.jwdeveloper.tiktok.data.events.common.TikTokHeaderEvent; -import io.github.jwdeveloper.tiktok.data.models.LinkMicArmy; -import io.github.jwdeveloper.tiktok.data.models.Picture; -import io.github.jwdeveloper.tiktok.messages.enums.LinkMicBattleStatus; +import io.github.jwdeveloper.tiktok.data.models.*; +import io.github.jwdeveloper.tiktok.messages.enums.*; import io.github.jwdeveloper.tiktok.messages.webcast.WebcastLinkMicArmies; import lombok.Getter; -import java.util.List; +import java.util.*; /** * Triggered every time a battle participant receives points. Contains the current status of the battle and the army that suported the group. @@ -47,13 +45,29 @@ public class TikTokLinkMicArmiesEvent extends TikTokHeaderEvent { private final Picture picture; - private final List armies; + private final Map armies; + + private final BattleType battleType; public TikTokLinkMicArmiesEvent(WebcastLinkMicArmies msg) { super(msg.getCommon()); - battleId = msg.getId(); - armies = msg.getBattleItemsList().stream().map(LinkMicArmy::new).toList(); - picture = Picture.map(msg.getImage()); - finished = msg.getBattleStatus() == LinkMicBattleStatus.ARMY_FINISHED; + System.out.println(msg); + battleId = msg.getBattleId(); + armies = new HashMap<>(); + picture = Picture.map(msg.getGifIconImage()); + finished = msg.getTriggerReason() == TriggerReason.TRIGGER_REASON_BATTLE_END; + battleType = msg.getBattleSettings().getBattleType(); + + switch (battleType) { + case BATTLE_TYPE_NORMAL_BATTLE -> // 1v1 | Fields present - armies + msg.getArmiesMap().forEach((aLong, userArmies) -> armies.put(aLong, new LinkMicArmy(userArmies))); + case BATTLE_TYPE_TEAM_BATTLE -> // 2v2 | Fields present - team_armies + msg.getTeamArmiesList().forEach(teamArmy -> armies.put(teamArmy.getTeamId(), new LinkMicArmy(teamArmy.getUserArmies()))); + case BATTLE_TYPE_INDIVIDUAL_BATTLE -> // 1v1v1 or 1v1v1v1 | Fields present - team_armies + msg.getTeamArmiesList().forEach(teamArmy -> armies.put(teamArmy.getTeamId(), new LinkMicArmy(teamArmy.getUserArmies()))); + case BATTLE_TYPE_1_V_N -> { // 1 vs Many | Have no data for this yet + // Most complicated and uncommon battle type - When more data is collected, this will be updated. + } + } } } \ No newline at end of file diff --git a/API/src/main/java/io/github/jwdeveloper/tiktok/data/events/TikTokLinkMicBattleEvent.java b/API/src/main/java/io/github/jwdeveloper/tiktok/data/events/TikTokLinkMicBattleEvent.java index 97d0bcb..cbe2439 100644 --- a/API/src/main/java/io/github/jwdeveloper/tiktok/data/events/TikTokLinkMicBattleEvent.java +++ b/API/src/main/java/io/github/jwdeveloper/tiktok/data/events/TikTokLinkMicBattleEvent.java @@ -24,13 +24,15 @@ package io.github.jwdeveloper.tiktok.data.events; import io.github.jwdeveloper.tiktok.annotations.*; import io.github.jwdeveloper.tiktok.data.events.common.TikTokHeaderEvent; -import io.github.jwdeveloper.tiktok.data.models.battles.*; -import io.github.jwdeveloper.tiktok.exceptions.TikTokLiveException; -import io.github.jwdeveloper.tiktok.messages.enums.LinkMicBattleStatus; +import io.github.jwdeveloper.tiktok.data.models.battles.Team; +import io.github.jwdeveloper.tiktok.data.models.users.User; +import io.github.jwdeveloper.tiktok.messages.data.*; +import io.github.jwdeveloper.tiktok.messages.enums.*; import io.github.jwdeveloper.tiktok.messages.webcast.WebcastLinkMicBattle; import lombok.Getter; -import java.util.List; +import java.util.*; +import java.util.stream.Collectors; /** * Triggered every time a battle starts & ends @@ -44,94 +46,86 @@ public class TikTokLinkMicBattleEvent extends TikTokHeaderEvent true if battle is finished otherwise false */ private final boolean finished; - private final Team team1, team2; + private final List teams; + private final BattleType battleType; public TikTokLinkMicBattleEvent(WebcastLinkMicBattle msg) { super(msg.getCommon()); - battleId = msg.getId(); - finished = msg.getBattleStatus() == LinkMicBattleStatus.BATTLE_FINISHED; - if (msg.getHostTeamCount() == 2) { // 1v1 battle - team1 = new Team1v1(msg.getHostTeam(0), msg); - team2 = new Team1v1(msg.getHostTeam(1), msg); - } else { // 2v2 battle - if (isFinished()) { - team1 = new Team2v2(msg.getHostData2V2List().stream().filter(data -> data.getTeamNumber() == 1).findFirst().orElse(null), msg); - team2 = new Team2v2(msg.getHostData2V2List().stream().filter(data -> data.getTeamNumber() == 2).findFirst().orElse(null), msg); - } else { - team1 = new Team2v2(msg.getHostTeam(0), msg.getHostTeam(1), msg); - team2 = new Team2v2(msg.getHostTeam(2), msg.getHostTeam(3), msg); + System.out.println(msg); + battleId = msg.getBattleId(); + finished = msg.getAction() == BattleAction.BATTLE_ACTION_FINISH; + battleType = msg.getBattleSetting().getBattleType(); + teams = new ArrayList<>(); + switch (battleType) { + case BATTLE_TYPE_NORMAL_BATTLE -> { // 1v1 | Fields present - anchor_info, battle_combos + for (Long userId : msg.getAnchorInfoMap().keySet()) + teams.add(new Team(msg.getAnchorInfoOrThrow(userId), msg.getBattleCombosOrThrow(userId))); + if (finished) { // Additional fields present - battle_result, armies + for (Team team : teams) { + Long userId = team.getHosts().get(0).getId(); + team.setTotalPoints((int) msg.getBattleResultOrThrow(userId).getScore()); + team.setViewers(msg.getArmiesOrThrow(userId).getUserArmyList().stream().collect(Collectors.toMap(User::new, bua -> (int) bua.getScore()))); + } + } + } + case BATTLE_TYPE_TEAM_BATTLE -> { // 2v2 | Fields present - anchor_info + if (finished) { // Additional fields present - team_battle_result, team_armies + for (BattleTeamUserArmies army : msg.getTeamArmiesList()) { + Team team = new Team(army.getTeamId(), army.getTeamUsersList().stream() + .map(BattleTeamUser::getUserId).map(userId -> new User(msg.getAnchorInfoOrThrow(userId).getUser())).toList()); + team.setTotalPoints((int) army.getTeamTotalScore()); + team.setViewers(army.getUserArmies().getUserArmyList().stream().collect(Collectors.toMap(User::new, bua -> (int) bua.getScore()))); + teams.add(team); + } + } else { // Additional fields present - team_users + for (WebcastLinkMicBattle.TeamUsersInfo teamUsersInfo : msg.getTeamUsersList()) + teams.add(new Team(teamUsersInfo.getTeamId(), teamUsersInfo.getUserIdsList().stream() + .map(userId -> new User(msg.getAnchorInfoOrThrow(userId).getUser())).toList())); + } + } + case BATTLE_TYPE_INDIVIDUAL_BATTLE -> { // 1v1v1 or 1v1v1v1 | Fields present - anchor_info + teams.addAll(msg.getAnchorInfoMap().values().stream().map(Team::new).toList()); + if (finished) { // Additional fields present - team_battle_result, team_armies + for (Team team : teams) { + Long userId = team.getHosts().get(0).getId(); + BattleTeamUserArmies army = msg.getTeamArmiesList().stream().filter(btua -> btua.getTeamId() == userId).findFirst().orElseThrow(); + team.setTotalPoints((int) army.getTeamTotalScore()); + team.setViewers(army.getUserArmies().getUserArmyList().stream().collect(Collectors.toMap(User::new, bua -> (int) bua.getScore()))); + } + } + } + case BATTLE_TYPE_1_V_N -> { // 1 vs Many | Have no data for this yet + // Most complicated and uncommon battle type - When more data is collected, this will be updated. } } - - // Info: - // - msg.getDetailsList() & msg.getViewerTeamList() both only have content when battle is finished - // - msg.getDetailsCount() & msg.getViewerTeamCount() always is 2 only when battle is finished - // - msg.getHostTeamCount() always is 2 for 1v1 or 4 for 2v2 - } - - /** - * @param battleHostName name of host to search - * @return Team1v1 instance containing name of host or null if no team found */ - public Team1v1 get1v1Team(String battleHostName) { - if (!is1v1()) - throw new TikTokLiveException("Teams are not instance of 1v1 battle!"); - List list = getTeams(battleHostName); - return list.isEmpty() ? null : list.get(0).getAs1v1Team(); - } - - public Team2v2 get2v2Team(String battleHostName) { - if (!is2v2()) - throw new TikTokLiveException("Teams are not instance of 2v2 battle!"); - List list = getTeams(battleHostName); - return list.isEmpty() ? null : list.get(0).getAs2v2Team(); - } - - /** - * @param battleHostName name of host to search - * @return Team1v1 instance not containing name of host */ - public Team1v1 get1v1OpponentTeam(String battleHostName) { - if (!is1v1()) - throw new TikTokLiveException("Teams are not instance of 1v1 battle!"); - List list = getTeams(battleHostName); - return list.isEmpty() ? null : list.get(1).getAs1v1Team(); - } - - public Team2v2 get2x2OpponentTeam(String battleHostName) { - if (!is2v2()) - throw new TikTokLiveException("Teams are not instance of 2v2 battle!"); - List list = getTeams(battleHostName); - return list.isEmpty() ? null : list.get(1).getAs2v2Team(); - } - - /** - * @param battleHostName name of host to search - * @return {@link List} with host team first, then opponent team - *

Empty if host is in neither otherwise always 2 in length; - */ - public List getTeams(String battleHostName) { - if (is1v1()) { - if (team1.getAs1v1Team().getHost().getName().equals(battleHostName)) - return List.of(team1, team2); - if (team2.getAs1v1Team().getHost().getName().equals(battleHostName)) - return List.of(team2, team1); - } else { - if (team1.getAs2v2Team().getHosts().stream().anyMatch(user -> user.getName().equals(battleHostName))) - return List.of(team1, team2); - if (team2.getAs2v2Team().getHosts().stream().anyMatch(user -> user.getName().equals(battleHostName))) - return List.of(team2, team1); - } - return List.of(); } + /** 1 host vs 1 host */ public boolean is1v1() { - return team1.is1v1Team() || team2.is1v1Team(); + return battleType == BattleType.BATTLE_TYPE_NORMAL_BATTLE; } + /** 2 hosts vs 2 hosts*/ public boolean is2v2() { - return team1.is2v2Team() || team2.is2v2Team(); + return battleType == BattleType.BATTLE_TYPE_TEAM_BATTLE; + } + + /** Up to four users battling each other all on separate teams */ + public boolean isIndividual() { + return battleType == BattleType.BATTLE_TYPE_INDIVIDUAL_BATTLE; + } + + /** 1 host vs N hosts | N max value unknown */ + public boolean isMultiTeam() { + return battleType == BattleType.BATTLE_TYPE_1_V_N; } public boolean isTie() { - return isFinished() && team1.getTotalPoints() == team2.getTotalPoints(); + return isFinished() && isTeamsTie(); + } + + private boolean isTeamsTie() { + int referencePoints = teams.get(0).getTotalPoints(); + return teams.stream().allMatch(team -> team.getTotalPoints() == referencePoints); } } \ No newline at end of file diff --git a/API/src/main/java/io/github/jwdeveloper/tiktok/data/events/TikTokQuestionEvent.java b/API/src/main/java/io/github/jwdeveloper/tiktok/data/events/TikTokQuestionEvent.java index 54d8a8e..ac13de1 100644 --- a/API/src/main/java/io/github/jwdeveloper/tiktok/data/events/TikTokQuestionEvent.java +++ b/API/src/main/java/io/github/jwdeveloper/tiktok/data/events/TikTokQuestionEvent.java @@ -40,9 +40,9 @@ public class TikTokQuestionEvent extends TikTokHeaderEvent { public TikTokQuestionEvent(WebcastQuestionNewMessage msg) { super(msg.getCommon()); var data = msg.getDetails(); - questionId = data.getId(); - text = data.getText(); - time = data.getTimeStamp(); + questionId = data.getQuestionId(); + text = data.getContent(); + time = data.getCreateTime(); user = User.map(data.getUser()); } -} +} \ No newline at end of file diff --git a/API/src/main/java/io/github/jwdeveloper/tiktok/data/events/TikTokSubscribeEvent.java b/API/src/main/java/io/github/jwdeveloper/tiktok/data/events/TikTokSubscribeEvent.java index 4fd4817..16ef5c9 100644 --- a/API/src/main/java/io/github/jwdeveloper/tiktok/data/events/TikTokSubscribeEvent.java +++ b/API/src/main/java/io/github/jwdeveloper/tiktok/data/events/TikTokSubscribeEvent.java @@ -53,9 +53,9 @@ public class TikTokSubscribeEvent extends TikTokHeaderEvent { public static TikTokSubscribeEvent of(String userName) { return new TikTokSubscribeEvent(WebcastMemberMessage.newBuilder() .setUser(io.github.jwdeveloper.tiktok.messages.data.User.newBuilder() - .setDisplayId(userName) + .setUsername(userName) .setNickname(userName) .build()) .build()); } -} +} \ No newline at end of file diff --git a/API/src/main/java/io/github/jwdeveloper/tiktok/data/events/common/TikTokHeaderEvent.java b/API/src/main/java/io/github/jwdeveloper/tiktok/data/events/common/TikTokHeaderEvent.java index 066749c..23c5b1c 100644 --- a/API/src/main/java/io/github/jwdeveloper/tiktok/data/events/common/TikTokHeaderEvent.java +++ b/API/src/main/java/io/github/jwdeveloper/tiktok/data/events/common/TikTokHeaderEvent.java @@ -22,7 +22,7 @@ */ package io.github.jwdeveloper.tiktok.data.events.common; -import io.github.jwdeveloper.tiktok.messages.data.Common; +import io.github.jwdeveloper.tiktok.messages.data.*; import lombok.Getter; @Getter @@ -31,7 +31,7 @@ public class TikTokHeaderEvent extends TikTokEvent { private final long roomId; private final long timeStamp; - public TikTokHeaderEvent(Common header) { + public TikTokHeaderEvent(CommonMessageData header) { this(header.getMsgId(), header.getRoomId(), header.getCreateTime()); } @@ -46,4 +46,4 @@ public class TikTokHeaderEvent extends TikTokEvent { roomId = 0; timeStamp = 0; } -} +} \ No newline at end of file diff --git a/API/src/main/java/io/github/jwdeveloper/tiktok/data/events/link/TikTokLinkEnterEvent.java b/API/src/main/java/io/github/jwdeveloper/tiktok/data/events/link/TikTokLinkEnterEvent.java index c6ce468..6c8150b 100644 --- a/API/src/main/java/io/github/jwdeveloper/tiktok/data/events/link/TikTokLinkEnterEvent.java +++ b/API/src/main/java/io/github/jwdeveloper/tiktok/data/events/link/TikTokLinkEnterEvent.java @@ -24,6 +24,7 @@ package io.github.jwdeveloper.tiktok.data.events.link; import io.github.jwdeveloper.tiktok.annotations.*; import io.github.jwdeveloper.tiktok.data.models.users.ListUser; +import io.github.jwdeveloper.tiktok.messages.enums.LinkmicMultiLiveEnum; import io.github.jwdeveloper.tiktok.messages.webcast.WebcastLinkMessage; import lombok.Getter; @@ -34,7 +35,7 @@ import java.util.List; public class TikTokLinkEnterEvent extends TikTokLinkEvent { private final List listUsers; - private final int anchorMultiLiveEnum; + private final LinkmicMultiLiveEnum anchorMultiLiveEnum; public TikTokLinkEnterEvent(WebcastLinkMessage msg) { super(msg); diff --git a/API/src/main/java/io/github/jwdeveloper/tiktok/data/events/link/TikTokLinkMediaChangeEvent.java b/API/src/main/java/io/github/jwdeveloper/tiktok/data/events/link/TikTokLinkMediaChangeEvent.java index abdaa3d..be1a7a6 100644 --- a/API/src/main/java/io/github/jwdeveloper/tiktok/data/events/link/TikTokLinkMediaChangeEvent.java +++ b/API/src/main/java/io/github/jwdeveloper/tiktok/data/events/link/TikTokLinkMediaChangeEvent.java @@ -23,6 +23,7 @@ package io.github.jwdeveloper.tiktok.data.events.link; import io.github.jwdeveloper.tiktok.annotations.*; +import io.github.jwdeveloper.tiktok.messages.enums.*; import io.github.jwdeveloper.tiktok.messages.webcast.WebcastLinkMessage; import lombok.Getter; @@ -30,7 +31,11 @@ import lombok.Getter; @EventMeta(eventType = EventType.Message) public class TikTokLinkMediaChangeEvent extends TikTokLinkEvent { - private final long op, toUserId, anchorId, roomId, changeScene; + private final GuestMicCameraManageOp op; + private final long toUserId; + private final long anchorId; + private final long roomId; + private final GuestMicCameraChangeScene changeScene; public TikTokLinkMediaChangeEvent(WebcastLinkMessage msg) { super(msg); diff --git a/API/src/main/java/io/github/jwdeveloper/tiktok/data/events/link/TikTokLinkMuteEvent.java b/API/src/main/java/io/github/jwdeveloper/tiktok/data/events/link/TikTokLinkMuteEvent.java index ef3b9e6..5e1f617 100644 --- a/API/src/main/java/io/github/jwdeveloper/tiktok/data/events/link/TikTokLinkMuteEvent.java +++ b/API/src/main/java/io/github/jwdeveloper/tiktok/data/events/link/TikTokLinkMuteEvent.java @@ -23,6 +23,7 @@ package io.github.jwdeveloper.tiktok.data.events.link; import io.github.jwdeveloper.tiktok.annotations.*; +import io.github.jwdeveloper.tiktok.messages.enums.MuteStatus; import io.github.jwdeveloper.tiktok.messages.webcast.WebcastLinkMessage; import lombok.Getter; @@ -30,7 +31,8 @@ import lombok.Getter; @EventMeta(eventType = EventType.Message) public class TikTokLinkMuteEvent extends TikTokLinkEvent { - private final long userId, status; + private final long userId; + private final MuteStatus status; public TikTokLinkMuteEvent(WebcastLinkMessage msg) { super(msg); @@ -41,4 +43,8 @@ public class TikTokLinkMuteEvent extends TikTokLinkEvent { this.userId = content.getUserId(); this.status = content.getStatus(); } + + public boolean isMuted() { + return status == MuteStatus.MUTE_STATUS_MUTE; + } } \ No newline at end of file diff --git a/API/src/main/java/io/github/jwdeveloper/tiktok/data/events/room/TikTokRoomPinEvent.java b/API/src/main/java/io/github/jwdeveloper/tiktok/data/events/room/TikTokRoomPinEvent.java index 099d503..d80a4cc 100644 --- a/API/src/main/java/io/github/jwdeveloper/tiktok/data/events/room/TikTokRoomPinEvent.java +++ b/API/src/main/java/io/github/jwdeveloper/tiktok/data/events/room/TikTokRoomPinEvent.java @@ -39,7 +39,7 @@ public class TikTokRoomPinEvent extends TikTokHeaderEvent public TikTokRoomPinEvent(WebcastRoomPinMessage msg, TikTokCommentEvent commentEvent) { super(msg.getCommon()); - this.timestamp = msg.getTimestamp(); + this.timestamp = msg.getPinTime(); this.pinnedMessage = commentEvent; } } \ No newline at end of file diff --git a/API/src/main/java/io/github/jwdeveloper/tiktok/data/events/social/TikTokFollowEvent.java b/API/src/main/java/io/github/jwdeveloper/tiktok/data/events/social/TikTokFollowEvent.java index 37626d7..7433fe5 100644 --- a/API/src/main/java/io/github/jwdeveloper/tiktok/data/events/social/TikTokFollowEvent.java +++ b/API/src/main/java/io/github/jwdeveloper/tiktok/data/events/social/TikTokFollowEvent.java @@ -45,7 +45,7 @@ public class TikTokFollowEvent extends TikTokHeaderEvent { public static TikTokFollowEvent of(String userName) { return new TikTokFollowEvent(WebcastSocialMessage.newBuilder() .setUser(io.github.jwdeveloper.tiktok.messages.data.User.newBuilder() - .setDisplayId(userName) + .setUsername(userName) .setNickname(userName) .build()) .build()); diff --git a/API/src/main/java/io/github/jwdeveloper/tiktok/data/events/social/TikTokJoinEvent.java b/API/src/main/java/io/github/jwdeveloper/tiktok/data/events/social/TikTokJoinEvent.java index 0827da8..40328ec 100644 --- a/API/src/main/java/io/github/jwdeveloper/tiktok/data/events/social/TikTokJoinEvent.java +++ b/API/src/main/java/io/github/jwdeveloper/tiktok/data/events/social/TikTokJoinEvent.java @@ -52,7 +52,7 @@ public class TikTokJoinEvent extends TikTokHeaderEvent { { return new TikTokJoinEvent(WebcastMemberMessage.newBuilder() .setUser(io.github.jwdeveloper.tiktok.messages.data.User.newBuilder() - .setDisplayId(userName) + .setUsername(userName) .setNickname(userName) .build()) .build()); diff --git a/API/src/main/java/io/github/jwdeveloper/tiktok/data/events/social/TikTokLikeEvent.java b/API/src/main/java/io/github/jwdeveloper/tiktok/data/events/social/TikTokLikeEvent.java index 0072e74..4827e07 100644 --- a/API/src/main/java/io/github/jwdeveloper/tiktok/data/events/social/TikTokLikeEvent.java +++ b/API/src/main/java/io/github/jwdeveloper/tiktok/data/events/social/TikTokLikeEvent.java @@ -62,9 +62,9 @@ public class TikTokLikeEvent extends TikTokHeaderEvent .setCount(likes) .setTotal(likes) .setUser(io.github.jwdeveloper.tiktok.messages.data.User.newBuilder() - .setDisplayId(userName) + .setUsername(userName) .setNickname(userName) .build()) .build()); } -} +} \ No newline at end of file diff --git a/API/src/main/java/io/github/jwdeveloper/tiktok/data/events/social/TikTokShareEvent.java b/API/src/main/java/io/github/jwdeveloper/tiktok/data/events/social/TikTokShareEvent.java index 2f3d352..4a994c4 100644 --- a/API/src/main/java/io/github/jwdeveloper/tiktok/data/events/social/TikTokShareEvent.java +++ b/API/src/main/java/io/github/jwdeveloper/tiktok/data/events/social/TikTokShareEvent.java @@ -22,11 +22,9 @@ */ package io.github.jwdeveloper.tiktok.data.events.social; -import io.github.jwdeveloper.tiktok.annotations.EventMeta; -import io.github.jwdeveloper.tiktok.annotations.EventType; +import io.github.jwdeveloper.tiktok.annotations.*; import io.github.jwdeveloper.tiktok.data.events.common.TikTokHeaderEvent; import io.github.jwdeveloper.tiktok.data.models.users.User; -import io.github.jwdeveloper.tiktok.messages.webcast.WebcastLikeMessage; import io.github.jwdeveloper.tiktok.messages.webcast.WebcastSocialMessage; import lombok.Getter; @@ -52,7 +50,7 @@ public class TikTokShareEvent extends TikTokHeaderEvent { public static TikTokShareEvent of(String userName, int shaders) { return new TikTokShareEvent(WebcastSocialMessage.newBuilder() .setUser(io.github.jwdeveloper.tiktok.messages.data.User.newBuilder() - .setDisplayId(userName) + .setUsername(userName) .setNickname(userName) .build()) .build(), shaders); diff --git a/API/src/main/java/io/github/jwdeveloper/tiktok/data/events/websocket/TikTokWebsocketMessageEvent.java b/API/src/main/java/io/github/jwdeveloper/tiktok/data/events/websocket/TikTokWebsocketMessageEvent.java index 97828d9..653ca85 100644 --- a/API/src/main/java/io/github/jwdeveloper/tiktok/data/events/websocket/TikTokWebsocketMessageEvent.java +++ b/API/src/main/java/io/github/jwdeveloper/tiktok/data/events/websocket/TikTokWebsocketMessageEvent.java @@ -22,17 +22,11 @@ */ package io.github.jwdeveloper.tiktok.data.events.websocket; -import io.github.jwdeveloper.tiktok.annotations.EventMeta; -import io.github.jwdeveloper.tiktok.annotations.EventType; +import io.github.jwdeveloper.tiktok.annotations.*; import io.github.jwdeveloper.tiktok.data.dto.MessageMetaData; import io.github.jwdeveloper.tiktok.data.events.common.TikTokEvent; -import io.github.jwdeveloper.tiktok.messages.webcast.WebcastGiftMessage; -import io.github.jwdeveloper.tiktok.messages.webcast.WebcastResponse; -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.Value; - -import java.time.Duration; +import io.github.jwdeveloper.tiktok.messages.webcast.ProtoMessageFetchResult; +import lombok.*; @@ -47,7 +41,7 @@ public class TikTokWebsocketMessageEvent extends TikTokEvent { * message.payload - Bytes array that contains actual data of message. * Example of parsing, WebcastGiftMessage giftMessage = WebcastGiftMessage.parseFrom(message.getPayload()); */ - private WebcastResponse.Message message; + private ProtoMessageFetchResult.BaseProtoMessage message; /* * TikTokLiveJava event that was created from TikTok message data @@ -61,4 +55,4 @@ public class TikTokWebsocketMessageEvent extends TikTokEvent { private MessageMetaData metaData; -} +} \ No newline at end of file diff --git a/API/src/main/java/io/github/jwdeveloper/tiktok/data/events/websocket/TikTokWebsocketResponseEvent.java b/API/src/main/java/io/github/jwdeveloper/tiktok/data/events/websocket/TikTokWebsocketResponseEvent.java index bb2b358..559415e 100644 --- a/API/src/main/java/io/github/jwdeveloper/tiktok/data/events/websocket/TikTokWebsocketResponseEvent.java +++ b/API/src/main/java/io/github/jwdeveloper/tiktok/data/events/websocket/TikTokWebsocketResponseEvent.java @@ -22,17 +22,15 @@ */ package io.github.jwdeveloper.tiktok.data.events.websocket; -import io.github.jwdeveloper.tiktok.annotations.EventMeta; -import io.github.jwdeveloper.tiktok.annotations.EventType; +import io.github.jwdeveloper.tiktok.annotations.*; import io.github.jwdeveloper.tiktok.data.events.common.TikTokEvent; -import io.github.jwdeveloper.tiktok.messages.webcast.WebcastResponse; -import lombok.AllArgsConstructor; -import lombok.Getter; +import io.github.jwdeveloper.tiktok.messages.webcast.ProtoMessageFetchResult; +import lombok.*; @Getter @AllArgsConstructor @EventMeta(eventType = EventType.Debug) public class TikTokWebsocketResponseEvent extends TikTokEvent { - private WebcastResponse response; -} + private ProtoMessageFetchResult response; +} \ No newline at end of file diff --git a/API/src/main/java/io/github/jwdeveloper/tiktok/data/events/websocket/TikTokWebsocketUnhandledMessageEvent.java b/API/src/main/java/io/github/jwdeveloper/tiktok/data/events/websocket/TikTokWebsocketUnhandledMessageEvent.java index 6ba278c..4663320 100644 --- a/API/src/main/java/io/github/jwdeveloper/tiktok/data/events/websocket/TikTokWebsocketUnhandledMessageEvent.java +++ b/API/src/main/java/io/github/jwdeveloper/tiktok/data/events/websocket/TikTokWebsocketUnhandledMessageEvent.java @@ -25,18 +25,18 @@ package io.github.jwdeveloper.tiktok.data.events.websocket; import io.github.jwdeveloper.tiktok.annotations.EventMeta; import io.github.jwdeveloper.tiktok.annotations.EventType; import io.github.jwdeveloper.tiktok.data.events.common.TikTokUnhandledEvent; -import io.github.jwdeveloper.tiktok.messages.webcast.WebcastResponse; +import io.github.jwdeveloper.tiktok.messages.webcast.ProtoMessageFetchResult; import lombok.Getter; @Getter @EventMeta(eventType = EventType.Debug) -public class TikTokWebsocketUnhandledMessageEvent extends TikTokUnhandledEvent +public class TikTokWebsocketUnhandledMessageEvent extends TikTokUnhandledEvent { - public TikTokWebsocketUnhandledMessageEvent(WebcastResponse.Message data) { + public TikTokWebsocketUnhandledMessageEvent(ProtoMessageFetchResult.BaseProtoMessage data) { super(data); } - public WebcastResponse.Message getMessage() + public ProtoMessageFetchResult.BaseProtoMessage getMessage() { return this.getData(); } diff --git a/API/src/main/java/io/github/jwdeveloper/tiktok/data/models/LinkMicArmy.java b/API/src/main/java/io/github/jwdeveloper/tiktok/data/models/LinkMicArmy.java index 51758fe..0e0c63d 100644 --- a/API/src/main/java/io/github/jwdeveloper/tiktok/data/models/LinkMicArmy.java +++ b/API/src/main/java/io/github/jwdeveloper/tiktok/data/models/LinkMicArmy.java @@ -23,27 +23,21 @@ package io.github.jwdeveloper.tiktok.data.models; import io.github.jwdeveloper.tiktok.data.models.users.User; -import io.github.jwdeveloper.tiktok.messages.data.LinkMicArmiesItems; +import io.github.jwdeveloper.tiktok.messages.data.BattleUserArmies; import lombok.Value; -import java.util.List; +import java.util.*; +import java.util.stream.Collectors; @Value public class LinkMicArmy { Long armyId; - List armies; + int totalPoints; + Map armies; - public LinkMicArmy(LinkMicArmiesItems army) { - armyId = army.getHostUserId(); - armies = army.getBattleGroupsList() - .stream() - .map(x -> new Army(x.getUsersList().stream().map(User::map).toList(), x.getPoints())) - .toList(); - } - - @Value - public static class Army { - List Users; - Integer Points; + public LinkMicArmy(BattleUserArmies userArmies) { + armyId = Long.parseLong(userArmies.getAnchorIdStr()); + totalPoints = (int) userArmies.getHostScore(); + armies = userArmies.getUserArmyList().stream().collect(Collectors.toMap(User::new, bua -> (int) bua.getScore())); } } \ No newline at end of file diff --git a/API/src/main/java/io/github/jwdeveloper/tiktok/data/models/badges/Badge.java b/API/src/main/java/io/github/jwdeveloper/tiktok/data/models/badges/Badge.java index a07abc7..496cb58 100644 --- a/API/src/main/java/io/github/jwdeveloper/tiktok/data/models/badges/Badge.java +++ b/API/src/main/java/io/github/jwdeveloper/tiktok/data/models/badges/Badge.java @@ -25,7 +25,7 @@ package io.github.jwdeveloper.tiktok.data.models.badges; public class Badge { public static Badge map(io.github.jwdeveloper.tiktok.messages.data.BadgeStruct badge) { - return switch (badge.getDisplayType()) { + return switch (badge.getBadgeDisplayType()) { case BADGEDISPLAYTYPE_TEXT -> new TextBadge(badge.getText()); case BADGEDISPLAYTYPE_IMAGE -> new PictureBadge(badge.getImage()); case BADGEDISPLAYTYPE_STRING -> new StringBadge(badge.getStr()); diff --git a/API/src/main/java/io/github/jwdeveloper/tiktok/data/models/battles/Team.java b/API/src/main/java/io/github/jwdeveloper/tiktok/data/models/battles/Team.java index dac2a21..f11072e 100644 --- a/API/src/main/java/io/github/jwdeveloper/tiktok/data/models/battles/Team.java +++ b/API/src/main/java/io/github/jwdeveloper/tiktok/data/models/battles/Team.java @@ -22,53 +22,63 @@ */ package io.github.jwdeveloper.tiktok.data.models.battles; -import lombok.Getter; +import io.github.jwdeveloper.tiktok.data.models.users.User; +import io.github.jwdeveloper.tiktok.messages.enums.BattleType; +import io.github.jwdeveloper.tiktok.messages.webcast.WebcastLinkMicBattle; +import lombok.Data; -public abstract class Team { +import java.util.*; + +@Data +public class Team { + /** TeamId used for all battle types */ + private final long teamId; /** Value >= 0 when finished otherwise -1 */ - @Getter protected int totalPoints; + private int totalPoints = -1; + /** Value >= 0 when battle type is {@link BattleType}.{@code BATTLE_TYPE_NORMAL_BATTLE} otherwise -1 */ + private int winStreak = -1; + /** Up to N hosts */ + private final List hosts; + /** Populated when finished */ + private Map viewers = new HashMap<>(); - /** - * Provides a check for verifying if this team represents a 1v1 Team. - * @return true if this team is of type {@link Team1v1}, false otherwise. - */ - public boolean is1v1Team() { - return this instanceof Team1v1; + // public Team(WebcastLinkMicBattle.BattleUserInfoWrapper anchorInfo, WebcastLinkMicBattle msg) { + // long hostId = anchorInfo.getUserId(); + // this.winStreak = msg.getBattleCombosOrDefault(hostId, WebcastLinkMicBattle.BattleComboInfo.newBuilder().setComboCount(-1).build()).getComboCount(); + // this.totalPoints = (int) msg.getBattleResultOrDefault(hostId, WebcastLinkMicBattle.BattleResult.newBuilder().setScore(-1).build()).getScore(); + // this.host = new User(anchorInfo.getUserInfo().getUser()); + // this.viewers = new HashMap<>(); + // Optional.ofNullable(msg.getArmiesMap().get(host.getId())).ifPresent(armies -> + // armies.getUserArmiesList().forEach(userArmy -> + // viewers.put(new User(userArmy), (int) userArmy.getScore()))); + // } + // + // public Team(WebcastLinkMicBattle.BattleTeamResult battleTeamResult, WebcastLinkMicBattle msg) { + // this.totalPoints = (int) battleTeamResult.getTotalScore(); + // var host = new User(msg.getAnchorInfoList().stream().filter(data -> data.getUserId() == battleTeamResult.getTeamUsers(0).getUserId()).findFirst().orElseThrow().getUserInfo().getUser()); + // var cohost = new User(msg.getAnchorInfoList().stream().filter(data -> data.getUserId() == battleTeamResult.getTeamUsers(1).getUserId()).findFirst().orElseThrow().getUserInfo().getUser()); + // this.hosts = List.of(host, cohost); + // this.viewers = new HashMap<>(); + // Optional.ofNullable(msg.getArmiesMap().get(host.getId())).ifPresent(armies -> + // armies.getUserArmiesList().forEach(userArmy -> + // viewers.put(new User(userArmy), (int) userArmy.getScore()))); + // Optional.ofNullable(msg.getArmiesMap().get(cohost.getId())).ifPresent(armies -> + // armies.getUserArmiesList().forEach(userArmy -> + // viewers.put(new User(userArmy), (int) userArmy.getScore()))); + // } + // + public Team(long teamId, List hosts) { + this.teamId = teamId; + this.hosts = List.copyOf(hosts); } - /** - * Provides a check for verifying if this team represents a 1v1 Team. - * @return true if this team is of type {@link Team1v1}, false otherwise. - */ - public boolean is2v2Team() { - return this instanceof Team2v2; + public Team(WebcastLinkMicBattle.BattleUserInfo anchorInfo) { + this.hosts = List.of(new User(anchorInfo.getUser())); + this.teamId = hosts.get(0).getId(); } - /** - * Convenience method to get this team as a {@link Team1v1}. If this team is of some - * other type, an {@link IllegalStateException} will result. Hence it is best to use this method - * after ensuring that this element is of the desired type by calling {@link #is1v1Team()} first. - * - * @return this team as a {@link Team1v1}. - * @throws IllegalStateException if this team is of another type. - */ - public Team1v1 getAs1v1Team() { - if (is1v1Team()) - return (Team1v1) this; - throw new IllegalStateException("Not a 1v1Team: " + this); - } - - /** - * Convenience method to get this team as a {@link Team2v2}. If this team is of some - * other type, an {@link IllegalStateException} will result. Hence it is best to use this method - * after ensuring that this element is of the desired type by calling {@link #is2v2Team()} first. - * - * @return this team as a {@link Team2v2}. - * @throws IllegalStateException if this team is of another type. - */ - public Team2v2 getAs2v2Team() { - if (is2v2Team()) - return (Team2v2) this; - throw new IllegalStateException("Not a 2v2Team: " + this); + public Team(WebcastLinkMicBattle.BattleUserInfo anchorInfo, WebcastLinkMicBattle.BattleComboInfo battleCombo) { + this(anchorInfo); + this.winStreak = (int) battleCombo.getComboCount(); } } \ No newline at end of file diff --git a/API/src/main/java/io/github/jwdeveloper/tiktok/data/models/battles/Team1v1.java b/API/src/main/java/io/github/jwdeveloper/tiktok/data/models/battles/Team1v1.java deleted file mode 100644 index 3658822..0000000 --- a/API/src/main/java/io/github/jwdeveloper/tiktok/data/models/battles/Team1v1.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 2023-2024 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.data.models.battles; - -import io.github.jwdeveloper.tiktok.data.models.users.User; -import io.github.jwdeveloper.tiktok.messages.webcast.WebcastLinkMicBattle; -import lombok.Getter; - -import java.util.*; - -@Getter -public class Team1v1 extends Team { - private final int winStreak; - private final User host; - private final List viewers; - - public Team1v1(WebcastLinkMicBattle.LinkMicBattleHost hostTeam, WebcastLinkMicBattle msg) { - long hostId = hostTeam.getId(); - this.winStreak = msg.getTeamDataList().stream().filter(data -> data.getTeamId() == hostId).map(data -> data.getData().getWinStreak()).findFirst().orElse(-1); - this.totalPoints = msg.getDetailsList().stream().filter(dets -> dets.getId() == hostId).map(dets -> dets.getSummary().getPoints()).findFirst().orElse(-1); - this.host = new User(hostTeam.getHostGroup(0).getHost(0)); - this.viewers = msg.getViewerTeamList().stream().filter(team -> team.getId() == hostId).findFirst().map(topViewers -> - topViewers.getViewerGroup(0).getViewerList().stream().map(Viewer::new).toList()).orElseGet(ArrayList::new); - } -} \ No newline at end of file diff --git a/API/src/main/java/io/github/jwdeveloper/tiktok/data/models/battles/Team2v2.java b/API/src/main/java/io/github/jwdeveloper/tiktok/data/models/battles/Team2v2.java deleted file mode 100644 index 8f4c364..0000000 --- a/API/src/main/java/io/github/jwdeveloper/tiktok/data/models/battles/Team2v2.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) 2023-2024 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.data.models.battles; - -import io.github.jwdeveloper.tiktok.data.models.users.User; -import io.github.jwdeveloper.tiktok.messages.webcast.WebcastLinkMicBattle; -import lombok.Getter; - -import java.util.*; - -@Getter -public class Team2v2 extends Team { - private final List hosts; - private final List viewers; - - public Team2v2(WebcastLinkMicBattle.LinkMicBattleHost hostTeam1, WebcastLinkMicBattle.LinkMicBattleHost hostTeam2, WebcastLinkMicBattle msg) { - this.totalPoints = -1; - this.hosts = List.of(new User(hostTeam1.getHostGroup(0).getHost(0)), new User(hostTeam2.getHostGroup(0).getHost(0))); - this.viewers = new ArrayList<>(); - } - - public Team2v2(WebcastLinkMicBattle.Host2v2Data hd, WebcastLinkMicBattle msg) { - this.totalPoints = hd.getTotalPoints(); - var host = new User(msg.getHostTeamList().stream().filter(data -> data.getId() == hd.getHostdata(0).getHostId()).findFirst().orElseThrow().getHostGroup(0).getHost(0)); - var cohost = new User(msg.getHostTeamList().stream().filter(data -> data.getId() == hd.getHostdata(1).getHostId()).findFirst().orElseThrow().getHostGroup(0).getHost(0)); - this.hosts = List.of(host, cohost); - this.viewers = msg.getViewerTeamList().stream().filter(team -> team.getId() == host.getId() || team.getId() == cohost.getId()).findFirst().map(topViewers -> - topViewers.getViewerGroup(0).getViewerList().stream().map(Viewer::new).toList()).orElseGet(ArrayList::new); - } -} \ No newline at end of file diff --git a/API/src/main/java/io/github/jwdeveloper/tiktok/data/models/battles/Viewer.java b/API/src/main/java/io/github/jwdeveloper/tiktok/data/models/battles/Viewer.java deleted file mode 100644 index 6c7007f..0000000 --- a/API/src/main/java/io/github/jwdeveloper/tiktok/data/models/battles/Viewer.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 2023-2024 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.data.models.battles; - -import io.github.jwdeveloper.tiktok.data.models.Picture; -import io.github.jwdeveloper.tiktok.data.models.users.User; -import io.github.jwdeveloper.tiktok.messages.webcast.WebcastLinkMicBattle; -import lombok.Getter; - -@Getter -public class Viewer { - private final User user; - private final int points; - - public Viewer(WebcastLinkMicBattle.LinkMicBattleTopViewers.TopViewerGroup.TopViewer topViewer) { - this.user = new User(topViewer.getId(), null, topViewer.getProfileId(), Picture.map(topViewer.getImages(0))); - this.points = topViewer.getPoints(); - } -} \ No newline at end of file diff --git a/API/src/main/java/io/github/jwdeveloper/tiktok/data/models/users/ListUser.java b/API/src/main/java/io/github/jwdeveloper/tiktok/data/models/users/ListUser.java index e1c08a4..2e19eaa 100644 --- a/API/src/main/java/io/github/jwdeveloper/tiktok/data/models/users/ListUser.java +++ b/API/src/main/java/io/github/jwdeveloper/tiktok/data/models/users/ListUser.java @@ -22,6 +22,7 @@ */ package io.github.jwdeveloper.tiktok.data.models.users; +import io.github.jwdeveloper.tiktok.messages.enums.*; import lombok.Getter; @Getter @@ -29,14 +30,19 @@ public class ListUser { private final User user; private final LinkType linkType; - private final long linkMicId, linkStatus, modifyTime, linkerId; - private final int userPosition, silenceStatus, roleType; + private final long linkMicId; + private final LinkmicRoleType linkStatus; + private final long modifyTime; + private final long linkerId; + private final int userPosition; + private final LinkSilenceStatus silenceStatus; + private final LinkRoleType roleType; public ListUser(io.github.jwdeveloper.tiktok.messages.data.ListUser listUser) { this.user = User.map(listUser.getUser()); this.linkMicId = listUser.getLinkmicId(); this.linkStatus = listUser.getLinkStatus(); - this.linkType = LinkType.values()[listUser.getLinkTypeValue()]; + this.linkType = listUser.getLinkType(); this.userPosition = listUser.getUserPosition(); this.silenceStatus = listUser.getSilenceStatus(); this.modifyTime = listUser.getModifyTime(); @@ -48,12 +54,6 @@ public class ListUser return new ListUser(listUser); } - public enum LinkType { - UNKNOWN, - AUDIO, - VIDEO - } - @Override public String toString() { return "ListUser{" + diff --git a/API/src/main/java/io/github/jwdeveloper/tiktok/data/models/users/User.java b/API/src/main/java/io/github/jwdeveloper/tiktok/data/models/users/User.java index de3ded5..fa79f8d 100644 --- a/API/src/main/java/io/github/jwdeveloper/tiktok/data/models/users/User.java +++ b/API/src/main/java/io/github/jwdeveloper/tiktok/data/models/users/User.java @@ -24,6 +24,7 @@ package io.github.jwdeveloper.tiktok.data.models.users; import io.github.jwdeveloper.tiktok.data.models.Picture; import io.github.jwdeveloper.tiktok.data.models.badges.Badge; +import io.github.jwdeveloper.tiktok.messages.data.BattleUserArmy; import io.github.jwdeveloper.tiktok.messages.webcast.*; import lombok.*; @@ -139,12 +140,16 @@ public class User { this(id, name, profileId, null, picture, 0, 0, List.of(Badge.empty())); } - public User(WebcastLinkMicBattle.LinkMicBattleHost.HostGroup.Host host) { - this(host.getId(), host.getName(), host.getProfileId(), Picture.map(host.getImages(0))); + public User(WebcastLinkMicBattle.BattleUserInfo.BattleBaseUserInfo host) { + this(host.getUserId(), host.getDisplayId(), host.getNickName(), Picture.map(host.getAvatarThumb())); + } + + public User(BattleUserArmy topViewer) { + this(topViewer.getUserId(), topViewer.getNickname(), Picture.map(topViewer.getAvatarThumb())); } public User(io.github.jwdeveloper.tiktok.messages.data.User user) { - this(user.getId(), user.getDisplayId(), Picture.map(user.getAvatarThumb())); + this(user.getId(), user.getUsername(), Picture.map(user.getAvatarThumb())); signature = user.getBioDescription(); profileName = user.getNickname(); following = user.getFollowInfo().getFollowingCount(); diff --git a/API/src/main/java/io/github/jwdeveloper/tiktok/data/requests/LiveConnectionData.java b/API/src/main/java/io/github/jwdeveloper/tiktok/data/requests/LiveConnectionData.java index 8d5a1ba..48acd58 100644 --- a/API/src/main/java/io/github/jwdeveloper/tiktok/data/requests/LiveConnectionData.java +++ b/API/src/main/java/io/github/jwdeveloper/tiktok/data/requests/LiveConnectionData.java @@ -22,10 +22,8 @@ */ package io.github.jwdeveloper.tiktok.data.requests; -import io.github.jwdeveloper.tiktok.messages.webcast.WebcastResponse; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.Getter; +import io.github.jwdeveloper.tiktok.messages.webcast.ProtoMessageFetchResult; +import lombok.*; import java.net.URI; @@ -41,6 +39,6 @@ public class LiveConnectionData { public static class Response { private final String websocketCookies; private final URI websocketUrl; - private final WebcastResponse webcastResponse; + private final ProtoMessageFetchResult webcastResponse; } } \ No newline at end of file diff --git a/API/src/main/java/io/github/jwdeveloper/tiktok/exceptions/TikTokLiveMessageException.java b/API/src/main/java/io/github/jwdeveloper/tiktok/exceptions/TikTokLiveMessageException.java index 05f34f9..a4f7aab 100644 --- a/API/src/main/java/io/github/jwdeveloper/tiktok/exceptions/TikTokLiveMessageException.java +++ b/API/src/main/java/io/github/jwdeveloper/tiktok/exceptions/TikTokLiveMessageException.java @@ -23,7 +23,7 @@ package io.github.jwdeveloper.tiktok.exceptions; -import io.github.jwdeveloper.tiktok.messages.webcast.WebcastResponse; +import io.github.jwdeveloper.tiktok.messages.webcast.ProtoMessageFetchResult; import lombok.Getter; import java.util.Base64; @@ -31,13 +31,13 @@ import java.util.Base64; public class TikTokLiveMessageException extends TikTokLiveException { @Getter - private final WebcastResponse.Message webcastMessage; + private final ProtoMessageFetchResult.BaseProtoMessage webcastMessage; @Getter - private final WebcastResponse webcastResponse; + private final ProtoMessageFetchResult webcastResponse; - public TikTokLiveMessageException(WebcastResponse.Message message, - WebcastResponse webcastResponse, + public TikTokLiveMessageException(ProtoMessageFetchResult.BaseProtoMessage message, + ProtoMessageFetchResult webcastResponse, Throwable cause) { super("Error while handling Message: " + message.getMethod() + ": \n", cause); this.webcastMessage = message; @@ -58,4 +58,4 @@ public class TikTokLiveMessageException extends TikTokLiveException { { return Base64.getEncoder().encodeToString(webcastResponse.toByteArray()); } -} +} \ No newline at end of file diff --git a/API/src/main/java/io/github/jwdeveloper/tiktok/live/LiveMessagesHandler.java b/API/src/main/java/io/github/jwdeveloper/tiktok/live/LiveMessagesHandler.java index 4053ee8..8b2004b 100644 --- a/API/src/main/java/io/github/jwdeveloper/tiktok/live/LiveMessagesHandler.java +++ b/API/src/main/java/io/github/jwdeveloper/tiktok/live/LiveMessagesHandler.java @@ -22,10 +22,10 @@ */ package io.github.jwdeveloper.tiktok.live; -import io.github.jwdeveloper.tiktok.messages.webcast.WebcastResponse; +import io.github.jwdeveloper.tiktok.messages.webcast.ProtoMessageFetchResult; public interface LiveMessagesHandler { - void handle(LiveClient client, WebcastResponse webcastResponse); + void handle(LiveClient client, ProtoMessageFetchResult webcastResponse); - void handleSingleMessage(LiveClient client, WebcastResponse.Message message); + void handleSingleMessage(LiveClient client, ProtoMessageFetchResult.BaseProtoMessage message); } \ No newline at end of file diff --git a/API/src/main/java/io/github/jwdeveloper/tiktok/utils/ProtocolUtils.java b/API/src/main/java/io/github/jwdeveloper/tiktok/utils/ProtocolUtils.java index bf6a36e..d01f670 100644 --- a/API/src/main/java/io/github/jwdeveloper/tiktok/utils/ProtocolUtils.java +++ b/API/src/main/java/io/github/jwdeveloper/tiktok/utils/ProtocolUtils.java @@ -22,10 +22,8 @@ */ package io.github.jwdeveloper.tiktok.utils; -import com.google.protobuf.ByteString; -import com.google.protobuf.InvalidProtocolBufferException; -import com.google.protobuf.UnknownFieldSet; -import io.github.jwdeveloper.tiktok.messages.webcast.WebcastResponse; +import com.google.protobuf.*; +import io.github.jwdeveloper.tiktok.messages.webcast.ProtoMessageFetchResult; import java.util.Base64; @@ -35,7 +33,7 @@ public class ProtocolUtils { return Base64.getEncoder().encodeToString(bytes); } - public static String toBase64(WebcastResponse.Message bytes) { + public static String toBase64(ProtoMessageFetchResult.BaseProtoMessage bytes) { return Base64.getEncoder().encodeToString(bytes.toByteArray()); } @@ -107,10 +105,10 @@ public class ProtocolUtils { } } - public static WebcastResponse.Message fromBase64ToMessage(String base64) throws InvalidProtocolBufferException { + public static ProtoMessageFetchResult.BaseProtoMessage fromBase64ToMessage(String base64) throws InvalidProtocolBufferException { var bytes = fromBase64(base64); - return WebcastResponse.Message.parseFrom(bytes); + return ProtoMessageFetchResult.BaseProtoMessage.parseFrom(bytes); } -} +} \ No newline at end of file diff --git a/API/src/main/proto/data.proto b/API/src/main/proto/data.proto index 2f31d5b..e431a0b 100644 --- a/API/src/main/proto/data.proto +++ b/API/src/main/proto/data.proto @@ -7,7 +7,7 @@ option java_multiple_files = true; import "enums.proto"; // @Common -message Common { +message CommonMessageData { string method = 1; int64 msgId = 2; int64 roomId = 3; @@ -83,8 +83,8 @@ message Text { message TextPieceGift { int32 giftId = 1; - // PatternRef nameRef = 2; - // ShowType showType = 3; // Enum + PatternRef nameRef = 2; + ShowType showType = 3; // Enum int64 colorId = 4; } @@ -98,18 +98,49 @@ message Text { bool withColon = 2; } + message PatternRef { + string key = 1; + string default_pattern = 2; + } + + enum ShowType { + SHOW_TYPE_NORMAL = 0; + SHOW_TYPE_FADE_IN_OUT = 1; + } + } // @Image message Image { repeated string url = 1; - string extras = 2; - bool isAnimated = 9; + string m_uri = 2; + int32 height = 3; + int32 width = 4; + string avg_color = 5; + int32 image_type = 6; + string schema = 7; + Content content = 8; + bool is_animated = 9; + + message Content { + string name = 1; + string font_color = 2; + int64 level = 3; + } } // @Badge message BadgeStruct { - BadgeDisplayType displayType = 1; // Enum + BadgeDisplayType badge_display_type = 1; // Enum + BadgePriorityType badge_priority_type = 2; + BadgeSceneType badge_scene = 3; + Position position = 4; + DisplayStatus display_status = 5; + int64 greyed_by_client = 6; + BadgeExhibitionType exhibition_type = 7; + string schema_url = 10; + bool display = 11; + PrivilegeLogExtra log_extra = 12; oneof badgeType { ImageBadge image = 20; @@ -117,23 +148,30 @@ message BadgeStruct { StringBadge str = 22; CombineBadge combine = 23; } + bool is_customized = 24; message CombineBadge { + int32 badge_display_type = 1; Image icon = 2; TextBadge text = 3; string str = 4; - // repeated PaddingInfo padding = 5; - // FontStyle fontStyle = 6; - ProfileCardPanel profileCardPanel = 7; + PaddingInfo padding = 5; + FontStyle font_style = 6; + ProfileCardPanel profile_card_panel = 7; CombineBadgeBackground background = 11; - CombineBadgeBackground backgroundDarkMode = 12; - bool iconAutoMirrored = 13; - bool backgroundAutoMirrored = 14; - int32 publicScreenShowStyle = 15; - int32 personalCardShowStyle = 16; - int32 ranklistOnlineAudienceShowStyle = 17; - int32 multiGuestShowStyle = 18; - // repeated PaddingInfo paddingNewFont = 20; + CombineBadgeBackground background_dark_mode = 12; + bool icon_auto_mirrored = 13; + bool bg_auto_mirrored = 14; + int32 public_screen_show_style = 15; + int32 personal_card_show_style = 16; + int32 rank_list_online_audience_show_style = 17; + int32 multi_guest_show_style = 18; + ArrowConfig arrow_config = 19; + PaddingInfo padding_new_font = 20; + } + + message ArrowConfig { + Image icon = 1; } message ProfileContent { @@ -149,7 +187,7 @@ message BadgeStruct { message NumberConfig { int64 number = 1; - //FontStyle fontStyle = 2; + FontStyle fontStyle = 2; CombineBadgeBackground background = 3; } @@ -168,11 +206,15 @@ message BadgeStruct { } message ImageBadge { + BadgeDisplayType badge_display_type = 1; Image image = 2; } message TextBadge { - string defaultPattern = 3; + BadgeDisplayType badge_display_type = 1; + string key = 2; + string default_pattern = 3; + repeated string pieces = 4; } message IconConfig { @@ -180,18 +222,18 @@ message BadgeStruct { CombineBadgeBackground background = 2; } - message StringBadge { + BadgeDisplayType badge_display_type = 1; string str = 2; } - enum DataCase { - DATA_NOT_SET = 0; - IMAGE = 20; - TEXT = 21; - STR = 22; - COMBINE = 23; - } +// enum DataCase { +// DATA_NOT_SET = 0; +// IMAGE = 20; +// TEXT = 21; +// STR = 22; +// COMBINE = 23; +// } enum BadgeDisplayType { BADGEDISPLAYTYPE_UNKNOWN = 0; @@ -201,8 +243,40 @@ message BadgeStruct { BADGEDISPLAYTYPE_COMBINE = 4; } + enum BadgePriorityType { + BADGE_PRIORITY_TYPE_UNKNOWN = 0; + BADGE_PRIORITY_TYPE_STRONG_RELATION = 10; + BADGE_PRIORITY_TYPE_PLATFORM = 20; + BADGE_PRIORITY_TYPE_RELATION = 30; + BADGE_PRIORITY_TYPE_ACTIVITY = 40; + BADGE_PRIORITY_TYPE_RANK_LIST = 50; + } + enum BadgeSceneType { + BADGE_SCENE_TYPE_UNKNOWN = 0; + BADGE_SCENE_TYPE_ADMIN = 1; + BADGE_SCENE_TYPE_FIRST_RECHARGE = 2; + BADGE_SCENE_TYPE_FRIENDS = 3; + BADGE_SCENE_TYPE_SUBSCRIBER = 4; + BADGE_SCENE_TYPE_ACTIVITY = 5; + BADGE_SCENE_TYPE_RANK_LIST = 6; + BADGE_SCENE_TYPE_NEW_SUBSCRIBER = 7; + BADGE_SCENE_TYPE_USER_GRADE = 8; + BADGE_SCENE_TYPE_STATE_CONTROLLED_MEDIA = 9; + BADGE_SCENE_TYPE_FANS = 10; + BADGE_SCENE_TYPE_LIVE_PRO = 11; + BADGE_SCENE_TYPE_ANCHOR = 12; + } + enum DisplayStatus { + DISPLAY_STATUS_NORMAL = 0; + DISPLAY_STATUS_SHADOW = 1; + } + + enum BadgeExhibitionType { + BADGE_EXHIBITION_TYPE_BADGE = 0; + BADGE_EXHIBITION_TYPE_IDENTITY_LABEL = 1; + } enum Position { POSITIONUNKNOWN = 0; @@ -210,16 +284,36 @@ message BadgeStruct { POSITIONRIGHT = 2; } + message PaddingInfo { + bool use_specific = 1; + int32 middle_padding = 2; + int32 badge_width = 3; + int32 left_padding = 4; + int32 right_padding = 5; + int32 icon_top_padding = 6; + int32 icon_bottom_padding = 7; + HorizontalPaddingRule horizontal_padding_rule = 8; + VerticalPaddingRule vertical_padding_rule = 9; + } + enum HorizontalPaddingRule { + HORIZONTAL_PADDING_RULE_USE_MIDDLE_AND_WIDTH = 0; + HORIZONTAL_PADDING_RULE_USE_LEFT_AND_MIDDLE_AND_RIGHT = 1; + } + + enum VerticalPaddingRule { + VERTICAL_PADDING_RULE_USE_DEFAULT = 0; + VERTICAL_PADDING_RULE_USE_TOP_AND_BOTTOM = 1; + } } // @Gift -message GiftStruct { +message Gift { Image image = 1; string describe = 2; - int64 duration = 4; + int32 duration = 4; int64 id = 5; - bool forLinkmic = 7; + bool for_link_mic = 7; bool combo = 10; int32 type = 11; int32 diamondCount = 12; @@ -236,53 +330,58 @@ message GiftStruct { bool isRandomGift = 51; bool isBoxGift = 52; bool canPutInGiftBox = 53; - // GiftBoxInfo giftBoxInfo = 54; + GiftBoxInfo giftBoxInfo = 54; - - // @GiftPanelBanner - // proto.webcast.data.GiftStruct message GiftPanelBanner { - Text displayText = 1; - Image leftIcon = 2; - string schemaUrl = 3; - repeated string bgColorValuesList = 5; - string bannerLynxUrl = 6; + Text display_text = 1; + Image left_icon = 2; + string schema_url = 3; + repeated string bg_colors = 5; + string banner_lynx_url = 6; + int32 banner_priority = 7; + string banner_lynx_extra = 8; + Image bg_image = 9; } - - // @GiftRandomEffectInfo - // proto.webcast.data.GiftStruct - message GiftRandomEffectInfo { - RandomGiftPanelBanner randomGiftPanelBanner = 1; - repeated int64 effectIdsList = 2; - string hostKey = 3; - string audienceKey = 4; - RandomGiftBubble randomGiftBubble = 5; + message BatchGiftInfo { + bool can_batch_send = 1; + repeated int64 available_counts = 2; } - - - // @RandomGiftBubble - // proto.webcast.data.GiftStruct - message RandomGiftBubble { - string displayText = 1; - Image iconDynamicEffect = 2; + message CrossScreenEffectInfo { + map single_action_effect_ids = 1; + map action_effect_ids = 2; + map reaction_effect_ids = 3; } - - - // @RandomGiftPanelBanner - // proto.webcast.data.GiftStruct - message RandomGiftPanelBanner { - Image bgImage = 1; - Image shadingImage = 2; - int64 targetNum = 3; - int64 collectNum = 4; - string displayText = 5; - Image leftIcon = 6; - string schemaUrl = 7; - repeated string bgColorValuesList = 8; - int64 round = 9; + message GiftSponsorInfo { + int64 sponsor_id = 1; + int64 sponsor_count = 2; + int64 current_count = 3; + int64 left_count_to_sponsor = 4; + bool can_sponsor = 5; + } + message UGGiftStructInfo { + bool is_ug_gift = 1; + int64 ug_points_cost = 2; + } + message GiftSkin { + int64 gift_skin_id = 1; + string gift_skin_name = 2; + Image static_image = 3; + Image animated_image = 4; + } + message GiftText { + int64 gift_text_id = 1; + string gift_text_name = 2; + } + message GiftSkinToGiftTextsInfo { + int64 gift_skin_id = 1; + repeated int64 gift_text_ids = 2; + } + message GiftBoxInfo { + int64 capacity = 1; + bool is_primary_box = 2; + string scheme_url = 3; } - } // @User @@ -298,85 +397,85 @@ message User { int64 createTime = 16; int64 modifyTime = 17; int32 secret = 18; - string shareQrcodeUri = 19; + string share_qrcode_uri = 19; repeated Image badgeImageList = 21; - FollowInfo followInfo = 22; - PayGrade payGrade = 23; - FansClub fansClub = 24; - Border border = 25; - string specialId = 26; + FollowInfo follow_info = 22; + UserHonor user_honor = 23; + FansClubMember fans_club = 24; + BorderInfo border = 25; + string special_id = 26; Image avatarBorder = 27; Image medal = 28; - repeated Image realTimeIconsList = 29; - repeated Image newRealTimeIconsList = 30; - int64 topVipNo = 31; - UserAttr userAttr = 32; - OwnRoom ownRoom = 33; - int64 payScore = 34; - int64 ticketCount = 35; - LinkmicStatus linkMicStats = 37; - string displayId = 38; - bool withCommercePermission = 39; - bool withFusionShopEntry = 40; - AnchorLevel webcastAnchorLevel = 42; - string verifiedContent = 43; - AuthorStats authorStats = 44; - repeated User topFansList = 45; - string secUid = 46; - int32 userRole = 47; - ActivityInfo activityReward = 49; - Image personalCard = 52; - AuthenticationInfo authenticationInfo = 53; - repeated Image mediaBadgeImageList = 57; - repeated int64 commerceWebcastConfigIdsList = 60; - repeated Border borderList = 61; - ComboBadgeInfo comboBadgeInfo = 62; - SubscribeInfo subscribeInfo = 63; - repeated BadgeStruct badgeList = 64; - repeated int64 mintTypeLabelList = 65; - FansClubInfo fansClubInfo = 66; - bool allowFindByContacts = 1002; - bool allowOthersDownloadVideo = 1003; - bool allowOthersDownloadWhenSharingVideo = 1004; - bool allowShareShowProfile = 1005; - bool allowShowInGossip = 1006; - bool allowShowMyAction = 1007; - bool allowStrangeComment = 1008; - bool allowUnfollowerComment = 1009; - bool allowUseLinkmic = 1010; - AnchorLevel anchorLevel = 1011; - Image avatarJpg = 1012; - string bgImgUrl = 1013; - int32 blockStatus = 1016; - int32 commentRestrict = 1017; + repeated Image user_badges = 29; + repeated Image new_user_badges = 30; + int32 top_vip_no = 31; + UserAttr user_attr = 32; + OwnRoom own_room = 33; + int64 pay_score = 34; + int64 fan_ticket_count = 35; + AnchorLevel anchor_info = 36; + LinkmicStatus link_mic_stats = 37; + string username = 38; + bool enable_show_commerce_sale = 39; + bool with_fusion_shop_entry = 40; + int64 pay_scores = 41; + AnchorLevel anchor_level = 42; + string verified_content = 43; + Author author_info = 44; + repeated User top_fans = 45; + string sec_uid = 46; + int32 user_role = 47; + ActivityInfo reward_info = 49; + Image personal_card = 52; + AuthenticationInfo authentication_info = 53; + repeated Image media_badge_image_list = 57; + repeated int64 commerce_webcast_config_ids = 60; + repeated BorderInfo borders = 61; + ComboBadgeInfo combo_badge_info = 62; + SubscribeInfo subscribe_info = 63; + repeated BadgeStruct badge_list = 64; + repeated int64 mint_type_label = 65; + FansClubInfo fans_club_info = 66; + bool allow_find_by_contacts = 1002; + bool allow_others_download_video = 1003; + bool allow_others_download_when_sharing_video = 1004; + bool allow_share_show_profile = 1005; + bool allow_show_in_gossip = 1006; + bool allow_show_my_action = 1007; + bool allow_strange_comment = 1008; + bool allow_unfollower_comment = 1009; + bool allow_use_linkmic = 1010; + Image avatar_jpg = 1012; + string background_img_url = 1013; + int32 block_status = 1016; + int32 comment_restrict = 1017; string constellation = 1018; - int32 disableIchat = 1019; - int64 enableIchatImg = 1020; + int32 disable_ichat = 1019; + int64 enable_ichat_img = 1020; int32 exp = 1021; - int64 fanTicketCount = 1022; - bool foldStrangerChat = 1023; - int64 followStatus = 1024; - int32 ichatRestrictType = 1027; - string idStr = 1028; - bool isFollower = 1029; - bool isFollowing = 1030; - bool needProfileGuide = 1031; - int64 payScores = 1032; - bool pushCommentStatus = 1033; - bool pushDigg = 1034; - bool pushFollow = 1035; - bool pushFriendAction = 1036; - bool pushIchat = 1037; - bool pushStatus = 1038; - bool pushVideoPost = 1039; - bool pushVideoRecommend = 1040; - UserStats stats = 1041; - string verifiedReason = 1043; - bool withCarManagementPermission = 1044; - repeated LiveEventInfo upcomingEventList = 1045; - string scmLabel = 1046; - EcommerceEntrance ecommerceEntrance = 1047; - bool isBlock = 1048; + bool fold_stranger_chat = 1023; + int64 follow_status = 1024; + int32 ichat_restrict_type = 1027; + string id_str = 1028; + bool is_follower = 1029; + bool is_following = 1030; + bool need_profile_guide = 1031; + bool push_comment_status = 1033; + bool push_digg = 1034; + bool push_follow = 1035; + bool push_friend_action = 1036; + bool push_ichat = 1037; + bool push_status = 1038; + bool push_video_post = 1039; + bool push_video_recommend = 1040; + string verified_reason = 1043; + bool enable_car_management_permission = 1044; + repeated LiveEventInfo upcoming_event_list = 1045; + string scm_label = 1046; + EcommerceEntrance ecommerce_entrance = 1047; + bool is_block = 1048; + bool is_subscribe = 1090; + bool is_anchor_marked = 1091; message LiveEventInfo { int64 eventId = 1; @@ -656,6 +755,7 @@ message User { int64 fansScore = 3; Image badge = 4; int64 fansCount = 5; + string fansClubName = 6; } @@ -705,18 +805,6 @@ message User { string gradeBanner = 1001; Image profileDialogBg = 1002; Image profileDialogBgBack = 1003; - - - // @GradeIcon - // proto.webcast.data.User.PayGrade - // C:\Users\ja\RiderProjects\TikTokProBufferGenerator\Application\output\sources\test.js - message GradeIcon { - Image icon = 1; - int64 iconDiamond = 2; - int64 level = 3; - string levelStr = 4; - } - } @@ -785,6 +873,29 @@ message Emote { EmoteType emoteType = 5; // Enum ContentSource contentSource = 6; // Enum EmotePrivateType emotePrivateType = 7; // Enum + string package_id = 8; + AuditInfo audit_info = 9; + RewardCondition reward_condition = 10; + EmoteUploadInfo emote_upload_info = 11; + int64 create_time = 12; + EmoteScene emote_scene = 13; + + message AuditInfo { + int64 violation_id = 1; + AuditTaskType task_type = 2; + + enum AuditTaskType { + AUDIT_TASK_TYPE_DEFAULT = 0; + AUDIT_TASK_TYPE_APPEAL = 1; + } + } + + message EmoteUploadInfo { + int64 user_id = 1; + UserEmoteUploadSource emote_upload_source = 2; + User user_info = 3; + string user_id_str = 4; + } } // @PunishEventInfo @@ -793,8 +904,11 @@ message PunishEventInfo { string punishReason = 2; string punishId = 3; int64 violationUid = 4; - int32 punishTypeId = 5; // Enum + PunishTypeId punishTypeId = 5; // Enum int64 duration = 6; + string punish_perception_code = 7; + string violation_uid_str = 9; + string show_reason = 10; } // @MsgFilter @@ -817,53 +931,100 @@ message UserIdentity { // @Goal // proto.webcast.data // C:\Users\ja\RiderProjects\TikTokProBufferGenerator\Application\output\sources\test.js -message Goal { +message LiveStreamGoal { int64 id = 1; - // TextType type = 2; // Enum - // GoalStatus status = 3; // Enum - // repeated SubGoal subGoalsList = 4; + int32 type = 2; + int32 status = 3; + repeated LiveStreamSubGoal sub_goals = 4; string description = 5; - int32 auditStatus = 6; - // CycleType cycleType = 7; // Enum - int64 startTime = 8; - int64 expireTime = 9; - int64 realFinishTime = 10; - repeated GoalContributor contributorsList = 11; - int32 contributorsLength = 12; - string idStr = 13; - string auditDescription = 14; + AuditStatus audit_status = 6; + int32 cycle_type = 7; + int64 start_time = 8; + int64 expire_time = 9; + int64 real_finish_time = 10; + repeated LiveStreamGoalContributor contributors = 11; + int32 contributors_length = 12; + string id_str = 13; + string audit_description = 14; GoalStats stats = 15; + string goal_extra_info = 16; + int32 mode = 17; + AuditInfo audit_info = 18; + string challenge_type = 20; + bool is_uneditable = 21; + + message AuditInfo { + int64 violation_id = 1; + int32 task_type = 2; + } + + message LiveStreamSubGoal { + int32 type = 1; + int64 id = 2; + int64 progress = 3; + int64 target = 4; + LiveStreamSubGoalGift gift = 5; + string id_str = 6; + SubGoalPinInfo pin_info = 7; + int32 source = 8; + string recommended_text = 9; + string recommended_header = 10; + + message SubGoalPinInfo { + int64 pin_start_time = 1; + int64 pin_end_time = 2; + int64 pin_ready_time = 3; + } + } + + message LiveStreamSubGoalGift { + string name = 1; + Image icon = 2; + int64 diamond_count = 3; + int32 type = 4; + } + + message LiveStreamGoalContributor { + int64 user_id = 1; + Image avatar = 2; + string display_id = 3; + int64 score = 4; + string user_id_str = 5; + bool in_room = 6; + bool is_friend = 7; + bool follow_by_owner = 9; + bool is_fist_contribute = 10; + repeated SubGoalContribution sub_goal_contributions = 11; + + message SubGoalContribution { + string id = 1; + int64 contribution_count = 2; + } + } message GoalStats { - int64 totalCoins = 1; - int64 totalContributor = 2; - } + int64 total_coins = 1; + int64 total_contributor = 2; + GoalComparison comparison = 3; + int64 total_new_fans = 4; - message GoalContributor { - int64 userId = 1; - Image avatar = 2; - string displayId = 3; - int64 score = 4; - string userIdStr = 5; - bool inRoom = 6; - bool isFriend = 7; - repeated BadgeStruct badgeList = 8; - bool followByOwner = 9; - bool isFistContribute = 10; + message GoalComparison { + int64 coins_incr = 1; + int64 contributor_incr = 2; + } } - } // @Indicator // proto.webcast.data // C:\Users\ja\RiderProjects\TikTokProBufferGenerator\Application\output\sources\test.js -message Indicator { +message LiveStreamGoalIndicator { string key = 1; - int64 op = 2; // @warning Enum not found, should be Op + int32 op = 2; } -// --- HANDMANDE +// --- HANDMADE message Ranking { string type = 1; @@ -885,20 +1046,20 @@ message ValueLabel { string label3 = 11; } -message MessageDetails { +/*message MessageDetails { uint32 data1 = 1; TikTokColor color = 2; string category = 11; UserContainer user = 21; -} +}*/ -message UserContainer { +/*message UserContainer { User user = 1; uint32 data1 = 2; -} +}*/ // Container for uint-Data -message DataContainer { +/*message DataContainer { uint64 data1 = 1; uint32 data2 = 2; uint32 data3 = 3; @@ -908,20 +1069,22 @@ message DataContainer { uint32 data7 = 7; uint32 data8 = 8; uint32 data9 = 9; -} +}*/ message TimeStampContainer { uint64 timestamp1 = 1; uint64 timestamp2 = 2; uint64 timestamp3 = 3; } -message MemberMessageData { + +/*message MemberMessageData { string type = 1; string label = 2; TikTokColor color = 3; repeated MessageDetails details = 4; // UserContainer-Data is empty -} -message LinkMicArmiesItems { +}*/ + +/*message LinkMicArmiesItems { uint64 hostUserId = 1; repeated LinkMicArmiesGroup battleGroups = 2; @@ -929,7 +1092,7 @@ message LinkMicArmiesItems { repeated User users = 1; uint32 points = 2; } -} +}*/ message PollStartContent { int64 StartTime = 1; @@ -940,7 +1103,7 @@ message PollStartContent { } message PollEndContent { - int32 EndType = 1; // Possibly an Enum? + PollEndType EndType = 1; repeated PollOptionInfo OptionList = 2; User Operator = 3; } @@ -974,6 +1137,8 @@ message FanTicketRoomNoticeContent { int64 MatchId = 3; int64 EventTime = 4; string FanTicketIconUrl = 5; + int64 play_id = 6; + PlayScene play_scene = 7; } message LinkerAcceptNoticeContent { @@ -993,19 +1158,13 @@ message ListUser { User user = 1; int64 linkmicId = 2; string linkmicIdStr = 3; - int64 linkStatus = 4; // Enum - LinkType linkType = 5; // Enum + LinkmicRoleType linkStatus = 4; + LinkType linkType = 5; int32 userPosition = 6; - int32 silenceStatus = 7; // Enum + LinkSilenceStatus silenceStatus = 7; int64 modifyTime = 8; int64 linkerId = 9; - int32 roleType = 10; // Enum - - enum LinkType { - LINK_UNKNOWN = 0; - AUDIO = 1; - VIDEO = 2; - } + LinkRoleType roleType = 10; } @@ -1017,15 +1176,13 @@ message LinkerCloseContent { message LinkerCreateContent { int64 ownerId = 1; int64 ownerRoomId = 2; - int64 linkType = 3; + int64 linkType = 3; // Assuming this is LinkType enum } - - message LinkerEnterContent { repeated ListUser linkedUsersList = 1; - int32 anchorMultiLiveEnum = 2; // Enum - LinkmicUserSettingInfo anchorSettingInfo = 3;; + LinkmicMultiLiveEnum anchorMultiLiveEnum = 2; + MultiLiveAnchorPanelSettings anchorSettingInfo = 3;; } message LinkerInviteContent { @@ -1038,11 +1195,138 @@ message LinkerInviteContent { string toLinkmicIdStr = 7; User fromUser = 8; int64 requiredMicIdx = 9; + map rtc_ext_info_map = 10; + LinkmicMultiLiveEnum multi_live_layout_enable = 11; + MultiLiveAnchorPanelSettings multi_live_setting = 12; + string from_linkmic_id_str = 13; + InviteTopHostInfo from_top_host_info = 16; + int64 action_id = 17; + repeated LinkmicUserInfo linked_users = 18; + PerceptionDialogInfo dialog_info = 19; + PunishEventInfo punish_event_info = 20; + int32 from_room_age_restricted = 21; + repeated CohostABTestSetting ab_test_setting = 23; + LinkerInviteMessageExtra linker_invite_msg_extra = 101; + + message InviteTopHostInfo { + string rank_type = 1; + int64 top_index = 2; + } + + message LinkmicUserInfo { + int64 user_id = 1; + string linkmic_id_str = 2; + int64 room_id = 3; + int64 linked_time = 4; + } + + message PerceptionDialogInfo { + PerceptionDialogIconType icon_type = 1; + Text title = 2; + Text sub_title = 3; + Text advice_action_text = 4; + Text default_action_text = 5; + string violation_detail_url = 6; + Scene scene = 7; + int64 target_user_id = 8; + int64 target_room_id = 9; + int64 count_down_time = 10; + bool show_feedback = 11; + repeated PerceptionFeedbackOption feedback_options = 12; + int64 policy_tip = 13; + int32 appeal_popup = 14; + + message PerceptionFeedbackOption { + int64 id = 1; + string content_key = 2; + } + } + + message CohostABTestSetting { + int64 key = 1; + CohostABTestList value = 2; + + message CohostABTestList { + repeated CohostABTest ab_test_list = 1; + + message CohostABTest { + CohostABTestType ab_test_type = 1; + int64 group = 2; + } + } + } + + message LinkerInviteMessageExtra { + int32 match_type = 1; + int32 invite_type = 2; + int32 sub_type = 3; + string theme = 4; + int32 duration = 5; + int32 layout = 6; + string tips = 7; + InviterRivalExtra inviter_rival_extra = 8; + repeated InviterRivalExtra other_rival_extra = 9; + CohostTopic topic_info = 10; + string algo_request_id = 11; + + message InviterRivalExtra { + TextType text_type = 1; + string text = 2; + string label = 3; + int32 user_count = 4; + Image avatar_thumb = 5; + string display_id = 6; + AuthenticationInfo authentication_info = 7; + string nickname = 8; + int64 follow_status = 9; + Hashtag m_hashtag = 10; + int64 user_id = 12; + bool is_best_teammate = 13; + OptPairInfo opt_pair_info = 14; + int64 follower_count = 15; + + message AuthenticationInfo { + string custom_verify = 1; + string enterprise_verify_reason = 2; + Image authentication_badge = 3; + } + + message Hashtag { + int64 id = 1; + string title = 2; + Image image = 3; + HashtagNamespace namespace = 4; + } + + message OptPairInfo { + int64 mapping_id = 1; + repeated OptPairUser display_user_list = 2; + OptPairStatus button_notice_type = 3; + int64 expected_time_sec = 4; + int64 opt_pair_type = 5; + + message OptPairUser { + User user = 1; + int64 room_id = 2; + } + } + } + } +} + +message CohostTopic { + int64 id = 1; + string title_key = 2; + string title_text = 3; + bool liked = 21; + int64 total_heat = 22; + int64 total_rivals = 23; + repeated Image rivals_avatar = 24; } message LinkerKickOutContent { int64 fromUserId = 1; - KickoutReason kickoutReason = 2; // Enum + KickoutReason kickoutReason = 2; } message LinkerLeaveContent { @@ -1068,11 +1352,19 @@ message LinkerListChangeContent { } message LinkerMediaChangeContent { - int64 op = 1; // Enum + GuestMicCameraManageOp op = 1; int64 toUserId = 2; int64 anchorId = 3; int64 roomId = 4; - int64 changeScene = 5; // Enum + GuestMicCameraChangeScene changeScene = 5; + LinkerMediaChangeOperator operator_info = 7; + + message LinkerMediaChangeOperator { + int64 user_id = 1; + LinkMicUserAdminType operator_type = 2; + string nick_name = 3; + string display_id = 4; + } } //Empty @@ -1080,10 +1372,9 @@ message LinkerMicIdxUpdateContent { } - message LinkerMuteContent { int64 userId = 1; - int64 status = 2; // Enum + MuteStatus status = 2; } message LinkerRandomMatchContent { @@ -1122,7 +1413,7 @@ message LinkerReplyContent { message LinkerSetting { int64 MaxMemberLimit = 1; int64 LinkType = 2; - int64 Scene = 3; + Scene Scene = 3; int64 OwnerUserId = 4; int64 OwnerRoomId = 5; int64 Vendor = 6; @@ -1137,16 +1428,17 @@ message LinkmicUserToastContent { int64 userId = 1; int64 roomId = 2; Text displayText = 3; + int64 leaved_user_id = 4; } message LinkerUpdateUserContent { int64 fromUserId = 1; int64 toUserId = 2; + map update_info = 3; } -//Empty message LinkerUpdateUserSettingContent { - + MultiLiveAnchorPanelSettings multi_live_anchor_panel_settings = 1; } //Empty @@ -1155,13 +1447,18 @@ message LinkerWaitingListChangeContent { } -message LinkmicUserSettingInfo { +message MultiLiveAnchorPanelSettings { 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 + int64 layout = 2; + int64 fixMicNum = 3; + int64 allowRequestFromUser = 4; + int64 allowRequestFromFollowerOnly = 5; + LinkmicApplierSortSetting applierSortSetting = 7; + int64 applier_sort_gift_score_threshold = 8; + int32 allow_request_from_friends = 9; + int32 allow_request_from_followers = 10; + int32 allow_request_from_others = 11; + int32 enable_show_multi_guest_layout = 12; } @@ -1209,16 +1506,18 @@ message DSLConfig { message GroupChannelAllUser { int64 groupChannelId = 1; repeated GroupChannelUser userList = 2; + int64 content_version = 3; } message GroupChannelUser { int64 channelId = 1; - GroupStatus status = 2; // Enum - TextType type = 3; // Enum + GroupStatus status = 2; + TextType type = 3; AllListUser allUser = 4; int64 joinTime = 5; int64 linkedTime = 6; GroupPlayer ownerUser = 7; + string group_linkmic_id = 8; } message RTCExtraInfo { @@ -1226,9 +1525,29 @@ message RTCExtraInfo { repeated RTCLiveVideoParam liveRtcVideoParamList = 2; RTCBitrateMap rtcBitrateMap = 3; int32 rtcFps = 4; + RTCMixBase rtc_mix_base = 5; + ByteRTCExtInfo byte_rtc_ext_info = 6; + RTCInfoExtra rtc_info_extra = 7; string rtcBusinessId = 8; + RTCOther rtc_other = 9; int32 interactClientType = 10; + message RTCMixBase { + int32 bitrate = 1; + } + + message ByteRTCExtInfo { + int32 default_signaling = 1; + } + + message RTCInfoExtra { + string version = 1; + } + + message RTCOther { + int32 trans_coding_second = 1; + } + message RTCEngineConfig { string rtcAppId = 1; string rtcUserId = 2; @@ -1262,25 +1581,50 @@ message CreateChannelContent { } message ListChangeContent { - TextType type = 1; // Enum - AllListUser list = 2; + int32 list_change_type = 1; + AllListUser user_list = 2; + repeated string linked_user_ui_positions = 3; + repeated ContentPosition content_pos = 4; +} + +message ContentPosition { + string content_i_d = 1; + ContentPositionType content_type = 2; + MicPositionData pos = 3; + string content_linkmic_i_d = 4; + int64 start_time_nano = 5; +} + +message MicPositionData { + int32 type = 1; + LinkPosition link_position = 2; } message MultiLiveContent { + ApplyBizContent applyBizContent = 1; InviteBizContent inviteBizContent = 2; ReplyBizContent replyBizContent = 3; PermitBizContent permitBizContent = 4; + JoinDirectBizContent joinDirectBizContent = 5; 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 ApplyBizContent { + User user = 1; } + message JoinDirectBizContent { + int64 reply_im_msg_id = 1; + MultiGuestOutsideRoomInviteSource outside_room_invite_source = 2; + } + + message InviteBizContent { + MultiLiveAnchorPanelSettings anchorSettingInfo = 1; + ContentInviteSource inviteSource = 2; + User operatorUserInfo = 3; + LinkMicUserAdminType operatorLinkAdminType = 4; + User inviteeUserInfo = 5; + LinkmicShareRevenueSetting share_revenue_setting = 6; + } message ReplyBizContent { int32 linkType = 1; @@ -1289,21 +1633,21 @@ message MultiLiveContent { } message PermitBizContent { - LinkmicUserSettingInfo anchorSettingInfo = 1; + MultiLiveAnchorPanelSettings anchorSettingInfo = 1; int64 expireTimestamp = 2; User operatorUserInfo = 3; - int64 operatorLinkAdminType = 4; // @warning Enum not found, should be OperatorLinkAdminType + LinkMicUserAdminType operatorLinkAdminType = 4; + LinkUserType link_user_type = 5; } message KickOutBizContent { User operatorUserInfo = 1; - int64 operatorLinkAdminType = 2; // @warning Enum not found, should be OperatorLinkAdminType + LinkMicUserAdminType operatorLinkAdminType = 2; User kickPlayerUserInfo = 3; } } - message InviteContent { Player invitor = 1; RTCExtraInfo inviteeRtcExtInfo = 2; @@ -1346,10 +1690,12 @@ message PermitApplyContent { // C:\Users\ja\RiderProjects\TikTokProBufferGenerator\Application\output\sources\test.js message ReplyInviteContent { Player invitee = 1; - ReplyStatus replyStatus = 2; // Enum + ReplyStatus replyStatus = 2; string inviteeLinkMicId = 3; Position inviteePos = 4; Player inviteOperatorUser = 5; + repeated string linked_user_ui_positions = 6; + repeated PosIdentity ui_pos = 7; } @@ -1358,7 +1704,14 @@ message ReplyInviteContent { // C:\Users\ja\RiderProjects\TikTokProBufferGenerator\Application\output\sources\test.js message KickOutContent { Player offliner = 1; - KickoutReason kickoutReason = 2; // Enum + KickoutReason kickoutReason = 2; + repeated string linked_user_ui_positions = 3; + repeated PosIdentity ui_pos = 4; +} + +message PosIdentity { + PosIdentityType type = 1; + string value = 2; } @@ -1389,6 +1742,8 @@ message CancelInviteContent { message LeaveContent { Player leaver = 1; int64 leaveReason = 2; + repeated string linked_user_ui_positions = 3; + repeated PosIdentity ui_pos = 4; } @@ -1417,6 +1772,7 @@ message LeaveJoinGroupContent { GroupPlayer operator = 1; int64 groupChannelId = 2; string leaveSource = 3; + repeated string linked_user_ui_positions = 4; } @@ -1424,10 +1780,18 @@ message LeaveJoinGroupContent { // proto.webcast.im message PermitJoinGroupContent { GroupPlayer approver = 1; - AgreeStatus agreeStatus = 2; // Enum - TextType type = 3; // Enum + AgreeStatus agreeStatus = 2; + JoinType type = 3; repeated RTCExtraInfo groupExtInfoList = 4; GroupChannelAllUser groupUser = 5; + MigrationDetails migration_details = 6; + repeated string linked_user_ui_positions = 7; +} + +message MigrationDetails { + bool is_migrate = 1; + int64 source_group_channel_id = 2; + int64 target_group_channel_id = 3; } @@ -1436,7 +1800,8 @@ message PermitJoinGroupContent { message CancelJoinGroupContent { repeated GroupPlayer leaverList = 1; GroupPlayer operator = 2; - TextType type = 3; // Enum + JoinType type = 3; + GroupChannelAllUser group_user = 4; } @@ -1444,6 +1809,13 @@ message CancelJoinGroupContent { message P2PGroupChangeContent { repeated RTCExtraInfo groupExtInfoList = 1; GroupChannelAllUser groupUser = 2; + MigrationDetails migration_details = 3; + repeated ContentPosition content_pos = 4; +} + +message GroupChangeContent { + GroupChannelAllUser group_user = 1; + repeated string linked_user_ui_positions = 2; } @@ -1454,7 +1826,43 @@ message BusinessContent { message CohostContent { JoinGroupBizContent joinGroupBizContent = 1; + PermitJoinGroupBizContent permit_join_group_biz_content = 2; + ListChangeBizContent list_change_biz_content = 11; + } + message PermitJoinGroupBizContent { + ReplyStatus reply_status = 1; + SourceType source_type = 2; + } + + message ListChangeBizContent { + map user_infos = 1; + repeated VirtualWaitingUser waiting_users = 2; + + message VirtualWaitingUser { + int64 user_id = 1; + int64 timestamp = 2; + repeated Image avatars = 3; + } + } + + message CohostUserInfo { + int64 permission_type = 1; + SourceType source_type = 2; + bool is_low_version = 3; + int64 best_teammate_uid = 4; + bool has_topic_perm = 5; + CohostStreamConfig stream_config = 6; + bool in_different_invite_type_control_group = 7; + string nickname = 11; + string display_id = 12; + Image avatar_thumb = 13; + int64 follow_status = 14; + string user_id_str = 15; + + message CohostStreamConfig { + string screen_share_stream_id = 1; + } } message JoinGroupBizContent { @@ -1462,7 +1870,42 @@ message BusinessContent { Tag fromTag = 2; PerceptionDialogInfo dialog = 3; PunishEventInfo punishInfo = 4; + CohostTopic topic_info = 5; + string algo_request_id = 6; + CohostLayoutMode cohost_layout_mode = 7; + TagV2 tag = 8; + RivalsGameTag game_tag = 9; + string new_user_education = 11; JoinGroupMessageExtra joinGroupMsgExtra = 101; + + message RivalsGameTag { + int64 tag_id = 1; + string tag_display_text = 2; + } + + message TagV2 { + TagClassification tag_classification = 1; + int32 tag_type = 2; + string tag_value = 3; + string starling_key = 4; + SecondDegreeRelationContent second_degree_relation_content = 10; + int64 cohost_history_day = 11; + SimilarInterestContent similar_interest_content = 12; + + message UserInfo { + int64 user_id = 1; + string nick_name = 2; + Image avatar_thumb = 3; + } + message SecondDegreeRelationContent { + repeated UserInfo related_users = 1; + int64 total_related_user_cnt = 2; + } + message SimilarInterestContent { + int64 content_id = 1; + string display_text = 2; + } + } } message Tag { @@ -1524,7 +1967,7 @@ message BusinessContent { int64 id = 1; string title = 2; Image image = 3; - HashtagNamespace namespace = 4; // Enum + HashtagNamespace namespace = 4; } message TopHostInfo { @@ -1536,5 +1979,199 @@ message BusinessContent { message JoinGroupContent { GroupChannelAllUser groupUser = 1; GroupPlayer joinUser = 2; - TextType type = 3; // Enum + JoinType type = 3; + repeated RTCExtraInfo group_ext_info = 4; +} + +message PrivilegeLogExtra { + string data_version = 1; + string privilege_id = 2; + string privilege_version = 3; + string privilege_order_id = 4; + string level = 5; +} + +message FontStyle { + int32 font_size = 1; + int32 font_width = 2; + string font_color = 3; + string border_color = 4; +} + +message UserHonor { + int64 total_diamond = 1; + Image diamond_icon = 2; + string current_honor_name = 3; + Image current_honor_icon = 4; + string next_honor_name = 5; + int32 level = 6; + Image next_honor_icon = 7; + int64 current_diamond = 9; + int64 this_grade_min_diamond = 10; + int64 this_grade_max_diamond = 11; + string grade_describe = 13; + repeated GradeIcon grade_icon_list = 14; + int64 screen_chat_type = 15; + Image im_icon = 16; + Image im_icon_with_level = 17; + Image live_icon = 18; + Image new_im_icon_with_level = 19; + Image new_live_icon = 20; + int64 upgrade_need_consume = 21; + string next_privileges = 22; + Image profile_dialog_bg = 23; + Image profile_dialog_back_bg = 24; + int64 score = 25; + string grade_banner = 1001; +} + +// @GradeIcon +// proto.webcast.data.User.PayGrade +// C:\Users\ja\RiderProjects\TikTokProBufferGenerator\Application\output\sources\test.js +message GradeIcon { + Image icon = 1; + int64 iconDiamond = 2; + int64 level = 3; + string levelStr = 4; +} + +message BorderInfo { + Image icon = 1; + int64 level = 2; + string source = 3; + Image profile_decoration_ribbon = 4; + PrivilegeLogExtra border_log_extra = 5; + PrivilegeLogExtra ribbon_log_extra = 6; + string avatar_background_color = 7; + string avatar_background_border_color = 8; +} + +message FansClubMember { + FansClubData data = 1; + map prefer_data = 2; +} + +message FansClubData { + string club_name = 1; + int32 level = 2; + int32 user_fans_club_status = 3; + UserBadge badge = 4; + repeated int64 available_gift_ids = 5; + int64 anchor_id = 6; + + message UserBadge { + map icons = 1; + string title = 2; + } +} + +message Author { + int64 video_total_count = 1; + int64 video_total_play_count = 2; + int64 video_total_favorite_count = 6; +} + +message PublicAreaCommon { + Image userLabel = 1; + int64 userConsumeInRoom = 2; +} + +message PublicAreaMessageCommon { + int64 scroll_gap_count = 1; + int64 anchor_scroll_gap_count = 2; + bool release_to_scroll_area = 3; + bool anchor_release_to_scroll_area = 4; + bool is_anchor_marked = 5; + CreatorSuccessInfo creator_success_info = 6; + PortraitInfo portrait_info = 7; + UserInteractionInfo user_interaction_info = 8; + int64 admin_fold_type = 9; + + message TagItem { + TagType tag_type = 1; + Text tag_text = 2; + } + message Topic { + TopicActionType topic_action_type = 1; + Text topic_text = 2; + Text topic_tips = 3; + } + message CreatorSuccessInfo { + repeated TagItem tags = 1; + Topic topic = 2; + } + message UserMetrics { + UserMetricsType type = 1; + string metrics_value = 2; + } + message PortraitTag { + string tag_id = 1; + int64 priority = 2; + string show_value = 3; + string show_args = 4; + } + message PortraitInfo { + repeated UserMetrics user_metrics = 1; + repeated PortraitTag portrait_tag = 2; + } + message UserInteractionInfo { + int64 like_cnt = 1; + int64 comment_cnt = 2; + int64 share_cnt = 3; + } +} + +message GiftModeMeta { + int64 gift_id = 1; + string gift_name_key = 2; + Image gift_icon_image = 3; + Text gift_mode_desc = 4; +} + +message BattleTeamUser { + int64 user_id = 1; + int64 score = 2; + string user_id_str = 3; +} + +message BattleSetting { + int64 battle_id = 1; + int64 start_time_ms = 2; + int32 duration = 3; + int64 channel_id = 4; + int32 status = 5; + BattleInviteType invite_type = 6; + GiftModeMeta gift_mode_meta = 7; + BattleType battle_type = 8; + int64 extra_duration_second = 9; + int64 end_time_ms = 10; +} + +message BattleTeamUserArmies { + int64 team_id = 1; + repeated BattleTeamUser team_users = 2; + int64 team_total_score = 3; + BattleUserArmies user_armies = 4; + int64 host_rank = 5; +} + +message BattleUserArmies { + repeated BattleUserArmy user_army = 1; + int64 host_score = 2; + string anchor_id_str = 3; +} + +message BattleUserArmy { + int64 user_id = 1; + int64 score = 2; + string nickname = 3; + Image avatar_thumb = 4; + int64 diamond_score = 5; + string user_id_str = 6; +} + +message HighScoreControlCfg { + bool normal_control_applied = 1; + int64 threshold = 2; + repeated int64 origin_display_to_user_list = 3; } \ No newline at end of file diff --git a/API/src/main/proto/enums.proto b/API/src/main/proto/enums.proto index 0c021e6..af6dd6c 100644 --- a/API/src/main/proto/enums.proto +++ b/API/src/main/proto/enums.proto @@ -35,14 +35,6 @@ enum LinkmicApplierSortSetting { LINKMIC_APPLIER_SORT_SETTING_BY_GIFT_SCORE = 1; } -enum LinkMicBattleStatus { - BATTLE_ARMY_UNKNOWN = 0; - ARMY_ONGOING = 1; - ARMY_FINISHED = 2; - BATTLE_ONGOING = 4; - BATTLE_FINISHED = 5; -} - enum HashtagNamespace { GLOBAL = 0; GAMING = 1; @@ -64,7 +56,6 @@ enum KickoutReason { KICKOUT_REASON_HOST_REMOVE_ALL_GUESTS = 6; } - enum GroupStatus { GROUP_STATUS_UNKNOWN = 0; GROUP_STATUS_WAITING = 1; @@ -183,7 +174,6 @@ enum LinkLayerMessageType Linker_Group_Change = 18; } - enum BarrageType { BarrageType_Unknown = 0; @@ -212,21 +202,18 @@ enum EnvelopeBusinessType BusinessTypeEoYDiamond = 6; BusinessTypeFanClubGtM = 7; } -enum EnvelopeFollowShowStatus -{ - EnvelopeFollowShowUnknown = 0; - EnvelopeFollowShow = 1; - EnvelopeFollowNotShow = 2; +enum EnvelopeFollowShowStatus { + ENVELOPE_FOLLOW_SHOW_STATUS_ENVELOPE_FOLLOW_SHOW_UNKNOWN = 0; + ENVELOPE_FOLLOW_SHOW_STATUS_ENVELOPE_FOLLOW_SHOW = 1; + ENVELOPE_FOLLOW_SHOW_STATUS_ENVELOPE_FOLLOW_NOT_SHOW = 2; } -enum EnvelopeDisplay -{ - EnvelopeDisplayUnknown = 0; - EnvelopeDisplayNew = 1; - EnvelopeDisplayHide = 2; +enum EnvelopeDisplay { + ENVELOPE_DISPLAY_UNKNOWN = 0; + ENVELOPE_DISPLAY_NEW = 1; + ENVELOPE_DISPLAY_HIDE = 2; } - enum CommonContentCase { COMMON_CONTENT_NOT_SET = 0; CREATE_CHANNEL_CONTENT = 100; @@ -249,7 +236,6 @@ enum CommonContentCase { GROUP_CHANGE_CONTENT = 118; } - enum LinkMessageType { TYPE_LINKER_UNKNOWN = 0; TYPE_LINKER_CREATE = 1; @@ -294,10 +280,544 @@ enum MessageType { MESSAGETYPE_SUBGIFTSENDSUCCEEDANCHORNOTICE = 10; MESSAGETYPE_SUBGIFTLOWVERSIONUPGRADENOTICE = 11; MESSAGETYPE_SUBGIFTUSERBUYAUTHNOTICE = 12; + MESSAGETYPE_SUBCOMMONTEXTNOTICE = 13; + MESSAGETYPE_SUBMODERATORPINPERK = 14; } enum Scene { SCENE_UNKNOWN = 0; SCENE_CO_HOST = 2; SCENE_MULTI_LIVE = 4; +} + +enum RewardCondition { + REWARD_CONDITION_SUBSCRIPTION = 0; + REWARD_CONDITION_SUB_WAVE_CUSTOM = 1; +} + +enum UserEmoteUploadSource { + USER_EMOTE_UPLOAD_SOURCE_EMOTE_UPLOAD_SOURCE_ANCHOR = 0; + USER_EMOTE_UPLOAD_SOURCE_EMOTE_UPLOAD_SOURCE_SUBSCRIBER = 1; + USER_EMOTE_UPLOAD_SOURCE_EMOTE_UPLOAD_SOURCE_MODERATOR = 2; +} + +enum EmoteScene { + EMOTE_SCENE_SUBSCRIPTION = 0; + EMOTE_SCENE_GAME = 1; +} + +enum PunishTypeId { + PUNISH_TYPE_IDUN_KNOWN = 0; + PUNISH_TYPE_ID_BAN_LINK_MIC = 9; + PUNISH_TYPE_ID_BAN_GAME_PARTNERSHIP = 25; + PUNISH_TYPE_ID_REMOVE_GAME_PARTNERSHIP = 26; + PUNISH_TYPE_ID_BANCO_HOST_LINK_MIC = 55; + PUNISH_TYPE_ID_AUTHORITY_LIMIT_MATCH = 57; + PUNISH_TYPE_ID_BAN_VOICE_CHAT = 59; + PUNISH_TYPE_ID_BAN_LIVE_GOAL = 64; + PUNISH_TYPE_ID_VIEWER_LIMIT = 70; +} + +enum MultiplierType { + MULTIPLIER_TYPE_UNSPECIFIED = 0; + MULTIPLIER_TYPE_CRITICAL_STRIKE = 1; + MULTIPLIER_TYPE_TOP_2 = 2; + MULTIPLIER_TYPE_TOP_3 = 3; +} + +enum LinkmicGiftExpressionStrategy { + LINKMIC_GIFT_EXPRESSION_STRATEGY_CONTROL_V_1 = 0; + LINKMIC_GIFT_EXPRESSION_STRATEGY_EXPERIMENT_V_1 = 1; + LINKMIC_GIFT_EXPRESSION_STRATEGY_EXPERIMENT_V_2 = 2; +} + +enum GiftMessageVersion { + GIFT_MESSAGE_VERSION_0 = 0; + GIFT_MESSAGE_VERSION_1 = 1; +} + +enum TagType { + TAG_TYPE_CREATOR_CR_M_TAG_TYPE_UNKNOWN = 0; + TAG_TYPE_CREATOR_CR_M_TAG_TYPE_USER_GRADE = 1; + TAG_TYPE_CREATOR_CR_M_TAG_TYPE_FANS_LEVEL = 2; + TAG_TYPE_CREATOR_CR_M_TAG_TYPE_WATCH_ME_DAYS_AGO = 3; + TAG_TYPE_CREATOR_CR_M_TAG_TYPE_CUSTOM = 4; + TAG_TYPE_CREATOR_CR_M_TAG_TYPE_TITLE_GIFT = 5; + TAG_TYPE_CREATOR_CR_M_TAG_TYPE_FIRST_JOINED_TEAM = 6; + TAG_TYPE_CREATOR_CR_M_TAG_TYPE_PAY_ACCOMPANY_DAYS = 7; + TAG_TYPE_CREATOR_CR_M_TAG_TYPE_SPONSOR_GIFT_LAST_ROOM = 8; + TAG_TYPE_CREATOR_CR_M_TAG_TYPE_MATCH_MVP_LAST_ROOM = 9; + TAG_TYPE_CREATOR_CR_M_TAG_TYPE_LARGE_AMOUNT_GIFT_LAST_ROOM = 10; + TAG_TYPE_CREATOR_CR_M_TAG_TYPE_COMMENT_LAST_ROOM = 11; + TAG_TYPE_CREATOR_CR_M_TAG_TYPE_RECENT_TITLED_GIFT = 12; + TAG_TYPE_CREATOR_CR_M_TAG_TYPE_MEET_ANNIVERSARY = 13; + TAG_TYPE_CREATOR_CR_M_TAG_TYPE_FANS_SLEEP = 14; + TAG_TYPE_CREATOR_CR_M_TAG_TYPE_NOT_SEND_HEART_ME = 15; + TAG_TYPE_CREATOR_CR_M_TAG_TYPE_NOT_JOIN_TEAM = 16; + TAG_TYPE_CREATOR_CR_M_TAG_TYPE_FIRST_WATCH_LIVE = 17; + TAG_TYPE_CREATOR_CR_M_TAG_TYPE_RECENT_COMMENT = 18; + TAG_TYPE_CREATOR_CR_M_TAG_TYPE_RECENT_GIFT_TIMES = 19; + TAG_TYPE_CREATOR_CR_M_TAG_TYPE_RECENT_WATCH_LIVE_DURATION = 20; + TAG_TYPE_CREATOR_CR_M_TAG_TYPE_RECENT_GIFT = 21; + TAG_TYPE_CREATOR_CR_M_TAG_TYPE_RECENT_LIVE_CONTRIBUTION_TOP = 22; + TAG_TYPE_CREATOR_CR_M_TAG_TYPE_JUST_UPGRADE = 28; + TAG_TYPE_CREATOR_CR_M_TAG_TYPE_FAN_TOTAL_WATCH_DURATION = 29; + TAG_TYPE_CREATOR_CR_M_TAG_TYPE_FAN_TOTAL_COMMENT_NUM = 30; + TAG_TYPE_CREATOR_CR_M_TAG_TYPE_FAN_TOTAL_GIFT_SENT_NUM = 31; +} + +enum TopicActionType { + TOPIC_ACTION_TYPE_UNKNOWN = 0; + TOPIC_ACTION_TYPE_FOLLOW = 1; +} + +enum UserMetricsType { + USER_METRICS_TYPE_UNKNOWN = 0; + USER_METRICS_TYPE_GRADE = 1; + USER_METRICS_TYPE_SUBSCRIBE = 2; + USER_METRICS_TYPE_FOLLOW = 3; + USER_METRICS_TYPE_FANS_CLUB = 4; + USER_METRICS_TYPE_TOP_VIEWER = 5; + USER_METRICS_TYPE_GIFT = 6; +} + +enum GiftMessageIgnoreConfig { + GIFT_MESSAGE_IGNORE_CONFIG_NOT_IGNORE = 0; + GIFT_MESSAGE_IGNORE_CONFIG_IGNORE_TRAY = 1; + GIFT_MESSAGE_IGNORE_CONFIG_IGNORE_PS_M = 2; + GIFT_MESSAGE_IGNORE_CONFIG_IGNORE_TRAY_AND_PS_M = 3; +} + +enum HorizontalOnclickTriggerType { + HORIZONTAL_ONCLICK_TRIGGER_TYPE_ONCLICK_TRIGGER_TYPE_UNKNOWN = 0; + HORIZONTAL_ONCLICK_TRIGGER_TYPE_ONCLICK_TRIGGER_TYPE_LEFT = 1; + HORIZONTAL_ONCLICK_TRIGGER_TYPE_ONCLICK_TRIGGER_TYPE_MIDDLE = 2; + HORIZONTAL_ONCLICK_TRIGGER_TYPE_ONCLICK_TRIGGER_TYPE_RIGHT = 3; + HORIZONTAL_ONCLICK_TRIGGER_TYPE_ONCLICK_TRIGGER_TYPE_ALL_AREA = 4; +} + +enum ShowType { + SHOW_TYPE_NORMAL = 0; + SHOW_TYPE_FADE_IN_OUT = 1; +} + +enum RenderType { + RENDER_TYPE_NATIVE = 0; + RENDER_TYPE_HYBRID = 1; + RENDER_TYPE_ALPHA = 2; +} + +enum IconDisplayType { + ICON_DISPLAY_TYPE_IMAGE = 0; + ICON_DISPLAY_TYPE_BADGE = 1; +} + +enum CommentTag { + COMMENT_TAG_NORMAL = 0; + COMMENT_TAG_CANDIDATE = 1; + COMMENT_TAG_OVERAGE = 2; +} + +enum PerceptionDialogIconType { + PERCEPTION_DIALOG_ICON_TYPE_ICON_TYPE_NONE = 0; + PERCEPTION_DIALOG_ICON_TYPE_ICON_TYPE_WARNING = 1; + PERCEPTION_DIALOG_ICON_TYPE_ICON_TYPE_LINK_MIC = 2; + PERCEPTION_DIALOG_ICON_TYPE_ICON_TYPE_GUEST_LINK_MIC = 3; + PERCEPTION_DIALOG_ICON_TYPE_ICON_TYPE_LIVE = 4; + PERCEPTION_DIALOG_ICON_TYPE_ICON_TYPE_TREASURE_BOX = 5; + PERCEPTION_DIALOG_ICON_TYPE_ICON_TYPE_MUTE = 6; + PERCEPTION_DIALOG_ICON_TYPE_ICON_GAMEPAD_ACCESS_REVOKED = 7; + PERCEPTION_DIALOG_ICON_TYPE_ICON_TYPE_BAN_REPORT_LIVE_SINGLE_ROOM = 8; + PERCEPTION_DIALOG_ICON_TYPE_ICON_TYPE_BAN_REPORT_LIVE_ALL_ROOM = 9; + PERCEPTION_DIALOG_ICON_TYPE_ICON_TYPE_BAN_REPORT_LIVE_GREEN_SCREEN = 10; + PERCEPTION_DIALOG_ICON_TYPE_ICON_TYPE_GIFT = 11; + PERCEPTION_DIALOG_ICON_TYPE_ICON_TYPE_APPEAL_SUCCESS = 12; + PERCEPTION_DIALOG_ICON_TYPE_ICON_TYPE_MATCH = 13; + PERCEPTION_DIALOG_ICON_TYPE_ICON_TYPE_LIVE_GOAL = 14; + PERCEPTION_DIALOG_ICON_TYPE_ICON_TYPE_SUBSCRIPTION = 15; + PERCEPTION_DIALOG_ICON_TYPE_ICON_TYPE_STAR_COMMENT = 16; + PERCEPTION_DIALOG_ICON_TYPE_ICON_TYPE_RANKING = 17; + PERCEPTION_DIALOG_ICON_TYPE_ICON_TYPE_COMMON = 18; +} + +enum GoalMessageSource { + GOAL_MESSAGE_SOURCE_UNKNOWN = 0; + GOAL_MESSAGE_SOURCE_COMMIT = 1; + GOAL_MESSAGE_SOURCE_PROGRESS_UPDATE = 2; + GOAL_MESSAGE_SOURCE_PIN = 3; + GOAL_MESSAGE_SOURCE_UNPIN = 4; + GOAL_MESSAGE_SOURCE_REVIEW_CALLBACK = 5; + GOAL_MESSAGE_SOURCE_SUSPEND = 6; + GOAL_MESSAGE_SOURCE_CHALLENGE_PROMPT = 7; +} + +enum ExhibitionType { + EXHIBITION_TYPE_DEFAULT = 0; + EXHIBITION_TYPE_FOLD = 1; + EXHIBITION_TYPE_PUBLIC_SCREEN = 2; +} + +enum GiftSource { + GIFT_SOURCE_UNKNOWN = 0; + GIFT_SOURCE_PLATFORM = 1; + GIFT_SOURCE_USER_BUY_RANDOM = 2; + GIFT_SOURCE_USER_BUY_SPECIFIC = 3; +} + +enum MessageDisplayStyle { + MESSAGE_DISPLAY_STYLE_DEFAULT = 0; + MESSAGE_DISPLAY_STYLE_POPUP = 1; +} + +enum ProfitRankType { + PROFIT_RANK_TYPE_TYPE_HOURLY_RANK = 0; + PROFIT_RANK_TYPE_TYPE_WEEKLY_RANK = 1; + PROFIT_RANK_TYPE_TYPE_HOURLY_STAR_RANK = 2; + PROFIT_RANK_TYPE_TYPE_WEEKLY_RISING_RANK_ACTIVITY = 3; + PROFIT_RANK_TYPE_TYPE_WEEKLY_RISING_RANK = 4; + PROFIT_RANK_TYPE_TYPE_WEEKLY_ROOKIE = 5; + PROFIT_RANK_TYPE_TYPE_E_COMMERCE_WEEKLY = 6; + PROFIT_RANK_TYPE_TYPE_E_COMMERCE_DAILY = 7; + PROFIT_RANK_TYPE_TYPE_DAILY_RANK = 8; + PROFIT_RANK_TYPE_TYPE_FIRST_GIFT_RANK = 9; + PROFIT_RANK_TYPE_TYPE_GAME_RANK = 10; + PROFIT_RANK_TYPE_TYPE_DAILY_GAME = 11; + PROFIT_RANK_TYPE_TYPE_HALL_OF_FAME_RANK = 12; + PROFIT_RANK_TYPE_TYPE_RANK_LEAGUE = 13; + PROFIT_RANK_TYPE_DAILY_ROOKIE = 14; + PROFIT_RANK_TYPE_TYPE_TEAM_RANK = 15; + PROFIT_RANK_TYPE_TYPE_CLASS_RANK = 16; + PROFIT_RANK_TYPE_TYPE_DAILY_GAME_PUB_G = 20; + PROFIT_RANK_TYPE_TYPE_DAILY_GAME_MLB_B = 21; + PROFIT_RANK_TYPE_TYPE_DAILY_GAME_FREE_FIRE = 22; + PROFIT_RANK_TYPE_TYPE_WEEKLY_GAME_SUBCATEGORY_ONE = 23; + PROFIT_RANK_TYPE_TYPE_WEEKLY_GAME_SUBCATEGORY_TWO = 24; + PROFIT_RANK_TYPE_TYPE_WEEKLY_GAME_SUBCATEGORY_THREE = 25; +} + +enum UnionAnimationInfoType { + UNION_ANIMATION_INFO_TYPE_NO_UNION_ANIMATION = 0; + UNION_ANIMATION_INFO_TYPE_LOOP = 1; + UNION_ANIMATION_INFO_TYPE_LOCK = 2; +} + +enum DisplayStyle { + DISPLAY_STYLE_NORMAL = 0; + DISPLAY_STYLE_STAY = 1; + DISPLAY_STYLE_CHAT = 2; +} + +enum HitABStatus { + HIT_A_B_STATUS_HIT_AB_STATUS_NO_HIT = 0; + HIT_A_B_STATUS_HIT_AB_STATUS_ENTER_FROM_EXTERNAL_LINK_NEW_TEXT = 1; + HIT_A_B_STATUS_HIT_AB_STATUS_ENTER_FROM_RE_POST_NEW_TEXT = 2; +} + +enum PollKind { + POLL_KIND_NORMAL = 0; + POLL_KIND_GIFT = 1; + POLL_KIND_CUSTOMIZABLE = 2; + POLL_KIND_CUSTOMIZABLE_GIFT = 3; + POLL_KIND_QUICK_GIFT = 4; + POLL_KIND_EMOTE = 5; +} + +enum PollTemplateStatus { + POLL_TEMPLATE_STATUS_TO_BE_REVIEWED = 0; + POLL_TEMPLATE_STATUS_UNDER_REVIEW = 1; + POLL_TEMPLATE_STATUS_REVIEWED = 2; + POLL_TEMPLATE_STATUS_REFUSED = 3; +} + +enum PollAppealStatus { + POLL_APPEAL_STATUS_UNKNOWN = 0; + POLL_APPEAL_STATUS_PASS = 1; + POLL_APPEAL_STATUS_FAIL = 2; +} + +enum RankTestMessageScene { + RANK_TEST_MESSAGE_SCENE_UNKNOWN = 0; + RANK_TEST_MESSAGE_SCENE_ONLINE_AUDIENCE_TOP_N_UPDATE_PUBLIC_SCREEN = 1; +} + +enum TriggerReason { + TRIGGER_REASON_UNKNOWN = 0; + TRIGGER_REASON_SCORE_UPDATE = 1; + TRIGGER_REASON_BATTLE_END = 2; + TRIGGER_REASON_OPT_OUT_UPDATE = 3; + TRIGGER_REASON_KEEP_ALIVE = 4; +} + +enum Reason { + REASON_TIME_UP = 0; + REASON_CUT_SHORT = 1; +} + +enum BattleTaskMessageType { + BATTLE_TASK_MESSAGE_TYPE_START = 0; + BATTLE_TASK_MESSAGE_TYPE_TASK_UPDATE = 1; + BATTLE_TASK_MESSAGE_TYPE_TASK_SETTLE = 2; + BATTLE_TASK_MESSAGE_TYPE_REWARD_SETTLE = 3; +} + +enum RewardStatus { + REWARD_STATUS_SUCCEED = 0; + REWARD_STATUS_FAILED = 1; +} + +enum BattleAction { + BATTLE_ACTION_UNKNOWN = 0; + BATTLE_ACTION_INVITE = 1; + BATTLE_ACTION_REJECT = 2; + BATTLE_ACTION_CANCEL = 3; + BATTLE_ACTION_OPEN = 4; + BATTLE_ACTION_FINISH = 5; + BATTLE_ACTION_CUT_SHORT = 6; + BATTLE_ACTION_ACCEPT = 7; + BATTLE_ACTION_QUIT_APPLY = 8; + BATTLE_ACTION_DECLINE_QUIT = 9; + BATTLE_ACTION_DECLINE_OFF_QUIT = 10; + BATTLE_ACTION_LEAVE_LINK_MIC = 11; +} + +enum Result { + RESULT_WIN = 0; + RESULT_LOSE = 1; + RESULT_DRAW = 2; +} + +enum GiftPermissionType { + GIFT_PERMISSION_TYPE_UNKNOWN_TYPE = 0; + GIFT_PERMISSION_TYPE_NO_GIFT_PERMISSION = 1; + GIFT_PERMISSION_TYPE_ANCHOR_CLOSE = 2; + GIFT_PERMISSION_TYPE_HAS_GIFT_PERMISSION = 3; + GIFT_PERMISSION_TYPE_ANCHOR_BANNED = 4; +} + +enum BattleABTestType { + BATTLE_A_B_TEST_TYPE_UNKNOWN_AB_TEST_TYPE = 0; + BATTLE_A_B_TEST_TYPE_MEANWHILE_INVITE = 1; + BATTLE_A_B_TEST_TYPE_SPECIFIED_GIFT = 2; + BATTLE_A_B_TEST_TYPE_RT_C_MESSAGE_CHANNEL = 3; + BATTLE_A_B_TEST_TYPE_CONNECTION_TIME_OUT = 4; + BATTLE_A_B_TEST_TYPE_REMATCH_SKIP_TEAMMATE = 5; + BATTLE_A_B_TEST_TYPE_OPT_INVITEE_4048 = 6; + BATTLE_A_B_TEST_TYPE_BATTLE_AB_TEST_TYPE_TIME_CALIBRATE = 7; +} + +enum PlayScene { + PLAY_SCENE_UNKNOWN = 0; + PLAY_SCENE_COUNTDOWN_FOR_ALL = 1; + PLAY_SCENE_COUNTDOWN_FOR_SINGLE = 2; + PLAY_SCENE_LIVE_SHOW = 3; + PLAY_SCENE_AIG_C = 4; + PLAY_SCENE_KARAOKE = 5; + PLAY_SCENE_DRAW_GUESS = 6; + PLAY_SCENE_ENLARGE_GRID = 7; + PLAY_SCENE_GIFT_PRIORITY_LINK = 8; + PLAY_SCENE_GIFT_THRESHOLD_LINK = 9; + PLAY_SCENE_NOTICE_BOARD = 10; + PLAY_SCENE_PLAY_BOOK = 11; + PLAY_SCENE_GUEST_SHOWDOWN = 12; +} + +enum LinkType { + LINK_TYPE_TYPE_UNKNOWN = 0; + LINK_TYPE_TYPE_VIDEO = 1; + LINK_TYPE_TYPE_AUDIO = 2; + LINK_TYPE_TYPE_VIRTUAL = 3; +} + +enum LinkSilenceStatus { + LINK_SILENCE_STATUS_STATUS_UN_SILENCE = 0; + LINK_SILENCE_STATUS_STATUS_SILENCE_BY_SELF = 1; + LINK_SILENCE_STATUS_STATUS_SILENCE_BY_OWNER = 2; +} + +enum LinkmicRoleType { + LINKMIC_ROLE_TYPE_ROLE_TYPE_UNKOWN = 0; + LINKMIC_ROLE_TYPE_LEADER = 1; + LINKMIC_ROLE_TYPE_PLAYER = 2; + LINKMIC_ROLE_TYPE_INVITEE = 3; +} + +enum LinkRoleType { + LINK_ROLE_TYPE_TYPE_ROLE_TYPE_UNKOWN = 0; + LINK_ROLE_TYPE_TYPE_LEADER = 1; + LINK_ROLE_TYPE_TYPE_PLAYER = 2; + LINK_ROLE_TYPE_TYPE_INVITEE = 3; + LINK_ROLE_TYPE_TYPE_APPLIER = 4; +} + +enum MuteStatus { + MUTE_STATUS_MUTE = 0; + MUTE_STATUS_UN_MUTE = 1; +} + +enum GuestMicCameraManageOp { + GUEST_MIC_CAMERA_MANAGE_OP_OPEN_MIC = 0; + GUEST_MIC_CAMERA_MANAGE_OP_OPEN_CAMERA = 1; + GUEST_MIC_CAMERA_MANAGE_OP_CLOSE_MIC = 2; + GUEST_MIC_CAMERA_MANAGE_OP_CLOSE_CAMERA = 3; + GUEST_MIC_CAMERA_MANAGE_OP_CLOSE_MIC_PUNISH = 4; +} + +enum GuestMicCameraChangeScene { + GUEST_MIC_CAMERA_CHANGE_SCENE_CHANGE_SCENE_UNKNOWN = 0; + GUEST_MIC_CAMERA_CHANGE_SCENE_LIVE_SHOW_BY_ANCHOR_AUTO = 1; + GUEST_MIC_CAMERA_CHANGE_SCENE_LIVE_SHOW_BY_SERVER_NORMAL = 2; + GUEST_MIC_CAMERA_CHANGE_SCENE_LIVE_SHOW_BY_SHOW_END = 3; +} + +enum LinkMicUserAdminType { + LINK_MIC_USER_ADMIN_TYPE_UNDEFINED_TYPE = 0; + LINK_MIC_USER_ADMIN_TYPE_MANAGER_TYPE = 1; + LINK_MIC_USER_ADMIN_TYPE_HOST_TYPE = 2; +} + +enum LinkmicMultiLiveEnum { + LINKMIC_MULTI_LIVE_ENUM_DEFAULT = 0; + LINKMIC_MULTI_LIVE_ENUM_ANCHOR_USE_NEW_LAYOUT = 1; +} + +enum PollEndType { + POLL_END_TYPE_POLL_END_BY_TIME = 0; + POLL_END_TYPE_POLL_END_BY_OWNER = 1; + POLL_END_TYPE_POLL_END_BY_OTHER = 2; + POLL_END_TYPE_POLL_END_BY_ADMIN = 3; +} + +enum CohostABTestType { + COHOST_A_B_TEST_TYPE_COHOST_AB_TEST_TYPE_UNKNOWN = 0; + COHOST_A_B_TEST_TYPE_COHOST_AB_TEST_TYPE_LINK_TIME_OUT_STRATEGY = 1; + COHOST_A_B_TEST_TYPE_COHOST_AB_TEST_TYPE_COHOST_RESERVATION = 2; + COHOST_A_B_TEST_TYPE_COHOST_AB_TEST_TYPE_QUICK_PAIR_NEW_ARCH_SWITCH = 3; + COHOST_A_B_TEST_TYPE_COHOST_AB_TEST_TYPE_COHOST_INVITATION_TEXT = 4; +} + +enum OptPairStatus { + OPT_PAIR_STATUS_UNKNOWN = 0; + OPT_PAIR_STATUS_OFFLINE = 1; + OPT_PAIR_STATUS_FINISHED = 2; +} + +enum ContentPositionType { + CONTENT_POSITION_TYPE_UNKNOWN = 0; + CONTENT_POSITION_TYPE_STREAM = 1; + CONTENT_POSITION_TYPE_LIVE_STUDIO_STREAM_PORTRAIT = 2; + CONTENT_POSITION_TYPE_LIVE_STUDIO_STREAM_LANDSCAPE = 3; +} + +enum MultiGuestOutsideRoomInviteSource { + MULTI_GUEST_OUTSIDE_ROOM_INVITE_SOURCE_OUTSIDE_ROOM_INVITE_SOURCE_UNKNOWN = 0; + MULTI_GUEST_OUTSIDE_ROOM_INVITE_SOURCE_OUTSIDE_ROOM_INVITE_SOURCE_PANEL = 1; + MULTI_GUEST_OUTSIDE_ROOM_INVITE_SOURCE_OUTSIDE_ROOM_INVITE_SOURCE_CAPSULE = 2; + MULTI_GUEST_OUTSIDE_ROOM_INVITE_SOURCE_OUTSIDE_ROOM_INVITE_SOURCE_EMPTY_POSITION = 3; +} + +enum LinkUserType { + LINK_USER_TYPE_DEFAULT = 0; + LINK_USER_TYPE_KARAOKE = 1; +} + +enum ContentInviteSource { + CONTENT_INVITE_SOURCE_INVITE_SOURCE_UNKNOWN = 0; + CONTENT_INVITE_SOURCE_INVITE_SOURCE_PANEL_GO_LIVE = 1; + CONTENT_INVITE_SOURCE_INVITE_SOURCE_MUTUAL_NOTICE = 2; + CONTENT_INVITE_SOURCE_INVITE_SOURCE_USER_PROFILE = 3; + CONTENT_INVITE_SOURCE_INVITE_SOURCE_RESERVE = 4; +} + +enum LinkmicShareRevenueSetting { + LINKMIC_SHARE_REVENUE_SETTING_LINK_MIC_SHARE_REVENUE_NOT_SET = 0; + LINKMIC_SHARE_REVENUE_SETTING_LINK_MIC_SHARE_REVENUE_OPEN = 1; + LINKMIC_SHARE_REVENUE_SETTING_LINK_MIC_SHARE_REVENUE_CLOSE = 2; +} + +enum PosIdentityType { + POS_IDENTITY_TYPE_IDENTITY_EMPTY_SLOT = 0; + POS_IDENTITY_TYPE_IDENTITY_RT_C_USER_ID = 1; + POS_IDENTITY_TYPE_IDENTITY_RT_C_STREAM_ID = 2; + POS_IDENTITY_TYPE_IDENTITY_LIVE_USER_ID = 3; +} + +enum JoinType { + JOIN_TYPE_UNKNOWN = 0; + JOIN_TYPE_CHANNEL_APPLY = 1; + JOIN_TYPE_CHANNEL_INVITE = 2; + JOIN_TYPE_GROUP_APPLY = 100; + JOIN_TYPE_GROUP_APPLY_FOLLOW = 101; + JOIN_TYPE_GROUP_INVITE = 102; + JOIN_TYPE_GROUP_INVITE_FOLLOW = 103; + JOIN_TYPE_GROUP_OWNER_JOIN = 104; +} + +enum CohostLayoutMode { + COHOST_LAYOUT_MODE_NORMAL = 0; + COHOST_LAYOUT_MODE_SCREEN_SHARE = 1; +} + +enum TagClassification { + TAG_CLASSIFICATION_UNKNOWN = 0; + TAG_CLASSIFICATION_COHOST_HISTORY = 1; + TAG_CLASSIFICATION_FIRST_DEGREE_RELATION = 2; + TAG_CLASSIFICATION_SECOND_DEGREE_RELATION = 3; + TAG_CLASSIFICATION_RANK = 4; + TAG_CLASSIFICATION_SIMILAR_INTERESTS = 5; +} + +enum SourceType { + SOURCE_TYPE_UNKNOWN = 0; + SOURCE_TYPE_FRIEND_LIST = 1; + SOURCE_TYPE_RECOMMEND_LIST = 2; + SOURCE_TYPE_RECENT = 3; + SOURCE_TYPE_OTHER_FOLLOW = 4; + SOURCE_TYPE_QUICK_PAIR = 5; + SOURCE_TYPE_ACTIVITY = 6; + SOURCE_TYPE_QUICK_RECOMMEND = 7; + SOURCE_TYPE_OFFICIAL_CHANNEL = 8; + SOURCE_TYPE_BEST_TEAMMATE = 9; + SOURCE_TYPE_RESERVATION = 10; + SOURCE_TYPE_PAIRING = 11; + SOURCE_TYPE_PAIRING_ON_RESERVATION = 12; + SOURCE_TYPE_TOPIC_QUICK_PAIR = 13; + SOURCE_TYPE_TOPIC_QUICK_RECOMMEND = 14; + SOURCE_TYPE_ONLINE_FRIEND_CAPSULE = 15; + SOURCE_TYPE_WEEKLY_RANK = 20; + SOURCE_TYPE_HOURLY_RANK = 21; + SOURCE_TYPE_WEEKLY_RISING = 23; + SOURCE_TYPE_WEEKLY_ROOKIE = 24; + SOURCE_TYPE_CONNECTION_LIST = 25; + SOURCE_TYPE_DAILY_RANK = 26; + SOURCE_TYPE_DAILY_RANK_HALL_OF_FAME = 27; + SOURCE_TYPE_RESERVATION_BUBBLE = 28; + SOURCE_TYPE_PAIRING_BUBBLE = 29; + SOURCE_TYPE_LEAGUE_PHASE_ONE = 30; + SOURCE_TYPE_LEAGUE_PHASE_TWO = 31; + SOURCE_TYPE_LEAGUE_PHASE_THREE = 32; + SOURCE_TYPE_DAILY_ROOKIE = 33; + SOURCE_TYPE_MAY_KNOW_LIST = 34; + SOURCE_TYPE_BANNER = 35; + SOURCE_TYPE_FANS_TEAM_RANK = 36; + SOURCE_TYPE_SEARCH = 37; + SOURCE_TYPE_E_OY_RANK_LIST = 38; + SOURCE_TYPE_LEAGUE_CAMPAIGN_RANK = 39; + SOURCE_TYPE_CREATOR_CLASS_RANK = 40; + SOURCE_TYPE_HISTORY = 41; + SOURCE_TYPE_QUICK_RECOMMEND_DURING_COHOST = 43; +} + +enum BattleType { + BATTLE_TYPE_UNKNOWN_BATTLE_TYPE = 0; + BATTLE_TYPE_NORMAL_BATTLE = 1; + BATTLE_TYPE_TEAM_BATTLE = 2; + BATTLE_TYPE_INDIVIDUAL_BATTLE = 3; + BATTLE_TYPE_1_V_N = 4; + BATTLE_TYPE_TAKE_THE_STAGE = 51; + BATTLE_TYPE_GROUP_SHOW = 52; +} + +enum BattleInviteType { + BATTLE_INVITE_TYPE_NORMAL = 0; + BATTLE_INVITE_TYPE_AGAIN = 1; } \ No newline at end of file diff --git a/API/src/main/proto/webcast.proto b/API/src/main/proto/webcast.proto index 580e942..e6298bc 100644 --- a/API/src/main/proto/webcast.proto +++ b/API/src/main/proto/webcast.proto @@ -29,8 +29,8 @@ message WebcastPushFrame { //@WebcastResponse // Response from TikTokServer. Container for Messages -message WebcastResponse { - repeated Message messages = 1; +message ProtoMessageFetchResult { + repeated BaseProtoMessage messages = 1; string cursor = 2; int64 fetchInterval = 3; int64 now = 4; @@ -45,7 +45,7 @@ message WebcastResponse { bool historyNoMore = 13; // Server-Message. Binary will deserialize into specific message - message Message { + message BaseProtoMessage { string method = 1; bytes payload = 2; int64 msgId = 3; @@ -57,7 +57,7 @@ message WebcastResponse { //@GiftMessage message WebcastGiftMessage { - Common common = 1; + CommonMessageData common = 1; int64 giftId = 2; int64 fanTicketCount = 3; int32 groupCount = 4; @@ -66,23 +66,52 @@ message WebcastGiftMessage { User user = 7; User toUser = 8; int32 repeatEnd = 9; + TextEffect text_effect = 10; int64 groupId = 11; int64 incomeTaskgifts = 12; int64 roomFanTicketCount = 13; - GiftStruct gift = 15; + GiftIMPriority priority = 14; + Gift gift = 15; string logId = 16; int64 sendType = 17; + PublicAreaCommon public_area_common = 18; + Text tray_display_text = 19; + int64 banned_display_effects = 20; + GiftTrayInfo m_tray_info = 21; string monitorExtra = 22; + GiftMonitorInfo gift_monitor_info = 23; int64 colorId = 24; bool isFirstSent = 25; + Text display_text_for_anchor = 26; + Text display_text_for_audience = 27; string orderId = 28; + GiftsBoxInfo gifts_in_box = 29; + MsgFilter msg_filter = 30; + repeated LynxGiftExtra lynx_extra = 31; UserIdentity userIdentity = 32; - UserGiftReciever userGiftReciever = 23; + MatchInfo match_info = 33; + LinkmicGiftExpressionStrategy linkmic_gift_expression_strategy = 34; + FlyingMicResources flying_mic_resources = 35; + bool disable_gift_tracking = 36; + AssetsModel asset = 37; + GiftMessageVersion version = 38; + repeated SponsorshipInfo sponsorship_info = 39; + FlyingMicResources flying_mic_resources_v2 = 40; + PublicAreaMessageCommon public_area_message_common = 41; + string signature = 42; + string signature_version = 43; + bool multi_generate_message = 44; + string to_member_id = 45; + int64 to_member_id_int = 46; + string to_member_nickname = 47; + InteractiveGiftInfo interactive_gift_info = 48; - message UserGiftReciever - { - int64 userId = 1; - string deviceName = 10; + message InteractiveGiftInfo { + int64 cross_screen_delay = 1; + int64 cross_screen_role = 2; + GiftMessageIgnoreConfig ignore_config = 3; + int64 uniq_id = 4; + int64 to_user_team_id = 5; } message GiftIMPriority { @@ -91,42 +120,292 @@ message WebcastGiftMessage { int64 priority = 3; } - message PublicAreaCommon { - Image userLabel = 1; - int64 userConsumeInRoom = 2; + message TextEffect { + Detail portrait_detail = 1; + Detail landscape_detail = 2; + + message Detail { + Text text = 1; + int32 text_font_size = 2; + Image background = 3; + int64 start = 4; + int64 duration = 5; + int32 x = 6; + int32 y = 7; + int32 width = 8; + int32 height = 9; + int32 shadow_dx = 10; + int32 shadow_dy = 11; + int32 shadow_radius = 12; + string shadow_color = 13; + string stroke_color = 14; + int32 stroke_width = 15; + } + } + + message GiftTrayInfo { + Image m_dynamic_img = 1; + bool can_mirror = 2; + Image tray_normal_bg_img = 3; + repeated string tray_normal_bg_color = 4; + Image tray_small_bg_img = 5; + repeated string tray_small_bg_color = 6; + Text right_tag_text = 7; + Image right_tag_bg_img = 8; + repeated string right_tag_bg_color = 9; + string tray_name_text_color = 10; + string tray_desc_text_color = 11; + string right_tag_jump_schema = 12; + } + + message GiftMonitorInfo { + int64 anchor_id = 1; + int64 profit_api_message_dur = 2; + int64 send_gift_profit_api_start_ms = 3; + int64 send_gift_profit_core_start_ms = 4; + int64 send_gift_req_start_ms = 5; + int64 send_gift_send_message_success_ms = 6; + int64 send_profit_api_dur = 7; + int64 to_user_id = 8; + int64 send_gift_start_client_local_ms = 9; + string from_platform = 10; + string from_version = 11; + } + + message MatchInfo { + int64 critical = 1; + bool effect_card_in_use = 2; + MultiplierType multiplier_type = 3; + int64 multiplier_value = 4; + } + + message GiftsBoxInfo { + repeated GiftInfoInBox gifts = 1; + + message GiftInfoInBox { + int64 gift_id = 1; + int64 effect_id = 2; + int64 color_id = 3; + int32 remain_times = 4; + AssetsModel asset = 5; + + message AssetsModel { + string name = 1; + string resource_uri = 2; + ResourceModel resource_model = 4; + string describe = 5; + int64 id = 6; + int32 resource_type = 7; + string md5 = 8; + int64 size = 9; + LokiExtraContent loki_extra_content = 10; + int32 download_type = 26; + ResourceModel resource_byte_v_c1_model = 28; + string bytevc1_md5 = 29; + repeated VideoResource video_resource_list = 30; + FaceRecognitionMeta face_recognition_archive_meta = 31; + string lynx_url_settings_key = 32; + int32 downgrade_resource_type = 33; + AssetExtra asset_extra = 34; + int32 sticker_asset_variant = 35; + bool immediate_download = 36; + int32 sticker_asset_variant_reason = 37; + + message AssetExtra { + string effect_starling_key = 1; + } + + message ResourceModel { + repeated string url_list = 1; + string uri = 2; + } + + message LokiExtraContent { + string gift_type = 1; + int64 gift_duration = 2; + bool need_screen_shot = 3; + bool ismulti_frame = 4; + string view_overlay = 5; + BEFViewRenderSize bef_view_render_size = 6; + int32 bef_view_render_f_p_s = 7; + int32 bef_view_fit_mode = 8; + string model_names = 9; + repeated string requirements = 10; + + message BEFViewRenderSize { + int32 with = 1; + int32 height = 2; + } + } + + message VideoResource { + string video_type_name = 1; + ResourceModel video_url = 2; + string video_md5 = 3; + } + + message FaceRecognitionMeta { + string version = 1; + repeated string requirements = 2; + string model_names = 3; + string sdk_extra = 4; + } + } + } + } + + message AssetsModel { + string name = 1; + string resource_uri = 2; + ResourceModel resource_model = 4; + string describe = 5; + int64 id = 6; + int32 resource_type = 7; + string md5 = 8; + int64 size = 9; + LokiExtraContent loki_extra_content = 10; + int32 download_type = 26; + ResourceModel resource_byte_v_c1_model = 28; + string bytevc1_md5 = 29; + repeated VideoResource video_resource_list = 30; + FaceRecognitionMeta face_recognition_archive_meta = 31; + string lynx_url_settings_key = 32; + int32 downgrade_resource_type = 33; + AssetExtra asset_extra = 34; + int32 sticker_asset_variant = 35; + bool immediate_download = 36; + int32 sticker_asset_variant_reason = 37; + + message AssetExtra { + string effect_starling_key = 1; + } + + message ResourceModel { + repeated string url_list = 1; + string uri = 2; + } + + message LokiExtraContent { + string gift_type = 1; + int64 gift_duration = 2; + bool need_screen_shot = 3; + bool ismulti_frame = 4; + string view_overlay = 5; + BEFViewRenderSize bef_view_render_size = 6; + int32 bef_view_render_f_p_s = 7; + int32 bef_view_fit_mode = 8; + string model_names = 9; + repeated string requirements = 10; + + message BEFViewRenderSize { + int32 with = 1; + int32 height = 2; + } + } + + message VideoResource { + string video_type_name = 1; + ResourceModel video_url = 2; + string video_md5 = 3; + } + + message FaceRecognitionMeta { + string version = 1; + repeated string requirements = 2; + string model_names = 3; + string sdk_extra = 4; + } + } + + message LynxGiftExtra { + int64 id = 1; + int64 code = 2; + int64 type = 3; + repeated string params = 4; + string extra = 5; + } + + message FlyingMicResources { + Image path_image = 1; + Image mic_image = 2; + repeated TransitionConfig transition_configs = 3; + + message TransitionConfig { + int64 config_id = 1; + Image resource_image = 2; + } + } + + message SponsorshipInfo { + int64 gift_id = 1; + int64 sponsor_id = 2; + bool light_gift_up = 3; + string unlighted_gift_icon = 4; + string gift_gallery_detail_page_scheme_url = 5; + bool gift_gallery_click_sponsor = 6; + bool become_all_sponsored = 21; } } //@RoomMessage -message RoomMessage { - Common common = 1; +/*message RoomMessage { + CommonMessageData common = 1; string content = 2; - bool supprotLandscape = 3; + bool supportLandscape = 3; int64 source = 4; Image icon = 5; - string scene = 6; + Scene scene = 6; bool isWelcome = 7; -} + PublicAreaMessageCommon public_area_common = 8; + int64 show_duration_ms = 9; + string sub_scene = 10; +}*/ //@WebcastRoomMessage message WebcastRoomMessage { - Common common = 1; + CommonMessageData common = 1; string content = 2; + bool supportLandscape = 3; + int64 source = 4; + Image icon = 5; + Scene scene = 6; + bool isWelcome = 7; + PublicAreaMessageCommon public_area_common = 8; + int64 show_duration_ms = 9; + string sub_scene = 10; } //@WebcastBarrageMessage message WebcastBarrageMessage { - Common common = 1; + CommonMessageData common = 1; BarrageEvent event = 2; - BarrageType msgType = 3; // Enum + BarrageType msgType = 3; Image icon = 4; Text content = 5; int32 duration = 6; Image background = 7; Image rightIcon = 8; + int32 display_config = 9; + int64 gallery_gift_id = 10; + Scene scene = 11; + DisplayControl control = 12; + RightLabel right_label = 13; + bool use_marquee = 14; + ShowType show_type = 15; + BadgeStruct badge = 16; + RenderType render_type = 17; + IconDisplayType left_icon_display_type = 18; + Image ribbon_animation = 19; + AnimationData animation_data = 20; + string hybrid_url = 21; + string schema = 22; + string sub_type = 23; + Text common_barrage_content = 24; BarrageTypeUserGradeParam userGradeParam = 100; BarrageTypeFansLevelParam fansLevelParam = 101; BarrageTypeSubscribeGiftParam subscribeGiftParam = 102; + PrivilegeLogExtra privilege_log_extra = 103; + BarrageTypeGiftGalleryParam gift_gallery_params = 104; message BarrageTypeUserGradeParam { int32 currentGrade = 1; @@ -146,6 +425,7 @@ message WebcastBarrageMessage { message BarrageEvent { string eventName = 1; + map params = 2; } // @BarrageType @@ -164,19 +444,56 @@ message WebcastBarrageMessage { FANSLEVELUPGRADE = 10; FANSLEVELENTRANCE = 11; GAMEPARTNERSHIP = 12; + GIFTGALLERY = 13; + ECOMBOUGHT = 14; + COMMONBARRAGE = 100; + } + + message AnimationData { + string gecko_channel_name = 1; + string file_name = 2; + int64 height = 3; + int64 width = 4; + int64 right_offset = 5; + } + + message BarrageTypeGiftGalleryParam { + int64 from_user_id = 1; + int64 to_user_id = 2; + } + + message DisplayControl { + int32 priority = 1; + int64 duration = 2; + map target_group_show_rst = 3; + HorizontalOnclickTriggerType horizontal_trigger_type = 4; + + message ShowResult { + bool banned = 1; + } + } + + message RightLabel { + string background_color = 1; + Text content = 2; + int64 height = 3; } } //@WebcastCaptionMessage // Closed Captioning for Video message WebcastCaptionMessage { - Common common = 1; - uint64 timeStamp = 2; - CaptionData captionData = 4; + CommonMessageData common = 1; + int64 timestamp_ms = 2; + int64 duration_ms = 3; + repeated CaptionContent content = 4; + int64 sentence_id = 5; + int64 sequence_id = 6; + bool definite = 7; - message CaptionData { - string language = 1; - string text = 2; + message CaptionContent { + string lang = 1; + string content = 2; } } @@ -185,22 +502,30 @@ message WebcastCaptionMessage { // Comment sent by User //@WebcastChatMessage message WebcastChatMessage { - Common common = 1; + CommonMessageData common = 1; User user = 2; string content = 3; bool visibleToSender = 4; Image backgroundImage = 5; string fullScreenTextColor = 6; Image backgroundImageV2 = 7; + PublicAreaCommon public_area_common = 9; Image giftImage = 10; int32 inputType = 11; User atUser = 12; repeated EmoteWithIndex emotesList = 13; string contentLanguage = 14; + MsgFilter msg_filter = 15; int32 quickChatScene = 16; int32 communityFlaggedStatus = 17; UserIdentity UserIdentity = 18; - map CommentQualityScores = 19; + repeated CommentQualityScore comment_quality_scores = 19; + CommentTag comment_tag = 20; + PublicAreaMessageCommon public_area_message_common = 21; + int64 screen_time = 22; + string signature = 23; + string signature_version = 24; + string ec_streamer_key = 25; // @EmoteWithIndex // proto.webcast.im.ChatMessage @@ -208,16 +533,21 @@ message WebcastChatMessage { int64 index = 1; Emote emote = 2; } + + message CommentQualityScore { + string version = 1; + int64 score = 2; + } } // System-Control Message from Room (e.g. Host ended Stream) //@WebcastControlMessage message WebcastControlMessage { - Common common = 1; + CommonMessageData common = 1; ControlAction action = 2; string tips = 3; Extra extra = 4; - //PerceptionDialogInfo perceptionDialog = 5; + PerceptionDialogInfo perceptionDialog = 5; Text perceptionAudienceText = 6; PunishEventInfo punishInfo = 7; Text floatText = 8; @@ -235,12 +565,34 @@ message WebcastControlMessage { Text banDetailButton = 7; string source = 8; } + + message PerceptionDialogInfo { + PerceptionDialogIconType icon_type = 1; + Text title = 2; + Text sub_title = 3; + Text advice_action_text = 4; + Text default_action_text = 5; + string violation_detail_url = 6; + Scene scene = 7; + int64 target_user_id = 8; + int64 target_room_id = 9; + int64 count_down_time = 10; + bool show_feedback = 11; + repeated PerceptionFeedbackOption feedback_options = 12; + int64 policy_tip = 13; + int32 appeal_popup = 14; + + message PerceptionFeedbackOption { + int64 id = 1; + string content_key = 2; + } + } } // Emote sent by user //@WebcastEmoteChatMessage message WebcastEmoteChatMessage { - Common common = 1; + CommonMessageData common = 1; User user = 2; repeated Emote emoteList = 3; MsgFilter msgFilter = 4; @@ -249,9 +601,9 @@ message WebcastEmoteChatMessage { //@WebcastEnvelopeMessage message WebcastEnvelopeMessage { - Common common = 1; + CommonMessageData common = 1; EnvelopeInfo envelopeInfo = 2; - EnvelopeDisplay display = 3; // @warning Enum not found, should be Display + EnvelopeDisplay display = 3; // @EnvelopeInfo // proto.webcast.im.EnvelopeMessage @@ -274,49 +626,107 @@ message WebcastEnvelopeMessage { //@WebcastGoalUpdateMessage message WebcastGoalUpdateMessage { - Common common = 1; - Indicator indicator = 2; - Goal goal = 3; + CommonMessageData common = 1; + LiveStreamGoalIndicator indicator = 2; + LiveStreamGoal goal = 3; int64 contributorId = 4; Image contributorAvatar = 5; string contributorDisplayId = 6; - // SubGoal contributeSubgoal = 7; + LiveStreamSubGoal contributeSubgoal = 7; int64 contributeCount = 9; int64 contributeScore = 10; int64 giftRepeatCount = 11; string contributorIdStr = 12; bool pin = 13; bool unpin = 14; - // GoalPinInfo pinInfo = 15; + GoalPinInfo pinInfo = 15; + GoalMessageSource update_source = 16; + string goal_extra = 17; + + message LiveStreamSubGoal { + int32 type = 1; + int64 id = 2; + int64 progress = 3; + int64 target = 4; + LiveStreamSubGoalGift gift = 5; + string id_str = 6; + SubGoalPinInfo pin_info = 7; + int32 source = 8; + string recommended_text = 9; + string recommended_header = 10; + + message LiveStreamSubGoalGift { + string name = 1; + Image icon = 2; + int64 diamond_count = 3; + int32 type = 4; + } + + message SubGoalPinInfo { + int64 pin_start_time = 1; + int64 pin_end_time = 2; + int64 pin_ready_time = 3; + } + } + + message GoalPinInfo { + bool pin = 1; + bool unpin = 2; + int64 pin_end_time = 3; + int64 sub_goal_id = 4; + string sub_goal_id_str = 5; + } } // Message related to Chat-moderation? //@WebcastImDeleteMessage message WebcastImDeleteMessage { - Common common = 1; + CommonMessageData common = 1; repeated int64 deleteMsgIdsList = 2; repeated int64 deleteUserIdsList = 3; } //@WebcastInRoomBannerMessage message WebcastInRoomBannerMessage { - Common header = 1; - string json = 2; // Json-Data for BannerMessage + CommonMessageData header = 1; + map extra = 2; + int32 position = 3; + int32 action_type = 4; } // User sent one or multiple likes to Stream. Maxes at 15 likes per message //@WebcastLikeMessage message WebcastLikeMessage { - Common common = 1; + CommonMessageData common = 1; int32 count = 2; int32 total = 3; + int32 color = 4; User user = 5; + string icon = 6; + repeated Image icons = 7; + repeated SpecifiedDisplayText specified_display_text = 8; + int64 effect_cnt = 9; + repeated LikeEffect like_effect = 10; + PublicAreaMessageCommon public_area_message_common = 11; + int64 room_message_heat_level = 12; + + message SpecifiedDisplayText { + int64 uid = 1; + Text display_text = 2; + } + + message LikeEffect { + int64 version = 1; + int64 effect_cnt = 2; + int64 effect_interval_ms = 3; + int64 level = 4; + } } // Status of Room (ViewerCount + Top Viewers) //@WebcastRoomUserSeqMessage message WebcastRoomUserSeqMessage { - Common common = 1; + CommonMessageData common = 1; repeated Contributor ranksList = 2; int64 total = 3; string popStr = 4; @@ -337,7 +747,7 @@ message WebcastRoomUserSeqMessage { // Sent for a variety of events, including Follow & Share //@WebcastSocialMessage message WebcastSocialMessage { - Common common = 1; + CommonMessageData common = 1; User user = 2; int64 shareType = 3; int64 action = 4; @@ -345,35 +755,62 @@ message WebcastSocialMessage { int32 followCount = 6; int64 shareDisplayStyle = 7; int32 shareCount = 8; + PublicAreaMessageCommon public_area_message_common = 9; + string signature = 10; + string signature_version = 11; + int64 show_duration_ms = 12; } //@WebcastSubNotifyMessage message WebcastSubNotifyMessage { - Common common = 1; + CommonMessageData common = 1; User user = 2; - // ExhibitionType exhibitionType = 3; // Enum + ExhibitionType exhibitionType = 3; // Enum int64 subMonth = 4; SubscribeType subscribeType = 5; // Enum OldSubscribeStatus oldSubscribeStatus = 6; // Enum SubscribingStatus subscribingStatus = 8; // Enum bool isSend = 9; bool isCustom = 10; + GiftSource gift_source = 11; + MessageDisplayStyle message_display_style = 12; + PublicAreaMessageCommon public_area_message_common = 13; + string package_id = 14; + EventTracking event_tracking = 15; + message EventTracking { + int64 gift_sub_sender_id = 1; + int64 gift_sub_receiver_id = 2; + int64 anchor_id = 3; + int64 gift_sub_order_create_time = 4; + } } //@WebcastRankUpdateMessage message WebcastRankUpdateMessage { - Common common = 1; + CommonMessageData common = 1; repeated RankUpdate updatesList = 2; int64 groupType = 3; // @warning Enum not found, should be GroupType int64 priority = 5; repeated RankTabInfo tabsList = 6; bool isAnimationLoopPlay = 7; bool animationLoopForOff = 8; + repeated UnionAnimationInfo union_animation = 9; + repeated RankListTabInfo tab_info = 10; + message UnionAnimationInfo { + UnionAnimationInfoType union_type = 1; + ProfitRankType rank_type_array = 2; + int64 supported_version = 3; + } + + message RankListTabInfo { + repeated RankTabInfo tabs = 1; + int64 supported_version = 2; + } message RankTabInfo { - int64 rankType = 1; // @warning Enum not found, should be RankType + ProfitRankType rank_type = 1; string title = 2; Text titleText = 3; int64 listLynxType = 4; @@ -397,7 +834,7 @@ message WebcastRankUpdateMessage { // Sent for a variety of events, including Join & Subscribe //@WebcastMemberMessage message WebcastMemberMessage { - Common common = 1; + CommonMessageData common = 1; User user = 2; int32 memberCount = 3; User operator = 4; @@ -420,6 +857,18 @@ message WebcastMemberMessage { string clientLiveReason = 21; int64 actionDuration = 22; string userShareType = 23; + DisplayStyle display_style = 24; + map admin_permissions = 25; + int32 kick_source = 26; + int64 allow_preview_time = 27; + int64 last_subscription_action = 28; + PublicAreaMessageCommon public_area_message_common = 29; + int64 live_sub_only_tier = 30; + int64 live_sub_only_month = 31; + string ec_streamer_key = 32; + int64 show_wave = 33; + WaveAlgorithmData wave_algorithm_data = 34; + HitABStatus hit_ab_status = 35; // @EffectConfig // proto.webcast.im.MemberMessage @@ -436,41 +885,73 @@ message WebcastMemberMessage { repeated int64 flexSettingArrayList = 9; } + message WaveAlgorithmData { + string algorithm_version = 1; + bool is_alg_hit = 2; + string predict_score = 3; + bool is_rewatch = 4; + bool is_follow = 5; + } } - - - // --- HandMade -- //@WebcastPollMessage message WebcastPollMessage { - Common common = 1; + CommonMessageData common = 1; MessageType messageType = 2; int64 pollId = 3; PollStartContent startContent = 4; PollEndContent endContent = 5; PollUpdateVotesContent updateContent = 6; - int32 pollKind = 7; // Possibly an Enum? + PollKind pollKind = 7; + PollBasicInfo pollBasicInfo = 8; + TemplateContent templateContent = 9; + + message TemplateContent { + int64 template_id = 1; + string template_id_str = 2; + PollTemplateStatus status = 3; + PollKind poll_kind = 4; + PollAppealStatus appeal_status = 5; + string violation_id_str = 6; + } + + message PollBasicInfo { + string poll_sponsor = 1; + int64 gift_id = 2; + string title = 3; + bool is_suggested_question = 4; + int64 user_cnt = 5; + Gift gift = 6; + string poll_id_str = 7; + string suggested_question_key = 8; + int64 poll_duration = 9; + int64 time_remain = 10; + int64 poll_index = 11; + int64 template_id = 12; + } } //@WebcastQuestionNewMessage message WebcastQuestionNewMessage { - Common common = 1; - QuestionDetails details = 2; + CommonMessageData common = 1; + Question details = 2; - message QuestionDetails { - uint64 id = 1; - string text = 2; - uint64 timeStamp = 4; + message Question { + int64 question_id = 1; + string content = 2; + int32 answer_status = 3; + int64 create_time = 4; User user = 5; - uint32 data1 = 20; + int32 create_from = 20; + int32 answer_from = 21; } } //@WebcastRankTextMessage message WebcastRankTextMessage { - Common common = 1; - int32 scene = 2; + CommonMessageData common = 1; + RankTestMessageScene scene = 2; int64 ownerIdxBeforeUpdate = 3; int64 ownerIdxAfterUpdate = 4; Text selfGetBadgeMsg = 5; @@ -480,7 +961,7 @@ message WebcastRankTextMessage { //@WebcastHourlyRankMessage message WebcastHourlyRankMessage { - Common common = 1; + CommonMessageData common = 1; RankContainer data = 2; uint32 data2 = 3; @@ -515,153 +996,257 @@ message WebcastHourlyRankMessage { //@WebcastLinkMicArmies message WebcastLinkMicArmies { - Common common = 1; - uint64 id = 2; - repeated LinkMicArmiesItems battleItems = 3; - uint64 id2 = 4; - uint64 timeStamp1 = 5; - uint64 timeStamp2 = 6; - LinkMicBattleStatus battleStatus = 7; - uint64 data1 = 8; - uint64 data2 = 9; - uint32 data3 = 10; - Image Image = 11; - uint32 data4 = 12; - uint32 data5 = 13; + CommonMessageData common = 1; + int64 battle_id = 2; + map armies = 3; + int64 channel_id = 4; + int64 gift_sent_time = 5; + int64 score_update_time = 6; + TriggerReason trigger_reason = 7; + int64 from_user_id = 8; + int64 gift_id = 9; + int32 gift_count = 10; + Image gif_icon_image = 11; + int32 total_diamond_count = 12; + int32 repeat_count = 13; + repeated BattleTeamUserArmies team_armies = 14; + bool trigger_critical_strike = 15; + bool has_team_match_mvp_sfx = 16; + string log_id = 17; + BattleSetting battle_settings = 18; + HighScoreControlCfg fuzzy_display_config_v2 = 19; } //@WebcastLinkMicBattlePunishFinish message WebcastLinkMicBattlePunishFinish { - Common Header = 1; - uint64 Id1 = 2; - uint64 Timestamp = 3; - uint32 Data4 = 4; - uint64 Id2 = 5; - LinkMicBattlePunishFinishData Data6 = 6; - - message LinkMicBattlePunishFinishData { - uint64 Id2 = 1; // Same as Id2 in outer object (loser?) - uint64 Timestamp = 2; - uint32 Data3 = 3; - uint64 Id1 = 4; // Same as Id1 in outer object (winner?) - uint32 Data5 = 5; - uint32 Data6 = 6; - uint32 Data8 = 8; - } + CommonMessageData Header = 1; + int64 channel_id = 2; + int64 op_uid = 3; + Reason reason = 4; + int64 battle_id = 5; + BattleSetting battle_settings = 6; } //@WebcastLinkmicBattleTaskMessage message WebcastLinkmicBattleTaskMessage { - Common Header = 1; - uint32 Data2 = 2; - LinkmicBattleTaskData Data3 = 3; - LinkmicBattleTaskData2 Data5 = 5; + CommonMessageData Header = 1; + BattleTaskMessageType battle_task_message_type = 2; + BattleTaskStart task_start = 3; + BattleTaskUpdate task_update = 4; + BattleTaskSettle task_settle = 5; + BattleRewardSettle reward_settle = 6; + int64 battle_id = 20; - message LinkmicBattleTaskData { - BattleTaskData Data1 = 1; - } - message BattleTaskData { - uint32 Data1 = 1; + message BattlePrompt { + string prompt_key = 1; + repeated BattlePromptElem prompt_elements = 2; + + message BattlePromptElem { + string prompt_field_key = 1; + string prompt_field_value = 2; + } } - message LinkmicBattleTaskData2 { - uint32 Data1 = 1; - uint32 Data2 = 2; + message BattleTaskStart { + BattleBonusConfig battle_bonus_config = 1; + + message BattleBonusConfig { + int64 preview_start_time = 1; + repeated PreviewPeriod preview_period_config = 2; + TaskPeriodConfig task_period_config = 3; + RewardPeriodConfig reward_period_config = 4; + map task_gift_guide = 5; + int64 preview_start_timestamp = 6; + string preview_click_action_schema_url = 7; + + message PreviewPeriod { + int64 duration = 1; + BattlePrompt promot = 2; + Image icon = 25; + } + + message TaskPeriodConfig { + int64 task_start_time = 1; + int64 duration = 2; + int64 target_start_timestamp = 3; + int32 click_action = 11; + BattlePrompt click_toast_prompt = 12; + int32 prompt_type = 21; + BattlePrompt task_static_prompt = 22; + int64 progress_target = 23; + int32 target_type = 24; + Image icon = 25; + string click_action_schema_url = 26; + } + + message RewardPeriodConfig { + int64 reward_start_time = 1; + int64 duration = 2; + int32 reward_multiple = 3; + int64 reward_start_timestamp = 4; + BattlePrompt reward_prapare_prompt = 11; + BattlePrompt rewarding_prompt = 12; + BattlePrompt click_prompt = 13; + } + + message BattleTaskGiftAmountGuide { + BattlePrompt guide_prompt = 1; + int32 prompt_type = 2; + int32 disappear_duration = 3; + Image icon_image = 11; + Image gift_image = 12; + int64 recommend_gift_id = 21; + int32 recommend_gift_count = 22; + Text guide_content = 23; + } + } + } + + message BattleTaskUpdate { + int64 task_progress = 1; + int64 from_user_uid = 2; + string prompt_key = 3; + string log_id = 21; + } + + message BattleTaskSettle { + Result task_result = 1; + int64 reward_start_time = 2; + int64 reward_start_timestamp = 3; + + enum Result { + RESULT_SUCCEED = 0; + RESULT_FAILED = 1; + RESULT_BOTH_SUCCEED = 2; + } + } + + message BattleRewardSettle { + BattlePrompt reward_settle_prompt = 1; + RewardStatus status = 2; } } //@WebcastLinkMicBattle message WebcastLinkMicBattle { - Common common = 1; - uint64 id = 2; - LinkMicBattleConfig battleConfig = 3; - LinkMicBattleStatus battleStatus = 4; - repeated LinkMicBattleDetails details = 5; - repeated LinkMicBattleTopViewers viewerTeam = 9; - repeated LinkMicBattleHost hostTeam = 10; - repeated LinkMicBattleTeamData teamData = 13; - uint64 unknownData16 = 16; - repeated Host2v2Data hostData2v2 = 17; + CommonMessageData common = 1; + int64 battle_id = 2; + BattleSetting battle_setting = 3; + BattleAction action = 4; + map battle_result = 5; + BattleDisplayConfig m_battle_display_config = 6; + GiftPermissionType invitee_gift_permission_type = 8; + map armies = 9; + map anchor_info = 10; + string bubble_text = 11; + repeated SupportedActionsWrapper supported_actions = 12; + map battle_combos = 13; + repeated TeamUsersInfo team_users = 14; + repeated BattleInviteeGiftPermission invitee_gift_permission_types = 15; + int64 action_by_user_id = 16; + repeated BattleTeamResult team_battle_result = 17; + repeated BattleTeamUserArmies team_armies = 18; + repeated BattleABTestSetting abtest_settings = 19; + TeamMatchCampaign team_match_campaign = 20; + HighScoreControlCfg fuzzy_display_config_v2 = 21; - message Host2v2Data { - uint32 teamNumber = 1; - repeated HostData hostdata = 2; - uint32 unknownData3 = 3; - uint32 totalPoints = 4; + message TeamMatchCampaign { + repeated BestTeammateRelation best_teammate_relation = 1; + repeated int64 start_sfx_team_id = 2; + bool has_team_match_mvp_sfx = 3; - message HostData { - uint64 hostId = 1; - uint32 points = 2; - string hostIdStr = 3; + message BestTeammateRelation { + int64 user_id = 1; + int64 best_teammate_id = 2; } } - message LinkMicBattleConfig { - uint64 id1 = 1; - uint64 timestamp = 2; - uint32 data1 = 3; - uint64 id2 = 4; - uint32 data2 = 5; - uint32 data3 = 6; - uint32 data4 = 8; + message BattleTeamResult { + int64 team_id = 1; + repeated BattleTeamUser team_users = 2; + int32 result = 3; + int64 total_score = 4; } - message LinkMicBattleTeamData { - uint64 teamId = 1; - LinkMicBattleData data = 2; + message BattleInviteeGiftPermission { + int64 user_id = 1; + int32 gift_permission_type = 2; } - message LinkMicBattleData { - uint64 id = 1; - uint32 data1 = 2; - uint32 winStreak = 3; - uint32 data3 = 5; - string url = 6; + message SupportedActionsWrapper { + int64 action_type = 1; } - message LinkMicBattleDetails { - uint64 id = 1; - LinkMicBattleDetailsSummary summary = 2; + message TeamUsersInfo { + int64 team_id = 1; + repeated int64 user_ids = 2; + } - message LinkMicBattleDetailsSummary { - uint64 id = 1; - uint32 unknownData2 = 2; - uint32 points = 3; + message BattleComboInfo { + int64 user_id = 1; + int64 combo_status = 2; + int64 combo_count = 3; + string combo_icon_url = 4; + int32 combo_type = 5; + string combo_rule_guide_schema = 6; + } + + message BattleResult { + int64 user_id = 1; + Result result = 2; + int64 score = 3; + } + + message BattleDisplayConfig { + int32 threshold = 1; + string text = 2; + int32 diff_threshold = 3; + string diff_text = 4; + ExemptStrategy exempt_strategy = 5; + + message ExemptStrategy { + bool exempt_both_host = 1; + int32 exempt_audience_top = 2; } } - message LinkMicBattleTopViewers { - uint64 id = 1; - repeated TopViewerGroup viewerGroup = 2; +// message UserArmiesWrapper { +// int64 user_id = 1; +// BattleUserArmies user_armies = 2; +// } - message TopViewerGroup { - repeated TopViewer viewer = 1; - uint32 points = 2; - string hostIdOrTeamNum = 3; // 1v1 Battle = HostId | 2v2 Battle = Team # - 1 & 2 +// message BattleUserInfoWrapper { +// int64 user_id = 1; +// BattleUserInfo user_info = 2; +// } - message TopViewer { - uint64 id = 1; - uint32 points = 2; - string profileId = 3; - repeated Image images = 4; - string stringId = 6; - } + message BattleUserInfo { + BattleBaseUserInfo user = 1; + repeated BattleRivalTag tags = 2; + + message BattleBaseUserInfo { + int64 user_id = 1; + string nick_name = 2; + Image avatar_thumb = 3; + string display_id = 4; + } + + message BattleRivalTag { + Image bg_image = 1; + Image icon_image = 2; + string content = 3; } } - message LinkMicBattleHost { - uint64 id = 1; - repeated HostGroup hostGroup = 2; + message BattleABTestSetting { + int64 uid = 1; + BattleABTestList ab_test_list = 2; - message HostGroup { - repeated Host host = 1; - uint32 points = 2; - string hostId = 3; + message BattleABTestList { + repeated BattleABTest ab_test_list = 1; - message Host { - uint64 id = 1; - string profileId = 2; - repeated Image images = 3; - string name = 4; + message BattleABTest { + BattleABTestType ab_test_type = 1; + int32 group = 2; } } } @@ -669,12 +1254,13 @@ message WebcastLinkMicBattle { //@WebcastLinkMicFanTicketMethod message WebcastLinkMicFanTicketMethod { - Common common = 1; + CommonMessageData common = 1; FanTicketRoomNoticeContent FanTicketRoomNotice = 2; } + //@WebcastLinkMicMethod message WebcastLinkMicMethod { - Common common = 1; + CommonMessageData common = 1; MessageType messageType = 2; string accessKey = 3; int64 anchorLinkmicId = 4; @@ -687,13 +1273,35 @@ message WebcastLinkMicMethod { int64 dimension = 11; string theme = 12; int64 inviteUid = 13; + int32 reply = 14; + int32 duration = 16; + int32 matchType = 18; + bool win = 19; + string prompts = 20; + int64 toUserId = 21; + string tips = 25; + int64 startTimeMs = 26; + int32 confluenceType = 27; + int64 fromRoomId = 28; + int32 inviteType = 29; + int64 subType = 30; + string rtcExtInfo = 32; + string appId = 34; + string appSign = 35; + string anchorLinkMicIdStr = 37; + int64 rivalAnchorId = 38; + int32 rivalLinkmicId = 39; + string rivalLinkmicIdStr = 40; + bool shouldShowPopup = 41; + bool rtcJoinChannel = 51; + int32 fanTicketType = 52; } // //@WebcastLiveIntroMessage message WebcastLiveIntroMessage { - Common common = 1; + CommonMessageData common = 1; int64 roomId = 2; AuditStatus auditStatus = 3; string content = 4; @@ -705,20 +1313,21 @@ message WebcastLiveIntroMessage { //@WebcastUnauthorizedMemberMessage message WebcastUnauthorizedMemberMessage { - Common common = 1; + CommonMessageData common = 1; int32 action = 2; Text nickNamePrefix = 3; string nickName = 4; Text enterText = 5; + PublicAreaMessageCommon public_area_common = 6; } //@WebcastMsgDetectMessage message WebcastMsgDetectMessage { - Common common = 1; - int32 detectType = 2; // Possibly an Enum? + CommonMessageData common = 1; + int32 detectType = 2; TriggerCondition triggerCondition = 3; TimeInfo timeInfo = 4; - int32 triggerBy = 5; // Possible an Enum? + int32 triggerBy = 5; string fromRegion = 6; message TimeInfo { @@ -738,7 +1347,7 @@ message WebcastMsgDetectMessage { //@WebcastOecLiveShoppingMessage message WebcastOecLiveShoppingMessage { - Common common = 1; + CommonMessageData common = 1; uint32 data1 = 2; LiveShoppingData shopData = 4; TimeStampContainer shopTimings = 5; // Uses index 1, 2 & 3 @@ -769,21 +1378,32 @@ message WebcastOecLiveShoppingMessage { //@WebcastRoomPinMessage // Host Pins comment to stream message WebcastRoomPinMessage { - Common common = 1; - bytes pinnedMessage = 2; // Usually this is a ChatMessage, but it can also be another message. - string originalMsgType = 30; // Use this Type/Method to Deserialize the PinnedMessage - uint64 timestamp = 31; + CommonMessageData common = 1; + oneof webcastMsg { + WebcastChatMessage chat_message = 2; + WebcastSocialMessage social_message = 3; + WebcastGiftMessage gift_message = 4; + WebcastMemberMessage member_message = 5; + WebcastLikeMessage like_message = 6; + } + string method = 30; + int64 pin_time = 31; + User operator = 32; + int32 action = 33; + int64 display_duration = 34; + int64 pin_id = 35; + string ec_streamer_key = 36; } //@SystemMessage -message WebcastSystemMessage { - Common common = 1; +/*message WebcastSystemMessage { + CommonMessageData common = 1; string message = 2; -} +}*/ //@WebcastLinkMessage message WebcastLinkMessage { - Common common = 1; + CommonMessageData common = 1; LinkMessageType MessageType = 2; int64 LinkerId = 3; Scene Scene = 4; @@ -816,10 +1436,13 @@ message WebcastLinkMessage { // @WebcastLinkLayerMessage message WebcastLinkLayerMessage { - Common common = 1; - MessageType messageType = 2; // Enum + CommonMessageData common = 1; + MessageType messageType = 2; int64 channelId = 3; - Scene scene = 4; // Enum + Scene scene = 4; + string source = 5; + string centerized_idc = 6; + int64 rtc_room_id = 7; CreateChannelContent createChannelContent = 100; ListChangeContent listChangeContent = 102; InviteContent inviteContent = 103; @@ -837,12 +1460,13 @@ message WebcastLinkLayerMessage { CancelJoinGroupContent cancelGroupContent = 115; LeaveJoinGroupContent leaveGroupContent = 116; P2PGroupChangeContent p2pGroupChangeContent = 117; + GroupChangeContent group_change_content = 118; BusinessContent businessContent = 200; } // @RoomVerifyMessage message RoomVerifyMessage { - Common common = 1; + CommonMessageData common = 1; int32 action = 2; string content = 3; int64 noticeType = 4; diff --git a/Client/src/main/java/io/github/jwdeveloper/tiktok/TikTokLiveClient.java b/Client/src/main/java/io/github/jwdeveloper/tiktok/TikTokLiveClient.java index 0f2a927..85a0f4e 100644 --- a/Client/src/main/java/io/github/jwdeveloper/tiktok/TikTokLiveClient.java +++ b/Client/src/main/java/io/github/jwdeveloper/tiktok/TikTokLiveClient.java @@ -31,9 +31,9 @@ import io.github.jwdeveloper.tiktok.data.requests.*; import io.github.jwdeveloper.tiktok.data.settings.LiveClientSettings; import io.github.jwdeveloper.tiktok.exceptions.*; import io.github.jwdeveloper.tiktok.http.LiveHttpClient; -import io.github.jwdeveloper.tiktok.listener.*; +import io.github.jwdeveloper.tiktok.listener.ListenersManager; import io.github.jwdeveloper.tiktok.live.*; -import io.github.jwdeveloper.tiktok.messages.webcast.WebcastResponse; +import io.github.jwdeveloper.tiktok.messages.webcast.ProtoMessageFetchResult; import io.github.jwdeveloper.tiktok.models.ConnectionState; import io.github.jwdeveloper.tiktok.websocket.LiveSocketClient; import lombok.Getter; @@ -177,7 +177,7 @@ public class TikTokLiveClient implements LiveClient @Override public void publishMessage(String webcastMessageName, byte[] payload) { - var builder = WebcastResponse.Message.newBuilder(); + var builder = ProtoMessageFetchResult.BaseProtoMessage.newBuilder(); builder.setMethod(webcastMessageName); builder.setPayload(ByteString.copyFrom(payload)); var message = builder.build(); diff --git a/Client/src/main/java/io/github/jwdeveloper/tiktok/TikTokLiveHttpClient.java b/Client/src/main/java/io/github/jwdeveloper/tiktok/TikTokLiveHttpClient.java index 5b5755a..8d4fd39 100644 --- a/Client/src/main/java/io/github/jwdeveloper/tiktok/TikTokLiveHttpClient.java +++ b/Client/src/main/java/io/github/jwdeveloper/tiktok/TikTokLiveHttpClient.java @@ -30,7 +30,7 @@ import io.github.jwdeveloper.tiktok.data.settings.LiveClientSettings; import io.github.jwdeveloper.tiktok.exceptions.*; import io.github.jwdeveloper.tiktok.http.*; import io.github.jwdeveloper.tiktok.http.mappers.*; -import io.github.jwdeveloper.tiktok.messages.webcast.WebcastResponse; +import io.github.jwdeveloper.tiktok.messages.webcast.ProtoMessageFetchResult; import java.net.http.HttpResponse; import java.util.function.Consumer; @@ -163,7 +163,7 @@ public class TikTokLiveHttpClient implements LiveHttpClient throw new TikTokSignServerException("Sign server did not return the x-set-tt-cookie header - "+result); } var websocketCookie = resultHeader.getContent(); - var webcastResponse = WebcastResponse.parseFrom(credentialsResponse.body()); + var webcastResponse = ProtoMessageFetchResult.parseFrom(credentialsResponse.body()); var webSocketUrl = httpFactory .client(webcastResponse.getPushServer()) .withParam("room_id", request.getRoomId()) diff --git a/Client/src/main/java/io/github/jwdeveloper/tiktok/TikTokLiveHttpOfflineClient.java b/Client/src/main/java/io/github/jwdeveloper/tiktok/TikTokLiveHttpOfflineClient.java index 5067567..f2d5537 100644 --- a/Client/src/main/java/io/github/jwdeveloper/tiktok/TikTokLiveHttpOfflineClient.java +++ b/Client/src/main/java/io/github/jwdeveloper/tiktok/TikTokLiveHttpOfflineClient.java @@ -24,12 +24,9 @@ package io.github.jwdeveloper.tiktok; import io.github.jwdeveloper.tiktok.data.models.Picture; import io.github.jwdeveloper.tiktok.data.models.users.User; -import io.github.jwdeveloper.tiktok.data.requests.GiftsData; -import io.github.jwdeveloper.tiktok.data.requests.LiveConnectionData; -import io.github.jwdeveloper.tiktok.data.requests.LiveData; -import io.github.jwdeveloper.tiktok.data.requests.LiveUserData; +import io.github.jwdeveloper.tiktok.data.requests.*; import io.github.jwdeveloper.tiktok.http.LiveHttpClient; -import io.github.jwdeveloper.tiktok.messages.webcast.WebcastResponse; +import io.github.jwdeveloper.tiktok.messages.webcast.ProtoMessageFetchResult; import java.net.URI; import java.util.List; @@ -62,6 +59,6 @@ public class TikTokLiveHttpOfflineClient implements LiveHttpClient { public LiveConnectionData.Response fetchLiveConnectionData(LiveConnectionData.Request request) { return new LiveConnectionData.Response("", URI.create("https://example.live"), - WebcastResponse.newBuilder().build()); + ProtoMessageFetchResult.newBuilder().build()); } } \ No newline at end of file diff --git a/Client/src/main/java/io/github/jwdeveloper/tiktok/TikTokLiveMessageHandler.java b/Client/src/main/java/io/github/jwdeveloper/tiktok/TikTokLiveMessageHandler.java index 3704025..3a012a4 100644 --- a/Client/src/main/java/io/github/jwdeveloper/tiktok/TikTokLiveMessageHandler.java +++ b/Client/src/main/java/io/github/jwdeveloper/tiktok/TikTokLiveMessageHandler.java @@ -25,15 +25,11 @@ package io.github.jwdeveloper.tiktok; import io.github.jwdeveloper.tiktok.data.dto.MessageMetaData; import io.github.jwdeveloper.tiktok.data.events.TikTokErrorEvent; -import io.github.jwdeveloper.tiktok.data.events.websocket.TikTokWebsocketMessageEvent; -import io.github.jwdeveloper.tiktok.data.events.websocket.TikTokWebsocketResponseEvent; -import io.github.jwdeveloper.tiktok.data.events.websocket.TikTokWebsocketUnhandledMessageEvent; +import io.github.jwdeveloper.tiktok.data.events.websocket.*; import io.github.jwdeveloper.tiktok.exceptions.TikTokLiveMessageException; -import io.github.jwdeveloper.tiktok.live.LiveClient; -import io.github.jwdeveloper.tiktok.live.LiveEventsHandler; -import io.github.jwdeveloper.tiktok.live.LiveMessagesHandler; +import io.github.jwdeveloper.tiktok.live.*; import io.github.jwdeveloper.tiktok.mappers.LiveMapper; -import io.github.jwdeveloper.tiktok.messages.webcast.WebcastResponse; +import io.github.jwdeveloper.tiktok.messages.webcast.ProtoMessageFetchResult; import io.github.jwdeveloper.tiktok.utils.Stopwatch; import java.time.Duration; @@ -48,7 +44,7 @@ public class TikTokLiveMessageHandler implements LiveMessagesHandler { this.mapper = mapper; } - public void handle(LiveClient client, WebcastResponse webcastResponse) { + public void handle(LiveClient client, ProtoMessageFetchResult webcastResponse) { tikTokEventHandler.publish(client, new TikTokWebsocketResponseEvent(webcastResponse)); for (var message : webcastResponse.getMessagesList()) { try { @@ -60,7 +56,7 @@ public class TikTokLiveMessageHandler implements LiveMessagesHandler { } } - public void handleSingleMessage(LiveClient client, WebcastResponse.Message message) { + public void handleSingleMessage(LiveClient client, ProtoMessageFetchResult.BaseProtoMessage message) { var messageClassName = message.getMethod(); if (!mapper.isRegistered(messageClassName)) { tikTokEventHandler.publish(client, new TikTokWebsocketUnhandledMessageEvent(message)); diff --git a/Client/src/main/java/io/github/jwdeveloper/tiktok/mappers/handlers/TikTokCommonEventHandler.java b/Client/src/main/java/io/github/jwdeveloper/tiktok/mappers/handlers/TikTokCommonEventHandler.java index c6be4e5..29146bf 100644 --- a/Client/src/main/java/io/github/jwdeveloper/tiktok/mappers/handlers/TikTokCommonEventHandler.java +++ b/Client/src/main/java/io/github/jwdeveloper/tiktok/mappers/handlers/TikTokCommonEventHandler.java @@ -25,18 +25,14 @@ package io.github.jwdeveloper.tiktok.mappers.handlers; import io.github.jwdeveloper.tiktok.data.events.*; import io.github.jwdeveloper.tiktok.data.events.common.TikTokEvent; import io.github.jwdeveloper.tiktok.data.events.envelop.TikTokChestEvent; -import io.github.jwdeveloper.tiktok.data.events.poll.TikTokPollEndEvent; -import io.github.jwdeveloper.tiktok.data.events.poll.TikTokPollEvent; -import io.github.jwdeveloper.tiktok.data.events.poll.TikTokPollStartEvent; -import io.github.jwdeveloper.tiktok.data.events.poll.TikTokPollUpdateEvent; +import io.github.jwdeveloper.tiktok.data.events.poll.*; import io.github.jwdeveloper.tiktok.data.events.room.TikTokRoomPinEvent; import io.github.jwdeveloper.tiktok.data.models.chest.Chest; import io.github.jwdeveloper.tiktok.messages.enums.EnvelopeDisplay; import io.github.jwdeveloper.tiktok.messages.webcast.*; import lombok.SneakyThrows; -import java.util.Collections; -import java.util.List; +import java.util.*; public class TikTokCommonEventHandler { @@ -55,7 +51,7 @@ public class TikTokCommonEventHandler @SneakyThrows public TikTokEvent handlePinMessage(byte[] msg) { var pinMessage = WebcastRoomPinMessage.parseFrom(msg); - var chatMessage = WebcastChatMessage.parseFrom(pinMessage.getPinnedMessage()); + var chatMessage = pinMessage.getChatMessage(); var chatEvent = new TikTokCommentEvent(chatMessage); return new TikTokRoomPinEvent(pinMessage, chatEvent); } @@ -75,7 +71,7 @@ public class TikTokCommonEventHandler @SneakyThrows public List handleEnvelop(byte[] data) { var msg = WebcastEnvelopeMessage.parseFrom(data); - if (msg.getDisplay() != EnvelopeDisplay.EnvelopeDisplayNew) { + if (msg.getDisplay() != EnvelopeDisplay.ENVELOPE_DISPLAY_NEW) { return Collections.emptyList(); } var totalDiamonds = msg.getEnvelopeInfo().getDiamondCount(); diff --git a/Client/src/main/java/io/github/jwdeveloper/tiktok/websocket/TikTokWebSocketListener.java b/Client/src/main/java/io/github/jwdeveloper/tiktok/websocket/TikTokWebSocketListener.java index 3992770..23b2a8d 100644 --- a/Client/src/main/java/io/github/jwdeveloper/tiktok/websocket/TikTokWebSocketListener.java +++ b/Client/src/main/java/io/github/jwdeveloper/tiktok/websocket/TikTokWebSocketListener.java @@ -121,11 +121,11 @@ public class TikTokWebSocketListener extends WebSocketClient { } } - private WebcastResponse getWebResponseMessage(ByteString buffer) { + private ProtoMessageFetchResult getWebResponseMessage(ByteString buffer) { try { - return WebcastResponse.parseFrom(buffer); + return ProtoMessageFetchResult.parseFrom(buffer); } catch (Exception e) { - throw new TikTokProtocolBufferException("Unable to parse WebcastResponse", buffer.toByteArray(), e); + throw new TikTokProtocolBufferException("Unable to parse ProtoMessageFetchResult", buffer.toByteArray(), e); } } diff --git a/examples/pom.xml b/examples/pom.xml index 18a7502..dc2acab 100644 --- a/examples/pom.xml +++ b/examples/pom.xml @@ -72,12 +72,6 @@ ${project.version} compile - - io.github.jwdeveloper.tiktok - extension-collector - ${project.version} - compile - diff --git a/extension-collector/pom.xml b/extension-collector/pom.xml index 8eda0c6..51f82fc 100644 --- a/extension-collector/pom.xml +++ b/extension-collector/pom.xml @@ -30,12 +30,6 @@ mongodb-driver-sync 4.4.0 - - io.github.jwdeveloper.tiktok - API - 1.9.2-Release - compile - \ No newline at end of file diff --git a/extension-collector/src/main/java/io/github/jwdeveloper/tiktok/extension/collector/impl/DataCollectorListener.java b/extension-collector/src/main/java/io/github/jwdeveloper/tiktok/extension/collector/impl/DataCollectorListener.java index 9bb503d..f06604a 100644 --- a/extension-collector/src/main/java/io/github/jwdeveloper/tiktok/extension/collector/impl/DataCollectorListener.java +++ b/extension-collector/src/main/java/io/github/jwdeveloper/tiktok/extension/collector/impl/DataCollectorListener.java @@ -29,16 +29,14 @@ import io.github.jwdeveloper.tiktok.data.events.control.TikTokConnectingEvent; import io.github.jwdeveloper.tiktok.data.events.room.TikTokRoomInfoEvent; import io.github.jwdeveloper.tiktok.data.events.websocket.TikTokWebsocketResponseEvent; import io.github.jwdeveloper.tiktok.exceptions.TikTokLiveMessageException; -import io.github.jwdeveloper.tiktok.extension.collector.api.LiveDataCollector; -import io.github.jwdeveloper.tiktok.extension.collector.api.Storage; +import io.github.jwdeveloper.tiktok.extension.collector.api.*; import io.github.jwdeveloper.tiktok.extension.collector.api.settings.CollectorListenerSettings; import io.github.jwdeveloper.tiktok.live.LiveClient; -import io.github.jwdeveloper.tiktok.messages.webcast.WebcastResponse; +import io.github.jwdeveloper.tiktok.messages.webcast.ProtoMessageFetchResult; import io.github.jwdeveloper.tiktok.utils.JsonUtil; import org.bson.Document; -import java.io.PrintWriter; -import java.io.StringWriter; +import java.io.*; import java.time.LocalDateTime; import java.util.Base64; @@ -77,12 +75,12 @@ public class DataCollectorListener implements LiveDataCollector { includeError(liveClient, event); } - private void includeResponse(LiveClient liveClient, WebcastResponse message) { + private void includeResponse(LiveClient liveClient, ProtoMessageFetchResult message) { var messageContent = Base64.getEncoder().encodeToString(message.toByteArray()); insertDocument(liveClient, createDocument("response", "webcast", messageContent)); } - private void includeMessage(LiveClient liveClient, WebcastResponse.Message message) { + private void includeMessage(LiveClient liveClient, ProtoMessageFetchResult.BaseProtoMessage message) { var method = message.getMethod(); var messageContent = Base64.getEncoder().encodeToString(message.getPayload().toByteArray()); insertDocument(liveClient, createDocument("message", method, messageContent));