- Home /
Question by
mickey-evers · May 28, 2018 at 05:52 PM ·
unity 5networkingtexturessynclobby
Networking lobby player image not working on host and other clients
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
Comment