coherence 2.3: Finding Your Friends Online
This release is all about players finding each other. We've added a friends list with online presence, lobby invites, and reserved lobby slots, so the social side of your game can now live in coherence Cloud, next to your lobbies and rooms. On the networking side, the Replication Server can now warn your players ahead of a scheduled shutdown, and we've fixed a long list of stability issues, in particular for client-hosted servers on mobile and consoles.
Here are the highlights.
Friends and Online Presence
Your players already have friends on Steam, PSN, Xbox, Nintendo, Epic or Game Center. With the new FriendsService (CloudService.Friends), you can mirror that platform friend list into coherence Cloud, or bring a friend list your own game provides. Once synced, coherence Cloud matches those platform IDs to players of your game, and keeps the list up to date for you.
Each friend comes with online presence: whether they're online, when they were last seen, which lobbies they're in, and a custom presence string your game sets (think "In the main menu" or "Racing on Track 3"). Players who'd rather not be seen can appear offline, and a lobby can be hidden from presence altogether through CreateLobbyOptions.HideFromPresence.
Have a closer look here: Friends documentation
Lobby Invites
Now that you know who's online, you'll want to play with them. Lobbies gain three ways to bring players in:
- Direct invites: LobbySession.InviteAsync sends an invite to a player, which arrives through LobbiesService.OnLobbyInviteReceived and can be accepted with AcceptLobbyInviteAsync.
- Invite tokens: LobbySession.CreateInviteTokenAsync creates a token you can share however you like, for example as a deep link or through a platform's own invite system.
- Join codes: give a lobby a short code that players type in to join, perfect for couch-to-couch "join my game" flows.
Lobby owners decide who's allowed to invite others through CreateLobbyOptions.InvitePermissions.
Take a look at how to implement this feature here: Lobby invites documentation
Reserved Lobby Slots
Inviting a friend to a full lobby isn't much fun. You can now reserve slots in a lobby for specific players, either when creating it or later on through LobbySession.ReserveSlotsAsync. A reserved seat is held for that player until they join or the reservation expires (LobbySession.OnReservationExpired lets you know when that happens). This makes "party" flows, where a group moves from one lobby to the next together, much easier to get right. Lobbies also got a few smaller additions: LobbyData.CreatedAt, LobbyFilter.WithCreatedAt to search for recently created lobbies, and LobbyPlayer.DisplayName and LobbyPlayer.AvatarUrl, so you can show who's in a lobby without an extra lookup.
Here's how you can turn on reserved lobby slots for coherence: Reserved lobby slots documentation
Game Center Login
Apple's Game Center joins the list of supported login methods: players can now log in to coherence Cloud with their Game Center account. We've also added PlayerAccount.LogOutAsync. Unlike the old Logout (now obsolete), it notifies coherence Cloud, so a player who logs out is removed from their lobbies right away, instead of lingering until they time out.
Server Shutdown Warnings
Servers go down for maintenance, updates or scaling. Rather than having players dropped without warning, the Replication Server can now be told ahead of time (through its POST /shutdown-notice endpoint) that it's going to shut down. Clients are notified through CoherenceBridge.onShutdownNotice, which carries the shutdown time, an optional human-readable reason and an optional game-specific payload. Use it to show a countdown, save progress, or move players to another room before the server goes away. CoherenceBridge.ScheduledShutdown gives you the same information at any time, for clients that join after the notice went out.
Also new on CoherenceBridge: IsLiveQuerySynced, so you can check at any point whether every entity in your live query has arrived, instead of only being told once through OnLiveQuerySynced.
You can find the full list of changes in the 2.3 Release Notes.
Written By