Not translated yet — showing English.
Groups
A group is a named channel: your server sends an event to it, and every player whose game joined the group gets it. Use one to tell everyone in a match that a round started, or everyone in a lobby that the map changed, without knowing who they are. The game joins and leaves groups; only your servers send to them.
using Playserv.Wrapper;
await PlayServEvents.SubscribeGroupAsync("arena-7"); // after PlayServ.Connect()
var sub = PlayServEvents.Subscribe<RoundStarted>(e => hud.ShowRound(e.Round));
// Later
sub.Dispose();
await PlayServEvents.UnsubscribeGroupAsync("arena-7");
How a group works
| Aspect | How it works |
|---|---|
| Membership | Belongs to the game's connection. A player is in a group from SubscribeGroupAsync until UnsubscribeGroupAsync or the end of the session. Nothing is stored. |
| Sending | Your game server or cloud function sends an event to the group's name. |
| Receiving | Every connection in the group gets the event. The game picks events by type with PlayServEvents.Subscribe<T>, see Server Events. |
| Reconnect | After a reconnect, the SDK joins the game's groups again. Events sent in between are not delivered. |
A delivered event doesn't say which group it came through. If the game is in several groups and needs to tell them apart, put that in the event, such as a RoomName field.
Join and leave
SubscribeGroupAsync(name) and UnsubscribeGroupAsync(name) return when the platform has answered. Calls run one at a time, and each waits up to 10 seconds before it throws TimeoutException. The game must be connected, with a signed-in player.
Group names are scoped to your project: the game uses the plain name, such as arena-7, and PlayServ keeps it apart from groups of other projects. A name can't reach another project's group.
A group is not access control
Any game in your project can join any group by name. Don't send anything to a group that only some players may see, and for a match, use a name players can't guess, such as the room name PlayServ gives the room.
Send to a group
| From | Call |
|---|---|
| A cloud function | Platform.Publish<T>(group, payload). The plain group name works, and the event type is the C# type's name. |
| A Unity Dedicated Server | PlayServGameServer.Events.PublishAsync(group, eventType, payload). The group must be given in its project-scoped form; a plain name throws ArgumentException. eventType must match the name of the class the game subscribes to. |
PublishAsync completes once the event has left the server: it doesn't wait for players to receive it, and it isn't sent again after a reconnect.
The game can't send to a group
PlayServEvents.PublishForGroup and the other Publish calls always throw PlayServEventPublishingException. For a chat message or a "ready" signal, send it to your server with a function call or RPC, and let the server send it to the group.
Limits
| What | Limit |
|---|---|
| Groups per connection | 64 |
| Group name | Up to 256 characters, including the project prefix PlayServ adds |
| Event size | 1 MiB |
| Join or leave | 10 seconds |
Errors
| Error | When |
|---|---|
PlayServGroupSubscriptionException with group_subscription_limit_reached | The game is already in 64 groups, or the name is too long. |
PlayServGroupSubscriptionException with group_outside_project | The name belongs to another project. |
TimeoutException | No answer within 10 seconds. |
InvalidOperationException | The game isn't connected yet. |
Trying a refused join again won't help.
What groups are not
Groups have no list of members, no presence, no way to accept or refuse a player, and no close. For a match with seats, a server and players who are let in, use rooms.
Next steps
- Server Events — receive typed events in the game
- Connecting to a Game — rooms players join
- Game Server Hosting — send events from your game server
Last updated on 22 Oct 2026