aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormdxd44 <ogurec332@mail.ru>2022-01-22 20:46:40 +0900
committermdxd44 <ogurec332@mail.ru>2022-01-22 20:47:34 +0900
commit7cda52867c05b0620bb486c1112f6c31b8402bdf (patch)
tree2080b32227e165d793bc5f40868fc6ecf83ffd81
parent21bf2a107e30df944a3523e22016737eb05650cd (diff)
downloadLimboAuth-7cda52867c05b0620bb486c1112f6c31b8402bdf.tar.gz
LimboAuth-7cda52867c05b0620bb486c1112f6c31b8402bdf.tar.bz2
LimboAuth-7cda52867c05b0620bb486c1112f6c31b8402bdf.zip
Add registered players chart, update dependencies, release candidate 3.
-rw-r--r--.github/workflows/build.yml10
-rw-r--r--.github/workflows/test.yml32
-rw-r--r--build.gradle22
-rw-r--r--src/main/java/net/elytrium/limboauth/LimboAuth.java4
-rw-r--r--src/main/java/net/elytrium/limboauth/listener/AuthListener.java7
5 files changed, 23 insertions, 52 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 40d732e..53f8a45 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -1,6 +1,6 @@
name: Java CI with Gradle
-on: [ push ]
+on: [ push, pull_request ]
jobs:
build:
@@ -11,14 +11,14 @@ jobs:
fail-fast: true
steps:
- name: Checkout
- uses: actions/checkout@v2.3.5
+ uses: actions/checkout@v2.4.0
- name: Set up JDK ${{ matrix.java }}
- uses: actions/setup-java@v2.3.1
+ uses: actions/setup-java@v2.5.0
with:
distribution: adopt
java-version: ${{ matrix.java }}
- name: Cache Gradle
- uses: actions/cache@v2.1.6
+ uses: actions/cache@v2.1.7
with:
path: ~/.gradle
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
@@ -26,7 +26,7 @@ jobs:
- name: Build LimboAuth
run: ./gradlew build
- name: Upload LimboAuth
- uses: actions/upload-artifact@v2.2.4
+ uses: actions/upload-artifact@v2.3.1
with:
name: LimboAuth Built On ${{ matrix.java }} JDK
path: "build/libs/limboauth*.jar"
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
deleted file mode 100644
index 6259d74..0000000
--- a/.github/workflows/test.yml
+++ /dev/null
@@ -1,32 +0,0 @@
-name: Java CI with Gradle [PR tests]
-
-on: [ pull_request ]
-
-jobs:
- build:
- runs-on: ubuntu-latest
- strategy:
- matrix:
- java: [ 11, 16 ]
- fail-fast: true
- steps:
- - name: Checkout
- uses: actions/checkout@v2.3.5
- - name: Set up JDK ${{ matrix.java }}
- uses: actions/setup-java@v2.3.1
- with:
- distribution: adopt
- java-version: ${{ matrix.java }}
- - name: Cache Gradle
- uses: actions/cache@v2.1.6
- with:
- path: ~/.gradle
- key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
- restore-keys: ${{ runner.os }}-gradle-
- - name: Build LimboAuth
- run: ./gradlew build
- - name: Upload LimboAuth
- uses: actions/upload-artifact@v2.2.4
- with:
- name: LimboAuth Built On ${{ matrix.java }} JDK
- path: "build/libs/limboauth*.jar"
diff --git a/build.gradle b/build.gradle
index fab4327..435a965 100644
--- a/build.gradle
+++ b/build.gradle
@@ -3,13 +3,13 @@
plugins {
id("java")
id("checkstyle")
- id("com.github.spotbugs").version("5.0.3")
+ id("com.github.spotbugs").version("5.0.5")
id("org.cadixdev.licenser").version("0.6.1")
- id("com.github.johnrengelman.shadow").version("7.1.0")
+ id("com.github.johnrengelman.shadow").version("7.1.2")
}
setGroup("net.elytrium")
-setVersion("1.0.3-rc2")
+setVersion("1.0.3-rc3")
compileJava {
getOptions().setEncoding("UTF-8")
@@ -24,6 +24,10 @@ repositories {
mavenCentral()
maven {
+ setName("elytrium-repo")
+ setUrl("https://maven.elytrium.net/repo/")
+ }
+ maven {
setName("papermc-repo")
setUrl("https://papermc.io/repo/repository/maven-public/")
}
@@ -31,14 +35,10 @@ repositories {
setName("opencollab-repo")
setUrl("https://repo.opencollab.dev/maven-snapshots/")
}
- maven {
- setName("elytrium-repo")
- setUrl("https://maven.elytrium.net/repo/")
- }
}
dependencies {
- compileOnly("net.elytrium:limboapi-api:1.0.3-rc2")
+ compileOnly("net.elytrium:limboapi-api:1.0.3-rc5")
compileOnly("com.velocitypowered:velocity-api:3.1.2-SNAPSHOT")
annotationProcessor("com.velocitypowered:velocity-api:3.1.2-SNAPSHOT")
@@ -51,12 +51,12 @@ dependencies {
implementation("com.j256.ormlite:ormlite-jdbc:6.1")
implementation("com.h2database:h2:1.4.200")
- implementation("mysql:mysql-connector-java:8.0.27")
+ implementation("mysql:mysql-connector-java:8.0.28")
implementation("org.postgresql:postgresql:42.3.1")
implementation("org.bstats:bstats-velocity:2.2.1")
- compileOnly("com.github.spotbugs:spotbugs-annotations:4.5.2")
+ compileOnly("com.github.spotbugs:spotbugs-annotations:4.5.3")
}
shadowJar {
@@ -93,7 +93,7 @@ license {
}
checkstyle {
- setToolVersion("9.2")
+ setToolVersion("9.2.1")
setConfigFile(file("${this.getRootDir()}/config/checkstyle/checkstyle.xml"))
setConfigProperties("configDirectory": "${this.getRootDir()}/config/checkstyle")
diff --git a/src/main/java/net/elytrium/limboauth/LimboAuth.java b/src/main/java/net/elytrium/limboauth/LimboAuth.java
index 770dc5b..04a159e 100644
--- a/src/main/java/net/elytrium/limboauth/LimboAuth.java
+++ b/src/main/java/net/elytrium/limboauth/LimboAuth.java
@@ -82,6 +82,7 @@ import net.elytrium.limboauth.utils.UpdatesChecker;
import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer;
import net.kyori.adventure.title.Title;
import org.bstats.charts.SimplePie;
+import org.bstats.charts.SingleLineChart;
import org.bstats.velocity.Metrics;
import org.slf4j.Logger;
@@ -147,6 +148,7 @@ public class LimboAuth {
metrics.addCustomChart(new SimplePie("totp_enabled", () -> String.valueOf(Settings.IMP.MAIN.ENABLE_TOTP)));
metrics.addCustomChart(new SimplePie("dimension", () -> Settings.IMP.MAIN.DIMENSION));
metrics.addCustomChart(new SimplePie("save_uuid", () -> String.valueOf(Settings.IMP.MAIN.SAVE_UUID)));
+ metrics.addCustomChart(new SingleLineChart("registered_players", () -> Math.toIntExact(this.playerDao.countOf())));
UpdatesChecker.checkForUpdates(this.getLogger());
}
@@ -260,7 +262,7 @@ public class LimboAuth {
}
}
- this.authServer = this.factory.createLimbo(authWorld);
+ this.authServer = this.factory.createLimbo(authWorld).setName("LimboAuth");
this.server.getEventManager().unregisterListeners(this);
this.server.getEventManager().register(this, new AuthListener(this, this.playerDao));
diff --git a/src/main/java/net/elytrium/limboauth/listener/AuthListener.java b/src/main/java/net/elytrium/limboauth/listener/AuthListener.java
index 62d001c..70dca80 100644
--- a/src/main/java/net/elytrium/limboauth/listener/AuthListener.java
+++ b/src/main/java/net/elytrium/limboauth/listener/AuthListener.java
@@ -62,9 +62,10 @@ public class AuthListener {
UUID uuid = event.getPlayer().getUniqueId();
if (postLoginTasks.containsKey(uuid)) {
// We need to delay for player's client to finish switching the server, it takes a little time.
- this.plugin.getServer().getScheduler().buildTask(
- this.plugin, () -> postLoginTasks.get(uuid).run()
- ).delay(Settings.IMP.MAIN.PREMIUM_AND_FLOODGATE_MESSAGES_DELAY, TimeUnit.MILLISECONDS).schedule();
+ this.plugin.getServer().getScheduler()
+ .buildTask(this.plugin, () -> postLoginTasks.get(uuid).run())
+ .delay(Settings.IMP.MAIN.PREMIUM_AND_FLOODGATE_MESSAGES_DELAY, TimeUnit.MILLISECONDS)
+ .schedule();
}
}