Resource Pool

Implemented a resource pool as a generic class -- Pool<T>.

The pool allows exclusive resources to be acquired and released in a thread safe manner.  If the pool does not have enough of a certain resource -- either because there's nothing currently in the pool or because all other resources are currently acquired -- it will call a user-supplied callback to obtain another resource.  It will do this until it reaches a configurable maximum (which may be unlimited), at which point incoming threads will block until a resource becomes available.
Scope Guard Addition

Added the ability to disengage a scope guard.  This prevents the scope guard's callback from being invoked when it goes out of scope.
MySQL Data Provider Rewrite

Entirely rewrote the MySQL Data Provider.  The old one was nowhere near as clean as I would've wanted, and had bugs -- segmentation faults et cetera -- that would crop up occasionally.  I suspect it was due to shoddy handling of prepared statement data structures, but the code wasn't worth debugging so I'll never know for sure.

The biggest problem was that its wrappers for the MySQL functions/data structures weren't clean or generic enough to prevent vast swathes of code from being reused, so many functions were almost literally copy/pastes of each other.

In rewriting I rectified this by writing a wrapper for the MYSQL_BIND structure that's comprehensive for my needs -- any code interacting with the MYSQL_BIND structure is 1-2 lines, rather than 10 or more as was previously common.

Rather than writing code to manage the connection pool directly, I offloaded that responsibility to the Pool<T> template class, a much better separation of responsibilities.

Rather than interacting with the MYSQL and MYSQL_STMT structures directly, I wrapped both of them -- in the Connection and PreparedStatement classes, respectively -- which -- for the majority of the code -- eliminated the need for messy and unwieldly branches on return codes.  Instead -- in true C++ style -- RAII and exceptions are used to handle errors.

I wrote wrappers that deal with the most common/repetitive tasks.  Because of the improved MYSQL_BIND wrapper, I was able to write a wrapper that transformed most of the functions that issue DML queries into a single line each.  The improved bind wrapper also removed repetitive code checking sizes and fiddling with pointers to extract strings/blobs -- that's all handled in a single function in get_buffer.cpp.

I also rewrote the GetDataProvider method to use C++ std::fstream instead of the CRT file I/O functions, and to be cleaner/better broken up overall.

Fiddled with the dp.mk makefile a bit beyond simply updating the files that are built.  It didn't make sense for the libmysqlclient library to be assigned to the DP_LIB variable, since not only is it only used in one place, the idea of the data provider paradigm is that data providers may be built ontop of many different sources -- not just MySQL.

Changed the DataProvider interface over to using purpose-written structures for containing information from its GetInfo method, as is the norm throughout the rest of the code base.
Data Provider Information Provider Update

Updated the data provider information provider to reflect the changes to the DataProvider interface.

I had to rename the module's class from DataProviderInfo to DPInfo, because one of the structures that the DataProvider uses to transport information has that name.
Merge branch 'mysql_rewrite'

Rewrote the MySQL data provider because it was a total mess (and had bugs).

Tweaked the DataProvider interface slightly to be more consistent with the style/patterns used throughout the rest of the project.
Merge branch 'linux'

Merged the changes made in rewriting the Linux/POSIX network stack as these changes are now fully compatible with the Windows network stack.
Makefile Tweaks

Added phony targets for all commands and all information providers.
Makefile Organization

Moved all Windows-specific makefiles and supporting scripts to build/windows.  When a build on windows is desired, running build.bat in the root directory will copy these files and then invoke make.  When a build on linux is desired, running build.sh in the root directory will perform a similar action for the linux makefiles.
Build Script Cleanup

Removed the mkdir_nofail.sh script.  This script was once part of the linux build system, but is no longer needed.
Plugin Message Module Fix

Fixed the plugin message module to no longer reference/use SendHandles -- which have been removed.  The module now properly passes through the Promise<bool> from the send it performs -- if any.
MySQL Fix

Fixed a latent bug in the MySQL Data Provider, specifically in the Connection::set method -- which sets options on a MYSQL structure before connection.

The only thing that method is currently used for is setting the MYSQL_OPT_RECONNECT option, however the method takes an enum mysql_option parameter, and can therefore -- in theory -- be used to set any option prior to connection.

Due to an oversight, however, the enum mysql_option parameter was ignored, and MYSQL_OPT_RECONNECT was unconditionally passed through to the mysql_options function.

Due to the limited manner in which this function is currently used this caused no problems, as the function behaved as expected, however going forward this could've caused confusion and was not intended.
World Module Maintenance Update

Updated the World module to use the SaveManager for its maintenance cycle, rather than needlessly implementing its own maintenance loop, with associated configuration et cetera.

This also simplified the maintenance code -- the SaveManager panics the server whenever any of its callbacks throw, so there's no need for the World module's maintenance routine to handle this internally.
World Events Fix

I was previously under the impression that C-style arrays -- which the World module uses to store its event handlers -- required manual memory management when used for non-trivial objects.  This is not the case.  Accordingly the code I'd written to perform this manual memory management has been removed.
World Save Compression

Modified the World module's save and load routines to zlib deflate and inflate column data, respectively.  This reduces the amount of data saved in the backing store by about 80x in my tests.

Since communicating with the backing store -- whether a database or directly to disk -- is in most cases the bottleneck, this accelerates that process.  It also keeps the size of the world on disk from getting out of hand, as it was liable to previously.
ClientListIterator Improvements

Added a move constructor and assignment operator to the ClientListIterator class.  This cuts the number of lock operations performed by these iterators approximately in half.

Also added a check for assignment to self in the copy constructor, and centralized/generalized the cleanup code.
Server Uninitialized Pointers Fix

Added initialization for two pointers in the Server class.
Server Shutdown Changes

Cleaned up some shutdown-related code inside the Server class.

Previously it was possible for multiple concurrent shutdown operations to proceed simultaneously, with each one launching a worker thread, attempting to shut the server down, and then all but the first bailing out after discovering the server was already shut down.

Now each successive request to shutdown will see that a shutdown is in process, and bail out immediately, without the overhead of creating a worker thread.

Cleaned up the way in which locking/waiting is handled with respect to the shutdown process.
ClientList Fix

Fixed a race condition in the ClientList class:

Previously, when creating start/end iterators, the ClientList class did not acquire the read lock, leaving that for the ClientListIterator instance it was creating.

However, in invoking the ClientListIterator constructor, the begin or end method (as applicable) of the ClientList's internal std::unordered_set must be invoked to get iterators for the ClientListIterator to wrap.  It was therefore possible for the std::unordered_set to be modified between when these iterators were created and when the ClientListIterator instance acquired the read lock.

Accordingly, the creation of these iterators is now guarded by the read lock.
Windows Network Stack Fix

Fixed a race condition within the Windows network stack:

The Windows network stack uses the MCPP::NetworkImpl::ReferenceManager class internally, to ensure that asynchronous callbacks dispatched due to events on connected sockets do not try and access the ConnectionHandler after it has been destroyed.

Accordingly, the ConnectionHandler destructor waits on the RefereneceManager.

However, there was a race condition -- the ReferenceManager::End method did not properly wake the ReferenceManager's internal condition variable if the count variable reached zero -- and therefore if the ConnectionHandler destructor attempted to wait on the ReferenceManager while a reference was still held by an asynchronous callback, the destructor would be stuck waiting indefinitely.