1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-05-24 18:47:45 +00:00

fix: fixed oversight where currency record not created

This commit is contained in:
Matthe815 2023-01-06 22:46:48 -05:00
parent ffbc1b43a4
commit 2b6dc90e8e
No known key found for this signature in database
GPG key ID: 6B963FE816B1DC39
5 changed files with 19 additions and 3 deletions

View file

@ -80,7 +80,7 @@ namespace xiv::exd
// Get the vector fields for the given record and preallocate it
auto fields = _data[ id ];
fields.reserve( member_count );
iss.seekg( cacheEntryIt->second.offset + 6 );
iss.seekg( static_cast< uint64_t >( cacheEntryIt->second.offset + 6 ) );
iss.read( reinterpret_cast<char*>( &pSheet.get()->_data ), sizeof( T ) );

View file

@ -308,10 +308,10 @@ void PlayerMinimal::saveAsNew()
createInvDbContainer( InventoryType::ArmoryRing );
createInvDbContainer( InventoryType::ArmoryMain );
createInvDbContainer( InventoryType::ArmorySoulCrystal );
createInvDbContainer( InventoryType::Currency );
createInvDbContainer( InventoryType::Crystal );
createCurrencyDbContainer();
auto stmtMonsterNote = g_charaDb.getPreparedStatement( Db::ZoneDbStatements::CHARA_MONSTERNOTE_INS );
stmtMonsterNote->setUInt64( 1, m_characterId );
for( uint8_t i = 1; i <= 12; ++i )
@ -453,6 +453,14 @@ void PlayerMinimal::createInvDbContainer( uint16_t slot ) const
g_charaDb.directExecute( stmtCreateInv );
}
void PlayerMinimal::createCurrencyDbContainer() const
{
auto stmtCreateCurrency = g_charaDb.getPreparedStatement( Db::CHARA_CURRENCYINV_INS );
stmtCreateCurrency->setUInt64( 1, m_characterId );
stmtCreateCurrency->setInt( 2, 2000 );
g_charaDb.directExecute( stmtCreateCurrency );
}
uint64_t PlayerMinimal::getNextUId64() const
{
g_charaDb.directExecute( std::string( "INSERT INTO uniqueiddata( IdName ) VALUES( 'NOT_SET' );" ) );

View file

@ -159,6 +159,8 @@ namespace Sapphire::Api
void createInvDbContainer( uint16_t slot ) const;
void createCurrencyDbContainer() const;
uint32_t m_modelEquip[10];
uint64_t getNextUId64() const;

View file

@ -176,6 +176,11 @@ void Sapphire::Db::ZoneDbConnection::doPrepareStatements()
"INSERT INTO charaiteminventory ( CharacterId, storageId, UPDATE_DATE ) VALUES ( ?, ?, NOW() );",
CONNECTION_BOTH );
/// INVENTORY INFO
prepareStatement(CHARA_CURRENCYINV_INS,
"INSERT INTO charaitemcurrency ( CharacterId, storageId, idx, UPDATE_DATE ) VALUES ( ?, ?, 0, NOW() );",
CONNECTION_BOTH);
/// ITEM GLOBAL
prepareStatement( CHARA_ITEMGLOBAL_INS,
"INSERT INTO charaglobalitem ( CharacterId, ItemId, catalogId, stack, UPDATE_DATE ) VALUES ( ?, ?, ?, ?, NOW() );",

View file

@ -70,6 +70,7 @@ namespace Sapphire::Db
CHARA_CLASS_DEL,
CHARA_ITEMINV_INS,
CHARA_CURRENCYINV_INS,
CHARA_ITEMGLOBAL_SELECT,
CHARA_ITEMGLOBAL_INS,