Eris  1.3.21
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