Party API Documentation

Hi, I can not find much regarding party in server runtime framework documentation. I want to know if I can find members of the party if given a party id.

Hello @demon,

Usually parties are operated on through the API expose by the socket. Could you elaborate a bit more on what you are trying to achieve?

It depends on what you actually have to do, if you’ll like to have a list with all the parties and their members or get a party object by id, you’ll probably have to create a custom RPC call to get all the data you need. :man_shrugging:
But if you want a list for the members of the group you are currently in, you just have to assign a function to the socket.ReceivedParty and you’ll have there a list with their presence.

I wanted this on the server side, not client side. I think streams can be used for this but when I pass in the the party Id that I get from the client, StreamSend, the client isn’t receiving any message:
Used the event ReceivedStreamState

Do I need to explictly add users to stream ? I assumed joinging and being in a single party makes them a part of the stream

No, I tagged server-framework for a reason.

I tried using StreamUserJoin with subject PartyId, but that fails with “stream subject must be a valid identifier” error.

I checked the party Id it contains a alphanumeric uuid with “.nakama1” appended to it

This was not working because we need a socket connection to have a correct session id for stream calls.

So, I changed the whole process and instead listen to After hook for PartyJoin to join stream.

1 Like

Note to everyone else and @novabyte (please see if anything here can be streamlined):

  1. Streams are not joined automatically even though intuitively it makes sense to have it automatic.
  2. You can listen to PartyJoin message to capture user and explictly add them to the party stream.
  3. PartyJoin message is not received when it is created for the first time by the party leader, which means party leader needs to join party stream explicitly via an RPC.

@demon What version of Nakama are you on because I think what you’ve suggested is outdated. Also do you use our Unreal OnlinePartySubsystem integration or is this the Realtime Parties feature in Nakama?

I am using 3.15 and Realtime Parties.