Commit graph

32 commits

Author SHA1 Message Date
turleypol
774a9349f3
rewrite Decay system (#660)
* rewrite Decay system
removed setting to switch to multithread decay
Syshook:: call_long treats true/false as 1/0
can_decay hook if it returns 2 skip multicheck

* sleeptime is used outside of PolLock, guarded via atomic

* updated docs

* renamed syshook private methods
added corechanges
2024-07-14 17:34:17 +02:00
turleypol
b216a16d36
refactored npcmod,decay to use Pos classes, removed all wrappers from Realm (#652)
* refactored npcmod,decay to use Pos classes
get rid of some realm methods used to wrap Pos

* all wrappers in Realm are now gone

* review comments
2024-07-07 15:32:29 +02:00
turleypol
a88d76acc3
refactor uomod to use pos classes (#651)
* refactor uomod to use pos classes

* fixed ambiguous call
2024-07-06 07:56:02 +02: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
d873551c25
removed pol_distance/inrange* functions (#556)
* removed pol_distance/inrange* functions
replaced lastxyz with Pos4d

* replaced WorldIterator::InVisualRange with InMaxVisualRange returning
all objects in maximum update range. Adapted each caller, they now have
to check in_visual_range
Multis should now be send to clients with its footprint in mind.
added testscript for boat moving in/out of range

* removed non pos InRange/InBox functions
gamestate.update_range doesnt need to be a Vector, renamed

* corrected send_action_to_inrange

* replaced clip methods with general numeric type clamp function

* added Range2d constructor with radius

* splitted update_range. chr has now a los_size (how far can it see) and
an object has a visible_size (0 for objects 1/2 footprint for multis)

* use in_range instead of pol_distance

* corrected order of checks

* fixed warnings

* fixed visual size of multis
testclient added wornitems pkt support
added tests for los

* corechanges
2023-12-25 22:02:52 +01:00
turleypol
7ffc201181
Test curl protocols (#577)
* can we unittest supported curl protocols?

* test for http(s)
2023-12-11 19:46:10 +01:00
Peter Wedder
62638190a6
Change outgoing packet handlers to write CP-1252 when appropriate (#443)
* - Change all (most?) outgoing packet handlers that should write CP-1252 to convert UTF-8 to CP-1252.
- Update Clib::sanitizeUnicodeWithIso() to sanitize with CP-1252, which is what UO uses instead of ISO-8859.
- Add a test for Clib::sanitizeUnicodeWithIso() to check if it's performing the conversion correctly (currently it is not).

* Fix stylecheck

* Revert changes to sanitizeUnicodeWithIso()

* Change test so it matches acceptable sanitizeUnicodeWithIso behavior.

* Fix warnings.

* Add corechanges.
2021-11-09 08:01:31 +01:00
Peter Wedder
f404591b1d
Fix SetString packet hook method writing UTF-8 instead of CP-1252 (#442)
* Fix SetString packet hook method writing UTF-8 instead of CP-1252. Add a new method, SetUtf8String, for writing UTF-8.

* Add functions that operate on whole strings.

* Fix a couple of bugs and add unit tests.

* Do not convert if the string doesn't contain any UTF-8

* Convert 0x80..0x9f control characters, which don't exist in cp1252, to question marks

* Fix SetUtf8String writing too few bytes if the string contained multi-byte UTF-8 characters

* Remove extraneous parameter from TextCommandScript documentation

* Update changes and docs
2021-11-02 22:00:36 +01:00
turleypol
bf27f27cd9
switched internal uworld.h WorldIterator to Pos class (#429)
removed >< operator to avoid missunderstandings
fixed helperscripts checkmembers/checkmethods
2021-09-21 20:17:04 +02:00
turleypol
95783a3226
removed ufacing move_delta, added getPos*Param (#424)
* removed ufacing move_delta, added getPos*Param

* renamed move_self to move_to
2021-09-12 14:39:06 +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
turleypol
5f79897e4b
Initial range class (#418)
* added area classes
first Area2d tests

* removed unneeded method

* area3d tests

* build fix

* remaining tests

* fixed typo

* zip coverage report before uploading

* renamed area to range. use std::minmax
2021-09-04 18:14:10 +02:00
turleypol
0df9b8c0f9
Initial pos class (#416)
* introduced position classes. Added Pos2d tests

* fixed pos3d comparison
added Pos3d tests

* return this in crop method

* more tests

* pos4d tests

* build fix

* more tests

* review changes: method names, includes
2021-09-03 18:33:25 +02:00
turleypol
07dda8273f
Initial vector class (#414)
* basic Vec2d, Vec3d class

* more tests
2021-08-30 22:20:29 +02:00
turleypol
cccf84dfc8
Fewer compile warnings (#413)
* added escriptgrammar as external lib where it belongs. Silenced warnings.

* bscript compiler warning fixes

* special include file to get rid of gcc warnings about antlr4

* misc windows warnings

* time specifc warnings

* buildfix + apple warnings

* never trust apple

* windows debug build warnings

* some windows clang warnings

* last warning fix
2021-08-28 22:26:15 +02:00
turleypol
f426a5bb8e
Unittests (#412)
* combined unittests with pol -test. Added it in ctest and integrated it in CI

* fixed compilation

* last compilation errors?

* pol -test needs some fixtures

* activated dynprops unittest

* fixed dynprop test
2021-08-23 07:58:42 +02:00
turleypol
dcc6beca4d removed intrusive list information in Attributes and Vitals
removed old way to write unicode strings
2020-08-02 12:51:24 +02: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
6107184258 only one global config include exists now 2018-06-17 18:31:55 +02:00
turleypol
d135860d71 fixed compiler warnings 2018-06-03 13:48:33 +02:00
turleypol
09485a0588 fixed missing header 2018-06-03 11:33:19 +02:00
turleypol
8bf52fd561 fixed pkt writer to use memcpy instead of violating strict aliasing. 2018-06-03 11:04:35 +02:00
turleypol
e761ed096d added small pkt test for upcomming changes 2018-06-02 22:37:14 +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
798eda5b63 Cleanup of header includes. 2018-01-01 21:52:14 +01:00
turleypol
4ab046ae06 Doubled speed of custom object method resolution 2017-12-20 16:52:39 +01:00
turley
6d50cce79a In the case of dynamic items near a LOS check (which is of cause all the
time the case) decreased runtime by another 40% due to pre filtering.
2016-12-18 17:03:27 +01:00
turley
cfd6f07235 try to fix windows build 2016-12-18 13:05:31 +01:00
turley
9094b3bd8c Optimized los check by introducing caching
added Google Benchmark lib (currently linux only)
compile with ENABLE_BENCHMARK see bin-build/build_tools.sh
2016-12-18 12:48:35 +01:00
turley
e621f23df8 fixed compilation error 2016-12-15 08:50:39 +01:00
turley
1da37b2523 Fixed program args parsing of runecl
Reenabled and fixed testmode for pol
2016-12-14 17:05:34 +01:00