EvilTurtleProductions Posted June 7, 2022 Share Posted June 7, 2022 I've gotten reports that people have trouble with joining friends-only lobbies i.e. they simply do not appear in the list. I've spend the past 2 hours experimenting and I noticed that the Lobby::Public setting works fine, but lobbies set to Lobby::FriendsOnly simply aren't detected by Lobby::Count(). Here's the lobby creation code: std::string lobbytype = "private"; if (permissions == 0) { lobbytype = "public"; currentlobby = Lobby::Create(4, Lobby::Public); } else if (permissions == 1) { lobbytype = "friends"; currentlobby = Lobby::Create(4, Lobby::FriendsOnly); } else currentlobby = Lobby::Create(4, Lobby::Private); if (currentlobby != nullptr) { world->Clear(true); currentlobby->SetString("game", title); currentlobby->SetString("type", lobbytype); currentlobby->SetString("mission", "0"); currentlobby->SetString("description", serverdescription->GetText()); etc... And here I fetch the lobbies when someone goes into the join menu: int count = Lobby::Count(); System::Print("Lobbies available: " + std::to_string(count)); for (int n = 0; n < count; n++) { Lobby* lobby = Lobby::Get(n); if (lobby->GetString("game") == title && lobby->GetString("type") == jointype) { std::string desc = lobby->GetString("description"); if (desc == "") desc = "(No name)"; desc += " | " + std::to_string(lobby->CountMembers()) + "/4"; if (lobbylist->CountItems() == 0) { lobbylist->AddItem(desc, true); selectedlobby = lobby; } else { lobbylist->AddItem(desc); } } } I've solved it now by setting friends-only lobbies to Public and setting lobby owner's SteamID in the lobby strings (SetString()). When I fetch the lobbies in the join menu I simply check if the steamID is this user's friend by using the GetFriendRelationship() API call. This seems to work fine for now, but I'm wondering if I'm missing something dumb with the FriendsOnly thing Quote Link to comment Share on other sites More sharing options...
Josh Posted June 7, 2022 Share Posted June 7, 2022 This is the source code for the lobby class: Lobby.cppLobby.h It's pretty straightforward, but there is always some things that change on Steam. 2 Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
reepblue Posted June 7, 2022 Share Posted June 7, 2022 I probably should make a tutorial on how to update the Steamworks library as the one included is hilariously outdated. 1 Quote Cyclone - Ultra Game System - Component Preprocessor - Tex2TGA - Darkness Awaits Template (Leadwerks) If you like my work, consider supporting me on Patreon! Link to comment Share on other sites More sharing options...
Josh Posted June 7, 2022 Share Posted June 7, 2022 That might not be a good idea. I know the API is supposed to stay the same, but it's a bad idea to mismatch headers and libraries. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
reepblue Posted June 7, 2022 Share Posted June 7, 2022 I replaced both headers and libraries and I ran into zero issues. Granted, I am not using the the built in Steamworks singleton class nor any networking features, but things like Steam Input (Which isn't in the library packaged) and app verification works. Quote Cyclone - Ultra Game System - Component Preprocessor - Tex2TGA - Darkness Awaits Template (Leadwerks) If you like my work, consider supporting me on Patreon! Link to comment Share on other sites More sharing options...
EvilTurtleProductions Posted June 7, 2022 Author Share Posted June 7, 2022 Ok I'll dive into that source code. Not sure if I can still get to doing that today, busy busy haha Oh, something else that came to mind: Lobby::GetOwner() only returns a valid ID if you actually joined that lobby already. This isn't mentioned in the docs anywhere and might give some confusion for people Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.