Releases: markozajc/Akiwrapper
Releases · markozajc/Akiwrapper
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#getQuestion
has been renamed toAkiwrapper#getCurrentResponse()
.GuessType
has been renamed toTheme
to more accurately reflect its purpose.Language
andTheme
(previouslyGuessType
) enums have been moved toAkiwrapper
.Theme.MOVIE_TV_SHOW
andTheme.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 toLanguageThemeCombinationException
Status
has been converted to an enum and moved to the.utils.route
package,Status.Level
andStatus.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 toGuess
. We can no longer reliably tell aQuestion
's ID, so it only makes sense forGuess
to have it.- The deprecated
AkiwrapperBuilder#DEFAULT_LOCALICATION
has 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 ofQuestion
andGuess
, 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:akiwrapper
toorg.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
withorg.eu.zajc.akiwrapper
in 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 aUndoOutOfBoundsException
when undoing the first question (previously it returnednull
)Akiwrapper#answer(Answer)
andAkiwrapper#undoAnswer()
now throw aQuestionsExhaustedException
after questions have been exhausted (previously they returnednull
)ServerUnavailableException
has been removed as it didn't have a consistent meaningStatusException
has been renamed toServerStatusException
MissingQuestionException
has been renamed toQuestionsExhaustedException
Server
can't be manually set inAkiwrapperBuilder
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 asList<Server>
Deprecations
Akiwrapper#getGuessesAboveProbability(double)
has been deprecated- use
Akiwrapper#suggestGuess()
instead
- use
AkiwrapperBuilder#DEFAULT_LOCALIZATION
has been deprecated- use
AkiwrapperBuilder#DEFAULT_LANGUAGE
instead
- 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 aReason
enum that should hopefully be less cryptic thanStatus#getMessage()
Fixes
- Answering the last (80th) question no longer throws a
JSONException
, but returnsnull
instead.
Other changes
AkinatorException
is now the superclass of all exceptions (and a subclass ofRuntimeException
)- 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 fixesAkinator
now requires a call tostartSession()
, which is done byAkiwrapperBuilder
..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
- 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 onen.akinator.com
. I have retrieved the intermediate certificate fromglobal3.akinator.com
and 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).
v1.5.2
Breaking changes
- The namespace has been moved from
com.markozajc.akiwrapper
tocom.github.markozajc.akiwrapper
to unify it with the group and artifact IDs, Akiwrapper#answerCurrentQuestion
has been deprecated and renamed toAkiwrapper#answer
,Akiwrapper#getCurrentQuestion
has been deprecated and renamed toAkiwrapper#getQuestion
,Question#getGain
has been deprecated and renamed toQuestion#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
andjsr305
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 toRoute#createRequest
,Route#getParametersQuantity
has been deprecated and renamed toRoute#getParameterCount
,- JSONUtils now uses primitive Optional types rather than boxed ones.