Commit graph

17 commits

Author SHA1 Message Date
cbnolok
6cdf242da1 CMake: external libs are now compiled as obj files, without an intermediate link-in-a-library stage.
This speeds up overall compilation, since only one link pass is done,
instead of one per target.
2025-05-09 20:08:22 +02:00
cbnolok
28586ef1d2 Fixed MinGW compilation with both Clang and MSVC runtime libs.
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.
2024-10-13 18:30:12 +02:00
cbnolok
eae1a45276 Formatted cmake files with gersemi. 2024-09-08 14:33:56 +02:00
cbnolok
405db0bb11 Restored PR #1255: Spellflags fix reorganization 2024-08-07 11:27:32 +02:00
cbnolok
5c9ea6bff6 Fixed: LASTUSED, LASTDISCONNECTED, TIMESTAMP being interpreted as a number with a different base (seconds or tenths of seconds or milliseconds) in different contexts. Now they expect in scripts only values in seconds.
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.
2024-08-06 09:56:32 +02:00
cbnolok
d66675e40a Added separated linker options for each C 3rd party lib.
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.
2024-05-20 11:16:23 +02:00
cbnolok
d93a122352 Fixed warning for invalid debug checks in twofish.c
Fixed another warning for unchecked/unused return value.
2024-05-19 15:18:21 +02:00
cbnolok
84888279c9 Updated toolchains to set options per target, instead of globally.
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.
2024-05-19 14:04:53 +02:00
cbnolok
4533f80f4c Moved each third-party library to a separate CMake project
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.
2024-05-17 11:10:17 +02:00
cbnolok
07082fc518 Fixed: House customization sending wrong component data, breaking it.
Updated AppVeyor image, it looks like the default one has some problems setting up its PostgreSQL installation?
2023-11-18 16:43:22 +01:00
cbnolok
ba14b024a2 Preparations for master/dev branches development model.
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.
2023-11-16 21:25:56 +01:00
cbnolok
7750d98e71 Fixed temporary strings allocation bugs and thread data retrieval upon server start.
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.
2023-11-01 21:18:01 +01:00
cbnolok
ef2d63c48b Revert "Fixed temporary strings allocation bugs and thread data retrieval upon server start."
This reverts commit 14a4651e20.
2023-11-01 21:14:08 +01:00
cbnolok
14a4651e20 Fixed temporary strings allocation bugs and thread data retrieval upon server start.
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.
2023-10-31 15:25:15 +01:00
cbnolok
b7e2497c50 Moved to GCC 12, fixes for github workflow and if parsing.
Fixed IF parsing of arguments without curved brackets and inside angular brackets.
Fixed Github Linux workflow.
Fixed Libev config.h generation.
2023-05-03 18:35:08 +02:00
cbnolok
fe4f07d262 Fixed: Assertion failure and segmentation fault/invalid memory access caused by early use of Sphere methods requiring some data to be initialized first. Compilation and execution should now work with latest GCC versions.
Added: functions to explicitly promote or narrow numeric types.
Changed: Target architecture is precisely reported, instead of giving the number of "bits".
2023-04-30 19:32:00 +02:00
cbnolok
572e3f39fc Moved CMakeLists.txt from /src/ to the project root dir. WARNING: you will need to change the source directory in CMake!
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.
2023-04-27 20:54:45 +02:00