Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

Networking HLAPI ClientRPC is received in reverse order

Discussion in '5.1 Beta' started by PhobicGunner, May 19, 2015.

  1. PhobicGunner

    PhobicGunner

    Joined:
    Jun 28, 2011
    Posts:
    1,813
    Just discovered that it seems RPCs which are buffered are dispatched in reverse order. This code on a network behavior which is spawned as part of the player object system:

    Code (csharp):
    1.  
    2. void Start()
    3. {
    4.     if( NetworkServer.active )
    5.     {
    6.         for( int i = 0; i < 20; i++ )
    7.         {
    8.                 RpcTest( i );
    9.         }
    10.     }
    11. }
    12.  
    13. [ClientRpc( channel = Channels.DefaultReliable )]
    14. public void RpcTest( int index )
    15. {
    16.     Debug.Log( index );
    17. }
    18.  
    Logs the following output to the console:

    Expected output should be in order from 0 to 19, as "Reliable" should guarantee message order.
    Seems messages are buffered and then dispatched LIFO, when they should be dispatched FIFO instead.
     
  2. seanr

    seanr

    Unity Technologies

    Joined:
    Sep 22, 2014
    Posts:
    669
    bug 698103 filed on this.

    This happens on LocalClients only.