Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to know when lobby search finishes? #27

Closed
artemiswkearney opened this issue May 9, 2021 · 3 comments
Closed

How to know when lobby search finishes? #27

artemiswkearney opened this issue May 9, 2021 · 3 comments

Comments

@artemiswkearney
Copy link

artemiswkearney commented May 9, 2021

LobbyManager.search() calls DEFAULT_CALLBACK when the search finishes, but a bunch of other things also call it. There doesn't seem to be a Result 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.

@JnCrMx
Copy link
Owner

JnCrMx commented May 10, 2021

There are to versions of the search-method:

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.

@artemiswkearney
Copy link
Author

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?

@JnCrMx
Copy link
Owner

JnCrMx commented May 10, 2021

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants