persister cleanup (still broke but logic is there for when it isn't); also replace all the SOE BS for forwarding stl port with native object classes because i thought that may be part of the problem...

This commit is contained in:
DarthArgus
2016-12-10 23:17:06 +00:00
parent 688ab3fc9e
commit 8e94519082
450 changed files with 1287 additions and 1494 deletions
@@ -32,7 +32,7 @@ public:
void setExperience (const NetworkId &objectId, const std::string &experienceType, int value);
void removeExperience (const NetworkId &objectId, std::string experienceType);
bool getExperienceForObject (const NetworkId &objectId, stdvector<std::pair<std::string, int> >::fwd &values) const;
bool getExperienceForObject (const NetworkId &objectId, std::vector<std::pair<std::string, int> > &values) const;
private:
void addRowToIndex (const NetworkId &objectId, const std::string &experienceType, DBSchema::ExperiencePointRow *row);
@@ -37,7 +37,7 @@ public:
void setManufactureSchematicAttribute (const NetworkId &objectId, std::string attributeType, float value);
void removeManufactureSchematicAttribute (const NetworkId &objectId, std::string attributeType);
bool getDataForObject (const NetworkId &objectId, stdvector<std::pair<std::string, float> >::fwd &values) const;
bool getDataForObject (const NetworkId &objectId, std::vector<std::pair<std::string, float> > &values) const;
private:
void addRowToIndex (NetworkId objectId, std::string attributeType, DBSchema::ManufactureSchematicAttributeRow *row);
@@ -162,7 +162,7 @@ void ObjectTableBuffer::getTags(DB::TagSet &tags) const
// ----------------------------------------------------------------------
void ObjectTableBuffer::getObjectList(stdvector<NetworkId>::fwd &theList) const
void ObjectTableBuffer::getObjectList(std::vector<NetworkId> &theList) const
{
typedef std::map <NetworkId, DFSNode> NodesType;
NodesType nodes;
@@ -761,7 +761,7 @@ void ObjectTableBuffer::getWorldContainers(std::vector<NetworkId> &containers) c
// ----------------------------------------------------------------------
bool ObjectTableBuffer::getMoneyFromOfflineObject(uint32 replyServer, NetworkId const & sourceObject, int amount, NetworkId const & replyTo, std::string const & successCallback, std::string const & failCallback, stdvector<int8>::fwd const & packedDictionary)
bool ObjectTableBuffer::getMoneyFromOfflineObject(uint32 replyServer, NetworkId const & sourceObject, int amount, NetworkId const & replyTo, std::string const & successCallback, std::string const & failCallback, std::vector<int8> const & packedDictionary)
{
DBSchema::ObjectBufferRow * const row=findRowByIndex(sourceObject);
if (!row)
@@ -53,14 +53,14 @@ public:
int encodeObjVarFreeFlags(const NetworkId & objectId) const;
void handlePackedObjvar(const NetworkId &objectId, int position, const std::string &objvarName, int typeId, const std::string &packedValue);
void getObjvarsForObject(const NetworkId &objectId, std::vector<DynamicVariableList::MapType::Command> &commands) const;
bool getMoneyFromOfflineObject(uint32 replyServer,NetworkId const & sourceObject, int amount, NetworkId const & replyTo, std::string const & successCallback, std::string const & failCallback, stdvector<int8>::fwd const & packedDictionary);
bool getMoneyFromOfflineObject(uint32 replyServer,NetworkId const & sourceObject, int amount, NetworkId const & replyTo, std::string const & successCallback, std::string const & failCallback, std::vector<int8> const & packedDictionary);
void newObject(const NetworkId &objectId, int templateId, Tag typeId);
// std::vector<NetworkId> queueForLoadWithContents(const stdvector<NetworkId>::fwd &oidList, DB::Session *session);
// std::vector<NetworkId> queueForLoadWithContents(const std::vector<NetworkId> &oidList, DB::Session *session);
void getObjectList(stdvector<NetworkId>::fwd &theList) const;
void getWorldContainers(stdvector<NetworkId>::fwd &containers) const;
void getObjectList(std::vector<NetworkId> &theList) const;
void getWorldContainers(std::vector<NetworkId> &containers) const;
void getTags(DB::TagSet &tags) const;
virtual bool save(DB::Session *session);
@@ -65,7 +65,7 @@ class ScriptBuffer : public AbstractTableBuffer
std::set<NetworkId> m_objectsToClear;
typedef stdmap<IndexKey, std::string>::fwd LoadedDataType;
typedef std::map<IndexKey, std::string> LoadedDataType;
LoadedDataType *m_loadedData; // data loaded from the database
};
@@ -43,7 +43,7 @@ void WaypointBuffer::setWaypoint(const NetworkId &objectId, const NetworkId &way
// ----------------------------------------------------------------------
bool WaypointBuffer::getWaypointsForObject(const NetworkId &objectId, stdvector<PersistableWaypoint>::fwd &values) const
bool WaypointBuffer::getWaypointsForObject(const NetworkId &objectId, std::vector<PersistableWaypoint> &values) const
{
DEBUG_FATAL(values.size()!=0,("Values vector should be empty on call to getWaypointForObject()\n"));
IndexType::const_iterator i ( m_data.lower_bound(IndexKey(objectId,NetworkId::cms_invalid)) );
@@ -32,7 +32,7 @@ public:
void setWaypoint (const NetworkId &objectId, const NetworkId &waypointId, const PersistableWaypoint &value);
void removeWaypoint (const NetworkId &objectId, const NetworkId &waypointId);
bool getWaypointsForObject(const NetworkId &objectId, stdvector<PersistableWaypoint>::fwd &values) const;
bool getWaypointsForObject(const NetworkId &objectId, std::vector<PersistableWaypoint> &values) const;
private:
struct IndexKey
@@ -397,7 +397,7 @@ void CommoditiesSnapshot::handleDeleteLocationMessage(CMDeleteLocationMessage &m
* ordinary (non-demand-load) containers. The live database will be checked
* for objects inside these objects.
*/
void CommoditiesSnapshot::getWorldContainers(stdvector<NetworkId>::fwd &containers) const
void CommoditiesSnapshot::getWorldContainers(std::vector<NetworkId> &containers) const
{
}
// ----------------------------------------------------------------------
@@ -57,7 +57,7 @@ public:
virtual bool saveToDB (DB::Session *session);
virtual bool load (DB::Session *session);
virtual void saveCompleted ();
virtual void getWorldContainers (stdvector<NetworkId>::fwd &containers) const;
virtual void getWorldContainers (std::vector<NetworkId> &containers) const;
virtual void handleCommoditiesDataMessage(const MessageDispatch::MessageBase & message);
virtual void startLoadAfterSaveComplete();
@@ -90,10 +90,10 @@ private:
virtual void decodeClientData(NetworkId const & objectId, Tag typeId, uint16 index, Archive::ReadIterator &bs, bool isBaseline);
virtual void decodeParentClientData(NetworkId const & objectId, Tag typeId, uint16 index, Archive::ReadIterator &bs, bool isBaseline);
virtual bool encodeParentClientData(NetworkId const & objectId, Tag typeId, stdvector<BatchBaselinesMessageData>::fwd &baselines) const;
virtual bool encodeClientData(NetworkId const & objectId, Tag typeId, stdvector<BatchBaselinesMessageData>::fwd &baselines) const;
virtual bool encodeServerData(NetworkId const & objectId, Tag typeId, stdvector<BatchBaselinesMessageData>::fwd &baselines) const;
virtual bool encodeSharedData(NetworkId const & objectId, Tag typeId, stdvector<BatchBaselinesMessageData>::fwd &baselines) const;
virtual bool encodeParentClientData(NetworkId const & objectId, Tag typeId, std::vector<BatchBaselinesMessageData> &baselines) const;
virtual bool encodeClientData(NetworkId const & objectId, Tag typeId, std::vector<BatchBaselinesMessageData> &baselines) const;
virtual bool encodeServerData(NetworkId const & objectId, Tag typeId, std::vector<BatchBaselinesMessageData> &baselines) const;
virtual bool encodeSharedData(NetworkId const & objectId, Tag typeId, std::vector<BatchBaselinesMessageData> &baselines) const;
private:
CommoditiesSnapshot(const CommoditiesSnapshot&); //disable
@@ -34,13 +34,13 @@ class ObjvarNameManager
DB::TaskRequest *saveNewNames();
private:
typedef stdunordered_map<std::string, int>::fwd NameToIdMapType;
typedef std::unordered_map<std::string, int> NameToIdMapType;
NameToIdMapType *m_nameToIdMap;
typedef stdunordered_map<int, std::string>::fwd IdToNameMapType;
typedef std::unordered_map<int, std::string> IdToNameMapType;
IdToNameMapType *m_idToNameMap;
typedef stdvector<std::pair<int, std::string> >::fwd NewNamesType;
typedef std::vector<std::pair<int, std::string> > NewNamesType;
NewNamesType *m_newNames;
int m_nextAvailableId;
@@ -108,7 +108,7 @@ void SwgPersister::moveToPlayer(const NetworkId &oid, const NetworkId &player, c
// ----------------------------------------------------------------------
void SwgPersister::getMoneyFromOfflineObject(uint32 replyServer, NetworkId const & sourceObject, int amount, NetworkId const & replyTo, std::string const & successCallback, std::string const & failCallback, stdvector<int8>::fwd const & packedDictionary)
void SwgPersister::getMoneyFromOfflineObject(uint32 replyServer, NetworkId const & sourceObject, int amount, NetworkId const & replyTo, std::string const & successCallback, std::string const & failCallback, std::vector<int8> const & packedDictionary)
{
SwgSnapshot * snapshot=nullptr;
@@ -26,7 +26,7 @@ class SwgPersister : public Persister
virtual void restoreCharacter(const NetworkId &playerId, const std::string &whoRequested);
virtual void undeleteItem(const NetworkId &itemId, const std::string &whoRequested);
virtual void moveToPlayer(const NetworkId &oid, const NetworkId &player, const std::string &whoRequested);
virtual void getMoneyFromOfflineObject(uint32 replyServer, NetworkId const & sourceObject, int amount, NetworkId const & replyTo, std::string const & successCallback, std::string const & failCallback, stdvector<int8>::fwd const & packedDictionary);
virtual void getMoneyFromOfflineObject(uint32 replyServer, NetworkId const & sourceObject, int amount, NetworkId const & replyTo, std::string const & successCallback, std::string const & failCallback, std::vector<int8> const & packedDictionary);
private:
SwgPersister();
@@ -1198,7 +1198,7 @@ void SwgSnapshot::startLoadAfterSaveComplete()
* ordinary (non-demand-load) containers. The live database will be checked
* for objects inside these objects.
*/
void SwgSnapshot::getWorldContainers(stdvector<NetworkId>::fwd &containers) const
void SwgSnapshot::getWorldContainers(std::vector<NetworkId> &containers) const
{
m_objectTableBuffer.getWorldContainers(containers);
}
@@ -1219,7 +1219,7 @@ void SwgSnapshot::handleBountyHunterTargetMessage (const BountyHunterTargetMessa
// ----------------------------------------------------------------------
void SwgSnapshot::getMoneyFromOfflineObject(uint32 replyServer, NetworkId const & sourceObject, int amount, NetworkId const & replyTo, std::string const & successCallback, std::string const & failCallback, stdvector<int8>::fwd const & packedDictionary)
void SwgSnapshot::getMoneyFromOfflineObject(uint32 replyServer, NetworkId const & sourceObject, int amount, NetworkId const & replyTo, std::string const & successCallback, std::string const & failCallback, std::vector<int8> const & packedDictionary)
{
// Object might be "offline" but still buffered. Try to handle it in memory first:
if (!m_objectTableBuffer.getMoneyFromOfflineObject(replyServer, sourceObject, amount, replyTo, successCallback, failCallback, packedDictionary))
@@ -89,13 +89,13 @@ public:
virtual bool send (GameServerConnection *connection) const;
// Misc game-specific persistence
void getMoneyFromOfflineObject (uint32 replyServer, NetworkId const & sourceObject, int amount, NetworkId const & replyTo, std::string const & successCallback, std::string const & failCallback, stdvector<int8>::fwd const & packedDictionary);
void getMoneyFromOfflineObject (uint32 replyServer, NetworkId const & sourceObject, int amount, NetworkId const & replyTo, std::string const & successCallback, std::string const & failCallback, std::vector<int8> const & packedDictionary);
// Saving and Loading:
virtual bool saveToDB(DB::Session *session);
virtual bool load (DB::Session *session);
virtual void saveCompleted ();
virtual void getWorldContainers (stdvector<NetworkId>::fwd &containers) const;
virtual void getWorldContainers (std::vector<NetworkId> &containers) const;
virtual void handleCommoditiesDataMessage(const MessageDispatch::MessageBase & message);
virtual void startLoadAfterSaveComplete();
@@ -219,10 +219,10 @@ protected:
virtual void decodeClientData(NetworkId const & objectId, Tag typeId, uint16 index, Archive::ReadIterator &bs, bool isBaseline);
virtual void decodeParentClientData(NetworkId const & objectId, Tag typeId, uint16 index, Archive::ReadIterator &bs, bool isBaseline);
virtual bool encodeParentClientData(NetworkId const & objectId, Tag typeId, stdvector<BatchBaselinesMessageData>::fwd &baselines) const;
virtual bool encodeClientData(NetworkId const & objectId, Tag typeId, stdvector<BatchBaselinesMessageData>::fwd &baselines) const;
virtual bool encodeServerData(NetworkId const & objectId, Tag typeId, stdvector<BatchBaselinesMessageData>::fwd &baselines) const;
virtual bool encodeSharedData(NetworkId const & objectId, Tag typeId, stdvector<BatchBaselinesMessageData>::fwd &baselines) const;
virtual bool encodeParentClientData(NetworkId const & objectId, Tag typeId, std::vector<BatchBaselinesMessageData> &baselines) const;
virtual bool encodeClientData(NetworkId const & objectId, Tag typeId, std::vector<BatchBaselinesMessageData> &baselines) const;
virtual bool encodeServerData(NetworkId const & objectId, Tag typeId, std::vector<BatchBaselinesMessageData> &baselines) const;
virtual bool encodeSharedData(NetworkId const & objectId, Tag typeId, std::vector<BatchBaselinesMessageData> &baselines) const;
void decodeClientBattlefieldMarkerObject(NetworkId const & objectId, uint16 index, Archive::ReadIterator &data, bool isBaseline);
void decodeClientBuildingObject(NetworkId const & objectId, uint16 index, Archive::ReadIterator &data, bool isBaseline);
@@ -53,7 +53,7 @@ namespace DBQuery
SaveMessageQuery(const SaveMessageQuery&); // disable
SaveMessageQuery& operator=(const SaveMessageQuery&); // disable
void convertMessageToUTF8(const stdvector<int8>::fwd & messageData, std::string & utf8Data) const;
void convertMessageToUTF8(const std::vector<int8> & messageData, std::string & utf8Data) const;
};
class AckMessageQuery : public DB::Query
@@ -109,7 +109,7 @@ namespace DBQuery
virtual DB::Query::QueryMode getExecutionMode() const;
virtual void getSQL(std::string &sql);
void convertUTF8ToMessage(const std::string & utf8Data, stdvector<int8>::fwd & messageData) const;
void convertUTF8ToMessage(const std::string & utf8Data, std::vector<int8> & messageData) const;
private:
std::vector<MessageRow> m_data;
@@ -79,7 +79,7 @@ OfflineMoneyCustomPersistStep::~OfflineMoneyCustomPersistStep()
// ----------------------------------------------------------------------
void OfflineMoneyCustomPersistStep::getMoneyFromOfflineObject(uint32 replyServer, NetworkId const & sourceObject, int amount, NetworkId const & replyTo, std::string const & successCallback, std::string const & failCallback, stdvector<int8>::fwd const & packedDictionary)
void OfflineMoneyCustomPersistStep::getMoneyFromOfflineObject(uint32 replyServer, NetworkId const & sourceObject, int amount, NetworkId const & replyTo, std::string const & successCallback, std::string const & failCallback, std::vector<int8> const & packedDictionary)
{
GetMoneyData * const data=new GetMoneyData;
data->m_replyServer=replyServer;
@@ -27,14 +27,14 @@ class OfflineMoneyCustomPersistStep : public CustomPersistStep
OfflineMoneyCustomPersistStep();
~OfflineMoneyCustomPersistStep();
void getMoneyFromOfflineObject(uint32 replyServer, NetworkId const & sourceObject, int amount, NetworkId const & replyTo, std::string const & successCallback, std::string const & failCallback, stdvector<int8>::fwd const & packedDictionary);
void getMoneyFromOfflineObject(uint32 replyServer, NetworkId const & sourceObject, int amount, NetworkId const & replyTo, std::string const & successCallback, std::string const & failCallback, std::vector<int8> const & packedDictionary);
virtual bool beforePersist (DB::Session *session);
virtual bool afterPersist (DB::Session *session);
virtual void onComplete ();
private:
typedef stdvector<OfflineMoneyCustomPersistStepNamespace::GetMoneyData*>::fwd GetMoneyRequestsType;
typedef std::vector<OfflineMoneyCustomPersistStepNamespace::GetMoneyData*> GetMoneyRequestsType;
GetMoneyRequestsType * const m_getMoneyRequests;
private:
@@ -19,7 +19,7 @@
class TaskSaveObjvarNames : public DB::TaskRequest
{
public:
typedef stdvector<std::pair<int, std::string> >::fwd NameList;
typedef std::vector<std::pair<int, std::string> > NameList;
public:
TaskSaveObjvarNames (const NameList &names);