Added different macros, instead of using _MSC_VER. This one is added
even when Clang with MSVC runtime, so it's not viable to check if we're
compiling with MSVC.
Fixed: crash when moving a char in an area full of teleporters, or whichever items made the char move multiple times in the same tick.
Fixed: buffer read past the end in CCacheableScriptFile first reading.
Fixed: if a char had the COMM_CRYSTAL flag enabled, it called ::OnHear on every item in range, without checking if the item is actually capable of hearing.
Further optimized distance checks.
Separated the Github workflows into different files, in order to get a different badge for each build platform/type.
Dismissed AppVeyor build.
Added sphere_library/sfastmath.h.
Fixed twofish compilation error on Windows. That library wasn't really meant to be used as-is...
Made _GITVERSION define macro available only when enabling git versioning from CMake.
Modernized and fixed MSVC CMake toolchain.
Removed mariadb_version.h from git index.
Windows and OS X not yet tested.
Moved toolchains .inc files to include/ folder.
Renamed folder lib/bin into _bin.
Moved bcrypt and twofish library into lib folder and into new cmake projects. Restored twofish library to the original version.
Fixed some format warnings.
This will allow setting per-project (build) settings and to build/link
Sphere using system-provided library source/headers/precompiled lib
(like the ones provided with -devel packages on Linux) instead of the
ones shipped with the projects.
This is also a necessary step to use git submodules.
Added git branch info into sphere; branch and revision number are not displayed to players/clients (by default).
Fixed some MSVC warnings for WinMain definition and a Clang warning for wrapper_ev.c.
Immediately after server start, the global objects are initialized in spheresvr.cpp. This happens before calling main().
Global objects initialization sometimes requires the allocation of temporary strings and the retrieval of the current thread state data (ThreadHolder class stuff).
Both of those things aren't yet created, so we can write to invalid memory instead of using the expected buffer.
When thread state data is not available, so we can't get a temporary string buffer in a thread-safe way, now it will be used the string buffer allocated for thread-unsafe access (for a minimum example, check Str_GetTemp code).
Also, when the server closes, also the temporary string pool and the thread state data are deleted, but there might be some code still requiring thread state data.
So it was added some code accounting of this special application state, avoiding reading or writing to the thread state data location, which doesn't hold anymore valid data.
Immediately after server start, the global objects are initialized in spheresvr.cpp. This happens before calling main().
Global objects initialization sometimes requires the allocation of temporary strings and the retrieval of the current thread state data (ThreadHolder class stuff).
Both of those things aren't yet created, so we can write to invalid memory instead of using the expected buffer.
When thread state data is not available, so we can't get a temporary string buffer in a thread-safe way, now it will be used the string buffer allocated for thread-unsafe access (for a minimum example, check Str_GetTemp code).
Also, when the server closes, also the temporary string pool and the thread state data are deleted, but there might be some code still requiring thread state data.
So it was added some code accounting of this special application state, avoiding reading or writing to the thread state data location, which doesn't hold anymore valid data.
Added: functions to explicitly promote or narrow numeric types.
Changed: Target architecture is precisely reported, instead of giving the number of "bits".
Refactored 3rd party libraries folders, moving both source and binaries to /lib/.
Refactored CMakeLists.txt
Abandoned old MySQL C Connector in favor of MariaDB C Connector, which supports all MariaDB versions and MySQL 5.x and 8.x.
Windows: abandoned MySQL libmysql.dll. Now using MariaDB libmysql.dll (compatible with MySQL until 5.x) for x86 builds and libmariadb.dll for x86_64 builds, which supports MariaDB and MySQL versions above.
Switching from Make to Ninja for automatic Linux builds.