<pre>bool GS_CThreadSQL::UpdateUserRECORD (classUSER *pUSER)
{
m_sBE.m_btCharRACE = (BYTE)pUSER->m_nCharRACE;
if ( pUSER->Get_HP() <= 0 ) {
if ( pUSER->m_nZoneNO == BEGINNER_ZONE_NO ) {
m_sBE.m_nZoneNO = BEGINNER_ZONE_NO;
m_sBE.m_PosSTART = pUSER->m_PosCUR;
} else {
m_sBE.m_nZoneNO = pUSER->m_nReviveZoneNO;
m_sBE.m_PosSTART = pUSER->m_PosREVIVE;
}
} else {
m_sBE.m_nZoneNO = pUSER->m_nZoneNO;
m_sBE.m_PosSTART = pUSER->m_PosCUR;
}
m_sBE.m_nReviveZoneNO = pUSER->m_nReviveZoneNO;
m_sBE.m_PosREVIVE = pUSER->m_PosREVIVE;
m_sBE.m_btCharSlotNO = pUSER->m_btPlatinumCHAR;
if ( m_sBE.m_nZoneNO < 0 || m_sBE.m_nReviveZoneNO < 0 ) {
g_LOG.CS_ODS( 0xffff, "**** Invalid ZoneNO [ %s ] Race: %d, Zone: %d ReviveZone: %d \n",
pUSER->Get_NAME(),
m_sBE.m_btCharRACE,
m_sBE.m_nZoneNO,
m_sBE.m_nReviveZoneNO );
}
::CopyMemory( m_sBE.m_PartITEM, pUSER->m_PartITEM, sizeof(tagPartITEM)*MAX_BODY_PART);
::CopyMemory( m_sBE.m_RideITEM, pUSER->m_RideITEM, sizeof(tagPartITEM)*MAX_RIDING_PART);
pUSER->m_BasicINFO.m_cFaceIDX = (char)pUSER->m_PartITEM[ BODY_PART_FACE ].m_nItemNo;
pUSER->m_BasicINFO.m_cHairIDX = (char)pUSER->m_PartITEM[ BODY_PART_HAIR ].m_nItemNo;
this->m_pSQL->BindPARAM( 1, (BYTE*)&this->m_sBE, sizeof( tagBasicETC ) );
this->m_pSQL->BindPARAM( 2, (BYTE*)&pUSER->m_BasicINFO, sizeof( tagBasicINFO ) );
this->m_pSQL->BindPARAM( 3, (BYTE*)&pUSER->m_BasicAbility, sizeof( tagBasicAbility ) );
this->m_pSQL->BindPARAM( 4, (BYTE*)&pUSER->m_GrowAbility, sizeof( tagGrowAbility ) );
this->m_pSQL->BindPARAM( 5, (BYTE*)&pUSER->m_Skills, sizeof( tagSkillAbility ) );
this->m_pSQL->BindPARAM( 6, (BYTE*)&pUSER->m_Inventory, sizeof( CInventory ) );
this->m_pSQL->BindPARAM( 7, (BYTE*)&pUSER->m_Quests, sizeof( tagQuestData ) );
this->m_pSQL->BindPARAM( 8, (BYTE*)&pUSER->m_HotICONS, sizeof( CHotICONS ) );
this->m_pSQL->BindPARAM( 9, (BYTE*)&pUSER->m_WishLIST, sizeof( tagWishLIST ) );
#ifdef __KCHS_BATTLECART__ // MQ_PARAM_INT16, DATA_VER_2,
this->m_pSQL->MakeQuery( "UPDATE tblGS_AVATAR SET binBasicE=",
MQ_PARAM_BINDIDX, 1,
MQ_PARAM_ADDSTR, ",binBasicI=", MQ_PARAM_BINDIDX, 2,
MQ_PARAM_ADDSTR, ",binBasicA=", MQ_PARAM_BINDIDX, 3,
MQ_PARAM_ADDSTR, ",binGrowA=", MQ_PARAM_BINDIDX, 4,
MQ_PARAM_ADDSTR, ",binSkillA=", MQ_PARAM_BINDIDX, 5,
MQ_PARAM_ADDSTR, ",blobINV=", MQ_PARAM_BINDIDX, 6,
MQ_PARAM_ADDSTR, ",blobQUEST=", MQ_PARAM_BINDIDX, 7,
MQ_PARAM_ADDSTR, ",binHotICON=", MQ_PARAM_BINDIDX, 8,
MQ_PARAM_ADDSTR, ",binWishLIST=", MQ_PARAM_BINDIDX, 9,
MQ_PARAM_ADDSTR, ",btLEVEL=", MQ_PARAM_INT, pUSER->m_GrowAbility.m_nLevel,
MQ_PARAM_ADDSTR, ",intMoney=", MQ_PARAM_INT64, pUSER->GetCur_MONEY(),
MQ_PARAM_ADDSTR, ",intJOB=", MQ_PARAM_INT, pUSER->m_BasicINFO.m_nClass,
MQ_PARAM_ADDSTR, ",dwRegTIME=", MQ_PARAM_INT, this->m_dwCurTIME,
MQ_PARAM_ADDSTR, ",dwPartyIDX=", MQ_PARAM_INT, pUSER->GetPARTY() ? pUSER->m_pPartyBUFF->m_wPartyWSID : 0,
MQ_PARAM_ADDSTR, ",dwItemSN=", MQ_PARAM_INT, pUSER->m_dwItemSN,
MQ_PARAM_ADDSTR, ",intDataVER=", MQ_PARAM_INT16, DATA_VER_2,
MQ_PARAM_ADDSTR, "WHERE txtNAME=", MQ_PARAM_STR, pUSER->Get_NAME(),
MQ_PARAM_END );
#else
this->m_pSQL->MakeQuery( "UPDATE tblGS_AVATAR SET binBasicE=",
MQ_PARAM_BINDIDX, 1,
MQ_PARAM_ADDSTR, ",binBasicI=", MQ_PARAM_BINDIDX, 2,
MQ_PARAM_ADDSTR, ",binBasicA=", MQ_PARAM_BINDIDX, 3,
MQ_PARAM_ADDSTR, ",binGrowA=", MQ_PARAM_BINDIDX, 4,
MQ_PARAM_ADDSTR, ",binSkillA=", MQ_PARAM_BINDIDX, 5,
MQ_PARAM_ADDSTR, ",blobINV=", MQ_PARAM_BINDIDX, 6,
MQ_PARAM_ADDSTR, ",blobQUEST=", MQ_PARAM_BINDIDX, 7,
MQ_PARAM_ADDSTR, ",binHotICON=", MQ_PARAM_BINDIDX, 8,
MQ_PARAM_ADDSTR, ",binWishLIST=", MQ_PARAM_BINDIDX, 9,
MQ_PARAM_ADDSTR, ",btLEVEL=", MQ_PARAM_INT, pUSER->m_GrowAbility.m_nLevel,
MQ_PARAM_ADDSTR, ",intMoney=", MQ_PARAM_INT64, pUSER->GetCur_MONEY(),
MQ_PARAM_ADDSTR, ",intJOB=", MQ_PARAM_INT, pUSER->m_BasicINFO.m_nClass,
MQ_PARAM_ADDSTR, ",dwRegTIME=", MQ_PARAM_INT, this->m_dwCurTIME,
MQ_PARAM_ADDSTR, ",dwPartyIDX=", MQ_PARAM_INT, pUSER->GetPARTY() ? pUSER->m_pPartyBUFF->m_wPartyWSID : 0,
MQ_PARAM_ADDSTR, ",dwItemSN=", MQ_PARAM_INT, pUSER->m_dwItemSN,
MQ_PARAM_ADDSTR, "WHERE txtNAME=", MQ_PARAM_STR, pUSER->Get_RNAME(),
MQ_PARAM_END );
#endif
if ( this->m_pSQL->ExecSQLBuffer() < 0 ) {
g_LOG.CS_ODS(LOG_NORMAL, "SQL Exec ERROR:: UPDATE Char:%s %s \n", pUSER->Get_NAME(), m_pSQL->GetERROR() );
} else {
g_pThreadLOG->When_BackUP( pUSER, "CHAR" );
}
if ( BANK_CHANGED != pUSER->m_btBankData )
return true;
this->m_pSQL->BindPARAM( 1, (BYTE*)&pUSER->m_Bank, sizeof( tagBankData ) );
this->m_pSQL->MakeQuery( "UPDATE tblGS_BANK SET blobITEMS=",
MQ_PARAM_BINDIDX, 1,
MQ_PARAM_ADDSTR, "WHERE txtACCOUNT=", MQ_PARAM_STR, pUSER->Get_ACCOUNT(),
MQ_PARAM_END );
if ( this->m_pSQL->ExecSQLBuffer() < 0 ) {
g_LOG.CS_ODS(LOG_NORMAL, "SQL Exec ERROR:: UPDATE Bank:%s %s \n", pUSER->Get_ACCOUNT(), m_pSQL->GetERROR() );
} else {
pUSER->m_btBankData = BANK_LOADED;
g_pThreadLOG->When_BackUP( pUSER, "BANK" );
}
return true;
}
SQL DATABASE MSSQL 2008 r2
intCharID int Unchecked
txtACCOUNT nvarchar(20) Unchecked
txtNAME nvarchar(30) Unchecked
btLEVEL int Checked
intMoney bigint Checked
dwRIGHT int Checked
binBasicE binary(96) Checked
binBasicI binary(32) Unchecked
binBasicA binary(48) Unchecked
binGrowA binary(384) Unchecked
binSkillA binary(384) Unchecked
blobQUEST binary(1024) Checked
blobINV binary(2048) Unchecked
binHotICON binary(96) Checked
dwDelTIME int Checked
binWishLIST binary(256) Checked
dwOPTION int Checked
intJOB smallint Unchecked
dwRegTIME int Unchecked
dwPartyIDX int Checked
dwItemSN int Checked
intDataVER smallint Unchecked
txtCharName nvarchar(30) Checked
binSkillB binary(240) Checked
Unchecked
What I have tried:
i been trying to figure why i keep getting problem for days and can't seem to figure it out any one able to help on this please and thank you