Closed jonbonazza closed 8 months ago
@jonbonazza When you call the socket function for creating a party can you print what the contents of the structure you get back looks like?
@jonbonazza When you call the socket function for creating a party can you print what the contents of the structure you get back looks like?
Okay so finally had some more time to look at this, it looks like I get a NakamaRTAPI.Party
struct and it does indeed have the leader and current party presences (which in my case, just has the one member). So I guess my questions then are:
Party
struct, presences
is an array of UserPresence
objects. Is there ever a situation where this array will have more than one item in it in the case of party creation? I'm assuming this is just an array because the class is reused in other places as well in during party creation, this array will always have exactly one entry, is that correct?Do I not get a presence event with the leader on party create? I only get that info in the response? This is fine if it's the case, just wanted to make sure I understand it correctly.
@jonbonazza When one of the realtime features of Nakama is used they all share the same structural pattern of an initial state is returned (in the case of Parties its NakamaRTAPI.Party
) and deltas (joins and leaves) which will be received from the event listeners (i.e. received_party_presence
signal). Together it provides the most compact way to keep track of presences in that gameplay feature. When a Party is created the leader receives the initial state but will not also receive a signal on received_party_presence
.
Is there ever a situation where this array will have more than one item in it in the case of party creation? I'm assuming this is just an array because the class is reused in other places as well in during party creation, this array will always have exactly one entry, is that correct?
The system is designed to batch presence changes so its possible (though in the case of Party creation - it would be a very small window of time) that the party is created and another player finds it to join (if its an open party) before the party creator then receives their NakamaRTAPI.Party
struct response. In this case it would be practically unlikely to occur but the design must account for it anyway to avoid potential race conditions.
Can we move the follow on questions to a forum thread? 🙏
Hope this helps.
On the nakama runtime logs, I see the following after creating a party from a Godot client:
I have a the
received_party_presence
signal connected on the client but it is never called.This is using the lastestGodot 4 client on the Godot asset lib (running on Windows 11), and nakama version 3.20.0 running in a docker container.