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 getConnection(), Eris::Room::getId(), Eris::Account::getId(), Eris::getNewSerialno(), Eris::Account::isLoggedIn(), and Eris::Connection::send().
|
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(), getPerson(), 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.
References getConnection().
Referenced by Eris::Room::createRoom(), Eris::Room::emote(), Eris::Room::getPeople(), 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(), getAccount(), join(), Eris::Room::leave(), Eris::Person::msg(), Eris::Room::Room(), Eris::Room::say(), and ~Lobby().
|
inlineinherited |
|
inlineinherited |
Obtain the human-readable name of this room.
Definition at line 53 of file Room.h.
References Eris::Room::getPeople().
|
inherited |
obtain an array of pointers to everyone in this room
Definition at line 141 of file Room.cpp.
References Eris::Room::Appearance, Eris::Room::Disappearance, Eris::Room::Emote, Eris::Room::Entered, Eris::Person::getAccount(), getAccount(), Eris::Account::getId(), getPerson(), Eris::Room::Room(), SightPerson, and Eris::Room::Speech.
Referenced by Eris::Room::getName().
Person * Eris::Lobby::getPerson | ( | const std::string & | acc | ) |
obtain a person's info, given their account ID; may return nullptr
Definition at line 197 of file Lobby.cpp.
Referenced by Eris::Room::createRoom(), and Eris::Room::getPeople().
Room * Eris::Lobby::getRoom | ( | const std::string & | id | ) |
Obtain a Room object, given the rooms' id. This will return nullptr if the id is invalid.
Definition at line 210 of file Lobby.cpp.
References Eris::Account::getConnection(), and SightPerson.
|
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().
Emitted when a person enters the room; argument is the account ID. Note that Appearance is not generated for the local player when entering/leaving; use the Entered signal instead.
Definition at line 96 of file Room.h.
Referenced by Eris::Room::getPeople().
Similarly, emitted when the specifed person leaves the room.
Definition at line 99 of file Room.h.
Referenced by Eris::Room::getPeople().
Emote (/me) callback. The arguments are identical to those for Talk above
Definition at line 91 of file Room.h.
Referenced by Eris::Room::getPeople().
|
inherited |
Emitted when entry into the room (after a Join) is complete, i.e the user list has been transferred and resolved.
Definition at line 84 of file Room.h.
Referenced by Eris::Room::getPeople().
sigc::signal<void, Person*, const std::string&> Eris::Lobby::PrivateTalk |
sigc::signal<void, Person*> Eris::Lobby::SightPerson |
Emitted when sight of a person is received.
Definition at line 60 of file Lobby.h.
Referenced by Eris::Room::getPeople(), and getRoom().
The primary talk callback. The arguments are the source room, the person talking, and the message itself
Definition at line 88 of file Room.h.
Referenced by Eris::Room::getPeople().