mirror of
https://github.com/jwdeveloper/TikTokLiveJava.git
synced 2026-02-28 01:09:40 -05:00
Quick string alteration for proper state!
This commit is contained in:
@@ -30,14 +30,12 @@ import lombok.Getter;
|
||||
@Getter
|
||||
@EventMeta(eventType = EventType.Control)
|
||||
public class TikTokDisconnectedEvent extends TikTokLiveClientEvent {
|
||||
/** Valid CloseFrame code or -1 for unknown */
|
||||
private final int code;
|
||||
private final String reason;
|
||||
|
||||
public TikTokDisconnectedEvent(String reason) {
|
||||
public TikTokDisconnectedEvent(int code, String reason) {
|
||||
this.code = code;
|
||||
this.reason = reason.isBlank() ? "None" : reason;
|
||||
}
|
||||
|
||||
public static TikTokDisconnectedEvent of(String reason)
|
||||
{
|
||||
return new TikTokDisconnectedEvent(reason);
|
||||
}
|
||||
}
|
||||
@@ -22,7 +22,7 @@
|
||||
*/
|
||||
package io.github.jwdeveloper.tiktok.data.requests;
|
||||
|
||||
import io.github.jwdeveloper.tiktok.data.models.users.User;
|
||||
import io.github.jwdeveloper.tiktok.live.LiveRoomInfo;
|
||||
import lombok.*;
|
||||
|
||||
public class LiveUserData {
|
||||
@@ -43,9 +43,7 @@ public class LiveUserData {
|
||||
public static class Response {
|
||||
private final String json;
|
||||
private final UserStatus userStatus;
|
||||
private final String roomId;
|
||||
private final long startTime;
|
||||
private final User user;
|
||||
private final LiveRoomInfo roomInfo;
|
||||
|
||||
public boolean isLiveOnline() {
|
||||
return userStatus == LiveUserData.UserStatus.Live || userStatus == LiveUserData.UserStatus.LivePaused;
|
||||
|
||||
@@ -89,6 +89,11 @@ public class LiveClientSettings {
|
||||
/** Throw an exception on 18+ Age Restriction */
|
||||
private boolean throwOnAgeRestriction;
|
||||
|
||||
/** Use Eulerstream.com websocket for events
|
||||
* @apiNote Requires API Key
|
||||
*/
|
||||
private boolean useEulerstreamWebsocket;
|
||||
|
||||
/**
|
||||
* Optional: Sometimes not every messages from chat are send to TikTokLiveJava to fix this issue you can set sessionId.
|
||||
* <p>This requires {@link #ttTargetIdc} also being set correctly for sessionid to be effective.
|
||||
|
||||
@@ -49,5 +49,7 @@ public interface LiveRoomInfo
|
||||
String getTitle();
|
||||
User getHost();
|
||||
List<RankingUser> getUsersRanking();
|
||||
String getLanguage();
|
||||
ConnectionState getConnectionState();
|
||||
void copy(LiveRoomInfo roomInfo);
|
||||
}
|
||||
Reference in New Issue
Block a user