Search Unity

Trouble with Unity Transport Simulator Pipeline

Discussion in 'Unity Transport' started by olejuer, Dec 30, 2019.

  1. olejuer

    olejuer

    Joined:
    Dec 1, 2014
    Posts:
    184
    Hi everyone,

    I am playing around with the new Unity transport package. And I am experiencing a weird issue with the simulator pipeline in combination with the reliability pipeline. When I connect a client so that a connection is created with an internalID that was used before, packages that are sent through a reliable simulator pipeline do not get through. To create the situation, I do the following.

    I setup a server driver using
    Code (CSharp):
    1. _serverDriver = new UdpNetworkDriver(new SimulatorUtility.Parameters
    2.             {
    3.                 MaxPacketCount = 30,
    4.                 PacketDropPercentage = 5,
    5.                 MaxPacketSize = 256,
    6.                 PacketDelayMs = 50
    7.             }, new ReliableUtility.Parameters {WindowSize = 32});
    and I create pipelines
    Code (CSharp):
    1. _unreliablePipeline = _serverDriver.CreatePipeline(typeof(SimulatorPipelineStage));
    2. _reliablePipeline = _serverDriver.CreatePipeline(typeof(ReliableSequencedPipelineStage), typeof(SimulatorPipelineStage));
    Then I connect a client and sending/receiving works fine. I can also connect another client, no problem. But then I disconnect a client. The next client will get ONE message send through the _reliablePipeline, but no more. Messages sent through the unreliable pipeline are received just fine. I think it might be because the connection reuses an old internalID and the state of the simulator pipeline is somehow messed up?

    I send messages using
    _serverDriver.Send(_reliablePipeline, connection, streamWriter);


    I tried getting a dump of the simulator pipeline using the instructions here https://docs.unity3d.com/Packages/com.unity.transport@0.2/manual/pipelines-usage.html , but the compiler will not let me perform the cast
    var simCtx = (SimulatorUtility.Context*)sharedBuffer.GetUnsafeReadOnlyPtr();
    , claiming SimulatorUtility.Context was a managed type, but it is a struct...

    Any ideas anyone? Thank you!
     
unityunity