mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-25 14:07:46 +00:00
fix: Fixed oversight where currency record not inserting
This commit is contained in:
parent
f71230809b
commit
40a0455c9e
4 changed files with 15 additions and 1 deletions
|
@ -309,7 +309,7 @@ void PlayerMinimal::saveAsNew()
|
|||
createInvDbContainer( InventoryType::ArmoryMain );
|
||||
createInvDbContainer( InventoryType::ArmorySoulCrystal );
|
||||
|
||||
createInvDbContainer( InventoryType::Currency );
|
||||
createCurrencyDbContainer();
|
||||
createInvDbContainer( InventoryType::Crystal );
|
||||
|
||||
auto stmtMonsterNote = g_charaDb.getPreparedStatement( Db::ZoneDbStatements::CHARA_MONSTERNOTE_INS );
|
||||
|
@ -453,6 +453,13 @@ void PlayerMinimal::createInvDbContainer( uint16_t slot ) const
|
|||
g_charaDb.directExecute( stmtCreateInv );
|
||||
}
|
||||
|
||||
void PlayerMinimal::createCurrencyDbContainer() const
|
||||
{
|
||||
auto stmtCreateInv = g_charaDb.getPreparedStatement( Db::CHARA_CURRENCYINV_INS );
|
||||
stmtCreateInv->setUInt64( 1, m_characterId );
|
||||
g_charaDb.directExecute( stmtCreateInv );
|
||||
}
|
||||
|
||||
uint64_t PlayerMinimal::getNextUId64() const
|
||||
{
|
||||
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 createCurrencyDbContainer() const;
|
||||
|
||||
uint32_t m_modelEquip[10];
|
||||
|
||||
uint64_t getNextUId64() const;
|
||||
|
|
|
@ -176,6 +176,10 @@ void Sapphire::Db::ZoneDbConnection::doPrepareStatements()
|
|||
"INSERT INTO charaiteminventory ( CharacterId, storageId, UPDATE_DATE ) VALUES ( ?, ?, NOW() );",
|
||||
CONNECTION_BOTH );
|
||||
|
||||
prepareStatement( CHARA_CURRENCYINV_INS,
|
||||
"INSERT INTO charaitemcurrency ( CharacterId, storageId, idx, UPDATE_DATE ) VALUES ( ?, 2000, 2, NOW() );",
|
||||
CONNECTION_BOTH );
|
||||
|
||||
/// ITEM GLOBAL
|
||||
prepareStatement( CHARA_ITEMGLOBAL_INS,
|
||||
"INSERT INTO charaglobalitem ( CharacterId, ItemId, catalogId, stack, UPDATE_DATE ) VALUES ( ?, ?, ?, ?, NOW() );",
|
||||
|
|
|
@ -70,6 +70,7 @@ namespace Sapphire::Db
|
|||
CHARA_CLASS_DEL,
|
||||
|
||||
CHARA_ITEMINV_INS,
|
||||
CHARA_CURRENCYINV_INS,
|
||||
|
||||
CHARA_ITEMGLOBAL_SELECT,
|
||||
CHARA_ITEMGLOBAL_INS,
|
||||
|
|
Loading…
Add table
Reference in a new issue