* SDK Protocol
* Server sends its name to client
* ProfileManager
* Rename existing profile commands
* Add Upload Profile, Download Profile, and Get Active Profile commands
* SettingsManager
* Add Get, Set, and Save Settings commands
* NetworkServer
* Formatting cleanup
* Use per-controller threads for handling NetworkServer controller-specific packets to avoid delays from controller mutexes
* NetworkClient
* Formatting cleanup
* Update OpenRGB Plugin Interface to include functions for loading/saving profile JSON data into OpenRGB profiles
* Update ProfileManager to handle auto-load profiles (Exit, Open, Resume, Suspend) and move their settings to ProfileManager section
* Update ProfileManager to store profiles in "profiles" folder in .json format
* Update ProfileManager to store size profile in sizes.json
* Update ProfileManager to perform device UpdateMode/UpdateColors when loading profile
* Code cleanup of ProfileManager and profile-related code
* Bumped profile version to 3
* Loading a v1/v2 profile onto a device with brightness will work
* Loading a v3 profile onto a device without brightness also works
* Add profile version parameter to Get/SetModeDescription
Commit amended for code style and to update versioning by Adam Honse <calcprogrammer1@gmail.com>
Various commands in NetworkServer require extra data. However, if the
packet size is set to 0 for these, the code will skip over reading the
data in and allocating memory. This results in null dereferences.
This patch adds checks to the relevant commands to make sure they don't
continue reading a null pointer.
This patch resolves several bugs:
* NetworkServer would allocate various instances of `NetworkClientInfo`.
This is patched by deallocating the NetworkClientInfo when it's
listening thread ends in the `listen_done` section.
* Memory would be allocated for threads that wouldn't be freed. This
is resolved by detaching from the threads, so they no longer need to
be joined to be freed, and then freeing the memory as they finish.
* Thread-Safety issues involving `ServerClients` would result in stray
`NetworkClientInfo`'s not being removed from the list in certain
situations. This is resolved by used a mutex to lock access to this
from different threads.