Revert "fix race condition when persisting large numbers of items"

This reverts commit 7b1f5a9991.
This commit is contained in:
DarthArgus
2016-12-19 00:17:35 +00:00
parent 0f2f354214
commit 34ee420ae0
5 changed files with 11 additions and 24 deletions
@@ -405,7 +405,7 @@ void IntangibleObject::onPermanentlyDestroyed()
* Persists this object in the database. Will also persist all the objects it
* is keeping track of.
*/
bool IntangibleObject::persist()
void IntangibleObject::persist()
{
if (isAuthoritative() && isTheater())
{
@@ -413,11 +413,11 @@ bool IntangibleObject::persist()
{
// we are not finished creating our objects, prevent persistance
WARNING(true, ("IntangibleObject::persist called before all objects created"));
return false;
return;
}
if (isPersisted())
return true;
return;
ServerObject::persist();
@@ -471,15 +471,9 @@ bool IntangibleObject::persist()
}
}
return true;
}
else {
else
ServerObject::persist();
return true;
}
return false;
} // IntangibleObject::persist
//------------------------------------------------------------------------------------------
@@ -44,7 +44,7 @@ public:
virtual float alter(float time);
virtual void onPermanentlyDestroyed();
virtual bool persist();
virtual void persist();
virtual bool isVisibleOnClient (const Client & client) const;
virtual void getAttributes (std::vector<std::pair<std::string, Unicode::String> > &data) const;
virtual bool onContainerAboutToTransfer(ServerObject * destination, ServerObject* transferer);
@@ -3203,11 +3203,11 @@ void ServerObject::onRemovedFromTriggerVolume(TriggerVolume & triggerVolume)
* After this function is called, changes to this object will be sent to the database.
*/
bool ServerObject::persist()
void ServerObject::persist()
{
// Do not persist buildout objects (buildout objects have negative networkIds)
if (getNetworkId() < NetworkId::cms_invalid)
return false;
return;
if (isAuthoritative())
{
@@ -3221,7 +3221,7 @@ bool ServerObject::persist()
if (!contained && !isPlayerControlled() && getPosition_p() != Vector::zero)
{
WARNING_STRICT_FATAL(true, ("Tried to persist non-player object %s in a space scene away from the origin (not persisting).", getDebugInformation().c_str()));
return false;
return;
}
}
else
@@ -3244,15 +3244,11 @@ bool ServerObject::persist()
PositionUpdateTracker::sendPositionUpdate(*this);
}
return true;
}
else
{
sendControllerMessageToAuthServer(CM_persistObject, 0);
}
return false;
}
// ----------------------------------------------------------------------
@@ -297,7 +297,7 @@ public:
bool isInEndBaselines() const;
bool isNeedingPobFixup() const;
bool permanentlyDestroy (DeleteReasons::Enumerator reason);
virtual bool persist ();
virtual void persist ();
virtual void onRemovingFromWorld ();
virtual void unload ();
void moveToPlayerAndUnload (const NetworkId &player);
@@ -1125,11 +1125,8 @@ jboolean JNICALL ScriptMethodsObjectCreateNamespace::persistObject(JNIEnv *env,
ServerObject* object = nullptr;
if (!JavaLibrary::getObject(target, object))
return JNI_FALSE;
if (object->persist()) {
return JNI_TRUE;
} else {
return JNI_FALSE;
}
object->persist();
return JNI_TRUE;
} // JavaLibrary::persistObject
/**