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

#include <consul.h>

Public Member Functions

 Consul (std::string host)
absl::Status Register (const WorldRegistration &world) const
absl::Status Pass (const std::string &instance) const
absl::Status Deregister (const std::string &instance) const
absl::StatusOr< std::vector< protocol::WorldListing > > Worlds () const
absl::StatusOr< std::vector< WorldInstance > > Instances () const

Static Public Attributes

static constexpr uint16_t kPort = 8500

Detailed Description

Definition at line 41 of file consul.h.

Constructor & Destructor Documentation

◆ Consul()

nanommo::Consul::Consul ( std::string host)
inlineexplicit

Definition at line 45 of file consul.h.

Member Function Documentation

◆ Deregister()

absl::Status nanommo::Consul::Deregister ( const std::string & instance) const

Definition at line 110 of file consul.cc.

◆ Instances()

absl::StatusOr< std::vector< WorldInstance > > nanommo::Consul::Instances ( ) const

Each world instance that passes its health check, by the host and port players reach it at, with its own address on Consul's network: what the gateway may connect a page to, and where.

Definition at line 168 of file consul.cc.

◆ Pass()

absl::Status nanommo::Consul::Pass ( const std::string & instance) const

Passes the instance's health check, which turns critical ten seconds after the last pass. NotFound when Consul doesn't know the instance.

Definition at line 106 of file consul.cc.

◆ Register()

absl::Status nanommo::Consul::Register ( const WorldRegistration & world) const

Registers the world, or registers it again with its players. Its health check starts as passing, and keeps its status when it's registered again.

Definition at line 80 of file consul.cc.

◆ Worlds()

absl::StatusOr< std::vector< protocol::WorldListing > > nanommo::Consul::Worlds ( ) const

The worlds that pass their health checks, by name, with the host and port players reach them at: each world's newest instance.

Definition at line 114 of file consul.cc.

Member Data Documentation

◆ kPort

uint16_t nanommo::Consul::kPort = 8500
staticconstexpr

Definition at line 43 of file consul.h.


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