Search Unity

How to best send a 2D integer array to clients?

Discussion in 'Multiplayer' started by Doghelmer, Oct 23, 2016.

  1. Doghelmer

    Doghelmer

    Joined:
    Aug 30, 2014
    Posts:
    120
    I need to send an integer array to my clients on the network. This would be a very irregular thing (maybe as little as once per session), so bandwidth isn’t really a concern. This is how I've attempted it:

    int[,] myArray = new int[100,100];
    //...Fill Array ...
    RpcSendArray(myArray);

    This gives me the following error message:
    "UnityException: NetworkWriter used buffer is too big!"
    What would be the easiest method of sending this sort of data?
     
  2. Hayz0rx

    Hayz0rx

    Joined:
    Apr 2, 2016
    Posts:
    34
    Split it into smaller messages or use another netlib.