public int deserialize(byte[] bytes, int index) { ByteReceiver br = new ByteReceiver(bytes, index); uniqueID = br.getInt(); color = br.getColor(); name = br.getString(); return(br.index); }
public override void ReceiveDataEvent(DataType type, PlayerInfo playerInfo, byte[] data, int index = 0) { base.ReceiveDataEvent(type, playerInfo, data, index); if (type == DataType.Text) { ByteReceiver r = new ByteReceiver(data, index); string message = r.getString(); textReceived(playerInfo, message); } }