YAPOG
0.0.1
Yet Another Pokemon Online Game
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
PlayerDataSelectRequest.cpp
Go to the documentation of this file.
1
#include "
YAPOG/System/StringHelper.hpp
"
2
#include "
YAPOG/Collection/Array.hpp
"
3
#include "
Database/Requests/Selects/PlayerDataSelectRequest.hpp
"
4
#include "
YAPOG/Database/DatabaseStream.hpp
"
5
6
namespace
yse
7
{
8
PlayerDataSelectRequest::PlayerDataSelectRequest
(
9
yap::DatabaseManager
& dm,
10
PlayerDataTable
& playerDataTable)
11
{
12
yap::String
queryString =
13
"SELECT "
14
"player_data_position, "
15
"player_data_map_id, "
16
"player_data_time, "
17
"player_data_step_count, "
18
"player_data_respawn_spot, "
19
"player_data_flee_count, "
20
"player_data_box_number, "
21
"player_data_battle_count, "
22
"player_data_money "
23
"FROM player_data "
24
"WHERE account_id = :accountID"
;
25
26
yap::DatabaseStream
select (queryString, dm.
GetConnection
());
27
28
select.
Write
(playerDataTable.
GetAccountID
().
GetValue
());
29
30
if
(select.EndOfStream ())
31
throw
yap::Exception
(
"This account doesn't have any player data !"
);
32
33
playerDataTable.
SetPosition
(select.ReadVector2 ());
34
playerDataTable.
SetMapID
(select.ReadID ());
35
playerDataTable.
SetPlayTime
(select.ReadInt ());
36
playerDataTable.
SetStepCount
(select.ReadInt ());
37
playerDataTable.
SetRespawnSpot
(select.ReadVector2 ());
38
playerDataTable.
SetFleeCount
(select.ReadInt ());
39
playerDataTable.
SetBoxNumber
(select.ReadInt ());
40
playerDataTable.
SetBattleCount
(select.ReadInt ());
41
playerDataTable.
SetMoney
(select.ReadInt ());
42
43
if
(!select.EndOfStream ())
44
throw
yap::Exception
(
"Account information loading error !"
);
45
}
46
}
// namespace yse
YAPOG.Server
src
Database
Requests
Selects
PlayerDataSelectRequest.cpp
Generated on Mon Sep 17 2012 22:24:22 for YAPOG by
1.8.1.1