Real-time parties create rules using runtime code

Is there a way to create rules on which users can create parties with before hooks using runtime code?

Hi @formatCvt

Yes we have support for adding before/after hooks for party messages. If you’re using the Go server runtime you should be good. If you’re using TypeScript you may see an error as the type definitions is yet to be updated but by providing the correct string (e.g. "PartyJoin") it should work correctly.

We’ll update our documentation to cover this.

Hi @tom
I’m working on creating parties for my game. We’re using the Go server. From my understanding, parties are only available using C# client SDK. Is there any place where I can find information about using server runtime code instead of the client?

Hi! Can you please help with PartyJoin hooks in TypeScript?

Hi @formatCvt,

The message names have been updated in our documentation (Nakama: Introduction | Heroic Labs Documentation) and are available in the TypeScript definitions in the latest release of nakama-common.

Is there any particular issue you need help with?

Nice! Thanks! I’ve see only party hooks and what about functions to work with party? Something like functions for groups - Nakama: Function Reference | Heroic Labs Documentation

Parties are interacted with via the client.

ok, looks like parties feature are semi-authoritative, because we can’t join/ban/leave user or send data to party by server-side logic

Yes you can think of a party like an ephemeral group. Any user can create one, they will then become the party leader. That user can then invite, promote, remove other users as well as close the party. This is all initiated via the client.

If the party leader disconnects without first closing the party, the server will choose a new party leader.

The Parties section of our documentation provides more context Nakama: Parties | Heroic Labs Documentation

Hi! Is there any plans to add server side functions to work with party (create/delete/change leader etc)?

Hi, there are not currently any plans to add party API functionality to the server runtime code. Parties are designed to be created and managed by clients for ephemeral group play.

Can you explain what your use case would be for managing the creation, leadership and deletion of a party from the server?

Automatic party creation from the server side when players entering or leaving a match for example

And in general, we want to control the full behavior of the party from the server side like groups do

When you say you want to control the full behaviour of a party from the server, can you give an example here of the kind of things you would want to control?

I guess the question really is what sort of system or behaviour are you trying to create?

As I mentioned, parties are designed to be ephemeral groups that are managed and self organised solely by the clients.

If your requirements are such that you need to manage the state of a group of players from the server (e.g. when it is created/deleted, who can join, who the leader is, promotion, demotion etc) then the Groups system may be better suited here.