Add network error log for missing network object when accessing ownership
#1066
This commit is contained in:
@@ -878,9 +878,16 @@ uint32 NetworkReplicator::GetObjectOwnerClientId(const ScriptingObject* obj)
|
|||||||
{
|
{
|
||||||
if (item.HasOwnership)
|
if (item.HasOwnership)
|
||||||
id = item.OwnerClientId;
|
id = item.OwnerClientId;
|
||||||
|
#if USE_NETWORK_REPLICATOR_LOG
|
||||||
|
return id;
|
||||||
|
#else
|
||||||
break;
|
break;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#if USE_NETWORK_REPLICATOR_LOG
|
||||||
|
NETWORK_REPLICATOR_LOG(Error, "[NetworkReplicator] Failed to get ownership of unregistered network object {} ({})", obj->GetID(), obj->GetType().ToString());
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return id;
|
return id;
|
||||||
@@ -903,9 +910,16 @@ NetworkObjectRole NetworkReplicator::GetObjectRole(const ScriptingObject* obj)
|
|||||||
{
|
{
|
||||||
if (item.HasOwnership)
|
if (item.HasOwnership)
|
||||||
role = item.Role;
|
role = item.Role;
|
||||||
|
#if USE_NETWORK_REPLICATOR_LOG
|
||||||
|
return role;
|
||||||
|
#else
|
||||||
break;
|
break;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#if USE_NETWORK_REPLICATOR_LOG
|
||||||
|
NETWORK_REPLICATOR_LOG(Error, "[NetworkReplicator] Failed to get ownership of unregistered network object {} ({})", obj->GetID(), obj->GetType().ToString());
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return role;
|
return role;
|
||||||
|
|||||||
Reference in New Issue
Block a user