本文整理汇总了C++中DBResultRow::GetUInt方法的典型用法代码示例。如果您正苦于以下问题:C++ DBResultRow::GetUInt方法的具体用法?C++ DBResultRow::GetUInt怎么用?C++ DBResultRow::GetUInt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DBResultRow
的用法示例。
在下文中一共展示了DBResultRow::GetUInt方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetJobVerifyProperties
bool RamProxyDB::GetJobVerifyProperties(const uint32 jobID, uint32 &ownerID, uint64 &endProductionTime, EVERamRestrictionMask &restrictionMask, EVERamCompletedStatus &status) {
DBQueryResult res;
if(!sDatabase.RunQuery(res,
"SELECT job.ownerID, job.endProductionTime, job.completedStatusID, line.restrictionMask"
" FROM ramJobs AS job"
" LEFT JOIN ramAssemblyLines AS line ON line.assemblyLineID = job.assemblyLineID"
" WHERE job.jobID = %u",
jobID))
{
_log(DATABASE__ERROR, "Unable to query completion properties for job %u: %s", jobID, res.error.c_str());
return false;
}
DBResultRow row;
if(!res.GetRow(row)) {
_log(DATABASE__ERROR, "No completion properties found for job %u.", jobID);
return false;
}
ownerID = row.GetUInt(0);
endProductionTime = row.GetUInt64(1);
status = (EVERamCompletedStatus)row.GetUInt(2);
restrictionMask = (EVERamRestrictionMask)row.GetUInt(3);
return true;
}
示例2: GetRequiredItems
bool RamProxyDB::GetRequiredItems(const uint32 typeID, const EVERamActivity activity, std::vector<RequiredItem> &into) {
DBQueryResult res;
if(!sDatabase.RunQuery(res,
"SELECT"
" material.requiredTypeID,"
" material.quantity,"
" material.damagePerJob,"
" IF(materialGroup.categoryID = 16, 1, 0) AS isSkill"
" FROM typeActivityMaterials AS material"
" LEFT JOIN invTypes AS materialType ON material.requiredTypeID = materialType.typeID"
" LEFT JOIN invGroups AS materialGroup ON materialType.groupID = materialGroup.groupID"
" WHERE material.typeID = %u"
" AND material.activityID = %d"
//this is needed as db is quite crappy ...
" AND material.quantity > 0",
typeID, (const int)activity))
{
_log(DATABASE__ERROR, "Failed to query data to build BillOfMaterials: %s.", res.error.c_str());
return false;
}
DBResultRow row;
while(res.GetRow(row))
into.push_back(RequiredItem(row.GetUInt(0), row.GetUInt(1), row.GetFloat(2), row.GetInt(3) ? true : false));
return true;
}
示例3: GetCurrentApplicationInfo
bool CorporationDB::GetCurrentApplicationInfo(uint32 charID, uint32 corpID, ApplicationInfo & aInfo) {
DBQueryResult res;
if (!sDatabase.RunQuery(res,
" SELECT "
" status, applicationText, applicationDateTime, roles, grantableRoles, lastCorpUpdaterID, deleted "
" FROM chrApplications "
" WHERE characterID = %u AND corporationID = %u ",
charID, corpID))
{
codelog(SERVICE__ERROR, "Error in query: %s", res.error.c_str());
aInfo.valid = false;
return false;
}
DBResultRow row;
if (!res.GetRow(row)) {
_log(DATABASE__ERROR, "There's no previous application.");
aInfo.valid = false;
return false;
}
aInfo.charID = charID;
aInfo.corpID = corpID;
aInfo.status = row.GetUInt(0);
aInfo.appText = row.GetText(1);
aInfo.appTime = row.GetUInt64(2);
aInfo.role = row.GetUInt64(3);
aInfo.grantRole = row.GetUInt64(4);
aInfo.lastCID = row.GetUInt(5);
aInfo.deleted = row.GetUInt(6);
aInfo.valid = true;
return true;
}
示例4: DBQueryResult
// ////////////////////// DGM_Type_Effects_Table Class ////////////////////////////
TypeEffectsList::TypeEffectsList(uint32 typeID)
{
//first get list of all effects from dgmTypeEffects table for the given typeID
DBQueryResult *res = new DBQueryResult();
ModuleDB::GetDgmTypeEffects(typeID, *res);
//counter
uint32 effectID = 0;
uint32 isDefault = 0;
uint32 total_effect_count = 0;
m_typeEffectsList.clear();
//go through and insert each effectID into the list
DBResultRow row;
while( res->GetRow(row) )
{
effectID = row.GetUInt(0);
isDefault = row.IsNull(1) ? 0 : row.GetUInt(1);
m_typeEffectsList.insert(std::pair<uint32,uint32>(effectID,isDefault));
total_effect_count++;
}
//cleanup
delete res;
res = NULL;
}
示例5: _Populate
void DGM_Type_Effects_Table::_Populate()
{
//first get list of all effects from dgmEffects table
DBQueryResult *res = new DBQueryResult();
ModuleDB::GetAllTypeIDs(*res);
//counter
TypeEffectsList * typeEffectsListPtr;
uint32 total_type_count = 0;
uint32 error_count = 0;
DBResultRow row;
while( res->GetRow(row) )
{
typeEffectsListPtr = new TypeEffectsList(row.GetUInt(0));
if( typeEffectsListPtr->GetEffectCount() > 0 )
m_TypeEffectsMap.insert(std::pair<uint32, TypeEffectsList *>(row.GetUInt(0),typeEffectsListPtr));
else
delete typeEffectsListPtr;
total_type_count++;
}
if( error_count > 0 )
sLog.Error("DGM_Type_Effects_Table::_Populate()","ERROR Populating the DGM_Type_Effects_Table memory object: %u of %u types failed to load!", error_count, total_type_count);
sLog.Log("DGM_Type_Effects_Table", "..........%u total type effect objects loaded", total_type_count);
//cleanup
delete res;
res = NULL;
}
示例6: GetAttributesFromAncestry
bool CharacterDB::GetAttributesFromAncestry(uint32 ancestryID, uint8 &intelligence, uint8 &charisma, uint8 &perception, uint8 &memory, uint8 &willpower) {
DBQueryResult res;
if (!sDatabase.RunQuery(res,
" SELECT "
" intelligence, charisma, perception, memory, willpower "
" FROM chrAncestries "
" WHERE ancestryID = %u ", ancestryID))
{
codelog(SERVICE__ERROR, "Error in query: %s", res.error.c_str());
return (false);
}
DBResultRow row;
if(!res.GetRow(row)) {
codelog(SERVICE__ERROR, "Failed to find ancestry information for ancestry %u", ancestryID);
return false;
}
intelligence += row.GetUInt(0);
charisma += row.GetUInt(1);
perception += row.GetUInt(2);
memory += row.GetUInt(3);
willpower += row.GetUInt(4);
return (true);
}
示例7: GetLocationByStation
bool CharacterDB::GetLocationByStation(uint32 staID, CharacterData &cdata) {
DBQueryResult res;
if (!sDatabase.RunQuery(res,
"SELECT "
" stationID, "
" solarSystemID, "
" constellationID, "
" regionID "
" FROM staStations"
" WHERE stationID = %u", staID))
{
codelog(SERVICE__ERROR, "Error in query: %s", res.error.c_str());
return (false);
}
DBResultRow row;
if(!res.GetRow(row)) {
codelog(SERVICE__ERROR, "Failed to find station %u", staID);
return false;
}
cdata.stationID = staID;
cdata.solarSystemID = row.GetUInt(1);
cdata.constellationID = row.GetUInt(2);
cdata.regionID = row.GetUInt(3);
return (true);
}
示例8: GetAssemblyLineVerifyProperties
bool RamProxyDB::GetAssemblyLineVerifyProperties(const uint32 assemblyLineID, uint32 &ownerID, double &minCharSecurity, double &maxCharSecurity, EVERamRestrictionMask &restrictionMask, EVERamActivity &activity) {
DBQueryResult res;
if(!sDatabase.RunQuery(res,
"SELECT"
" ownerID,"
" minimumCharSecurity,"
" maximumCharSecurity,"
" restrictionMask,"
" activityID"
" FROM ramAssemblyLines"
" WHERE assemblyLineID = %u",
assemblyLineID))
{
_log(DATABASE__ERROR, "Failed to query verify properties for assembly line %u: %s.", assemblyLineID, res.error.c_str());
return false;
}
DBResultRow row;
if(!res.GetRow(row)) {
_log(DATABASE__ERROR, "No verify properties found for assembly line %u.", assemblyLineID);
return false;
}
ownerID = row.GetUInt(0);
minCharSecurity = row.GetDouble(1);
maxCharSecurity = row.GetDouble(2);
restrictionMask = (EVERamRestrictionMask)row.GetUInt(3);
activity = (EVERamActivity)row.GetUInt(4);
return true;
}
示例9: GetAccountInformation
bool ServiceDB::GetAccountInformation( const char* username, const char* password, AccountInfo & account_info )
{
std::string _username = username;
std::string _escaped_username;
DBcore::DoEscapeString(_escaped_username, _username);
DBQueryResult res;
if (!DBcore::RunQuery(res, "SELECT accountID, password, hash, role, online, banned, logonCount, lastLogin FROM srvAccount WHERE accountName = '%s'", _escaped_username.c_str()))
{
SysLog::Error( "ServiceDB", "Error in query: %s.", res.error.c_str() );
return false;
}
DBResultRow row;
if (!res.GetRow( row )) {
// account not found, create new one if autoAccountRole is not zero (0)
if(EVEServerConfig::account.autoAccountRole > 0) {
uint32 accountID = CreateNewAccount( _username.c_str(), password, EVEServerConfig::account.autoAccountRole);
if( accountID > 0 ) {
// add new account successful, get account info again
bool ret = GetAccountInformation(username, password, account_info);
return ret;
}
else
return false;
}
else
return false;
}
/* when any of the text gets are NULL it will fail... I think.. */
account_info.id = row.GetUInt(0);
if (!row.IsNull(1))
account_info.password = row.GetText(1);
if (!row.IsNull(2))
account_info.hash = row.GetText(2);
account_info.name = _escaped_username;
account_info.role = row.GetUInt64(3);
account_info.online = row.GetBool(4);
account_info.banned = row.GetBool(5);
account_info.visits = row.GetUInt(6);
if (!row.IsNull(7))
account_info.last_login = row.GetText(7);
return true;
}
示例10: GetConstant
bool ServiceDB::GetConstant(const char *name, uint32 &into) {
DBQueryResult res;
std::string escaped;
DBcore::DoEscapeString(escaped, name);
if(!DBcore::RunQuery(res,
"SELECT"
" constantValue"
" FROM eveConstants"
" WHERE constantID='%s'",
escaped.c_str()
))
{
codelog(SERVICE__ERROR, "Error in query: %s", res.error.c_str());
return false;
}
DBResultRow row;
if(!res.GetRow(row)) {
codelog(SERVICE__ERROR, "Unable to find constant %s", name);
return false;
}
into = row.GetUInt(0);
return true;
}
示例11: GetDestinationStargateID
uint32 ServiceDB::GetDestinationStargateID(uint32 fromSystem, uint32 toSystem) {
DBQueryResult res;
if(!DBcore::RunQuery(res,
" SELECT "
" fromStargate.solarSystemID AS fromSystem,"
" fromStargate.itemID AS fromGate,"
" toStargate.itemID AS toGate,"
" toStargate.solarSystemID AS toSystem"
" FROM mapJumps AS jump"
" LEFT JOIN mapDenormalize AS fromStargate"
" ON fromStargate.itemID = jump.stargateID"
" LEFT JOIN mapDenormalize AS toStargate"
" ON toStargate.itemID = jump.celestialID"
" WHERE fromStargate.solarSystemID = %u"
" AND toStargate.solarSystemID = %u",
fromSystem, toSystem
))
{
codelog(SERVICE__ERROR, "Error in query: %s", res.error.c_str());
return(0);
}
DBResultRow row;
if(!res.GetRow(row)) {
codelog(SERVICE__ERROR, "Error in query: no data for %d, %d", fromSystem, toSystem);
return(0);
}
return row.GetUInt(2);
}
示例12: ItemSearch
bool CommandDB::ItemSearch(const char *query, std::map<uint32, std::string> &into) {
std::string escaped;
sDatabase.DoEscapeString(escaped, query);
DBQueryResult result;
DBResultRow row;
into.clear();
//we need to query out the primary message here... not sure how to properly
//grab the "main message" though... the text/plain clause is pretty hackish.
if (!sDatabase.RunQuery(result,
" SELECT typeID,typeName"
" FROM invTypes"
" WHERE"
" typeName rlike '%s'",
escaped.c_str()
))
{
codelog(SERVICE__ERROR, "Error in query: %s", result.error.c_str());
return (false);
}
while(result.GetRow(row)) {
into[row.GetUInt(0)] = row.GetText(1);
}
return true;
}
示例13: FullSkillList
bool CommandDB::FullSkillList(std::vector<uint32> &skillList) {
DBQueryResult result;
DBResultRow row;
skillList.clear();
if (!sDatabase.RunQuery(result,
" SELECT * FROM `invTypes` WHERE "
" ((`groupID` IN (SELECT groupID FROM invGroups WHERE categoryID = 16)) AND (published = 1)) "
))
{
codelog(SERVICE__ERROR, "Error in query: %s", result.error.c_str());
return (false);
}
while(result.GetRow(row)) {
skillList.push_back( (row.GetUInt(0)) );
}
// Because we searched skills with published = 1 and some GM skills are not published but still usable,
// we will add them manually here:
skillList.push_back( 3755 ); // Jove Frigate
skillList.push_back( 3758 ); // Jove Cruiser
skillList.push_back( 9955 ); // Polaris
skillList.push_back( 10264 ); // Concord
skillList.push_back( 11075 ); // Jove Industrial
skillList.push_back( 11078 ); // Jove Battleship
skillList.push_back( 19430 ); // Omnipotent
skillList.push_back( 28604 ); // Tournament Observation
return true;
}
示例14: DBResultToIntIntlistDict
/**
* this function isn't used.
*/
void DBResultToIntIntlistDict( DBQueryResult &result, std::map<int32, PyRep *> &into ) {
/* this builds a map from the int in result[0], to a list of each result[1]
* which is has the same result[0]. This function assumes the result is
* ORDER BY result[0]
*/
uint32 last_key = 0xFFFFFFFF;
PyList *l = NULL;
DBResultRow row;
while( result.GetRow( row ) )
{
uint32 k = row.GetUInt(0);
if( k != last_key )
{
//watch for overwrite, no guarantee we are dealing with a key.
std::map<int32, PyRep *>::iterator res = into.find(k);
if( res != into.end() )
//log an error or warning?
PyDecRef( res->second );
into[k] = l = new PyList();
last_key = k;
}
l->AddItemInt( row.GetInt( 1 ) );
}
}
示例15: FindSellOrder
uint32 MarketDB::FindSellOrder(
uint32 stationID,
uint32 typeID,
double price,
uint32 quantity,
uint32 orderRange
) {
DBQueryResult res;
if(!sDatabase.RunQuery(res,
"SELECT orderID"
" FROM market_orders"
" WHERE bid=0"
" AND typeID=%u"
" AND stationID=%u"
" AND volRemaining >= %u"
" AND price <= %f"
" ORDER BY price ASC"
" LIMIT 1", //right now, we just care about the first order which can satisfy our needs.
typeID,
stationID,
quantity,
price))
{
codelog(MARKET__ERROR, "Error in query: %s", res.error.c_str());
return false;
}
DBResultRow row;
if(!res.GetRow(row))
return(0); //no order found.
return(row.GetUInt(0));
}