eris 1.4.0
A WorldForge client library.
Lobby.h
1#ifndef ERIS_LOBBY_H
2#define ERIS_LOBBY_H
3
4#include <memory>
5#include "Room.h"
6
7namespace Eris
8{
9
10class Account;
11class Person;
12class Connection;
13class OOGRouter;
14
26class Lobby : public Room
27{
28public:
31 explicit Lobby(Account &acc);
32
34 ~Lobby() override;
35
38 Room* join(const std::string &roomID);
39
41 Person* getPerson(const std::string &acc);
42
47 Room* getRoom(const std::string &id);
48
51 {
52 return m_account;
53 }
54
57
58// callbacks
60 sigc::signal<void, Person*> SightPerson;
61
67 sigc::signal<void, Person*, const std::string&> PrivateTalk;
68
69protected:
70 friend class Room;
71 friend class OOGRouter;
72
73 void look(const std::string &id);
74
75 void sightPerson(const Atlas::Objects::Entity::Account &ac);
76 Router::RouterResult recvTalk(const Atlas::Objects::Operation::Talk& tk);
77 void recvInitialSight(const Atlas::Objects::Entity::RootEntity& ent);
78
79 void recvAppearance(const Atlas::Objects::Root& obj);
80 void recvDisappearance(const Atlas::Objects::Root& obj);
81
82 Router::RouterResult recvImaginary(const Atlas::Objects::Operation::Imaginary& im);
83
84private:
85 void onLoggedIn();
86 void onLogout(bool clean);
87
88 Account& m_account;
89 IdPersonMap m_people;
90
91 std::unordered_map<std::string, std::unique_ptr<Room>> m_rooms;
92
93 std::unique_ptr<OOGRouter> m_router;
94};
95
96} // of namespace Eris
97
98#endif
Encapsulates all the state of an Atlas Account, and methods that operation on that state.
Definition: Account.h:42
Room * join(const std::string &roomID)
Definition: Lobby.cpp:165
Room * getRoom(const std::string &id)
Definition: Lobby.cpp:210
Person * getPerson(const std::string &acc)
obtain a person's info, given their account ID; may return nullptr
Definition: Lobby.cpp:197
Connection & getConnection() const
Helper method to access the underlying Connection from the Account.
Definition: Lobby.cpp:192
sigc::signal< void, Person *, const std::string & > PrivateTalk
Definition: Lobby.h:67
Account & getAccount() const
Retrive the Account which this lobbby is bound to.
Definition: Lobby.h:50
sigc::signal< void, Person * > SightPerson
Emitted when sight of a person is received.
Definition: Lobby.h:60
~Lobby() override
Definition: Lobby.cpp:135
Definition: Account.cpp:33