Compare commits

...
7 Commits
Author SHA1 Message Date
Nassim Jahnke d8e36d7ff6 4.0.1 Release 2022-04-16 18:40:34 +02:00
Nassim Jahnke 39f966ba5d Update dependencies, actually fix tests 2022-04-15 21:51:29 +02:00
Nassim Jahnke 879f07e3e7 Fix tests 2022-04-15 20:08:13 +02:00
Nassim Jahnke 9cbead310a Fix config header saving 2022-03-23 09:27:43 +01:00
Nassim Jahnke 25375b184d Update workflow 2022-03-23 09:26:53 +01:00
Nassim Jahnke eec5acd0ce Bump version to 4.0.1-SNAPSHOT 2022-03-23 09:20:09 +01:00
Nassim Jahnke 14cef4d53b Fix Sponge metadata replacement 2022-03-17 10:50:56 +01:00
12 changed files with 108 additions and 26 deletions

No files matched your search

+4
View File
@@ -1,6 +1,10 @@
# Maintenance Changelog
This file contains update logs for this project. The top may contain a `Unreleased` section, gathering update logs for a future update during development.
---
## 4.0.1 - April 17th 2022
### Fixed
* Fixed the config header sometimes breaking the config on upgrading/saving
---
## 4.0.0 - March 17th 2022
### Changed
+4 -10
View File
@@ -7,16 +7,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.4.0
- uses: actions/cache@v2.1.7
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-maven-
- uses: actions/checkout@v3.0.0
- name: Set up JDK 11
uses: actions/setup-java@v2.5.0
uses: actions/setup-java@v3.0.0
with:
java-version: 11
distribution: 'temurin'
@@ -25,7 +19,7 @@ jobs:
run: ./gradlew build
- name: Upload a Build Artifact
uses: actions/upload-artifact@v2.3.1
uses: actions/upload-artifact@v3.0.0
with:
name: MaintenanceFiles
name: Maintenance Files
path: build/libs
+1
View File
@@ -94,3 +94,4 @@ $RECYCLE.BIN/
*.lnk
!MaintenanceAPI.jar
**/src/test/resources/
!core/src/test/resources/dirty-config.yml
+1 -2
View File
@@ -29,10 +29,9 @@ A full list of commands, permissions and configuration options can be found in t
Other forum threads
* [Spigot forums](https://www.spigotmc.org/resources/maintenance.40699/)
* [Ore/Sponge Forums](https://ore.spongepowered.org/KennyTV/Maintenance)
* [Velocity forums](https://forums.velocitypowered.com/t/maintenance/129)
## Compiling
To create a working jar yourself, simply clone the project and compile it with maven (by using `mvn clean package` in your IDE console).
To create a working jar yourself, simply clone the project and compile it with Gradle (`gradlew build`).
## License
This project is licensed under the [GNU General Public License v3](LICENSE.txt).
@@ -6,7 +6,7 @@ plugins {
tasks {
// Variable replacements
processResources {
filesMatching(listOf("plugin.yml", "bungee.yml")) {
filesMatching(listOf("plugin.yml", "bungee.yml", "META-INF/sponge_plugins.json")) {
expand("version" to project.version, "description" to project.description)
}
}
@@ -18,6 +18,9 @@ tasks {
options.encoding = Charsets.UTF_8.name()
options.compilerArgs.addAll(listOf("-nowarn", "-Xlint:-unchecked", "-Xlint:-deprecation"))
}
test {
useJUnitPlatform()
}
}
java {
+3 -2
View File
@@ -36,6 +36,7 @@ subprojects {
}
dependencies {
TEST_IMPLEMENTATION_CONFIGURATION_NAME("org.junit.jupiter:junit-jupiter-engine:5.8.2")
TEST_IMPLEMENTATION_CONFIGURATION_NAME(rootProject.libs.bundles.junit)
TEST_IMPLEMENTATION_CONFIGURATION_NAME(rootProject.libs.snakeyaml)
}
}
}
@@ -51,7 +51,8 @@ public final class Config extends ConfigSection {
"###################################################################################################################\n" +
"# You can report bugs here: https://github.com/kennytv/Maintenance/issues\n" +
"# If you need any other help/support, you can also join my Discord server: https://discord.gg/vGCUzHq\n" +
"# The config and language files use MiniMessage, NOT legacy text for input. Use https://webui.adventure.kyori.net/ to edit and preview the formatted text.";
"# The config and language files use MiniMessage, NOT legacy text for input. Use https://webui.adventure.kyori.net/ to edit and preview the formatted text.\n" +
"# For a full list of formats and fancy examples of MiniMessage, see https://docs.adventure.kyori.net/minimessage/format.html\n";
private final Yaml yaml = createYaml();
private final File file;
private final Set<String> unsupportedFields;
@@ -17,6 +17,7 @@
*/
package eu.kennytv.maintenance.core.config;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestInstance;
@@ -39,6 +40,17 @@ class ConfigTest {
copyOriginalToTest("config.yml", "config.yml");
}
@Test
void testHeader() throws Exception {
final Config config = new Config(getTestFile("config.yml"));
config.load();
final String header = config.getHeader();
config.resetAwesomeHeader();
Assertions.assertTrue(config.getHeader().endsWith("\n"), "Header needs to end with a new line");
Assertions.assertEquals(config.getHeader(), header);
}
@Test
void testDeep() throws IOException {
final Config config = new Config(getTestFile("config.yml"));
+61
View File
@@ -0,0 +1,61 @@
# Enables maintenance mode.
maintenance-enabled: true
# Enables maintenance on certain servers managed by your Bungee instance(s).
proxied-maintenance-servers:
- SpigotServer1
# - AnotherServer
# If maintenance is enabled on a proxied server with players on it,
# they will be sent to the fallback server instead of being kicked off the network.
# If the fallback server is not reachable/not set, they will just be kicked off the network.
fallback: ''
# The message shown in the multiplayer server list motd when maintenance is enabled.
# If you put in multiple entries, one of them will be chosen randomly on every ping.
# If running an endtimer, the time left can be displayed by including '%TIMER%' in a pingmessage (also works in playercount(-hover) message).
pingmessages:
- |2-
&2&lX's &b&lServer &f- &7&l(1.12.2-1.15.2)
&4&n&lMANUTENZIONE!
enable-timerspecific-messages: true
timerspecific-pingmessages:
- |2-
&2&lX's &b&lServer &f- &7&l(1.12.2-1.15.2)
&4&n&lMANUTENZIONE! Torneremo tra %TIMER%
enable-playercountmessage: true
playercountmessage: '&41.12.2-1.15.2'
playercounthovermessage: '&n&lStato server: In manutenzione'
custom-maintenance-icon: false
send-join-notification: false
kick-online-players: true
language: de
mysql:
use-mysql: false
host: host
port: 3306
database: database
username: useer
password: password
update-interval: 15
use-ssl: true
continue-endtimer-after-restart:
enabled: false
end: 0
timer-broadcast-for-seconds:
- 1200
- 900
- 600
- 300
- 120
- 60
- 30
- 20
- 10
- 5
- 4
- 3
- 2
- 1
update-checks: true
config-version: 3
+1 -1
View File
@@ -1,4 +1,4 @@
projectVersion=4.0.0
projectVersion=4.0.1
# Gradle properties
org.gradle.daemon=true
+14 -8
View File
@@ -4,8 +4,8 @@ metadata.format.version = "1.1"
# Shaded
adventure = "4.10.1"
adventurePlatform = "4.0.1"
mysqlConnector = "8.0.27"
adventurePlatform = "4.1.0"
mysqlConnector = "8.0.28"
hikariCP = "4.0.3"
# Provided
@@ -25,6 +25,8 @@ bungee = "1.18-R0.1-SNAPSHOT"
sponge = "8.0.0"
velocity = "3.1.0"
junitVer = "5.8.2"
[libraries]
@@ -40,19 +42,23 @@ jetbrainsAnnotations = { group = "org.jetbrains", name = "annotations", version.
gson = { group = "com.google.code.gson", name = "gson", version.ref = "gson" }
guava = { group = "com.google.guava", name = "guava", version.ref = "guava" }
authlib = { group = "com.mojang", name = "authlib", version.ref = "authlib" }
protocollib = { group = "com.comphenix.protocol", name = "ProtocolLib", version.ref = "protocollib" }
hikariCP = { group = "com.zaxxer", name = "HikariCP", version.ref = "hikariCP" }
luckperms = { group = "net.luckperms", name = "api", version.ref = "luckperms" }
snakeyaml = { group = "org.yaml", name = "snakeyaml", version.ref = "snakeyaml" }
serverlistplus = { group = "net.minecrell", name = "ServerListPlus", version.ref = "serverlistplus" }
authlib = { group = "com.mojang", name = "authlib", version.ref = "authlib" }
protocollib = { group = "com.comphenix.protocol", name = "ProtocolLib", version.ref = "protocollib" }
hikariCP = { group = "com.zaxxer", name = "HikariCP", version.ref = "hikariCP" }
luckperms = { group = "net.luckperms", name = "api", version.ref = "luckperms" }
snakeyaml = { group = "org.yaml", name = "snakeyaml", version.ref = "snakeyaml" }
serverlistplus = { group = "net.minecrell", name = "ServerListPlus", version.ref = "serverlistplus" }
paper = { group = "com.destroystokyo.paper", name = "paper-api", version.ref = "paper" }
bungee = { group = "net.md-5", name = "bungeecord-api", version.ref = "bungee" }
sponge = { group = "org.spongepowered", name = "spongeapi", version.ref = "sponge" }
velocity = { group = "com.velocitypowered", name = "velocity-api", version.ref = "velocity" }
jupiterApi = { group = "org.junit.jupiter", name = "junit-jupiter-api", version.ref = "junitVer" }
jupiterEngine = { group = "org.junit.jupiter", name = "junit-jupiter-engine", version.ref = "junitVer" }
[bundles]
adventure = ["adventureApi", "adventureTextMinimessage", "adventureTextSerializerGson", "adventureTextSerializerLegacy"]
junit = ["jupiterApi", "jupiterEngine"]
+1 -1
View File
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists