Browse Source

Clone unloading

Bartek Bok 14 years ago committed by Adam Johnson
parent
commit
57c600ce32
  1. 12
      Sources/Plasma/FeatureLib/pfPython/cyMisc.cpp
  2. 8
      Sources/Plasma/FeatureLib/pfPython/cyMiscGlue.cpp

12
Sources/Plasma/FeatureLib/pfPython/cyMisc.cpp

@ -2903,21 +2903,19 @@ void cyMisc::VaultDownload(unsigned nodeId)
);
}
PyObject* cyMisc::CloneKey(pyKey* object, bool netForce) {
PyObject* cyMisc::CloneKey(pyKey* object, bool loading) {
plKey obj = object->getKey();
plUoid uoid = obj->GetUoid();
plLoadCloneMsg* cloneMsg;
if (uoid.IsClone())
cloneMsg = new plLoadCloneMsg(obj, plNetClientMgr::GetInstance()->GetKey(), 0, true);
cloneMsg = new plLoadCloneMsg(obj, plNetClientMgr::GetInstance()->GetKey(), 0, loading);
else
cloneMsg = new plLoadCloneMsg(uoid, plNetClientMgr::GetInstance()->GetKey(), 0);
if (netForce) {
cloneMsg->SetBCastFlag(plMessage::kNetPropagate);
cloneMsg->SetBCastFlag(plMessage::kNetForce);
}
cloneMsg->SetBCastFlag(plMessage::kNetPropagate);
cloneMsg->SetBCastFlag(plMessage::kNetForce);
cloneMsg->Send();
return pyKey::New(cloneMsg->GetCloneKey());

8
Sources/Plasma/FeatureLib/pfPython/cyMiscGlue.cpp

@ -484,17 +484,17 @@ PYTHON_GLOBAL_METHOD_DEFINITION(PtDumpLogs, args, "Params: folder\nDumps all cur
}
}
PYTHON_GLOBAL_METHOD_DEFINITION(PtCloneKey, args, "Params: key, netForce=false\nCreates clone of key")
PYTHON_GLOBAL_METHOD_DEFINITION(PtCloneKey, args, "Params: key, loading=false\nCreates clone of key")
{
PyObject* keyObj = NULL;
char netForce = 0;
if (!PyArg_ParseTuple(args, "O|b", &keyObj, &netForce) || !pyKey::Check(keyObj))
char loading = 0;
if (!PyArg_ParseTuple(args, "O|b", &keyObj, &loading) || !pyKey::Check(keyObj))
{
PyErr_SetString(PyExc_TypeError, "PtCloneKey expects a ptKey and bool");
PYTHON_RETURN_ERROR;
}
pyKey* key = pyKey::ConvertFrom(keyObj);
return cyMisc::CloneKey(key, netForce);
return cyMisc::CloneKey(key, loading);
}
PYTHON_GLOBAL_METHOD_DEFINITION(PtFindClones, args, "Params: key\nFinds all clones")

Loading…
Cancel
Save