Releases: markozajc/Akiwrapper
v3.0.2
v3.0.1
v3.0.0
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
UnirestUtilshas been removed entirely.AkiwrapperBuilder#getUnirestInstancehas been removed and replaced with (incompatible)AkiwrapperBuilder#getHttpClient.AkiwrapperBuilder#setUnirestInstancehas been removed and replaced with (incompatible)AkiwrapperBuilder#setHttpClient.Akiwrapper#getUnirestInstancehas 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, andAkinatorException#getDebugInformation.
Additions
- Publicly writable
Route.defaultHeadershas been added, since it is otherwise not possible to change the default headers. Akiwrapper.Language.VIETNAMESEhas been added.
Fixes
- The
AkinatorException: Got HTTP 403error 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.
LanguageEnumBuilderhas been fixed and no longer produces an empty result.
v2.0.1
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
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 toQuestion#answer(Answer).Akiwrapper#undoAnswer()has been moved toQuestion#undoAnswer().Akiwrapper#confirmGuess(Guess)has been moved toGuess#confirm().Akiwrapper#rejectLastGuess()has been moved toGuess#reject().Akiwrapper#getStep()has been moved toQuery#getStep().Akiwrapper#getServer()has been removed.Akiwrapper#getQuestionhas been renamed toAkiwrapper#getCurrentResponse().GuessTypehas been renamed toThemeto more accurately reflect its purpose.LanguageandTheme(previouslyGuessType) enums have been moved toAkiwrapper.Theme.MOVIE_TV_SHOWandTheme.PLACEhave been removed removed as no language seems to support them.Serverhas been removed. We now interact with<language>.akinator.comdirectly, so server URLs are no longer known or needed.ServerNotFoundExceptionhas been renamed toLanguageThemeCombinationExceptionStatushas been converted to an enum and moved to the.utils.routepackage,Status.LevelandStatus.Reasonenums 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.Identifiablehas been removed, and its functionality moved toGuess. We can no longer reliably tell aQuestion's ID, so it only makes sense forGuessto have it.- The deprecated
AkiwrapperBuilder#DEFAULT_LOCALICATIONhas been removed.
Deprecations
Question#getQuestion()has been deprecated and renamed toQuestion#getText().Akiwrapper#isExhausted()has been deprecated.AkinatorException#getDebugInformation()has been deprecated and will always return an empty string.
Additions
Query, a common parent ofQuestionandGuess, has been added.Guess#getPseudonym()has been added.
Other changes
Guess#getDescription()is now@Nonnull(was previously@Nullable).
v1.6.1-1
v1.6.1
Breaking changes
- Akiwrapper's artifact has relocated from
com.github.markozajc:akiwrappertoorg.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.akiwrapperwithorg.eu.zajc.akiwrapperin your imports.
v1.6
Breaking changes
- Previously deprecated features have been removed
Status#getReason()has been renamed toStatus#getMessage(), but keep in mind that a new method with the same name has been addedAkiwrapper#undoAnswer()now throws aUndoOutOfBoundsExceptionwhen undoing the first question (previously it returnednull)Akiwrapper#answer(Answer)andAkiwrapper#undoAnswer()now throw aQuestionsExhaustedExceptionafter questions have been exhausted (previously they returnednull)ServerUnavailableExceptionhas been removed as it didn't have a consistent meaningStatusExceptionhas been renamed toServerStatusExceptionMissingQuestionExceptionhas been renamed toQuestionsExhaustedExceptionServercan't be manually set inAkiwrapperBuilderanymore (this is more of a scream test; let me know if you needed that)ServerListhas been removed, lists of servers are now passed around asList<Server>
Deprecations
Akiwrapper#getGuessesAboveProbability(double)has been deprecated- use
Akiwrapper#suggestGuess()instead
- use
AkiwrapperBuilder#DEFAULT_LOCALIZATIONhas been deprecated- use
AkiwrapperBuilder#DEFAULT_LANGUAGEinstead
- use
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)andAkiwrapper#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
- note that calling
- Added
Status#getReason(), which returns aReasonenum that should hopefully be less cryptic thanStatus#getMessage()
Fixes
- Answering the last (80th) question no longer throws a
JSONException, but returnsnullinstead.
Other changes
AkinatorExceptionis now the superclass of all exceptions (and a subclass ofRuntimeException)- Javadocs have been improved
Internal changes
Routehas 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 fixesAkinatornow requires a call tostartSession(), which is done byAkiwrapperBuilder..core.entities.impl.immutablehas 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
- Work around the
PKIX path building failedexception: it seems that Akinator has misconfigured their HTTP server such that it no longer sends the full certificate chain onen.akinator.com. I have retrieved the intermediate certificate fromglobal3.akinator.comand put it intosrc/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
- 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).