10 Commits

Author SHA1 Message Date
Govindass
b2a53078a6 add gradle fatJar task 2020-05-02 20:02:25 +03:00
Govindas
83f71e147b Update HikariCP, should fix a lot of issues 2020-05-02 19:48:35 +03:00
Govindass
e610fc1357 Remove unused class 2020-05-02 19:30:48 +03:00
Govindass
aa1a1d14c7 add synchronous 2019-09-30 15:28:32 +03:00
Govindass
3a1ec76a0b Delete EffSyncExecuteStatement.java 2019-09-30 15:27:26 +03:00
Govindass
2eb691cd69 Delete EffExecuteStatement.java 2019-09-30 15:27:16 +03:00
Govindass
6dbd2effb3 Delete plugin.yml 2019-09-30 15:26:48 +03:00
Govindass
88b76f1b5b Add files via upload 2019-09-30 15:25:37 +03:00
Bryan Terce
b692047878 0.2.1 Hotfix 2019-06-26 01:56:29 -07:00
Bryan Terce
3e57cae866 Fix sync execute logic (fixes #16) 2019-06-26 01:55:08 -07:00
4 changed files with 22 additions and 16 deletions

View File

@@ -1,5 +1,5 @@
group 'com.btk5h.skript-db'
version '0.2.0'
version '0.2.1'
buildscript {
repositories {
@@ -31,7 +31,7 @@ repositories {
dependencies {
shadow 'org.spigotmc:spigot-api:1.11-R0.1-SNAPSHOT'
shadow 'ch.njol:skript:2.2-SNAPSHOT'
compile 'com.zaxxer:HikariCP:2.6.2'
compile 'com.zaxxer:HikariCP:3.4.3'
}
task buildReadme(type: Javadoc) {
@@ -43,3 +43,13 @@ task buildReadme(type: Javadoc) {
options.addStringOption('file', 'README.md')
options.addStringOption('markdown', '-quiet')
}
task fatJar(type: Jar) {
manifest {
attributes 'Implementation-Title': 'Gradle Jar File Example',
'Implementation-Version': version,
'Main-Class': 'com.mkyong.DateUtils'
}
baseName = project.name + '-all'
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
with jar
}

View File

@@ -0,0 +1,3 @@
Manifest-Version: 1.0
Main-Class: com.btk5h.skriptdb.SkriptDB

View File

@@ -53,9 +53,7 @@ import ch.njol.util.Kleenean;
*/
public class EffExecuteStatement extends Delay {
static {
Skript.registerEffect(EffExecuteStatement.class,
"[(1¦synchronously)] execute %string% (in|on) %datasource% " +
"[and store [[the] (output|result)[s]] (to|in) [the] [var[iable]] %-objects%]");
Skript.registerEffect(EffExecuteStatement.class, "[(1¦synchronously)] execute %string% (in|on) %datasource% [and store [[the] (output|result)[s]] (to|in) [the] [var[iable]] %-objects%]");
}
static String lastError;
@@ -82,13 +80,10 @@ public class EffExecuteStatement extends Delay {
protected void execute(Event e) {
boolean isMainThread = Bukkit.isPrimaryThread();
if (isSync && !isMainThread) {
if (isSync) {
String result = executeStatement(e);
continueScriptExecution(e, result);
} else {
if (isMainThread) {
Skript.warning("A SQL query was attempted on the main thread!");
}
CompletableFuture<String> sql =
CompletableFuture.supplyAsync(() -> executeStatement(e), threadPool);
@@ -98,11 +93,7 @@ public class EffExecuteStatement extends Delay {
err.printStackTrace();
}
if (isSync) {
continueScriptExecution(e, res);
} else {
Bukkit.getScheduler().runTask(SkriptDB.getInstance(), () -> continueScriptExecution(e, res));
}
Bukkit.getScheduler().runTask(SkriptDB.getInstance(), () -> continueScriptExecution(e, res));
});
}
}
@@ -110,7 +101,9 @@ public class EffExecuteStatement extends Delay {
@Override
protected TriggerItem walk(Event e) {
debug(e, true);
SkriptUtil.delay(e);
if (!isSync) {
SkriptUtil.delay(e);
}
execute(e);
return null;
}

View File

@@ -1,4 +1,4 @@
name: skript-db
version: 0.2.0
version: 0.3.0-Govindas
main: com.btk5h.skriptdb.SkriptDB
depend: [Skript]