YAPOG  0.0.1
Yet Another Pokemon Online Game
ClientSession.hpp
Go to the documentation of this file.
1 #ifndef YAPOG_SERVER_CLIENTSESSION_HPP
2 # define YAPOG_SERVER_CLIENTSESSION_HPP
3 
4 # include <SFML/Network/SocketSelector.hpp>
5 
6 # include "YAPOG/Macros.hpp"
13 
14 # include "Server/User.hpp"
15 
16 namespace yap
17 {
18  class DatabaseManager;
19 } // namespace yap
20 
21 namespace yse
22 {
24  {
26 
27  public:
28 
29  ClientSession ();
30  virtual ~ClientSession ();
31 
32  void Init ();
33 
34  void Refresh ();
35 
36  void HandleReception ();
37 
38  User& GetUser ();
39 
41 
42  void SetDatabaseManager (yap::DatabaseManager* databaseManager);
43 
44  void ServerTick (const yap::Time& dt);
45 
48  virtual bool HandlePacket (yap::IPacket& packet);
49  virtual bool SendPacket (yap::IPacket& packet);
50 
51  virtual void AddRelay (yap::IPacketHandler* relay);
52  virtual void RemoveRelay (yap::IPacketHandler* relay);
53  virtual void SetParent (yap::IPacketHandler* parent);
55 
56  yap::Event<
57  const ClientSession&,
59 
60  private:
61 
62  bool IsConnected () const;
63 
64  void Disconnect ();
65 
69 
71  yap::IPacket& packet,
72  const yap::ObjectFactory& objectFactory);
73 
75 
77 
80 
83  };
84 } // namespace yap
85 
86 #endif // YAPOG_SERVER_CLIENTSESSION_HPP