Commit graph

73 commits

Author SHA1 Message Date
turleypol
21577d8e5b
Clang Tidy concat namespaces (#855)
* tidy

* Automated clang-tidy change: modernize-concat-nested-namespaces

* compile test

* fix namespace

---------

Co-authored-by: Clang Tidy <clang-tidy@users.noreply.github.com>
2026-01-17 10:30:21 +01:00
turleypol
7d28cade61
test dynflag flag before getting the structure while saving data (#773) 2025-03-04 19:27:03 +00:00
turleypol
0fdd03316b
Worldsave further improvements (#758)
* directly use the capi for file writing
could improve performance

* docs

* file i/o error checking also during writing
2025-02-06 20:41:12 +01:00
turleypol
c588c51a33
Expansion helper classes for central handling of features (#756)
* use uoexpansion enums for A9, B9 flags
added TOL to uoexpansion
currently unsure where this will end

simplified account initialisation, added errorcheck

* Expansion classes for server and account
fixed flags

* use of AccountExpansion,ServerExpansion
extended tests
splitted unittest file
added missing test for Min/MaxAttackRange

* more micro performance for world saving
use all 4 cores in CI builds
fix compiler flag warning on windows

* save test for weight_multiplier

* enable gothic,rustictiles when using HSA expansion

* removed ancient unused files

* addressed comments
renamed ServerExpansion to ServerFeatures
added method for expansion name

* got rid of client UOExpansionFlag which is the same as the accout
expansion

* updated core-changes and docs

* updated generated ssopt

* test for tooltips
changed method names
removed/clarified comments

* npc hitchance was never saved
added missing npc save tests

* hitchance bug exists also for items...
added missing test for movemode
2025-02-05 19:02:25 +01:00
turleypol
8e9a044776
WorldSave performance (#753)
* directly write to stream

* quickfix just disabled orphan console print

* now?

* debug timer for each file

* removed pointer indirection
use defined underlying buffer size
reactivated orphans

* missing files

* optimized away dynamic allocations during formatting by using buffer

* debug print thread id used
stop timer of blocking part

* wake up all threads, if the producer thread is faster only one thread
will wake up...
extended debug logging

* after reading the standard...
notify_* is atomic thus multiple calls to notify_one will always wake up
a different thread.
So notify_one is correct here and notify_all pessimistic

* increased the buffer
ordered savefiles roughly by size

* use compile time strings to optimize formatting
added a few shortcuts
optimized hexint by adding a string_view version with threadlocal buffer

* cleanup

* readded terminate protection

* docs

* StreamWriter needs to be destroyed before printing the stream
2025-01-29 06:48:05 +01:00
turleypol
22b01b3b81
added multi prop/itemdesc items_decay (#735)
* added multi prop/itemdesc items_decay
added region cfg entry NoDecay
misc cleanup eg chr->equip sets position instead of calling side

* docs

* added future pos refactoring comment

* changed region NoDecay to ItemsDecay so it matches the other props
2024-11-14 06:58:18 +01:00
turleypol
7e07fbe33a
moved polcfg to plib (#732)
removed unused remainings of incremential save
2024-11-03 14:37:38 +01:00
Jonathan Morland-Barrett
8df2f6515e
Added dynaprops for min and max attack range increase. (#511)
* Initial commit of min and max range increase dynaprops.

* Fixed documentation and reported style issues.

* More style check fixes.

* Update missing uobject and script objects for new props.

* Rectify missing code from uoscrobj which prevented assignment on mobiles.
Changed range logic from weapons to include some sanity checks.

* Add a simple test

---------

Co-authored-by: Jonathan Morland-Barrett <jonathan@veridiandynamics.com.au>
Co-authored-by: Kevin Eady <8634912+KevinEady@users.noreply.github.com>
2024-11-02 15:46:50 +01:00
turleypol
9d2bf0ec60
replaced all uppercase hex formatting with lowercase variant (#645) 2024-05-05 09:13:12 +02:00
turleypol
08bd3c7ce5
Savefile rewrite (#601)
* rewrite of saving, replaced operator way with a generic add method, thus
not everywhere the formating of the savefiles is hardcoded.
since its the last spot which uses the old formating lib, remobed the
lib

* removed cmake of old format lib

* testscripts for load/save of UObject,Item,Armor,Weapon

* fixed: member faster_cast_recovery and faster_cast_recovery_mod getter returned
a wrong value

* wrong/missing docs

* test containers, lockable, map, spellbooks
fixed save bug in map and spellbook
removed ancient savestrategy experiments

* added corpse test
splitted testfiles

* fixed loading (ancient bug) and saving (PR bug) of Reportables
added tests for houses, boats, accounts and chars

* fixed include

* fix shutdown leak

* added npc tests
upload complete coretest folder also on failure

* do not write and load RegisteredHouse for NPCs two times
readded extra newline between accounts

* tests for guild, party, realm
added resource cfgs, but a test is not really possible since nothing of
interest is stored

* added datafile, storage test

* activated resource loading, 25year old bug, but since the stored values
are senseless it makes no real difference.
added a few wtf comments
catch all exceptions during formatting of log lines

* replaced .write with explixit .begin, .end and .comment.
for leftovers.txt the StreamSaver was also used, since the format is
different use directly ofstream

* added corechanges
2024-01-24 18:49:06 +01:00
turleypol
d848deae18
POLLOG* macros use the new formatting (#598)
* POLLOG* macros use the new formatting
removed all old logging functions

* removed old fmt lib from everything except StreamWriter
removed unneeded functions

* fixed review comments
2024-01-16 17:55:42 +01:00
turleypol
0e675c516a
use new formatter for ERROR_PRINT, added ERROR_PRINTLN (#595)
* use new formatter for ERROR_PRINT, added ERROR_PRINTLN

* remove old log define

* fix comments
2024-01-12 06:51:44 +01:00
turleypol
43b776b94d
New format lib version (#592)
* renamed include guard to be able to use both format lib versions in
parallel

* build Fmt lib and link it into clib

* use std::string instead of format Writer for logging
added variant "2" for logging with new fmt lib

* use new logging variant for two logs

* always add \n to flush log, lets see if the assumption holds

* use new lib for tostring

* replaced all INFO_PRINTS in clib

* formatter for Token, BObject and BObjectImp

* started with bsccript

* use function instead of actual object for logging

* remaining bscript, started plib

* logvariant without newline added, more template magic

* format support for base types, added test for format padding
new version for fdump

* chanhed ecompile/runecl fixed compilation with ESCRIPT_PROFILE

* rewrite INFO_PRINT in plib,poltool/uoconvert/uotool

* replaced remaining INFO_PRINTS, renamed macros INFO_PRINT for logging
without newline, INFO_PRINTLN for newline addition.
Replaced also INFO_PRINT_TRACE and renamed it to INFO_PRINTLN_TRACE

* gitignore for fmt lib

* cleanup vim leftovers
2024-01-10 18:29:10 +01:00
turleypol
aa5ef40356
use nondeprecated openssl api (#555)
cleanup refptr
added test for md5_encrypt
2023-10-23 19:38:39 +02:00
turleypol
eeb57d489a
Drop/getitem related pos refactoring (#497)
* refactored move_item

* container location methods

* dropitem position refactors

* addressed pr comments.
fixed comment
more readable algo for random location
2023-01-05 00:10:51 +01:00
turleypol
9fe3e36cff
use Pos classes in Map and Door (#422)
* use Pos classes in Map and Door
removed most of the functions in ufacing.cpp
removed Plib::UFACING
added executor getPos2d

* added forward methods to baseobject, lets see where it ends :)

* fix typo

* moved methods to uobject
2021-09-11 22:38:43 +02:00
turleypol
7ee1b64e19
replaced baseclass x,y,z,realm members with Pos4d. (#420)
* replaced baseclass x,y,z,realm members with Pos4d.
Adapted the code, no changes except making the compiler happy

* review changes

* Fixed gotten_item

* fixed copy&waste
2021-09-10 20:17:25 +02:00
Fernando Rozenblit
c49f5b4abb
Reorganize regions and realms (#228)
* Moved realms.h and realms.cpp to realms/..

* Moved regions into their own folder
2020-08-17 22:29:07 +02:00
GIB
5dfc28173a Added missing changes to enable swing_speed_increase to work.
Fixed nullptr issue discovered when setting verbosity to 20.
Added % calculation for swing_speed_increase to clocks for schedule_attack()
2020-06-06 21:48:03 +08:00
GIB
7c627437af
Noninvasive dynaprops (#89)
Added new mobile and item props from the AOS update. Please read docs to understand how they are applied and how they stack from items to mobiles.
2019-06-17 18:58:58 +08:00
turleypol
25dae4fc21 fixed namespaces of moved files 2018-12-22 00:32:47 +01:00
turleypol
e1b14dcd00 moved polfile/uofile files into plib to cleanup atleast a bit the
compile dependencies
2018-12-21 20:27:05 +01:00
turleypol
983c6a3c73 first round for scripted object class methods 2018-10-13 00:03:40 +02:00
esdete
dc2d29b433 NULL to nullptr 2018-07-31 14:30:29 +02:00
turleypol
dbb25bdb62
Include and buildsystem cleanup (#45)
Include cleanup
Reworked buildsystem (Linux only)
Removed dynamic libs, Linux now again uses static linking (like windows)
2018-01-29 21:55:48 +01:00
turleypol
32ddea28cb simplified elemental resist/damage 2017-10-22 15:57:29 +02:00
turley
c855a27815 Added new baseclass for uobject
contains only minimum data and can be created with arbritary data.
This reduces memory overhead for each los-check.
Plus minor cleanup
2016-12-12 22:21:59 +01:00
turley
a983d25e4e removed bool members and replaced them with flags.
Further decrease memory foodprint.
2016-12-07 23:34:16 +01:00
turley
189cad3479 Formating everything
Authors are not forced to use the clang-format setting, but should
atleast be inspired by the style.
The only thing which is now not allowed are tabs for ident/alignment!
2016-02-19 19:26:35 +01:00
Gabriele Tozzi
53c2ba78c6 Added: CProp profiler, helps detecting unused CProps
It can be enabled by using the new pol.cfg option "ProfileCProps".
For better results, should be enabled before startup.
Impacts on performance very slightly, but consumes an average of
300 bytes of extra RAM for every CProp used.
New polsys.em function LogCPropProfile() can be called to dump
the profiling information into cpprofile.log.
2016-01-31 15:06:56 +01:00
Gabriele Tozzi
d1ac902926 Documentation: reformatted headers for DoxyGen 2016-01-28 14:52:40 +01:00
Gabriele Tozzi
a5efaa4fa6 Merge branch 'master' of https://github.com/polserver/polserver into cmake 2015-12-05 09:41:51 +01:00
frozenblit
b3b9bb1fb6 Removing dependence on useless includes.
Preparing to reorganize the uofile code by removing useless includes
from the rest ;)
2015-12-04 00:50:14 +01:00
Gabriele Tozzi
24eee9ecf4 Merge branch 'master' of https://github.com/polserver/polserver into cmake
Conflicts solved, still need to test and review it before merging into master.
2015-11-27 06:26:46 +01:00
turley
dfd65e30cd Moved plib realm to pol 2015-09-18 19:11:46 +02:00
Gabriele Tozzi
b69cb9032a Fixed: Bug in loading POL098 and older data files
Boats were rotated leaving dynamic elements like plank and
tillerman on the old position.
2015-09-12 18:49:05 +02:00
Thomas Volkert
1dd2200c6b Renamed endian.h to clib_endian.h to avoid redefinition problems in
system files and the general hiding of the endian.h from the system
2015-08-31 20:01:31 +02:00
frozenblit
ab592b0bf6 Instead of .c_str(), the log will take a copy of the formatter string 2015-05-16 16:00:26 +02:00
turley
188b2797ed Replaced old dynprop_map with new dynproperties.
Moved also extended_statbar,skillcap, movementcost_mod infos into the dynprops
2015-05-09 13:00:12 +02:00
turley
79dff37246 Splitted gamestate external. 2015-01-02 14:46:44 +01:00
turley
2737393f2a Tried to put all global vars into centralized structures.
Currently plib/systemstate, pol/uvars, pol/ucfg, pol/multi/multidef

Next step should be to split them based on usage, since its currently a bit of include hell...
2014-12-30 14:14:41 +01:00
frozenblit
fb717e2ef3 Even more cleanups.
Removed stl_inc.h from most of the include files. Still have some 200
files to go. I wish I'm done... someday...
2014-11-01 15:43:45 +01:00
frozenblit
3bec88c830 Cleaning up includes and adding fully-qualified names 2014-10-31 20:45:30 +01:00
turley
e0b722a93b fixed several uninitialized variables 2014-08-30 12:25:08 +02:00
turley
b8d22e290b more flyweight usage (names, scripts, template), made resistance and damage types optional. 2014-08-02 17:53:33 +00:00
turley
9ab40f7c77 made compiler happy 2014-06-14 08:28:30 +00:00
turley
331792c755 added more memoryusage estimation 2014-06-07 09:00:37 +00:00
turley
05c5b2d60b removed old code
testing a threadpool 
added chr.last_textcolor member which returns the clientside chatcolor
2014-06-01 09:59:12 +00:00
turley
fb873de803 decoupled headers to optimize a bit the build time 2014-05-03 09:06:19 +00:00
turley
9acf8fa43c added StackWalker lib for complete backtraces under windows
simplified some loops
fixed a crash on char death with non moveable robe layer items
2014-04-25 09:30:50 +00:00