evemuproject/evemu_server — pull request #68 by aknorjaden (2013-04-15 00:48:50+00:00)
Title: Fixes Issue #64 - Modules all appear offline after a server restart

src/eve-server/ship/Ship.cpp
* ShipGetState(): removed wrong commented out code and created and populated a std::vector to contain refs to all modules fitted to this ship, then inserted pairs for all modules on this ship into the dictionary for "shipState" as part of GetAllInfo call.

src/eve-server/ship/ModuleManager.h
* GetModuleListOfRefs() - new methods in both ModuleManager and ModuleContainer classes to return a std::vector of all modules fitted to the ship

src/eve-server/ship/ModuleManager.cpp
* GetModuleListOfRefs() - new methods in both ModuleManager and ModuleContainer classes to provide this list of modules' InventoryItemRefs to the caller
* ModuleManager constructor modified to call Online() or Offline() based on now loaded state of each module's InventoryItemRef 'AttrIsOnline' attribute

src/inventory/InventoryItem.cpp
* correctly and now fully defined InventoryItem::GetItemStatusRow() method that was returning 0 for all values in this PyPackedRow.

src/inventory/EVEAttributeMgr.h
* had to create a const version of the AttributeMap::HasAttribute() method to be allowed to be used in InventoryItem::GetItemStatusRow() method

src/inventory/EVEAttributeMgr.cpp
* created method for const version of HasAttribute() and added comments to it, its non-const version, and both const and non-const version of the GetAttribute() method to clarify that the code in each const vs non-const version of the methods MUST BE IDENTICAL as a warning to anyone making changes to make them the same way in both places, i hate const that you cannot just call one from the other, but have to have duplicate code. If anyone knows how to do that, please submit a change for it :)

src/eve-server/dogmaim/DogmaIMService.cpp
* nicely commented each section of the main dictionary that gets created as the response to the DogmaIMBound::Handle_GetAllInfo() service call
* no real extra functional code was needed here in order to fix this problem