YAPOG  0.0.1
Yet Another Pokemon Online Game
Session.hpp
Go to the documentation of this file.
1 #ifndef YAPOG_CLIENT_SESSION_HPP
2 # define YAPOG_CLIENT_SESSION_HPP
3 
4 # include "YAPOG/Macros.hpp"
11 # include "YAPOG/System/IntTypes.hpp"
13 
14 # include "Client/User.hpp"
15 
16 namespace ycl
17 {
19  {
21 
22  public:
23 
24  static Session& Instance ();
25 
26  void Refresh ();
27 
28  void Login (const yap::String& login, const yap::String& password);
29  void Register (
30  const yap::String& login,
31  const yap::String& password,
32  const yap::String& email);
33  void Disconnect ();
34 
35  User& GetUser ();
36 
39  virtual bool HandlePacket (yap::IPacket& packet);
40  virtual bool SendPacket (yap::IPacket& packet);
41 
42  virtual void AddRelay (yap::IPacketHandler* relay);
43  virtual void RemoveRelay (yap::IPacketHandler* relay);
44  virtual void SetParent (yap::IPacketHandler* parent);
46 
54 
55  private:
56 
57  Session ();
58  virtual ~Session ();
59 
60  bool Connect ();
61  void HandleReception ();
62 
67 
69  void UpdateObjectFactory (
70  yap::IPacket& packet,
71  yap::ObjectFactory& objectFactory);
72 
75 
77 
79 
82 
86 
88 
90  };
91 }
92 
93 #endif // YAPOG_CLIENT_SESSION_HPP