PyObject *CorporationDB::GetEveOwners() { DBQueryResult res; /*if (!sDatabase.RunQuery(res, " SELECT * FROM eveStaticOwners ")) { codelog(SERVICE__ERROR, "Error in query: %s", res.error.c_str()); return NULL; }*/ if( !sDatabase.RunQuery( res, "(SELECT" " itemID AS ownerID," " itemName AS ownerName," " 0 AS ownerNameID," " typeID" " FROM entity" " WHERE itemID < %u" " AND itemID NOT IN ( SELECT ownerID from eveStaticOwners ) )" " UNION ALL " "(SELECT" " ownerID, ownerName, 0 AS ownerNameID, typeID" " FROM eveStaticOwners)" " ORDER BY ownerID", EVEMU_MINIMUM_ID ) ) { codelog(SERVICE__ERROR, "Error in query: %s", res.error.c_str()); return NULL; } return DBResultToRowset(res); }
PyObject *LSCDB::LookupChars(const char *match, bool exact) { DBQueryResult res; std::string matchEsc; sDatabase.DoEscapeString(matchEsc, match); if (matchEsc == "__ALL__") { if(!sDatabase.RunQuery(res, "SELECT " " characterID, itemName AS characterName, typeID" " FROM character_" " LEFT JOIN entity ON characterID = itemID" " WHERE characterID >= 140000000")) { _log(SERVICE__ERROR, "Error in LookupChars query: %s", res.error.c_str()); return NULL; } } else { if(!sDatabase.RunQuery(res, "SELECT " " characterID, itemName AS characterName, typeID" " FROM character_" " LEFT JOIN entity ON characterID = itemID" " WHERE itemName %s '%s'", exact?"=":"RLIKE", matchEsc.c_str() )) { _log(SERVICE__ERROR, "Error in LookupChars query: %s", res.error.c_str()); return NULL; } } return DBResultToRowset(res); }
PyObject *CorporationDB::GetEveOwners() { DBQueryResult res; /*if (!sDatabase.RunQuery(res, " SELECT * FROM eveStaticOwners ")) { codelog(SERVICE__ERROR, "Error in query: %s", res.error.c_str()); return NULL; }*/ if(!sDatabase.RunQuery(res, "(SELECT" " itemID as ownerID," " itemName as ownerName," " typeID FROM entity" " WHERE itemId <140000000 AND itemID NOT IN(select ownerID from evestaticowners))" " UNION ALL " "(SELECT * FROM evestaticowners)" " ORDER BY ownerID")) { codelog(SERVICE__ERROR, "Error in query: %s", res.error.c_str()); return NULL; } return DBResultToRowset(res); }
PyObject *CorporationDB::ListStationCorps(uint32 station_id) { DBQueryResult res; if(!sDatabase.RunQuery(res, "SELECT " " corporationID,corporationName,description,shares,graphicID," " memberCount,ceoID,stationID,raceID,corporationType,creatorID," " hasPlayerPersonnelManager,tickerName,sendCharTerminationMessage," " shape1,shape2,shape3,color1,color2,color3,typeface,memberLimit," " allowedMemberRaceIDs,url,taxRate,minimumJoinStanding,division1," " division2,division3,division4,division5,division6,division7," " allianceID,deleted" " FROM corporation" //no idea what the criteria should be here... " WHERE stationID=%u", station_id )) { codelog(SERVICE__ERROR, "Error in query: %s", res.error.c_str()); return NULL; } return DBResultToRowset(res); }
PyRep *ConfigDB::GetDynamicCelestials(uint32 solarSystemID) { sLog.Error("ConfigDB::GetDynamicCelestials", "This query is intentionally made to yield an empty result. It must be re-worked to provide actual data!"); const std::string query = " SELECT " " `itemID`, " " `entity`.`typeID`, " " `invTypes`.`groupID`, " " `itemName`, " " 0, " // This field refers to the orbitID of the dynamic celestial and needs to be implemented " 0, " // This field refers to the boolean value of isConnector. It may signify some sort of mission jump bridge " `x`, " " `y`, " " `z` " " FROM `entity` JOIN `invTypes` ON `entity`.`typeID` = `invTypes`.`typeID`" " WHERE " " `locationID` = %u AND " // In the future, the locationID field needs to be constrained to being a solarSystemID " `groupID` = -1"; // This is set to -1 because we do not know what the ID(s) of dynamic celestials is/are. DBQueryResult result; DBResultRow currentRow; if (!sDatabase.RunQuery(result, query.c_str(), solarSystemID)) { codelog(SERVICE__ERROR, "Error in query: %s", result.error.c_str()); return NULL; } return DBResultToRowset(result); }
PyRep *RamProxyDB::AssemblyLinesGet(const uint32 containerID) { DBQueryResult res; if(!DBcore::RunQuery(res, "SELECT" " assemblyLineID," " assemblyLineTypeID," " containerID," " nextFreeTime," " costInstall," " costPerHour," " restrictionMask," " discountPerGoodStandingPoint," " surchargePerBadStandingPoint," " minimumStanding," " minimumCharSecurity," " minimumCorpSecurity," " maximumCharSecurity," " maximumCorpSecurity" " FROM ramAssemblyLines" " WHERE containerID = %u", containerID)) { _log(DATABASE__ERROR, "Failed to query assembly lines for container %u: %s.", containerID, res.error.c_str()); return NULL; } return DBResultToRowset(res); }
PyObject *ConfigDB::GetMap(uint32 solarSystemID) { DBQueryResult res; #ifndef WIN32 #warning a lot of missing data in GetMap #endif //how in the world do they get a list in the freakin rowset for destinations??? if(!sDatabase.RunQuery(res, "SELECT " " itemID," " itemName," " typeID," " groupID," " solarSystemID AS locationID," " x,y,z," " NULL AS orbitID," " NULL AS destinations," " NULL AS xMin," " NULL AS xMax," " NULL AS yMin," " NULL AS yMax," " NULL AS zMin," " NULL AS zMax," " NULL AS luminosity" " FROM mapDenormalize" " WHERE solarSystemID=%u", solarSystemID )) { codelog(SERVICE__ERROR, "Error in query: %s", res.error.c_str()); return NULL; } return DBResultToRowset(res); }
PyObject *CharacterDB::GetTopBounties() { DBQueryResult res; if(!sDatabase.RunQuery(res, "SELECT `characterID`, `itemName` as `ownerName`, `bounty`, `online` FROM character_ LEFT JOIN `entity` ON `characterID` = `itemID` WHERE `characterID` >= %u AND `bounty` > 0 ORDER BY `bounty` DESC LIMIT 0,100" , EVEMU_MINIMUM_ID)) { sLog.Error("CharacterDB", "Error in GetTopBounties query: %s", res.error.c_str()); return NULL; } return DBResultToRowset(res); }
PyRep *ConfigDB::GetTextsForGroup(const std::string & langID, uint32 textgroup) { DBQueryResult res; if (!sDatabase.RunQuery(res, "SELECT textLabel, `text` FROM intro WHERE langID = '%s' AND textgroup = %u", langID.c_str(), textgroup)) { codelog(SERVICE__ERROR, "Error in query: %s", res.error.c_str()); return NULL; } return DBResultToRowset(res); }
PyObject *AccountDB::GetEntryTypes() { DBQueryResult res; if(!sDatabase.RunQuery(res, "SELECT refTypeID AS entryTypeID,refTypeText AS entryTypeName,description FROM market_refTypes")) { sLog.Error("Account DB", "Error in query: %s", res.error.c_str()); return NULL; } return DBResultToRowset(res); }
PyObject *AccountDB::GetKeyMap() { DBQueryResult res; if(!sDatabase.RunQuery(res, "SELECT accountKey AS keyID,accountType AS keyType,accountName AS keyName,description FROM market_keyMap")) { sLog.Error("Account DB", "Error in query: %s", res.error.c_str()); return NULL; } return DBResultToRowset(res); }
PyObject *CharacterDB::GetOwnerNote(uint32 charID, uint32 noteID) { DBQueryResult res; if (!sDatabase.RunQuery(res, "SELECT note FROM chrOwnerNote WHERE ownerID = %u AND noteID = %u", charID, noteID)) { codelog(SERVICE__ERROR, "Error on query: %s", res.error.c_str()); return (NULL); } return DBResultToRowset(res); }
PyObject *MapDB::GetPseudoSecurities() { DBQueryResult res; if(!sDatabase.RunQuery(res, "SELECT solarSystemID, security FROM mapSolarSystems")) { codelog(SERVICE__ERROR, "Error in query: %s", res.error.c_str()); return NULL; } return DBResultToRowset(res); }
PyRep *CorporationDB::GetMyShares(uint32 charID) { DBQueryResult res; if (!sDatabase.RunQuery(res, " SELECT corporationID, shares " " FROM crpcharshares " " WHERE characterID = %u ", charID)) { codelog(SERVICE__ERROR, "Error in query: %s", res.error.c_str()); return NULL; } return DBResultToRowset(res); }
PyRep *MarketDB::GetPlayerItemsInStation( uint32 characterID, uint32 stationID ) { // Hack into NULL DBQueryResult res; if(!sDatabase.RunQuery(res, "SELECT itemID, itemName, typeID, ownerID, locationID, flag, contraband, singleton, quantity, x, y, z, custominfo, 0 AS categoryID, 0 AS groupID FROM entity WHERE ownerID=%d && locationID=%d && flag=4", characterID, stationID)){ codelog( MARKET__ERROR, "Error in query: %s", res.error.c_str() ); return NULL; } return DBResultToRowset( res ); }
PyRep *RamProxyDB::GetJobs2(const uint32 ownerID, const bool completed, const uint64 fromDate, const uint64 toDate) { DBQueryResult res; if(!DBcore::RunQuery(res, "SELECT" " job.jobID," " job.assemblyLineID," " assemblyLine.containerID," " job.installedItemID," " installedItem.typeID AS installedItemTypeID," " installedItem.ownerID AS installedItemOwnerID," " blueprint.productivityLevel AS installedItemProductivityLevel," " blueprint.materialLevel AS installedItemMaterialLevel," // quite ugly, but lets us use DBResultToRowset " IF(assemblyLine.activityID = 1, blueprintType.productTypeID, installedItem.typeID) AS outputTypeID," " job.outputFlag," " job.installerID," " assemblyLine.activityID," " job.runs," " job.installTime," " job.beginProductionTime," " job.pauseProductionTime," " job.endProductionTime," " job.completedStatusID != 0 AS completed," " job.licensedProductionRuns," " job.installedInSolarSystemID," " job.completedStatusID AS completedStatus," " station.stationTypeID AS containerTypeID," " station.solarSystemID AS containerLocationID" " FROM srvRamJobs AS job" " LEFT JOIN srvEntity AS installedItem ON job.installedItemID = installedItem.itemID" " LEFT JOIN ramAssemblyLines AS assemblyLine ON job.assemblyLineID = assemblyLine.assemblyLineID" " LEFT JOIN srvInvBlueprints AS blueprint ON installedItem.itemID = blueprint.blueprintID" " LEFT JOIN invBlueprintTypes AS blueprintType ON installedItem.typeID = blueprintType.blueprintTypeID" " LEFT JOIN ramAssemblyLineStations AS station ON assemblyLine.containerID = station.stationID" " WHERE job.ownerID = %u" " AND job.completedStatusID %s 0" " AND job.installTime >= %" PRIu64 " AND job.endProductionTime <= %" PRIu64 " GROUP BY job.jobID" " ,job.assemblyLineID, assemblyLine.containerID, job.installedItemID, installedItemTypeID" " ,installedItemOwnerID, installedItemProductivityLevel, installedItemMaterialLevel, outputTypeID, job.outputFlag, job.installerID" " ,assemblyLine.activityID, job.runs, job.installTime, job.beginProductionTime, job.pauseProductionTime" " ,job.endProductionTime, completed, job.licensedProductionRuns, job.installedInSolarSystemID, completedStatus" " ,containerTypeID, containerLocationID", ownerID, (completed ? "!=" : "="), fromDate, toDate)) { _log(DATABASE__ERROR, "Failed to query jobs for owner %u: %s", ownerID, res.error.c_str()); return NULL; } return DBResultToRowset(res); }
PyRep *PosMgrDB::GetControlTowerFuelRequirements() { DBQueryResult res; if (!sDatabase.RunQuery(res, " SELECT " " controlTowerTypeID, resourceTypeID, purpose, quantity, factionID, minSecurityLevel " " FROM invControlTowerResources ")) { _log(SERVICE__ERROR, "Error in GetControlTowerFuelRequirements query: %s", res.error.c_str()); return (NULL); } return DBResultToRowset(res); }
PyRep *CorporationDB::GetMyApplications(uint32 charID) { DBQueryResult res; if (!sDatabase.RunQuery(res, " SELECT corporationID, characterID, applicationText, roles, grantableRoles, " " status, applicationDateTime, deleted, lastCorpUpdaterID " " FROM chrApplications " " WHERE characterID = %u ", charID)) { codelog(SERVICE__ERROR, "Error in query: %s", res.error.c_str()); return NULL; } return DBResultToRowset(res); }
PyRep *TutorialDB::GetAllCriterias() { DBQueryResult res; if(!sDatabase.RunQuery(res, "SELECT criteriaID, criteriaName, messageText, audioPath, 0 AS dataID" " FROM tutorial_criteria")) { _log(DATABASE__ERROR, "Error in query: %s", res.error.c_str()); return NULL; } return DBResultToRowset(res); }
PyRep* PaperDollDB::GetMyPaperDollData() const { DBQueryResult res; if (!sDatabase.RunQuery(res, " SELECT " " sculptLocationID, weightKeyCategory, weightKeyPrefix " " FROM paperdollsculptinglocations")) { _log(DATABASE__ERROR, "Error in GetMyPaperDollData query: %s", res.error.c_str()); return (NULL); } return DBResultToRowset(res); }
PyObject *SystemDB::ListFactions() { DBQueryResult res; if(!sDatabase.RunQuery(res, "SELECT " " factionID" " FROM chrFactions ")) { codelog(SERVICE__ERROR, "Error in query: %s", res.error.c_str()); return NULL; } return DBResultToRowset(res); }
PyRep *TutorialDB::GetTutorial(uint32 tutorialID) { DBQueryResult res; if(!DBcore::RunQuery(res, "SELECT tutorialID, tutorialName, nextTutorialID, 0 AS dataID" " FROM blkTutorials" " WHERE tutorialID=%u", tutorialID)) { _log(DATABASE__ERROR, "Error in query: %s", res.error.c_str()); return NULL; } return DBResultToRowset(res); }
PyObject *LSCDB::GetMailHeaders(uint32 recID) { DBQueryResult res; if(!sDatabase.RunQuery(res, "SELECT channelID, messageID, senderID, subject, created, `read` " " FROM eveMail " " WHERE channelID=%u", recID)) { codelog(SERVICE__ERROR, "Error in query: %s", res.error.c_str()); return NULL; } return DBResultToRowset(res); }
PyRep *TutorialDB::GetCategories() { DBQueryResult res; if(!sDatabase.RunQuery(res, "SELECT" " categoryID, categoryName, description, 0 AS dataID" " FROM tutorial_categories")) { _log(DATABASE__ERROR, "Error in query: %s", res.error.c_str()); return NULL; } return DBResultToRowset(res); }
PyRep *TutorialDB::GetTutorialCriterias(uint32 tutorialID) { DBQueryResult res; if(!sDatabase.RunQuery(res, "SELECT criteriaID" " FROM tutorials_criterias" " WHERE tutorialID=%u", tutorialID)) { _log(DATABASE__ERROR, "Error in query: %s", res.error.c_str()); return NULL; } return DBResultToRowset(res); }
PyObject *StandingDB::GetNPCStandings() { DBQueryResult res; if(!sDatabase.RunQuery(res, "SELECT " " fromID,toID,standing" " FROM npcStandings" )) { codelog(SERVICE__ERROR, "Error in query: %s", res.error.c_str()); return NULL; } return DBResultToRowset(res); }
PyObject *CorporationDB::GetStations(uint32 corpID) { DBQueryResult res; if (!sDatabase.RunQuery(res, " SELECT " " stationID, stationTypeID as typeID " " FROM staStations " " WHERE corporationID = %u ", corpID )) { codelog(SERVICE__ERROR, "Error in query: %s", res.error.c_str()); return NULL; } return DBResultToRowset(res); }
PyObject *CorporationDB::ListNPCDivisions() { DBQueryResult res; if(!sDatabase.RunQuery(res, "SELECT " " divisionID, divisionName, description, leaderType" " FROM crpNPCDivisions" )) { codelog(SERVICE__ERROR, "Error in query: %s", res.error.c_str()); return NULL; } return DBResultToRowset(res); }
PyObject *MapDB::GetStationServiceInfo() { DBQueryResult res; if(!sDatabase.RunQuery(res, "SELECT " " serviceID,serviceName" " FROM staServices" )) { codelog(SERVICE__ERROR, "Error in query: %s", res.error.c_str()); return NULL; } return DBResultToRowset(res); }
PyObject *MapDB::GetStationExtraInfo() { DBQueryResult res; if(!sDatabase.RunQuery(res, "SELECT " " stationID,solarSystemID,operationID,stationTypeID,corporationID AS ownerID" " FROM staStations" )) { codelog(SERVICE__ERROR, "Error in query: %s", res.error.c_str()); return NULL; } return DBResultToRowset(res); }