0

I am trying to create a lobby for my game. I need to set a profile image for every player, but I can't send to texture from each player profile image to the server

anny sugestions?

I have tried using Command like this

    [Command]
    public void CmdPlayerProfile(byte[] test)
    {
        myBites.Add(test);
        profileImagebyte = test;
    }

The command function gets called in the OnClientEnterLobby

I am using a extra class to manage the SyncList

  public class LobbyPlayerImage : NetworkBehaviour
{
public class SyncListByte : SyncList<byte[]>
{
    protected override byte[] DeserializeItem(NetworkReader reader)
    {
        return reader.ReadBytesAndSize();
    }

    protected override void SerializeItem(NetworkWriter writer, byte[] item)
    {
   //     writer.Write(item, Buffer.ByteLength(item));
        writer.WriteBytesFull(item);
      //  writer.WriteBytesAndSize(item, Buffer.ByteLength(item));

    }
}
public SyncListByte myBites = new SyncListByte();

}

When I use this, I get an error saying my byte[] is to big

Programmer
  • 121,791
  • 22
  • 236
  • 328
Mickey Evers
  • 151
  • 2
  • 4
  • 12

0 Answers0