Skip to content

Releases: markozajc/Akiwrapper

v2.0.0

14 Apr 16:19
f0a5363
Compare
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
Compare
Choose a tag to compare

Fixes

Other changes

  • Update dependencies

v1.6.1

08 Aug 22:49
8264c3c
Compare
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
Compare
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
Compare
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
Compare
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).

v1.5.2

07 Jul 21:00
b9831b7
Compare
Choose a tag to compare

Breaking changes

  • The namespace has been moved from com.markozajc.akiwrapper to com.github.markozajc.akiwrapper to unify it with the group and artifact IDs,
  • Akiwrapper#answerCurrentQuestion has been deprecated and renamed to Akiwrapper#answer,
  • Akiwrapper#getCurrentQuestion has been deprecated and renamed to Akiwrapper#getQuestion,
  • Question#getGain has been deprecated and renamed to Question#getInfogain.

Additions

  • It is now possible to make Akiwrapper use a custom Unirest instance through AkiwrapperBuilder#setUnirestInstance. By default, UnirestUtils.getInstance is used, and it is now pointer multiple times in the javadocs that the singleton/custom provided instance need to be closed after they're no longer needed in order to prevent memory leakage.

Other changes

  • spotbugs-annotations and jsr305 are now optional dependencies - they will not be inherited when you depend on Maven, as they're not needed during runtime and making dependents inherit them by default makes little sense,
  • The example project has been cleaned up, and its pom.xml has been updated to allow it to compile properly.

Internal changes

  • AkiwrapperMetadata and MutableAkiwrapperMetadata have been removed since it makes no sense to keep them around with changes to how AkiwrapperImpl is constructed. Their methods and constants have been moved into AkiwrapperBuilder,
  • Internal methods that make HTTP requests now take UnirestInstance as a parameter, as it is no longer a static constant,
  • Route#getRequest has been deprecated and renamed to Route#createRequest,
  • Route#getParametersQuantity has been deprecated and renamed to Route#getParameterCount,
  • JSONUtils now uses primitive Optional types rather than boxed ones.

v1.5.1.2

22 Apr 15:02
bbaf2ac
Compare
Choose a tag to compare
  • Updated dependencies.

v1.5.1.1

02 Apr 10:54
e0249a9
Compare
Choose a tag to compare
  • Updated dependencies.

v1.5.1

10 Feb 11:20
7902fd8
Compare
Choose a tag to compare
  • Fixed a small typo that could cause a confusing exception message