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

A world server, over TLS, with the worlds over UDP or TCP. More...

#include <connection.h>

Inheritance diagram for nanommo::Connection:
nanommo::Link

Public Member Functions

 Connection (const Connection &)=delete
Connection & operator= (const Connection &)=delete
void Poll () override
 Takes in what's arrived, without waiting.
void Send (const protocol::Input &input) override
bool connected () const override
const protocol::World & world () const override
const std::deque< protocol::Chat > & chat () const override
 The newest lines said in the world, oldest first.
int64_t whole () const override
const std::optional< protocol::Move > & move () const override
 Where the world's instance told us to go, once it hands its players over.
const protocol::Inventory & inventory () const override
 What we carry and wear, as the world last sent it.
const protocol::Quests & quests () const override
const protocol::Guild & guild () const override
 Our guild, with no name for none.
const protocol::Trade & trade () const override
 Our trade, with nobody in it for none.
const protocol::Duel & duel () const override
 Our duel, the same.
std::vector< protocol::Event > TakeEvents () override
std::optional< protocol::GuildInvite > TakeInvite () override
 The guild that asked us to join since the last time, once.

Static Public Member Functions

static absl::StatusOr< std::unique_ptr< Connection > > Create (const std::string &host, uint16_t port, asio::ssl::context &tls, const std::string &token, bool udp)
 Connects to the server over TLS, or returns why it couldn't.

Detailed Description

A world server, over TLS, with the worlds over UDP or TCP.

Definition at line 28 of file connection.h.

Constructor & Destructor Documentation

◆ Connection()

nanommo::Connection::Connection ( const Connection & )
delete

Member Function Documentation

◆ chat()

const std::deque< protocol::Chat > & nanommo::Connection::chat ( ) const
inlineoverridevirtual

The newest lines said in the world, oldest first.

Implements nanommo::Link.

Definition at line 42 of file connection.h.

◆ connected()

bool nanommo::Connection::connected ( ) const
inlineoverridevirtual

Implements nanommo::Link.

Definition at line 40 of file connection.h.

◆ Create()

absl::StatusOr< std::unique_ptr< Connection > > nanommo::Connection::Create ( const std::string & host,
uint16_t port,
asio::ssl::context & tls,
const std::string & token,
bool udp )
static

Connects to the server over TLS, or returns why it couldn't.

Definition at line 19 of file connection.cc.

◆ duel()

const protocol::Duel & nanommo::Connection::duel ( ) const
inlineoverridevirtual

Our duel, the same.

Implements nanommo::Link.

Definition at line 55 of file connection.h.

◆ guild()

const protocol::Guild & nanommo::Connection::guild ( ) const
inlineoverridevirtual

Our guild, with no name for none.

Implements nanommo::Link.

Definition at line 53 of file connection.h.

◆ inventory()

const protocol::Inventory & nanommo::Connection::inventory ( ) const
inlineoverridevirtual

What we carry and wear, as the world last sent it.

Implements nanommo::Link.

Definition at line 49 of file connection.h.

◆ move()

const std::optional< protocol::Move > & nanommo::Connection::move ( ) const
inlineoverridevirtual

Where the world's instance told us to go, once it hands its players over.

Implements nanommo::Link.

Definition at line 46 of file connection.h.

◆ operator=()

Connection & nanommo::Connection::operator= ( const Connection & )
delete

◆ Poll()

void nanommo::Connection::Poll ( )
overridevirtual

Takes in what's arrived, without waiting.

Implements nanommo::Link.

Definition at line 81 of file connection.cc.

◆ quests()

const protocol::Quests & nanommo::Connection::quests ( ) const
inlineoverridevirtual

Implements nanommo::Link.

Definition at line 52 of file connection.h.

◆ Send()

void nanommo::Connection::Send ( const protocol::Input & input)
overridevirtual

Implements nanommo::Link.

Definition at line 83 of file connection.cc.

◆ TakeEvents()

std::vector< protocol::Event > nanommo::Connection::TakeEvents ( )
inlineoverridevirtual

What happened near us since the last time, oldest first, which it hands over, as each event comes once.

Implements nanommo::Link.

Definition at line 56 of file connection.h.

◆ TakeInvite()

std::optional< protocol::GuildInvite > nanommo::Connection::TakeInvite ( )
inlineoverridevirtual

The guild that asked us to join since the last time, once.

Implements nanommo::Link.

Definition at line 59 of file connection.h.

◆ trade()

const protocol::Trade & nanommo::Connection::trade ( ) const
inlineoverridevirtual

Our trade, with nobody in it for none.

Implements nanommo::Link.

Definition at line 54 of file connection.h.

◆ whole()

int64_t nanommo::Connection::whole ( ) const
inlineoverridevirtual

The newest world that's come whole, by when it was sent, for the server to leave out what hasn't changed since.

Implements nanommo::Link.

Definition at line 45 of file connection.h.

◆ world()

const protocol::World & nanommo::Connection::world ( ) const
inlineoverridevirtual

Implements nanommo::Link.

Definition at line 41 of file connection.h.


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