Commit graph

67 commits

Author SHA1 Message Date
turleypol
bce1154d7a
ClangTidy readability-else-after-return (#857)
* trigger tidy

* Automated clang-tidy change: readability-else-after-return

* compile test

* rerun

* Automated clang-tidy change: readability-else-after-return

* trigger..

* Automated clang-tidy change: readability-else-after-return

* manually removed a few

* Automated clang-tidy change: readability-else-after-return

* removed duplicate code

* fix remaining warnings

* fixed scope

---------

Co-authored-by: Clang Tidy <clang-tidy@users.noreply.github.com>
2026-01-18 09:35:52 +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
Kevin Eady
5cf6949ea7
Add support for regular expressions (#818)
* implementation

* tests

* maybe fix windows compilation?

* undo change of match_flag_type

* switch to boost regex

* move flags to BRegExp object

* fix tests due to cmake 4 update

* update grammar

* update prettifier

* move flag parsing to BRegExp ctor

* add AST nodes, update instr generation and execution

* copy tests but use regular expression literals

* fix grammar for handling division correctly

* modify return values a bit, update tests
- string.match: make groups hold structs of matched, offset
- string.match: add offset
- string.replace: use a groups array like string.match vs individual arguments

* bundle of changes

- standardize error messages
- add more tests for coverage
- move BRegExp creation to static method:  previous implementation had
  ctor throwing, which was no good inside executor since it didn't have
  a try/catch

* more tests; add OT_REGEXP to basic.em

* move string regex stuff to bregexp and support regex/wregex via std::visit

* maybe fix compilation errors?

* add unicode escape sequence handling

* really maybe fix compilation error?

* fix compiler warnings

* refactor a bit to remove duplicate code

* address discord comments
- just return wstring, no need for vector<wchar_t> method

* Add string.split by string and regexp

* Use Max_Split instead of Limit
This makes it match basic::SplitWords

* add support for empty string delim in SplitWords

* remove duplicate code across string.split and mf_SplitWords

* Squashed commit of the following:

commit b3148e069f
Author: turleypol <turley@polserver.com>
Date:   Sat Sep 27 17:02:22 2025 +0200

    memorylocation of input string is not allowed to changed, switched back
    to uniqueptr

commit 5a4d1c8fcb
Author: turleypol <turley@polserver.com>
Date:   Sat Sep 27 10:18:01 2025 +0200

    no need to use ptr for input

commit 90fa0edc66
Author: turleypol <turley@polserver.com>
Date:   Sat Sep 27 09:56:29 2025 +0200

    fixed typo

commit bed4ff3ac9
Author: turleypol <turley@polserver.com>
Date:   Sat Sep 27 09:47:36 2025 +0200

    make Callback for BContinuation move only

* use uninit when group isn't matched

* fix multiline flag handling; add test

* add docs and doc example tests

* some cleanup

* address review comments
- allow move assignment

* add core-changes
2025-11-17 18:02:45 +01:00
turleypol
17911b23aa
impptr_if method/impptrIf function to test and return Imp derived classes (#685)
* impptr_if method/impptrIf function to test and return Imp derived
classes.
Simplified a few spots

* more usage of impptr

* fix makeDouble

* fix warnings

* more warnings

* more warnings..

* replaced new/remaining casts

* non owning imp* needs to be protected

* silly me
2024-08-07 22:14:52 +02:00
turleypol
271a1105ba
added explicit targets for every 3rd party lib (#612)
* added explicit targets for every 3rd party lib
these contain include dirs/libs/compiler defs

* moved each 3rd party lib into a version folder, to give each target a
dedicated include directory.
Now noone should add lib root folder as include dir
Used private linking where possible
disabled building of boost, wasnt used at all

* regnerate boost cache
adapted targets for coverity
2024-01-27 09:06:23 +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
Kevin Eady
469a454446
Add prettify argument to PackJSON() (#520)
* Add prettify argument to PackJson()

* simplify test
2023-04-28 09:44:22 +02:00
Eric Swanson
2cae8137f3
Enable building on OSX (clion) (#318)
* Build on OSX

* Add macos-latest to build matrix

* Fix case sensitivity checks/tests

* On osx builds, cope with unpacking a double that might be followed by either an exponent or an error (as part of an array).

Also, remove static unpack(const char*) forms that were never called.

Co-authored-by: turleypol <turley@polserver.com>
2020-09-26 06:57:10 -07:00
Kevin Eady
12d6186d10
Script option enhancements (#118)
* Fix SCRIPTOPT_CAN_ACCESS_OFFLINE_MOBILES

* Add SCRIPTOPT_SURVIVE_ATTACHED_DISCONNECT

* wip beginning work on templatization

* Use PolModule in pol-specific modules

* wip, creating PolModule with getXYZParam

* wip 1, moving getXYZ to UOExecutor

* compilable with PolObjectImp / PolApplicObj

* add type guard

* wip, change signatures

change signatures of script_method, script_method_id, and
custom_script_method

* compilable (windows)

* linux fixes

* namespace fixes

* remove uoexhelp

* formatting

* compilable

- move can_access_offline_mobiles back to uoexec
- add guildscrobj and partyscrobj sources
- move EGuildRefObjImp and EPartyRefObjImp
- wip, implement asUOExec
- formatting uoexec.cpp,.h

* finish uoexec() helper

* some cleanup
2020-02-08 09:21:35 +01:00
turleypol
568ebfea96 fixed more memleaks 2020-01-03 19:17:07 +01:00
turleypol
7e8f92bc85 rewrote module function generation, maybe this works 2019-11-10 22:04:08 +01:00
Kevin Eady
ca850a0c76 project refactoring 2019-10-18 21:32:30 +02:00
Kevin Eady
5c0fb7c4ea First support for .em-parsed module function tbls
- Create module parser custom target
- Include generated tables in .cpp sources
- Standardize module function names based off .em names
2019-10-17 22:37:26 +02:00
Kevin Eady
b55e852a5b wip 1 2019-10-17 19:08:49 +02:00
turleypol
aa96dfc300 binaryfile readstring should validate the string.
no need for basicmod compare to create the strings on the heap
removed doxygen experiment
fixed compiler warning about cast in uotool
2019-08-17 13:51:45 +02:00
turleypol
8c7ed986a9 CAsc(Z)/CChr(Z) use utf16, if CChr() cannot represent it with a single
number return an error.
Fixed problem with RequestInput using the unicode version
Updated em file comments
2019-01-04 13:18:53 +01:00
turleypol
a6c7a471a1 simplified string api, converted requestinputuc return packet 2019-01-01 15:47:27 +01:00
turleypol
366f7e7122 Merge remote-tracking branch 'upstream/master'
* upstream/master: (45 commits)
  renamed mobile syshook to character used unique_ptr for all syshooks
  added docs
  code simplification, deprecate warning for uoclient.cfg MethodScript entry
  party and guild ref support docs and testing left?
  custom methods for client and account references
  fixed line length
  syshooks for npc/mobiles
  first round for scripted object class methods
  Fixed formatting error.
  Added new return option to consume ammunition hook which allows the hook to make the core continue with the usual ammunition checks.
  Fix critical bug in FindObjtypeInContainer()
  fixed compiler warning
  fixed linesize
  windows fixes
  Added cmake option to run clang-tidy used everywhere nullptr
  Changed classes to be final if possible, removed override macro
  Added additional documentation.
  next..
  clang 7 is currently untrusted... next try 6 ;)
  fixed new clang warnings, new compiler version on travis (lets see how many commits are needed till it works)
  ...

Conflicts:
	.travis.yml
	pol-core/bscript/impstr.h
	pol-core/clib/cfgfile.cpp
	pol-core/pol/module/npcmod.cpp
2018-10-14 14:00:33 +02:00
esdete
dc2d29b433 NULL to nullptr 2018-07-31 14:30:29 +02:00
turleypol
f37d500f72 fix msvc warnings 2018-07-20 20:46:59 +02:00
DevGIB
680fc9c3ea Removed non uTF-8 compatible characters 2018-07-21 00:11:02 +08:00
DevGIB
e74d8c58c7 Clang Format Cleanup 2018-07-20 21:28:09 +10:00
GIB
06667e0481 Fixed encode so it actually works and updated documentation. 2018-07-19 23:24:32 +08:00
DevGIB
881d2cdbf4 Initial Base64 Work. 2018-07-20 00:28:01 +10:00
turleypol
84afea1bc1 unicode: find and compare 2018-06-25 19:31:00 +02:00
turleypol
f3d92ad172 more utf8 support 2018-06-25 19:30:59 +02:00
turleypol
af5d3f38d7 utf8 work in progress 2018-06-25 19:30:59 +02:00
Gabriele Tozzi
b72f725e02 Whitespace fixes 2018-04-03 04:13:03 +02:00
turleypol
3afc41241b
CMake on windows (#48)
CMake can now also be used for windows
2018-02-24 22:34:55 +01: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
Kevin Eady
e50bd96f47 More changes from review 2018-01-11 15:58:09 +01:00
Kevin Eady
806e89d54e Comments based off Turley's review. Also some cleanup. 2018-01-11 14:55:27 +01:00
Kevin Eady
92f234ed27 Add boolean to json stuff, and some cleanup 2018-01-07 02:12:13 +01:00
Kevin Eady
af4de9a1a4 Correct invalid merge; fix folder name for pol project 2018-01-05 21:00:48 +01:00
Kevin Eady
642c3700fc Merge master and fix conflicts 2018-01-05 20:49:30 +01:00
Kevin Eady
a28cd9c42c Initial implementation of json 2018-01-05 20:40:14 +01:00
turleypol
ef2108c9f7 New objecttype Boolean.
create via basic::Boolean(1/0)
only == != ! operators are implemented.
2018-01-05 20:04:01 +01:00
turleypol
798eda5b63 Cleanup of header includes. 2018-01-01 21:52:14 +01:00
Fernando Rozenblit
9475bc0299 Fixed crash in SplitWords due to outdated .em files 2017-05-28 11:30:19 +02:00
Fernando Rozenblit
eb34290222 Cleanup for modules' function tables 2017-01-24 21:57:16 +01:00
turley
f9c3db9e41 Modules share the same (helper) template base class
Optimize function name search for all modules not only uo by using an additional map, replaced c array with vector for functionsdef.
Simplified pragma pack order. (MSVC version is supported in all
compilers)
Removed compilerassert.h (asserteql,..) replaced with static_assert
Removed some old #ifs
2016-12-20 23:53:32 +01:00
turley
4d9aa75f3b Corrected definition order in module defs 2016-12-14 21:50:23 +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
turley
ed7b16b233 normalized lineendings 2016-02-11 22:54:43 +01:00
Gabriele Tozzi
d1ac902926 Documentation: reformatted headers for DoxyGen 2016-01-28 14:52:40 +01:00
turley
2ca9cac2e0 Moved fileaccess storage 2015-01-02 16:31:10 +01:00
frozenblit
c4cb100279 Some more stl_inc.h cleanups 2014-11-01 19:16:13 +01:00
turley
3a15fd38af fixed 64bit linux hex display 2014-08-16 17:03:32 +02:00
frozenblit
5431134b66 Fixed warning in basicmod.cpp. Rewrote clib::mkupper/clib::mklower to use boost::to_lower, boost::to_upper. Same for clib::strlower/clib::strupper. 2014-06-09 22:48:52 +00:00
dsourc
c61c4127c5 fixed crashes when parent script is killed before child script returns
fixed crashes when reporting error in an armordesc entry defined in config\itemdesc.cfg
fixed warning about streamoff conversion to int
2014-02-27 14:26:49 +00:00