2017-09-30 23:51:01 +02:00
|
|
|
#include "CharaDbConnection.h"
|
|
|
|
#include <libraries/sapphire/mysqlConnector/MySqlConnector.h>
|
|
|
|
|
|
|
|
Core::Db::CharaDbConnection::CharaDbConnection( ConnectionInfo& connInfo ) : DbConnection( connInfo )
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2017-10-07 23:10:13 +02:00
|
|
|
Core::Db::CharaDbConnection::CharaDbConnection( Core::LockedWaitQueue< boost::shared_ptr< Operation > >* q,
|
2017-09-30 23:51:01 +02:00
|
|
|
ConnectionInfo& connInfo) : DbConnection( q, connInfo )
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
Core::Db::CharaDbConnection::~CharaDbConnection()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void Core::Db::CharaDbConnection::doPrepareStatements()
|
|
|
|
{
|
|
|
|
if( !m_reconnecting )
|
|
|
|
m_stmts.resize( MAX_STATEMENTS );
|
|
|
|
|
|
|
|
prepareStatement( CHAR_INS_TEST, "INSERT INTO zoneservers ( id, ip, port ) VALUES ( ?, ?, ?);", CONNECTION_BOTH );
|
|
|
|
|
2017-10-07 23:10:13 +02:00
|
|
|
prepareStatement( CHAR_SEL_LOAD, "SELECT ContentId, Name, Hp, Mp, Tp, Gp, Mode, Mount, InvincibleGM, Voice, "
|
|
|
|
"Customize, ModelMainWeapon, ModelSubWeapon, ModelSystemWeapon, "
|
|
|
|
"ModelEquip, EmoteModeType, FirstLoginTime, Language, IsNewGame, "
|
|
|
|
"IsNewAdventurer, TerritoryType, TerritoryId, PosX, PosY, PosZ, PosR, "
|
|
|
|
"OTerritoryType, OTerritoryId, OPosX, OPosY, OPosZ, OPosR, GuardianDeity, "
|
|
|
|
"BirthDay, BirthMonth, Class, Status, TotalPlayTime, FirstClass, HomePoint, "
|
|
|
|
"FavoritePoint, RestPoint, StartTown, ActiveTitle, TitleList, Achievement, "
|
|
|
|
"Aetheryte, HowTo, Minions, Mounts, EquippedMannequin, ConfigFlags, "
|
|
|
|
"QuestCompleteFlags, OpeningSequence, QuestTracking, GrandCompany, "
|
|
|
|
"GrandCompanyRank, Discovery, GMRank, Unlocks, CFPenaltyUntil "
|
|
|
|
"FROM charainfo WHERE CharacterId = ?;", CONNECTION_SYNCH );
|
|
|
|
|
|
|
|
|
|
|
|
prepareStatement( CHAR_SEL_LOAD_MINIMAL, "SELECT Name, Customize, ModelEquip, TerritoryId, GuardianDeity, "
|
|
|
|
"Class, ContentId, BirthDay, BirthMonth "
|
|
|
|
"FROM charainfo WHERE CharacterId = ?;", CONNECTION_SYNCH );
|
2017-10-04 23:28:38 +02:00
|
|
|
|
2017-10-05 22:43:15 +02:00
|
|
|
prepareStatement( CHAR_SEL_LOAD_CLASSINFO, "SELECT * FROM characlass WHERE CharacterId = ?;", CONNECTION_SYNCH );
|
|
|
|
prepareStatement( CHAR_SEL_LOAD_SEARCHINFO, "SELECT * FROM charainfosearch WHERE CharacterId = ?;", CONNECTION_SYNCH );
|
|
|
|
prepareStatement( CHAR_SEL_LOAD_QUESTINFO, "SELECT * FROM charaquest WHERE CharacterId = ?;", CONNECTION_SYNCH );
|
|
|
|
|
2017-10-07 23:10:13 +02:00
|
|
|
prepareStatement( CHAR_INS_CHARINFO, "INSERT INTO charainfo (AccountId, CharacterId, ContentId, Name, Hp, Mp, "
|
|
|
|
"Customize, Voice, IsNewGame, TerritoryId, PosX, PosY, PosZ, PosR, ModelEquip, "
|
|
|
|
"IsNewAdventurer, GuardianDeity, Birthday, BirthMonth, Class, Status, FirstClass, "
|
|
|
|
"HomePoint, StartTown, Discovery, HowTo, QuestCompleteFlags, Unlocks, QuestTracking, "
|
|
|
|
"Aetheryte, GMRank, UPDATE_DATE ) "
|
|
|
|
"VALUES ( ?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,NOW() );",
|
|
|
|
CONNECTION_SYNCH );
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-10-05 22:43:15 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-09-30 23:51:01 +02:00
|
|
|
}
|