# Real-time parties create rules using runtime code

**URL:** <https://forum.heroiclabs.com/t/real-time-parties-create-rules-using-runtime-code/3190>\
**Category:** Runtime Framework\
**Created:** [October 21, 2022, 1:38pm UTC](https://forum.heroiclabs.com/t/real-time-parties-create-rules-using-runtime-code/3190 "2022-10-21T13:38:33Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![formatCvt](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/formatcvt/32/1127_2.png) [@formatCvt](https://forum.heroiclabs.com/u/formatCvt)\
**Post date:** [October 21, 2022, 1:38pm UTC](https://forum.heroiclabs.com/t/real-time-parties-create-rules-using-runtime-code/3190/1 "2022-10-21T13:38:33Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![tom](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/tom/32/676_2.png) [@tom](https://forum.heroiclabs.com/u/tom)\
**Post date:** [October 21, 2022, 4:18pm UTC](https://forum.heroiclabs.com/t/real-time-parties-create-rules-using-runtime-code/3190/2 "2022-10-21T16:18:14Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Ben](https://avatars.discourse-cdn.com/v4/letter/b/df788c/32.png) [@Ben](https://forum.heroiclabs.com/u/Ben)\
**Post date:** [October 22, 2022, 9:49pm UTC](https://forum.heroiclabs.com/t/real-time-parties-create-rules-using-runtime-code/3190/3 "2022-10-22T21:49:37Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![formatCvt](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/formatcvt/32/1127_2.png) [@formatCvt](https://forum.heroiclabs.com/u/formatCvt)\
**Post date:** [January 25, 2023, 10:25am UTC](https://forum.heroiclabs.com/t/real-time-parties-create-rules-using-runtime-code/3190/4 "2023-01-25T10:25:19Z")

</div>

> [@tom](#):
>
> We’ll update our documentation to cover this.

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

---

<div class="post-metadata">

**Author:** ![tom](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/tom/32/676_2.png) [@tom](https://forum.heroiclabs.com/u/tom)\
**Post date:** [January 25, 2023, 12:09pm UTC](https://forum.heroiclabs.com/t/real-time-parties-create-rules-using-runtime-code/3190/5 "2023-01-25T12:09:42Z")

</div>

Hi @formatCvt,

The message names have been updated in our documentation ([Nakama: Introduction | Heroic Labs Documentation](https://heroiclabs.com/docs/nakama/server-framework/introduction/#message-names)) and are available in the TypeScript definitions in the latest release of `nakama-common`.

Is there any particular issue you need help with?

---

<div class="post-metadata">

**Author:** ![formatCvt](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/formatcvt/32/1127_2.png) [@formatCvt](https://forum.heroiclabs.com/u/formatCvt)\
**Post date:** [January 26, 2023, 9:15am UTC](https://forum.heroiclabs.com/t/real-time-parties-create-rules-using-runtime-code/3190/6 "2023-01-26T09:15:29Z")

</div>

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](https://heroiclabs.com/docs/nakama/server-framework/typescript-runtime/function-reference/#Groups)

---

<div class="post-metadata">

**Author:** ![tom](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/tom/32/676_2.png) [@tom](https://forum.heroiclabs.com/u/tom)\
**Post date:** [January 26, 2023, 9:34am UTC](https://forum.heroiclabs.com/t/real-time-parties-create-rules-using-runtime-code/3190/7 "2023-01-26T09:34:16Z")

</div>

Parties are interacted with [via the client](https://heroiclabs.com/docs/nakama/client-libraries/unity/index.html#parties).

---

<div class="post-metadata">

**Author:** ![formatCvt](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/formatcvt/32/1127_2.png) [@formatCvt](https://forum.heroiclabs.com/u/formatCvt)\
**Post date:** [January 27, 2023, 7:25am UTC](https://forum.heroiclabs.com/t/real-time-parties-create-rules-using-runtime-code/3190/8 "2023-01-27T07:25:11Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![tom](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/tom/32/676_2.png) [@tom](https://forum.heroiclabs.com/u/tom)\
**Post date:** [January 27, 2023, 9:27am UTC](https://forum.heroiclabs.com/t/real-time-parties-create-rules-using-runtime-code/3190/9 "2023-01-27T09:27:47Z")

</div>

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](https://heroiclabs.com/docs/nakama/concepts/parties/)

---

<div class="post-metadata">

**Author:** ![formatCvt](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/formatcvt/32/1127_2.png) [@formatCvt](https://forum.heroiclabs.com/u/formatCvt)\
**Post date:** [June 13, 2023, 2:28pm UTC](https://forum.heroiclabs.com/t/real-time-parties-create-rules-using-runtime-code/3190/10 "2023-06-13T14:28:28Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![tom](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/tom/32/676_2.png) [@tom](https://forum.heroiclabs.com/u/tom)\
**Post date:** [June 14, 2023, 8:18am UTC](https://forum.heroiclabs.com/t/real-time-parties-create-rules-using-runtime-code/3190/11 "2023-06-14T08:18:44Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![formatCvt](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/formatcvt/32/1127_2.png) [@formatCvt](https://forum.heroiclabs.com/u/formatCvt)\
**Post date:** [June 14, 2023, 12:06pm UTC](https://forum.heroiclabs.com/t/real-time-parties-create-rules-using-runtime-code/3190/12 "2023-06-14T12:06:42Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![tom](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/tom/32/676_2.png) [@tom](https://forum.heroiclabs.com/u/tom)\
**Post date:** [June 14, 2023, 12:29pm UTC](https://forum.heroiclabs.com/t/real-time-parties-create-rules-using-runtime-code/3190/13 "2023-06-14T12:29:24Z")

</div>

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.
