mirror of
https://github.com/jwdeveloper/TikTokLiveJava.git
synced 2026-02-27 16:59:39 -05:00
@@ -56,7 +56,7 @@ public class ClientSettings {
|
||||
* Whether to print Logs to Console
|
||||
*/
|
||||
|
||||
private boolean printToConsole;
|
||||
private boolean printToConsole = true;
|
||||
/**
|
||||
* LoggingLevel for Logs
|
||||
*/
|
||||
@@ -64,7 +64,7 @@ public class ClientSettings {
|
||||
|
||||
|
||||
/**
|
||||
* Optional: Use it if you need to change TikTok live hostname in builder
|
||||
* Optional: Use it if you need to change TikTok live hostname in builder
|
||||
*/
|
||||
private String hostName;
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface TikTokEventHandler
|
||||
public @interface TikTokEventObserver
|
||||
{
|
||||
|
||||
}
|
||||
@@ -47,11 +47,11 @@ public class TikTokCommentEvent extends TikTokHeaderEvent {
|
||||
|
||||
public TikTokCommentEvent(WebcastChatMessage msg) {
|
||||
super(msg.getCommon());
|
||||
user = User.map(msg.getUser());
|
||||
user = User.map(msg.getUser(),msg.getUserIdentity());
|
||||
text = msg.getContent();
|
||||
visibleToSender = msg.getVisibleToSender();
|
||||
getUserLanguage = msg.getContentLanguage();
|
||||
mentionedUser = User.map(msg.getAtUser(),msg.getUserIdentity());
|
||||
mentionedUser = User.map(msg.getAtUser());
|
||||
pictures = msg.getEmotesListList().stream().map(e -> Picture.map(e.getEmote().getImage())).toList();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
package io.github.jwdeveloper.tiktok.data.events.http;
|
||||
|
||||
import io.github.jwdeveloper.tiktok.annotations.EventMeta;
|
||||
import io.github.jwdeveloper.tiktok.annotations.EventType;
|
||||
import io.github.jwdeveloper.tiktok.data.events.common.TikTokEvent;
|
||||
import io.github.jwdeveloper.tiktok.data.models.http.HttpData;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
@EventMeta(eventType = EventType.Debug)
|
||||
public class TikTokHttpResponseEvent extends TikTokEvent
|
||||
{
|
||||
String url;
|
||||
|
||||
HttpData response;
|
||||
|
||||
HttpData request;
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
package io.github.jwdeveloper.tiktok.data.models.http;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.net.URI;
|
||||
import java.net.http.HttpRequest;
|
||||
import java.net.http.HttpResponse;
|
||||
import java.util.*;
|
||||
|
||||
@Data
|
||||
public class HttpData {
|
||||
String url;
|
||||
String method;
|
||||
Map<String, List<String>> headers = new TreeMap<>();
|
||||
Map<String, String> parameters = new TreeMap<>();
|
||||
int status;
|
||||
String body = "";
|
||||
|
||||
|
||||
public static HttpData map(HttpRequest request) {
|
||||
var data = new HttpData();
|
||||
data.setUrl(request.uri().getPath());
|
||||
data.setMethod(request.method());
|
||||
data.setParameters(extractQueryParams(request.uri()));
|
||||
data.setStatus(200);
|
||||
if (request.bodyPublisher().isPresent()) {
|
||||
data.setBody(request.bodyPublisher().get().toString());
|
||||
}
|
||||
data.setHeaders(Collections.unmodifiableMap(request.headers().map()));
|
||||
return data;
|
||||
}
|
||||
|
||||
public static HttpData map(HttpResponse<String> response) {
|
||||
var data = new HttpData();
|
||||
data.setUrl(response.uri().getPath());
|
||||
data.setMethod(response.request().method());
|
||||
data.setParameters(extractQueryParams(response.uri()));
|
||||
data.setStatus(200);
|
||||
data.setBody(response.body());
|
||||
data.setHeaders(Collections.unmodifiableMap(response.headers().map()));
|
||||
return data;
|
||||
}
|
||||
|
||||
|
||||
private static Map<String, String> extractQueryParams(URI uri) {
|
||||
Map<String, String> params = new HashMap<>();
|
||||
String query = uri.getQuery();
|
||||
if (query != null && !query.isEmpty()) {
|
||||
for (String param : query.split("&")) {
|
||||
String[] keyValue = param.split("=");
|
||||
if (keyValue.length > 1) {
|
||||
params.put(keyValue[0], keyValue[1]);
|
||||
} else {
|
||||
params.put(keyValue[0], ""); // Empty value for parameter without explicit value
|
||||
}
|
||||
}
|
||||
}
|
||||
return params;
|
||||
}
|
||||
}
|
||||
@@ -22,6 +22,7 @@
|
||||
*/
|
||||
package io.github.jwdeveloper.tiktok.live;
|
||||
|
||||
import io.github.jwdeveloper.tiktok.data.events.common.TikTokEvent;
|
||||
import io.github.jwdeveloper.tiktok.listener.ListenersManager;
|
||||
import io.github.jwdeveloper.tiktok.listener.TikTokEventListener;
|
||||
|
||||
@@ -55,6 +56,11 @@ public interface LiveClient {
|
||||
void disconnect();
|
||||
|
||||
|
||||
/**
|
||||
* You to manually trigger event
|
||||
*/
|
||||
void publishEvent(TikTokEvent event);
|
||||
|
||||
/**
|
||||
* Get information about gifts
|
||||
*/
|
||||
|
||||
@@ -26,6 +26,7 @@ import io.github.jwdeveloper.tiktok.data.events.common.TikTokEvent;
|
||||
import io.github.jwdeveloper.tiktok.data.events.*;
|
||||
import io.github.jwdeveloper.tiktok.data.events.gift.TikTokGiftComboEvent;
|
||||
import io.github.jwdeveloper.tiktok.data.events.gift.TikTokGiftEvent;
|
||||
import io.github.jwdeveloper.tiktok.data.events.http.TikTokHttpResponseEvent;
|
||||
import io.github.jwdeveloper.tiktok.data.events.room.TikTokRoomInfoEvent;
|
||||
import io.github.jwdeveloper.tiktok.data.events.social.TikTokFollowEvent;
|
||||
import io.github.jwdeveloper.tiktok.data.events.social.TikTokJoinEvent;
|
||||
@@ -39,61 +40,140 @@ import io.github.jwdeveloper.tiktok.data.events.websocket.TikTokWebsocketUnhandl
|
||||
public interface EventsBuilder<T> {
|
||||
|
||||
/**
|
||||
* Method used to register own custom events
|
||||
* @param eventClazz event class
|
||||
* @param event action
|
||||
* Invoked whenever specified event is triggered
|
||||
*
|
||||
* @param eventClass event class
|
||||
* @param action action
|
||||
*/
|
||||
<E extends TikTokEvent> T onCustomEvent(Class<E> eventClazz, EventConsumer<E> event);
|
||||
|
||||
T onRoomInfo(EventConsumer<TikTokRoomInfoEvent> event);
|
||||
|
||||
T onComment(EventConsumer<TikTokCommentEvent> event);
|
||||
|
||||
T onWebsocketMessage(EventConsumer<TikTokWebsocketMessageEvent> event);
|
||||
|
||||
T onWebsocketResponse(EventConsumer<TikTokWebsocketResponseEvent> event);
|
||||
|
||||
T onWebsocketUnhandledMessage(EventConsumer<TikTokWebsocketUnhandledMessageEvent> event);
|
||||
<E extends TikTokEvent> T onEvent(Class<E> eventClass, EventConsumer<E> action);
|
||||
|
||||
|
||||
T onGiftCombo(EventConsumer<TikTokGiftComboEvent> event);
|
||||
/**
|
||||
* Invoked whenever any event is triggered
|
||||
*
|
||||
* @param action
|
||||
* @return
|
||||
*/
|
||||
T onEvent(EventConsumer<TikTokEvent> action);
|
||||
|
||||
T onGift(EventConsumer<TikTokGiftEvent> event);
|
||||
/**
|
||||
* Invoked when information about room (live) got updated such as viewer count, etc..
|
||||
*
|
||||
* @param action
|
||||
* @return
|
||||
*/
|
||||
T onRoomInfo(EventConsumer<TikTokRoomInfoEvent> action);
|
||||
|
||||
T onQuestion(EventConsumer<TikTokQuestionEvent> event);
|
||||
/**
|
||||
* Invoked when someone send message to chat
|
||||
*
|
||||
* @param action
|
||||
* @return
|
||||
*/
|
||||
T onComment(EventConsumer<TikTokCommentEvent> action);
|
||||
|
||||
T onSubscribe(EventConsumer<TikTokSubscribeEvent> event);
|
||||
|
||||
T onFollow(EventConsumer<TikTokFollowEvent> event);
|
||||
/**
|
||||
* Invoked when TikTokLiveJava makes http request and getting response
|
||||
*
|
||||
* @param action
|
||||
* @return
|
||||
*/
|
||||
T onHttpResponse(EventConsumer<TikTokHttpResponseEvent> action);
|
||||
|
||||
T onLike(EventConsumer<TikTokLikeEvent> event);
|
||||
/**
|
||||
* Invoked when TikTok protocolBuffer data "message" was successfully mapped to event
|
||||
* events contains protocol-buffer "Message" and TikTokLiveJava "Event"
|
||||
*
|
||||
* @param action
|
||||
* @return
|
||||
*/
|
||||
T onWebsocketMessage(EventConsumer<TikTokWebsocketMessageEvent> action);
|
||||
|
||||
T onEmote(EventConsumer<TikTokEmoteEvent> event);
|
||||
/**
|
||||
* Invoked when there was not found event mapper for TikTok protocolBuffer data "message"
|
||||
*
|
||||
* @param action
|
||||
* @return
|
||||
*/
|
||||
T onWebsocketUnhandledMessage(EventConsumer<TikTokWebsocketUnhandledMessageEvent> action);
|
||||
|
||||
T onJoin(EventConsumer<TikTokJoinEvent> event);
|
||||
/**
|
||||
* Invoked every time TikTok sends protocolBuffer data to websocket
|
||||
* Response contains list of messages that are later mapped to events
|
||||
* @param action
|
||||
* @return
|
||||
*/
|
||||
T onWebsocketResponse(EventConsumer<TikTokWebsocketResponseEvent> action);
|
||||
|
||||
T onShare(EventConsumer<TikTokShareEvent> event);
|
||||
|
||||
// T onChest(EventConsumer<TikTokChestEvent> event);
|
||||
/**
|
||||
* Invoked for gifts that has no combo, or when combo finishes
|
||||
* @param action
|
||||
* @return
|
||||
*/
|
||||
T onGift(EventConsumer<TikTokGiftEvent> action);
|
||||
|
||||
T onLivePaused(EventConsumer<TikTokLivePausedEvent> event);
|
||||
/**
|
||||
* Invoked for gifts that has combo options such as roses
|
||||
* @param action
|
||||
* @return
|
||||
*/
|
||||
T onGiftCombo(EventConsumer<TikTokGiftComboEvent> action);
|
||||
|
||||
T onLiveUnpaused(EventConsumer<TikTokLiveUnpausedEvent> event);
|
||||
|
||||
T onLiveEnded(EventConsumer<TikTokLiveEndedEvent> event);
|
||||
T onQuestion(EventConsumer<TikTokQuestionEvent> action);
|
||||
|
||||
T onConnected(EventConsumer<TikTokConnectedEvent> event);
|
||||
T onSubscribe(EventConsumer<TikTokSubscribeEvent> action);
|
||||
|
||||
T onReconnecting(EventConsumer<TikTokReconnectingEvent> event);
|
||||
T onFollow(EventConsumer<TikTokFollowEvent> action);
|
||||
|
||||
T onDisconnected(EventConsumer<TikTokDisconnectedEvent> event);
|
||||
T onLike(EventConsumer<TikTokLikeEvent> action);
|
||||
|
||||
T onError(EventConsumer<TikTokErrorEvent> event);
|
||||
T onEmote(EventConsumer<TikTokEmoteEvent> action);
|
||||
|
||||
T onEvent(EventConsumer<TikTokEvent> event);
|
||||
T onJoin(EventConsumer<TikTokJoinEvent> action);
|
||||
|
||||
T onShare(EventConsumer<TikTokShareEvent> action);
|
||||
|
||||
T onLivePaused(EventConsumer<TikTokLivePausedEvent> action);
|
||||
|
||||
T onLiveUnpaused(EventConsumer<TikTokLiveUnpausedEvent> action);
|
||||
|
||||
T onLiveEnded(EventConsumer<TikTokLiveEndedEvent> action);
|
||||
|
||||
/**
|
||||
* Invoked when client has been successfully connected to live
|
||||
* @param action
|
||||
* @return
|
||||
*/
|
||||
T onConnected(EventConsumer<TikTokConnectedEvent> action);
|
||||
|
||||
/**
|
||||
* Invoked when client tries to reconnect
|
||||
* @param action
|
||||
* @return
|
||||
*/
|
||||
T onReconnecting(EventConsumer<TikTokReconnectingEvent> action);
|
||||
|
||||
/**
|
||||
* Invoked when client disconnected
|
||||
* @param action
|
||||
* @return
|
||||
*/
|
||||
T onDisconnected(EventConsumer<TikTokDisconnectedEvent> action);
|
||||
|
||||
/**
|
||||
* Invoked when exception was throed inside client or event handler
|
||||
* @param action
|
||||
* @return
|
||||
*/
|
||||
T onError(EventConsumer<TikTokErrorEvent> action);
|
||||
|
||||
|
||||
// TODO Figure out how those events works
|
||||
// T onChest(EventConsumer<TikTokChestEvent> event);
|
||||
|
||||
//T onLinkMicFanTicket(TikTokEventConsumer<TikTokLinkMicFanTicketEvent> event);
|
||||
|
||||
//T onEnvelope(TikTokEventConsumer<TikTokEnvelopeEvent> event);
|
||||
|
||||
@@ -24,72 +24,32 @@ package io.github.jwdeveloper.tiktok.mappers;
|
||||
|
||||
import com.google.protobuf.GeneratedMessageV3;
|
||||
import io.github.jwdeveloper.tiktok.data.events.common.TikTokEvent;
|
||||
import io.github.jwdeveloper.tiktok.mappers.data.MappingAction;
|
||||
import io.github.jwdeveloper.tiktok.mappers.data.MappingResult;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.function.Function;
|
||||
|
||||
public interface TikTokMapper {
|
||||
|
||||
|
||||
/**
|
||||
* Triggered when `sourceClass` is mapped,
|
||||
* input is bytes that are coming from TikTok in `sourceClass` packet
|
||||
* output is TikTok event we want to create
|
||||
* <p>
|
||||
* bytesToEvent(WebcastGiftMessage.class, bytes ->
|
||||
* {
|
||||
* var giftMessage = WebcastGiftMessage.parseFrom(bytes);
|
||||
* var giftName = giftMessage.getGift().getName();
|
||||
* return new TikTokEvent(Gift.ROSE, giftMessage);
|
||||
* })
|
||||
* * if mapper is not found for messageName, TikTokLiveException is thrown
|
||||
*
|
||||
* @param sourceClass protocol buffer webcast class
|
||||
* @param onMapping lambda function that is triggered on mapping. takes as input ProtocolBuffer object and as output TikTokEvent
|
||||
* @param messageName
|
||||
* @return TikTokMapperModel
|
||||
*/
|
||||
void bytesToEvent(Class<? extends GeneratedMessageV3> sourceClass, Function<byte[], TikTokEvent> onMapping);
|
||||
TikTokMapperModel forMessage(String messageName);
|
||||
|
||||
void bytesToEvents(Class<? extends GeneratedMessageV3> sourceClass, Function<byte[], List<TikTokEvent>> onMapping);
|
||||
TikTokMapperModel forMessage(Class<? extends GeneratedMessageV3> mapperName);
|
||||
|
||||
TikTokMapperModel forMessage(String mapperName, MappingAction<MappingResult> onMapping);
|
||||
|
||||
/**
|
||||
* In case you found some TikTok message that has not Webcast class use this method
|
||||
*
|
||||
* @param messageName Name of TikTok data event
|
||||
* @param onMapping lambda function that is triggered on mapping. takes as input ProtocolBuffer object and as output TikTokEvent
|
||||
*/
|
||||
void bytesToEvent(String messageName, Function<byte[], TikTokEvent> onMapping);
|
||||
TikTokMapperModel forMessage(Class<? extends GeneratedMessageV3> mapperName, MappingAction<MappingResult> onMapping);
|
||||
|
||||
void bytesToEvents(String messageName, Function<byte[], List<TikTokEvent>> onMapping);
|
||||
TikTokMapperModel forMessage(Class<? extends GeneratedMessageV3> mapperName, Function<byte[], TikTokEvent> onMapping);
|
||||
|
||||
boolean isRegistered(String mapperName);
|
||||
|
||||
/**
|
||||
* This method can be used to override default mapping for
|
||||
* certain TikTok incoming data message. For this example
|
||||
* we are overriding WebcastGiftMessage and retuning CustomGiftEvent
|
||||
* instead of TikTokGiftEvent
|
||||
* <p>
|
||||
* webcastObjectToEvent(WebcastGiftMessage.class, webcastGiftMessage ->
|
||||
* {
|
||||
* var giftName = webcastGiftMessage.getGift().getName();
|
||||
* var user = webcastGiftMessage.getUser().getNickname();
|
||||
* return new CustomGiftEvent(giftName, user);
|
||||
* })
|
||||
*
|
||||
* @param sourceClass ProtocolBuffer class that represent incoming custom data, hint class should starts with Webcast prefix
|
||||
* @param onMapping lambda function that is triggered on mapping. takes as input ProtocolBuffer object and as output TikTokEvent
|
||||
*/
|
||||
<T extends GeneratedMessageV3> void webcastObjectToEvent(Class<T> sourceClass, Function<T, TikTokEvent> onMapping);
|
||||
<T extends GeneratedMessageV3> boolean isRegistered(Class<T> mapperName);
|
||||
|
||||
<T extends GeneratedMessageV3> void webcastObjectToEvents(Class<T> sourceClass, Function<T, List<TikTokEvent>> onMapping);
|
||||
|
||||
/**
|
||||
* Triggered when `sourceClass` is mapped,
|
||||
* looking for constructor in `outputClass` with one parameter that is of type `sourceClass`
|
||||
* and created instance of object from this constructor
|
||||
*
|
||||
* @param sourceClass protocol buffer webcast class
|
||||
* @param outputClass TikTok event class
|
||||
*/
|
||||
void webcastObjectToConstructor(Class<? extends GeneratedMessageV3> sourceClass, Class<? extends TikTokEvent> outputClass);
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
package io.github.jwdeveloper.tiktok.mappers;
|
||||
|
||||
import com.google.protobuf.GeneratedMessageV3;
|
||||
import io.github.jwdeveloper.tiktok.exceptions.TikTokMessageMappingException;
|
||||
import io.github.jwdeveloper.tiktok.utils.ProtoBufferObject;
|
||||
|
||||
public interface TikTokMapperHelper {
|
||||
|
||||
/**
|
||||
* @param bytes protocol buffer data bytes
|
||||
* @param messageClass class that we want to serialize bytes to
|
||||
* @param <T> @messageClass must be class that is made by protocol buffer
|
||||
* @return object of type @messageClass
|
||||
*/
|
||||
<T extends GeneratedMessageV3> T bytesToWebcastObject(byte[] bytes, Class<T> messageClass);
|
||||
|
||||
/**
|
||||
* @param bytes protocol buffer data bytes
|
||||
* @param messageName class that we want to serialize bytes to
|
||||
* @return protocol buffer objects if class for @messageName has been found
|
||||
* @throws TikTokMessageMappingException if there is no suitable class for messageName
|
||||
*/
|
||||
Object bytesToWebcastObject(byte[] bytes, String messageName);
|
||||
|
||||
|
||||
/**
|
||||
* @param messageName checks wheaten TikTokLiveJava has class representation for certain protocol-buffer message name
|
||||
* @return false if class is not found
|
||||
*/
|
||||
boolean isMessageHasProtoClass(String messageName);
|
||||
|
||||
/**
|
||||
* @param bytes protocol buffer data bytes
|
||||
* @return tree structure of protocol buffer object
|
||||
* @see ProtoBufferObject
|
||||
*/
|
||||
ProtoBufferObject bytesToProtoBufferStructure(byte[] bytes);
|
||||
|
||||
/**
|
||||
* Converts object to json
|
||||
*
|
||||
* @param obj any object
|
||||
* @return pretty formatted json
|
||||
*/
|
||||
String toJson(Object obj);
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package io.github.jwdeveloper.tiktok.mappers;
|
||||
|
||||
import io.github.jwdeveloper.tiktok.data.events.common.TikTokEvent;
|
||||
import io.github.jwdeveloper.tiktok.mappers.data.AfterMappingAction;
|
||||
import io.github.jwdeveloper.tiktok.mappers.data.MappingAction;
|
||||
import io.github.jwdeveloper.tiktok.mappers.data.MappingResult;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.function.Function;
|
||||
|
||||
public interface TikTokMapperModel {
|
||||
|
||||
/**
|
||||
* @return name of websocket message that this mapper is mapping from
|
||||
*/
|
||||
|
||||
String getSourceMessageName();
|
||||
|
||||
/**
|
||||
* @param action Input bytes from websocket, you can modify it and returns different bytes
|
||||
*/
|
||||
TikTokMapperModel onBeforeMapping(MappingAction<byte[]> action);
|
||||
|
||||
/**
|
||||
* @param action Input bytes from websocket. As output returns list of tiktok live events
|
||||
*/
|
||||
TikTokMapperModel onMapping(MappingAction<MappingResult> action);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @param action You can modify output list of TikTokLive events
|
||||
* @see AfterMappingAction
|
||||
*/
|
||||
TikTokMapperModel onAfterMapping(Function<MappingResult, List<TikTokEvent>> action);
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package io.github.jwdeveloper.tiktok.mappers.data;
|
||||
|
||||
import io.github.jwdeveloper.tiktok.data.events.common.TikTokEvent;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@FunctionalInterface
|
||||
public interface AfterMappingAction {
|
||||
/**
|
||||
* @param source object that was used as source to create events
|
||||
* @param events list of events prepared before, could be modified or changed
|
||||
* @return list of events that will be invoked
|
||||
*/
|
||||
List<TikTokEvent> onAfterMapping(Object source, List<TikTokEvent> events);
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package io.github.jwdeveloper.tiktok.mappers.data;
|
||||
|
||||
import io.github.jwdeveloper.tiktok.mappers.TikTokMapperHelper;
|
||||
|
||||
@FunctionalInterface
|
||||
public interface MappingAction<T> {
|
||||
|
||||
/**
|
||||
* @param inputBytes incoming bytes from TikTok server. The represents protocol buffer message that was send to client
|
||||
* @param messageName name of protocol buffer message
|
||||
* @param mapperHelper utils and helper methods that can be use to debbug/display/deserialize protocol buffer data
|
||||
* @return
|
||||
*/
|
||||
T onMapping(byte[] inputBytes, String messageName, TikTokMapperHelper mapperHelper);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package io.github.jwdeveloper.tiktok.mappers.data;
|
||||
|
||||
import io.github.jwdeveloper.tiktok.data.events.common.TikTokEvent;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public class MappingResult
|
||||
{
|
||||
|
||||
Object source;
|
||||
|
||||
List<TikTokEvent> events;
|
||||
|
||||
String message;
|
||||
|
||||
public static MappingResult of(Object source) {
|
||||
return new MappingResult(source, List.of(),"");
|
||||
}
|
||||
|
||||
public static MappingResult of(Object source, List<TikTokEvent> events) {
|
||||
return new MappingResult(source, events,"");
|
||||
}
|
||||
|
||||
public static MappingResult of(Object source,TikTokEvent events) {
|
||||
return new MappingResult(source, List.of(events),"");
|
||||
}
|
||||
}
|
||||
@@ -64,8 +64,8 @@ message Text {
|
||||
string stringValue = 11;
|
||||
oneof textPieceType
|
||||
{
|
||||
TextPieceUser userValue = 21;
|
||||
TextPieceGift giftValue = 22;
|
||||
TextPieceUser userValue = 21;
|
||||
TextPieceGift giftValue = 22;
|
||||
}
|
||||
TextPiecePatternRef patternRefValue = 24;
|
||||
}
|
||||
@@ -155,7 +155,7 @@ message BadgeStruct {
|
||||
|
||||
message ProfileCardPanel {
|
||||
bool useNewProfileCardStyle = 1;
|
||||
// BadgeTextPosition badgeTextPosition = 2; // Enum
|
||||
// BadgeTextPosition badgeTextPosition = 2; // Enum
|
||||
ProjectionConfig projectionConfig = 3;
|
||||
ProfileContent profileContent = 4;
|
||||
}
|
||||
@@ -1000,8 +1000,8 @@ message LinkerCreateContent {
|
||||
|
||||
message LinkerEnterContent {
|
||||
repeated User LinkedUsersList = 1;
|
||||
// LinkmicMultiLiveEnum AnchorMultiLiveEnum = 2;
|
||||
// Data.LinkmicUserSettingInfo AnchorSettingInfo = 3;
|
||||
// LinkmicMultiLiveEnum AnchorMultiLiveEnum = 2;
|
||||
// Data.LinkmicUserSettingInfo AnchorSettingInfo = 3;
|
||||
}
|
||||
|
||||
message LinkerInviteContent {
|
||||
@@ -1018,15 +1018,15 @@ message LinkerInviteContent {
|
||||
//Data.LinkmicMultiLiveEnum AnchorMultiLiveEnum = 11;
|
||||
//Data.LinkmicUserSettingInfo AnchorSettingInfo = 12;
|
||||
string InviterLinkmicIdStr = 13;
|
||||
// InviteTopHostInfo FromTopHostInfo = 16;
|
||||
// InviteTopHostInfo FromTopHostInfo = 16;
|
||||
int64 ActionId = 17;
|
||||
// repeated LinkmicUserInfo LinkedUsersList = 18;
|
||||
// Data.PerceptionDialogInfo Dialog = 19;
|
||||
// Data.PunishEventInfo PunishInfo = 20;
|
||||
// repeated LinkmicUserInfo LinkedUsersList = 18;
|
||||
// Data.PerceptionDialogInfo Dialog = 19;
|
||||
// Data.PunishEventInfo PunishInfo = 20;
|
||||
int32 FromRoomAgeRestricted = 21;
|
||||
// Data.Tag FromTag = 22;
|
||||
// repeated Data.CohostABTestSetting AbTestSettingList = 23;
|
||||
// Data.LinkerInviteMessageExtra LinkerInviteMsgExtra = 101;
|
||||
// Data.Tag FromTag = 22;
|
||||
// repeated Data.CohostABTestSetting AbTestSettingList = 23;
|
||||
// Data.LinkerInviteMessageExtra LinkerInviteMsgExtra = 101;
|
||||
}
|
||||
|
||||
message LinkerKickOutContent {
|
||||
@@ -1046,17 +1046,17 @@ message LinkerLinkedListChangeContent {
|
||||
}
|
||||
|
||||
message LinkerListChangeContent {
|
||||
repeated User LinkedUsersList = 1;
|
||||
repeated User AppliedUsersList = 2;
|
||||
repeated User ConnectingUsersList = 3;
|
||||
repeated LinkLayerListUser LinkedUsersList = 1;
|
||||
repeated LinkLayerListUser AppliedUsersList = 2;
|
||||
repeated LinkLayerListUser ConnectingUsersList = 3;
|
||||
}
|
||||
|
||||
message LinkerMediaChangeContent {
|
||||
// MicIdxOperation Op = 1;
|
||||
// MicIdxOperation Op = 1;
|
||||
int64 ToUserId = 2;
|
||||
int64 AnchorId = 3;
|
||||
int64 RoomId = 4;
|
||||
// LinkerSceneType ChangeScene = 5;
|
||||
// LinkerSceneType ChangeScene = 5;
|
||||
}
|
||||
|
||||
message LinkerMicIdxUpdateContent {
|
||||
@@ -1064,14 +1064,14 @@ message LinkerMicIdxUpdateContent {
|
||||
}
|
||||
|
||||
message LinkerMicIdxUpdateInfo {
|
||||
// MicIdxOperation Op = 1;
|
||||
// MicIdxOperation Op = 1;
|
||||
int64 UserId = 2;
|
||||
int64 MicIdx = 3;
|
||||
}
|
||||
|
||||
message LinkerMuteContent {
|
||||
int64 UserId = 1;
|
||||
// Data.MuteStatus Status = 2;
|
||||
// Data.MuteStatus Status = 2;
|
||||
}
|
||||
|
||||
message LinkerRandomMatchContent {
|
||||
@@ -1085,9 +1085,9 @@ message LinkerRandomMatchContent {
|
||||
message LinkerReplyContent {
|
||||
int64 FromUserId = 1;
|
||||
int64 FromRoomId = 2;
|
||||
// LinkmicInfo FromUserLinkmicInfo = 3;
|
||||
// LinkmicInfo FromUserLinkmicInfo = 3;
|
||||
int64 ToUserId = 4;
|
||||
// LinkmicInfo ToUserLinkmicInfo = 5;
|
||||
// LinkmicInfo ToUserLinkmicInfo = 5;
|
||||
int64 LinkType = 6;
|
||||
int64 ReplyStatus = 7;
|
||||
LinkerSetting LinkerSetting = 8;
|
||||
@@ -1096,10 +1096,10 @@ message LinkerReplyContent {
|
||||
map<int64, string> RtcExtInfoMap = 11;
|
||||
LinkerMicIdxUpdateInfo InviteeMicIdxUpdateInfo = 12;
|
||||
map<int64, int64> ApplierMicIdxInfoMap = 13;
|
||||
// Data.LinkmicMultiLiveEnum AnchorMultiLiveEnum = 14;
|
||||
// Data.LinkmicUserSettingInfo AnchorSettingInfo = 15;
|
||||
// Data.LinkmicMultiLiveEnum AnchorMultiLiveEnum = 14;
|
||||
// Data.LinkmicUserSettingInfo AnchorSettingInfo = 15;
|
||||
int64 ActionId = 16;
|
||||
// repeated LinkmicUserInfo LinkedUsersList = 17;
|
||||
// repeated LinkmicUserInfo LinkedUsersList = 17;
|
||||
int64 SourceType = 18;
|
||||
}
|
||||
|
||||
@@ -1124,7 +1124,7 @@ message LinkerUpdateUserContent {
|
||||
}
|
||||
|
||||
message LinkerUpdateUserSettingContent {
|
||||
// Data.LinkmicUserSettingInfo UpdateUserSettingInfo = 1;
|
||||
// Data.LinkmicUserSettingInfo UpdateUserSettingInfo = 1;
|
||||
}
|
||||
|
||||
message LinkerWaitingListChangeContent {
|
||||
@@ -1156,10 +1156,11 @@ message AllListUser {
|
||||
|
||||
message LinkLayerListUser {
|
||||
User user = 1;
|
||||
string linkmicId = 2;
|
||||
int64 linkmicId = 2;
|
||||
Position pos = 3;
|
||||
int64 linkedTimeNano = 4;
|
||||
string appVersion = 5;
|
||||
int64 magicNumber1 = 7;
|
||||
}
|
||||
|
||||
message Position {
|
||||
|
||||
@@ -68,7 +68,6 @@ message WebcastGiftMessage {
|
||||
int32 repeatCount = 5;
|
||||
int32 comboCount = 6;
|
||||
User user = 7;
|
||||
User toUser = 8;
|
||||
int32 repeatEnd = 9;
|
||||
int64 groupId = 11;
|
||||
int64 incomeTaskgifts = 12;
|
||||
@@ -81,6 +80,13 @@ message WebcastGiftMessage {
|
||||
bool isFirstSent = 25;
|
||||
string orderId = 28;
|
||||
UserIdentity userIdentity = 32;
|
||||
UserGiftReciever userGiftReciever = 23;
|
||||
|
||||
message UserGiftReciever
|
||||
{
|
||||
int64 userId =1;
|
||||
string deviceName = 10;
|
||||
}
|
||||
|
||||
message GiftIMPriority {
|
||||
repeated int64 queueSizesList = 1;
|
||||
@@ -507,6 +513,9 @@ message WebcastHourlyRankMessage {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//<Battles>
|
||||
|
||||
//@WebcastLinkMicArmies
|
||||
message WebcastLinkMicArmies {
|
||||
Common common = 1;
|
||||
@@ -523,6 +532,45 @@ message WebcastLinkMicArmies {
|
||||
uint32 data4 = 12;
|
||||
uint32 data5 = 13;
|
||||
}
|
||||
//@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;
|
||||
}
|
||||
}
|
||||
|
||||
//@WebcastLinkmicBattleTaskMessage
|
||||
message WebcastLinkmicBattleTaskMessage {
|
||||
Common Header = 1;
|
||||
uint32 Data2 = 2;
|
||||
LinkmicBattleTaskData Data3 = 3;
|
||||
LinkmicBattleTaskData2 Data5 = 5;
|
||||
|
||||
message LinkmicBattleTaskData {
|
||||
BattleTaskData Data1 = 1;
|
||||
}
|
||||
message BattleTaskData {
|
||||
uint32 Data1 = 1;
|
||||
}
|
||||
|
||||
message LinkmicBattleTaskData2 {
|
||||
uint32 Data1 = 1;
|
||||
uint32 Data2 = 2;
|
||||
}
|
||||
}
|
||||
|
||||
//@WebcastLinkMicBattle
|
||||
message WebcastLinkMicBattle {
|
||||
@@ -572,7 +620,6 @@ message WebcastLinkMicFanTicketMethod {
|
||||
Common common = 1;
|
||||
FanTicketRoomNoticeContent FanTicketRoomNotice = 2;
|
||||
}
|
||||
|
||||
//@WebcastLinkMicMethod
|
||||
message WebcastLinkMicMethod {
|
||||
Common common = 1;
|
||||
@@ -590,6 +637,8 @@ message WebcastLinkMicMethod {
|
||||
int64 inviteUid = 13;
|
||||
}
|
||||
|
||||
//<Battles>
|
||||
|
||||
//@WebcastLiveIntroMessage
|
||||
message WebcastLiveIntroMessage {
|
||||
Common common = 1;
|
||||
|
||||
Reference in New Issue
Block a user