Quick string alteration for proper state!

This commit is contained in:
kohlerpop1
2025-09-15 23:12:43 -04:00
parent c8120d89b2
commit 54433af65f
17 changed files with 285 additions and 86 deletions

View File

@@ -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);
}
}

View File

@@ -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;

View File

@@ -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.

View File

@@ -49,5 +49,7 @@ public interface LiveRoomInfo
String getTitle();
User getHost();
List<RankingUser> getUsersRanking();
String getLanguage();
ConnectionState getConnectionState();
void copy(LiveRoomInfo roomInfo);
}