Removed text packet type, added lock around modification of packets array.