mirror of
https://github.com/CarmJos/MineSQL.git
synced 2026-06-14 05:11:08 +08:00
Compare commits
15 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c2c5e0656d | |||
| e6bbe36cb1 | |||
| b49c46ffe8 | |||
| 06f7a2607b | |||
| 66396c0c27 | |||
| e3ef67e342 | |||
| 9ba9b1f5d1 | |||
| 31aa49a60b | |||
| 1e2b18026a | |||
| 1013501fda | |||
| 3e30a83484 | |||
| 83936ee53e | |||
| 7a1216e624 | |||
| 24530e1f50 | |||
| a22d9bd797 |
@@ -29,13 +29,17 @@ jobs:
|
|||||||
run: mvn -B package --file pom.xml -Dgpg.skip
|
run: mvn -B package --file pom.xml -Dgpg.skip
|
||||||
|
|
||||||
- name: "Upload artifacts"
|
- name: "Upload artifacts"
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: artifacts
|
name: artifacts
|
||||||
path: "**/target/"
|
path: "**/target/"
|
||||||
|
retention-days: 5
|
||||||
|
include-hidden-files: true
|
||||||
|
|
||||||
- name: "Upload assets"
|
- name: "Upload assets"
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: assets
|
name: assets
|
||||||
path: ".asset/"
|
path: ".asset/"
|
||||||
|
retention-days: 5
|
||||||
|
include-hidden-files: true
|
||||||
+1
-1
@@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>minesql-parent</artifactId>
|
<artifactId>minesql-parent</artifactId>
|
||||||
<groupId>cc.carm.plugin</groupId>
|
<groupId>cc.carm.plugin</groupId>
|
||||||
<version>1.4.1</version>
|
<version>1.4.2</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
|||||||
+20
-9
@@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>minesql-parent</artifactId>
|
<artifactId>minesql-parent</artifactId>
|
||||||
<groupId>cc.carm.plugin</groupId>
|
<groupId>cc.carm.plugin</groupId>
|
||||||
<version>1.4.1</version>
|
<version>1.4.2</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<properties>
|
<properties>
|
||||||
@@ -68,17 +68,10 @@
|
|||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>net.byteflux</groupId>
|
|
||||||
<artifactId>libby-core</artifactId>
|
|
||||||
<version>${deps.libby.version}</version>
|
|
||||||
<scope>compile</scope>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.github.chris2018998</groupId>
|
<groupId>com.github.chris2018998</groupId>
|
||||||
<artifactId>beecp</artifactId>
|
<artifactId>beecp</artifactId>
|
||||||
<scope>provided</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
@@ -87,6 +80,24 @@
|
|||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.mariadb.jdbc</groupId>
|
||||||
|
<artifactId>mariadb-java-client</artifactId>
|
||||||
|
<scope>compile</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.mysql</groupId>
|
||||||
|
<artifactId>mysql-connector-j</artifactId>
|
||||||
|
<scope>compile</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.h2database</groupId>
|
||||||
|
<artifactId>h2</artifactId>
|
||||||
|
<scope>compile</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>cc.carm.lib</groupId>
|
<groupId>cc.carm.lib</groupId>
|
||||||
<artifactId>easyplugin-githubchecker</artifactId>
|
<artifactId>easyplugin-githubchecker</artifactId>
|
||||||
|
|||||||
@@ -14,16 +14,14 @@ import cc.carm.plugin.minesql.command.MineSQLCommand;
|
|||||||
import cc.carm.plugin.minesql.command.MineSQLHelpFormatter;
|
import cc.carm.plugin.minesql.command.MineSQLHelpFormatter;
|
||||||
import cc.carm.plugin.minesql.conf.PluginConfiguration;
|
import cc.carm.plugin.minesql.conf.PluginConfiguration;
|
||||||
import cc.carm.plugin.minesql.conf.SQLSourceGroup;
|
import cc.carm.plugin.minesql.conf.SQLSourceGroup;
|
||||||
import cc.carm.plugin.minesql.lib.PluginLibraries;
|
|
||||||
import cc.carm.plugin.minesql.util.DBPropertiesUtil;
|
import cc.carm.plugin.minesql.util.DBPropertiesUtil;
|
||||||
import cn.beecp.BeeDataSource;
|
|
||||||
import cn.beecp.BeeDataSourceConfig;
|
|
||||||
import co.aikar.commands.CommandManager;
|
import co.aikar.commands.CommandManager;
|
||||||
import co.aikar.commands.InvalidCommandArgument;
|
import co.aikar.commands.InvalidCommandArgument;
|
||||||
import co.aikar.commands.Locales;
|
import co.aikar.commands.Locales;
|
||||||
import net.byteflux.libby.Library;
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
import org.stone.beecp.BeeDataSource;
|
||||||
|
import org.stone.beecp.BeeDataSourceConfig;
|
||||||
|
|
||||||
import javax.sql.DataSource;
|
import javax.sql.DataSource;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
@@ -50,17 +48,6 @@ public class MineSQLCore implements IMineSQL {
|
|||||||
instance = this;
|
instance = this;
|
||||||
this.platform = platform;
|
this.platform = platform;
|
||||||
|
|
||||||
getLogger().info("加载数据库依赖文件...");
|
|
||||||
getPlatform().getLibraryManager().addMavenLocal();
|
|
||||||
getPlatform().getLibraryManager().addMavenCentral();
|
|
||||||
getPlatform().getLibraryManager().addSonatype();
|
|
||||||
|
|
||||||
for (PluginLibraries value : PluginLibraries.values()) {
|
|
||||||
Library lib = value.getLibrary();
|
|
||||||
getLogger().info(" 加载 " + lib.getArtifactId() + " (" + lib.getVersion() + ") ...");
|
|
||||||
getPlatform().getLibraryManager().loadLibrary(value.getLibrary());
|
|
||||||
}
|
|
||||||
|
|
||||||
getLogger().info("加载配置文件...");
|
getLogger().info("加载配置文件...");
|
||||||
this.configProvider = EasyConfiguration.from(new File(platform.getPluginFolder(), "config.yml"));
|
this.configProvider = EasyConfiguration.from(new File(platform.getPluginFolder(), "config.yml"));
|
||||||
this.config = new PluginConfiguration();
|
this.config = new PluginConfiguration();
|
||||||
@@ -143,9 +130,9 @@ public class MineSQLCore implements IMineSQL {
|
|||||||
Optional.ofNullable(conf.getSettings().getReadOnly()).ifPresent(config::setDefaultReadOnly);
|
Optional.ofNullable(conf.getSettings().getReadOnly()).ifPresent(config::setDefaultReadOnly);
|
||||||
Optional.ofNullable(conf.getSettings().getSchema()).ifPresent(config::setDefaultSchema);
|
Optional.ofNullable(conf.getSettings().getSchema()).ifPresent(config::setDefaultSchema);
|
||||||
|
|
||||||
Optional.ofNullable(conf.getSettings().getValidationSQL()).ifPresent(config::setValidTestSql);
|
Optional.ofNullable(conf.getSettings().getValidationSQL()).ifPresent(config::setAliveTestSql);
|
||||||
Optional.ofNullable(conf.getSettings().getValidationTimeout()).ifPresent(config::setValidTestTimeout);
|
Optional.ofNullable(conf.getSettings().getValidationTimeout()).ifPresent(config::setAliveTestTimeout);
|
||||||
Optional.ofNullable(conf.getSettings().getValidationInterval()).ifPresent(config::setValidAssumeTime);
|
Optional.ofNullable(conf.getSettings().getValidationInterval()).ifPresent(config::setTimerCheckInterval);
|
||||||
|
|
||||||
SQLManagerImpl manager = create(name, config);
|
SQLManagerImpl manager = create(name, config);
|
||||||
if (conf.getInitializer() != null) {
|
if (conf.getInitializer() != null) {
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package cc.carm.plugin.minesql;
|
package cc.carm.plugin.minesql;
|
||||||
|
|
||||||
import co.aikar.commands.CommandManager;
|
import co.aikar.commands.CommandManager;
|
||||||
import net.byteflux.libby.LibraryManager;
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
@@ -16,6 +15,4 @@ public interface MineSQLPlatform {
|
|||||||
|
|
||||||
@Nullable CommandManager<?, ?, ?, ?, ?, ?> getCommandManager();
|
@Nullable CommandManager<?, ?, ?, ?, ?, ?> getCommandManager();
|
||||||
|
|
||||||
@NotNull LibraryManager getLibraryManager();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package cc.carm.plugin.minesql.lib;
|
package cc.carm.plugin.minesql.lib;
|
||||||
|
|
||||||
import cc.carm.plugin.minesql.util.VersionReader;
|
import cc.carm.plugin.minesql.util.VersionReader;
|
||||||
import net.byteflux.libby.Library;
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
public enum PluginLibraries {
|
public enum PluginLibraries {
|
||||||
@@ -21,16 +20,8 @@ public enum PluginLibraries {
|
|||||||
this.artifactID = artifactID;
|
this.artifactID = artifactID;
|
||||||
}
|
}
|
||||||
|
|
||||||
public @NotNull Library getLibrary() {
|
|
||||||
return Library.builder().id(name())
|
|
||||||
.groupId(this.groupID).artifactId(this.artifactID)
|
|
||||||
.version(getVersion())
|
|
||||||
.build();
|
|
||||||
}
|
|
||||||
|
|
||||||
public @NotNull String getVersion() {
|
public @NotNull String getVersion() {
|
||||||
return READER.get(name().toLowerCase().replace('_', '-'));
|
return READER.get(name().toLowerCase().replace('_', '-'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>minesql-parent</artifactId>
|
<artifactId>minesql-parent</artifactId>
|
||||||
<groupId>cc.carm.plugin</groupId>
|
<groupId>cc.carm.plugin</groupId>
|
||||||
<version>1.4.1</version>
|
<version>1.4.2</version>
|
||||||
<relativePath>../../pom.xml</relativePath>
|
<relativePath>../../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|||||||
@@ -85,11 +85,6 @@ public class MineSQLBukkit extends EasyPlugin implements MineSQLPlatform {
|
|||||||
return commandManager;
|
return commandManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public @NotNull LibraryManager getLibraryManager() {
|
|
||||||
return this.libraryManager;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public @NotNull File getPluginFolder() {
|
public @NotNull File getPluginFolder() {
|
||||||
return getDataFolder();
|
return getDataFolder();
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>minesql-parent</artifactId>
|
<artifactId>minesql-parent</artifactId>
|
||||||
<groupId>cc.carm.plugin</groupId>
|
<groupId>cc.carm.plugin</groupId>
|
||||||
<version>1.4.1</version>
|
<version>1.4.2</version>
|
||||||
<relativePath>../../pom.xml</relativePath>
|
<relativePath>../../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
@@ -56,15 +56,6 @@
|
|||||||
<url>https://github.com/CarmJos/MineSQL/actions/workflows/maven.yml</url>
|
<url>https://github.com/CarmJos/MineSQL/actions/workflows/maven.yml</url>
|
||||||
</ciManagement>
|
</ciManagement>
|
||||||
|
|
||||||
<repositories>
|
|
||||||
|
|
||||||
<repository>
|
|
||||||
<id>bungeecord-repo</id>
|
|
||||||
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
|
|
||||||
</repository>
|
|
||||||
|
|
||||||
</repositories>
|
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
@@ -75,28 +66,12 @@
|
|||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>net.md-5</groupId>
|
<groupId>io.github.waterfallmc</groupId>
|
||||||
<artifactId>bungeecord-api</artifactId>
|
<artifactId>waterfall-api</artifactId>
|
||||||
<version>1.16-R0.5-SNAPSHOT</version>
|
<version>1.21-R0.1-SNAPSHOT</version>
|
||||||
<type>jar</type>
|
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>net.md-5</groupId>
|
|
||||||
<artifactId>bungeecord-api</artifactId>
|
|
||||||
<version>1.16-R0.5-SNAPSHOT</version>
|
|
||||||
<type>javadoc</type>
|
|
||||||
<scope>provided</scope>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>net.byteflux</groupId>
|
|
||||||
<artifactId>libby-bungee</artifactId>
|
|
||||||
<version>${deps.libby.version}</version>
|
|
||||||
<scope>compile</scope>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.bstats</groupId>
|
<groupId>org.bstats</groupId>
|
||||||
<artifactId>bstats-bungeecord</artifactId>
|
<artifactId>bstats-bungeecord</artifactId>
|
||||||
|
|||||||
@@ -5,8 +5,6 @@ import cc.carm.lib.easyplugin.utils.JarResourceUtils;
|
|||||||
import cc.carm.plugin.minesql.conf.PluginConfiguration;
|
import cc.carm.plugin.minesql.conf.PluginConfiguration;
|
||||||
import co.aikar.commands.BungeeCommandManager;
|
import co.aikar.commands.BungeeCommandManager;
|
||||||
import co.aikar.commands.CommandManager;
|
import co.aikar.commands.CommandManager;
|
||||||
import net.byteflux.libby.BungeeLibraryManager;
|
|
||||||
import net.byteflux.libby.LibraryManager;
|
|
||||||
import net.md_5.bungee.api.ProxyServer;
|
import net.md_5.bungee.api.ProxyServer;
|
||||||
import net.md_5.bungee.api.plugin.Plugin;
|
import net.md_5.bungee.api.plugin.Plugin;
|
||||||
import org.bstats.bungeecord.Metrics;
|
import org.bstats.bungeecord.Metrics;
|
||||||
@@ -22,8 +20,6 @@ public class MineSQLBungee extends Plugin implements MineSQLPlatform {
|
|||||||
|
|
||||||
protected static MineSQLBungee instance;
|
protected static MineSQLBungee instance;
|
||||||
|
|
||||||
protected BungeeLibraryManager libraryManager;
|
|
||||||
|
|
||||||
protected MineSQLCore core;
|
protected MineSQLCore core;
|
||||||
protected BungeeCommandManager commandManager;
|
protected BungeeCommandManager commandManager;
|
||||||
|
|
||||||
@@ -31,9 +27,6 @@ public class MineSQLBungee extends Plugin implements MineSQLPlatform {
|
|||||||
public void onLoad() {
|
public void onLoad() {
|
||||||
MineSQLBungee.instance = this;
|
MineSQLBungee.instance = this;
|
||||||
|
|
||||||
getLogger().info("加载依赖管理器...");
|
|
||||||
this.libraryManager = new BungeeLibraryManager(this);
|
|
||||||
|
|
||||||
getLogger().info("加载基础核心...");
|
getLogger().info("加载基础核心...");
|
||||||
this.core = new MineSQLCore(this);
|
this.core = new MineSQLCore(this);
|
||||||
}
|
}
|
||||||
@@ -99,11 +92,6 @@ public class MineSQLBungee extends Plugin implements MineSQLPlatform {
|
|||||||
return this.commandManager;
|
return this.commandManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public @NotNull LibraryManager getLibraryManager() {
|
|
||||||
return this.libraryManager;
|
|
||||||
}
|
|
||||||
|
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
public void outputInfo() {
|
public void outputInfo() {
|
||||||
Optional.ofNullable(JarResourceUtils.readResource(this.getResourceAsStream("PLUGIN_INFO")))
|
Optional.ofNullable(JarResourceUtils.readResource(this.getResourceAsStream("PLUGIN_INFO")))
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>minesql-parent</artifactId>
|
<artifactId>minesql-parent</artifactId>
|
||||||
<groupId>cc.carm.plugin</groupId>
|
<groupId>cc.carm.plugin</groupId>
|
||||||
<version>1.4.1</version>
|
<version>1.4.2</version>
|
||||||
<relativePath>../../pom.xml</relativePath>
|
<relativePath>../../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
@@ -84,13 +84,6 @@
|
|||||||
</exclusions>
|
</exclusions>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>net.byteflux</groupId>
|
|
||||||
<artifactId>libby-sponge</artifactId>
|
|
||||||
<version>${deps.libby.version}</version>
|
|
||||||
<scope>compile</scope>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.bstats</groupId>
|
<groupId>org.bstats</groupId>
|
||||||
<artifactId>bstats-sponge</artifactId>
|
<artifactId>bstats-sponge</artifactId>
|
||||||
|
|||||||
@@ -5,8 +5,6 @@ import cc.carm.lib.easyplugin.utils.JarResourceUtils;
|
|||||||
import cc.carm.plugin.minesql.conf.PluginConfiguration;
|
import cc.carm.plugin.minesql.conf.PluginConfiguration;
|
||||||
import co.aikar.commands.CommandManager;
|
import co.aikar.commands.CommandManager;
|
||||||
import com.google.inject.Inject;
|
import com.google.inject.Inject;
|
||||||
import net.byteflux.libby.LibraryManager;
|
|
||||||
import net.byteflux.libby.SpongeLibraryManager;
|
|
||||||
import net.kyori.adventure.text.Component;
|
import net.kyori.adventure.text.Component;
|
||||||
import org.bstats.charts.SimplePie;
|
import org.bstats.charts.SimplePie;
|
||||||
import org.bstats.sponge.Metrics;
|
import org.bstats.sponge.Metrics;
|
||||||
@@ -43,17 +41,13 @@ public class MineSQLSponge implements MineSQLPlatform {
|
|||||||
private final PluginContainer pluginContainer;
|
private final PluginContainer pluginContainer;
|
||||||
private final Metrics.Factory metricsFactory;
|
private final Metrics.Factory metricsFactory;
|
||||||
|
|
||||||
protected final SpongeLibraryManager<MineSQLSponge> libraryManager;
|
|
||||||
protected final MineSQLCore core;
|
protected final MineSQLCore core;
|
||||||
// protected SpongeCommandManager commandManager;
|
// protected SpongeCommandManager commandManager;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public MineSQLSponge(Metrics.Factory factory,
|
public MineSQLSponge(Metrics.Factory factory, PluginContainer pluginContainer) {
|
||||||
PluginContainer pluginContainer,
|
|
||||||
SpongeLibraryManager<MineSQLSponge> libraryManager) {
|
|
||||||
this.pluginContainer = pluginContainer;
|
this.pluginContainer = pluginContainer;
|
||||||
this.metricsFactory = factory;
|
this.metricsFactory = factory;
|
||||||
this.libraryManager = libraryManager;
|
|
||||||
|
|
||||||
getLogger().info("加载基础核心...");
|
getLogger().info("加载基础核心...");
|
||||||
this.core = new MineSQLCore(this);
|
this.core = new MineSQLCore(this);
|
||||||
@@ -115,11 +109,6 @@ public class MineSQLSponge implements MineSQLPlatform {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public @NotNull LibraryManager getLibraryManager() {
|
|
||||||
return this.libraryManager;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getVersion() {
|
public String getVersion() {
|
||||||
return pluginContainer.metadata().version().toString();
|
return pluginContainer.metadata().version().toString();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>minesql-parent</artifactId>
|
<artifactId>minesql-parent</artifactId>
|
||||||
<groupId>cc.carm.plugin</groupId>
|
<groupId>cc.carm.plugin</groupId>
|
||||||
<version>1.4.1</version>
|
<version>1.4.2</version>
|
||||||
<relativePath>../../pom.xml</relativePath>
|
<relativePath>../../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
@@ -82,13 +82,6 @@
|
|||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>net.byteflux</groupId>
|
|
||||||
<artifactId>libby-velocity</artifactId>
|
|
||||||
<version>${deps.libby.version}</version>
|
|
||||||
<scope>compile</scope>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.bstats</groupId>
|
<groupId>org.bstats</groupId>
|
||||||
<artifactId>bstats-velocity</artifactId>
|
<artifactId>bstats-velocity</artifactId>
|
||||||
|
|||||||
@@ -1,8 +1,5 @@
|
|||||||
package cc.carm.plugin.minesql;
|
package cc.carm.plugin.minesql;
|
||||||
|
|
||||||
|
|
||||||
import cc.carm.lib.easyplugin.utils.ColorParser;
|
|
||||||
import cc.carm.lib.easyplugin.utils.JarResourceUtils;
|
|
||||||
import cc.carm.plugin.minesql.conf.PluginConfiguration;
|
import cc.carm.plugin.minesql.conf.PluginConfiguration;
|
||||||
import co.aikar.commands.CommandManager;
|
import co.aikar.commands.CommandManager;
|
||||||
import co.aikar.commands.VelocityCommandManager;
|
import co.aikar.commands.VelocityCommandManager;
|
||||||
@@ -16,22 +13,16 @@ import com.velocitypowered.api.plugin.PluginContainer;
|
|||||||
import com.velocitypowered.api.plugin.PluginDescription;
|
import com.velocitypowered.api.plugin.PluginDescription;
|
||||||
import com.velocitypowered.api.plugin.annotation.DataDirectory;
|
import com.velocitypowered.api.plugin.annotation.DataDirectory;
|
||||||
import com.velocitypowered.api.proxy.ProxyServer;
|
import com.velocitypowered.api.proxy.ProxyServer;
|
||||||
import net.byteflux.libby.LibraryManager;
|
|
||||||
import net.byteflux.libby.VelocityLibraryManager;
|
|
||||||
import net.kyori.adventure.text.Component;
|
|
||||||
import org.bstats.charts.SimplePie;
|
import org.bstats.charts.SimplePie;
|
||||||
import org.bstats.velocity.Metrics;
|
import org.bstats.velocity.Metrics;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.Optional;
|
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
|
|
||||||
@Plugin(id = "minesql", name = "MineSQL (EasySQL-Plugin)", version = "1.4.0",
|
@Plugin(id = "minesql", name = "MineSQL (EasySQL-Plugin)", version = "1.4.2",
|
||||||
description = "EasySQL Plugin For Velocity",
|
description = "EasySQL Plugin For Velocity",
|
||||||
url = "https://github.com/CarmJos/MineSQL",
|
url = "https://github.com/CarmJos/MineSQL",
|
||||||
authors = {"CarmJos", "GhostChu"}
|
authors = {"CarmJos", "GhostChu"}
|
||||||
@@ -43,7 +34,6 @@ public class MineSQLVelocity implements MineSQLPlatform {
|
|||||||
private final File dataFolder;
|
private final File dataFolder;
|
||||||
|
|
||||||
private final Metrics.Factory metricsFactory;
|
private final Metrics.Factory metricsFactory;
|
||||||
protected VelocityLibraryManager<MineSQLVelocity> libraryManager;
|
|
||||||
|
|
||||||
protected MineSQLCore core;
|
protected MineSQLCore core;
|
||||||
protected VelocityCommandManager commandManager;
|
protected VelocityCommandManager commandManager;
|
||||||
@@ -56,18 +46,14 @@ public class MineSQLVelocity implements MineSQLPlatform {
|
|||||||
this.logger = logger;
|
this.logger = logger;
|
||||||
this.dataFolder = dataDirectory.toFile();
|
this.dataFolder = dataDirectory.toFile();
|
||||||
this.metricsFactory = metricsFactory;
|
this.metricsFactory = metricsFactory;
|
||||||
this.libraryManager = new VelocityLibraryManager<>(
|
|
||||||
LoggerFactory.getLogger("minesql"), dataDirectory,
|
getLogger().info("加载基础核心...");
|
||||||
server.getPluginManager(), this
|
this.core = new MineSQLCore(this);
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Subscribe(order = PostOrder.FIRST)
|
@Subscribe(order = PostOrder.FIRST)
|
||||||
public void onInitialize(ProxyInitializeEvent event) {
|
public void onInitialize(ProxyInitializeEvent event) {
|
||||||
outputInfo();
|
|
||||||
|
|
||||||
getLogger().info("加载基础核心...");
|
|
||||||
this.core = new MineSQLCore(this);
|
|
||||||
|
|
||||||
getLogger().info("初始化指令管理器...");
|
getLogger().info("初始化指令管理器...");
|
||||||
this.commandManager = new VelocityCommandManager(server, this);
|
this.commandManager = new VelocityCommandManager(server, this);
|
||||||
@@ -98,7 +84,6 @@ public class MineSQLVelocity implements MineSQLPlatform {
|
|||||||
|
|
||||||
@Subscribe(order = PostOrder.LAST)
|
@Subscribe(order = PostOrder.LAST)
|
||||||
public void onShutdown(ProxyShutdownEvent event) {
|
public void onShutdown(ProxyShutdownEvent event) {
|
||||||
outputInfo();
|
|
||||||
getLogger().info("终止全部数据库连接...");
|
getLogger().info("终止全部数据库连接...");
|
||||||
this.core.shutdownAll();
|
this.core.shutdownAll();
|
||||||
}
|
}
|
||||||
@@ -122,25 +107,12 @@ public class MineSQLVelocity implements MineSQLPlatform {
|
|||||||
return this.dataFolder;
|
return this.dataFolder;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public @NotNull CommandManager<?, ?, ?, ?, ?, ?> getCommandManager() {
|
public @NotNull CommandManager<?, ?, ?, ?, ?, ?> getCommandManager() {
|
||||||
return commandManager;
|
return commandManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public @NotNull LibraryManager getLibraryManager() {
|
|
||||||
return this.libraryManager;
|
|
||||||
}
|
|
||||||
|
|
||||||
public @NotNull PluginConfiguration getConfiguration() {
|
public @NotNull PluginConfiguration getConfiguration() {
|
||||||
return this.core.getConfig();
|
return this.core.getConfig();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void outputInfo() {
|
|
||||||
Optional.ofNullable(JarResourceUtils.readResource(this.getClass().getResourceAsStream("PLUGIN_INFO")))
|
|
||||||
.map(v -> ColorParser.parse(Arrays.asList(v)))
|
|
||||||
.ifPresent(list -> list.forEach(s -> getServer().getConsoleCommandSource().sendMessage(Component.text(s))));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>minesql-parent</artifactId>
|
<artifactId>minesql-parent</artifactId>
|
||||||
<groupId>cc.carm.plugin</groupId>
|
<groupId>cc.carm.plugin</groupId>
|
||||||
<version>1.4.1</version>
|
<version>1.4.2</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<properties>
|
<properties>
|
||||||
|
|||||||
@@ -13,16 +13,16 @@
|
|||||||
|
|
||||||
<deps.easysql.version>0.4.7</deps.easysql.version>
|
<deps.easysql.version>0.4.7</deps.easysql.version>
|
||||||
<deps.easyconf.version>3.5.1</deps.easyconf.version>
|
<deps.easyconf.version>3.5.1</deps.easyconf.version>
|
||||||
<deps.easyplugin.version>1.5.5</deps.easyplugin.version>
|
<deps.easyplugin.version>1.5.12</deps.easyplugin.version>
|
||||||
<deps.beecp.version>3.3.9</deps.beecp.version>
|
<deps.beecp.version>4.1.7</deps.beecp.version>
|
||||||
|
|
||||||
<deps.libby.version>1.1.5</deps.libby.version>
|
<deps.libby.version>1.1.5</deps.libby.version>
|
||||||
<deps.acf.version>0.5.1-SNAPSHOT</deps.acf.version>
|
<deps.acf.version>0.5.1-SNAPSHOT</deps.acf.version>
|
||||||
<deps.bstats.version>3.0.0</deps.bstats.version>
|
<deps.bstats.version>3.0.0</deps.bstats.version>
|
||||||
|
|
||||||
<deps.mysql-driver.version>8.0.31</deps.mysql-driver.version>
|
<deps.mysql-driver.version>8.2.0</deps.mysql-driver.version>
|
||||||
<deps.mariadb-driver.version>3.1.0</deps.mariadb-driver.version>
|
<deps.mariadb-driver.version>3.1.0</deps.mariadb-driver.version>
|
||||||
<deps.h2-driver.version>2.1.214</deps.h2-driver.version>
|
<deps.h2-driver.version>2.2.220</deps.h2-driver.version>
|
||||||
|
|
||||||
<code.package>cc.carm.plugin.minesql</code.package>
|
<code.package>cc.carm.plugin.minesql</code.package>
|
||||||
</properties>
|
</properties>
|
||||||
@@ -30,7 +30,7 @@
|
|||||||
<groupId>cc.carm.plugin</groupId>
|
<groupId>cc.carm.plugin</groupId>
|
||||||
<artifactId>minesql-parent</artifactId>
|
<artifactId>minesql-parent</artifactId>
|
||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
<version>1.4.1</version>
|
<version>1.4.2</version>
|
||||||
<modules>
|
<modules>
|
||||||
<module>api</module>
|
<module>api</module>
|
||||||
<module>core</module>
|
<module>core</module>
|
||||||
@@ -105,11 +105,6 @@
|
|||||||
<url>https://repo.aikar.co/content/groups/aikar/</url>
|
<url>https://repo.aikar.co/content/groups/aikar/</url>
|
||||||
</repository>
|
</repository>
|
||||||
|
|
||||||
<repository>
|
|
||||||
<id>AlessioDP</id>
|
|
||||||
<url>https://repo.alessiodp.com/releases/</url>
|
|
||||||
</repository>
|
|
||||||
|
|
||||||
<repository>
|
<repository>
|
||||||
<id>central</id>
|
<id>central</id>
|
||||||
<url>https://repo1.maven.org/maven2/</url>
|
<url>https://repo1.maven.org/maven2/</url>
|
||||||
@@ -161,7 +156,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.google.guava</groupId>
|
<groupId>com.google.guava</groupId>
|
||||||
<artifactId>guava</artifactId>
|
<artifactId>guava</artifactId>
|
||||||
<version>31.0.1-jre</version>
|
<version>32.0.0-jre</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- https://mvnrepository.com/artifact/org.mariadb.jdbc/mariadb-java-client -->
|
<!-- https://mvnrepository.com/artifact/org.mariadb.jdbc/mariadb-java-client -->
|
||||||
@@ -209,7 +204,7 @@
|
|||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-surefire-plugin</artifactId>
|
<artifactId>maven-surefire-plugin</artifactId>
|
||||||
<version>2.22.1</version>
|
<version>2.22.2</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<useSystemClassLoader>false</useSystemClassLoader>
|
<useSystemClassLoader>false</useSystemClassLoader>
|
||||||
</configuration>
|
</configuration>
|
||||||
|
|||||||
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
||||||
|
"extends": [
|
||||||
|
"config:recommended"
|
||||||
|
]
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user