48 lines
1.2 KiB
C++
48 lines
1.2 KiB
C++
|
|
// Fraun Sky Accessories 7/12/2025
|
|
#include <toolkit/XConsole.h>
|
|
|
|
#include "DB_Commands.h"
|
|
#include "StructItem.h"
|
|
|
|
|
|
bool DB_UpdateItemEffect::proc(DBConnection& db)
|
|
{
|
|
_CommandPtr cmd;
|
|
|
|
if(db.CreateCommand(cmd) == false ) throw XException("DB_UpdateItemEffect : CreateInstance(command) error");
|
|
|
|
cmd->CommandType = adCmdStoredProc;
|
|
cmd->CommandText = _bstr_t("dbo.smp_update_additional_item_effect");
|
|
// Store the name of current stored-procedure for debugging
|
|
szStoredProcedureName = "dbo.smp_update_additional_item_effect";
|
|
s_sprintf(szStoredProcedureDebugInfo, _countof(szStoredProcedureDebugInfo), "@IN_SID: %d, @IN_ITEMEFFECT: %d", m_pItem->GetItemUID(), m_pItem->GetItemAdditionalEffect());
|
|
|
|
cmd->Parameters->Append(cmd->CreateParameter("IN_SID", adBigInt, adParamInput, 8, m_pItem->GetItemUID()));
|
|
cmd->Parameters->Append(cmd->CreateParameter("IN_ITEMEFFECT", adInteger, adParamInput, 4, m_pItem->GetItemAdditionalEffect()));
|
|
|
|
cmd->Execute(NULL, NULL, adCmdStoredProc);
|
|
|
|
return true;
|
|
}
|
|
|
|
|
|
bool DB_UpdateItemEffect::onProcess(DBConnection& db)
|
|
{
|
|
try
|
|
{
|
|
bool bRtn = true;
|
|
|
|
if (!m_pItem->IsVirtualItem())
|
|
bRtn = proc(db);
|
|
}
|
|
catch (...)
|
|
{
|
|
m_pItem->onEndQuery();
|
|
throw;
|
|
}
|
|
|
|
m_pItem->onEndQuery();
|
|
|
|
return true;
|
|
} |