Código:
if(gQueryManager.ExecQuery("SELECT ProductId,Information1,Information2,Status,PackageIndex,PlanIndex FROM License WHERE UserId=%d",UserId) != 0)
{
while(gQueryManager.Fetch() != SQL_NO_DATA)
{
char IpAddress[16] = {0};
char HardwareId[36] = {0};
int ProductId = gQueryManager.GetAsInteger("ProductId");
gQueryManager.GetAsString("Information1",IpAddress,sizeof(IpAddress));
gQueryManager.GetAsString("Information2",HardwareId,sizeof(HardwareId));
if(GetDatabaseProductId(lpMsg->ServerType) == ProductId && strcmp(gClientManager[index].m_IpAddr,IpAddress) == 0 && strcmp(lpMsg->CustomerHardwareId,HardwareId) == 0)
{
pMsg.Status = (BYTE)gQueryManager.GetAsInteger("Status");
pMsg.PackageType = (BYTE)gQueryManager.GetAsInteger("PackageIndex")+1;
pMsg.PlanType = (BYTE)gQueryManager.GetAsInteger("PlanIndex")+1;
memcpy(pMsg.CustomerName,lpMsg->CustomerName,sizeof(pMsg.CustomerName));
memcpy(pMsg.CustomerHardwareId,lpMsg->CustomerHardwareId,sizeof(pMsg.CustomerHardwareId));
break;
}
}
}
gQueryManager.Close();
}
gSocketManager.DataSend(index,(BYTE*)&pMsg,pMsg.size);
gQueryManager.ExecQuery("INSERT INTO AuthLog (IpAddress,CustomerName,HardwareId,Type,Version,Status,Date) VALUES ('%s','%s','%s',%d,%d,%d,getdate())",gClientManager[index].m_IpAddr,lpMsg->CustomerName,lpMsg->CustomerHardwareId,lpMsg->ServerType,0,pMsg.Status);
gQueryManager.Close();
Galera no caso esse em verelho e data base correto?
Criei Tabela License com todas as colunas de cima
e a tabela AuthLog correto?