Enable network object ids remapping for host or server too to fix custom object ids map
#3042
This commit is contained in:
@@ -483,7 +483,6 @@ void SetupObjectSpawnMessageItem(SpawnItem* e, NetworkMessage& msg)
|
|||||||
NetworkMessageObjectSpawnItem msgDataItem;
|
NetworkMessageObjectSpawnItem msgDataItem;
|
||||||
msgDataItem.ObjectId = item.ObjectId;
|
msgDataItem.ObjectId = item.ObjectId;
|
||||||
msgDataItem.ParentId = item.ParentId;
|
msgDataItem.ParentId = item.ParentId;
|
||||||
if (NetworkManager::IsClient())
|
|
||||||
{
|
{
|
||||||
// Remap local client object ids into server ids
|
// Remap local client object ids into server ids
|
||||||
IdsRemappingTable.KeyOf(msgDataItem.ObjectId, &msgDataItem.ObjectId);
|
IdsRemappingTable.KeyOf(msgDataItem.ObjectId, &msgDataItem.ObjectId);
|
||||||
@@ -1677,7 +1676,6 @@ void NetworkInternal::NetworkReplicatorUpdate()
|
|||||||
NETWORK_REPLICATOR_LOG(Info, "[NetworkReplicator] Despawn object ID={}", e.Id.ToString());
|
NETWORK_REPLICATOR_LOG(Info, "[NetworkReplicator] Despawn object ID={}", e.Id.ToString());
|
||||||
NetworkMessageObjectDespawn msgData;
|
NetworkMessageObjectDespawn msgData;
|
||||||
msgData.ObjectId = e.Id;
|
msgData.ObjectId = e.Id;
|
||||||
if (isClient)
|
|
||||||
{
|
{
|
||||||
// Remap local client object ids into server ids
|
// Remap local client object ids into server ids
|
||||||
IdsRemappingTable.KeyOf(msgData.ObjectId, &msgData.ObjectId);
|
IdsRemappingTable.KeyOf(msgData.ObjectId, &msgData.ObjectId);
|
||||||
@@ -1888,7 +1886,6 @@ void NetworkInternal::NetworkReplicatorUpdate()
|
|||||||
msgData.OwnerFrame = NetworkManager::Frame;
|
msgData.OwnerFrame = NetworkManager::Frame;
|
||||||
msgData.ObjectId = item.ObjectId;
|
msgData.ObjectId = item.ObjectId;
|
||||||
msgData.ParentId = item.ParentId;
|
msgData.ParentId = item.ParentId;
|
||||||
if (isClient)
|
|
||||||
{
|
{
|
||||||
// Remap local client object ids into server ids
|
// Remap local client object ids into server ids
|
||||||
IdsRemappingTable.KeyOf(msgData.ObjectId, &msgData.ObjectId);
|
IdsRemappingTable.KeyOf(msgData.ObjectId, &msgData.ObjectId);
|
||||||
@@ -1985,7 +1982,6 @@ void NetworkInternal::NetworkReplicatorUpdate()
|
|||||||
NetworkMessageObjectRpc msgData;
|
NetworkMessageObjectRpc msgData;
|
||||||
msgData.ObjectId = item.ObjectId;
|
msgData.ObjectId = item.ObjectId;
|
||||||
msgData.ParentId = item.ParentId;
|
msgData.ParentId = item.ParentId;
|
||||||
if (isClient)
|
|
||||||
{
|
{
|
||||||
// Remap local client object ids into server ids
|
// Remap local client object ids into server ids
|
||||||
IdsRemappingTable.KeyOf(msgData.ObjectId, &msgData.ObjectId);
|
IdsRemappingTable.KeyOf(msgData.ObjectId, &msgData.ObjectId);
|
||||||
|
|||||||
Reference in New Issue
Block a user