Closed artemiswkearney closed 3 years ago
There are to versions of the search
-method:
public void search(LobbySearchQuery query)
which uses the DEFAULT_CALLBACK
(https://javadoc.jitpack.io/com/github/JnCrMx/discord-game-sdk4j/v0.5.2/javadoc/de/jcm/discordgamesdk/LobbyManager.html#search-de.jcm.discordgamesdk.lobby.LobbySearchQuery-)public void search(LobbySearchQuery query, Consumer<Result> callback)
to which you can provide any callback as second argument (https://javadoc.jitpack.io/com/github/JnCrMx/discord-game-sdk4j/v0.5.2/javadoc/de/jcm/discordgamesdk/LobbyManager.html#search-de.jcm.discordgamesdk.lobby.LobbySearchQuery-java.util.function.Consumer-)The first one only exists for consistency, because I decided to implement a DEFAULT_CALLBACK
version of all methods that have a callback. For search
that version might be a little useless indeed.
Okay, I could've sworn the docs only showed the first version. It looks like what actually happened is that they showed the 1-argument version last, and I scrolled down looking for a solution but not up. (Also, all the mentions of search
in the docs for the methods for interacting with the results link to the 1-argument version.)
Closing the issue here, although maybe it's worth making those links point to the more useful one?
Usually the two version link to each other, but in the case of search
I made a mistake, so that search(LobbySearchQuery query)
linked to itself, instead of to search(LobbySearchQuery query, Consumer<Result> callback)
.
But I will consider changing all links to search(LobbySearchQuery query)
to links to search(LobbySearchQuery query, Consumer<Result> callback)
.
LobbyManager.search()
callsDEFAULT_CALLBACK
when the search finishes, but a bunch of other things also call it. There doesn't seem to be aResult
specific to "your lobby search is done", so there's no way to tell whether the callback is related, as far as I can tell.The C and C# versions of this function seem to take a callback as the second argument, but the Java version here only takes the query.