Eris  1.3.23
Lobby.h
1 #ifndef ERIS_LOBBY_H
2 #define ERIS_LOBBY_H
3 
4 #include <Eris/Room.h>
5 
6 namespace Eris
7 {
8 
9 class Account;
10 class Person;
11 class Connection;
12 class OOGRouter;
13 
25 class Lobby : public Room
26 {
27 public:
30  Lobby(Account *acc);
31 
33  virtual ~Lobby();
34 
37  Room* join(const std::string &roomID);
38 
40  Person* getPerson(const std::string &acc);
41 
46  Room* getRoom(const std::string &id);
47 
50  {
51  return m_account;
52  }
53 
55  Connection* getConnection() const;
56 
57 // callbacks
59  sigc::signal<void, Person*> SightPerson;
60 
66  sigc::signal<void, Person*, const std::string&> PrivateTalk;
67 
68 protected:
69  friend class Room;
70  friend class OOGRouter;
71 
72  void look(const std::string &id);
73 
74  void sightPerson(const Atlas::Objects::Entity::Account &ac);
75  Router::RouterResult recvTalk(const Atlas::Objects::Operation::Talk& tk);
76  void recvInitialSight(const Atlas::Objects::Entity::RootEntity& ent);
77 
78  void recvAppearance(const Atlas::Objects::Root& obj);
79  void recvDisappearance(const Atlas::Objects::Root& obj);
80 
81  Router::RouterResult recvImaginary(const Atlas::Objects::Operation::Imaginary& im);
82 
83 private:
84  void onLoggedIn();
85  void onLogout(bool clean);
86 
87  Account* m_account;
88  IdPersonMap m_people;
89 
90  typedef std::map<std::string, Room*> IdRoomMap;
91  IdRoomMap m_rooms;
92 
93  OOGRouter* m_router;
94 };
95 
96 } // of namespace Eris
97 
98 #endif
Eris::Person::getAccount
const std::string & getAccount() const
access the Atlas account ID for this person
Definition: Person.h:28
Eris::Account::getId
const std::string & getId() const
returns the account ID if logged in
Definition: Account.h:318
Eris::Lobby
Lobby is the Out-of-Game session object, valid from connection to the server until disconnection.
Definition: Lobby.h:26
Eris::Room
The out-of-game (OOG) heirarchy is composed of Rooms, containing Persons and other Rooms.
Definition: Room.h:25
Eris::OOGRouter
Definition: Lobby.cpp:32
Eris::Lobby::SightPerson
sigc::signal< void, Person * > SightPerson
Emitted when sight of a person is received.
Definition: Lobby.h:59
Eris::Lobby::getPerson
Person * getPerson(const std::string &acc)
obtain a person's info, given their account ID; may return NULL
Definition: Lobby.cpp:193
Eris::Account::getConnection
Connection * getConnection() const
Access the underlying Connection for this account.
Definition: Account.h:334
Eris::Person
An Out-of-Game Person (found in a Room / Lobby) As more person data becomes available,...
Definition: Person.h:16
Eris::Room::getId
std::string getId() const
Get the Atlas object ID of the Room; note that this may return an empty value if called prior to ente...
Definition: Room.h:68
Eris::TypeService
A service class querying and caching types.
Definition: TypeService.h:25
Eris::Lobby::~Lobby
virtual ~Lobby()
Delete the Lobby, including all it's Rooms and Persons.
Definition: Lobby.cpp:125
Eris::Account
Encapsulates all the state of an Atlas Account, and methods that operation on that state.
Definition: Account.h:45
Eris::Router
abstract interface for objects that can route Atlas data.
Definition: Router.h:11
Eris::error
Definition: LogStream.h:56
Eris::Account::LogoutComplete
sigc::signal< void, bool > LogoutComplete
Emitted when a logout completes.
Definition: Account.h:220
Eris::SightPersonRedispatch
helper to buffer operations when waiting on sight of a person.
Definition: Lobby.cpp:254
Eris::Lobby::getRoom
Room * getRoom(const std::string &id)
Obtain a Room object, given the rooms' id.
Definition: Lobby.cpp:206
Eris::Account::isLoggedIn
bool isLoggedIn() const
Check if the account is logged in.
Definition: Account.cpp:351
Eris::Redispatch
Definition: Redispatch.h:16
Eris::Lobby::PrivateTalk
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.
Definition: Lobby.h:66
Eris::Lobby::getAccount
Account * getAccount() const
Retrive the Account which this lobbby is bound to.
Definition: Lobby.h:49
Eris::Lobby::join
Room * join(const std::string &roomID)
Join the specified room, or return NULL if an error occurs.
Definition: Lobby.cpp:161
Eris::Connection::send
virtual void send(const Atlas::Objects::Root &obj)
Transmit an Atlas::Objects instance to the server.
Definition: Connection.cpp:147
Eris::Connection
Underlying Atlas connection, providing a send interface, and receive (dispatch) system.
Definition: Connection.h:40
Eris::Lobby::getConnection
Connection * getConnection() const
Helper method to access the underlying Connection from the Account.
Definition: Lobby.cpp:188
Eris::Account::LoginSuccess
sigc::signal< void > LoginSuccess
Emitted when login or character creation is successful.
Definition: Account.h:213