The most important change is to use a timer that is based on a monotonic
clock in order to avoid time jumps and this inconsistent measurements
of time intervals (see
https://github.com/mumble-voip/mumble/issues/3985#issuecomment-601754212).
Furthermore the code-style has been adapted (m_ prefix instead of usage
of this->) and documentation has been added / extended.
This commit adds all the missing includes when the PCH header is not used.
Also, some includes are reordered and/or made consistent (e.g. "#include <QtEndian>" -> "#include <QtCore/QtEndian>").
According to Qt's documentation the PCH header doesn't need to be included.
From https://doc.qt.io/qt-5/qmake-precompiledheaders.html:
"To make your project use precompiled headers, you only need to define the PRECOMPILED_HEADER variable in your project file."
"qmake will handle the rest, to ensure the creation and use of the precompiled header file. You do not need to include the precompiled header file in HEADERS, as qmake will do this if the configuration supports precompiled headers."
The legacy implementation (with ctime), used when std::chrono is not available (C++ < 11), caused the client's messages to be permanently blocked until it reconnected.
More specifically, millisecondsBetween() always returned 0.
This commit replaces both implementations with a simpler one which makes use of QTime.
This adds messagelimit and messageburst to the configuration file murmur.ini as
well as the ability to set these live.
Though adjusting these live is entirely possible, they only take effect for new connections.
This patch adds a rate limiting to selected patches. The underlying rate limiter
used is the Leaky-Bucket algorithm. It allows for a burst of messages, but
limits them after a specified amount of messages within a time frame.
Places that use the QString() conversion operator
for Channel and ServerUser sometimes end up using
the QString move constructor, which doesn't take
const strings.
Example of an error:
Messages.cpp:1055:65: error: no viable conversion from 'Channel' to 'QString'
log(uSource, QString("Renamed channel %1 to %2").arg(QString(*c),
Fixes C++11 build on OS X (clang/libc++).
* uninitialized membervars,
* AudioOutput.cpp: fix delete on array to delete[]
* OSS.cpp: close file descriptor in false data case
* OverlayEditorScene.cpp: rm duplicate logic
* fix ifndef to match usage of declared variable
* member var initializations
* check for null (ds in d3d9 as some lines above),
* lower scope of var decl.,
* swap bufsize check and array dereference so check is before! deref,
* initialize member vars in constr.