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

#include <websocket_link.h>

Inheritance diagram for nanommo::WebSocketLink:
nanommo::Link

Public Member Functions

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< WebSocketLink > > Open (const std::string &url, const std::string &token)
 Opens the world's url at the gateway, and says hello with the token.

Detailed Description

A world server, through the gateway, over a browser's WebSocket: the same messages as over TLS on a computer, with the world over the same stream.

Definition at line 72 of file websocket_link.h.

Member Function Documentation

◆ chat()

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

The newest lines said in the world, oldest first.

Implements nanommo::Link.

Definition at line 82 of file websocket_link.h.

◆ connected()

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

Implements nanommo::Link.

Definition at line 80 of file websocket_link.h.

◆ duel()

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

Our duel, the same.

Implements nanommo::Link.

Definition at line 95 of file websocket_link.h.

◆ guild()

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

Our guild, with no name for none.

Implements nanommo::Link.

Definition at line 93 of file websocket_link.h.

◆ inventory()

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

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

Implements nanommo::Link.

Definition at line 89 of file websocket_link.h.

◆ move()

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

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

Implements nanommo::Link.

Definition at line 86 of file websocket_link.h.

◆ Open()

absl::StatusOr< std::unique_ptr< WebSocketLink > > nanommo::WebSocketLink::Open ( const std::string & url,
const std::string & token )
static

Opens the world's url at the gateway, and says hello with the token.

Definition at line 136 of file websocket_link.cc.

◆ Poll()

void nanommo::WebSocketLink::Poll ( )
overridevirtual

Takes in what's arrived, without waiting.

Implements nanommo::Link.

Definition at line 150 of file websocket_link.cc.

◆ quests()

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

Implements nanommo::Link.

Definition at line 92 of file websocket_link.h.

◆ Send()

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

Implements nanommo::Link.

Definition at line 163 of file websocket_link.cc.

◆ TakeEvents()

std::vector< protocol::Event > nanommo::WebSocketLink::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 96 of file websocket_link.h.

◆ TakeInvite()

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

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

Implements nanommo::Link.

Definition at line 99 of file websocket_link.h.

◆ trade()

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

Our trade, with nobody in it for none.

Implements nanommo::Link.

Definition at line 94 of file websocket_link.h.

◆ whole()

int64_t nanommo::WebSocketLink::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 85 of file websocket_link.h.

◆ world()

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

Implements nanommo::Link.

Definition at line 81 of file websocket_link.h.


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