Skip to content

Commit

Permalink
Minor Fixes (#301)
Browse files Browse the repository at this point in the history
* Minor Fixes

- Fixed a bug where jet cans and other deployables would not be visible to everyone until the system would reload.
- Fixed a crash upon trying to dock with an outpost.
- Fixed an issue with the science & industry tab loading too much data from outposts and POSs.

* - Fixing client error with outpost sci & industry
- Removed previously added Init()s to ShipService as they were untested.
  • Loading branch information
marsara9 authored Jan 9, 2025
1 parent 47980f6 commit a7bc9e3
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 10 deletions.
36 changes: 27 additions & 9 deletions src/eve-server/manufacturing/FactoryDB.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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,"
Expand All @@ -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"
Expand All @@ -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",
Expand All @@ -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"
Expand All @@ -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"
Expand Down
2 changes: 2 additions & 0 deletions src/eve-server/ship/ShipService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion src/eve-server/system/DestinyManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3350,7 +3350,9 @@ void DestinyManager::SendDestinyUpdate( std::vector<PyTuple*>& 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)) {
Expand Down

0 comments on commit a7bc9e3

Please sign in to comment.