diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 85c0f89..88b0cea 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -25,7 +25,7 @@ jobs: uses: actions/setup-java@v2 with: distribution: temurin - java-version: 17 + java-version: 18 - name: create dist run: make dist - name: release diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index bae636a..53825c5 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -17,6 +17,6 @@ jobs: uses: actions/setup-java@v2 with: distribution: temurin - java-version: 17 + java-version: 18 - name: run tests - run: make tests \ No newline at end of file + run: make tests diff --git a/TODO.md b/TODO.md deleted file mode 100644 index 6cc0694..0000000 --- a/TODO.md +++ /dev/null @@ -1,3 +0,0 @@ -* [x] items improvements -* [x] multiple parties support -* [ ] pretty UI \ No newline at end of file diff --git a/build.sbt b/build.sbt index 1ba98ae..92007da 100644 --- a/build.sbt +++ b/build.sbt @@ -2,7 +2,7 @@ organization := "me.arcanis" name := "ffxivbis" -scalaVersion := "2.13.6" +scalaVersion := "2.13.8" scalacOptions ++= Seq("-deprecation", "-feature") diff --git a/libraries.sbt b/libraries.sbt index d1d2463..a065037 100644 --- a/libraries.sbt +++ b/libraries.sbt @@ -1,5 +1,5 @@ -val AkkaVersion = "2.6.19" -val AkkaHttpVersion = "10.2.9" +val AkkaVersion = "2.6.20" +val AkkaHttpVersion = "10.2.10" val ScalaTestVersion = "3.2.12" val SlickVersion = "3.3.3" @@ -10,7 +10,7 @@ libraryDependencies += "com.typesafe.akka" %% "akka-http" % AkkaHttpVersion libraryDependencies += "com.typesafe.akka" %% "akka-http-spray-json" % AkkaHttpVersion libraryDependencies += "com.typesafe.akka" %% "akka-actor-typed" % AkkaVersion libraryDependencies += "com.typesafe.akka" %% "akka-stream" % AkkaVersion -libraryDependencies += "com.github.swagger-akka-http" %% "swagger-akka-http" % "2.7.0" +libraryDependencies += "com.github.swagger-akka-http" %% "swagger-akka-http" % "2.8.0" libraryDependencies += "jakarta.platform" % "jakarta.jakartaee-web-api" % "9.1.0" libraryDependencies += "ch.megard" %% "akka-http-cors" % "1.1.3" @@ -18,9 +18,9 @@ libraryDependencies += "io.spray" %% "spray-json" % "1.3.6" libraryDependencies += "org.playframework.anorm" %% "anorm" % "2.6.10" libraryDependencies += "com.zaxxer" % "HikariCP" % "5.0.1" exclude("org.slf4j", "slf4j-api") -libraryDependencies += "org.flywaydb" % "flyway-core" % "8.5.12" -libraryDependencies += "org.xerial" % "sqlite-jdbc" % "3.36.0.3" -libraryDependencies += "org.postgresql" % "postgresql" % "42.3.6" +libraryDependencies += "org.flywaydb" % "flyway-core" % "9.2.2" +libraryDependencies += "org.xerial" % "sqlite-jdbc" % "3.39.2.1" +libraryDependencies += "org.postgresql" % "postgresql" % "42.5.0" libraryDependencies += "org.mindrot" % "jbcrypt" % "0.4" libraryDependencies += "com.google.guava" % "guava" % "31.0.1-jre" diff --git a/project/build.properties b/project/build.properties index f4f743c..d738b85 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version = 1.5.8 +sbt.version = 1.7.1 diff --git a/src/main/scala/me/arcanis/ffxivbis/http/api/v1/json/JsonSupport.scala b/src/main/scala/me/arcanis/ffxivbis/http/api/v1/json/JsonSupport.scala index 6527958..736e7fb 100644 --- a/src/main/scala/me/arcanis/ffxivbis/http/api/v1/json/JsonSupport.scala +++ b/src/main/scala/me/arcanis/ffxivbis/http/api/v1/json/JsonSupport.scala @@ -16,12 +16,12 @@ import java.time.Instant trait JsonSupport extends SprayJsonSupport with DefaultJsonProtocol { - private def enumFormat[E <: Enumeration](enum: E): RootJsonFormat[E#Value] = + private def enumFormat[E <: Enumeration](enumeration: E): RootJsonFormat[E#Value] = new RootJsonFormat[E#Value] { override def write(obj: E#Value): JsValue = obj.toString.toJson override def read(json: JsValue): E#Value = json match { - case JsNumber(value) => enum(value.toInt) - case JsString(name) => enum.withName(name) + case JsNumber(value) => enumeration(value.toInt) + case JsString(name) => enumeration.withName(name) case other => deserializationError(s"String or number expected, got $other") } } diff --git a/src/main/scala/me/arcanis/ffxivbis/service/bis/XivApi.scala b/src/main/scala/me/arcanis/ffxivbis/service/bis/XivApi.scala index 5046745..97f87a9 100644 --- a/src/main/scala/me/arcanis/ffxivbis/service/bis/XivApi.scala +++ b/src/main/scala/me/arcanis/ffxivbis/service/bis/XivApi.scala @@ -75,6 +75,8 @@ trait XivApi extends RequestExecutor { object XivApi { + private val defaultShop = JsObject("IsUnique" -> JsNumber(1), "StackSize" -> JsNumber(999)) + private def parseXivapiJsonToShop( js: JsObject )(implicit executionContext: ExecutionContext): Future[Map[Long, (String, Long)]] = { @@ -128,7 +130,7 @@ object XivApi { if (index == "crafted" && shopId == -1L) PieceType.Crafted else Try(shopMap(shopId).fields(s"ItemCost$index").asJsObject) - .getOrElse(throw new Exception(s"${shopMap(shopId).fields(s"ItemCost$index")}, $index")) + .getOrElse(defaultShop) .getFields("IsUnique", "StackSize") match { case Seq(JsNumber(isUnique), JsNumber(stackSize)) => if (isUnique == 1 || stackSize.toLong != 999) PieceType.Tome // either upgraded gear or tomes found