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:
parent
ffbc1b43a4
commit
2b6dc90e8e
5 changed files with 19 additions and 3 deletions
2
deps/datReader/Exd.h
vendored
2
deps/datReader/Exd.h
vendored
|
@ -80,7 +80,7 @@ namespace xiv::exd
|
||||||
// Get the vector fields for the given record and preallocate it
|
// Get the vector fields for the given record and preallocate it
|
||||||
auto fields = _data[ id ];
|
auto fields = _data[ id ];
|
||||||
fields.reserve( member_count );
|
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 ) );
|
iss.read( reinterpret_cast<char*>( &pSheet.get()->_data ), sizeof( T ) );
|
||||||
|
|
||||||
|
|
|
@ -308,10 +308,10 @@ void PlayerMinimal::saveAsNew()
|
||||||
createInvDbContainer( InventoryType::ArmoryRing );
|
createInvDbContainer( InventoryType::ArmoryRing );
|
||||||
createInvDbContainer( InventoryType::ArmoryMain );
|
createInvDbContainer( InventoryType::ArmoryMain );
|
||||||
createInvDbContainer( InventoryType::ArmorySoulCrystal );
|
createInvDbContainer( InventoryType::ArmorySoulCrystal );
|
||||||
|
|
||||||
createInvDbContainer( InventoryType::Currency );
|
|
||||||
createInvDbContainer( InventoryType::Crystal );
|
createInvDbContainer( InventoryType::Crystal );
|
||||||
|
|
||||||
|
createCurrencyDbContainer();
|
||||||
|
|
||||||
auto stmtMonsterNote = g_charaDb.getPreparedStatement( Db::ZoneDbStatements::CHARA_MONSTERNOTE_INS );
|
auto stmtMonsterNote = g_charaDb.getPreparedStatement( Db::ZoneDbStatements::CHARA_MONSTERNOTE_INS );
|
||||||
stmtMonsterNote->setUInt64( 1, m_characterId );
|
stmtMonsterNote->setUInt64( 1, m_characterId );
|
||||||
for( uint8_t i = 1; i <= 12; ++i )
|
for( uint8_t i = 1; i <= 12; ++i )
|
||||||
|
@ -453,6 +453,14 @@ void PlayerMinimal::createInvDbContainer( uint16_t slot ) const
|
||||||
g_charaDb.directExecute( stmtCreateInv );
|
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
|
uint64_t PlayerMinimal::getNextUId64() const
|
||||||
{
|
{
|
||||||
g_charaDb.directExecute( std::string( "INSERT INTO uniqueiddata( IdName ) VALUES( 'NOT_SET' );" ) );
|
g_charaDb.directExecute( std::string( "INSERT INTO uniqueiddata( IdName ) VALUES( 'NOT_SET' );" ) );
|
||||||
|
|
|
@ -159,6 +159,8 @@ namespace Sapphire::Api
|
||||||
|
|
||||||
void createInvDbContainer( uint16_t slot ) const;
|
void createInvDbContainer( uint16_t slot ) const;
|
||||||
|
|
||||||
|
void createCurrencyDbContainer() const;
|
||||||
|
|
||||||
uint32_t m_modelEquip[10];
|
uint32_t m_modelEquip[10];
|
||||||
|
|
||||||
uint64_t getNextUId64() const;
|
uint64_t getNextUId64() const;
|
||||||
|
|
|
@ -176,6 +176,11 @@ void Sapphire::Db::ZoneDbConnection::doPrepareStatements()
|
||||||
"INSERT INTO charaiteminventory ( CharacterId, storageId, UPDATE_DATE ) VALUES ( ?, ?, NOW() );",
|
"INSERT INTO charaiteminventory ( CharacterId, storageId, UPDATE_DATE ) VALUES ( ?, ?, NOW() );",
|
||||||
CONNECTION_BOTH );
|
CONNECTION_BOTH );
|
||||||
|
|
||||||
|
/// INVENTORY INFO
|
||||||
|
prepareStatement(CHARA_CURRENCYINV_INS,
|
||||||
|
"INSERT INTO charaitemcurrency ( CharacterId, storageId, idx, UPDATE_DATE ) VALUES ( ?, ?, 0, NOW() );",
|
||||||
|
CONNECTION_BOTH);
|
||||||
|
|
||||||
/// ITEM GLOBAL
|
/// ITEM GLOBAL
|
||||||
prepareStatement( CHARA_ITEMGLOBAL_INS,
|
prepareStatement( CHARA_ITEMGLOBAL_INS,
|
||||||
"INSERT INTO charaglobalitem ( CharacterId, ItemId, catalogId, stack, UPDATE_DATE ) VALUES ( ?, ?, ?, ?, NOW() );",
|
"INSERT INTO charaglobalitem ( CharacterId, ItemId, catalogId, stack, UPDATE_DATE ) VALUES ( ?, ?, ?, ?, NOW() );",
|
||||||
|
|
|
@ -70,6 +70,7 @@ namespace Sapphire::Db
|
||||||
CHARA_CLASS_DEL,
|
CHARA_CLASS_DEL,
|
||||||
|
|
||||||
CHARA_ITEMINV_INS,
|
CHARA_ITEMINV_INS,
|
||||||
|
CHARA_CURRENCYINV_INS,
|
||||||
|
|
||||||
CHARA_ITEMGLOBAL_SELECT,
|
CHARA_ITEMGLOBAL_SELECT,
|
||||||
CHARA_ITEMGLOBAL_INS,
|
CHARA_ITEMGLOBAL_INS,
|
||||||
|
|
Loading…
Add table
Reference in a new issue