Removed AvatarClientData::checkAndSetHasReceivedFirstPackets boolean.
This is handled by the AvatarClientData::checkAndSetHasReceivedFirstPacketsFrom
set.
This should fix the issue where a persons avatar was occasionally not visible to others
for a long period of time. This was due to several factors:
1) When a new avatar was added to the simulation that identity packet was not broadcast to
other avatars on the server. This would rely on random logic to send the identity eventually.
This is fixed in this PR, by sending identity packets to all other clients when a new clients
arrive.
2) The random identity logic was not being executed if the sequence number check caused an update
to be skipped. This means the probability of sending a random packet was reduced significantly,
especially for clients that were loading geometry on entry. This was fixed by doing the random
check before sequence number check.
3) The 1/300 probably used in the check was too low, this was only a 63% chance of sending a identity
packet within 5 seconds. This was fixed by changing the probability to 1/187, which is a 80% chance
to send an identity packet within 5 seconds.
4) The randFloat() implementation slightly reduced the identity packet probability due to quantization errors.
This has been replaced by a C++ std random number generator.
This can happen when LogHandler::flushRepetedMessages is called on
the main thread, while the application is printing messages on
a separate thread. The access to the _lastRepeatedMessage QHash was
not guarded.
I've added two mutexes to guard access to both the repeatedMessage
hashes/regexes and the onlyOnceMessages/regexes. This will unfortunately
incur a performance hit for frequent debug logging, but that's better
then crashing.
Also, I've added the ability to print threadIDs as well as Process ids.
This is helpful when debugging multi-threaded access to shared variables.