Repository navigation
Open
Description
Hi, thanks for the great example project!
When testing this project I ran into an issue:
I cannot see the test lobby I created with another Steam account in the match list. I’d like to know what could be the possible reason for this. The lobby list looks completely different on each account.
As a quick workaround, I wrote a very lazy way to display friend lobbies in the lobby list. Maybe it can help others who run into the same issue. (Note: both sides need to be online in Steam for it to work.)
Here is the modified code:
func get_friends_game_list() -> Dictionary:
var results: Dictionary = {}
for i in range(0, Steam.getFriendCount()):
var steam_id: int = Steam.getFriendByIndex(i, Steam.FRIEND_FLAG_IMMEDIATE)
var game_info: Dictionary = Steam.getFriendGamePlayed(steam_id)
if game_info.is_empty():
# This friend is not playing a game
continue
else:
# They are playing a game, check if it's the same game as ours
var app_id: int = game_info['id']
var lobby = game_info['lobby']
if app_id != Steam.getAppID() or lobby is String:
# Either not in this game, or not in a lobby
continue
if not results.has(lobby):
results[lobby] = []
results[lobby].append(steam_id)
return results
func _setup_ui():
#Should be customizable, ultimately
Steam.addRequestLobbyListDistanceFilter(Steam.LOBBY_DISTANCE_FILTER_CLOSE)
Steam.lobby_match_list.connect(
func(lobbies : Array):
var friend_lobbys = get_friends_game_list()
var all_lobbys = friend_lobbys.keys() + lobbies
for sample in all_lobbys:
var lobby_name : String = Steam.getLobbyData(sample, "name")
var member_count : int = Steam.getNumLobbyMembers(sample)
var join_button := Button.new()
if friend_lobbys.has(sample):
join_button.set_text(str(lobby_name, ": ",
member_count, " joined (Friend)"))
else:
join_button.set_text(str(lobby_name, ": ",
member_count, " joined (Public)"))
join_button.set_size(Vector2(100, 5))
lobby_container.add_child(join_button)
join_button.pressed.connect(
func():
steam_connect.hide()
steam_players.show()
gamestate.join_lobby(
sample,
player_name.text)
)
)
_request_lobby_list()
Do you have any idea why the match list does not return my test lobby?
Thanks!
Metadata
Metadata
Assignees
Labels
No labels
Activity
MichaelMacha commentedon Aug 19, 2025
Interesting. I'm not personally-and-immediately seeing anything wrong with your code, but I do know that 480 can get absolutely swamped, and if you live in a heavily populated area, it could still occasionally fail to find the specific target lobby. If you're using 480, I would encourage you to try it with an app id you own, too. Sometimes filtering by distance isn't enough.
(This is also why the lobby list looks different every time; even major games usually have far fewer running instances than this.)
That said, you also seem to be—if I'm reading this right—iterating over your friends list and checking to see if they're playing the game? I assume this is where most of the issue is?
You might try walking through it with breakpoints and unit-testing parts of that code, just to make sure they're doing what you intend for them to do. As an example, a
print("Friend Steam ID: ", steam_id)after retrieving the ID of a friend in the index, would ensure that you are actually getting IDs in the index; then, maybe a `print("Friend game info: ", game_info) to ensure that the dictionary returned isn't anything unexpected there.