Verified Commit 9bdbfbfe authored by AtjonTV's avatar AtjonTV

Release 3.6.1

* Added
  * Support for AAAB-Center/Proxy HTTP status code 505 (Indicates outdated Plugin version)

* Changed
  * Only reload plugin on update rather then the full server
Signed-off-by: AtjonTV's avatarAtjonTV <thomas.obernosterer@atvg-studios.com>
parent 82266228
Pipeline #2004 passed with stages
in 1 minute and 15 seconds
......@@ -13,6 +13,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed
### Security
## [3.6.1] - 09.06.2019
### Added
- Support for AAAB-Center/Proxy HTTP status code 505 (Indicates outdated Plugin version)
### Changed
- Only reload plugin on update rather then the full server
## [3.6.0] - 09.06.2019
### Changed
......@@ -31,7 +39,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Removed
* Removed call to `/i/:uuid` if the UUID was not found in the cache
## 3.4.0] - 02.06.2019
## [3.4.0] - 02.06.2019
### Added
* Sending Plugin Version to remote for statistics
......
......@@ -13,7 +13,7 @@ plugins {
}
group 'com.atvgstudios'
version '3.6.0'
version '3.6.1'
repositories {
mavenCentral()
......
......@@ -14,7 +14,7 @@ import java.util.TimerTask
class Plugin : JavaPlugin() {
companion object {
val version = SemVer(3, 6, 0)
val version = SemVer(3, 6, 1)
const val prefix = "AAAB-v3 »"
}
......
......@@ -60,8 +60,19 @@ object Updater {
if (oldFile.exists()) oldFile.delete()
if (oldFile2.exists()) oldFile2.delete()
Console.log("Reloading Server")
Bukkit.getServer().reload()
Console.log("Trying to Reload Plugin")
val plugin = Bukkit.getPluginManager().getPlugin("AAAB-v3")
if (plugin != null) {
Console.log("Reloading Plugin")
Bukkit.getPluginManager().disablePlugin(plugin)
Bukkit.getPluginManager().enablePlugin(plugin)
} else {
Console.log("Reloading Server")
Bukkit.reload()
}
Console.log("Finished Installation of AAAB Update!")
} else {
Console.log("No Update Available! (Running: ${Plugin.version}, Available: $latestVersion)")
......
package com.atvgstudios.aaab.api
import com.atvgstudios.aaab.Console
import com.atvgstudios.aaab.Updater
import com.atvgstudios.aaab.extensions.setDefaultHeaders
import com.github.kittinunf.fuel.Fuel
import com.github.kittinunf.fuel.gson.responseObject
......@@ -19,13 +20,21 @@ object UserAPI {
val (res, _) = f.third
if (f.second.statusCode == 505) {
Updater.update()
}
return res?.ok ?: false
}
fun sendToken(token: String) {
Fuel.get("$remote/t/$token")
val f = Fuel.get("$remote/t/$token")
.setDefaultHeaders()
.responseString()
if (f.second.statusCode == 505) {
Updater.update()
}
}
fun getAfter(num: Int): List<Profile> {
......@@ -39,6 +48,10 @@ object UserAPI {
if (res == null) return ArrayList()
if (f.second.statusCode == 505) {
Updater.update()
}
val listOfProfiles = object : TypeToken<List<Profile>>() {}.type
val profiles = kLibInf.jsonHandler.toObject(res, listOfProfiles) ?: return ArrayList()
......@@ -57,6 +70,10 @@ object UserAPI {
if (res == null) return ArrayList()
if (f.second.statusCode == 505) {
Updater.update()
}
val listOfProfiles = object : TypeToken<List<Profile>>() {}.type
val profiles = kLibInf.jsonHandler.toObject(res, listOfProfiles) ?: return ArrayList()
......
......@@ -2,7 +2,7 @@ main: com.atvgstudios.aaab.Plugin
name: AAAB-v3
description: This is the third generation of AAAB that uses a completly new online API and is more performant.
author: Thomas Obernosterer <thomas.obernosterer@atvg-studios.com>
version: 3.5.0
version: 3.6.1
website: https://aaab-online.xyz
commands:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment