Skip to content

Commit

Permalink
Add registered players chart, update dependencies, release candidate 3.
Browse files Browse the repository at this point in the history
  • Loading branch information
mdxd44 committed Jan 22, 2022
1 parent 21bf2a1 commit 7cda528
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 52 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Java CI with Gradle

on: [ push ]
on: [ push, pull_request ]

jobs:
build:
Expand All @@ -11,22 +11,22 @@ 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') }}
restore-keys: ${{ runner.os }}-gradle-
- 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"
32 changes: 0 additions & 32 deletions .github/workflows/test.yml

This file was deleted.

22 changes: 11 additions & 11 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -23,6 +23,10 @@ java {
repositories {
mavenCentral()

maven {
setName("elytrium-repo")
setUrl("https://maven.elytrium.net/repo/")
}
maven {
setName("papermc-repo")
setUrl("https://papermc.io/repo/repository/maven-public/")
Expand All @@ -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")
Expand All @@ -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 {
Expand Down Expand Up @@ -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")

Expand Down
4 changes: 3 additions & 1 deletion src/main/java/net/elytrium/limboauth/LimboAuth.java
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
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;

Expand Down Expand Up @@ -147,6 +148,7 @@ public void onProxyInitialization(ProxyInitializeEvent event) throws Exception {
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());
}
Expand Down Expand Up @@ -260,7 +262,7 @@ public void reload() throws Exception {
}
}

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));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,10 @@ public void onPostLogin(PostLoginEvent event) {
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();
}
}

Expand Down

0 comments on commit 7cda528

Please sign in to comment.