YAPOG
0.0.1
Yet Another Pokemon Online Game
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
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
"
7
# include "
YAPOG/System/Network/IPacketHandler.hpp
"
8
# include "
YAPOG/System/Network/PacketHandler.hpp
"
9
# include "
YAPOG/System/Network/ClientSocket.hpp
"
10
# include "
YAPOG/System/Network/NetworkHandler.hpp
"
11
# include "
YAPOG/System/Event/Event.hpp
"
12
# include "
YAPOG/Game/Factory/ObjectFactory.hpp
"
13
14
# include "
Server/User.hpp
"
15
16
namespace
yap
17
{
18
class
DatabaseManager;
19
}
// namespace yap
20
21
namespace
yse
22
{
23
class
ClientSession
:
public
yap::IPacketHandler
24
{
25
DISALLOW_COPY
(
ClientSession
);
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
40
yap::ClientSocket
&
GetSocket
();
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
&,
58
const
yap::EmptyEventArgs
&>
OnDisconnected
;
59
60
private
:
61
62
bool
IsConnected
()
const
;
63
64
void
Disconnect
();
65
66
void
HandleClientRequestLogin
(
yap::IPacket
& packet);
67
void
HandleClientRequestRegistration
(
yap::IPacket
& packet);
68
void
HandleClientInfoDisconnection
(
yap::IPacket
& packet);
69
70
void
SendObjectFactoryTypes
(
71
yap::IPacket
& packet,
72
const
yap::ObjectFactory
& objectFactory);
73
74
bool
isConnected_
;
75
76
yap::PacketHandler
packetHandler_
;
77
78
yap::ClientSocket
socket_
;
79
yap::NetworkHandler
networkHandler_
;
80
81
User
user_
;
82
yap::DatabaseManager
*
databaseManager_
;
83
};
84
}
// namespace yap
85
86
#endif // YAPOG_SERVER_CLIENTSESSION_HPP
YAPOG.Server
include
Server
ClientSession.hpp
Generated on Mon Sep 17 2012 22:24:22 for YAPOG by
1.8.1.1