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

Can't find lobby with equal KeyValuePair in data (Pls help I'm stupid) #770

Open
morfeyc opened this issue Jun 6, 2024 · 3 comments
Open

Comments

@morfeyc
Copy link

morfeyc commented Jun 6, 2024

I'm creating lobby like this:

Lobby? lobby = await SteamMatchmaking.CreateLobbyAsync(Constants.MaxLobbyMembers);
if (lobby == null)
  return null;

lobby?.SetData("GameCode", "ABCD1234"));
lobby?.SetJoinable(true);
lobby?.SetPublic();

And after I try to find it by code on another instance(with another steam user(who is friend with host)) using this code:

Lobby[] results = await SteamMatchmaking
  .LobbyList
  .WithKeyValue("GameCode", "ABCD1234")
  .WithMaxResults(1)
  .RequestAsync();

if (results == null || results.Length == 0)
  return null;

return results.First();

And it's always return null

Meanwhile, when I use this search on the host side it's always find it
Am I stupid or does it not work?

@morfeyc morfeyc changed the title Can't find lobby with equal KeyValuePair in data Can't find lobby with equal KeyValuePair in data (Pls help I'm stupid) Jun 7, 2024
@kristianpiacenti
Copy link

I use LobbyQuery instead of LobbyList and it works well. I can send you code reference if it can help.

@morfeyc
Copy link
Author

morfeyc commented Sep 16, 2024

I use LobbyQuery instead of LobbyList and it works well. I can send you code reference if it can help.

I would be appreciate if you could send

@kristianpiacenti
Copy link

It's very similar to what you do

var findLobbiesQuery = new LobbyQuery();
findLobbiesQuery.maxResults = maxResults;
findLobbiesQuery.WithKeyValue(GAMENAME_LOBBYKEY, GAMENAME_LOBBYVALUE);
lobbies = await Task.Run(() => findLobbiesQuery.RequestAsync(), browseCancellationToken.Token);

let me know if you need more context 💪

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