Compare commits

...

71 Commits

Author SHA1 Message Date
David Kohler
f6fbd60eca Merge pull request #112 from jwdeveloper/develop-1.8.11
Develop 1.8.11
2024-11-28 21:18:46 -05:00
kohlerpop1
437335f784 Should be _session_id not just session_id. Maybe this will fix stream disconnections! 2024-11-25 20:11:23 -05:00
kohlerpop1
84b0a3aaf4 Add equals and hashCode to picture for easier comparison. 2024-11-24 00:18:34 -05:00
kohlerpop1
14bf9c8c9b Removal of blank spaces and unused imports/dependencies
Optimize picture download memory usage and add option to convert to unsigned url
Convert response data classes to final and add toString with `@Data`
Made sending requests dynamic by allowing passing of BodyHandler to class
2024-11-22 22:31:23 -05:00
GitHub Action
2dc3001e7b Update version in pom.xml 2024-11-10 02:04:46 +00:00
David Kohler
29a81f4cd6 Merge pull request #111 from Naimadx123/master
Downgrade protobuf-java version from 4.28.3 to 4.26.1 in pom.xml files.
2024-11-09 21:03:09 -05:00
Naimadx123
70fd174a95 Downgrade protobuf-java version from 4.28.3 to 4.26.1 in pom.xml files. 2024-11-09 23:10:24 +01:00
GitHub Action
3e23e5b939 Update version in pom.xml 2024-11-09 21:34:57 +00:00
kohlerpop1
733e72f814 Update version in pom! 2024-11-09 16:32:42 -05:00
kohlerpop1
838728d47d Update version in pom! 2024-11-09 16:30:11 -05:00
David Kohler
fd6158410a Update pom.xml 2024-11-09 16:27:19 -05:00
David Kohler
6c56a96ba8 Merge pull request #110 from Naimadx123/master
Copyright year update and jitpack.yml maven version update
2024-11-09 16:19:45 -05:00
Naimad
bb5659574c Merge branch 'jwdeveloper:master' into master 2024-11-09 22:14:45 +01:00
Naimadx123
286da42e54 Copyright year update and jitpack.yml maven version update 2024-11-09 22:14:09 +01:00
GitHub Action
3d0b9ddcc0 Update version in pom.xml 2024-11-09 17:04:46 +00:00
David Kohler
354c072833 Merge pull request #109 from Naimadx123/master
Refactor protobuf import from GeneratedMessageV3 to GeneratedMessage
2024-11-09 12:02:51 -05:00
Naimadx123
f85f24a5c8 Refactor protobuf import from GeneratedMessageV3 to GeneratedMessage 2024-11-09 17:20:04 +01:00
Jacek W
2550a462f9 Merge pull request #108 from Naimadx123/master
Update protobuf-java version and apply updated copyright licenses to …
2024-11-09 14:39:22 +01:00
Naimadx123
eb7b977d62 Update header path in pom.xml to use relative path for license.txt 2024-11-09 14:16:37 +01:00
Naimadx123
1c2c701be0 Update protobuf-java version and apply updated copyright licenses to all Java files. 2024-11-08 22:08:53 +01:00
GitHub Action
a2303f1fde Update version in pom.xml 2024-10-28 00:34:41 +00:00
Jacek W
a8ac0f6fff Update maven-publish.yml 2024-10-28 01:32:58 +01:00
David Kohler
732eda3d22 Merge pull request #106 from jwdeveloper/develop-1.8.6
Develop 1.8.6
2024-10-27 20:28:59 -04:00
kohlerpop1
358954984b Deprecate the usage of github gifts json! 2024-10-18 14:14:36 -04:00
kohlerpop1
acb13ea58a Removal of examples using Deprecated TikTokEventListener pt 2! 2024-10-17 21:51:07 -04:00
kohlerpop1
e8129862d1 Removal of examples using Deprecated TikTokEventListener! 2024-10-17 21:48:42 -04:00
kohlerpop1
88e36e7e90 Add settings as parameter to TikTokLiveRecorderStartedEvent! 2024-10-17 21:10:08 -04:00
kohlerpop1
eef9d43d01 Added TikTokLiveRecorderEndedEvent and updated RecorderListener to use CompletableFuture and a cancellation token! 2024-10-17 16:53:00 -04:00
kohlerpop1
75f3896a86 Merge branch 'master' into develop-1.8.6 2024-10-11 14:18:38 -04:00
Jacek W
e679ff23b7 Update README.md 2024-10-11 19:27:58 +02:00
kohlerpop1
e6211e69c5 Removed implements TikTokEventListener from TikTokEventListenerBase
Added current viewers to TikTokRoomInfoEventHandler
2024-10-09 18:06:28 -04:00
kohlerpop1
1b3ee24aea Add STREAM_SUSPENDED proto and use it to fire stream ended event! 2024-10-08 21:41:04 -04:00
GitHub Action
c9309ee2cf Update version in pom.xml 2024-09-02 14:51:14 +00:00
Jacek W
a28df44cee Merge pull request #101 from kMagic142/master
replaced asList() method call to old fashioned iteration
2024-09-02 16:49:29 +02:00
kMagic142
ee866762a3 replaced asList() method call to old fashioned iteration to avoid gson errors 2024-09-01 02:30:15 +03:00
GitHub Action
3cb7c83ef4 Update version in pom.xml 2024-08-23 07:25:27 +00:00
Jacek W
bf755bcb89 Merge pull request #98 from lulajax/fix-issue-97
adjust the position of the followingCount and followers
2024-08-23 09:23:49 +02:00
lujunjie
20bb05e527 adjust the position of the followingCount and followers 2024-08-23 15:13:53 +08:00
Jacek W
d5a3213ad8 Update README.md 2024-08-20 20:47:17 +02:00
Jacek W
7e496373ef Update README.md 2024-08-20 20:47:00 +02:00
GitHub Action
1f3c1c7d41 Update version in pom.xml 2024-07-31 02:47:35 +00:00
David Kohler
c160259863 Merge pull request #94 from jwdeveloper/develop-1.8.5
Develop 1.8.5
2024-07-30 22:45:49 -04:00
kohlerpop1
fb458e7e7d Rename pinging-task to heartbeat-task! 2024-07-30 20:36:45 -04:00
kohlerpop1
5f5ada312a Renamed PingTask to HeartbeatTask to reflect discovered byte array of TikTok's custom heartbeat value 2024-07-30 16:09:50 -04:00
GitHub Action
cb20c3dd3a Update version in pom.xml 2024-07-27 23:20:36 +00:00
David Kohler
bf42f65b3d Merge pull request #93 from jwdeveloper/develop-1.8.4
Added User instance to LiveUserDataMapper Response to access the retrieved user
2024-07-27 19:18:58 -04:00
kohlerpop1
05e18ef8e0 Added User instance to LiveUserDataMapper Response to access the retrieved user. 2024-07-27 13:02:31 -04:00
GitHub Action
0f6ee58d7f Update version in pom.xml 2024-07-21 17:03:47 +00:00
Jacek W
511759960d Merge pull request #91 from jwdeveloper/develop-1.8.3
- fix tests
2024-07-21 19:02:02 +02:00
JW
617d1c381a - fix tests 2024-07-21 19:01:11 +02:00
Jacek W
6f8b4698cd Merge pull request #90 from jwdeveloper/develop-1.8.3
Develop 1.8.3
2024-07-21 18:56:48 +02:00
JW
2bc1993ea5 - Create of methods for more events
- User.name was empty in testing event
- Add `onConnecting` to builder
2024-07-21 12:08:27 +02:00
kohlerpop1
3d4a517adb Removal of TikTokRoomDataResponseEvent.java as its included in TikTokPreConnectionEvent.java
Added ListUser#toString
Changed TikTokLiveHttpClient.getStartingPayload and TikTokLiveHttpClient.getByteResponse to protected
Altered DownloadData to be dynamic to declare request values or append them instead!
2024-07-18 17:41:27 -04:00
GitHub Action
ee0b559758 Update version in pom.xml 2024-07-06 15:26:51 +00:00
GitHub Action
1c9573dc39 Update version in pom.xml 2024-07-06 15:13:34 +00:00
Jacek W
5b17c33236 Merge pull request #89 from jwdeveloper/develop-1.8.2
Develop 1.8.2
2024-07-06 17:12:01 +02:00
kohlerpop1
b59373254c Make TikTokLinkMicBattleEvent.is1v1 and is2v2 dynamic based upon team instance
Moved Team1v1 and Team2v2 totalPoints to Team for universal access
2024-07-05 16:21:42 -04:00
jacek.wolniewicz
5524d9f8c4 -- tests improvement 2024-07-05 13:23:56 +02:00
jacek.wolniewicz
aa56f8eaea -- tests improvement 2024-07-05 13:21:59 +02:00
jacek.wolniewicz
e40bde8e7c - clean up code
- rename module Example to examples
2024-07-04 17:40:22 +02:00
jacek.wolniewicz
b769eb9c1f Merge remote-tracking branch 'origin/develop-1.8.2' into develop-1.8.2 2024-07-04 11:52:26 +02:00
jacek.wolniewicz
3e555a502a - add comments next to magic numbers 2024-07-04 11:51:45 +02:00
kohlerpop1
316868818b Renamed Priority.priorityValue to value to follow enum standards
Clarified message in TikTokEventListener
2024-07-03 21:04:44 -04:00
jacek.wolniewicz
36475c2cf6 - change method name from onMapping, to mappings 2024-07-04 00:00:26 +02:00
jacek.wolniewicz
2dbe81278c Merge branch 'refs/heads/master' into develop-1.8.2 2024-07-03 23:45:11 +02:00
jacek.wolniewicz
91fc32b20b Improvement on the ListenersManager 2024-07-03 23:43:23 +02:00
jacek.wolniewicz
fa855fa3aa Improvement on the ListenersManager 2024-07-03 23:40:48 +02:00
jacek.wolniewicz
cfea12dacc Remove descrabble 2024-07-03 22:37:40 +02:00
Jacek W
16cd819aaf Merge pull request #88 from jwdeveloper/develop-1.8.1
Develop 1.8.1
2024-07-03 22:30:18 +02:00
jacek.wolniewicz
290a4970fd Improvement of Listener 2024-07-03 22:29:11 +02:00
jacek.wolniewicz
660cb287e9 Improvement of Listener 2024-07-03 22:27:15 +02:00
251 changed files with 1221 additions and 726 deletions

View File

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

View File

@@ -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.0-Release</version> <version>1.8.10-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>

View File

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

View File

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

View File

@@ -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
@@ -20,21 +20,21 @@
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ */
package io.github.jwdeveloper.tiktok.listener; package io.github.jwdeveloper.tiktok.annotations;
import io.github.jwdeveloper.tiktok.live.builder.EventConsumer; /**
* HIGHEST 1
* HIGH 2
* NORMAL 3
* LOW 4
* LOWEST 5
*/
public enum Priority {
LOWEST(2), LOW(1), NORMAL(0), HIGH(-1), HIGHEST(-2);
import lombok.Value; public final int value;
import java.util.List; Priority(int value) {
import java.util.Map; this.value = value;
}
}
@Value
public class ListenerBindingModel
{
TikTokEventListener listener;
Map<Class<?>, List<EventConsumer<?>>> events;
}

View File

@@ -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,5 +28,14 @@ import java.lang.annotation.RetentionPolicy;
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
public @interface TikTokEventObserver public @interface TikTokEventObserver
{ {
/**
* When more than one method listen for certain Event, you can specify the method priority
* @see Priority
*/
Priority priority() default Priority.NORMAL;
/**
* When true, action is invoked on a thread, from the threads pool
*/
boolean async() default false;
} }

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -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
@@ -39,4 +39,10 @@ public class TikTokDisconnectedEvent extends TikTokLiveClientEvent {
public TikTokDisconnectedEvent() { public TikTokDisconnectedEvent() {
this("None"); this("None");
} }
public static TikTokDisconnectedEvent of(String reason)
{
return new TikTokDisconnectedEvent(reason);
}
} }

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -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
@@ -43,8 +43,6 @@ 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;
@Getter(AccessLevel.NONE)
private final boolean oneVsOne;
private final List<Team> teams; private final List<Team> teams;
public TikTokLinkMicBattleEvent(WebcastLinkMicBattle msg) { public TikTokLinkMicBattleEvent(WebcastLinkMicBattle msg) {
@@ -55,7 +53,6 @@ public class TikTokLinkMicBattleEvent extends TikTokHeaderEvent
if (msg.getHostTeamCount() == 2) { // 1v1 battle if (msg.getHostTeamCount() == 2) { // 1v1 battle
teams.add(new Team1v1(msg.getHostTeam(0), msg)); teams.add(new Team1v1(msg.getHostTeam(0), msg));
teams.add(new Team1v1(msg.getHostTeam(1), msg)); teams.add(new Team1v1(msg.getHostTeam(1), msg));
oneVsOne = true;
} 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)); teams.add(new Team2v2(msg.getHostData2V2List().stream().filter(data -> data.getTeamNumber() == 1).findFirst().orElse(null), msg));
@@ -64,7 +61,6 @@ public class TikTokLinkMicBattleEvent extends TikTokHeaderEvent
teams.add(new Team2v2(msg.getHostTeam(0), msg.getHostTeam(1), msg)); teams.add(new Team2v2(msg.getHostTeam(0), msg.getHostTeam(1), msg));
teams.add(new Team2v2(msg.getHostTeam(2), msg.getHostTeam(3), msg)); teams.add(new Team2v2(msg.getHostTeam(2), msg.getHostTeam(3), msg));
} }
oneVsOne = false;
} }
// Info: // Info:
@@ -74,10 +70,14 @@ public class TikTokLinkMicBattleEvent extends TikTokHeaderEvent
} }
public boolean is1v1() { public boolean is1v1() {
return oneVsOne; return teams.get(0) instanceof Team1v1;
} }
public boolean is2v2() { public boolean is2v2() {
return !oneVsOne; return teams.get(0) instanceof Team2v2;
}
public boolean isTie() {
return isFinished() && teams.get(0).getTotalPoints() == teams.get(1).getTotalPoints();
} }
} }

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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