Skip to main content
Multiplayer

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

AspectHow it works
MembershipBelongs to the game's connection. A player is in a group from SubscribeGroupAsync until UnsubscribeGroupAsync or the end of the session. Nothing is stored.
SendingYour game server or cloud function sends an event to the group's name.
ReceivingEvery connection in the group gets the event. The game picks events by type with PlayServEvents.Subscribe<T>, see Server Events.
ReconnectAfter 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

FromCall
A cloud functionPlatform.Publish<T>(group, payload). The plain group name works, and the event type is the C# type's name.
A Unity Dedicated ServerPlayServGameServer.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

WhatLimit
Groups per connection64
Group nameUp to 256 characters, including the project prefix PlayServ adds
Event size1 MiB
Join or leave10 seconds

Errors

ErrorWhen
PlayServGroupSubscriptionException with group_subscription_limit_reachedThe game is already in 64 groups, or the name is too long.
PlayServGroupSubscriptionException with group_outside_projectThe name belongs to another project.
TimeoutExceptionNo answer within 10 seconds.
InvalidOperationExceptionThe 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

Last updated on 22 Oct 2026