Skip to content

Netcode v2.5.0 Broke Network List #3618

@AliasgarBohra

Description

@AliasgarBohra

Everything used to work fine in v2.4.4. Suddenly changing network list struct value is not triggering change event in any client nor host. Nothing works. Add and Remove events triggers but change event does not. My project used to work fine on earlier version, I just upgraded and it broke

Reproduce Steps

  1. Just try updating networklist data, the change event will not get triggered

Actual Outcome

OnListUpdate change event does not get triggered

Expected Outcome

OnListUpdate change event should get triggered

Environment

  • OS: Windows 11
  • Unity Version: 6000.0.56
  • Netcode Version: 2.5.0
  • Netcode Commit: [e.g. https://github.com/Unity-Technologies/com.unity.netcode.gameobjects/commit/ba418fa5b600ad9eb61fab0575f12fbecc2c6520]
  • Netcode Topology: [e.g. Client-Server, Distributed Authority, etc.]

Additional Context

My Code:

PlayerData data = playerDataHandler.GetPlayerData(networkManager.LocalClientId);
data.runtimeData.isReadyInLobby = !data.runtimeData.isReadyInLobby;

playerDataHandler.UpdatePlayerData(data);

//Updation
public void UpdatePlayerData(PlayerData data)
{
if (IsServer)
{
UpdateData(data.runtimeData);
}
else
{
UpdatePlayerDataRpc(data.runtimeData);
}
}

[Rpc(SendTo.Server)]
private void UpdatePlayerDataRpc(PlayerRuntimeData data)
{
    UpdateData(data);
}
private void UpdateData(PlayerRuntimeData data)
{
    if (playerDataIndexMap != null &&
        playerDataIndexMap.TryGetValue(data.clientId, out int index))
    {
        playerRuntimeDataList[index] = data;
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    stat:awaiting-responseAwaiting response from author. This label should be added manually.stat:awaiting-triageStatus - Awaiting triage from the Netcode team.type:bugBug Report

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions