77 uint32_t playerId,
const std::vector<std::shared_ptr<Room>> &availableRooms,
78 bool allowSpectator =
true) = 0;
Interface for a matchmaking system.
virtual std::pair< std::shared_ptr< Room >, bool > findOrCreateMatch(uint32_t playerId, const std::vector< std::shared_ptr< Room > > &availableRooms, bool allowSpectator=true)=0
Find an available room or add player to matchmaking queue.
virtual void setMatchCreatedCallback(MatchCreatedCallback callback)=0
Set callback for when a match is created.
virtual void tick()=0
Process matchmaking queue and create matches Called periodically by the server.
virtual size_t getQueueSize() const =0
Get the number of players waiting in queue.
virtual void removePlayer(uint32_t playerId)=0
Remove a player from the matchmaking queue.
virtual ~IMatchmakingService()=default
virtual void addPlayer(uint32_t playerId)=0
Add a player to the matchmaking queue.
std::function< void(std::shared_ptr< Room >)> MatchCreatedCallback
Callback invoked when a match is created.