Commit graph

76 commits

Author SHA1 Message Date
turleypol
24c8c8b92f
Tidy modernize for loops (#862)
* trigger loop convert

* Automated clang-tidy change: modernize-loop-convert

* fixed refactor

* Automated clang-tidy change: modernize-loop-convert

* compile

* first look through

* fixes and start to use a few ranges

* revert autogenerated file

* compilation fix

* second pass

* renamed loop variable

---------

Co-authored-by: Clang Tidy <clang-tidy@users.noreply.github.com>
2026-01-31 09:14:02 +01:00
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
c882c42a31
misc clang-tidy (#853)
* trigger tidy

* Automated clang-tidy change: modernize-use-equals-delete,modernize-make-shared,modernize-make-unique,modernize-use-constraints,readability-container-size-empty,modernize-redundant-void-arg,modernize-use-emplace

* removed non needed macros

* missed to disable tidy build

---------

Co-authored-by: Clang Tidy <clang-tidy@users.noreply.github.com>
2026-01-16 12:22:43 +00: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
ec91d7cc3c
Codecleanup from #581 (#583)
* is_visible_to_me checks now also in_visual_range
added obj::distance_to
fixed warnings

* no magic numbers for snprintf
2023-12-26 17:47:40 +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
830daf726e
Fix crash when event queue is full (#521)
* each SpeechEvent needs to contain a copy of the speechtokens

* added core changes

* prevent memoryleak

* add basic pol test

* Remove extraneous prints in test

* Address review comments
- Refactor token encoding into a method

---------

Co-authored-by: Kevin Eady <8634912+KevinEady@users.noreply.github.com>
2023-05-12 20:45:40 +02: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
turleypol
f99ab2dbaf
switched internals of realms, changed packetdefs (#432)
* switched internals of realms, changed packetdefs

* restructured ListenPoint a bit

* moved actual listenpt code to private method

* simplified listenptr loop and the same for guilds to fix ancient fixme

* added todo for future us
2021-10-26 10:52:13 +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
d010f617c9 fixed unknown command text 2020-01-03 19:25:46 +01:00
turleypol
37f0691b10 optimzied a bit ascii speech handling 2019-09-06 21:02:14 +02:00
turleypol
7f8b5055b2 no need to strip tilde chars from speech
added small early out test for textcmds
simplified _unicode params
2019-01-16 21:24:41 +01:00
turleypol
8b085e86ef dont assume a tainted string by default
cfgfiles (which includes savefiles, datafiles) get sanizized on read,
filemod::readfile, xml module, sql handled
old ascii speech packets handled
2019-01-12 17:14:05 +01:00
turleypol
d0b74d6da6 added first docs, cleanup of first todos 2019-01-03 18:58:13 +01:00
turleypol
b032dc8065 cleanup of sysmsg unicode 2019-01-03 17:44:20 +01:00
turleypol
ee92a503bf updated speech code 2019-01-02 23:35:38 +01:00
turleypol
9372421d93 simplified unicode send functions 2018-12-31 20:07:22 +01:00
turleypol
a89886a0ce Merge remote-tracking branch 'origin/master' into utf8
* origin/master:
  more network specific code moved
  moved pkt headers into network folder
  fixed argument count for DepletedFunction
  Updated cotire, updated pch
  Added vitals.cfg DepletedFunction gets called once the vital reaches zero removed UnderFlowFunction since it was never used
2018-12-31 10:37:35 +01:00
turleypol
9cfb4ec5a5 moved pkt headers into network folder 2018-12-30 21:35:54 +01:00
turleypol
1898b1687c Merge remote-tracking branch 'origin/master' into utf8
* origin/master:
  fixed leak in compiler and xml filemod ecompile/runecl no longer try to log to pol logs activated xml unittest print stderr on testfailure

Conflicts:
	testsuite/escript/config/fileaccess.cfg
	testsuite/escript/filemod/xml.ins
2018-12-23 14:28:37 +01:00
turleypol
1c57ac43cf renamed all unicode speech functions for easier refactoring 2018-12-23 10:24:46 +01:00
turleypol
25dae4fc21 fixed namespaces of moved files 2018-12-22 00:32:47 +01:00
turleypol
aadea18796 renamed mobile syshook to character
used unique_ptr for all syshooks
2018-10-14 13:13:16 +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
798eda5b63 Cleanup of header includes. 2018-01-01 21:52:14 +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
d1ac902926 Documentation: reformatted headers for DoxyGen 2016-01-28 14:52:40 +01: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
turley
da3e2291d0 Equipment has a fixed member for quality
Moved the 3 pointers for parties and the guild pointer into the dynprops.
2015-05-16 10:30:34 +02:00
turley
64d8fdb310 Moved npc files into mobiles dir, changed the namespace accordingly
removed some old code
2015-01-16 19:44:07 +01:00
turley
79dff37246 Splitted gamestate external. 2015-01-02 14:46:44 +01:00
turley
88ec380941 Moved globals into separate directory. 2014-12-30 15:20:59 +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
turley
dd4d4c0f9a Added new WorldIteratorFilter for active client only players
Fixed warning during pkt write of sound effects.
2014-11-21 21:28:09 +01:00
frozenblit
943b820eba More and more cleanups
Added some missing include guards, corrected wrong include guard names.
Removed more stl_inc.h includes.
2014-11-02 19:40:40 +01:00
frozenblit
ed679dba3d Moved message handling code into its own cpp
Created a new file (msghandl.cpp) and moved the code from pol.cpp there.
Moved related files to the "network" folder, where they belong. Fixed
include names... (we should make this relative to the project root!)
2014-10-01 21:10:32 +02:00
turley
54b4691bdd c++11 random mersenne twister usage added (patch submitted by Kimungu)
started to split the packet build logic into own classes (SendWorldItem/Multi checks itself which packet version needs to be build)
2014-08-01 17:05:58 +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
261052f48d cleanup of the world iteration methods 2014-01-19 15:25:48 +00:00
turley
31ee263a45 activated new logging facility 2014-01-18 13:29:38 +00:00
turley
47fec4bdf5 splitted world zones into players and npcs, added several helper functions to only interate over the wanted types (player+npcs,player,npc,items,multis) best usable with lambdas. 2013-12-31 14:14:04 +00:00
turley
99d7dc3037 namespaces...finally :)
Hard part is finished every file is touched. Namespaces are currently rough named by directory name.
Maybe we could split it more
2013-12-21 09:10:46 +00:00
turley
4c7f70fc79 first version of a generic message_queue (currently not lockfree, need to test more)
replaced old auto_ptr with unique_ptr
2013-09-13 18:07:19 +00:00
turley
248eee150e fixed possible speechtoken crash 2012-12-31 10:33:41 +00:00
turley
6dbae04c16 codecleanup 2012-11-05 11:21:22 +00:00
KevinEady
b89a192b7e fixed alliance chat bug fix... :p 2012-09-26 03:11:41 +00:00
KevinEady
72bf851e18 09-25-2012 Kevin:
Fixed:      Guild and alliance messages no longer send as regular speech messages. They are sent to all guild or alliance members online.
  Added:      servspecopt.cfg CoreGuildMessages=0/1 default 1 to determine if core should handle guild and alliance messages.
2012-09-26 00:38:47 +00:00