# Re-match logic

**URL:** <https://forum.heroiclabs.com/t/re-match-logic/4143>\
**Category:** Game Design\
**Tags:** matches\
**Created:** [July 26, 2023, 7:35pm UTC](https://forum.heroiclabs.com/t/re-match-logic/4143 "2023-07-26T19:35:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![totebo](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/totebo/32/528_2.png) [@totebo](https://forum.heroiclabs.com/u/totebo)\
**Post date:** [July 26, 2023, 7:35pm UTC](https://forum.heroiclabs.com/t/re-match-logic/4143/1 "2023-07-26T19:35:48Z")

</div>

What’s the best way to add re-match logic?

My thinking is something like:

1. Match players with matchmaking.
2. Start match.
3. Once the match ends, server allows clients to request a rematch.
4. When a client requests a rematch, the request is sent to all other players to display a “player a wants to play again” message.
5. If all clients request a rematch, the server creates a match and sends the match IDs to all clients.
6. Clients join match, goto 2.

The thing I’m unsure about is how to send data to players outside a match context. Maybe the players can join a stream or group, and the server sends the message to the members?

---

<div class="post-metadata">

**Author:** ![flavio](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/flavio/32/2161_2.png) [@flavio](https://forum.heroiclabs.com/u/flavio)\
**Post date:** [July 27, 2023, 3:48pm UTC](https://forum.heroiclabs.com/t/re-match-logic/4143/2 "2023-07-27T15:48:33Z")

</div>

Hello @totebo,

Do you need to end the match and create a new one? Maybe it would be better to let the match open, give players the rematch option, and only then create another or terminate if no one is interested.

I think you could even do some clean up and reuse the match.

---

<div class="post-metadata">

**Author:** ![totebo](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/totebo/32/528_2.png) [@totebo](https://forum.heroiclabs.com/u/totebo)\
**Post date:** [July 27, 2023, 8:14pm UTC](https://forum.heroiclabs.com/t/re-match-logic/4143/3 "2023-07-27T20:14:45Z")

</div>

I was considering this, but laziness got the better of me. 😅

I allow player that dropped out to rejoin a match if it’s still active, so I’d have to refactor that part to allow for matches to have an active, but finished, state, which makes things a bit muddy. Might be the best option though, thinking about it.

Thanks for the suggestion, it helped me rethink to find a better solution!
