Search Unity

Bug [1.0.8] A bug for netcode server debug

Discussion in 'NetCode for ECS' started by hxhloveunity, May 16, 2023.

  1. hxhloveunity

    hxhloveunity

    Joined:
    May 27, 2022
    Posts:
    37
    in server world,if you open netcode debug,then GhostSendSystem will not send any data:

    Code (CSharp):
    1. #if NETCODE_DEBUG
    2.             FixedString32Bytes packetDumpTimestamp = default;
    3.             if (!m_PacketLogEnableQuery.IsEmptyIgnoreFilter)
    4.             {
    5.                 state.CompleteDependency();
    6.                 NetDebugInterop.GetTimestamp(out packetDumpTimestamp);
    7.                 FixedString128Bytes worldNameFixed = state.WorldUnmanaged.Name;
    8.  
    9.                 foreach (var packet in SystemAPI.Query<AspectPacket>())
    10.                 {
    11.                     if (!m_ConnectionStateLookup.ContainsKey(packet.Entity)) { return; }
    12.  
    13.                     var conState = m_ConnectionStates[m_ConnectionStateLookup[packet.Entity]];
    14.                     if (conState.NetDebugPacket.IsCreated) { return; }
    15.  
    16.                     NetDebugInterop.InitDebugPacketIfNotCreated(ref conState.NetDebugPacket, ref m_LogFolder, ref worldNameFixed, packet.Id.ValueRO.Value);
    17.  
    18.                     m_ConnectionStates[m_ConnectionStateLookup[packet.Entity]] = conState;
    19.                     // Find connection state in the list sent to the serialize job and replace with this updated version
    20.                     for (int i = 0; i < connectionsToProcess.Length; ++i)
    21.                     {
    22.                         if (connectionsToProcess[i].Entity != packet.Entity)
    23.                         {
    24.                             continue;
    25.                         }
    26.                         connectionsToProcess[i] = conState;
    27.                         break;
    28.                     }
    29.                 }
    30.             }
    31. #endif
    when ConState.NetDebugPacket.IsCreated is true,it will return,so OnUpdate stop work。maybe change return to continue?
     
  2. NikiWalker

    NikiWalker

    Unity Technologies

    Joined:
    May 18, 2021
    Posts:
    316
    Hey hxhloveunity! Thanks for the report! This is a known issue, and I've just confirmed that we have not yet backported it. I'll backport it now.
     
    hxhloveunity likes this.