mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-27 14:57:44 +00:00
Added basic player updates
This commit is contained in:
parent
4660ff47a2
commit
22e416dabc
9 changed files with 303 additions and 147 deletions
|
@ -19,36 +19,91 @@ 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 );
|
||||
|
||||
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( CHARA_SEL, "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_SYNC );
|
||||
|
||||
|
||||
prepareStatement( CHAR_SEL_LOAD_MINIMAL, "SELECT Name, Customize, ModelEquip, TerritoryId, GuardianDeity, "
|
||||
"Class, ContentId, BirthDay, BirthMonth "
|
||||
"FROM charainfo WHERE CharacterId = ?;", CONNECTION_SYNCH );
|
||||
prepareStatement( CHARA_UP,
|
||||
"UPDATE charainfo SET "
|
||||
"Hp = ?, Mp = ?, Tp = ?, Gp = ?, Mode = ?, Mount = ?, InvincibleGM = ?, Voice = ?, "
|
||||
"Customize = ?, ModelMainWeapon = ?, ModelSubWeapon = ?, ModelSystemWeapon = ?, "
|
||||
"ModelEquip = ?, EmoteModeType = ?, Language = ?, IsNewGame = ?, IsNewAdventurer = ?, "
|
||||
"TerritoryType = ?, TerritoryId = ?, PosX = ?, PosY = ?, PosZ = ?, PosR = ?, "
|
||||
"OTerritoryType = ?, OTerritoryId = ?, OPosX = ?, OPosY = ?, OPosZ = ?, OPosR = ?, "
|
||||
"Class = ?, Status = ?, TotalPlayTime = ?, HomePoint = ?, FavoritePoint = ?, RestPoint = ?, "
|
||||
"ActiveTitle = ?, TitleList = ?, Achievement = ?, Aetheryte = ?, HowTo = ?, Minions = ?, Mounts = ?, "
|
||||
"EquippedMannequin = ?, ConfigFlags = ?, QuestCompleteFlags = ?, OpeningSequence = ?, "
|
||||
"QuestTracking = ?, GrandCompany = ?, GrandCompanyRank = ?, Discovery = ?, GMRank = ?, Unlocks = ?, "
|
||||
"CFPenaltyUntil = ? WHERE CharacterId = ?;", CONNECTION_ASYNC );
|
||||
|
||||
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 );
|
||||
|
||||
prepareStatement( CHAR_INS_CHARINFO, "INSERT INTO charainfo (AccountId, CharacterId, ContentId, Name, Hp, Mp, "
|
||||
prepareStatement( CHARA_SEL_MINIMAL, "SELECT Name, Customize, ModelEquip, TerritoryId, GuardianDeity, "
|
||||
"Class, ContentId, BirthDay, BirthMonth "
|
||||
"FROM charainfo WHERE CharacterId = ?;", CONNECTION_SYNC );
|
||||
|
||||
prepareStatement( CHARA_CLASSINFO_SEL_LOAD, "SELECT * FROM characlass WHERE CharacterId = ?;", CONNECTION_SYNC );
|
||||
prepareStatement( CHARA_SEACHINFO_SEL_LOAD, "SELECT * FROM charainfosearch WHERE CharacterId = ?;", CONNECTION_SYNC );
|
||||
prepareStatement( CHARA_QUESTINFO_SEL_LOAD, "SELECT * FROM charaquest WHERE CharacterId = ?;", CONNECTION_SYNC );
|
||||
|
||||
prepareStatement( CHARA_INS, "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 );
|
||||
CONNECTION_SYNC );
|
||||
|
||||
prepareStatement( CHARA_UP_NAME, "UPDATE charainfo SET Name = ? WHERE CharacterId = ?;", CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_UP_HPMP, "UPDATE charainfo SET Hp = ?, Mp = ?, Tp = ?, Gp = ? WHERE CharacterId = ?;", CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_UP_MODE, "UPDATE charainfo SET Mode = ? WHERE CharacterId = ?;", CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_UP_MOUNT, "UPDATE charainfo SET Mount = ? WHERE CharacterId = ?;", CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_UP_INVINCIBLE, "UPDATE charainfo SET InvincibleGM = ? WHERE CharacterId = ?;", CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_UP_CUSTOMIZE, "UPDATE charainfo SET Customize = ? WHERE CharacterId = ?;", CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_UP_MODELMAINWEAP, "UPDATE charainfo SET ModelMainWeapon = ? WHERE CharacterId = ?;", CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_UP_MODELSUBWEAP, "UPDATE charainfo SET ModelSubWeapon = ? WHERE CharacterId = ?;", CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_UP_MODELSYSWEAP, "UPDATE charainfo SET ModelSystemWeapon = ? WHERE CharacterId = ?;", CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_UP_MODELEQUIP, "UPDATE charainfo SET ModelEquip = ? WHERE CharacterId = ?;", CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_UP_EMOTEMODETYPE, "UPDATE charainfo SET EmoteModeType = ? WHERE CharacterId = ?;", CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_UP_FIRSTLOGINTIME, "UPDATE charainfo SET FirstLoginTime = ? WHERE CharacterId = ?;", CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_UP_LANGUAGE, "UPDATE charainfo SET Language = ? WHERE CharacterId = ?;", CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_UP_ISNEWGAME, "UPDATE charainfo SET IsNewGame = ? WHERE CharacterId = ?;", CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_UP_ISNEWADV, "UPDATE charainfo SET IsNewAdventurer = ? WHERE CharacterId = ?;", CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_UP_TERRITORY, "UPDATE charainfo SET TerritoryType = ?, TerritoryId = ? WHERE CharacterId = ?;", CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_UP_POS, "UPDATE charainfo SET OPosX = ?, OPosY = ?, OPosZ = ?, OPosR = ? WHERE CharacterId = ?;", CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_UP_CLASS, "UPDATE charainfo SET Class = ? WHERE CharacterId = ?;", CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_UP_STATUS, "UPDATE charainfo SET Status = ? WHERE CharacterId = ?;", CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_UP_TOTALPLAYTIME, "UPDATE charainfo SET TotalPlayTime = ? WHERE CharacterId = ?;", CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_UP_HOMEPOINT, "UPDATE charainfo SET Homepoint = ? WHERE CharacterId = ?;", CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_UP_FAVOPOINT, "UPDATE charainfo SET FavoritePoint = ? WHERE CharacterId = ?;", CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_UP_TITLE, "UPDATE charainfo SET ActiveTitle = ? WHERE CharacterId = ?;", CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_UP_TITLELIST, "UPDATE charainfo SET TitleList = ? WHERE CharacterId = ?;", CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_UP_ACHIEVEMENTS, "UPDATE charainfo SET Achievement = ? WHERE CharacterId = ?;", CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_UP_AETHERYTE, "UPDATE charainfo SET Aetheryte = ? WHERE CharacterId = ?;", CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_UP_HOWTO, "UPDATE charainfo SET HowTo = ? WHERE CharacterId = ?;", CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_UP_MINIONS, "UPDATE charainfo SET Minions = ? WHERE CharacterId = ?;", CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_UP_MOUNTS, "UPDATE charainfo SET Mounts = ? WHERE CharacterId = ?;", CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_UP_GEARSET, "UPDATE charainfo SET EquippedMannequin = ? WHERE CharacterId = ?;", CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_UP_CONFIGFLAGS, "UPDATE charainfo SET ConfigFlags = ? WHERE CharacterId = ?;", CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_UP_QUESTCOMPLETE, "UPDATE charainfo SET QuestCompleteFlags = ? WHERE CharacterId = ?;", CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_UP_OPENINGSEQ, "UPDATE charainfo SET OpeningSequence = ? WHERE CharacterId = ?;", CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_UP_QUESTTRACKING, "UPDATE charainfo SET QuestTracking = ? WHERE CharacterId = ?;", CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_UP_GRANDCOMPANY, "UPDATE charainfo SET GrandCompany = ? WHERE CharacterId = ?;", CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_UP_GRANDCOMPANYRANKS, "UPDATE charainfo SET GrandCompanyRank = ? WHERE CharacterId = ?;", CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_UP_DISCOVERY, "UPDATE charainfo SET Discovery = ? WHERE CharacterId = ?;", CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_UP_GMRANK, "UPDATE charainfo SET GMRank = ? WHERE CharacterId = ?;", CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_UP_UNLOCKS, "UPDATE charainfo SET Unlocks = ? WHERE CharacterId = ?;", CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_UP_CFPENATLY, "UPDATE charainfo SET CFPenaltyUntil = ? WHERE CharacterId = ?;", CONNECTION_ASYNC );
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -11,13 +11,53 @@ class DbConnectionInfo;
|
|||
|
||||
enum CharaDbStatements : uint32_t
|
||||
{
|
||||
CHAR_SEL_LOAD,
|
||||
CHAR_SEL_LOAD_MINIMAL,
|
||||
CHAR_SEL_LOAD_CLASSINFO,
|
||||
CHAR_SEL_LOAD_SEARCHINFO,
|
||||
CHAR_SEL_LOAD_QUESTINFO,
|
||||
CHAR_INS_CHARINFO,
|
||||
CHAR_INS_TEST,
|
||||
CHARA_SEL,
|
||||
CHARA_SEL_MINIMAL,
|
||||
CHARA_CLASSINFO_SEL_LOAD,
|
||||
CHARA_SEACHINFO_SEL_LOAD,
|
||||
CHARA_QUESTINFO_SEL_LOAD,
|
||||
CHARA_INS,
|
||||
CHARA_UP,
|
||||
CHARA_UP_NAME,
|
||||
CHARA_UP_HPMP,
|
||||
CHARA_UP_MODE,
|
||||
CHARA_UP_MOUNT,
|
||||
CHARA_UP_INVINCIBLE,
|
||||
CHARA_UP_CUSTOMIZE,
|
||||
CHARA_UP_MODELMAINWEAP,
|
||||
CHARA_UP_MODELSUBWEAP,
|
||||
CHARA_UP_MODELSYSWEAP,
|
||||
CHARA_UP_MODELEQUIP,
|
||||
CHARA_UP_EMOTEMODETYPE,
|
||||
CHARA_UP_FIRSTLOGINTIME,
|
||||
CHARA_UP_LANGUAGE,
|
||||
CHARA_UP_ISNEWGAME,
|
||||
CHARA_UP_ISNEWADV,
|
||||
CHARA_UP_TERRITORY,
|
||||
CHARA_UP_POS,
|
||||
CHARA_UP_CLASS,
|
||||
CHARA_UP_STATUS,
|
||||
CHARA_UP_TOTALPLAYTIME,
|
||||
CHARA_UP_HOMEPOINT,
|
||||
CHARA_UP_FAVOPOINT,
|
||||
CHARA_UP_TITLE,
|
||||
CHARA_UP_TITLELIST,
|
||||
CHARA_UP_ACHIEVEMENTS,
|
||||
CHARA_UP_AETHERYTE,
|
||||
CHARA_UP_HOWTO,
|
||||
CHARA_UP_MINIONS,
|
||||
CHARA_UP_MOUNTS,
|
||||
CHARA_UP_GEARSET,
|
||||
CHARA_UP_CONFIGFLAGS,
|
||||
CHARA_UP_QUESTCOMPLETE,
|
||||
CHARA_UP_OPENINGSEQ,
|
||||
CHARA_UP_QUESTTRACKING,
|
||||
CHARA_UP_GRANDCOMPANY,
|
||||
CHARA_UP_GRANDCOMPANYRANKS,
|
||||
CHARA_UP_DISCOVERY,
|
||||
CHARA_UP_GMRANK,
|
||||
CHARA_UP_UNLOCKS,
|
||||
CHARA_UP_CFPENATLY,
|
||||
|
||||
MAX_STATEMENTS
|
||||
};
|
||||
|
|
|
@ -15,7 +15,7 @@ Core::Db::DbConnection::DbConnection( ConnectionInfo &connInfo ) :
|
|||
m_queue( nullptr ),
|
||||
m_pConnection( nullptr ),
|
||||
m_connectionInfo( connInfo ),
|
||||
m_connectionFlags( CONNECTION_SYNCH )
|
||||
m_connectionFlags( CONNECTION_SYNC )
|
||||
{
|
||||
|
||||
}
|
||||
|
|
|
@ -33,8 +33,8 @@ namespace Db
|
|||
enum ConnectionFlags
|
||||
{
|
||||
CONNECTION_ASYNC = 0x1,
|
||||
CONNECTION_SYNCH = 0x2,
|
||||
CONNECTION_BOTH = CONNECTION_ASYNC | CONNECTION_SYNCH
|
||||
CONNECTION_SYNC = 0x2,
|
||||
CONNECTION_BOTH = CONNECTION_ASYNC | CONNECTION_SYNC
|
||||
};
|
||||
|
||||
struct ConnectionInfo
|
||||
|
|
|
@ -38,7 +38,7 @@ namespace Core {
|
|||
void PlayerMinimal::load( uint32_t charId )
|
||||
{
|
||||
|
||||
auto stmt = g_charaDb.getPreparedStatement( Db::CharaDbStatements::CHAR_SEL_LOAD_MINIMAL );
|
||||
auto stmt = g_charaDb.getPreparedStatement( Db::CharaDbStatements::CHARA_SEL_MINIMAL );
|
||||
|
||||
stmt->setUInt( 1, charId );
|
||||
auto res = g_charaDb.query( stmt );
|
||||
|
@ -223,7 +223,7 @@ namespace Core {
|
|||
// "HomePoint, StartTown, Discovery, HowTo, QuestCompleteFlags, Unlocks, QuestTracking, "
|
||||
// "Aetheryte, GMRank, UPDATE_DATE )
|
||||
|
||||
auto stmt = g_charaDb.getPreparedStatement( Db::CharaDbStatements::CHAR_INS_CHARINFO );
|
||||
auto stmt = g_charaDb.getPreparedStatement( Db::CharaDbStatements::CHARA_INS );
|
||||
|
||||
stmt->setInt( 1, m_accountId );
|
||||
stmt->setInt( 2, m_id );
|
||||
|
@ -259,71 +259,69 @@ namespace Core {
|
|||
|
||||
g_charaDb.directExecute( stmt );
|
||||
|
||||
g_database.execute( "INSERT INTO characlass (CharacterId, Lv_" + std::to_string( g_exdData.m_classJobInfoMap[m_class].exp_idx ) + ", UPDATE_DATE ) "
|
||||
g_charaDb.execute( "INSERT INTO characlass (CharacterId, Lv_" + std::to_string( g_exdData.m_classJobInfoMap[m_class].exp_idx ) + ", UPDATE_DATE ) "
|
||||
" VALUES (" + std::to_string( m_id ) + ", 1, NOW());" );
|
||||
|
||||
g_database.execute( "INSERT INTO charaquest (CharacterId, UPDATE_DATE ) "
|
||||
" VALUES (" + std::to_string( m_id ) + ", NOW());" );
|
||||
g_charaDb.execute( "INSERT INTO charaquest (CharacterId, UPDATE_DATE ) VALUES (" + std::to_string( m_id ) + ", NOW());" );
|
||||
|
||||
g_database.execute( "INSERT INTO charainfosearch (CharacterId, UPDATE_DATE ) "
|
||||
" VALUES (" + std::to_string( m_id ) + ", NOW());" );
|
||||
g_charaDb.execute( "INSERT INTO charainfosearch (CharacterId, UPDATE_DATE ) VALUES (" + std::to_string( m_id ) + ", NOW());" );
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// SET UP INVENTORIES
|
||||
|
||||
g_database.execute( "INSERT INTO charaiteminventory (storageId, CharacterId, UPDATE_DATE ) "
|
||||
"VALUES ( " + std::to_string( InventoryType::Bag0 ) + ", " + std::to_string( m_id ) + ", NOW());" );
|
||||
g_charaDb.execute( "INSERT INTO charaiteminventory (storageId, CharacterId, UPDATE_DATE ) "
|
||||
"VALUES ( " + std::to_string( InventoryType::Bag0 ) + ", " + std::to_string( m_id ) + ", NOW());" );
|
||||
|
||||
g_database.execute( "INSERT INTO charaiteminventory (storageId, CharacterId, UPDATE_DATE ) "
|
||||
"VALUES ( " + std::to_string( InventoryType::Bag1 ) + ", " + std::to_string( m_id ) + ", NOW());" );
|
||||
g_charaDb.execute( "INSERT INTO charaiteminventory (storageId, CharacterId, UPDATE_DATE ) "
|
||||
"VALUES ( " + std::to_string( InventoryType::Bag1 ) + ", " + std::to_string( m_id ) + ", NOW());" );
|
||||
|
||||
g_database.execute( "INSERT INTO charaiteminventory (storageId, CharacterId, UPDATE_DATE ) "
|
||||
"VALUES ( " + std::to_string( InventoryType::Bag2 ) + ", " + std::to_string( m_id ) + ", NOW());" );
|
||||
g_charaDb.execute( "INSERT INTO charaiteminventory (storageId, CharacterId, UPDATE_DATE ) "
|
||||
"VALUES ( " + std::to_string( InventoryType::Bag2 ) + ", " + std::to_string( m_id ) + ", NOW());" );
|
||||
|
||||
g_database.execute( "INSERT INTO charaiteminventory (storageId, CharacterId, UPDATE_DATE ) "
|
||||
"VALUES ( " + std::to_string( InventoryType::Bag3 ) + ", " + std::to_string( m_id ) + ", NOW());" );
|
||||
g_charaDb.execute( "INSERT INTO charaiteminventory (storageId, CharacterId, UPDATE_DATE ) "
|
||||
"VALUES ( " + std::to_string( InventoryType::Bag3 ) + ", " + std::to_string( m_id ) + ", NOW());" );
|
||||
|
||||
g_database.execute( "INSERT INTO charaiteminventory (storageId, CharacterId, UPDATE_DATE ) "
|
||||
"VALUES ( " + std::to_string( InventoryType::ArmoryOff ) + ", " + std::to_string( m_id ) + ", NOW());" );
|
||||
g_charaDb.execute( "INSERT INTO charaiteminventory (storageId, CharacterId, UPDATE_DATE ) "
|
||||
"VALUES ( " + std::to_string( InventoryType::ArmoryOff ) + ", " + std::to_string( m_id ) + ", NOW());" );
|
||||
|
||||
g_database.execute( "INSERT INTO charaiteminventory (storageId, CharacterId, UPDATE_DATE ) "
|
||||
"VALUES ( " + std::to_string( InventoryType::ArmoryHead ) + ", " + std::to_string( m_id ) + ", NOW());" );
|
||||
g_charaDb.execute( "INSERT INTO charaiteminventory (storageId, CharacterId, UPDATE_DATE ) "
|
||||
"VALUES ( " + std::to_string( InventoryType::ArmoryHead ) + ", " + std::to_string( m_id ) + ", NOW());" );
|
||||
|
||||
g_database.execute( "INSERT INTO charaiteminventory (storageId, CharacterId, UPDATE_DATE ) "
|
||||
"VALUES ( " + std::to_string( InventoryType::ArmoryBody ) + ", " + std::to_string( m_id ) + ", NOW());" );
|
||||
g_charaDb.execute( "INSERT INTO charaiteminventory (storageId, CharacterId, UPDATE_DATE ) "
|
||||
"VALUES ( " + std::to_string( InventoryType::ArmoryBody ) + ", " + std::to_string( m_id ) + ", NOW());" );
|
||||
|
||||
g_database.execute( "INSERT INTO charaiteminventory (storageId, CharacterId, UPDATE_DATE ) "
|
||||
"VALUES ( " + std::to_string( InventoryType::ArmoryHand ) + ", " + std::to_string( m_id ) + ", NOW());" );
|
||||
g_charaDb.execute( "INSERT INTO charaiteminventory (storageId, CharacterId, UPDATE_DATE ) "
|
||||
"VALUES ( " + std::to_string( InventoryType::ArmoryHand ) + ", " + std::to_string( m_id ) + ", NOW());" );
|
||||
|
||||
g_database.execute( "INSERT INTO charaiteminventory (storageId, CharacterId, UPDATE_DATE ) "
|
||||
"VALUES ( " + std::to_string( InventoryType::ArmoryWaist ) + ", " + std::to_string( m_id ) + ", NOW());" );
|
||||
g_charaDb.execute( "INSERT INTO charaiteminventory (storageId, CharacterId, UPDATE_DATE ) "
|
||||
"VALUES ( " + std::to_string( InventoryType::ArmoryWaist ) + ", " + std::to_string( m_id ) + ", NOW());" );
|
||||
|
||||
g_database.execute( "INSERT INTO charaiteminventory (storageId, CharacterId, UPDATE_DATE ) "
|
||||
"VALUES ( " + std::to_string( InventoryType::ArmoryLegs ) + ", " + std::to_string( m_id ) + ", NOW());" );
|
||||
g_charaDb.execute( "INSERT INTO charaiteminventory (storageId, CharacterId, UPDATE_DATE ) "
|
||||
"VALUES ( " + std::to_string( InventoryType::ArmoryLegs ) + ", " + std::to_string( m_id ) + ", NOW());" );
|
||||
|
||||
g_database.execute( "INSERT INTO charaiteminventory (storageId, CharacterId, UPDATE_DATE ) "
|
||||
"VALUES ( " + std::to_string( InventoryType::ArmoryFeet ) + ", " + std::to_string( m_id ) + ", NOW());" );
|
||||
g_charaDb.execute( "INSERT INTO charaiteminventory (storageId, CharacterId, UPDATE_DATE ) "
|
||||
"VALUES ( " + std::to_string( InventoryType::ArmoryFeet ) + ", " + std::to_string( m_id ) + ", NOW());" );
|
||||
|
||||
g_database.execute( "INSERT INTO charaiteminventory (storageId, CharacterId, UPDATE_DATE ) "
|
||||
"VALUES ( " + std::to_string( InventoryType::ArmotyNeck ) + ", " + std::to_string( m_id ) + ", NOW());" );
|
||||
g_charaDb.execute( "INSERT INTO charaiteminventory (storageId, CharacterId, UPDATE_DATE ) "
|
||||
"VALUES ( " + std::to_string( InventoryType::ArmotyNeck ) + ", " + std::to_string( m_id ) + ", NOW());" );
|
||||
|
||||
g_database.execute( "INSERT INTO charaiteminventory (storageId, CharacterId, UPDATE_DATE ) "
|
||||
"VALUES ( " + std::to_string( InventoryType::ArmoryEar ) + ", " + std::to_string( m_id ) + ", NOW());" );
|
||||
g_charaDb.execute( "INSERT INTO charaiteminventory (storageId, CharacterId, UPDATE_DATE ) "
|
||||
"VALUES ( " + std::to_string( InventoryType::ArmoryEar ) + ", " + std::to_string( m_id ) + ", NOW());" );
|
||||
|
||||
g_database.execute( "INSERT INTO charaiteminventory (storageId, CharacterId, UPDATE_DATE )"
|
||||
"VALUES ( " + std::to_string( InventoryType::ArmoryWrist ) + ", " + std::to_string( m_id ) + ", NOW());" );
|
||||
g_charaDb.execute( "INSERT INTO charaiteminventory (storageId, CharacterId, UPDATE_DATE )"
|
||||
"VALUES ( " + std::to_string( InventoryType::ArmoryWrist ) + ", " + std::to_string( m_id ) + ", NOW());" );
|
||||
|
||||
g_database.execute( "INSERT INTO charaiteminventory (storageId, CharacterId, UPDATE_DATE ) "
|
||||
"VALUES ( " + std::to_string( InventoryType::ArmoryRing ) + ", " + std::to_string( m_id ) + ", NOW());" );
|
||||
g_charaDb.execute( "INSERT INTO charaiteminventory (storageId, CharacterId, UPDATE_DATE ) "
|
||||
"VALUES ( " + std::to_string( InventoryType::ArmoryRing ) + ", " + std::to_string( m_id ) + ", NOW());" );
|
||||
|
||||
g_database.execute( "INSERT INTO charaiteminventory (storageId, CharacterId, UPDATE_DATE ) "
|
||||
"VALUES ( " + std::to_string( InventoryType::ArmoryMain ) + ", " + std::to_string( m_id ) + ", NOW());" );
|
||||
g_charaDb.execute( "INSERT INTO charaiteminventory (storageId, CharacterId, UPDATE_DATE ) "
|
||||
"VALUES ( " + std::to_string( InventoryType::ArmoryMain ) + ", " + std::to_string( m_id ) + ", NOW());" );
|
||||
|
||||
g_database.execute( "INSERT INTO charaiteminventory (storageId, CharacterId, UPDATE_DATE ) "
|
||||
"VALUES ( " + std::to_string( InventoryType::Currency ) + ", " + std::to_string( m_id ) + ", NOW());" );
|
||||
g_charaDb.execute( "INSERT INTO charaiteminventory (storageId, CharacterId, UPDATE_DATE ) "
|
||||
"VALUES ( " + std::to_string( InventoryType::Currency ) + ", " + std::to_string( m_id ) + ", NOW());" );
|
||||
|
||||
g_database.execute( "INSERT INTO charaiteminventory (storageId, CharacterId, UPDATE_DATE ) "
|
||||
"VALUES ( " + std::to_string( InventoryType::Crystal ) + ", " + std::to_string( m_id ) + ", NOW());" );
|
||||
g_charaDb.execute( "INSERT INTO charaiteminventory (storageId, CharacterId, UPDATE_DATE ) "
|
||||
"VALUES ( " + std::to_string( InventoryType::Crystal ) + ", " + std::to_string( m_id ) + ", NOW());" );
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// SETUP EQUIPMENT / STARTING GEAR
|
||||
|
@ -360,22 +358,22 @@ namespace Core {
|
|||
feet = raceInfo->female_feet;
|
||||
}
|
||||
|
||||
g_database.execute( "INSERT INTO charaglobalitem (CharacterId, ItemId, catalogId, UPDATE_DATE ) "
|
||||
g_charaDb.execute( "INSERT INTO charaglobalitem (CharacterId, ItemId, catalogId, UPDATE_DATE ) "
|
||||
"VALUES ( " + std::to_string( m_id ) + ", " + std::to_string( uniqueId ) + ", " +
|
||||
std::to_string( weaponId ) + ", NOW());" );
|
||||
g_database.execute( "INSERT INTO charaglobalitem (CharacterId, ItemId, catalogId, UPDATE_DATE ) "
|
||||
std::to_string( weaponId ) + ", NOW());" );
|
||||
g_charaDb.execute( "INSERT INTO charaglobalitem (CharacterId, ItemId, catalogId, UPDATE_DATE ) "
|
||||
"VALUES ( " + std::to_string( m_id ) + ", " + std::to_string( bodyUid ) + ", " +
|
||||
std::to_string( body ) + ", NOW());" );
|
||||
g_database.execute( "INSERT INTO charaglobalitem (CharacterId, ItemId, catalogId, UPDATE_DATE ) "
|
||||
std::to_string( body ) + ", NOW());" );
|
||||
g_charaDb.execute( "INSERT INTO charaglobalitem (CharacterId, ItemId, catalogId, UPDATE_DATE ) "
|
||||
"VALUES ( " + std::to_string( m_id ) + ", " + std::to_string( handsUid ) + ", " +
|
||||
std::to_string( hands ) + ", NOW());" );
|
||||
g_database.execute( "INSERT INTO charaglobalitem (CharacterId, ItemId, catalogId, UPDATE_DATE ) "
|
||||
std::to_string( hands ) + ", NOW());" );
|
||||
g_charaDb.execute( "INSERT INTO charaglobalitem (CharacterId, ItemId, catalogId, UPDATE_DATE ) "
|
||||
"VALUES ( " + std::to_string( m_id ) + ", " + std::to_string( legsUid ) + ", " +
|
||||
std::to_string( legs ) + ", NOW());" );
|
||||
g_database.execute( "INSERT INTO charaglobalitem (CharacterId, ItemId, catalogId, UPDATE_DATE ) "
|
||||
std::to_string( legs ) + ", NOW());" );
|
||||
g_charaDb.execute( "INSERT INTO charaglobalitem (CharacterId, ItemId, catalogId, UPDATE_DATE ) "
|
||||
"VALUES ( " + std::to_string( m_id ) + ", " + std::to_string( feetUid ) + ", " +
|
||||
std::to_string( feet ) + ", NOW());" );
|
||||
g_database.execute( "INSERT INTO charaitemgearset (storageId, CharacterId, "
|
||||
std::to_string( feet ) + ", NOW());" );
|
||||
g_charaDb.execute( "INSERT INTO charaitemgearset (storageId, CharacterId, "
|
||||
"container_" + std::to_string( EquipSlot::MainHand ) + ", "
|
||||
"container_" + std::to_string( EquipSlot::Body ) + ", "
|
||||
"container_" + std::to_string( EquipSlot::Hands ) + ", "
|
||||
|
@ -387,10 +385,7 @@ namespace Core {
|
|||
std::to_string( bodyUid ) + ", " +
|
||||
std::to_string( handsUid ) + ", " +
|
||||
std::to_string( legsUid ) + ", " +
|
||||
std::to_string( feetUid ) + ", " +
|
||||
"NOW());" );
|
||||
|
||||
|
||||
std::to_string( feetUid ) + ", NOW());" );
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -566,6 +566,8 @@ private:
|
|||
uint8_t m_titleList[32];
|
||||
uint8_t m_achievement[16];
|
||||
uint8_t m_howTo[33];
|
||||
uint8_t m_minions[33];
|
||||
uint8_t m_mounts[13];
|
||||
uint8_t m_homePoint;
|
||||
uint8_t m_startTown;
|
||||
uint8_t m_favoritePoint[3];
|
||||
|
|
|
@ -13,14 +13,12 @@
|
|||
#include "Player.h"
|
||||
#include "src/servers/Server_Zone/Inventory/Inventory.h"
|
||||
|
||||
extern Core::Db::Database g_database;
|
||||
extern Core::Data::ExdData g_exdData;
|
||||
|
||||
using namespace Core::Common;
|
||||
using namespace Core::Network::Packets;
|
||||
using namespace Core::Network::Packets::Server;
|
||||
|
||||
|
||||
void Core::Entity::Player::finishQuest( uint16_t questId )
|
||||
{
|
||||
|
||||
|
|
|
@ -51,7 +51,7 @@ bool Core::Entity::Player::load( uint32_t charId, Core::SessionPtr pSession )
|
|||
{
|
||||
const std::string char_id_str = std::to_string( charId );
|
||||
|
||||
auto stmt = g_charaDb.getPreparedStatement( Core::Db::CharaDbStatements::CHAR_SEL_LOAD );
|
||||
auto stmt = g_charaDb.getPreparedStatement( Core::Db::CharaDbStatements::CHARA_SEL );
|
||||
|
||||
stmt->setUInt( 1, charId );
|
||||
auto res = g_charaDb.query( stmt );
|
||||
|
@ -207,7 +207,7 @@ bool Core::Entity::Player::load( uint32_t charId, Core::SessionPtr pSession )
|
|||
bool Core::Entity::Player::loadActiveQuests()
|
||||
{
|
||||
|
||||
auto stmt = g_charaDb.getPreparedStatement( Core::Db::CharaDbStatements::CHAR_SEL_LOAD_QUESTINFO );
|
||||
auto stmt = g_charaDb.getPreparedStatement( Core::Db::CharaDbStatements::CHARA_QUESTINFO_SEL_LOAD );
|
||||
|
||||
stmt->setUInt( 1, m_id );
|
||||
auto res = g_charaDb.query( stmt );
|
||||
|
@ -262,7 +262,7 @@ bool Core::Entity::Player::loadActiveQuests()
|
|||
bool Core::Entity::Player::loadClassData()
|
||||
{
|
||||
|
||||
auto stmt = g_charaDb.getPreparedStatement( Core::Db::CharaDbStatements::CHAR_SEL_LOAD_CLASSINFO );
|
||||
auto stmt = g_charaDb.getPreparedStatement( Core::Db::CharaDbStatements::CHARA_CLASSINFO_SEL_LOAD );
|
||||
stmt->setUInt( 1, m_id );
|
||||
auto res = g_charaDb.query( stmt );
|
||||
|
||||
|
@ -281,7 +281,7 @@ bool Core::Entity::Player::loadClassData()
|
|||
|
||||
bool Core::Entity::Player::loadSearchInfo()
|
||||
{
|
||||
auto stmt = g_charaDb.getPreparedStatement( Core::Db::CharaDbStatements::CHAR_SEL_LOAD_SEARCHINFO );
|
||||
auto stmt = g_charaDb.getPreparedStatement( Core::Db::CharaDbStatements::CHARA_SEACHINFO_SEL_LOAD );
|
||||
stmt->setUInt( 1, m_id );
|
||||
auto res = g_charaDb.query( stmt );
|
||||
|
||||
|
@ -299,6 +299,124 @@ bool Core::Entity::Player::loadSearchInfo()
|
|||
void Core::Entity::Player::updateSql()
|
||||
{
|
||||
|
||||
/*"Hp 1, Mp 2, Tp 3, Gp 4, Mode 5, Mount 6, InvincibleGM 7, Voice 8, "
|
||||
"Customize 9, ModelMainWeapon 10, ModelSubWeapon 11, ModelSystemWeapon 12, "
|
||||
"ModelEquip 13, EmoteModeType 14, Language 15, IsNewGame 16, IsNewAdventurer 17, "
|
||||
"TerritoryType 18, TerritoryId 19, PosX 20, PosY 21, PosZ 22, PosR 23, "
|
||||
"OTerritoryType 24, OTerritoryId 25, OPosX 26, OPosY 27, OPosZ 28, OPosR 29, "
|
||||
"Class 30, Status 31, TotalPlayTime 32, HomePoint 33, FavoritePoint 34, RestPoint 35, "
|
||||
"ActiveTitle 36, TitleList 37, Achievement 38, Aetheryte 39, HowTo 40, Minions 41, Mounts 42, "
|
||||
"EquippedMannequin 43, ConfigFlags 44, QuestCompleteFlags 45, OpeningSequence 46, "
|
||||
"QuestTracking 47, GrandCompany 48, GrandCompanyRank 49, Discovery 50, GMRank 51, Unlocks 52, "
|
||||
"CFPenaltyUntil 53"*/
|
||||
auto stmt = g_charaDb.getPreparedStatement( Core::Db::CharaDbStatements::CHARA_UP );
|
||||
|
||||
stmt->setInt( 1, getHp() );
|
||||
stmt->setInt( 2, getMp() );
|
||||
stmt->setInt( 3, 0 ); // TP
|
||||
stmt->setInt( 4, 0 ); // GP
|
||||
stmt->setInt( 5, 0 ); // Mode
|
||||
stmt->setInt( 6, 0 ); // Mount
|
||||
stmt->setInt( 7, 0 ); // InvicibleGM
|
||||
stmt->setInt( 8, m_voice );
|
||||
|
||||
std::vector< uint8_t > customVec( sizeof( m_customize ) );
|
||||
memcpy( customVec.data(), m_customize, sizeof( m_customize ) );
|
||||
stmt->setBinary( 9, customVec );
|
||||
|
||||
stmt->setInt64( 10, m_modelMainWeapon );
|
||||
stmt->setInt64( 11, m_modelSubWeapon );
|
||||
stmt->setInt64( 12, m_modelSystemWeapon );
|
||||
|
||||
std::vector< uint8_t > modelVec( sizeof( m_modelEquip ) );
|
||||
memcpy( modelVec.data(), m_modelEquip, sizeof( m_modelEquip ) );
|
||||
stmt->setBinary( 13, modelVec );
|
||||
|
||||
stmt->setInt( 14, 0 ); // EmodeModeType
|
||||
stmt->setInt( 15, 0 ); // Language
|
||||
|
||||
stmt->setInt( 16, static_cast< uint32_t >( m_bNewGame ) );
|
||||
stmt->setInt( 17, static_cast< uint32_t >( m_bNewAdventurer ) );
|
||||
|
||||
stmt->setInt( 18, 0 ); // TerritoryType
|
||||
stmt->setInt( 19, m_zoneId ); // TerritoryId
|
||||
stmt->setDouble( 20, m_pos.x );
|
||||
stmt->setDouble( 21, m_pos.y );
|
||||
stmt->setDouble( 22, m_pos.z );
|
||||
stmt->setDouble( 23, getRotation() );
|
||||
|
||||
stmt->setInt( 24, 0 ); // OTerritoryType
|
||||
stmt->setInt( 25, 0 ); // OTerritoryId
|
||||
stmt->setDouble( 26, 0.0f );
|
||||
stmt->setDouble( 27, 0.0f );
|
||||
stmt->setDouble( 28, 0.0f );
|
||||
stmt->setDouble( 29, 0.0f );
|
||||
|
||||
stmt->setInt( 30, static_cast< uint8_t >( getClass() ) );
|
||||
stmt->setInt( 31, static_cast< uint8_t >( getStatus() ) );
|
||||
stmt->setInt( 32, m_playTime );
|
||||
stmt->setInt( 33, m_homePoint );
|
||||
|
||||
stmt->setBinary( 34, { 0, 0, 0 } ); // FavoritePoint
|
||||
stmt->setInt( 35, 0 ); // RestPoint
|
||||
stmt->setInt( 36, 0 ); // ActiveTitle
|
||||
|
||||
std::vector< uint8_t > titleListVec( 32 );
|
||||
stmt->setBinary( 37, titleListVec );
|
||||
|
||||
std::vector< uint8_t > achievementVec( 16 );
|
||||
stmt->setBinary( 38, achievementVec );
|
||||
|
||||
std::vector< uint8_t > aetheryteVec( sizeof( m_aetheryte ) );
|
||||
memcpy( aetheryteVec.data(), m_aetheryte, sizeof( m_aetheryte ) );
|
||||
stmt->setBinary( 39, aetheryteVec );
|
||||
|
||||
std::vector< uint8_t > howToVec( sizeof( m_howTo ) );
|
||||
memcpy( howToVec.data(), m_howTo, sizeof( m_howTo ) );
|
||||
stmt->setBinary( 40, howToVec );
|
||||
|
||||
std::vector< uint8_t > minionsVec( sizeof( m_minions ) );
|
||||
memcpy( minionsVec.data(), m_minions, sizeof( m_minions ) );
|
||||
stmt->setBinary( 41, minionsVec );
|
||||
|
||||
std::vector< uint8_t > mountsVec( sizeof( m_mounts ) );
|
||||
memcpy( mountsVec.data(), m_mounts, sizeof( m_mounts ) );
|
||||
stmt->setBinary( 42, mountsVec );
|
||||
|
||||
stmt->setInt( 43, 0 ); // EquippedMannequin
|
||||
|
||||
stmt->setInt( 44, 0 ); // DisplayFlags
|
||||
|
||||
std::vector< uint8_t > questCompleteVec( sizeof( m_questCompleteFlags ) );
|
||||
memcpy( questCompleteVec.data(), m_questCompleteFlags, sizeof( m_questCompleteFlags ) );
|
||||
stmt->setBinary( 45, questCompleteVec );
|
||||
|
||||
stmt->setInt( 46, m_openingSequence );
|
||||
|
||||
std::vector< uint8_t > questTrackerVec( sizeof( m_questTracking ) );
|
||||
memcpy( questTrackerVec.data(), m_questTracking, sizeof( m_questTracking ) );
|
||||
stmt->setBinary( 47, questTrackerVec );
|
||||
|
||||
stmt->setInt( 48, m_gc ); // DisplayFlags
|
||||
|
||||
stmt->setBinary( 49, { m_gcRank[0], m_gcRank[1], m_gcRank[2] } );
|
||||
|
||||
std::vector< uint8_t > discoveryVec( sizeof( m_discovery ) );
|
||||
memcpy( discoveryVec.data(), m_discovery, sizeof( m_discovery ) );
|
||||
stmt->setBinary( 50, discoveryVec );
|
||||
|
||||
stmt->setInt( 51, m_gmRank );
|
||||
|
||||
std::vector< uint8_t > unlockVec( sizeof( m_unlocks ) );
|
||||
memcpy( unlockVec.data(), m_unlocks, sizeof( m_unlocks ) );
|
||||
stmt->setBinary( 52, unlockVec );
|
||||
|
||||
stmt->setInt( 53, m_cfPenaltyUntil );
|
||||
|
||||
stmt->setInt( 54, m_id );
|
||||
|
||||
g_charaDb.execute( stmt );
|
||||
|
||||
std::set< std::string > charaBaseSet;
|
||||
std::set< std::string > charaDetailSet;
|
||||
std::set< std::string > charaClassSet;
|
||||
|
@ -306,41 +424,12 @@ void Core::Entity::Player::updateSql()
|
|||
std::set< std::string > charaInfoSearchSet;
|
||||
|
||||
std::string dbName = g_serverZone.getConfig()->getValue< std::string >( "Settings.General.Mysql.Database", "sapphire" );
|
||||
std::string updateCharaBase = "UPDATE " + dbName + ".charabase SET ";
|
||||
std::string updateCharaDetail = "UPDATE " + dbName + ".charadetail SET ";
|
||||
std::string updateCharaClass = "UPDATE " + dbName + ".characlass SET ";
|
||||
std::string updateCharaQuest = "UPDATE " + dbName + ".charaquest SET ";
|
||||
std::string updateCharaInfoSearch = "UPDATE " + dbName + ".charainfosearch SET ";
|
||||
|
||||
std::string condition = " UPDATE_DATE = NOW() WHERE CharacterId = " + std::to_string( m_id ) + ";";
|
||||
|
||||
charaBaseSet.insert( " Pos_0_0 = " + std::to_string( m_pos.x ) );
|
||||
charaBaseSet.insert( " Pos_0_1 = " + std::to_string( m_pos.y ) );
|
||||
charaBaseSet.insert( " Pos_0_2 = " + std::to_string( m_pos.z ) );
|
||||
charaBaseSet.insert( " Pos_0_3 = " + std::to_string( getRotation() ) );
|
||||
charaBaseSet.insert( " PrimaryTerritoryId = " + std::to_string( m_zoneId ) );
|
||||
charaBaseSet.insert( " IsNewGame = " + std::to_string( static_cast< uint32_t >( m_bNewGame ) ) );
|
||||
charaBaseSet.insert( " IsNewAdventurer = " + std::to_string( static_cast< uint32_t >( m_bNewAdventurer ) ) );
|
||||
charaBaseSet.insert( " Hp = " + std::to_string( getHp() ) );
|
||||
charaBaseSet.insert( " Mp = " + std::to_string( getMp() ) );
|
||||
charaBaseSet.insert( " Mode = " + std::to_string( static_cast< uint32_t >( getStance() ) ) );
|
||||
charaBaseSet.insert( " ModelEquip = UNHEX('" + std::string( Util::binaryToHexString( reinterpret_cast< uint8_t* >( m_modelEquip ), 40 ) ) + "')" );
|
||||
|
||||
charaDetailSet.insert( " Homepoint = " + std::to_string( m_homePoint ) );
|
||||
charaDetailSet.insert( " Discovery = UNHEX('" + std::string( Util::binaryToHexString( static_cast< uint8_t* >( m_discovery ), sizeof( m_discovery ) ) ) + "')" );
|
||||
charaDetailSet.insert( " TotalPlayTime = " + std::to_string( m_playTime ) );
|
||||
charaDetailSet.insert( " unlocks = UNHEX('" + std::string( Util::binaryToHexString( static_cast< uint8_t* >( m_unlocks ), sizeof( m_unlocks ) ) ) + "')" );
|
||||
charaDetailSet.insert( " QuestTracking = UNHEX('" + std::string( Util::binaryToHexString( reinterpret_cast< uint8_t* >( m_questTracking ), sizeof( m_questTracking ) ) ) + "')" );
|
||||
charaDetailSet.insert( " HowTo = UNHEX('" + std::string( Util::binaryToHexString( static_cast< uint8_t* >( m_howTo ), sizeof( m_howTo ) ) ) + "')" );
|
||||
charaDetailSet.insert( " Aetheryte = UNHEX('" + std::string( Util::binaryToHexString( reinterpret_cast< uint8_t* >( m_aetheryte ), sizeof( m_aetheryte ) ) ) + "')" );
|
||||
charaDetailSet.insert( " GrandCompany = " + std::to_string( m_gc ) );
|
||||
charaDetailSet.insert( " GrandCompanyRank = UNHEX('" + std::string( Util::binaryToHexString( reinterpret_cast< uint8_t* >( m_gcRank ), sizeof( m_gcRank ) ) ) + "')" );
|
||||
charaDetailSet.insert( " CFPenaltyUntil = " + std::to_string( m_cfPenaltyUntil ) );
|
||||
charaDetailSet.insert( " Class = " + std::to_string( static_cast< uint32_t >( getClass() ) ) );
|
||||
charaDetailSet.insert( " Status = " + std::to_string( static_cast< uint8_t >( getStatus() ) ) );
|
||||
charaDetailSet.insert( " OpeningSequence = " + std::to_string( static_cast< uint8_t >( getOpeningSequence() ) ) );
|
||||
charaDetailSet.insert( " QuestCompleteFlags = UNHEX('" + std::string( Util::binaryToHexString( static_cast< uint8_t* >( m_questCompleteFlags ), 200 ) ) + "')" );
|
||||
|
||||
uint8_t classJobIndex = g_exdData.m_classJobInfoMap[static_cast< uint8_t >( getClass() )].exp_idx;
|
||||
charaClassSet.insert( " Lv_" + std::to_string( classJobIndex ) + " = " + std::to_string( static_cast< uint32_t >( getLevel() ) ) );
|
||||
charaClassSet.insert( " Exp_" + std::to_string( classJobIndex ) + " = " + std::to_string( getExp() ) );
|
||||
|
@ -388,24 +477,6 @@ void Core::Entity::Player::updateSql()
|
|||
g_database.execute( updateCharaInfoSearch );
|
||||
}
|
||||
|
||||
if( !charaBaseSet.empty() )
|
||||
{
|
||||
for( auto entry : charaBaseSet )
|
||||
updateCharaBase += entry + ", ";
|
||||
|
||||
updateCharaBase += condition;
|
||||
g_database.execute( updateCharaBase );
|
||||
}
|
||||
|
||||
if( !charaDetailSet.empty() )
|
||||
{
|
||||
for( auto entry : charaDetailSet )
|
||||
updateCharaDetail += entry + ", ";
|
||||
|
||||
updateCharaDetail += condition;
|
||||
g_database.execute( updateCharaDetail );
|
||||
}
|
||||
|
||||
if( !charaClassSet.empty() )
|
||||
{
|
||||
for( auto entry : charaClassSet )
|
||||
|
|
|
@ -202,11 +202,6 @@ bool Core::ServerZone::loadSettings( int32_t argc, char* argv[] )
|
|||
g_log.info( "port: " + std::to_string( res->getUInt( "port" ) ) );
|
||||
}
|
||||
|
||||
auto stmt = g_charaDb.getPreparedStatement( Core::Db::CharaDbStatements::CHAR_INS_TEST );
|
||||
stmt->setUInt( 1, 2345 );
|
||||
stmt->setString( 2, "123.123.123.123" );
|
||||
stmt->setUInt( 3, 3306 );
|
||||
g_charaDb.execute( stmt );
|
||||
|
||||
//stmt->setUInt( 1, 245 );
|
||||
//stmt->setString( 2, "12.12.12.12" );
|
||||
|
|
Loading…
Add table
Reference in a new issue