mirror of
https://github.com/jwdeveloper/TikTokLiveJava.git
synced 2026-02-27 16:59:39 -05:00
Compare commits
65 Commits
1.8.2-Rele
...
1.8.13-Rel
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
31f0e4210d | ||
|
|
2e22da1fbe | ||
|
|
4b4874d33e | ||
|
|
9c7b24f33e | ||
|
|
7476a11ae0 | ||
|
|
125e421ea9 | ||
|
|
5d84e28bdb | ||
|
|
a9003f4296 | ||
|
|
8cd640f8eb | ||
|
|
ca741ed931 | ||
|
|
96872e27b5 | ||
|
|
f6fbd60eca | ||
|
|
437335f784 | ||
|
|
84b0a3aaf4 | ||
|
|
14bf9c8c9b | ||
|
|
2dc3001e7b | ||
|
|
29a81f4cd6 | ||
|
|
70fd174a95 | ||
|
|
3e23e5b939 | ||
|
|
733e72f814 | ||
|
|
838728d47d | ||
|
|
fd6158410a | ||
|
|
6c56a96ba8 | ||
|
|
bb5659574c | ||
|
|
286da42e54 | ||
|
|
3d0b9ddcc0 | ||
|
|
354c072833 | ||
|
|
f85f24a5c8 | ||
|
|
2550a462f9 | ||
|
|
eb7b977d62 | ||
|
|
1c2c701be0 | ||
|
|
a2303f1fde | ||
|
|
a8ac0f6fff | ||
|
|
732eda3d22 | ||
|
|
358954984b | ||
|
|
acb13ea58a | ||
|
|
e8129862d1 | ||
|
|
88e36e7e90 | ||
|
|
eef9d43d01 | ||
|
|
75f3896a86 | ||
|
|
e679ff23b7 | ||
|
|
e6211e69c5 | ||
|
|
1b3ee24aea | ||
|
|
c9309ee2cf | ||
|
|
a28df44cee | ||
|
|
ee866762a3 | ||
|
|
3cb7c83ef4 | ||
|
|
bf755bcb89 | ||
|
|
20bb05e527 | ||
|
|
d5a3213ad8 | ||
|
|
7e496373ef | ||
|
|
1f3c1c7d41 | ||
|
|
c160259863 | ||
|
|
fb458e7e7d | ||
|
|
5f5ada312a | ||
|
|
cb20c3dd3a | ||
|
|
bf42f65b3d | ||
|
|
05e18ef8e0 | ||
|
|
0f6ee58d7f | ||
|
|
511759960d | ||
|
|
617d1c381a | ||
|
|
6f8b4698cd | ||
|
|
2bc1993ea5 | ||
|
|
3d4a517adb | ||
|
|
ee0b559758 |
2
.github/workflows/maven-publish.yml
vendored
2
.github/workflows/maven-publish.yml
vendored
@@ -53,7 +53,7 @@ jobs:
|
|||||||
restore-keys: ${{runner.os}}-m2
|
restore-keys: ${{runner.os}}-m2
|
||||||
|
|
||||||
- name: 7 Create Artifacts
|
- name: 7 Create Artifacts
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: ${{ steps.version.outputs.version_tag }}
|
name: ${{ steps.version.outputs.version_tag }}
|
||||||
path: staging
|
path: staging
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>TikTokLiveJava</artifactId>
|
<artifactId>TikTokLiveJava</artifactId>
|
||||||
<groupId>io.github.jwdeveloper.tiktok</groupId>
|
<groupId>io.github.jwdeveloper.tiktok</groupId>
|
||||||
<version>1.8.1-Release</version>
|
<version>1.8.12-Release</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<artifactId>API</artifactId>
|
<artifactId>API</artifactId>
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.google.protobuf</groupId>
|
<groupId>com.google.protobuf</groupId>
|
||||||
<artifactId>protobuf-java</artifactId>
|
<artifactId>protobuf-java</artifactId>
|
||||||
<version>3.24.1</version>
|
<version>4.26.1</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
@@ -51,6 +51,7 @@
|
|||||||
</goals>
|
</goals>
|
||||||
<configuration>
|
<configuration>
|
||||||
<includeMavenTypes>direct</includeMavenTypes>
|
<includeMavenTypes>direct</includeMavenTypes>
|
||||||
|
<protocVersion>4.26.1</protocVersion>
|
||||||
<inputDirectories>
|
<inputDirectories>
|
||||||
<include>src/main/proto</include>
|
<include>src/main/proto</include>
|
||||||
</inputDirectories>
|
</inputDirectories>
|
||||||
@@ -79,4 +80,4 @@
|
|||||||
</plugin>
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
</project>
|
</project>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2023-2023 jwdeveloper jacekwoln@gmail.com
|
* Copyright (c) 2023-2024 jwdeveloper jacekwoln@gmail.com
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
* a copy of this software and associated documentation files (the
|
* a copy of this software and associated documentation files (the
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2023-2023 jwdeveloper jacekwoln@gmail.com
|
* Copyright (c) 2023-2024 jwdeveloper jacekwoln@gmail.com
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
* a copy of this software and associated documentation files (the
|
* a copy of this software and associated documentation files (the
|
||||||
|
|||||||
@@ -1,3 +1,25 @@
|
|||||||
|
/*
|
||||||
|
* 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.annotations;
|
package io.github.jwdeveloper.tiktok.annotations;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2023-2023 jwdeveloper jacekwoln@gmail.com
|
* Copyright (c) 2023-2024 jwdeveloper jacekwoln@gmail.com
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
* a copy of this software and associated documentation files (the
|
* a copy of this software and associated documentation files (the
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2023-2023 jwdeveloper jacekwoln@gmail.com
|
* Copyright (c) 2023-2024 jwdeveloper jacekwoln@gmail.com
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
* a copy of this software and associated documentation files (the
|
* a copy of this software and associated documentation files (the
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2023-2023 jwdeveloper jacekwoln@gmail.com
|
* Copyright (c) 2023-2024 jwdeveloper jacekwoln@gmail.com
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
* a copy of this software and associated documentation files (the
|
* a copy of this software and associated documentation files (the
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2023-2023 jwdeveloper jacekwoln@gmail.com
|
* Copyright (c) 2023-2024 jwdeveloper jacekwoln@gmail.com
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
* a copy of this software and associated documentation files (the
|
* a copy of this software and associated documentation files (the
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2023-2023 jwdeveloper jacekwoln@gmail.com
|
* Copyright (c) 2023-2024 jwdeveloper jacekwoln@gmail.com
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
* a copy of this software and associated documentation files (the
|
* a copy of this software and associated documentation files (the
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2023-2023 jwdeveloper jacekwoln@gmail.com
|
* Copyright (c) 2023-2024 jwdeveloper jacekwoln@gmail.com
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
* a copy of this software and associated documentation files (the
|
* a copy of this software and associated documentation files (the
|
||||||
@@ -58,6 +58,7 @@ public class TikTokCommentEvent extends TikTokHeaderEvent {
|
|||||||
var builder = WebcastChatMessage.newBuilder();
|
var builder = WebcastChatMessage.newBuilder();
|
||||||
builder.setUser(io.github.jwdeveloper.tiktok.messages.data.User.newBuilder()
|
builder.setUser(io.github.jwdeveloper.tiktok.messages.data.User.newBuilder()
|
||||||
.setNickname(userName)
|
.setNickname(userName)
|
||||||
|
.setDisplayId(userName)
|
||||||
.build());
|
.build());
|
||||||
builder.setContentLanguage("en");
|
builder.setContentLanguage("en");
|
||||||
builder.setVisibleToSender(true);
|
builder.setVisibleToSender(true);
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2023-2023 jwdeveloper jacekwoln@gmail.com
|
* Copyright (c) 2023-2024 jwdeveloper jacekwoln@gmail.com
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
* a copy of this software and associated documentation files (the
|
* a copy of this software and associated documentation files (the
|
||||||
@@ -29,4 +29,9 @@ import io.github.jwdeveloper.tiktok.data.events.common.TikTokLiveClientEvent;
|
|||||||
public class TikTokConnectedEvent extends TikTokLiveClientEvent
|
public class TikTokConnectedEvent extends TikTokLiveClientEvent
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
|
public static TikTokConnectedEvent of()
|
||||||
|
{
|
||||||
|
return new TikTokConnectedEvent();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2023-2023 jwdeveloper jacekwoln@gmail.com
|
* Copyright (c) 2023-2024 jwdeveloper jacekwoln@gmail.com
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
* a copy of this software and associated documentation files (the
|
* a copy of this software and associated documentation files (the
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2023-2023 jwdeveloper jacekwoln@gmail.com
|
* Copyright (c) 2023-2024 jwdeveloper jacekwoln@gmail.com
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
* a copy of this software and associated documentation files (the
|
* a copy of this software and associated documentation files (the
|
||||||
@@ -36,7 +36,8 @@ public class TikTokDisconnectedEvent extends TikTokLiveClientEvent {
|
|||||||
this.reason = reason.isBlank() ? "None" : reason;
|
this.reason = reason.isBlank() ? "None" : reason;
|
||||||
}
|
}
|
||||||
|
|
||||||
public TikTokDisconnectedEvent() {
|
public static TikTokDisconnectedEvent of(String reason)
|
||||||
this("None");
|
{
|
||||||
|
return new TikTokDisconnectedEvent(reason);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2023-2023 jwdeveloper jacekwoln@gmail.com
|
* Copyright (c) 2023-2024 jwdeveloper jacekwoln@gmail.com
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
* a copy of this software and associated documentation files (the
|
* a copy of this software and associated documentation files (the
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2023-2023 jwdeveloper jacekwoln@gmail.com
|
* Copyright (c) 2023-2024 jwdeveloper jacekwoln@gmail.com
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
* a copy of this software and associated documentation files (the
|
* a copy of this software and associated documentation files (the
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2023-2023 jwdeveloper jacekwoln@gmail.com
|
* Copyright (c) 2023-2024 jwdeveloper jacekwoln@gmail.com
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
* a copy of this software and associated documentation files (the
|
* a copy of this software and associated documentation files (the
|
||||||
@@ -25,13 +25,18 @@ package io.github.jwdeveloper.tiktok.data.events;
|
|||||||
import io.github.jwdeveloper.tiktok.annotations.EventMeta;
|
import io.github.jwdeveloper.tiktok.annotations.EventMeta;
|
||||||
import io.github.jwdeveloper.tiktok.annotations.EventType;
|
import io.github.jwdeveloper.tiktok.annotations.EventType;
|
||||||
import io.github.jwdeveloper.tiktok.data.events.common.TikTokLiveClientEvent;
|
import io.github.jwdeveloper.tiktok.data.events.common.TikTokLiveClientEvent;
|
||||||
|
import io.github.jwdeveloper.tiktok.exceptions.TikTokLiveException;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@EventMeta(eventType = EventType.Control)
|
@EventMeta(eventType = EventType.Control)
|
||||||
public class TikTokErrorEvent extends TikTokLiveClientEvent
|
public class TikTokErrorEvent extends TikTokLiveClientEvent {
|
||||||
{
|
|
||||||
private final Throwable exception;
|
private final Throwable exception;
|
||||||
|
|
||||||
|
|
||||||
|
public static TikTokErrorEvent of(String message) {
|
||||||
|
return new TikTokErrorEvent(new TikTokLiveException(message));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2023-2023 jwdeveloper jacekwoln@gmail.com
|
* Copyright (c) 2023-2024 jwdeveloper jacekwoln@gmail.com
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
* a copy of this software and associated documentation files (the
|
* a copy of this software and associated documentation files (the
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2023-2023 jwdeveloper jacekwoln@gmail.com
|
* Copyright (c) 2023-2024 jwdeveloper jacekwoln@gmail.com
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
* a copy of this software and associated documentation files (the
|
* a copy of this software and associated documentation files (the
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2023-2023 jwdeveloper jacekwoln@gmail.com
|
* Copyright (c) 2023-2024 jwdeveloper jacekwoln@gmail.com
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
* a copy of this software and associated documentation files (the
|
* a copy of this software and associated documentation files (the
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2023-2023 jwdeveloper jacekwoln@gmail.com
|
* Copyright (c) 2023-2024 jwdeveloper jacekwoln@gmail.com
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
* a copy of this software and associated documentation files (the
|
* a copy of this software and associated documentation files (the
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2023-2023 jwdeveloper jacekwoln@gmail.com
|
* Copyright (c) 2023-2024 jwdeveloper jacekwoln@gmail.com
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
* a copy of this software and associated documentation files (the
|
* a copy of this software and associated documentation files (the
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2023-2023 jwdeveloper jacekwoln@gmail.com
|
* Copyright (c) 2023-2024 jwdeveloper jacekwoln@gmail.com
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
* a copy of this software and associated documentation files (the
|
* a copy of this software and associated documentation files (the
|
||||||
@@ -25,11 +25,12 @@ package io.github.jwdeveloper.tiktok.data.events;
|
|||||||
import io.github.jwdeveloper.tiktok.annotations.*;
|
import io.github.jwdeveloper.tiktok.annotations.*;
|
||||||
import io.github.jwdeveloper.tiktok.data.events.common.TikTokHeaderEvent;
|
import io.github.jwdeveloper.tiktok.data.events.common.TikTokHeaderEvent;
|
||||||
import io.github.jwdeveloper.tiktok.data.models.battles.*;
|
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.messages.enums.LinkMicBattleStatus;
|
||||||
import io.github.jwdeveloper.tiktok.messages.webcast.WebcastLinkMicBattle;
|
import io.github.jwdeveloper.tiktok.messages.webcast.WebcastLinkMicBattle;
|
||||||
import lombok.*;
|
import lombok.Getter;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Triggered every time a battle starts & ends
|
* Triggered every time a battle starts & ends
|
||||||
@@ -43,23 +44,22 @@ public class TikTokLinkMicBattleEvent extends TikTokHeaderEvent
|
|||||||
true if battle is finished otherwise false
|
true if battle is finished otherwise false
|
||||||
*/
|
*/
|
||||||
private final boolean finished;
|
private final boolean finished;
|
||||||
private final List<Team> teams;
|
private final Team team1, team2;
|
||||||
|
|
||||||
public TikTokLinkMicBattleEvent(WebcastLinkMicBattle msg) {
|
public TikTokLinkMicBattleEvent(WebcastLinkMicBattle msg) {
|
||||||
super(msg.getCommon());
|
super(msg.getCommon());
|
||||||
battleId = msg.getId();
|
battleId = msg.getId();
|
||||||
finished = msg.getBattleStatus() == LinkMicBattleStatus.BATTLE_FINISHED;
|
finished = msg.getBattleStatus() == LinkMicBattleStatus.BATTLE_FINISHED;
|
||||||
teams = new ArrayList<>();
|
|
||||||
if (msg.getHostTeamCount() == 2) { // 1v1 battle
|
if (msg.getHostTeamCount() == 2) { // 1v1 battle
|
||||||
teams.add(new Team1v1(msg.getHostTeam(0), msg));
|
team1 = new Team1v1(msg.getHostTeam(0), msg);
|
||||||
teams.add(new Team1v1(msg.getHostTeam(1), msg));
|
team2 = new Team1v1(msg.getHostTeam(1), msg);
|
||||||
} else { // 2v2 battle
|
} else { // 2v2 battle
|
||||||
if (isFinished()) {
|
if (isFinished()) {
|
||||||
teams.add(new Team2v2(msg.getHostData2V2List().stream().filter(data -> data.getTeamNumber() == 1).findFirst().orElse(null), msg));
|
team1 = new Team2v2(msg.getHostData2V2List().stream().filter(data -> data.getTeamNumber() == 1).findFirst().orElse(null), msg);
|
||||||
teams.add(new Team2v2(msg.getHostData2V2List().stream().filter(data -> data.getTeamNumber() == 2).findFirst().orElse(null), msg));
|
team2 = new Team2v2(msg.getHostData2V2List().stream().filter(data -> data.getTeamNumber() == 2).findFirst().orElse(null), msg);
|
||||||
} else {
|
} else {
|
||||||
teams.add(new Team2v2(msg.getHostTeam(0), msg.getHostTeam(1), msg));
|
team1 = new Team2v2(msg.getHostTeam(0), msg.getHostTeam(1), msg);
|
||||||
teams.add(new Team2v2(msg.getHostTeam(2), msg.getHostTeam(3), msg));
|
team2 = new Team2v2(msg.getHostTeam(2), msg.getHostTeam(3), msg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -69,15 +69,69 @@ public class TikTokLinkMicBattleEvent extends TikTokHeaderEvent
|
|||||||
// - msg.getHostTeamCount() always is 2 for 1v1 or 4 for 2v2
|
// - 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<Team> 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<Team> 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<Team> 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<Team> list = getTeams(battleHostName);
|
||||||
|
return list.isEmpty() ? null : list.get(1).getAs2v2Team();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param battleHostName name of host to search
|
||||||
|
* @return {@link List<Team>} with host team first, then opponent team
|
||||||
|
* <p> Empty if host is in neither otherwise always 2 in length;
|
||||||
|
*/
|
||||||
|
public List<Team> 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();
|
||||||
|
}
|
||||||
|
|
||||||
public boolean is1v1() {
|
public boolean is1v1() {
|
||||||
return teams.get(0) instanceof Team1v1;
|
return team1.is1v1Team() || team2.is1v1Team();
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean is2v2() {
|
public boolean is2v2() {
|
||||||
return teams.get(0) instanceof Team2v2;
|
return team1.is2v2Team() || team2.is2v2Team();
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isTie() {
|
public boolean isTie() {
|
||||||
return isFinished() && teams.get(0).getTotalPoints() == teams.get(1).getTotalPoints();
|
return isFinished() && team1.getTotalPoints() == team2.getTotalPoints();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2023-2023 jwdeveloper jacekwoln@gmail.com
|
* Copyright (c) 2023-2024 jwdeveloper jacekwoln@gmail.com
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
* a copy of this software and associated documentation files (the
|
* a copy of this software and associated documentation files (the
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2023-2023 jwdeveloper jacekwoln@gmail.com
|
* Copyright (c) 2023-2024 jwdeveloper jacekwoln@gmail.com
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
* a copy of this software and associated documentation files (the
|
* a copy of this software and associated documentation files (the
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2023-2023 jwdeveloper jacekwoln@gmail.com
|
* Copyright (c) 2023-2024 jwdeveloper jacekwoln@gmail.com
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
* a copy of this software and associated documentation files (the
|
* a copy of this software and associated documentation files (the
|
||||||
@@ -24,9 +24,14 @@ package io.github.jwdeveloper.tiktok.data.events;
|
|||||||
import io.github.jwdeveloper.tiktok.annotations.EventMeta;
|
import io.github.jwdeveloper.tiktok.annotations.EventMeta;
|
||||||
import io.github.jwdeveloper.tiktok.annotations.EventType;
|
import io.github.jwdeveloper.tiktok.annotations.EventType;
|
||||||
import io.github.jwdeveloper.tiktok.data.events.common.TikTokEvent;
|
import io.github.jwdeveloper.tiktok.data.events.common.TikTokEvent;
|
||||||
|
import io.github.jwdeveloper.tiktok.data.events.control.TikTokConnectingEvent;
|
||||||
|
|
||||||
|
|
||||||
@EventMeta(eventType = EventType.Message)
|
@EventMeta(eventType = EventType.Message)
|
||||||
public class TikTokLiveEndedEvent extends TikTokEvent {
|
public class TikTokLiveEndedEvent extends TikTokEvent {
|
||||||
|
|
||||||
|
|
||||||
|
public static TikTokLiveEndedEvent of() {
|
||||||
|
return new TikTokLiveEndedEvent();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2023-2023 jwdeveloper jacekwoln@gmail.com
|
* Copyright (c) 2023-2024 jwdeveloper jacekwoln@gmail.com
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
* a copy of this software and associated documentation files (the
|
* a copy of this software and associated documentation files (the
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2023-2023 jwdeveloper jacekwoln@gmail.com
|
* Copyright (c) 2023-2024 jwdeveloper jacekwoln@gmail.com
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
* a copy of this software and associated documentation files (the
|
* a copy of this software and associated documentation files (the
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2023-2023 jwdeveloper jacekwoln@gmail.com
|
* Copyright (c) 2023-2024 jwdeveloper jacekwoln@gmail.com
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
* a copy of this software and associated documentation files (the
|
* a copy of this software and associated documentation files (the
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2023-2023 jwdeveloper jacekwoln@gmail.com
|
* Copyright (c) 2023-2024 jwdeveloper jacekwoln@gmail.com
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
* a copy of this software and associated documentation files (the
|
* a copy of this software and associated documentation files (the
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2023-2023 jwdeveloper jacekwoln@gmail.com
|
* Copyright (c) 2023-2024 jwdeveloper jacekwoln@gmail.com
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
* a copy of this software and associated documentation files (the
|
* a copy of this software and associated documentation files (the
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2023-2023 jwdeveloper jacekwoln@gmail.com
|
* Copyright (c) 2023-2024 jwdeveloper jacekwoln@gmail.com
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
* a copy of this software and associated documentation files (the
|
* a copy of this software and associated documentation files (the
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2023-2023 jwdeveloper jacekwoln@gmail.com
|
* Copyright (c) 2023-2024 jwdeveloper jacekwoln@gmail.com
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
* a copy of this software and associated documentation files (the
|
* a copy of this software and associated documentation files (the
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2023-2023 jwdeveloper jacekwoln@gmail.com
|
* Copyright (c) 2023-2024 jwdeveloper jacekwoln@gmail.com
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
* a copy of this software and associated documentation files (the
|
* a copy of this software and associated documentation files (the
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2023-2023 jwdeveloper jacekwoln@gmail.com
|
* Copyright (c) 2023-2024 jwdeveloper jacekwoln@gmail.com
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
* a copy of this software and associated documentation files (the
|
* a copy of this software and associated documentation files (the
|
||||||
@@ -53,6 +53,7 @@ public class TikTokSubscribeEvent extends TikTokHeaderEvent {
|
|||||||
public static TikTokSubscribeEvent of(String userName) {
|
public static TikTokSubscribeEvent of(String userName) {
|
||||||
return new TikTokSubscribeEvent(WebcastMemberMessage.newBuilder()
|
return new TikTokSubscribeEvent(WebcastMemberMessage.newBuilder()
|
||||||
.setUser(io.github.jwdeveloper.tiktok.messages.data.User.newBuilder()
|
.setUser(io.github.jwdeveloper.tiktok.messages.data.User.newBuilder()
|
||||||
|
.setDisplayId(userName)
|
||||||
.setNickname(userName)
|
.setNickname(userName)
|
||||||
.build())
|
.build())
|
||||||
.build());
|
.build());
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2023-2023 jwdeveloper jacekwoln@gmail.com
|
* Copyright (c) 2023-2024 jwdeveloper jacekwoln@gmail.com
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
* a copy of this software and associated documentation files (the
|
* a copy of this software and associated documentation files (the
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2023-2023 jwdeveloper jacekwoln@gmail.com
|
* Copyright (c) 2023-2024 jwdeveloper jacekwoln@gmail.com
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
* a copy of this software and associated documentation files (the
|
* a copy of this software and associated documentation files (the
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2023-2023 jwdeveloper jacekwoln@gmail.com
|
* Copyright (c) 2023-2024 jwdeveloper jacekwoln@gmail.com
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
* a copy of this software and associated documentation files (the
|
* a copy of this software and associated documentation files (the
|
||||||
@@ -35,4 +35,4 @@ public class TikTokUnhandledMemberEvent extends TikTokUnhandledEvent<WebcastMemb
|
|||||||
public TikTokUnhandledMemberEvent(WebcastMemberMessage data) {
|
public TikTokUnhandledMemberEvent(WebcastMemberMessage data) {
|
||||||
super(data);
|
super(data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2023-2023 jwdeveloper jacekwoln@gmail.com
|
* Copyright (c) 2023-2024 jwdeveloper jacekwoln@gmail.com
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
* a copy of this software and associated documentation files (the
|
* a copy of this software and associated documentation files (the
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2023-2023 jwdeveloper jacekwoln@gmail.com
|
* Copyright (c) 2023-2024 jwdeveloper jacekwoln@gmail.com
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
* a copy of this software and associated documentation files (the
|
* a copy of this software and associated documentation files (the
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2023-2023 jwdeveloper jacekwoln@gmail.com
|
* Copyright (c) 2023-2024 jwdeveloper jacekwoln@gmail.com
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
* a copy of this software and associated documentation files (the
|
* a copy of this software and associated documentation files (the
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2023-2023 jwdeveloper jacekwoln@gmail.com
|
* Copyright (c) 2023-2024 jwdeveloper jacekwoln@gmail.com
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
* a copy of this software and associated documentation files (the
|
* a copy of this software and associated documentation files (the
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2023-2023 jwdeveloper jacekwoln@gmail.com
|
* Copyright (c) 2023-2024 jwdeveloper jacekwoln@gmail.com
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
* a copy of this software and associated documentation files (the
|
* a copy of this software and associated documentation files (the
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2023-2023 jwdeveloper jacekwoln@gmail.com
|
* Copyright (c) 2023-2024 jwdeveloper jacekwoln@gmail.com
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
* a copy of this software and associated documentation files (the
|
* a copy of this software and associated documentation files (the
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2023-2023 jwdeveloper jacekwoln@gmail.com
|
* Copyright (c) 2023-2024 jwdeveloper jacekwoln@gmail.com
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
* a copy of this software and associated documentation files (the
|
* a copy of this software and associated documentation files (the
|
||||||
@@ -31,7 +31,9 @@ import io.github.jwdeveloper.tiktok.data.events.common.TikTokLiveClientEvent;
|
|||||||
* Triggered when client is connecting to live is successfully established.
|
* Triggered when client is connecting to live is successfully established.
|
||||||
*/
|
*/
|
||||||
@EventMeta(eventType = EventType.Control)
|
@EventMeta(eventType = EventType.Control)
|
||||||
public class TikTokConnectingEvent extends TikTokLiveClientEvent
|
public class TikTokConnectingEvent extends TikTokLiveClientEvent {
|
||||||
{
|
|
||||||
|
|
||||||
|
public static TikTokConnectingEvent of() {
|
||||||
|
return new TikTokConnectingEvent();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2023-2023 jwdeveloper jacekwoln@gmail.com
|
* Copyright (c) 2023-2024 jwdeveloper jacekwoln@gmail.com
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
* a copy of this software and associated documentation files (the
|
* a copy of this software and associated documentation files (the
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2023-2023 jwdeveloper jacekwoln@gmail.com
|
* Copyright (c) 2023-2024 jwdeveloper jacekwoln@gmail.com
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
* a copy of this software and associated documentation files (the
|
* a copy of this software and associated documentation files (the
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2023-2023 jwdeveloper jacekwoln@gmail.com
|
* Copyright (c) 2023-2024 jwdeveloper jacekwoln@gmail.com
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
* a copy of this software and associated documentation files (the
|
* a copy of this software and associated documentation files (the
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2023-2023 jwdeveloper jacekwoln@gmail.com
|
* Copyright (c) 2023-2024 jwdeveloper jacekwoln@gmail.com
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
* a copy of this software and associated documentation files (the
|
* a copy of this software and associated documentation files (the
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2023-2023 jwdeveloper jacekwoln@gmail.com
|
* Copyright (c) 2023-2024 jwdeveloper jacekwoln@gmail.com
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
* a copy of this software and associated documentation files (the
|
* a copy of this software and associated documentation files (the
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2023-2023 jwdeveloper jacekwoln@gmail.com
|
* Copyright (c) 2023-2024 jwdeveloper jacekwoln@gmail.com
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
* a copy of this software and associated documentation files (the
|
* a copy of this software and associated documentation files (the
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2023-2023 jwdeveloper jacekwoln@gmail.com
|
* Copyright (c) 2023-2024 jwdeveloper jacekwoln@gmail.com
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
* a copy of this software and associated documentation files (the
|
* a copy of this software and associated documentation files (the
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2023-2023 jwdeveloper jacekwoln@gmail.com
|
* Copyright (c) 2023-2024 jwdeveloper jacekwoln@gmail.com
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
* a copy of this software and associated documentation files (the
|
* a copy of this software and associated documentation files (the
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2023-2023 jwdeveloper jacekwoln@gmail.com
|
* Copyright (c) 2023-2024 jwdeveloper jacekwoln@gmail.com
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
* a copy of this software and associated documentation files (the
|
* a copy of this software and associated documentation files (the
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2023-2023 jwdeveloper jacekwoln@gmail.com
|
* Copyright (c) 2023-2024 jwdeveloper jacekwoln@gmail.com
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
* a copy of this software and associated documentation files (the
|
* a copy of this software and associated documentation files (the
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2023-2023 jwdeveloper jacekwoln@gmail.com
|
* Copyright (c) 2023-2024 jwdeveloper jacekwoln@gmail.com
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
* a copy of this software and associated documentation files (the
|
* a copy of this software and associated documentation files (the
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2023-2023 jwdeveloper jacekwoln@gmail.com
|
* Copyright (c) 2023-2024 jwdeveloper jacekwoln@gmail.com
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
* a copy of this software and associated documentation files (the
|
* a copy of this software and associated documentation files (the
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2023-2023 jwdeveloper jacekwoln@gmail.com
|
* Copyright (c) 2023-2024 jwdeveloper jacekwoln@gmail.com
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
* a copy of this software and associated documentation files (the
|
* a copy of this software and associated documentation files (the
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2023-2023 jwdeveloper jacekwoln@gmail.com
|
* Copyright (c) 2023-2024 jwdeveloper jacekwoln@gmail.com
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
* a copy of this software and associated documentation files (the
|
* a copy of this software and associated documentation files (the
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2023-2023 jwdeveloper jacekwoln@gmail.com
|
* Copyright (c) 2023-2024 jwdeveloper jacekwoln@gmail.com
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
* a copy of this software and associated documentation files (the
|
* a copy of this software and associated documentation files (the
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2023-2023 jwdeveloper jacekwoln@gmail.com
|
* Copyright (c) 2023-2024 jwdeveloper jacekwoln@gmail.com
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
* a copy of this software and associated documentation files (the
|
* a copy of this software and associated documentation files (the
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2023-2023 jwdeveloper jacekwoln@gmail.com
|
* Copyright (c) 2023-2024 jwdeveloper jacekwoln@gmail.com
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
* a copy of this software and associated documentation files (the
|
* a copy of this software and associated documentation files (the
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2023-2023 jwdeveloper jacekwoln@gmail.com
|
* Copyright (c) 2023-2024 jwdeveloper jacekwoln@gmail.com
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
* a copy of this software and associated documentation files (the
|
* a copy of this software and associated documentation files (the
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2023-2023 jwdeveloper jacekwoln@gmail.com
|
* Copyright (c) 2023-2024 jwdeveloper jacekwoln@gmail.com
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
* a copy of this software and associated documentation files (the
|
* a copy of this software and associated documentation files (the
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2023-2023 jwdeveloper jacekwoln@gmail.com
|
* Copyright (c) 2023-2024 jwdeveloper jacekwoln@gmail.com
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
* a copy of this software and associated documentation files (the
|
* a copy of this software and associated documentation files (the
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2023-2023 jwdeveloper jacekwoln@gmail.com
|
* Copyright (c) 2023-2024 jwdeveloper jacekwoln@gmail.com
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
* a copy of this software and associated documentation files (the
|
* a copy of this software and associated documentation files (the
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2023-2023 jwdeveloper jacekwoln@gmail.com
|
* Copyright (c) 2023-2024 jwdeveloper jacekwoln@gmail.com
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
* a copy of this software and associated documentation files (the
|
* a copy of this software and associated documentation files (the
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2023-2023 jwdeveloper jacekwoln@gmail.com
|
* Copyright (c) 2023-2024 jwdeveloper jacekwoln@gmail.com
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
* a copy of this software and associated documentation files (the
|
* a copy of this software and associated documentation files (the
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2023-2023 jwdeveloper jacekwoln@gmail.com
|
* Copyright (c) 2023-2024 jwdeveloper jacekwoln@gmail.com
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
* a copy of this software and associated documentation files (the
|
* a copy of this software and associated documentation files (the
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2023-2023 jwdeveloper jacekwoln@gmail.com
|
* Copyright (c) 2023-2024 jwdeveloper jacekwoln@gmail.com
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
* a copy of this software and associated documentation files (the
|
* a copy of this software and associated documentation files (the
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2023-2023 jwdeveloper jacekwoln@gmail.com
|
* Copyright (c) 2023-2024 jwdeveloper jacekwoln@gmail.com
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
* a copy of this software and associated documentation files (the
|
* a copy of this software and associated documentation files (the
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2023-2023 jwdeveloper jacekwoln@gmail.com
|
* Copyright (c) 2023-2024 jwdeveloper jacekwoln@gmail.com
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
* a copy of this software and associated documentation files (the
|
* a copy of this software and associated documentation files (the
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2023-2023 jwdeveloper jacekwoln@gmail.com
|
* Copyright (c) 2023-2024 jwdeveloper jacekwoln@gmail.com
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
* a copy of this software and associated documentation files (the
|
* a copy of this software and associated documentation files (the
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2023-2023 jwdeveloper jacekwoln@gmail.com
|
* Copyright (c) 2023-2024 jwdeveloper jacekwoln@gmail.com
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
* a copy of this software and associated documentation files (the
|
* a copy of this software and associated documentation files (the
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2023-2023 jwdeveloper jacekwoln@gmail.com
|
* Copyright (c) 2023-2024 jwdeveloper jacekwoln@gmail.com
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
* a copy of this software and associated documentation files (the
|
* a copy of this software and associated documentation files (the
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2023-2023 jwdeveloper jacekwoln@gmail.com
|
* Copyright (c) 2023-2024 jwdeveloper jacekwoln@gmail.com
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
* a copy of this software and associated documentation files (the
|
* a copy of this software and associated documentation files (the
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2023-2023 jwdeveloper jacekwoln@gmail.com
|
* Copyright (c) 2023-2024 jwdeveloper jacekwoln@gmail.com
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
* a copy of this software and associated documentation files (the
|
* a copy of this software and associated documentation files (the
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2023-2023 jwdeveloper jacekwoln@gmail.com
|
* Copyright (c) 2023-2024 jwdeveloper jacekwoln@gmail.com
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
* a copy of this software and associated documentation files (the
|
* a copy of this software and associated documentation files (the
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2023-2023 jwdeveloper jacekwoln@gmail.com
|
* Copyright (c) 2023-2024 jwdeveloper jacekwoln@gmail.com
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
* a copy of this software and associated documentation files (the
|
* a copy of this software and associated documentation files (the
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2023-2023 jwdeveloper jacekwoln@gmail.com
|
* Copyright (c) 2023-2024 jwdeveloper jacekwoln@gmail.com
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
* a copy of this software and associated documentation files (the
|
* a copy of this software and associated documentation files (the
|
||||||
@@ -32,8 +32,7 @@ import lombok.Value;
|
|||||||
|
|
||||||
@Value
|
@Value
|
||||||
@EventMeta(eventType = EventType.Message)
|
@EventMeta(eventType = EventType.Message)
|
||||||
public class TikTokFollowEvent extends TikTokHeaderEvent
|
public class TikTokFollowEvent extends TikTokHeaderEvent {
|
||||||
{
|
|
||||||
User user;
|
User user;
|
||||||
int totalFollowers;
|
int totalFollowers;
|
||||||
|
|
||||||
@@ -43,12 +42,12 @@ public class TikTokFollowEvent extends TikTokHeaderEvent
|
|||||||
totalFollowers = msg.getFollowCount();
|
totalFollowers = msg.getFollowCount();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static TikTokFollowEvent of(String userName)
|
public static TikTokFollowEvent of(String userName) {
|
||||||
{
|
|
||||||
return new TikTokFollowEvent(WebcastSocialMessage.newBuilder()
|
return new TikTokFollowEvent(WebcastSocialMessage.newBuilder()
|
||||||
.setUser(io.github.jwdeveloper.tiktok.messages.data.User.newBuilder()
|
.setUser(io.github.jwdeveloper.tiktok.messages.data.User.newBuilder()
|
||||||
.setNickname(userName)
|
.setDisplayId(userName)
|
||||||
.build())
|
.setNickname(userName)
|
||||||
.build());
|
.build())
|
||||||
|
.build());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2023-2023 jwdeveloper jacekwoln@gmail.com
|
* Copyright (c) 2023-2024 jwdeveloper jacekwoln@gmail.com
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
* a copy of this software and associated documentation files (the
|
* a copy of this software and associated documentation files (the
|
||||||
@@ -26,7 +26,6 @@ import io.github.jwdeveloper.tiktok.annotations.EventMeta;
|
|||||||
import io.github.jwdeveloper.tiktok.annotations.EventType;
|
import io.github.jwdeveloper.tiktok.annotations.EventType;
|
||||||
import io.github.jwdeveloper.tiktok.data.events.common.TikTokHeaderEvent;
|
import io.github.jwdeveloper.tiktok.data.events.common.TikTokHeaderEvent;
|
||||||
import io.github.jwdeveloper.tiktok.data.models.users.User;
|
import io.github.jwdeveloper.tiktok.data.models.users.User;
|
||||||
import io.github.jwdeveloper.tiktok.messages.webcast.WebcastLikeMessage;
|
|
||||||
import io.github.jwdeveloper.tiktok.messages.webcast.WebcastMemberMessage;
|
import io.github.jwdeveloper.tiktok.messages.webcast.WebcastMemberMessage;
|
||||||
import io.github.jwdeveloper.tiktok.messages.webcast.WebcastSocialMessage;
|
import io.github.jwdeveloper.tiktok.messages.webcast.WebcastSocialMessage;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
@@ -53,8 +52,9 @@ public class TikTokJoinEvent extends TikTokHeaderEvent {
|
|||||||
{
|
{
|
||||||
return new TikTokJoinEvent(WebcastMemberMessage.newBuilder()
|
return new TikTokJoinEvent(WebcastMemberMessage.newBuilder()
|
||||||
.setUser(io.github.jwdeveloper.tiktok.messages.data.User.newBuilder()
|
.setUser(io.github.jwdeveloper.tiktok.messages.data.User.newBuilder()
|
||||||
|
.setDisplayId(userName)
|
||||||
.setNickname(userName)
|
.setNickname(userName)
|
||||||
.build())
|
.build())
|
||||||
.build());
|
.build());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2023-2023 jwdeveloper jacekwoln@gmail.com
|
* Copyright (c) 2023-2024 jwdeveloper jacekwoln@gmail.com
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
* a copy of this software and associated documentation files (the
|
* a copy of this software and associated documentation files (the
|
||||||
@@ -62,6 +62,7 @@ public class TikTokLikeEvent extends TikTokHeaderEvent
|
|||||||
.setCount(likes)
|
.setCount(likes)
|
||||||
.setTotal(likes)
|
.setTotal(likes)
|
||||||
.setUser(io.github.jwdeveloper.tiktok.messages.data.User.newBuilder()
|
.setUser(io.github.jwdeveloper.tiktok.messages.data.User.newBuilder()
|
||||||
|
.setDisplayId(userName)
|
||||||
.setNickname(userName)
|
.setNickname(userName)
|
||||||
.build())
|
.build())
|
||||||
.build());
|
.build());
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2023-2023 jwdeveloper jacekwoln@gmail.com
|
* Copyright (c) 2023-2024 jwdeveloper jacekwoln@gmail.com
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
* a copy of this software and associated documentation files (the
|
* a copy of this software and associated documentation files (the
|
||||||
@@ -26,6 +26,7 @@ import io.github.jwdeveloper.tiktok.annotations.EventMeta;
|
|||||||
import io.github.jwdeveloper.tiktok.annotations.EventType;
|
import io.github.jwdeveloper.tiktok.annotations.EventType;
|
||||||
import io.github.jwdeveloper.tiktok.data.events.common.TikTokHeaderEvent;
|
import io.github.jwdeveloper.tiktok.data.events.common.TikTokHeaderEvent;
|
||||||
import io.github.jwdeveloper.tiktok.data.models.users.User;
|
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 io.github.jwdeveloper.tiktok.messages.webcast.WebcastSocialMessage;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
|
||||||
@@ -33,18 +34,27 @@ import lombok.Getter;
|
|||||||
@Getter
|
@Getter
|
||||||
@EventMeta(eventType = EventType.Message)
|
@EventMeta(eventType = EventType.Message)
|
||||||
public class TikTokShareEvent extends TikTokHeaderEvent {
|
public class TikTokShareEvent extends TikTokHeaderEvent {
|
||||||
private final User user;
|
private final User user;
|
||||||
private final int totalShares;
|
private final int totalShares;
|
||||||
|
|
||||||
public TikTokShareEvent(WebcastSocialMessage msg, Integer amount) {
|
public TikTokShareEvent(WebcastSocialMessage msg, Integer amount) {
|
||||||
super(msg.getCommon());
|
super(msg.getCommon());
|
||||||
user = User.map(msg.getUser());
|
user = User.map(msg.getUser());
|
||||||
this.totalShares = amount;
|
this.totalShares = amount;
|
||||||
}
|
}
|
||||||
|
|
||||||
public TikTokShareEvent(WebcastSocialMessage msg) {
|
public TikTokShareEvent(WebcastSocialMessage msg) {
|
||||||
super(msg.getCommon());
|
super(msg.getCommon());
|
||||||
user = User.map(msg.getUser());
|
user = User.map(msg.getUser());
|
||||||
totalShares = 1;
|
totalShares = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static TikTokShareEvent of(String userName, int shaders) {
|
||||||
|
return new TikTokShareEvent(WebcastSocialMessage.newBuilder()
|
||||||
|
.setUser(io.github.jwdeveloper.tiktok.messages.data.User.newBuilder()
|
||||||
|
.setDisplayId(userName)
|
||||||
|
.setNickname(userName)
|
||||||
|
.build())
|
||||||
|
.build(), shaders);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2023-2023 jwdeveloper jacekwoln@gmail.com
|
* Copyright (c) 2023-2024 jwdeveloper jacekwoln@gmail.com
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
* a copy of this software and associated documentation files (the
|
* a copy of this software and associated documentation files (the
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2023-2023 jwdeveloper jacekwoln@gmail.com
|
* Copyright (c) 2023-2024 jwdeveloper jacekwoln@gmail.com
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
* a copy of this software and associated documentation files (the
|
* a copy of this software and associated documentation files (the
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2023-2023 jwdeveloper jacekwoln@gmail.com
|
* Copyright (c) 2023-2024 jwdeveloper jacekwoln@gmail.com
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
* a copy of this software and associated documentation files (the
|
* a copy of this software and associated documentation files (the
|
||||||
@@ -28,8 +28,6 @@ import io.github.jwdeveloper.tiktok.data.events.common.TikTokUnhandledEvent;
|
|||||||
import io.github.jwdeveloper.tiktok.messages.webcast.WebcastResponse;
|
import io.github.jwdeveloper.tiktok.messages.webcast.WebcastResponse;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
@EventMeta(eventType = EventType.Debug)
|
@EventMeta(eventType = EventType.Debug)
|
||||||
public class TikTokWebsocketUnhandledMessageEvent extends TikTokUnhandledEvent<WebcastResponse.Message>
|
public class TikTokWebsocketUnhandledMessageEvent extends TikTokUnhandledEvent<WebcastResponse.Message>
|
||||||
@@ -42,4 +40,4 @@ public class TikTokWebsocketUnhandledMessageEvent extends TikTokUnhandledEvent<W
|
|||||||
{
|
{
|
||||||
return this.getData();
|
return this.getData();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2023-2023 jwdeveloper jacekwoln@gmail.com
|
* Copyright (c) 2023-2024 jwdeveloper jacekwoln@gmail.com
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
* a copy of this software and associated documentation files (the
|
* a copy of this software and associated documentation files (the
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2023-2023 jwdeveloper jacekwoln@gmail.com
|
* Copyright (c) 2023-2024 jwdeveloper jacekwoln@gmail.com
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
* a copy of this software and associated documentation files (the
|
* a copy of this software and associated documentation files (the
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2023-2023 jwdeveloper jacekwoln@gmail.com
|
* Copyright (c) 2023-2024 jwdeveloper jacekwoln@gmail.com
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
* a copy of this software and associated documentation files (the
|
* a copy of this software and associated documentation files (the
|
||||||
@@ -30,6 +30,7 @@ import java.awt.*;
|
|||||||
import java.awt.image.BufferedImage;
|
import java.awt.image.BufferedImage;
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
|
import java.util.Objects;
|
||||||
import java.util.concurrent.CompletableFuture;
|
import java.util.concurrent.CompletableFuture;
|
||||||
|
|
||||||
public class Picture {
|
public class Picture {
|
||||||
@@ -85,8 +86,7 @@ public class Picture {
|
|||||||
throw new TikTokLiveException("Unable map downloaded image", e);
|
throw new TikTokLiveException("Unable map downloaded image", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
var bais = new ByteArrayInputStream(baos.toByteArray());
|
try (var bais = new ByteArrayInputStream(baos.toByteArray())) {
|
||||||
try {
|
|
||||||
return ImageIO.read(bais);
|
return ImageIO.read(bais);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
throw new TikTokLiveException("Unable map downloaded image bytes to Image", e);
|
throw new TikTokLiveException("Unable map downloaded image bytes to Image", e);
|
||||||
@@ -97,8 +97,25 @@ public class Picture {
|
|||||||
return new Picture("");
|
return new Picture("");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Picture asUnsigned() {
|
||||||
|
if (link == null || link.isEmpty())
|
||||||
|
return this;
|
||||||
|
// p16-sign-va.tiktokcdn.com -> p16-va.tiktokcdn.com || p16-sign.tiktokcdn.com -> p16.tiktokcdn.com
|
||||||
|
return new Picture(link.replace("-sign-", "-").replace("-sign.", "."));
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "Picture{link='" + link + "', image=" + image + "}";
|
return "Picture{link='" + link + "', image=" + image + "}";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public final boolean equals(Object o) {
|
||||||
|
return o == this || o instanceof Picture picture && picture.link != null && picture.link.equals(link);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
return Objects.hashCode(link);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2023-2023 jwdeveloper jacekwoln@gmail.com
|
* Copyright (c) 2023-2024 jwdeveloper jacekwoln@gmail.com
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
* a copy of this software and associated documentation files (the
|
* a copy of this software and associated documentation files (the
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2023-2023 jwdeveloper jacekwoln@gmail.com
|
* Copyright (c) 2023-2024 jwdeveloper jacekwoln@gmail.com
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
* a copy of this software and associated documentation files (the
|
* a copy of this software and associated documentation files (the
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2023-2023 jwdeveloper jacekwoln@gmail.com
|
* Copyright (c) 2023-2024 jwdeveloper jacekwoln@gmail.com
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
* a copy of this software and associated documentation files (the
|
* a copy of this software and associated documentation files (the
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2023-2023 jwdeveloper jacekwoln@gmail.com
|
* Copyright (c) 2023-2024 jwdeveloper jacekwoln@gmail.com
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
* a copy of this software and associated documentation files (the
|
* a copy of this software and associated documentation files (the
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2023-2023 jwdeveloper jacekwoln@gmail.com
|
* Copyright (c) 2023-2024 jwdeveloper jacekwoln@gmail.com
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
* a copy of this software and associated documentation files (the
|
* a copy of this software and associated documentation files (the
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2023-2023 jwdeveloper jacekwoln@gmail.com
|
* Copyright (c) 2023-2024 jwdeveloper jacekwoln@gmail.com
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
* a copy of this software and associated documentation files (the
|
* a copy of this software and associated documentation files (the
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2023-2023 jwdeveloper jacekwoln@gmail.com
|
* Copyright (c) 2023-2024 jwdeveloper jacekwoln@gmail.com
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
* a copy of this software and associated documentation files (the
|
* a copy of this software and associated documentation files (the
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2023-2023 jwdeveloper jacekwoln@gmail.com
|
* Copyright (c) 2023-2024 jwdeveloper jacekwoln@gmail.com
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
* a copy of this software and associated documentation files (the
|
* a copy of this software and associated documentation files (the
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2023-2023 jwdeveloper jacekwoln@gmail.com
|
* Copyright (c) 2023-2024 jwdeveloper jacekwoln@gmail.com
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
* a copy of this software and associated documentation files (the
|
* a copy of this software and associated documentation files (the
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2023-2023 jwdeveloper jacekwoln@gmail.com
|
* Copyright (c) 2023-2024 jwdeveloper jacekwoln@gmail.com
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
* a copy of this software and associated documentation files (the
|
* a copy of this software and associated documentation files (the
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2023-2023 jwdeveloper jacekwoln@gmail.com
|
* Copyright (c) 2023-2024 jwdeveloper jacekwoln@gmail.com
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
* a copy of this software and associated documentation files (the
|
* a copy of this software and associated documentation files (the
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user