mirror of
https://github.com/jwdeveloper/TikTokLiveJava.git
synced 2026-02-27 08:49:40 -05:00
made: settings.fetchGifts default to true
This commit is contained in:
@@ -25,6 +25,7 @@ package io.github.jwdeveloper.tiktok.data.events.gift;
|
|||||||
|
|
||||||
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.Picture;
|
||||||
import io.github.jwdeveloper.tiktok.data.models.gifts.*;
|
import io.github.jwdeveloper.tiktok.data.models.gifts.*;
|
||||||
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.WebcastGiftMessage;
|
import io.github.jwdeveloper.tiktok.messages.webcast.WebcastGiftMessage;
|
||||||
@@ -55,4 +56,20 @@ public class TikTokGiftEvent extends TikTokHeaderEvent {
|
|||||||
}
|
}
|
||||||
combo = msg.getComboCount();
|
combo = msg.getComboCount();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public TikTokGiftEvent(Gift gift) {
|
||||||
|
this.gift = gift;
|
||||||
|
user = new User(0L, "sender", new Picture(""));
|
||||||
|
toUser = new User(0L, "receiver", new Picture(""));
|
||||||
|
combo = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static TikTokGiftEvent of(Gift gift) {
|
||||||
|
return new TikTokGiftEvent(gift);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static TikTokGiftEvent of(String name, int id, int diamonds) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -38,7 +38,7 @@ public class LiveClientSettings {
|
|||||||
* Determines if gifts data is downloaded before TikTokLive starts,
|
* Determines if gifts data is downloaded before TikTokLive starts,
|
||||||
* when `false` then client.giftManager() does not contain initial gifts
|
* when `false` then client.giftManager() does not contain initial gifts
|
||||||
*/
|
*/
|
||||||
private boolean fetchGifts;
|
private boolean fetchGifts = true;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ISO-Language for Client
|
* ISO-Language for Client
|
||||||
|
|||||||
@@ -78,6 +78,12 @@
|
|||||||
<version>1.3.0-Release</version>
|
<version>1.3.0-Release</version>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.github.jwdeveloper.worker</groupId>
|
||||||
|
<artifactId>extension-tester</artifactId>
|
||||||
|
<version>1.3.0-Release</version>
|
||||||
|
<scope>compile</scope>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
|
|||||||
@@ -0,0 +1,45 @@
|
|||||||
|
package io.github.jwdeveloper.tiktok;
|
||||||
|
|
||||||
|
import io.github.jwdeveloper.tiktok.data.events.gift.TikTokGiftEvent;
|
||||||
|
import io.github.jwdeveloper.tiktok.live.LiveClient;
|
||||||
|
|
||||||
|
public class GiftTestingExample {
|
||||||
|
|
||||||
|
|
||||||
|
public static void main(String[] args) throws Exception {
|
||||||
|
LiveClient client = TikTokLive.newClient(SimpleExample.TIKTOK_HOSTNAME)
|
||||||
|
.configure(liveClientSettings ->
|
||||||
|
{
|
||||||
|
// liveClientSettings.setOffline(true);
|
||||||
|
})
|
||||||
|
.onConnected((liveClient, event) ->
|
||||||
|
{
|
||||||
|
liveClient.getLogger().info("Connected");
|
||||||
|
})
|
||||||
|
.onGiftCombo((liveClient, event) ->
|
||||||
|
{
|
||||||
|
|
||||||
|
})
|
||||||
|
.onGift((liveClient, event) ->
|
||||||
|
{
|
||||||
|
liveClient.getLogger().info("New fakeGift: " + event.getGift());
|
||||||
|
})
|
||||||
|
.buildAndConnect();
|
||||||
|
|
||||||
|
var gifts = TikTokLive.gifts();
|
||||||
|
var fakeGift = TikTokGiftEvent.of(gifts.getByName("Rose"));
|
||||||
|
var fakeGift2 = TikTokGiftEvent.of("Rose", 1, 23);
|
||||||
|
client.publishEvent(fakeGift);
|
||||||
|
client.publishEvent(fakeGift2);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void GetTesterBuilder() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void GetBuilder() {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package io.github.jwdeveloper.tiktok;
|
package io.github.jwdeveloper.tiktok;
|
||||||
|
|
||||||
public class testerExample {
|
public class TestingGiftsExample {
|
||||||
}
|
}
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
|
||||||
<modelVersion>4.0.0</modelVersion>
|
|
||||||
<parent>
|
|
||||||
<groupId>io.github.jwdeveloper.tiktok</groupId>
|
|
||||||
<artifactId>TikTokLiveJava</artifactId>
|
|
||||||
<version>1.3.0-Release</version>
|
|
||||||
</parent>
|
|
||||||
|
|
||||||
<groupId>io.github.jwdeveloper.worker</groupId>
|
|
||||||
<artifactId>extension-tester</artifactId>
|
|
||||||
|
|
||||||
<properties>
|
|
||||||
<maven.compiler.source>16</maven.compiler.source>
|
|
||||||
<maven.compiler.target>16</maven.compiler.target>
|
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
|
||||||
</properties>
|
|
||||||
<dependencies>
|
|
||||||
<dependency>
|
|
||||||
<groupId>io.github.jwdeveloper.tiktok</groupId>
|
|
||||||
<artifactId>Client</artifactId>
|
|
||||||
<version>1.3.0-Release</version>
|
|
||||||
<scope>compile</scope>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
|
||||||
|
|
||||||
</project>
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
package io.github.jwdeveloper.tiktok.extension.tester;
|
|
||||||
|
|
||||||
import io.github.jwdeveloper.tiktok.live.LiveClient;
|
|
||||||
|
|
||||||
public class TikTokLiveTester {
|
|
||||||
public static LiveClient createFakeClient() {
|
|
||||||
throw new RuntimeException("Not implemented");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user