Eris
1.4.0
|
Lobby is the Out-of-Game session object, valid from connection to the server until disconnection. More...
#include <Lobby.h>
Public Member Functions | |
Lobby (Account *acc) | |
Create a Lobby for the specified account, and retrive the initial OOG structure if the Account is logged in and connected. More... | |
virtual | ~Lobby () |
Delete the Lobby, including all it's Rooms and Persons. More... | |
Room * | join (const std::string &roomID) |
Join the specified room, or return NULL if an error occurs. More... | |
Person * | getPerson (const std::string &acc) |
obtain a person's info, given their account ID; may return NULL | |
Room * | getRoom (const std::string &id) |
Obtain a Room object, given the rooms' id. More... | |
Account * | getAccount () const |
Retrive the Account which this lobbby is bound to. | |
Connection * | getConnection () const |
Helper method to access the underlying Connection from the Account. | |
![]() | |
void | say (const std::string &tk) |
Send a piece of text to this room. | |
void | emote (const std::string &em) |
Send an emote ( /me ) to the room. More... | |
void | leave () |
Leave the room - no more signals will be emitted for this room again (validity of Room pointer after this call?) | |
Room * | createRoom (const std::string &name) |
create a child room of this one, with the specified name. More... | |
std::string | getName () const |
Obtain the human-readable name of this room. | |
std::string | getTopic () const |
std::vector< Person * > | getPeople () const |
obtain an array of pointers to everyone in this room | |
std::vector< Room * > | getRooms () const |
Obtain a list of rooms within this room. | |
std::string | getId () const |
Get the Atlas object ID of the Room; note that this may return an empty value if called prior to entering the Lobby. | |
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. | |
sigc::signal< void, Person *, const std::string & > | PrivateTalk |
Emitted when some person sends a private (one-to-one) chat message to the client's account. More... | |
![]() | |
sigc::signal< void, Room * > | Entered |
Emitted when entry into the room (after a Join) is complete, i.e the user list has been transferred and resolved. More... | |
sigc::signal< void, Room *, Person *, const std::string & > | Speech |
The primary talk callback. More... | |
sigc::signal< void, Room *, Person *, const std::string & > | Emote |
Emote (/me) callback. More... | |
sigc::signal< void, Room *, Person * > | Appearance |
Emitted when a person enters the room; argument is the account ID. More... | |
sigc::signal< void, Room *, Person * > | Disappearance |
Similarly, emitted when the specifed person leaves the room. | |
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) |
![]() | |
Room (Lobby *l, const std::string &id) | |
standard constructor. More... | |
virtual RouterResult | handleOperation (const Atlas::Objects::Operation::RootOperation &op) |
void | handleSoundTalk (Person *p, const std::string &speech) |
void | handleEmote (Person *p, const std::string &desc) |
Friends | |
class | Room |
class | OOGRouter |
Additional Inherited Members | |
![]() | |
enum | RouterResult { IGNORED = 0, HANDLED, WILL_REDISPATCH } |
![]() | |
typedef std::unordered_map< std::string, Person * > | IdPersonMap |
![]() | |
std::string | m_roomId |
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.
Eris::Lobby::Lobby | ( | Account * | acc | ) |
Create a Lobby for the specified account, and retrive the initial OOG structure if the Account is logged in and connected.
References Eris::Account::isLoggedIn(), Eris::Account::LoginSuccess, and Eris::Account::LogoutComplete.
|
virtual |
Delete the Lobby, including all it's Rooms and Persons.
References getConnection(), Eris::Account::getId(), Eris::getNewSerialno(), Eris::Account::isLoggedIn(), and Eris::Connection::send().
Room * Eris::Lobby::getRoom | ( | const std::string & | id | ) |
Obtain a Room object, given the rooms' id.
This will return NULL if the id is invalid.
References Eris::Account::getConnection(), and SightPerson.
Room * Eris::Lobby::join | ( | const std::string & | roomID | ) |
Join the specified room, or return NULL if an error occurs.
Note the Room will not be valid until it emits the Entered signal.
References getConnection(), Eris::Account::getId(), Eris::getNewSerialno(), Eris::Account::isLoggedIn(), and Eris::Connection::send().
sigc::signal<void, Person*, const std::string&> Eris::Lobby::PrivateTalk |
Emitted when some person sends a private (one-to-one) chat message to the client's account.
The first argument is the sender, which will always be a valid Person object, and the second is the message text.