Skip to content

Commit 758bfe7

Browse files
authored
Merge pull request #1418 from Sphereserver/dev
Dev
2 parents 0911dd2 + 0e55360 commit 758bfe7

File tree

136 files changed

+57840
-24211
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

136 files changed

+57840
-24211
lines changed

.clang-tidy

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Checks: >
1414
readability-*,
1515
# Disable specific checks/warnings:
1616
-clang-analyzer-security.insecureAPI.strcpy,
17+
-clang-diagnostic-format-security,
1718
-cppcoreguidelines-avoid-c-arrays,
1819
-cppcoreguidelines-avoid-goto,
1920
-cppcoreguidelines-avoid-magic-numbers,
@@ -56,7 +57,7 @@ Checks: >
5657

5758
CheckOptions:
5859
- key: 'clang-analyzer-core.NonNullParamChecker:assert_like_macro'
59-
value: 'DEBUG_ASSERT,ASSERT,PERSISTANT_ASSERT'
60+
value: 'DEBUG_ASSERT,ASSERT,ASSERT_ALWAYS'
6061
- key: 'clang-analyzer-config:noreturn_function'
6162
value: 'RaiseImmediateAbort,RaiseRecoverableAbort'
6263
- { key: readability-identifier-naming.NamespaceCase, value: lower_case }

.github/workflows/build_linux_x86.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ jobs:
9494
- name: Report building tools
9595
run: |
9696
echo "GCC:" && gcc -v
97+
echo "Default Linker:" && ld -v
9798
echo && echo "CMake:" && cmake --version
9899
echo && echo "Ninja:" && ninja --version
99100

.github/workflows/build_linux_x86_64.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ jobs:
4949
- name: Report building tools
5050
run: |
5151
echo "GCC:" && gcc -v
52+
echo "Default Linker:" && ld -v
5253
echo && echo "CMake:" && cmake --version
5354
echo && echo "Ninja:" && ninja --version
5455

.github/workflows/build_osx_arm.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,12 @@ jobs:
3838
echo && echo "** Setting up compiler" && echo
3939
export HOMEBREW_NO_AUTO_UPDATE=1
4040
export HOMEBREW_NO_INSTALL_CLEANUP=1
41-
brew install ninja mariadb-connector-c
41+
brew install mariadb-connector-c
4242
4343
- name: Report building tools
4444
run: |
4545
echo "Apple Clang:" && clang --version
46+
echo "Default Linker:" && ld -v
4647
echo && echo "CMake:" && cmake --version
4748
echo && echo "Ninja:" && ninja --version
4849

.github/workflows/build_osx_x86_64.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,11 @@ jobs:
3737
echo && echo "** Setting up compiler" && echo
3838
export HOMEBREW_NO_AUTO_UPDATE=1
3939
export HOMEBREW_NO_INSTALL_CLEANUP=1
40-
brew install ninja mariadb-connector-c
40+
brew install mariadb-connector-c
4141
- name: Report building tools
4242
run: |
4343
echo "Apple Clang:" && clang --version
44+
echo "Default Linker:" && ld -v
4445
echo && echo "CMake:" && cmake --version
4546
echo && echo "Ninja:" && ninja --version
4647

.github/workflows/codeql.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ jobs:
5252
- name: Report building tools
5353
run: |
5454
echo "GCC:" && gcc -v
55+
echo "Default Linker:" && ld -v
5556
echo && echo "CMake:" && cmake --version
5657
#echo && echo "Ninja:" && ninja --version
5758

.github/workflows/coverity-scan.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ jobs:
3737
- name: Report building tools
3838
run: |
3939
echo "GCC:" && gcc -v
40+
echo "Default Linker:" && ld -v
4041
echo && echo "CMake:" && cmake --version
4142
4243
- name: Download Coverity Build Tool

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
/.cache
33
/.git
44
/.vscode
5+
/.idea
56
*.vshistory*
67
/.kdev*
78
/.ctagsd
@@ -50,7 +51,6 @@
5051
*.*workspace
5152
*.kdev*
5253

53-
5454
# Ignore some files in the parent folder
5555
CMakeCache.txt
5656

@@ -62,3 +62,4 @@ CMakeCache.txt
6262
/lib/mariadb_connector_c/mysql/config.h
6363
/lib/mariadb_connector_c/mysql/ma_config.h
6464
/lib/mariadb_connector_c/mysql/mariadb_version.h
65+
/lib/zlib/zlib/zconf.h

CMakeLists.txt

Lines changed: 30 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Main config #
22

3-
cmake_minimum_required(VERSION 3.24)
3+
cmake_minimum_required(VERSION 3.29)
44
set(CMAKE_SUPPRESS_REGENERATION TRUE) # Supress the ZERO_CHECK generation
55

66
# -------------------- Utility functions --------------------
@@ -21,15 +21,33 @@ if((NOT TOOLCHAIN_LOADED) AND (NOT ${CMAKE_TOOLCHAIN_FILE} STREQUAL ""))
2121
toolchain_force_compiler()
2222
endif()
2323

24+
# Remove default, global compiler and linker flags set by CMake.
25+
# Init: must come before project() command
26+
set(CMAKE_C_FLAGS_INIT "")
27+
set(CMAKE_CXX_FLAGS_INIT "")
28+
set(CMAKE_EXE_LINKER_FLAGS_INIT "")
29+
# Generic
30+
set(CMAKE_CXX_FLAGS "")
31+
set(CMAKE_C_FLAGS "")
32+
set(CMAKE_EXE_LINKER_FLAGS "")
33+
set(CMAKE_SHARED_LINKER_FLAGS "")
34+
# Also clear build-type specific flags
35+
set(CMAKE_CXX_FLAGS_DEBUG "")
36+
set(CMAKE_CXX_FLAGS_RELEASE "")
37+
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "")
38+
set(CMAKE_CXX_FLAGS_MINSIZEREL "")
39+
2440
message(STATUS "Scanning system build tools...")
2541
project(SphereServer CXX C) # does a scan for C++ and C compilers
2642

43+
2744
# If we have not specified a toolchain, let's detect which one we should use, using the detected arch.
2845
# We need to do this after "project", otherwise CMake doesn't know where it's running.
2946
if(NOT TOOLCHAIN_LOADED)
3047
include("cmake/DetectDefaultToolchain.cmake")
3148
endif()
3249

50+
3351
# Setup global flags, to be done before creating targets.
3452

3553
if(NOT DEFINED CMAKE_CXX_STANDARD)
@@ -42,6 +60,7 @@ elseif(CMAKE_CXX_STANDARD LESS 20)
4260
endif()
4361
set(CMAKE_CXX_STANDARD_REQUIRED ON)
4462
set(CMAKE_CXX_EXTENSIONS OFF)
63+
set(CMAKE_CXX_SCAN_FOR_MODULES OFF) # disable C++ module scanning
4564

4665
# Need to clear shared library flags. If not, cmake sets -rdynamic and this
4766
# add to the executable the full symbol table (included unused symbols).
@@ -73,20 +92,28 @@ set(CMAKE_EXE_LINKER_FLAGS_RELEASE "")
7392
# Also, it fails to create those predefined flags, which it needs, for custom build types (e.g. Nightly).
7493
set(CMAKE_EXE_LINKER_FLAGS_NIGHTLY "")
7594

95+
7696
# -------------------- GUI checkboxes --------------------
7797

7898
option(
7999
CMAKE_NO_GIT_REVISION
80100
"Do not try to retrieve the current git revision. Useful for building source not git-cloned from Github."
81101
FALSE
82102
)
103+
if(WIN32)
104+
option(WIN_SPAWN_CONSOLE "Spawn an additional console, useful for debugging." FALSE)
105+
if(MSVC)
106+
option(WIN_GENERATE_CRASHDUMP "For non-Debug builds, add Windows Structured Exception Handling and generate a Crash Dump if a fatal SE is thrown." FALSE)
107+
endif()
108+
endif()
83109
option(CROSSCOMPILE "Are we compiling for a different target architecture?" FALSE)
84110
option(
85111
RUNTIME_STATIC_LINK
86112
"Statically link inside the executable the runtime libraries? (MSVC, libc/libcc, libstdc++)."
87113
FALSE
88114
)
89115
option(CMAKE_EXPORT_COMPILE_COMMANDS "Export compiler commands to compile_commands.json" TRUE)
116+
set(CMAKE_LINKER_TYPE "DEFAULT" CACHE STRING "Linker to be used for the linking step.")
90117

91118
set(predef_LIB_LIBEV_BUILD FALSE)
92119
if(NOT WIN32)
@@ -96,13 +123,6 @@ option(LIB_LIBEV_BUILD "Build libev." ${predef_LIB_LIBEV_BUILD})
96123
option(LIB_SQLITE_BUILD "Build sqlite." TRUE)
97124
option(LIB_ZLIB_BUILD "Build zlib." TRUE)
98125

99-
if(WIN32)
100-
option(WIN_SPAWN_CONSOLE "Spawn an additional console, useful for debugging." FALSE)
101-
if(MSVC)
102-
option(WIN_GENERATE_CRASHDUMP "For non-Debug builds, add Windows Structured Exception Handling and generate a Crash Dump if a fatal SE is thrown." FALSE)
103-
endif()
104-
endif()
105-
106126
if(NOT MSVC)
107127
option(USE_COMPILER_HARDENING_OPTIONS "Enable compiler (even runtime) safety checks and code hardening." FALSE)
108128
endif()
@@ -179,9 +199,11 @@ else(SINGLE_TARGET)
179199
set(CMAKE_CONFIGURATION_TYPES "Debug;Release;Nightly" CACHE STRING "" FORCE)
180200
endif(SINGLE_TARGET)
181201

202+
182203
# Include the list of all Sphere source files
183204
include("src/CMakeSources.cmake")
184205

206+
185207
# Configure output binaries
186208
set(TARGETS "" CACHE INTERNAL "List of Sphere targets to build.")
187209
if(SINGLE_TARGET)

Changelog.txt

Lines changed: 62 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -3957,34 +3957,36 @@ Added: 'H' shortcut for variables to get the value as hexadecimal.
39573957
LOCAL.ReflectDamage (r/w) = The amount of damage that will be reflected to this other party
39583958
LOCAL.ReduceDamage (r/w) = Amount to be deducted from damage received
39593959
LOCAL.DamageType (r/w) = Type of damage received (Default: DAMAGE_FIXED andDAMAGE_REACTIVE)
3960-
NOTE;
3961-
1. If no ReflectDamage or ReduceDamage values are entered, the system defaults to the Reactive Armor Effect value.
3960+
NOTE:
3961+
1. If no ReflectDamage or ReduceDamage values ​​are entered, the system defaults to the Reactive Armor Effect value.
39623962
2. No damage amount can be less than 1.
39633963

39643964
4-12-2024, canerksk
39653965
- Fixed: Sphere crash troubleshooting if a player has no CHATNAME value and remove a channel.
39663966

39673967
6-12-2024, canerksk
3968-
- Added: Added LOCAL.WOPTalkMode in @SpellCast trigger and ini setting WOPTalkMode.
3969-
In some clients, different operations can be performed in return for this, for example, if this talkmode went from sphere as TALKMODE SPELL, the operation is performed according to this incoming talk mode according to the client versions. Here, the possibility of changing the talkmode according to the client version used is given. By default, TALKMODE_SPELL
3970-
Default talk mode: TALKMODE_SPELL = 10
3971-
Sphere.ini;
3972-
WOPTalkMode=0/14
3973-
3974-
Trigger;
3975-
@SpellCast
3976-
Local.WOPTalkMode=0/14
3977-
3978-
TALKMODE_SAY = 0 // A character speaking.
3979-
TALKMODE_SYSTEM = 1 // Display as system prompt
3980-
TALKMODE_EMOTE = 2 // *smiles* at object (client shortcut: :+space)
3981-
TALKMODE_ITEM = 6 // text labeling an item. Preceeded by "You see"
3982-
TALKMODE_NOSCROLL = 7 // As a status msg. Does not scroll (as reported by the packet guides)
3983-
TALKMODE_WHISPER = 8 // Only those close can here. (client shortcut: ;+space)
3984-
TALKMODE_YELL = 9 // Can be heard 2 screens away. (client shortcut: !+space)
3985-
TALKMODE_SPELL = 10 // Used by spells
3986-
TALKMODE_GUILD = 13 // Used by guild chat (client shortcut: \)
3987-
TALKMODE_ALLIANCE = 14 // Used by alliance chat (client shortcut: shift+\)
3968+
- Added: LOCAL.WOPTalkMode in @SpellCast trigger and ini setting WOPTalkMode.
3969+
In some clients, different operations can be performed based on this. For example, if this talk mode was sent from Sphere as TALKMODE_SPELL, the operation is performed according to the client version. The possibility of changing the talk mode according to the client version used is now provided. By default, TALKMODE_SPELL.
3970+
3971+
Default talk mode: TALKMODE_SPELL = 10
3972+
3973+
Sphere.ini:
3974+
WOPTalkMode = 0/14
3975+
3976+
Trigger:
3977+
@SpellCast
3978+
Local.WOPTalkMode = 0/14
3979+
3980+
TALKMODE_SAY = 0 // A character speaking.
3981+
TALKMODE_SYSTEM = 1 // Display as system prompt.
3982+
TALKMODE_EMOTE = 2 // *smiles* at object (client shortcut: :+space).
3983+
TALKMODE_ITEM = 6 // Text labeling an item. Preceded by "You see".
3984+
TALKMODE_NOSCROLL = 7 // As a status message. Does not scroll (as reported by the packet guides).
3985+
TALKMODE_WHISPER = 8 // Only those close can hear. (client shortcut: ;+space).
3986+
TALKMODE_YELL = 9 // Can be heard 2 screens away. (client shortcut: !+space).
3987+
TALKMODE_SPELL = 10 // Used by spells.
3988+
TALKMODE_GUILD = 13 // Used by guild chat (client shortcut: \).
3989+
TALKMODE_ALLIANCE = 14 // Used by alliance chat (client shortcut: shift+\).
39883990

39893991
08-01-2025, DavideRei
39903992
- Fixed: NPC FLEE action didn't work because it was using action target (empty) instead of fight target
@@ -3997,18 +3999,51 @@ Added: 'H' shortcut for variables to get the value as hexadecimal.
39973999
Serv.Log <DLOCAL.DoorAutoDist>
39984000
Local.DoorAutoDist=10
39994001

4000-
28-02-2025, cbnolok
4002+
28-02-2025, Nolok
40014003
- Fixed: failing assertion if targeting a non-corpse object when casting Animate Dead spell.
40024004

4003-
09-03-2025, cbnolok
4005+
09-03-2025, Nolok
40044006
- 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 (partial fix for Issue #1249).
40054007
Also, stamina wasn't consumed, thus NPCs had no limit in placing those items.
40064008

4007-
11-03-2025, cbnolok
4009+
11-03-2025, Nolok
40084010
- Added: log message with informations about the newly created object, if just placed in a sector exceeding complexity threshold.
40094011

4010-
15-03-2025, cbnolok
4012+
15-03-2025, Nolok
40114013
- Fixed: when using the ini setting ItemTimers=1 (enabling items to tick even if inside a container), the items kept ticking even after a char logout.
40124014
- Fixed: when using the ini setting ItemTimers=1, items ticked on npcs ridden by a disconnected char.
40134015

4014-
4016+
22-04-2025, Mulambo
4017+
- Added ini settings:
4018+
// Display more bounce messages when drinking potions, fishing, crafting etc. (Old sphere behaviour).
4019+
VerboseItemBounce = 0 // (default)
4020+
4021+
22-04-2025, canerksk
4022+
- Added: New item function, CARVECORPSE: carves a corpse with SRC = char carving the corpse.
4023+
- Added: New ini RevealFlag setting REVEALF_ONHORSE, to allow or disallow stealth walking if you are on a mount.
4024+
- Added: new ini CombatFlags setting COMBAT_ATTACK_NOAGGREIVED.
4025+
In the old behavior (55i/55r/56b/56c) we were not guilty when we hit a murderer. Now when we attack a criminal or murderer we are guilty towards that person. An ini setting option has been added for this behavior. Although this is a normal behavior in OSI, it can be perceived as a problem since not every server designs games like OSI.
4026+
4027+
03-05-2025, Nolok
4028+
- Changed: Retrieving the MORE1/2 of items with the flag CAN_I_SCRIPTEDMORE will always return the raw numerical value.
4029+
This allows using the full numerical range available.
4030+
4031+
03-05-2025, canerksk (from PR #1319), Nolok
4032+
- Added: New optionflag OF_PetBehaviorOwnerNeutral.
4033+
If this setting is enabled, pets you own will appear to you with the original noto (pre-taming, old behavior). If this setting is not enabled, the assets you own will always appear natural to you. This setting only applies when the owning character is looking at the asset they own. It does not apply when someone else is looking at the asset you own.
4034+
- Added: OF_NPCMovementOldStyle, TAG.OVERRIDE.MOVESTYLE.
4035+
Support for the old 0.56b NPC movement formulas with: OF_NPCMovementOldStyle ini setting and TAG.OVERRIDE.MOVESTYLE (to override the behavior for a single character).
4036+
With that formula, among the other things, char MOVERATE property and TAG.OVERRIDE.MOVERATE will return to be the percent modifier of the speed of the NPC - the higher it is, the slower will the NPC be. Default is 100.
4037+
4038+
04-05-2025, Nolok
4039+
- Fixed: spell or skill defname reading from an object property.
4040+
When setting a property like MORE to the a spell or skill defname, trying to read it returned back the resource index (like the spell number) instead of the defname (Issue #1397)
4041+
4042+
05-05-2025, Mulambo
4043+
- Added: new command line switch `-I=/path/to/ini/`
4044+
Allows you to define path to folder with ini files. Usable, when you want to separate binary from configuration or when running Sphere as Windows service (since services are usually run in C:\Windows\System32).
4045+
Usage: Linux: `.\SphereSvrX64_debug -I=/etc/sphereserver/`, Windows: `SphereSvrX64_nightly.exe -I=C:/sphere/` (trailing slash required).
4046+
4047+
08-05-2025, Nolok
4048+
- Added: NPCWanderingLookAroundChance ini setting and TAG.OVERRIDE.LOOKAROUNDCHANCE.
4049+
It allows to change the chance that a wandering NPC will analyze its surroundings for the current step. This also means that the trigger @NPCLookAtChar will fire more frequently.

0 commit comments

Comments
 (0)