nanoMMO 0.97.8
Building an MMO: The Engineering Series
Loading...
Searching...
No Matches
nanommo::Server Class Reference

#include <server.h>

Public Member Functions

int players () const
 In all its lands.
int HandOver (const std::string &host, uint16_t port)
uint16_t port () const

Static Public Member Functions

static absl::StatusOr< std::unique_ptr< Server > > Create (asio::io_context &io, uint16_t port, asio::ssl::context &tls, std::chrono::nanoseconds interval, std::string name, uint32_t seed, const Content &content, Metrics &metrics, Tokens &tokens, Players &players, Guilds &guilds, Events &events, Storyteller &storyteller)

Detailed Description

Definition at line 44 of file server.h.

Member Function Documentation

◆ Create()

absl::StatusOr< std::unique_ptr< Server > > nanommo::Server::Create ( asio::io_context & io,
uint16_t port,
asio::ssl::context & tls,
std::chrono::nanoseconds interval,
std::string name,
uint32_t seed,
const Content & content,
Metrics & metrics,
Tokens & tokens,
Players & players,
Guilds & guilds,
Events & events,
Storyteller & storyteller )
static

Starts the server, or returns why it couldn't, such as the port being taken. Clients connect over TLS, with the context. The name keeps the world's players apart from other worlds', and the seed makes the terrain.

Definition at line 124 of file server.cc.

◆ HandOver()

int nanommo::Server::HandOver ( const std::string & host,
uint16_t port )

Hands the players over to the world's next instance, at the host and port players reach it at: saves them, stops ticking and taking players, hands their leases to it, and tells each client where to go. Returns how many it told.

Definition at line 1067 of file server.cc.

◆ players()

int nanommo::Server::players ( ) const

In all its lands.

Definition at line 159 of file server.cc.

◆ port()

uint16_t nanommo::Server::port ( ) const

The port it listens on, over TCP and UDP. Given port zero, Create has the system pick a free one.

Definition at line 161 of file server.cc.


The documentation for this class was generated from the following files: