04-22-2021, 10:26 PM
2 hours ago, Matt Hias said:
Hello.
me again.
i have another problem.
the cash tickets no longer work after about 3 hours
The chat says I have received cash.
but nothing is credited.
I've already tried different flags from Item but no solution
Can anyone help me?
Best regards
Don't think it will solve, but i've cleaned a little bit the code
bool do_ItemUse_CashTicket(CPC* ch, const CItemProto* itemproto)
{
CLCString TicketQuery(1024);
CDBCmd DBTicket;
DBTicket.Init(&gserver->m_dbauth);
int userIndex = ch->m_desc->m_index;
TicketQuery.Format("UPDATE bg_user SET cash = cash + 100 WHERE user_code = '%d'", userIndex);
DBTicket.SetQuery(TicketQuery);
if (!DBTicket.Update() || !DBTicket.MoveFirst())
{
LOG_INFO("CashTicket[100] Failed at USER_INDEX[%d]", userIndex);
return false;
}
LOG_INFO("CashTicket[100] Success at USER_INDEX[%d]", userIndex);
return true;
}
Indeed you should be able to hook the mysql error in case ... don't think is necessary by the way .. is a really simple code ...
didn't look in deep ... you should be able to catch the mysql error in case , and log it in a string. This should be how the hook code looks like, check out didn't test
mysql_error(&gserver.m_dbAuth);

