eris
1.4.0
A WorldForge client library.
|
#include <Lobby.h>
Public Types | |
enum | RouterResult { IGNORED = 0 , HANDLED } |
Public Member Functions | |
Lobby (Account &acc) | |
~Lobby () override | |
Room * | join (const std::string &roomID) |
Person * | getPerson (const std::string &acc) |
obtain a person's info, given their account ID; may return nullptr More... | |
Room * | getRoom (const std::string &id) |
Account & | getAccount () const |
Retrive the Account which this lobbby is bound to. More... | |
Connection & | getConnection () const |
Helper method to access the underlying Connection from the Account. More... | |
void | say (const std::string &tk) |
Send a piece of text to this room. More... | |
void | emote (const std::string &em) |
void | leave () |
Room * | createRoom (const std::string &name) |
std::string | getName () const |
Obtain the human-readable name of this room. More... | |
std::string | getTopic () const |
std::vector< Person * > | getPeople () const |
obtain an array of pointers to everyone in this room More... | |
std::vector< Room * > | getRooms () const |
Obtain a list of rooms within this room. More... | |
std::string | getId () const |
Person * | getPersonByUID (const std::string &uid) |
virtual RouterResult | handleObject (const Atlas::Objects::Root &obj) |
virtual RouterResult | handleEntity (const Atlas::Objects::Entity::RootEntity &ent) |
Public Attributes | |
sigc::signal< void, Person * > | SightPerson |
Emitted when sight of a person is received. More... | |
sigc::signal< void, Person *, const std::string & > | PrivateTalk |
sigc::signal< void, Room * > | Entered |
sigc::signal< void, Room *, Person *, const std::string & > | Speech |
sigc::signal< void, Room *, Person *, const std::string & > | Emote |
sigc::signal< void, Room *, Person * > | Appearance |
sigc::signal< void, Room *, Person * > | Disappearance |
Similarly, emitted when the specifed person leaves the room. More... | |
Protected Types | |
typedef std::unordered_map< std::string, std::unique_ptr< Person > > | IdPersonMap |
Protected Member Functions | |
void | look (const std::string &id) |
void | sightPerson (const Atlas::Objects::Entity::Account &ac) |
Router::RouterResult | recvTalk (const Atlas::Objects::Operation::Talk &tk) |
void | recvInitialSight (const Atlas::Objects::Entity::RootEntity &ent) |
void | recvAppearance (const Atlas::Objects::Root &obj) |
void | recvDisappearance (const Atlas::Objects::Root &obj) |
Router::RouterResult | recvImaginary (const Atlas::Objects::Operation::Imaginary &im) |
RouterResult | handleOperation (const Atlas::Objects::Operation::RootOperation &op) override |
void | handleSoundTalk (Person *p, const std::string &speech) |
void | handleEmote (Person *p, const std::string &desc) |
Protected Attributes | |
std::string | m_roomId |
Friends | |
class | Room |
class | OOGRouter |
Lobby is the Out-of-Game session object, valid from connection to the server until disconnection. It manages the entire OOG structure, which consists of rooms and people. People can be in more than one room (this is the big difference to in-game). Note the entire OOG system remains live and valid even when an Avatar is active, it's up to the client to present some UI for accessing the OOG system if it wants.
Of course, nothing requries to create a Lobby at all, Account and the in-game structure will work perfectly well without one.
|
explicit |
Create a Lobby for the specified account, and retrieve the initial OOG structure if the Account is logged in and connected.
Definition at line 120 of file Lobby.cpp.
References Eris::Account::isLoggedIn(), Eris::Account::LoginSuccess, and Eris::Account::LogoutComplete.
|
override |
Delete the Lobby, including all it's Rooms and Persons.
Definition at line 135 of file Lobby.cpp.
References Eris::Room::getId().
|
inherited |
create a child room of this one, with the specified name. Note that most attributes, including the ID will not be valid until the new room emits the 'Entered' signal. If you need a unique, referenceable indentifier earlier than that point, use the pointer value.
Definition at line 112 of file Room.cpp.
References getAccount(), getConnection(), Eris::Account::getId(), Eris::getNewSerialno(), Eris::BaseConnection::isConnected(), and Eris::Connection::send().
|
inherited |
Send an emote ( /me ) to the room. This is transmitted as an IMAGINARY op in Atlas, with args[0]["id"] = "emote".
Definition at line 69 of file Room.cpp.
References getAccount(), getConnection(), Eris::Account::getId(), Eris::getNewSerialno(), Eris::BaseConnection::isConnected(), and Eris::Connection::send().
|
inline |
Retrive the Account which this lobbby is bound to.
Definition at line 50 of file Lobby.h.
Referenced by Eris::Room::createRoom(), Eris::Room::emote(), Eris::Room::leave(), Eris::Person::msg(), and Eris::Room::say().
Connection & Eris::Lobby::getConnection | ( | ) | const |
Helper method to access the underlying Connection from the Account.
Definition at line 192 of file Lobby.cpp.
References Eris::Account::getConnection().
Referenced by Eris::Room::createRoom(), Eris::Room::emote(), join(), Eris::Room::leave(), Eris::Person::msg(), Eris::Room::Room(), and Eris::Room::say().
|
inlineinherited |
|
inlineinherited |
|
inherited |
Person * Eris::Lobby::getPerson | ( | const std::string & | acc | ) |
Room * Eris::Lobby::getRoom | ( | const std::string & | id | ) |
|
inlineinherited |
Room * Eris::Lobby::join | ( | const std::string & | roomID | ) |
Join the specified room, or return nullptr if an error occurs. Note the Room will not be valid until it emits the Entered signal.
Definition at line 165 of file Lobby.cpp.
References getConnection(), Eris::Account::getId(), Eris::getNewSerialno(), Eris::Account::isLoggedIn(), and Eris::Connection::send().
|
inherited |
Leave the room - no more signals will be emitted for this room again (validity of Room pointer after this call?)
Definition at line 92 of file Room.cpp.
References getAccount(), getConnection(), Eris::Account::getId(), Eris::getNewSerialno(), Eris::BaseConnection::isConnected(), and Eris::Connection::send().
|
inherited |
Send a piece of text to this room.
Definition at line 48 of file Room.cpp.
References getAccount(), getConnection(), Eris::Account::getId(), Eris::getNewSerialno(), Eris::BaseConnection::isConnected(), and Eris::Connection::send().
|
inherited |
sigc::signal<void, Person*, const std::string&> Eris::Lobby::PrivateTalk |
sigc::signal<void, Person*> Eris::Lobby::SightPerson |