Eris  1.4.0
Lobby.h
1 #ifndef ERIS_LOBBY_H
2 #define ERIS_LOBBY_H
3 
4 #include "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::unordered_map<std::string, Room*> IdRoomMap;
91  IdRoomMap m_rooms;
92 
93  OOGRouter* m_router;
94 };
95 
96 } // of namespace Eris
97 
98 #endif
virtual ~Lobby()
Delete the Lobby, including all it&#39;s Rooms and Persons.
Definition: Lobby.cpp:123
Connection * getConnection() const
Helper method to access the underlying Connection from the Account.
Definition: Lobby.cpp:186
Room * getRoom(const std::string &id)
Obtain a Room object, given the rooms&#39; id.
Definition: Lobby.cpp:204
Every Eris class and type lives inside the Eris namespace; certain utility functions live in the Util...
Definition: Account.cpp:34
Underlying Atlas connection, providing a send interface, and receive (dispatch) system.
Definition: Connection.h:36
Room * join(const std::string &roomID)
Join the specified room, or return NULL if an error occurs.
Definition: Lobby.cpp:159
Person * getPerson(const std::string &acc)
obtain a person&#39;s info, given their account ID; may return NULL
Definition: Lobby.cpp:191
Encapsulates all the state of an Atlas Account, and methods that operation on that state...
Definition: Account.h:44
Lobby(Account *acc)
Create a Lobby for the specified account, and retrive the initial OOG structure if the Account is log...
Definition: Lobby.cpp:108
Lobby is the Out-of-Game session object, valid from connection to the server until disconnection...
Definition: Lobby.h:25
The out-of-game (OOG) heirarchy is composed of Rooms, containing Persons and other Rooms...
Definition: Room.h:24
sigc::signal< void, Person *, const std::string & > PrivateTalk
Emitted when some person sends a private (one-to-one) chat message to the client&#39;s account...
Definition: Lobby.h:66
sigc::signal< void, Person * > SightPerson
Emitted when sight of a person is received.
Definition: Lobby.h:59
An Out-of-Game Person (found in a Room / Lobby) As more person data becomes available, this class will be extended, for example to return nicknames, location, the choosen &#39;face&#39; graphic.
Definition: Person.h:15
Account * getAccount() const
Retrive the Account which this lobbby is bound to.
Definition: Lobby.h:49
Definition: Lobby.cpp:31