heroiclabs / nakama-godot

Godot client for Nakama server written in GDScript.
Apache License 2.0
607 stars 72 forks source link

When passing name with create_match_async then listing the match label is null #209

Closed Cyteon closed 5 months ago

Cyteon commented 6 months ago

Creating lobby snippet: gameMatch = await Global.socket.create_match_async("test")

Doing m.label returns null, i can verify it has fetched the match correctly as i can do m.match_id and m.size

dominiks commented 5 months ago

If I understand the documentation at https://heroiclabs.com/docs/nakama/concepts/multiplayer/relayed/#create-a-match correctly:

Users can optionally provide a name when creating a new match. This name is used to generate the match ID, meaning two players creating matches with the same name will end up with identical match IDs and, as a result, in the same match.

The name parameter does not set the match label but leads to a predictable match_id. To set the label you have use the server side scripting and an authoritative match.

Cyteon commented 5 months ago

Thanks, I'm currently storing the marchid as a key in a collection. Listing storage objects and iteratinging through them until it finds a key matching the marchid. This is not the best way as it has to iterate on that list for each match. Do you know of any better way?

dominiks commented 5 months ago

That depends on what you are trying to do. Find a match id via a label or listing all open matches and their labels? You can get good advice on the Heroiclabs forum at https://forum.heroiclabs.com/ it would be best if you asked your question there.

Cyteon commented 5 months ago

I want to list matches and their ids. But thanks