Browse Source

Fix clone loading race condition.

This happens on DirtSand shards when two avatars are loading the same age
at once. LoadCloneMsgs are dispatched to the clients before they have
loaded the original keys. The server has no way of knowing that however,
so this is the correct place to fix the problem.
Adam Johnson 12 years ago
parent
commit
7020624be4
  1. 6
      Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgrLoad.cpp

6
Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgrLoad.cpp

@ -105,6 +105,12 @@ plKey plNetClientMgr::ILoadClone(plLoadCloneMsg *pCloneMsg)
if(pCloneMsg->GetIsLoading()) if(pCloneMsg->GetIsLoading())
{ {
if (!cloneKey)
{
DebugMsg("ILoadClone: got a null clone key... either a loading race or someone is being naughty.");
return nullptr;
}
if (cloneKey->ObjectIsLoaded()) if (cloneKey->ObjectIsLoaded())
{ {
DebugMsg("ILoadClone: object %s is already loaded, ignoring", cloneKey->GetUoid().StringIze().c_str()); DebugMsg("ILoadClone: object %s is already loaded, ignoring", cloneKey->GetUoid().StringIze().c_str());

Loading…
Cancel
Save