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

#include <inbox.h>

Public Member Functions

absl::Status Take (std::string_view message)
 Files one of the server's messages, or returns why it isn't one.
void Add (const protocol::World &part)
 A part of the world that came on its own, as a datagram brings it.
const protocol::World & world () const
const std::deque< protocol::Chat > & chat () const
 The newest lines said in the world, oldest first.
int64_t whole () const
const std::optional< protocol::Move > & move () const
const protocol::Inventory & inventory () const
const protocol::Quests & quests () const
const protocol::Guild & guild () const
const protocol::Trade & trade () const
const protocol::Duel & duel () const
std::vector< protocol::Event > TakeEvents ()
 The events since the last time, oldest first, handed over once.
std::optional< protocol::GuildInvite > TakeInvite ()
 The guild that asked us to join since the last time, once.

Detailed Description

What a world server has sent us, filed by kind, for the game to read each frame: the world, put together from its parts, and the chat, our bag, our quests, our guild, our trade, our duel, the moves and the events, which each come on their own. Whatever carries the messages, a socket on a computer or a WebSocket in a browser, hands them to one of these.

Definition at line 21 of file inbox.h.

Member Function Documentation

◆ Add()

void nanommo::Inbox::Add ( const protocol::World & part)

A part of the world that came on its own, as a datagram brings it.

Definition at line 51 of file inbox.cc.

◆ chat()

const std::deque< protocol::Chat > & nanommo::Inbox::chat ( ) const
inline

The newest lines said in the world, oldest first.

Definition at line 31 of file inbox.h.

◆ duel()

const protocol::Duel & nanommo::Inbox::duel ( ) const
inline

Definition at line 38 of file inbox.h.

◆ guild()

const protocol::Guild & nanommo::Inbox::guild ( ) const
inline

Definition at line 36 of file inbox.h.

◆ inventory()

const protocol::Inventory & nanommo::Inbox::inventory ( ) const
inline

Definition at line 34 of file inbox.h.

◆ move()

const std::optional< protocol::Move > & nanommo::Inbox::move ( ) const
inline

Definition at line 33 of file inbox.h.

◆ quests()

const protocol::Quests & nanommo::Inbox::quests ( ) const
inline

Definition at line 35 of file inbox.h.

◆ Take()

absl::Status nanommo::Inbox::Take ( std::string_view message)

Files one of the server's messages, or returns why it isn't one.

Definition at line 17 of file inbox.cc.

◆ TakeEvents()

std::vector< protocol::Event > nanommo::Inbox::TakeEvents ( )

The events since the last time, oldest first, handed over once.

Definition at line 56 of file inbox.cc.

◆ TakeInvite()

std::optional< protocol::GuildInvite > nanommo::Inbox::TakeInvite ( )

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

Definition at line 60 of file inbox.cc.

◆ trade()

const protocol::Trade & nanommo::Inbox::trade ( ) const
inline

Definition at line 37 of file inbox.h.

◆ whole()

int64_t nanommo::Inbox::whole ( ) const
inline

Definition at line 32 of file inbox.h.

◆ world()

const protocol::World & nanommo::Inbox::world ( ) const
inline

Definition at line 29 of file inbox.h.


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