Simple Web Game Server
0.1
A C++ library for creating authenticated scalable backends for multiplayer web games.
|
A matchmaking server built on the base_server class. More...
#include <matchmaking_server.hpp>
Public Member Functions | |
matchmaking_server (const jwt::verifier< jwt_clock, json_traits > &v, function< std::string(const combined_id &, const json &)> f, std::chrono::milliseconds t) | |
The constructor for the matchmaking_server class. More... | |
matchmaking_server (const jwt::verifier< jwt_clock, json_traits > &v, function< std::string(const combined_id &, const json &)> f) | |
Constructs the underlying base_server with a default time-step. | |
void | set_tls_init_handler (function< ssl_context_ptr(connection_hdl)> f) |
Sets the tls_init_handler for the underlying base_server. | |
void | run (uint16_t port, bool unlock_address=false) |
Runs the underlying base_server. | |
void | process_messages () |
Runs the process_messages loop on the underlying base_server. | |
void | reset () |
Stops, clears, and resets the server so it may be run again. | |
void | stop () |
Stops the server and clears all data and connections. | |
std::size_t | get_player_count () |
Returns the number of verified clients connected. | |
bool | is_running () |
void | match_players (std::chrono::milliseconds timestep) |
Loop to match players. More... | |
A matchmaking server built on the base_server class.
This class wraps an underlying base_server and performs matchmaking between connected client sessions.
|
inline |
The constructor for the matchmaking_server class.
The parameters are simply used to construct the underlying base_server.
|
inline |
Loop to match players.
Processes client connections and disconnections and matches connected client sessions together. It may also send out any messages broadcast by the matchmaking function. Should only be called by one thread.