Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 1 addition & 9 deletions bukkit/dependency-reduced-pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<artifactId>Donation-Store-Minecraft</artifactId>
<groupId>net.donationstore</groupId>
<version>2.2.3</version>
<version>2.3</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>donation-store-bukkit</artifactId>
Expand All @@ -20,14 +20,6 @@
</goals>
</execution>
</executions>
<configuration>
<relocations>
<relocation>
<pattern>com.fasterxml.jackson</pattern>
<shadedPattern>net.donationstore.plugin.internal.jackson</shadedPattern>
</relocation>
</relocations>
</configuration>
</plugin>
</plugins>
</build>
Expand Down
10 changes: 1 addition & 9 deletions bukkit/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>Donation-Store-Minecraft</artifactId>
<groupId>net.donationstore</groupId>
<version>2.2.3</version>
<version>2.3</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down Expand Up @@ -40,14 +40,6 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.2</version>
<configuration>
<relocations>
<relocation>
<pattern>com.fasterxml.jackson</pattern>
<shadedPattern>net.donationstore.plugin.internal.jackson</shadedPattern>
</relocation>
</relocations>
</configuration>
<executions>
<execution>
<phase>package</phase>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public void onEnable() {

plugin = this;

Log.toConsole(String.format(Logging.enableLog(), "Bukkit", "v2.2.3"));
Log.toConsole(String.format(Logging.enableLog(), "Bukkit", "v2.3"));

config = plugin.getConfig();

Expand Down Expand Up @@ -54,7 +54,7 @@ public boolean onCommand(CommandSender sender, Command command, String label, St

if (args.length == 0) {
Log.send(sender, "Webstore and Helpdesk for Game Servers");
Log.send(sender, "Bukkit Plugin - Version 2.2.3");
Log.send(sender, "Bukkit Plugin - Version 2.3");
Log.send(sender, "https://donationstore.net");
Log.send(sender, "Type /ds help for command information");
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,17 @@ public void run() {
player = Bukkit.getPlayer(UUID.fromString(command.uuid));
}

if(player != null) {
boolean canExecuteCommand = false;

if (command.requireOnline) {
if (player != null) {
canExecuteCommand = true;
}
} else {
canExecuteCommand = true;
}

if(canExecuteCommand) {
Bukkit.getServer().getScheduler().runTask(plugin, new Runnable() {
@Override
public void run() {
Expand Down
2 changes: 1 addition & 1 deletion bungeecord/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>Donation-Store-Minecraft</artifactId>
<groupId>net.donationstore</groupId>
<version>2.2.3</version>
<version>2.3</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public void onEnable() {

queueTask = new QueueTask();

Log.toConsole(String.format(Logging.enableLog(), "BungeeCord", "v2.2.3"));
Log.toConsole(String.format(Logging.enableLog(), "BungeeCord", "v2.3"));

try {
configuration = ConfigurationProvider.getProvider(YamlConfiguration.class).load(FileConfiguration.loadResource(plugin, "config.yml"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public DonationStoreCommand(Configuration configuration, Plugin plugin) {
public void execute(CommandSender commandSender, String[] strings) {
if(strings.length < 1) {
Log.send(commandSender, "Webstore and Helpdesk for Game Servers");
Log.send(commandSender, "BungeeCord Plugin - Version 2.2.3");
Log.send(commandSender, "BungeeCord Plugin - Version 2.3");
Log.send(commandSender, "https://donationstore.net");
Log.send(commandSender, "Type /ds help for command information");
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,17 @@ public void run() {
player = plugin.getProxy().getPlayer(UUID.fromString(command.uuid));
}

if(player != null) {
boolean canExecuteCommand = false;

if (command.requireOnline) {
if (player != null) {
canExecuteCommand = true;
}
} else {
canExecuteCommand = true;
}

if(canExecuteCommand) {
runCommand(plugin, command.command);
updateCommandExecutedRequest.getCommands().add(command.id);
}
Expand Down
70 changes: 70 additions & 0 deletions common/dependency-reduced-pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
<?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/maven-v4_0_0.xsd">
<parent>
<artifactId>Donation-Store-Minecraft</artifactId>
<groupId>net.donationstore</groupId>
<version>2.3</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>common</artifactId>
<build>
<plugins>
<plugin>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.2</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
<configuration>
<relocations>
<relocation>
<pattern>com.fasterxml.jackson</pattern>
<shadedPattern>net.donationstore.plugin.internal.jackson</shadedPattern>
</relocation>
<relocation>
<pattern>com.squareup.okhttp3</pattern>
<shadedPattern>net.donationstore.plugin.internal.okhttp3</shadedPattern>
</relocation>
</relocations>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13</version>
<scope>test</scope>
<exclusions>
<exclusion>
<artifactId>hamcrest-core</artifactId>
<groupId>org.hamcrest</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>5.2.3.RELEASE</version>
<scope>test</scope>
<exclusions>
<exclusion>
<artifactId>spring-core</artifactId>
<groupId>org.springframework</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<version>1.10.19</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
32 changes: 31 additions & 1 deletion common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>Donation-Store-Minecraft</artifactId>
<groupId>net.donationstore</groupId>
<version>2.2.3</version>
<version>2.3</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down Expand Up @@ -50,4 +50,34 @@
<scope>test</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.2</version>
<configuration>
<relocations>
<relocation>
<pattern>com.fasterxml.jackson</pattern>
<shadedPattern>net.donationstore.plugin.internal.jackson</shadedPattern>
</relocation>
<relocation>
<pattern>com.squareup.okhttp3</pattern>
<shadedPattern>net.donationstore.plugin.internal.okhttp3</shadedPattern>
</relocation>
</relocations>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ public class CommandManager {
private static String UUID_IDENTIFIER = "{uuid}";
private static String USERNAME_IDENTIFIER = "{username}";
private static String TRANSACTION_ID_IDENTIFIER = "{transactionId}";
private static String SERVER_IDENTIFIER = "{server}";
private static String AMOUNT_IDENTIFIER = "{amount}";
private static String PACKAGE_ID_IDENTIFIER = "{packageId}";
private static String PACKAGE_PRICE_IDENTIFIER = "{packagePrice}";
private static String PACKAGE_NAME_IDENTIFIER = "{packageName}";

private ArrayList<String> logs;
private ObjectMapper objectMapper;
Expand Down Expand Up @@ -67,17 +72,37 @@ public QueueResponse getCommands() throws Exception {
}
}

if (command.command.contains("{username}")) {
if (command.command.contains(USERNAME_IDENTIFIER)) {
command.command = command.command.replace(USERNAME_IDENTIFIER, command.username);
}

if (command.command.contains("{transactionId}")) {
if (command.command.contains(TRANSACTION_ID_IDENTIFIER)) {
command.command = command.command.replace(TRANSACTION_ID_IDENTIFIER, payment.meta.transactionId);
}

if (command.command.contains("{uuid}")) {
if (command.command.contains(UUID_IDENTIFIER)) {
command.command = command.command.replace(UUID_IDENTIFIER, command.uuid);
}

if (command.command.contains(SERVER_IDENTIFIER)) {
command.command = command.command.replace(SERVER_IDENTIFIER, command.server);
}

if (command.command.contains(AMOUNT_IDENTIFIER)) {
command.command = command.command.replace(AMOUNT_IDENTIFIER, command.amount);
}

if (command.command.contains(PACKAGE_ID_IDENTIFIER)) {
command.command = command.command.replace(PACKAGE_ID_IDENTIFIER, Integer.toString(command.packageResponse.id));
}

if (command.command.contains(PACKAGE_PRICE_IDENTIFIER)) {
command.command = command.command.replace(PACKAGE_PRICE_IDENTIFIER, command.packageResponse.price);
}

if (command.command.contains(PACKAGE_NAME_IDENTIFIER)) {
command.command = command.command.replace(PACKAGE_NAME_IDENTIFIER, command.packageResponse.name);
}
}
}

Expand Down
18 changes: 17 additions & 1 deletion common/src/main/java/net/donationstore/models/Command.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,24 @@
package net.donationstore.models;

import com.fasterxml.jackson.annotation.JsonProperty;
import net.donationstore.models.response.PackageResponse;

public class Command {
public String command;
public int id;

public String command;

public String uuid;

@JsonProperty("require_online")
public boolean requireOnline;

public String server;

public String amount;

public String username;

@JsonProperty("package")
public PackageResponse packageResponse;
}
7 changes: 5 additions & 2 deletions common/src/main/java/net/donationstore/models/Meta.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,17 @@
import com.fasterxml.jackson.annotation.JsonProperty;

public class Meta {

@JsonProperty("payment_id")
public String paymentId;

public String user;

public String uuid;

@JsonProperty("transaction_id")
public String transactionId;

public String uuid;
public String currency;

public String email;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package net.donationstore.models.response;

public class PackageResponse {
public int id;
public String price;
public String name;
}
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>net.donationstore</groupId>
<artifactId>Donation-Store-Minecraft</artifactId>
<version>2.2.3</version>
<version>2.3</version>
<packaging>pom</packaging>
<modules>
<module>bungeecord</module>
Expand Down
6 changes: 5 additions & 1 deletion sponge/dependency-reduced-pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<artifactId>Donation-Store-Minecraft</artifactId>
<groupId>net.donationstore</groupId>
<version>2.2.3</version>
<version>2.3</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>donation-store-sponge</artifactId>
Expand All @@ -26,6 +26,10 @@
<pattern>com.fasterxml.jackson</pattern>
<shadedPattern>net.donationstore.plugin.internal.jackson</shadedPattern>
</relocation>
<relocation>
<pattern>com.squareup.okhttp3</pattern>
<shadedPattern>net.donationstore.plugin.internal.okhttp3</shadedPattern>
</relocation>
</relocations>
</configuration>
</plugin>
Expand Down
Loading