Skip to content

Commit

Permalink
Merge branch 'release/v5.4.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
Marco (Valandur) committed Feb 23, 2019
2 parents c45445e + b68bb04 commit 6ed56f9
Show file tree
Hide file tree
Showing 114 changed files with 206 additions and 766 deletions.
13 changes: 0 additions & 13 deletions Web-API.iml

This file was deleted.

29 changes: 12 additions & 17 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
id "java"
id "com.qixalite.spongestart" version "1.6.2"
id "com.qixalite.spongestart2" version "4.0.0"
id "ninja.miserable.blossom" version "1.0.1"
id "com.github.johnrengelman.shadow" version "2.0.1"
}
Expand All @@ -14,10 +14,7 @@ blossom {
}

spongestart {
eula true
minecraft project.minecraftVersion
spongeForgeVersion "1.12.2-2705-7.1.0-BETA-3399"
spongeVanillaVersion "1.12.2-7.1.0-BETA-105"
//spongeForgeVersion "1.12.2-2705-8.0.0-BETA-3398"
//spongeVanillaVersion "1.12.2-8.0.0-BETA-444"
}
Expand Down Expand Up @@ -76,25 +73,24 @@ dependencies {
compile group: "org.mindrot", name: "jbcrypt", version: "0.4"
compile group: "org.glassfish.jersey.containers", name: "jersey-container-servlet", version: "2.26"
compile group: "org.glassfish.jersey.inject", name: "jersey-hk2", version: "2.26"
compile group: "org.bstats", name: "bstats-sponge", version: "1.2"
compile group: "org.bstats", name: "bstats-sponge", version: "1.4"

compileOnly group: "org.spongepowered", name: "spongeapi", version: "${project.spongeVersion}.0-SNAPSHOT"

compile group: 'redis.clients', name: 'jedis', version: '2.9.0'
compile group: 'com.rabbitmq', name: 'amqp-client', version: '5.3.0'

// Integrations
compileOnly name: "ActiveTime-s7.1-v1.4.0"
compileOnly name: "CmdScheduler-s7.1-v1.1.0"
compileOnly name: "GWMLibrary 1.3.2"
compileOnly name: "GWMCrates beta-3.1.2"
compileOnly name: "HuskyCrates-v1.8.0PRE2-API7"
compileOnly name: "MMCRestrict-1.5.1-API-7"
compileOnly name: "MMCTickets-1.4.1-API-7"
compileOnly name: "Nucleus-1.3.3-S7.0-api"
compileOnly name: "RedProtect-7.3.0-b68-Universal"
compileOnly name: "UniversalMarket-1.12.2-v1.1"
compileOnly name: "VillagerShops"
compileOnly name: "ActiveTime-s7.1-v1.4.3"
compileOnly name: "CmdScheduler-s7.1-v1.1.1"
compileOnly name: "GWMLibrary 1.3.4"
compileOnly name: "GWMCrates 3.1.13"
compileOnly name: "MMCRestrict-1.6.2-API-7"
compileOnly name: "MMCTickets-2.0.4-API-7"
compileOnly name: "Nucleus-1.8.0-S7.1-api"
compileOnly name: "RedProtect-7.5.5-b130-Universal"
compileOnly name: "UniversalMarket-1.12.2-v1.3"
compileOnly name: "VillagerShops-1.9.1"
compileOnly name: "WebBooks"
}

Expand Down Expand Up @@ -135,7 +131,6 @@ shadowJar {
relocate "net.jcip.annotations", "valandur.webapi.shadow.net.jcip.annotations"

relocate "org.aopalliance", "valandur.webapi.shadow.org.aopalliance"
relocate "org.bstats", "valandur.webapi.shadow.org.bstats"
relocate "org.codehaus", "valandur.webapi.shadow.org.codehaus"
relocate "org.threeten", "valandur.webapi.shadow.org.threeten"

Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version=5.3.0
version=5.4.0
minecraftVersion=1.12.2
spongeVersion=7.1
jacksonVersion=2.9.4
Expand Down
Binary file removed lib/ActiveTime-s7.1-v1.4.0.jar
Binary file not shown.
Binary file added lib/ActiveTime-s7.1-v1.4.3.jar
Binary file not shown.
Binary file removed lib/CmdScheduler-s7.1-v1.1.0.jar
Binary file not shown.
Binary file added lib/CmdScheduler-s7.1-v1.1.1.jar
Binary file not shown.
Binary file added lib/GWMCrates 3.1.13.jar
Binary file not shown.
Binary file removed lib/GWMCrates beta-3.1.2.jar
Binary file not shown.
Binary file removed lib/GWMLibrary 1.3.2.jar
Binary file not shown.
Binary file added lib/GWMLibrary 1.3.4.jar
Binary file not shown.
Binary file removed lib/HuskyCrates-v1.8.0PRE2-API7.jar
Binary file not shown.
Binary file removed lib/MMCRestrict-1.5.1-API-7.jar
Binary file not shown.
Binary file added lib/MMCRestrict-1.6.2-API-7.jar
Binary file not shown.
Binary file removed lib/MMCTickets-1.4.1-API-7.jar
Binary file not shown.
Binary file added lib/MMCTickets-2.0.4-API-7.jar
Binary file not shown.
Binary file not shown.
Binary file removed lib/RedProtect-7.3.0-b68-Universal.jar
Binary file not shown.
Binary file added lib/RedProtect-7.5.5-b130-Universal.jar
Binary file not shown.
Binary file removed lib/UniversalMarket-1.12.2-v1.1.jar
Binary file not shown.
Binary file added lib/UniversalMarket-1.12.2-v1.3.jar
Binary file not shown.
Binary file added lib/VillagerShops-1.9.1.jar
Binary file not shown.
Binary file removed lib/VillagerShops.jar
Binary file not shown.
Binary file modified lib/WebBooks.jar
Binary file not shown.
16 changes: 10 additions & 6 deletions src/main/java/valandur/webapi/WebAPI.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import io.sentry.context.Context;
import io.swagger.converter.ModelConverters;
import ninja.leaping.configurate.objectmapping.serialize.TypeSerializers;
import org.bstats.sponge.Metrics;
import org.bstats.sponge.Metrics2;
import org.eclipse.jetty.util.log.Log;
import org.slf4j.Logger;
import org.spongepowered.api.Platform;
Expand Down Expand Up @@ -93,6 +93,10 @@
)
public class WebAPI {

static {
System.out.println("Static initialized");
}

private static WebAPI instance;
public static WebAPI getInstance() {
return WebAPI.instance;
Expand All @@ -119,7 +123,7 @@ public static boolean isAdminPanelEnabled() {
private static WebServer server;

@Inject
private Metrics metrics;
private Metrics2 metrics;

@Inject
private Logger logger;
Expand Down Expand Up @@ -442,7 +446,7 @@ public void onServerStart(GameStartedServerEvent event) {
checkForUpdates();

// Add custom bstats metrics
metrics.addCustomChart(new Metrics.DrilldownPie("plugin_version", () -> {
metrics.addCustomChart(new Metrics2.DrilldownPie("plugin_version", () -> {
String[] vers = Constants.VERSION.split("-");

Map<String, Integer> entry = new HashMap<>();
Expand All @@ -453,9 +457,9 @@ public void onServerStart(GameStartedServerEvent event) {

return map;
}));
metrics.addCustomChart(new Metrics.SimplePie("report_errors", () -> reportErrors ? "Yes" : "No"));
metrics.addCustomChart(new Metrics.SimplePie("admin_panel", () -> adminPanelEnabled ? "Yes" : "No"));
metrics.addCustomChart(new Metrics.SimpleBarChart("servlets", () -> {
metrics.addCustomChart(new Metrics2.SimplePie("report_errors", () -> reportErrors ? "Yes" : "No"));
metrics.addCustomChart(new Metrics2.SimplePie("admin_panel", () -> adminPanelEnabled ? "Yes" : "No"));
metrics.addCustomChart(new Metrics2.SimpleBarChart("servlets", () -> {
Map<String, Integer> map = new HashMap<>();
Collection<Class<? extends BaseServlet>> servlets = servletService.getRegisteredServlets().values();
for (Class<? extends BaseServlet> servlet : servlets) {
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/valandur/webapi/WebServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,11 @@ public void start(Player player) {
String loc = config.customKeyStore;
String pw = config.customKeyStorePassword;
String mgrPw = config.customKeyStoreManagerPassword;

if (loc == null || loc.isEmpty()) {
loc = Sponge.getAssetManager().getAsset(WebAPI.getInstance(), "keystore.jks")
.map(a -> a.getUrl().toString()).orElse("");
.map(a -> a.getUrl().toString())
.orElse("../../src/main/resources/assets/webapi/keystore.jks");
pw = "mX4z%&uJ2E6VN#5f";
mgrPw = "mX4z%&uJ2E6VN#5f";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
import io.swagger.annotations.ApiModelProperty;
import valandur.webapi.serialize.BaseView;

import java.util.List;

@ApiModel("CommandTask")
public class CommandTaskView extends BaseView<CommandTask> {

Expand All @@ -14,9 +16,9 @@ public String getName() {
return value.getName();
}

@ApiModelProperty("The command that is executed")
public String getCommand() {
return value.getCommand();
@ApiModelProperty("The list of commands that are executed")
public List<String> getCommands() {
return value.getCommands();
}

@ApiModelProperty("The command that is executed")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package valandur.webapi.integration.huskycrates;
/*package valandur.webapi.integration.huskycrates;
import com.codehusky.huskycrates.crate.config.CrateReward;
import com.fasterxml.jackson.annotation.JsonGetter;
Expand Down Expand Up @@ -89,3 +89,4 @@ public String getLink() {
return null;
}
}
*/
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package valandur.webapi.integration.huskycrates;
/*package valandur.webapi.integration.huskycrates;
import com.codehusky.huskycrates.crate.VirtualCrate;
import com.codehusky.huskycrates.crate.config.CrateReward;
Expand Down Expand Up @@ -96,3 +96,4 @@ public String getLink() {
return Constants.BASE_PATH + "/husky-crates/crate/" + id;
}
}
*/
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package valandur.webapi.integration.huskycrates;
/*package valandur.webapi.integration.huskycrates;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import io.swagger.annotations.ApiModel;
Expand Down Expand Up @@ -32,3 +32,4 @@ public void saveToNode(ConfigurationNode node) {
node.getNode("command").setValue(command);
}
}
*/
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package valandur.webapi.integration.huskycrates;
/*package valandur.webapi.integration.huskycrates;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonSubTypes;
Expand Down Expand Up @@ -37,3 +37,4 @@ public void saveToNode(ConfigurationNode node) {
node.getNode("type").setValue(getType().toString().toLowerCase());
}
}
*/
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package valandur.webapi.integration.huskycrates;
/*package valandur.webapi.integration.huskycrates;
import com.codehusky.huskycrates.HuskyCrates;
import com.codehusky.huskycrates.crate.VirtualCrate;
Expand Down Expand Up @@ -224,3 +224,4 @@ private void saveCrate(ConfigurationLoader loader, CachedVirtualCrate crate) {
}
}
}
*/
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package valandur.webapi.integration.huskycrates;
/*package valandur.webapi.integration.huskycrates;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import io.swagger.annotations.ApiModel;
Expand Down Expand Up @@ -36,3 +36,4 @@ public void saveToNode(ConfigurationNode node) {
node.getNode("overrideItem", "count").setValue(item.getQuantity());
}
}
*/
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,8 @@ public CachedRegion(Region region) {
optPlayer.ifPresent(player -> this.members.add(player));
}

this.flags = new HashMap<>(region.flags.size());
for (Map.Entry<String, Object> entry : region.flags.entrySet()) {
this.flags = new HashMap<>(region.getFlags().size());
for (Map.Entry<String, Object> entry : region.getFlags().entrySet()) {
this.flags.put(entry.getKey(), cacheService.asCachedObject(entry.getValue()));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.spongepowered.api.Sponge;
import org.spongepowered.api.event.cause.Cause;
import org.spongepowered.api.event.cause.EventContext;
import org.spongepowered.api.world.Location;
import org.spongepowered.api.world.World;
import valandur.webapi.WebAPI;
Expand Down Expand Up @@ -230,8 +232,10 @@ public CachedRegion modifyRegion(@PathParam("id") String id, CachedRegion req)
}

if (req.getFlags() != null) {
EventContext ctx = EventContext.builder().build();
Cause cause = Cause.builder().append(WebAPI.getInstance()).build(ctx);
for (Map.Entry<String, Object> entry : req.getFlags().entrySet()) {
region.setFlag(entry.getKey(), entry.getValue());
region.setFlag(cause, entry.getKey(), entry.getValue());
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ public InteractiveMessage() {

@Override
public String getLink() {
return Constants.BASE_PATH + "/message/" + uuid;
return Constants.BASE_PATH + "/interactive-message/" + uuid;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import valandur.webapi.integration.activetime.ActiveTimeServlet;
import valandur.webapi.integration.cmdscheduler.CmdSchedulerServlet;
import valandur.webapi.integration.gwmcrates.GWMCratesServlet;
import valandur.webapi.integration.huskycrates.HuskyCratesServlet;
import valandur.webapi.integration.mmcrestrict.MMCRestrictServlet;
import valandur.webapi.integration.mmctickets.MMCTicketsServlet;
import valandur.webapi.integration.nucleus.NucleusServlet;
Expand Down Expand Up @@ -91,13 +90,13 @@ public void init() {
}
}

if (config.integrations.HuskyCrates) {
/*if (config.integrations.HuskyCrates) {
try {
Class.forName("com.codehusky.huskycrates.HuskyCrates");
logger.info(" Integrating with HuskyCrates...");
registerServlet(HuskyCratesServlet.class);
} catch (ClassNotFoundException ignored) { }
}
}*/

if (config.integrations.MMCRestrict) {
try {
Expand Down
Loading

0 comments on commit 6ed56f9

Please sign in to comment.