Search Unity

RPC limitation

Discussion in 'Multiplayer' started by roberts, Jul 2, 2008.

  1. roberts

    roberts

    Joined:
    May 8, 2008
    Posts:
    24
    Hello :)

    is there any limitation for the size of strings used as attributes in RPC methods?
    I tried to pass string as parameter and it seems that large string will be accepted but the client will receive empty string.
     
  2. Der Dude

    Der Dude

    Joined:
    Aug 7, 2006
    Posts:
    213
    I could imagine that this might be limited by the standard UDP-Packet size (MTU). Which is usually about 1492 bytes over the internet. Of course you have to subtract all the information that is additionally sent with every RPC Call.

    If this is the case, then divide your string and send it piece by piece.
     
  3. larus

    larus

    Unity Technologies

    Joined:
    Oct 12, 2007
    Posts:
    280
    Strings can be 4096 bytes long and byte arrays are unlimited, as long as you got the memory for allocating it.

    If you exceed the string size limit you should get a warning and the string gets truncated.
     
  4. roberts

    roberts

    Joined:
    May 8, 2008
    Posts:
    24
    Thanks for answers!