/plushcap/analysis/ably/using-presence-in-in-game-chat-is-the-other-person-still-there

Using Presence in in-game chat: Is the other person still there?

What's this blog post about?

In this post, the author discusses extending an existing chat app to show when another player leaves the game using Presence data from Ably's React hooks. They create a new component called OpponentPresence that displays a system message and provides a link to start a new game if the opponent is not present. The implementation includes debounce logic to prevent flickers, as well as logic to restart the game if the opponent leaves. Finally, the author suggests using Ably's dashboard for debugging purposes.

Company
Ably

Date published
Jan. 22, 2024

Author(s)
Nate Eagle

Word count
976

Language
English

Hacker News points
None found.


By Matt Makai. 2021-2024.