Skip to content

Releases: markozajc/Akiwrapper

v3.0.2

06 Sep 22:13
34441fb

Choose a tag to compare

Fixes

  • Guess#reject() no longer throws a MalformedResponseException.

v3.0.1

13 Apr 12:20
3cf7ec0

Choose a tag to compare

Fixes

  • Formatting HTTP errors no longer causes a StackOverflowError.
  • Guess#confirm no longer fails.

v3.0.0

13 Apr 02:15
70d4191

Choose a tag to compare

Akinator no longer works with Unirest, so I've opted to use Java's HttpClient instead. This also introduces breaking changes to the API, though migration should be straightforward unless a custom UnirestInstance is needed.

Breaking changes

  • UnirestUtils has been removed entirely.
  • AkiwrapperBuilder#getUnirestInstance has been removed and replaced with (incompatible) AkiwrapperBuilder#getHttpClient.
  • AkiwrapperBuilder#setUnirestInstance has been removed and replaced with (incompatible) AkiwrapperBuilder#setHttpClient.
  • Akiwrapper#getUnirestInstance has been removed and replaced with (incompatible) Akiwrapper#getHttpClient.
  • Deprecated methods and fields have been removed: Question#isExhausted, AkiwrapperBuilder.DEFAULT_GUESS_TYPE, AkiwrapperBuilder#setGuessType, AkiwrapperBuilder#getGuessType, Question#getQuestion, and AkinatorException#getDebugInformation.

Additions

  • Publicly writable Route.defaultHeaders has been added, since it is otherwise not possible to change the default headers.
  • Akiwrapper.Language.VIETNAMESE has been added.

Fixes

  • The AkinatorException: Got HTTP 403 error has been fixed. I'm not sure if this was a regional problem or not since it was emitted by CloudFlare and did not affect GitHub Actions workers, but Unirest's inability to communicate via HTTP/2 seems to be the cause.
  • Documentation no longer links to deprecated fields and methods.
  • LanguageEnumBuilder has been fixed and no longer produces an empty result.

v2.0.1

08 Feb 22:15
ed31983

Choose a tag to compare

Dependencies, most importantly Unirest, have been updated. Keep in mind that Unirest 4 has changed its artifact ID from unirest-java to unirest-java-core - while its package namespace is also different and you will be able to use it alongside Unirest 3, you will run into problems if you use a custom UnirestInstance with Akiwrapper unless you upgrade.

Deprecations

  • UnirestUtils.shutdownInstance() has been deprecated with no replacement, because it's no longer necessary.

v2.0.0

14 Apr 16:19
f0a5363

Choose a tag to compare

The game loop has been completely revised to suit the updated Akinator API, and to better fit an OOP model - questions are no longer answered through the Akiwrapper object, but instead use Question#answer(Answer). Guess has been changed similarly. Additionally, we can no longer request guesses from the API, instead they are returned whenever Akinator is confident enough. Query, a common parent of Question and Guess has been created to fit this model, and user code is meant to switch logic based on its type.

Please consult the example code or the README to find out how the new API is used.

Breaking changes

  • Akiwrapper#suggestGuess(), #getGuesses(), and #getGuessesAboveProbability() have been removed as the API no longer lets us list guesses on demand.
  • Akiwrapper#answer(Answer) has been moved to Question#answer(Answer).
  • Akiwrapper#undoAnswer() has been moved to Question#undoAnswer().
  • Akiwrapper#confirmGuess(Guess) has been moved to Guess#confirm().
  • Akiwrapper#rejectLastGuess() has been moved to Guess#reject().
  • Akiwrapper#getStep() has been moved to Query#getStep().
  • Akiwrapper#getServer() has been removed.
  • Akiwrapper#getQuestion has been renamed to Akiwrapper#getCurrentResponse().
  • GuessType has been renamed to Theme to more accurately reflect its purpose.
  • Language and Theme (previously GuessType) enums have been moved to Akiwrapper.
  • Theme.MOVIE_TV_SHOW and Theme.PLACE have been removed removed as no language seems to support them.
  • Server has been removed. We now interact with <language>.akinator.com directly, so server URLs are no longer known or needed.
  • ServerNotFoundException has been renamed to LanguageThemeCombinationException
  • Status has been converted to an enum and moved to the .utils.route package, Status.Level and Status.Reason enums have been removed. Akinator no longer provides a status reason in the "completion" key, so only the level is know.
  • Guess#isExplicit() has been removed. Akinator no longer provides the "corrupt" key, and its purpose was speculation on my part to begin with.
  • Guess#getProbability() has been removed, as it is no longer known.
  • Guess#getGain() has been removed as it is no longer known.
  • Identifiable has been removed, and its functionality moved to Guess. We can no longer reliably tell a Question's ID, so it only makes sense for Guess to have it.
  • The deprecated AkiwrapperBuilder#DEFAULT_LOCALICATION has been removed.

Deprecations

  • Question#getQuestion() has been deprecated and renamed to Question#getText().
  • Akiwrapper#isExhausted() has been deprecated.
  • AkinatorException#getDebugInformation() has been deprecated and will always return an empty string.

Additions

  • Query, a common parent of Question and Guess, has been added.
  • Guess#getPseudonym() has been added.

Other changes

  • Guess#getDescription() is now @Nonnull (was previously @Nullable).

v1.6.1-1

14 Oct 14:11
6ca33dd

Choose a tag to compare

Fixes

Other changes

  • Update dependencies

v1.6.1

08 Aug 22:49
8264c3c

Choose a tag to compare

Breaking changes

  • Akiwrapper's artifact has relocated from com.github.markozajc:akiwrapper to org.eu.zajc:akiwrapper. You will need to change Akiwrapper's dependency's groupId in your pom.xml or build.gradle.
  • The same change has been made on the base package name, which means that you will need to replace com.github.markozajc.akiwrapper with org.eu.zajc.akiwrapper in your imports.

v1.6

30 Jul 01:18
754f925

Choose a tag to compare

Breaking changes

  • Previously deprecated features have been removed
  • Status#getReason() has been renamed to Status#getMessage(), but keep in mind that a new method with the same name has been added
  • Akiwrapper#undoAnswer() now throws a UndoOutOfBoundsException when undoing the first question (previously it returned null)
  • Akiwrapper#answer(Answer) and Akiwrapper#undoAnswer() now throw a QuestionsExhaustedException after questions have been exhausted (previously they returned null)
  • ServerUnavailableException has been removed as it didn't have a consistent meaning
  • StatusException has been renamed to ServerStatusException
  • MissingQuestionException has been renamed to QuestionsExhaustedException
  • Server can't be manually set in AkiwrapperBuilder anymore (this is more of a scream test; let me know if you needed that)
  • ServerList has been removed, lists of servers are now passed around as List<Server>

Deprecations

  • Akiwrapper#getGuessesAboveProbability(double) has been deprecated
    • use Akiwrapper#suggestGuess() instead
  • AkiwrapperBuilder#DEFAULT_LOCALIZATION has been deprecated
    • use AkiwrapperBuilder#DEFAULT_LANGUAGE instead

Additions

  • Added Akiwrapper#isExhausted() to check for question exhaustion
  • Guesses should now be retrieved using Akiwrapper#suggestGuess(), which keeps track of rejected guesses and replicates Akinator's behaviour better
  • Akiwrapper#confirmGuess(Guess) and Akiwrapper#rejectLastGuess() has been added to signal guess confirmation and rejections to the API
    • note that calling #confirmGuess(Guess) is purely optional but improves Akinator's algorithm
  • Added Status#getReason(), which returns a Reason enum that should hopefully be less cryptic than Status#getMessage()

Fixes

  • Answering the last (80th) question no longer throws a JSONException, but returns null instead.

Other changes

  • AkinatorException is now the superclass of all exceptions (and a subclass of RuntimeException)
  • Javadocs have been improved

Internal changes

  • Route has been rewritten from scratch and split into multiple classes, providing more robust access to the API, which should hopefully also make it easier to implement new features and fixes
  • Akinator now requires a call to startSession(), which is done by AkiwrapperBuilder
  • ..core.entities.impl.immutable has been renamed to ..core.entities.impl
  • IntegrationTest has been extended to cover question exhaustion

Full Changelog: v1.5.2...v1.6

v1.5.2-2

29 Apr 16:46
34802e1

Choose a tag to compare

  • Work around the PKIX path building failed exception: it seems that Akinator has misconfigured their HTTP server such that it no longer sends the full certificate chain on en.akinator.com. I have retrieved the intermediate certificate from global3.akinator.com and put it into src/main/resources/intermediate.jks. The intermediate certificate is added into the trust store by default (in UnirestUtils.configureInstance), but you can also apply it manually from WorkaroundUtils. This workaround does not compromise security beyond adding GoDaddy's intermediate certificate (Go Daddy Secure Certificate Authority - G2) to the trust store used by Akiwrapper.
  • Skipped unit tests (from invalid configuration combinations) now abort instead of reporting success
  • Updated dependencies

v1.5.2-1

14 Apr 19:29
5fb048e

Choose a tag to compare

  • Updated dependencies (fixes CVE-2022-45688, though that vulnerability doesn't seem to affect Akiwrapper's usage of the JSON library in the first place).