mirror of
https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git
synced 2025-07-14 02:27:40 -04:00
Clone unloading
This commit is contained in:
@ -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();
|
plKey obj = object->getKey();
|
||||||
plUoid uoid = obj->GetUoid();
|
plUoid uoid = obj->GetUoid();
|
||||||
|
|
||||||
plLoadCloneMsg* cloneMsg;
|
plLoadCloneMsg* cloneMsg;
|
||||||
if (uoid.IsClone())
|
if (uoid.IsClone())
|
||||||
cloneMsg = new plLoadCloneMsg(obj, plNetClientMgr::GetInstance()->GetKey(), 0, true);
|
cloneMsg = new plLoadCloneMsg(obj, plNetClientMgr::GetInstance()->GetKey(), 0, loading);
|
||||||
else
|
else
|
||||||
cloneMsg = new plLoadCloneMsg(uoid, plNetClientMgr::GetInstance()->GetKey(), 0);
|
cloneMsg = new plLoadCloneMsg(uoid, plNetClientMgr::GetInstance()->GetKey(), 0);
|
||||||
|
|
||||||
if (netForce) {
|
cloneMsg->SetBCastFlag(plMessage::kNetPropagate);
|
||||||
cloneMsg->SetBCastFlag(plMessage::kNetPropagate);
|
cloneMsg->SetBCastFlag(plMessage::kNetForce);
|
||||||
cloneMsg->SetBCastFlag(plMessage::kNetForce);
|
|
||||||
}
|
|
||||||
|
|
||||||
cloneMsg->Send();
|
cloneMsg->Send();
|
||||||
|
|
||||||
return pyKey::New(cloneMsg->GetCloneKey());
|
return pyKey::New(cloneMsg->GetCloneKey());
|
||||||
|
@ -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;
|
PyObject* keyObj = NULL;
|
||||||
char netForce = 0;
|
char loading = 0;
|
||||||
if (!PyArg_ParseTuple(args, "O|b", &keyObj, &netForce) || !pyKey::Check(keyObj))
|
if (!PyArg_ParseTuple(args, "O|b", &keyObj, &loading) || !pyKey::Check(keyObj))
|
||||||
{
|
{
|
||||||
PyErr_SetString(PyExc_TypeError, "PtCloneKey expects a ptKey and bool");
|
PyErr_SetString(PyExc_TypeError, "PtCloneKey expects a ptKey and bool");
|
||||||
PYTHON_RETURN_ERROR;
|
PYTHON_RETURN_ERROR;
|
||||||
}
|
}
|
||||||
pyKey* key = pyKey::ConvertFrom(keyObj);
|
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")
|
PYTHON_GLOBAL_METHOD_DEFINITION(PtFindClones, args, "Params: key\nFinds all clones")
|
||||||
|
Reference in New Issue
Block a user