diff --git a/src/eve-server/manufacturing/FactoryDB.cpp b/src/eve-server/manufacturing/FactoryDB.cpp index 23121c048..0df885c1e 100644 --- a/src/eve-server/manufacturing/FactoryDB.cpp +++ b/src/eve-server/manufacturing/FactoryDB.cpp @@ -257,7 +257,7 @@ PyRep *FactoryDB::AssemblyLinesSelectPublic(const uint32 regionID) { DBQueryResult res; if (!sDatabase.RunQuery(res, - "SELECT" + "SELECT DISTINCT" " station.stationID AS containerID," " station.stationTypeID AS containerTypeID," " station.solarSystemID AS containerLocationID," @@ -283,13 +283,14 @@ PyRep *FactoryDB::AssemblyLinesSelectPersonal(const uint32 charID) { DBQueryResult res; if (!sDatabase.RunQuery(res, - "SELECT" + "SELECT DISTINCT" " station.stationID AS containerID," " station.stationTypeID AS containerTypeID," " station.solarSystemID AS containerLocationID," " station.assemblyLineTypeID," " station.quantity," - " station.ownerID" + " station.ownerID," + " line.activityID" " FROM ramAssemblyLineStations AS station" " LEFT JOIN ramAssemblyLines AS line ON station.stationID = line.containerID AND station.assemblyLineTypeID = line.assemblyLineTypeID AND station.ownerID = line.ownerID" " WHERE station.ownerID = %u" @@ -307,13 +308,14 @@ PyRep *FactoryDB::AssemblyLinesSelectPrivate(const uint32 charID) { DBQueryResult res; if (!sDatabase.RunQuery(res, - "SELECT" + "SELECT DISTINCT" " station.stationID AS containerID," " station.stationTypeID AS containerTypeID," " station.solarSystemID AS containerLocationID," " station.assemblyLineTypeID," " station.quantity," - " station.ownerID" + " station.ownerID," + " line.activityID" " FROM ramAssemblyLineStations AS station" " LEFT JOIN ramAssemblyLines AS line ON station.stationID = line.containerID AND station.assemblyLineTypeID = line.assemblyLineTypeID AND station.ownerID = line.ownerID" " WHERE station.ownerID = %u", @@ -331,13 +333,14 @@ PyRep *FactoryDB::AssemblyLinesSelectCorporation(const uint32 corpID) { DBQueryResult res; if (!sDatabase.RunQuery(res, - "SELECT" + "SELECT DISTINCT" " station.stationID AS containerID," " station.stationTypeID AS containerTypeID," " station.solarSystemID AS containerLocationID," " station.assemblyLineTypeID," " station.quantity," - " station.ownerID" + " station.ownerID," + " line.activityID" " FROM ramAssemblyLineStations AS station" " LEFT JOIN ramAssemblyLines AS line ON station.stationID = line.containerID AND station.assemblyLineTypeID = line.assemblyLineTypeID AND station.ownerID = line.ownerID" " WHERE station.ownerID = %u" @@ -355,14 +358,29 @@ PyRep *FactoryDB::AssemblyLinesSelectCorporation(const uint32 corpID) { PyRep *FactoryDB::AssemblyLinesSelectAlliance(const int32 allianceID) { DBQueryResult res; + // This produces the same output but with less complex joins and + // the quantity column is completely redundant. + // SELECT + // job.containerId, + // station.stationTypeId AS containerTypeId, + // station.solarSystemId AS containerLocationId, + // job.typeId as assemblyLineTypeId, + // COUNT(job.containerId) as quantity, + // station.corporationId as ownerId + // FROM industrySlots AS job + // JOIN evemu.staStations AS station ON station.stationId = job.containerId + // JOIN evemu.crpCorporation AS corp ON corp.corporationId = station.corporationId + // GROUP BY job.containerId, job.typeId; + if (!sDatabase.RunQuery(res, - "SELECT" + "SELECT DISTINCT" " station.stationID AS containerID," " station.stationTypeID AS containerTypeID," " station.solarSystemID AS containerLocationID," " station.assemblyLineTypeID," " station.quantity," - " station.ownerID" + " station.ownerID," + " line.activityID" " FROM ramAssemblyLineStations AS station" " LEFT JOIN crpCorporation AS crp ON station.ownerID = crp.corporationID" " LEFT JOIN ramAssemblyLines AS line ON station.stationID = line.containerID AND station.assemblyLineTypeID = line.assemblyLineTypeID AND station.ownerID = line.ownerID" diff --git a/src/eve-server/ship/ShipService.cpp b/src/eve-server/ship/ShipService.cpp index 818c2a277..0f24a9f46 100644 --- a/src/eve-server/ship/ShipService.cpp +++ b/src/eve-server/ship/ShipService.cpp @@ -945,6 +945,7 @@ PyResult ShipBound::Jettison(PyCallArgs &call, PyList* itemIDs) { ccRef->Move(pClient->GetLocationID(), flagNone, true); ContainerSE* cSE = new ContainerSE(ccRef, this->GetServiceManager(), pSysMgr, data); + cSE->Init(); location.MakeRandomPointOnSphere(500.0); cSE->SetPosition(location); ccRef->SaveItem(); @@ -1001,6 +1002,7 @@ PyResult ShipBound::Jettison(PyCallArgs &call, PyList* itemIDs) { throw CustomError ("Unable to spawn jetcan."); // create new container ContainerSE* cSE = new ContainerSE(jcRef, this->GetServiceManager(), pSysMgr, data); + cSE->Init(); jcRef->SetMySE(cSE); // set anchored to avoid deletion when empty diff --git a/src/eve-server/system/DestinyManager.cpp b/src/eve-server/system/DestinyManager.cpp index 37051ec1c..025ec26a6 100644 --- a/src/eve-server/system/DestinyManager.cpp +++ b/src/eve-server/system/DestinyManager.cpp @@ -3350,7 +3350,9 @@ void DestinyManager::SendDestinyUpdate( std::vector& updates, std::vec mySE->SystemMgr()->GetClientList(cv); for(auto const& value: cv) { - value->GetShipSE()->SysBubble()->BubblecastDestiny(updates, events, "destiny"); + if (value->GetShipSE() != nullptr) { + value->GetShipSE()->SysBubble()->BubblecastDestiny(updates, events, "destiny"); + } } } else if (mySE->SysBubble() != nullptr) { if (is_log_enabled(DESTINY__UPDATES)) {