46 Commits

Author SHA1 Message Date
Alex King
2a6cf8c8e7
[Strings] Add more number formatters (#2873)
* [Strings] Add more number formatters

# Notes
- Adds `Strings::ToUnsignedInt` for `uint32` support.
- Adds `Strings::ToBigInt` for `int64` support.
- Adds `Strings::ToUnsignedBigInt` for `uint64` support.
- Adds `Strings::ToFloat` for `float` support.
- Replaces all `std::stoi` references with `Strings::ToInt`.
- Replaces all `atoi` references with `Strings::ToInt`.
- Replaces all `std::stoul` references with `Strings::ToUnsignedInt`.
- Replaces all `atoul` references with `Strings::ToUnsignedInt`.
- Replaces all `std::stoll` references with `Strings::ToBigInt`.
- Replaces all `atoll` references with `Strings::ToBigInt`.
- Replaces all `std::stoull` references with `Strings::ToUnsignedBigInt`.
- Replaces all `atoull` references with `Strings::ToUnsignedBigInt`.
- Replaces all `std::stof` references with `Strings::ToFloat`.

* [Strings] Add more number formatters

- Adds `Strings::ToUnsignedInt` for `uint32` support.
- Adds `Strings::ToBigInt` for `int64` support.
- Adds `Strings::ToUnsignedBigInt` for `uint64` support.
- Adds `Strings::ToFloat` for `float` support.
- Replaces all `std::stoi` references with `Strings::ToInt`.
- Replaces all `atoi` references with `Strings::ToInt`.
- Replaces all `std::stoul` references with `Strings::ToUnsignedInt`.
- Replaces all `atoul` references with `Strings::ToUnsignedInt`.
- Replaces all `std::stoll` references with `Strings::ToBigInt`.
- Replaces all `atoll` references with `Strings::ToBigInt`.
- Replaces all `std::stoull` references with `Strings::ToUnsignedBigInt`.
- Replaces all `atoull` references with `Strings::ToUnsignedBigInt`.
- Replaces all `std::stof` references with `Strings::ToFloat`.

* Rebase cleanup

* Changes/benchmarks/tests

---------

Co-authored-by: Akkadius <akkadius1@gmail.com>
2023-03-04 17:01:19 -06:00
Chris Miles
f8e7576ae7
[File Paths] Implement Path Manager (#2440)
* Push up branch for testing

* Path manager

* Tweaks

* Changes

* More path work

* Update paths for eqemu_server.pl

* More path work

* Import and export client files

* Path remove

* More path work

* Update eqemu_config.h

* Fix tests

* Tests disable temp

* Update eqemu_config.h

* Update .drone.yml

* Hook tests back up

* Update main.cpp

* Platform tests

* Fix include

* Use std::filesystem on windows

* Fix IPCMutex name on windows

* std::filesystem changes

* Update path_manager.cpp

* Explicit string cast

* Explicit string cast

* Update path_manager.cpp

* Windows fixes

* Mapped files

* Relative fixes

* Use relative paths off of cwd

* Update Debian image to Debian 11 (updates GCC)

Co-authored-by: hg <4683435+hgtw@users.noreply.github.com>
2022-09-28 04:08:59 -05:00
Michael Cook (mackal)
edda5ef811
[Utility] Add std::string_view overloads for std::from_chars (#2392)
* Add std::string_view overloads for std::from_chars

std::from_chars floating point support is still pour, so we provide some
fall backs. These fall backs currently lack error handling.

(since GCC 11 and MSVC 2019 16.4 FP support is added, clang with libc++
still doesn't support FP)

GCC's floating point support is still rather pour (performance) and
probably shouldn't be used, but we have support to if people want to
now.

Probably need more test cases ...

* Fix issue with std::chars_format define lacking

My test case for lacking FP support was clang with libc++ which defined
this enum anyways.
2022-08-30 23:13:59 -05:00
hg
e65b61a95f
[Tasks] Implement task activity prerequisites (#2374)
Some live tasks make new elements available without requiring all
currently active ones to be completed first.

This adds the `req_activity_id` field to task activities which will mark
an element active if its required activity id is completed. If a valid
value is set then it's used instead of checking the current step.

The `step` field may still be set on rows with a valid `req_activity_id`
to specify its logical step and prevent later steps from becoming active
until completed. It's only ignored when deciding if the current element
is active.

The legacy task logic for unlocking activities was completely refactored
for this. A common method has been added so both zone and world can make
use of it to determine which elements are currently active. The previous
step system should remain unchanged.

The world logic for locking shared tasks when an element became active
did not account for "sequential" mode (all steps 0), unordered steps, or
gaps in step numbers. This also resolves that issue.
2022-08-21 19:55:19 -05:00
Michael Cook (mackal)
9488ee1e8c
[Bug Fix] Remove StringUtilTest::EscapeStringMemoryTest (#2310)
This was testing the old std::string EscapeString(const char *src,
size_t sz) which was removed since it's not used anywhere else.
2022-07-14 19:47:58 -05:00
Chris Miles
dfd8f84cac
[Strings] Refactor Strings Usage (#2305)
* Initial commit checkpoint

* More functions converted

* Commify

* More functions

* Fin

* Sort declarations

* Split functions between files

* Bots

* Update strings.h

* Split

* Revert find replaces

* Repository template

* Money

* Misc function

* Update CMakeLists.txt

* Saylink

* Update strings.cpp

* Swap Strings::Saylink for Saylink::Create since saylink is coupled to zone database

* API casings
2022-07-14 02:10:52 -05:00
Michael Cook (mackal)
0ebb1cc54c
Fix linking tests due to ddcb18418 (#1769) 2021-11-15 13:27:01 -05:00
Michael Cook (mackal)
dba3010c89
[Strings] Split String Optimizations (#1325)
* Switch the 2 split calls to SplitString

* Nuke duplicate split in favor of SplitString #1263

* Add a test for SplitString

* Optimize SplitString

Benchmarking:
--------------------------------------------------------------
Benchmark                       Time           CPU Iterations
--------------------------------------------------------------
bench_oldsplit               5201 ns       5201 ns     129500
bench_split                  1269 ns       1269 ns     548906

This is splitting a VERY long SpecialAbilities string. This is ~75%
speed up.
2021-04-22 23:36:39 -05:00
Michael Cook (mackal)
74ce20b256
Add string util search_deliminated_string (#1260)
This function takes a string of deliminated an see if another string is
one of those

This function also verifies it's not finding a substring
2021-02-23 11:52:34 -06:00
KimLS
c330904695 Fix for broken tests 2020-05-17 19:10:12 -07:00
Alex
058a722569
Revert "Revert "Build System Updated"" 2019-10-13 18:49:16 -07:00
Alex
b9f57f1f28
Revert "Build System Updated" 2019-10-12 21:07:06 -07:00
KimLS
72a922f2ba Changes to building 2019-08-25 14:45:54 -07:00
KimLS
0db70218e9 Merge fix 2016-11-19 15:54:31 -08:00
Uleat
8b5dd58e96 Renamed struct EQEmu::ItemBase to EQEmu::ItemData and class ItemInst to EQEmu::ItemInstance 2016-10-16 05:10:54 -04:00
Uleat
e29ec16759 Missed 2 reference changes 2016-10-15 22:23:50 -04:00
KimLS
5cad3f62d0 EQStream abstraction layer 2016-09-25 15:10:34 -07:00
Uleat
579efe83af Renamed EQEmu::Item_Struct to EQEmu::ItemBase to coincide with new inventory naming conventions (re-run shared_memory.exe) 2016-05-27 22:22:19 -04:00
Uleat
71f128731f Renamed and moved SkillUseTypes enumeration to EQEmu::skills::SkillType; eq_dictionary work 2016-05-25 18:50:26 -04:00
phredi
455223df1c fix to pass tests 2016-05-24 22:17:50 -05:00
phredi
5cd052458a fix for bin/tests to compile with configfileupdate 2016-05-24 21:53:37 -05:00
Uleat
3031365e1f Moved struct Item_Struct into namespace EQEmu 2016-05-21 04:54:18 -04:00
Michael Cook (mackal)
0f12a74074 Add bool EQEmu::IsSpecializedSkill(SkillUseTypes skill) 2014-09-25 21:40:31 -04:00
Michael Cook (mackal)
61b784e96e Add tests for skills utilities 2014-09-25 21:35:17 -04:00
KimLS
aa021addc1 Fix for potion belt name loading. 2014-09-25 04:00:06 -07:00
KimLS
0d12715d77 Data verification utils, not in use yet. Also added ability for lua packet to bypass the translation layer (dangerous) if a writer so desires (useful for quickly trying packet stuff) 2014-09-24 03:58:46 -07:00
KimLS
70d5983562 Added eqemu::any 2014-08-25 22:31:02 -07:00
KimLS
a612c3c006 Idiot kls missed a file 2014-08-24 16:30:02 -07:00
KimLS
412835d7fa Basic string tests, plus fix for StringFormat returning a std::string that was just very subtley malformed. 2014-08-24 16:26:51 -07:00
KimLS
7fc21b9e3a Tons of renames 2014-08-21 19:33:02 -07:00
KimLS
b7e36feeeb Removed more socket server stuff, changed some of the build stuff. 2014-07-14 15:44:28 -07:00
Michael Cook (mackal)
2cf546accd Fix #150 2014-05-05 18:23:55 -04:00
Corysia Taware
f6046477b4 Changes for intel Mac OSX build 2014-04-03 14:10:03 -07:00
Arthur Ice
c239964427 Tests for hextoi, hextoi64, atobool
const hextoi / hextoi64 / atobool. null check for each. tests for each.
2014-03-13 14:45:54 -07:00
Dmitry Marakasov
7ee417ab05 Simplify conditional linking with libdl 2013-10-09 19:27:52 +04:00
j883376
4bdd8b2502 Change space indentation to tabs 2013-05-09 11:37:51 -04:00
j883376
ffcff4aea1 Remove trailing whitespace 2013-05-09 11:13:16 -04:00
Arthur Ice
7560b6b0a7 NULL to nullptr 2013-05-04 18:06:58 -07:00
Arthur Ice
c8da17c664 Deleted the old and duplicated GNU license text 2013-03-02 11:58:39 -08:00
KimLS
b5405c35e2 Tests fix + fix for certain factions not loading 2013-02-28 22:33:20 -08:00
KimLS
c31b2b65c1 NPC Faction lists to new shared memory scheme 2013-02-23 13:45:19 -08:00
KimLS
39a77a855e Stupid design choice in cppunit fixt -.- 2013-02-23 00:37:12 -08:00
KimLS
6f13d0cfbc Partial work on loot tables (non-compiling) 2013-02-21 22:13:33 -08:00
KimLS
3e9c2a06a3 Items in shared memory 2013-02-20 22:36:30 -08:00
KimLS
23dbd00d40 Style + compile option for rvalue-move 2013-02-19 23:06:00 -08:00
KimLS
53d6e4000c Unit tests + cleanup 2013-02-17 13:36:39 -08:00