Skip to content

Conversation

@raydienull
Copy link
Contributor

No description provided.

cbnolok and others added 30 commits August 7, 2024 12:33
…ntext data in server logs.

- Fixed: custom triggers not firing.
- Fixed: CUOClientVersion not parsing correctly new string format.
- Fixed: TOOLTIP Dialog keyword sending the cliloc number in hex notation if ini DecimalVariables == 0 (unsupported by client, making some of them crash).
- Fixed: some integer data type size inconsistencies.
- Fixed: initialization order fiasco for CAccounts at server shutdown.
- Changed: Str_To* functions to return a std::optional value, in order to get the best error handling (before, it depended on errno and there were ambiguous return values for invalid or "0" zero strings.
- Changed: Refactored CUOMobTypes.
- Changed: replaced localtime function with thread-safe alternatives, avoiding data race conditions.
- Added: stypecast.h. It has utilities to cast numbers with strong guarantees and error checking at compile time, to avoid undefined behaviors, involuntary wrong sign/size cast or overflowing.
…ad of signed char) and initialization order fiasco for g_Srv
…rties:

Changed: since there was too much data to be stored in the FACTION/SLAYER property, so that it sometimes couldn't fit and caused issues,
	it has been split in two different propertie
	  - FACTION/SLAYER_GROUP (expects a bitmask, max value of the usable flag: 0x800000),
	  - FACTION/SLAYER_SPECIES (plain number, max value 255).
	    SPECIES with index/value 1 are always considered to be SuperSlayers for their group.
Added some security checks and constexpr.
…ebug builds.

Fixed: gump tooltips not showing. Also, small refactoring of dialog parsing code.
Fixed: CUOMobtypes not parsing correctly strings with comments, bug introduced with a recent refactor commit.
Fixed: CGlobalChatChanMember name could be corrupted/overwritten since it was using a temporary string instead of a properly owned one.
Fixed: undefined behavior warning in CScriptObj.cpp.
Added more stypecast functions and a couple of fixes there.
Added more noexcept specifiers.
Added: RETRY_LOCK_FOR_TASK*, used to retry mutex lock in the (rare) case
it fails. This has to be used only for critical mutexes.
Added: STDERR_LOG to log critical messages to stderr if standard CLog
methods are failing or can't be used.
Added: NOTHROW macro to specify functions that might throw an exception,
as opposite to nothrow.
Adapted some CLog and threading methods to actually be noexcept.
Reordered common.h.
Removed legacy/unused SLAYER* properties.
Added log message when a new thread is created or a thread is being renamed.
Added more methods for enum conversion in stypecast.h.
Made more resilient to rare mutex locking errors the threads-managing code.
Made more threads.h methods noexcept.
Reordered CChar members to reduce memory usage.
Added ensure_comptime() in common.h.
Fixed Windows compilation error.
…e base def.

Splitted num_alias_cast into n_alias_cast and enum_alias_cast.
cbnolok and others added 29 commits February 14, 2025 07:27
CMake parsing error causing optimizations not being applied correctly to
Nightly and Release build.
Update with dev branch bugfixes.
Using vfork() directly is extremely fragile, and posix_spawn() is
easier to use.  This implements a TODO comment.
Each "apt install" invocation loads the package database, and merging
two calls speeds up the build.
"apt" is a wrapper for "apt-get" that is "better suited for
interactive usage", but really only adds overhead, and GitHub actions
are non-interactive by design.
Let's make this a single command, removing the overhead for two "cd"
commands (the latter of which had no effect anyway because it was the
last command in the shell process).
It's only used on non-Windows OSes, and declaring it on all but glibc
broke the Windows build.  Fixes regression by commit 2a129d5
The CI log should be verbose so we can see what commands are really
being used, and it's pointless to use the default "beautified" ninja
output.  In this case, I'd like to know why my ccache changes were not
used ("Hits: 0 / Uncacheable: 210"), see commit b06a46e
ccache cannot cache projects using PCH properly unless we allow it to
be "sloppy" about it.  See ccache manual.
Another improvement for ccache with GCC+PCH, see ccache maual.
to CUSTOM_CXX_FLAGS and CUSTOM_EXE_LINKER_FLAGS.
Added -Wdouble-promotion.
This hides all symbols that have no explicit "visibility" attribute.
Since Sphere never needs to export any of its symbols to another ELF
object (e.g. a loadable module), it makes no sense to leave them in
the executable as global symbols.  This will make a big difference
once we use `--gc-sections`, because only sections with hidden symbols
can be dropped from the executable.
This linker flag, if supported, removes unused sections from the
executable.  Unused sections are those that do not contain public
symbols (therefore `-fvisibility=hidden`) and are not referenced by
other sections.

This shrinks the code size by 4%:

    text	  data	   bss	   dec	   hex	filename
 4069421	285904	1427713	5783038	583dfe	Debug/bin-native64/SphereSvrX64_release
 3918858	284456	1427713	5631027	55ec33	Debug/bin-native64/SphereSvrX64_release
.github/workflows/build*: pass "-v" to ninja
…l Variables to @UserExtCmd Trigger

Credits to @canerksk
Fixed: If Giant Spiders and Fire Elementals are denied going into
sleeping state into a sleeping sector, their dropped items (ie.
i_spider_web) went into sleeping state and didn't decay, leading to
accumulation (Issue #1249).
  Also, stamina wasn't consumed, thus NPCs had no limit in placing those
items.
…if just placed in a sector exceeding complexity threshold.
…the random device.

Moved xorshift inclusion in the cpp.
Added the mt19937_64 variant for the generation of pseudo-random 64 bits
numbers on a 64-bits machine (should be faster).
Made xorshift and mt generators multithreaded.
@raydienull raydienull merged commit 73170a5 into static-analysis Mar 26, 2025
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants