Compare commits

...
195 Commits
Author SHA1 Message Date
amacocian f218b89f6c Match Guildwars folder name structures (#938) 2025-04-27 16:01:22 +02:00
amacocian cc607b37c9 Release 0.9.9.63 (#937) 2025-04-27 16:01:22 +02:00
amacocian f80ea8cf0c Inject toolbox before GW initialization (#935) (#927) 2025-04-26 15:48:54 +02:00
amacocian 39f6707d23 Release 0.9.9.62 (#934) 2025-04-26 15:48:54 +02:00
amacocian eb11029ece Update pipeline runtimes (#933) 2025-04-25 02:42:36 +02:00
amacocian 4583b5b2d3 Fix toolbox injection (Closes #927) (#931) 2025-04-25 02:42:36 +02:00
amacocian 8c01377667 Update .NET9 runtime (#930) 2025-04-25 02:42:36 +02:00
amacocian 9a130d71dd Release 0.9.9.61 (#929) 2025-04-25 02:42:36 +02:00
amacocian 018ed6c5b5 Update dependencies (#928) 2025-04-25 02:42:36 +02:00
amacocianandGitHub cb48248c82 Change VirusTotal publish folder (#913) 2024-12-11 17:18:54 +01:00
amacocianandGitHub e1284375e2 Add debugging info to CD pipeline (#912) 2024-12-11 12:34:00 +00:00
amacocianandGitHub d38d620a84 Add VirusTotal scanning to CD pipeline (#911) 2024-12-11 11:36:39 +00:00
amacocian ce810dafab Support for toolbox builds (#908)
Closes #866
2024-12-10 14:50:59 +01:00
amacocian aabc98e4fc Build template metadata with support for hero positions. Closes #906 (#907) 2024-12-10 14:50:59 +01:00
amacocian 7eb0b7cc4f Release 0.9.9.60 (#905) 2024-12-10 14:50:59 +01:00
amacocian f1eb829ac4 Fix non-persistent notifications showing up after expiring. Closes #901 (#903) 2024-12-07 15:37:53 +01:00
amacocian 4b03a5a16f Increase memory scanner responsiveness (#902) 2024-12-07 15:37:53 +01:00
amacocian 71c90100be Fix memory scanner deadlock. Closes #899 (#900) 2024-12-07 15:37:53 +01:00
amacocian ee512d130d Fix launch button text when Focus View is disabled. Closes #897 (#898) 2024-12-07 15:37:53 +01:00
amacocian 03d0759e57 Release 0.9.9.59 (#896) 2024-12-07 15:37:53 +01:00
amacocian 0db7628d66 Cleanup GWCA dependencies (#895) 2024-12-06 21:19:01 +01:00
amacocian d1d1ba6c08 Fix build pipelines (#894) 2024-12-06 21:19:01 +01:00
amacocian d16a88a9bc Remove submodules file (#893) 2024-12-06 21:19:01 +01:00
amacocian a9d93f4162 Update dependencies (#891) 2024-12-06 21:19:01 +01:00
amacocian 632b5a55ac Remove GWCA (#890) Closes #889 #887 2024-12-06 21:19:01 +01:00
amacocian 6424505631 Release 0.9.9.58 (#888) 2024-12-06 21:19:01 +01:00
amacocian dfc1d3ba0a View for Guild Wars Party Search (#880)
Closes #877
2024-11-22 20:19:04 +01:00
amacocian 5bee88016d Upgrade vulnerable testing package (#879) 2024-11-22 20:19:04 +01:00
amacocian 5a37250680 Release 0.9.9.57 (#878) 2024-11-22 20:19:04 +01:00
amacocian 1c4ccb9fa3 Update dependencies (#874) 2024-11-22 15:09:42 +01:00
amacocian 8403dadca7 Patch GWCA module to not rely on the GW Window to start the http server. To be reverted once GWCA is patched (#871) (#873) 2024-11-22 15:09:42 +01:00
amacocian 4ac4cb0886 Check and update toolbox version (#872) 2024-11-22 15:09:42 +01:00
amacocian 74f13d2447 Update GWCA (#869) 2024-11-22 15:09:42 +01:00
amacocian bf53793729 Release 0.9.9.56 (#868) 2024-11-22 15:09:42 +01:00
amacocian e69dbf6791 Fix error test (#864) 2024-11-17 16:25:36 +01:00
amacocian a0eafa8a13 Setup button for bug reporting (#862)
Overhaul bug exception window
Closes #784
2024-11-17 16:25:36 +01:00
amacocian b0a236beb4 Use safe DateTime conversion (#861) 2024-11-17 16:25:36 +01:00
amacocian c10b81f3a1 Release 0.9.9.55 (#860) 2024-11-17 16:25:36 +01:00
amacocian 6cd51d6584 Fix theme sync (#858)
Closes #857
2024-11-16 00:16:40 +01:00
amacocian a283117cc8 Remove Minimap and InventoryComponent (#856)
Closes #855
2024-11-16 00:16:40 +01:00
amacocian 329e64232c Stop spamming when datetime conversion fails. This is a temporary fix for the spam (#854)
Closes #852
2024-11-16 00:16:40 +01:00
amacocian feb3c9042e Release 0.9.9.54 (#853) 2024-11-16 00:16:40 +01:00
amacocian 71f15f56a4 Update dependencies (#850) 2024-11-13 15:10:02 +01:00
amacocian d37951b832 Update GWCA (#849) 2024-11-13 15:10:02 +01:00
amacocian 908a149df4 Release 0.9.9.53 (#848) 2024-11-13 15:10:02 +01:00
amacocian 38cf140dfa Update GWCA (#838) 2024-10-23 22:57:08 +02:00
amacocian d13e1a2d08 Migrate db engine to Realm (#837) 2024-10-23 22:57:08 +02:00
amacocian a0c7842b84 Update dependencies (#836) 2024-10-23 22:57:08 +02:00
amacocian de13b68633 Release 0.9.9.52 (#835) 2024-10-23 22:57:08 +02:00
amacocian f289602068 Update dependencies - fixes critical System.Text.Json vulnerability (#831) 2024-10-10 12:01:01 +02:00
amacocian 15f4ee8979 Release 0.9.9.51 (#830) 2024-10-10 12:01:01 +02:00
amacocian d826dea457 Use sell quotes. Add sell prices and buy prices to trade quote view (#825) 2024-10-07 11:44:47 +02:00
amacocian b89a6666a3 Update dependencies and replace deprecated packages (#824) 2024-10-07 11:44:47 +02:00
amacocian 1dc69fd0c2 Release 0.9.9.50 (#823) 2024-10-07 11:44:47 +02:00
amacocian 5005b07f09 Update GWCA module (#819) 2024-09-27 17:37:40 +02:00
amacocian 0b692165e0 Update dependencies (#818) 2024-09-27 17:37:40 +02:00
amacocian ffee0fdf4c Release 0.9.9.49 (#817) 2024-09-27 17:37:40 +02:00
amacocian 72b4cd5470 Update GWCA (#808) 2024-08-20 17:34:59 +02:00
dependabot[bot]amacociandependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
dc9be53ace Bump MSTest.TestAdapter from 3.5.0 to 3.5.2 (#795)
Bumps [MSTest.TestAdapter](https://github.com/microsoft/testfx) from 3.5.0 to 3.5.2.
- [Release notes](https://github.com/microsoft/testfx/releases)
- [Changelog](https://github.com/microsoft/testfx/blob/main/docs/Changelog.md)
- [Commits](https://github.com/microsoft/testfx/compare/v3.5.0...v3.5.2)

---
updated-dependencies:
- dependency-name: MSTest.TestAdapter
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Macocian Alexandru Victor <amacocian@yahoo.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Macocian Alexandru Victor <amacocian@yahoo.com>
2024-08-20 17:34:59 +02:00
dependabot[bot]amacociandependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
3a8a6b0f7f Bump MSTest.TestFramework from 3.5.0 to 3.5.2 (#797)
Bumps [MSTest.TestFramework](https://github.com/microsoft/testfx) from 3.5.0 to 3.5.2.
- [Release notes](https://github.com/microsoft/testfx/releases)
- [Changelog](https://github.com/microsoft/testfx/blob/main/docs/Changelog.md)
- [Commits](https://github.com/microsoft/testfx/compare/v3.5.0...v3.5.2)

---
updated-dependencies:
- dependency-name: MSTest.TestFramework
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-20 17:34:59 +02:00
amacocian 7cdd0534f6 Set version checker as first mod in the list (#807)
Closes #778
2024-08-20 17:34:59 +02:00
amacocian 4b14ab9312 Add database cleanup (#806)
Closes #791
2024-08-20 17:34:59 +02:00
amacocian 57e1ddb8da Release 0.9.9.48 (#805) 2024-08-20 17:34:59 +02:00
amacocian c7609c0f7e Update dependencies (#803) 2024-08-20 16:34:04 +02:00
amacocian 1eca8021d2 Fixes for stuttering on image and notification load (#802) 2024-08-20 16:34:04 +02:00
amacocian 0077f35c4d Fix a bug in credentials migrator that would delete newly created credentials (#801) 2024-08-20 16:34:04 +02:00
amacocian 28b0a0a138 Release 0.9.9.47 (#800) 2024-08-20 16:34:04 +02:00
amacocian cc7ce92013 Update dependencies (#789) 2024-07-18 12:15:25 +03:00
amacocian 5bd02e56ee Ignore operation canceled exceptions (#788) 2024-07-18 12:15:25 +03:00
amacocian 8c7cd0a562 Bugfix for executable paths exception (#787) 2024-07-18 12:15:25 +03:00
amacocian 3ab3f72366 Release 0.9.9.46 (#785) 2024-07-18 12:15:25 +03:00
amacocian 733883a6c2 Check executables for fixes and updates (Closes #763) (#772) 2024-07-07 16:55:34 +03:00
amacocian d1ed8aeaf6 Fix GWCA module (#771) 2024-07-07 16:55:34 +03:00
amacocian 66ad44b8ce Update GWCA (#770) 2024-07-07 16:55:34 +03:00
amacocian 18e51ae408 Fix Nahpui Quarter missing id (Closes #761) (#769) 2024-07-07 16:55:34 +03:00
amacocian 06940dbf38 Update dependencies (#768) 2024-07-07 16:55:34 +03:00
amacocian 875b29f8ba Daybreak maintains and updates executables (#767) 2024-07-07 16:55:34 +03:00
amacocian a953c3a0d3 Release 0.9.9.45 (#766) 2024-07-07 16:55:34 +03:00
amacocian ce198fcfc9 Update GWCA (#759) 2024-06-11 15:03:37 +02:00
amacocian 3d84648af2 Update test dependencies (#757) 2024-06-11 15:03:37 +02:00
amacocian 38bb43bba3 Daybreak paths now fall back to root Daybreak folder (Closes #716) (#756)
* Daybreak paths now fall back to root Daybreak folder (Closes #716)

* Fix some more paths
2024-06-11 15:03:37 +02:00
amacocian cc00709016 Show skill icons in skill list menu (Closes #747) (#755)
* Show skill icons in skill list menu (Closes #747)

* Remove unused code
2024-06-11 15:03:37 +02:00
amacocian ee02b3b49a Download Gw.exe directly (Closes #753) (#754)
* Download Gw.exe directly (Closes #753)

* Downloader improvements
2024-06-11 15:03:37 +02:00
amacocian d1d6b7d757 Update GWCA module (#752) 2024-06-11 15:03:37 +02:00
amacocian 4e1c0c4f50 Save dump on crash (Closes #749) (#751) 2024-06-11 15:03:37 +02:00
amacocian 2a7e2c90fc Update dependencies (#750) 2024-06-11 15:03:37 +02:00
amacocian 0dc957a99d Release 0.9.9.44 2024-06-11 15:03:37 +02:00
amacocian f3f0aeb97e Update GWCA (#736) 2024-05-22 13:09:53 +02:00
amacocian d6dbe6f2cd Freeze layouts calculations on resize (Closes #734) (#735) 2024-05-22 13:09:53 +02:00
amacocian 79da1801bc GWCA Debug Module (#733) 2024-05-22 13:09:53 +02:00
amacocian 2b692b2d88 Update GWCA (#732) 2024-05-22 13:09:53 +02:00
amacocian a7a98f7288 Release 0.9.9.43 (#731) 2024-05-22 13:09:53 +02:00
amacocian 5d27d9c380 Update GWCA plugin (#729) 2024-05-10 23:09:23 +02:00
amacocian fb4185b541 Update httplib (#728) 2024-05-10 23:09:23 +02:00
amacocian d2d6e87e12 Add timeouts to GWCA modules (Closes #725) (#727) 2024-05-10 23:09:23 +02:00
amacocian 354cdda109 Release 0.9.9.42 (#726) 2024-05-10 23:09:23 +02:00
amacocian 83429e264a Update GWCA (#723) 2024-05-09 10:33:05 +02:00
amacocian ffdf374cdd Allow mods to cancel Guild Wars startup (Closes #717) (#721) 2024-05-09 10:33:05 +02:00
amacocian aed34608ee Improve GWCA plugin logging (Closes #718) (#720) 2024-05-09 10:33:05 +02:00
amacocian 18981e131d Release 0.9.9.41 (#719) 2024-05-09 10:33:05 +02:00
amacocian fe0a77d89d Fix automatic screen placer (Closes #708) (#714) 2024-05-06 00:27:48 +03:00
amacocian dbfd555f0d Improve detection of Guild Wars launching successfully (Closes #712) (#713) 2024-05-06 00:27:48 +03:00
amacocian 85d4ac3a29 Remove price checker (now incl. in Toolbox) (Closes #707) (#711) 2024-05-06 00:27:48 +03:00
amacocian dcb983d3de Update GWCA (#710) 2024-05-06 00:27:48 +03:00
amacocian ba1e4348ad Release 0.9.9.40 (#709) 2024-05-06 00:27:48 +03:00
amacocian 04bc7cffc6 Update GWCA (Closes #696) (#705) 2024-05-01 12:35:14 +03:00
amacocian 01b74a936b Rewrite GWCA module for better maintainability (#702)
* Use game thread enqueue method

* Remove manual memory handling

* Use game thread enqueue method

* Remove manual memory handling

* Setup module classes
2024-05-01 12:35:14 +03:00
dependabot[bot]amacociandependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
654b6bc10f Bump HtmlAgilityPack from 1.11.60 to 1.11.61 (#704)
Bumps [HtmlAgilityPack](https://github.com/zzzprojects/html-agility-pack) from 1.11.60 to 1.11.61.
- [Release notes](https://github.com/zzzprojects/html-agility-pack/releases)
- [Commits](https://github.com/zzzprojects/html-agility-pack/compare/v1.11.60...v1.11.61)

---
updated-dependencies:
- dependency-name: HtmlAgilityPack
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-01 12:35:14 +03:00
amacocian c9e6b9f626 Shortcut auto-place no longer removes arguments (Closes #695) (#701) 2024-05-01 12:35:14 +03:00
amacocian 554f1aea9b Fix extracted minimap not updating (Closes #698) (#700) 2024-05-01 12:35:14 +03:00
dependabot[bot]amacociandependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
6fb817855c Bump SharpCompress from 0.37.0 to 0.37.2 (#697)
Bumps [SharpCompress](https://github.com/adamhathcock/sharpcompress) from 0.37.0 to 0.37.2.
- [Release notes](https://github.com/adamhathcock/sharpcompress/releases)
- [Commits](https://github.com/adamhathcock/sharpcompress/compare/0.37.0...0.37.2)

---
updated-dependencies:
- dependency-name: SharpCompress
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-01 12:35:14 +03:00
amacocian b3f5fadfe3 Release 0.9.9.39 (#699) 2024-05-01 12:35:14 +03:00
DubbleClick 9275b7a7f8 simpler PreGameModule, test this 2024-04-28 23:14:58 +02:00
DubbleClick 2d06ff85b8 ignore .idea folder 2024-04-28 23:00:38 +02:00
amacocian 07d06313d9 Support for GuildWars launch arguments (Closes #691) (#693) 2024-04-27 13:46:53 +02:00
amacocian 546409130c Auto launch configuration (Closes #689) (#692) 2024-04-27 13:46:53 +02:00
amacocian 82436872f8 Launch argument support (Closes #689) (#690) 2024-04-27 13:46:53 +02:00
amacocian ad6f76af0c Event notification expiration set to 15s (Closes #686) (#688) 2024-04-27 13:46:53 +02:00
amacocian 8f0ad91a22 Bundle quote alerts (Closes #676) (#687) 2024-04-27 13:46:53 +02:00
amacocian 6a70c5b7cc Fix 'yearss' typo in Trade chat (Closes #677) (#685) 2024-04-27 13:46:53 +02:00
amacocian 5f5d67fdf2 Release 0.9.9.38 (#684) 2024-04-27 13:46:53 +02:00
dependabot[bot]andamacocian 150b41647a Bump SharpCompress from 0.36.0 to 0.37.0 (#675)
Bumps [SharpCompress](https://github.com/adamhathcock/sharpcompress) from 0.36.0 to 0.37.0.
- [Release notes](https://github.com/adamhathcock/sharpcompress/releases)
- [Commits](https://github.com/adamhathcock/sharpcompress/compare/0.36.0...0.37.0)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-26 20:48:21 +02:00
amacocian 66e52e7324 Remove redundant GWCA calls on non-visible components (#681) 2024-04-26 20:48:21 +02:00
amacocian 23328240a9 Fix launch button spamming GWCA (#680) 2024-04-26 20:48:21 +02:00
amacocian 3f06e9486d Setup release 0.9.9.37 (#678) 2024-04-26 20:48:21 +02:00
dependabot[bot]amacociandependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
52a8e912e9 Bump Microsoft.Web.WebView2 from 1.0.2420.47 to 1.0.2478.35 (#669)
Bumps Microsoft.Web.WebView2 from 1.0.2420.47 to 1.0.2478.35.

---
updated-dependencies:
- dependency-name: Microsoft.Web.WebView2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-23 14:59:34 +02:00
amacocian 641aa8250e Minimap player arrow (#673) 2024-04-23 14:59:34 +02:00
amacocian faa47f32c7 Minimap angle (#672) 2024-04-23 14:59:34 +02:00
amacocian e3dac780df Update GWCA (#671) Closes (#668) 2024-04-23 14:59:34 +02:00
amacocian dfc0f12150 Release 0.9.9.36 (#670) 2024-04-23 14:59:34 +02:00
amacocian 638fb38fa0 Fix exception when extracting maximized minimap (Closes #662) (#666) 2024-04-22 14:33:10 +02:00
amacocian 4d6a06ccdf Floodplains of Mahnkelon id (Closes #653) (#665) 2024-04-22 14:33:10 +02:00
amacocian 3228604876 Item modifiers improvements (#664)
* Improve modifiers check for items

* Update minor vigor
2024-04-22 14:33:10 +02:00
amacocian 44879924d6 Release 0.9.9.35 2024-04-22 14:33:10 +02:00
amacocian 6b7478f6ae Save minimap pinned state (Closes #655) (#659) 2024-04-18 19:24:19 +02:00
amacocian f54d95c1e7 Fix word highlighting edge cases (Closes #656) (#658) 2024-04-18 19:24:19 +02:00
amacocian 5315a45a98 Fix browser navigation (Closes #654) (#657) 2024-04-18 19:24:19 +02:00
amacocian 8575d970a3 Setup release 0.9.9.34 2024-04-18 19:24:19 +02:00
amacocian 5c611eca4f GWCA Module Bugfix (#651) 2024-04-16 18:41:44 +02:00
amacocian 71aa37b965 Added 558 id for sparkfly swamp (#650) 2024-04-16 18:41:44 +02:00
amacocian 0f1b1cc83d Release 0.9.9.33 2024-04-16 18:41:44 +02:00
amacocian 198c1e6eb3 Update Daybreak.GWCA to 0.9.9.32 2024-04-16 11:28:18 +02:00
amacocian e7c9111a1f Allow credentials to be backed up (Closes #525) (#648) 2024-04-16 11:28:18 +02:00
amacocian 1191e996db Update GWCA (#647) 2024-04-16 11:28:18 +02:00
amacocian 19de3c99f9 Release 0.9.9.23 2024-04-16 11:28:18 +02:00
amacocian d857b6dc26 Bugfixes in GWCA module (#645) 2024-04-15 21:56:37 +02:00
amacocian 68b5b79035 Release 0.9.9.31 2024-04-15 21:56:37 +02:00
amacocian 318032d998 Inventory component loading widget (#643) 2024-04-15 12:13:52 +02:00
amacocian 483860532f Update GWCA (#642) 2024-04-15 12:13:52 +02:00
amacocian 694dbe82a9 Race condition crashfix - Downgrade LiteDB dependency - Closes #640 (#641) 2024-04-15 12:13:52 +02:00
amacocian a936f24e32 Setup release branch 2024-04-15 12:13:52 +02:00
amacocian a2ec87ced2 Update GWCA module (#638) 2024-04-12 02:46:53 +02:00
amacocian 48955a7dd7 Setup GWCA whisper functionality (#636) 2024-04-12 02:46:53 +02:00
amacocian 9d7c6c29b0 Setup periodical price checker for inventory (#635) 2024-04-12 02:46:53 +02:00
amacocian 902d210dfd Fix pointer in GWCA plugin (#633) 2024-04-12 02:46:53 +02:00
amacocian 57867851a9 Release 0.9.9.29 2024-04-12 02:46:53 +02:00
amacocianandGitHub ca82cc92bf Release 0.9.9.28 (#632)
Update GWCA
2024-04-11 17:58:39 +00:00
amacocianandGitHub 569ce1e656 Release-0.9.9.27
Release 0.9.9.27
Changelog viewer
2024-04-11 19:28:36 +02:00
amacocian a96c6c3f66 Release 0.9.9.27
Implement changelog view (#629)
2024-04-11 19:19:15 +02:00
amacocian 28c3b2f8c1 Fix CD pipeline 2024-04-11 18:29:04 +02:00
amacocianandGitHub deeccd81b4 Release 0.9.9.26 (#628)
* Event Calendar (#625)

* Event calendar view

* Update GWCA (#626)

* Publish changelog (#627)

* Update dependencies
2024-04-11 16:26:22 +00:00
amacocianandGitHub 6a27245ae8 Release 0.9.9.25 (#618) 2024-04-02 16:59:21 +00:00
amacocianandGitHub 6f4063abb7 Release v0.9.9.24 (#617)
Fix price history functionality
Implement all runes
Update dependencies
2024-03-27 21:33:30 +00:00
amacocianandGitHub f307bcd665 Release 0.9.9.23 (#615)
* Create 0.9.9.23 release

* Update dependencies
2024-03-18 17:52:51 +00:00
amacocianandGitHub 02ca41ba6d Release 0.9.9.22 (#612)
* Fix Daybreak restart commands

* Option to disable dynamic backgrounds

* Improve game running detection
2024-03-04 15:33:00 +00:00
amacocianandGitHub a0ebc87b7c Release 0.9.9.21 (#609)
Fix updater packaging logic
2024-02-27 14:08:02 +00:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
d21c55deb0 Bump Xotl/cool-github-releases from 1.1.8 to 1.1.10 (#608)
Bumps [Xotl/cool-github-releases](https://github.com/xotl/cool-github-releases) from 1.1.8 to 1.1.10.
- [Release notes](https://github.com/xotl/cool-github-releases/releases)
- [Commits](https://github.com/xotl/cool-github-releases/compare/v1.1.8...v1.1.10)

---
updated-dependencies:
- dependency-name: Xotl/cool-github-releases
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-27 12:53:07 +00:00
amacocianandGitHub 50a8131ec2 Update dependencies (#607)
Improve updater
2024-02-27 12:42:39 +00:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
e70cfa3d99 Bump coverlet.collector from 6.0.0 to 6.0.1 (#596)
Bumps [coverlet.collector](https://github.com/coverlet-coverage/coverlet) from 6.0.0 to 6.0.1.
- [Release notes](https://github.com/coverlet-coverage/coverlet/releases)
- [Commits](https://github.com/coverlet-coverage/coverlet/compare/v6.0.0...v6.0.1)

---
updated-dependencies:
- dependency-name: coverlet.collector
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-24 20:46:19 +00:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
4c0c45f1c7 Bump MSTest.TestFramework from 3.2.1 to 3.2.2 (#600)
Bumps [MSTest.TestFramework](https://github.com/microsoft/testfx) from 3.2.1 to 3.2.2.
- [Release notes](https://github.com/microsoft/testfx/releases)
- [Changelog](https://github.com/microsoft/testfx/blob/main/docs/Changelog.md)
- [Commits](https://github.com/microsoft/testfx/compare/v3.2.1...v3.2.2)

---
updated-dependencies:
- dependency-name: MSTest.TestFramework
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-24 20:32:37 +00:00
amacocianandGitHub a9e819a83a Release 0.9.9.19 (#602)
Disable GWCA component when Focus View is disabled
2024-02-24 20:20:11 +00:00
amacocianandGitHub 65830f9125 Release 0.9.9.18 (#595)
* Setup release 0.9.9.18

* Minimap transparency
Closes #594

* Toggle to display exploration percentage
Closes #593
2024-02-18 22:55:07 +01:00
amacocianandGitHub 3d9106addf Release 0.9.9.17 (#592)
* Setup release 0.9.9.17

* Save extracted minimap window position (#591)

Closes #590

* Add ability to pin minimap to screen
Closes #585

* Fix ObjectDisposedException
Closes #589
2024-02-18 16:04:52 +00:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>amacocian
2863032d9a Bump MSTest.TestAdapter from 3.2.0 to 3.2.1 (#587)
Bumps [MSTest.TestAdapter](https://github.com/microsoft/testfx) from 3.2.0 to 3.2.1.
- [Release notes](https://github.com/microsoft/testfx/releases)
- [Changelog](https://github.com/microsoft/testfx/blob/main/docs/Changelog.md)
- [Commits](https://github.com/microsoft/testfx/compare/v.3.2.0...v3.2.1)

---
updated-dependencies:
- dependency-name: MSTest.TestAdapter
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Macocian Alexandru Victor <amacocian@yahoo.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Macocian Alexandru Victor <amacocian@yahoo.com>
2024-02-14 10:48:58 +00:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
aada189b1b Bump MSTest.TestFramework from 3.2.0 to 3.2.1 (#588)
Bumps [MSTest.TestFramework](https://github.com/microsoft/testfx) from 3.2.0 to 3.2.1.
- [Release notes](https://github.com/microsoft/testfx/releases)
- [Changelog](https://github.com/microsoft/testfx/blob/main/docs/Changelog.md)
- [Commits](https://github.com/microsoft/testfx/compare/v.3.2.0...v3.2.1)

---
updated-dependencies:
- dependency-name: MSTest.TestFramework
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-14 11:40:09 +01:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
22ea4de66e Bump NSubstitute.Analyzers.CSharp from 1.0.16 to 1.0.17 (#586)
Bumps [NSubstitute.Analyzers.CSharp](https://github.com/nsubstitute/NSubstitute.Analyzers) from 1.0.16 to 1.0.17.
- [Changelog](https://github.com/nsubstitute/NSubstitute.Analyzers/blob/1.0.17/ReleaseNotes.md)
- [Commits](https://github.com/nsubstitute/NSubstitute.Analyzers/compare/1.0.16...1.0.17)

---
updated-dependencies:
- dependency-name: NSubstitute.Analyzers.CSharp
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-12 05:46:15 +01:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
9859617a74 Bump Microsoft.NET.Test.Sdk from 17.8.0 to 17.9.0 (#578)
Bumps [Microsoft.NET.Test.Sdk](https://github.com/microsoft/vstest) from 17.8.0 to 17.9.0.
- [Release notes](https://github.com/microsoft/vstest/releases)
- [Changelog](https://github.com/microsoft/vstest/blob/main/docs/releases.md)
- [Commits](https://github.com/microsoft/vstest/compare/v17.8.0...v17.9.0)

---
updated-dependencies:
- dependency-name: Microsoft.NET.Test.Sdk
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-07 15:41:59 +01:00
amacocianandGitHub 0629c1929d Release 0.9.9.16 (#582)
* Setup release 0.9.9.16

* Copy buttons for build templates (#580)

* Extract minimap functionality (#581)

* Improve performance of RowAutoMargin functionality
2024-02-07 15:24:47 +01:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
6ec45396c3 Bump microsoft/setup-msbuild from 1.3.2 to 2.0.0 (#575)
Bumps [microsoft/setup-msbuild](https://github.com/microsoft/setup-msbuild) from 1.3.2 to 2.0.0.
- [Release notes](https://github.com/microsoft/setup-msbuild/releases)
- [Changelog](https://github.com/microsoft/setup-msbuild/blob/main/building-release.md)
- [Commits](https://github.com/microsoft/setup-msbuild/compare/v1.3.2...v2.0.0)

---
updated-dependencies:
- dependency-name: microsoft/setup-msbuild
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-05 10:23:57 +01:00
amacocianandGitHub b76a9b80fb Release 0.9.9.15 (#574)
* Setup release 0.9.9.15

* Export team build from focus view (#573)

Closes #573

* Fix load skill template
2024-02-04 19:30:22 +01:00
amacocianandGitHub f4bc58bbf7 Release 0.9.9.14 (#570)
* Team build support (#565)

* Setup support for team builds
Fix parser to load team builds
Fix bug in attribute loading
Adjust encoder to order and skip attributes for consistency

* Small buildtemplate binding fixes
Setup TeamBuildTemplateView

* Setup button to create team build

* Fix launch button (#566)

Closes #563

* Team build improvements (#568)

Closes #564

* Closes #562 (#569)

Closes #561

* Increment version
2024-02-04 14:11:01 +00:00
amacocianandGitHub 09fdbb6f95 Release 0.9.9.13 (#560) 2024-02-01 14:52:15 +00:00
amacocianandGitHub 8ee7ed23e4 Release 0.9.9.12 (#558)
* Release 0.9.9.12

* Move injection to injector executable (#554)

* Fix logview missing history (#556)

Closes #526

* Detect unresponsive Guild Wars instance (#557)

Closes #534
Closes #422
2024-01-31 22:02:14 +00:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>amacocian
8d8a78cf88 Bump microsoft/setup-msbuild from 1.3.1 to 1.3.2 (#552)
Bumps [microsoft/setup-msbuild](https://github.com/microsoft/setup-msbuild) from 1.3.1 to 1.3.2.
- [Release notes](https://github.com/microsoft/setup-msbuild/releases)
- [Changelog](https://github.com/microsoft/setup-msbuild/blob/main/building-release.md)
- [Commits](https://github.com/microsoft/setup-msbuild/compare/v1.3.1...v1.3.2)

---
updated-dependencies:
- dependency-name: microsoft/setup-msbuild
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Macocian Alexandru Victor <amacocian@yahoo.com>
2024-01-29 17:06:36 +01:00
amacocianandGitHub f0652231cb Fix minimap mouse interaction (#553)
* Rework minimap renderer

* Fix dragging

* Fix mouse over detection
2024-01-29 15:50:32 +00:00
amacocianandGitHub d9aa760256 Release 0.9.9.10 (#550)
* Release 0.9.9.10
Option to rotate minimap with the camera
Fix launch button not disabling properly when launching
Remove minimap id overlay
Closes #549
Closes #533
Closes #532

* Increment version

* Increment Daybreak.GWCA version
2024-01-28 14:56:51 +00:00
amacocianandGitHub a65f375255 Release 0.9.9.9 (#548)
Closes #547
Closes #546
Closes #536
2024-01-27 19:34:47 +00:00
amacocianandGitHub 3ee58e2711 Release 0.9.9.8 (#545)
* Synchronize browser history

* Intercept mouse button navigation
Closes #535
Closes #544
2024-01-26 14:24:32 +01:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>amacocian
9b3b083aec Bump MSTest.TestAdapter from 3.1.1 to 3.2.0 (#542)
Bumps [MSTest.TestAdapter](https://github.com/microsoft/testfx) from 3.1.1 to 3.2.0.
- [Release notes](https://github.com/microsoft/testfx/releases)
- [Changelog](https://github.com/microsoft/testfx/blob/main/docs/Changelog.md)
- [Commits](https://github.com/microsoft/testfx/compare/v3.1.1...v.3.2.0)

---
updated-dependencies:
- dependency-name: MSTest.TestAdapter
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Macocian Alexandru Victor <amacocian@yahoo.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Macocian Alexandru Victor <amacocian@yahoo.com>
2024-01-26 13:09:38 +01:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
ecb9b8f172 Bump MSTest.TestFramework from 3.1.1 to 3.2.0 (#543)
Bumps [MSTest.TestFramework](https://github.com/microsoft/testfx) from 3.1.1 to 3.2.0.
- [Release notes](https://github.com/microsoft/testfx/releases)
- [Changelog](https://github.com/microsoft/testfx/blob/main/docs/Changelog.md)
- [Commits](https://github.com/microsoft/testfx/compare/v3.1.1...v.3.2.0)

---
updated-dependencies:
- dependency-name: MSTest.TestFramework
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-26 13:08:22 +01:00
amacocianandGitHub 5765c27240 Release 0.9.9.7 (#541)
* Introduce support for browser extensions

* Setup ublock origin

* Release 0.9.9.7 branch

* Automatically backup settings
Closes #539

* Compare settings with remote
2024-01-23 18:25:31 +00:00
amacocianandGitHub c53456112a Update GWCA (#538)
Fix inventory bug
2024-01-20 10:19:46 +00:00
amacocianandGitHub ccea21886e Release 0.9.9.5 (#531)
* Remove character name from credentials
Update vulnerable packages

* Update SharpCompress
2024-01-17 20:00:12 +00:00
amacocianandGitHub 37be8de5ac Update httplib (#529)
Fix missing data when player has no titles
Fix http requests stalling
2024-01-15 19:20:55 +00:00
amacocianandGitHub 107e43a15f Update GWCA (#528) 2024-01-15 13:34:41 +00:00
556 changed files with 11686 additions and 46497 deletions
+44 -12
View File
@@ -46,23 +46,18 @@ jobs:
run: |
$changeLog = git log --no-merges --pretty="%h - %s (%an)<br />" ${{ env.LatestReleaseTag }}..HEAD
echo "::set-env name=Changelog::$changeLog"
mkdir Publish
echo $changeLog > .\Publish\changelog.txt
env:
LatestReleaseTag: ${{steps.getLatestTag.outputs.tag}}
- name: Install .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.x'
dotnet-version: '9.x'
- name: Setup MSBuild.exe
uses: microsoft/setup-msbuild@v1.3.1
- name: Fetch submodules
run: |
git submodule update --init --recursive
- name: Build CMake Files
run: cmake -S . -B build -A Win32
uses: microsoft/setup-msbuild@v2.0.0
- name: Setup project secrets
run: |
@@ -103,6 +98,37 @@ jobs:
.\Scripts\BuildRelease.ps1 -version $env:Version
shell: pwsh
- name: Submit virustotal scan
shell: pwsh
run: |
cd Publish
$apiKey = "${{ secrets.VIRUSTOTAL_APIKEY }}"
$archiveName = "daybreakv${{ env.Version }}.zip"
$uploadUrlResponse = curl https://www.virustotal.com/api/v3/files/upload_url -H x-apikey:"$apiKey"
$uploadUrlResponse
$uploadUrlJson = $uploadUrlResponse | ConvertFrom-Json
$uploadUrl = $uploadUrlJson.data
$uploadResponse = curl --request POST --header x-apikey:"$apiKey" --header 'content-type: multipart/form-data' --form file="@$archiveName" --url $uploadUrl
$uploadResponse
$uploadResponseJson = $uploadResponse | ConvertFrom-Json
$resultsUrl = "https://www.virustotal.com/api/v3/analyses/$($uploadResponseJson.data.id)"
$resultsUrl
# Poll the results until the status is "completed"
$status = ""
while ($status -ne "completed") {
Start-Sleep -Seconds 10 # Wait for 10 seconds between checks
$results = curl --header x-apikey:"$apiKey" --url $resultsUrl
$results
$resultsJson = $results | ConvertFrom-Json
$status = $resultsJson.data.attributes.status
Write-Host "Current status: $status"
}
$resultsJson.data.attributes.results | ConvertTo-Json | Out-File -FilePath "VirusTotal.Results.json" -Encoding UTF8
$resultsJson.data.attributes.stats | ConvertTo-Json | Out-File -FilePath "VirusTotal.Stats.json" -Encoding UTF8
$stats = $resultsJson.data.attributes.stats
echo "::set-env name=VirusTotalStats::$stats"
- name: Publish blob files
run: |
Write-Host $env
@@ -110,15 +136,21 @@ jobs:
shell: pwsh
- name: Create release draft
uses: Xotl/cool-github-releases@v1.1.8
uses: Xotl/cool-github-releases@v1.1.10
with:
mode: update
tag_name: v${{ env.Version }}
release_name: Daybreak v${{ env.Version }}
assets: .\Publish\daybreakv${{ env.Version }}.zip
assets: .\Publish\daybreakv${{ env.Version }}.zip;.\Publish\VirusTotal.Results.json;.\Publish\VirusTotal.Stats.json
github_token: ${{ env.GITHUB_TOKEN }}
replace_assets: true
body_mrkdwn: ${{ env.Changelog }}
body_mrkdwn: |
${{ env.Changelog }}
** VirustTotal Stats: **
```
${{ env.VirusTotalStats }}
```
isDraft: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+3 -10
View File
@@ -38,20 +38,13 @@ jobs:
- name: Install .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.x'
dotnet-version: '9.x'
- name: Setup MSBuild.exe
uses: microsoft/setup-msbuild@v1.3.1
- name: Fetch submodules
run: |
git submodule update --init --recursive
- name: Build CMake Files
run: cmake -S . -B build -A Win32
uses: microsoft/setup-msbuild@v2.0.0
- name: Execute Unit Tests
run: dotnet test $env:Test_Project_Path --property:SolutionDir=$env:GITHUB_WORKSPACE
run: dotnet test $env:Test_Project_Path --property:SolutionDir=$env:GITHUB_WORKSPACE -p:ParallelizeTestCollections=false
- name: Restore the Wpf application to populate the obj folder
run: msbuild $env:Solution_Path /t:Restore /p:Configuration=$env:Configuration /p:RuntimeIdentifier=$env:RuntimeIdentifier --property:SolutionDir=$env:GITHUB_WORKSPACE
+1 -5
View File
@@ -49,10 +49,6 @@ jobs:
with:
fetch-depth: 0
- name: Fetch submodules
run: |
git submodule update --init --recursive
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
@@ -72,7 +68,7 @@ jobs:
- name: Install .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.x'
dotnet-version: '9.x'
#- name: Autobuild
# uses: github/codeql-action/autobuild@v2
+1 -8
View File
@@ -32,19 +32,12 @@ jobs:
- name: Install .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.x'
dotnet-version: '9.x'
- name: Get Latest Tag
id: getLatestTag
uses: WyriHaximus/github-action-get-previous-tag@v1
- name: Fetch submodules
run: |
git submodule update --init --recursive
- name: Build CMake Files
run: cmake -S . -B build -A Win32
- name: Build Daybreak project
run: dotnet build Daybreak -c $env:Configuration --property:SolutionDir=$env:GITHUB_WORKSPACE
+3 -1
View File
@@ -362,4 +362,6 @@ MigrationBackup/
.ionide/
# Fody - auto-generated XML schema
FodyWeavers.xsd
FodyWeavers.xsd
.idea
-3
View File
@@ -1,3 +0,0 @@
[submodule "GWCA"]
path = GWCA
url = https://github.com/gwdevhub/GWCA
-16
View File
@@ -1,16 +0,0 @@
# CMakeList.txt : Top-level CMake project file, do global configuration
# and include sub-projects here.
#
cmake_minimum_required (VERSION 3.8)
# Enable Hot Reload for MSVC compilers if supported.
if (POLICY CMP0141)
cmake_policy(SET CMP0141 NEW)
set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "$<IF:$<AND:$<C_COMPILER_ID:MSVC>,$<CXX_COMPILER_ID:MSVC>>,$<$<CONFIG:Debug,RelWithDebInfo>:EditAndContinue>,$<$<CONFIG:Debug,RelWithDebInfo>:ProgramDatabase>>")
endif()
project ("Daybreak")
# Include sub-projects.
add_subdirectory ("Daybreak.GWCA")
add_subdirectory ("GWCA")
-42
View File
@@ -1,42 +0,0 @@
{
"version": 3,
"configurePresets": [
{
"name": "windows-base",
"hidden": true,
"generator": "Ninja",
"binaryDir": "${sourceDir}/build/${presetName}",
"installDir": "${sourceDir}/install/${presetName}",
"cacheVariables": {
"CMAKE_C_COMPILER": "cl.exe",
"CMAKE_CXX_COMPILER": "cl.exe",
"CMAKE_CXX_FLAGS": "/EHa"
},
"condition": {
"type": "equals",
"lhs": "${hostSystemName}",
"rhs": "Windows"
}
},
{
"name": "x86-debug",
"displayName": "x86 Debug",
"inherits": "windows-base",
"architecture": {
"value": "x86",
"strategy": "external"
},
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug"
}
},
{
"name": "x86-release",
"displayName": "x86 Release",
"inherits": "x86-debug",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release"
}
}
]
}
@@ -2,7 +2,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<RootNamespace>Daybreak._7ZipExtractor</RootNamespace>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
@@ -10,7 +10,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="SharpCompress" Version="0.35.0" />
<PackageReference Include="SharpCompress" Version="0.39.0" />
</ItemGroup>
</Project>
-39
View File
@@ -1,39 +0,0 @@
# CMakeList.txt : CMake project for Daybreak.GWCA, include source and define
# project specific logic here.
#
project(Daybreak.GWCA)
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
message(FATAL_ERROR "You are configuring a 64bit build, this is not supported. Run cmake with `-A Win32`")
endif()
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(Daybreak.GWCA_FOLDER "${CMAKE_CURRENT_LIST_DIR}/")
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake/")
add_library(Daybreak.GWCA SHARED)
file(GLOB SOURCES
"source/pch.h"
"source/*.cpp"
"source/*/*.cpp"
"header/*.h*"
"header/*/*.h")
source_group(TREE "${CMAKE_CURRENT_SOURCE_DIR}" FILES ${SOURCES})
target_sources(Daybreak.GWCA PRIVATE ${SOURCES})
target_compile_features(Daybreak.GWCA PUBLIC cxx_std_17)
target_compile_definitions(Daybreak.GWCA PRIVATE
$<$<CONFIG:Debug>:BUILD_TYPE_DEBUG>
$<$<CONFIG:Release>:BUILD_TYPE_RELEASE>
)
target_precompile_headers(Daybreak.GWCA PRIVATE "header/pch.h")
target_include_directories(Daybreak.GWCA PUBLIC "header")
target_link_libraries(Daybreak.GWCA PUBLIC
gwca
directx
minhook)
-8
View File
@@ -1,8 +0,0 @@
#pragma once
#include "httplib.h"
namespace http {
namespace modules {
void HandleAlive(const httplib::Request&, httplib::Response& res);
}
}
-6
View File
@@ -1,6 +0,0 @@
#pragma once
#include "httplib.h"
namespace Daybreak::Modules::EntityNameModule {
void GetName(const httplib::Request& req, httplib::Response& res);
}
-6
View File
@@ -1,6 +0,0 @@
#pragma once
#include "httplib.h"
namespace Daybreak::Modules::GameModule {
void GetGameInfo(const httplib::Request&, httplib::Response& res);
}
-6
View File
@@ -1,6 +0,0 @@
#pragma once
#include "httplib.h"
namespace Daybreak::Modules::GameStateModule {
void GetGameStateInfo(const httplib::Request&, httplib::Response& res);
}
-6
View File
@@ -1,6 +0,0 @@
#pragma once
#include "httplib.h"
namespace http {
void ConsoleLogger(const httplib::Request req, httplib::Response res);
}
-6
View File
@@ -1,6 +0,0 @@
#pragma once
#include "httplib.h"
namespace Daybreak::Modules::InventoryModule {
void GetInventoryInfo(const httplib::Request&, httplib::Response& res);
}
-6
View File
@@ -1,6 +0,0 @@
#pragma once
#include "httplib.h"
namespace Daybreak::Modules::ItemNameModule {
void GetName(const httplib::Request& req, httplib::Response& res);
}
-6
View File
@@ -1,6 +0,0 @@
#pragma once
#include "httplib.h"
namespace Daybreak::Modules::LoginModule {
void GetLoginInfo(const httplib::Request&, httplib::Response& res);
}
-6
View File
@@ -1,6 +0,0 @@
#pragma once
#include "httplib.h"
namespace Daybreak::Modules::MainPlayerModule {
void GetMainPlayer(const httplib::Request&, httplib::Response& res);
}
-6
View File
@@ -1,6 +0,0 @@
#pragma once
#include "httplib.h"
namespace Daybreak::Modules::MapModule {
void GetMapInfo(const httplib::Request&, httplib::Response& res);
}
@@ -1,6 +0,0 @@
#pragma once
#include "httplib.h"
namespace Daybreak::Modules::PathingMetadataModule {
void GetPathingMetadata(const httplib::Request&, httplib::Response& res);
}
-6
View File
@@ -1,6 +0,0 @@
#pragma once
#include "httplib.h"
namespace Daybreak::Modules::PathingModule {
void GetPathingData(const httplib::Request&, httplib::Response& res);
}
-6
View File
@@ -1,6 +0,0 @@
#pragma once
#include "httplib.h"
namespace Daybreak::Modules::PreGameModule {
void GetPreGameInfo(const httplib::Request&, httplib::Response& res);
}
-8
View File
@@ -1,8 +0,0 @@
#pragma once
#include "httplib.h"
namespace http {
namespace modules {
void HandleProcessId(const httplib::Request&, httplib::Response& res);
}
}
-12
View File
@@ -1,12 +0,0 @@
#pragma once
#include "httplib.h"
#include "pch.h"
namespace http {
namespace server {
bool StartServer();
void StopServer();
void SetLogger(httplib::Logger logger);
void Get(const std::string& pattern, httplib::Server::Handler handler);
}
}
-6
View File
@@ -1,6 +0,0 @@
#pragma once
#include "httplib.h"
namespace Daybreak::Modules::SessionModule {
void GetSessionInfo(const httplib::Request&, httplib::Response& res);
}
-6
View File
@@ -1,6 +0,0 @@
#pragma once
#include "httplib.h"
namespace Daybreak::Modules::UserModule {
void GetUserInfo(const httplib::Request&, httplib::Response& res);
}
-7
View File
@@ -1,7 +0,0 @@
#pragma once
#include <string>
namespace Daybreak::Utils {
std::string WStringToString(const std::wstring& wstr);
bool StringToInt(const std::string& str, int& outValue);
}
-5
View File
@@ -1,5 +0,0 @@
#pragma once
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
// Windows Header Files
#include <windows.h>
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
-18
View File
@@ -1,18 +0,0 @@
#pragma once
#include <cstdint>
#include <GWCA/GameEntities/Map.h>
#include <json.hpp>
using json = nlohmann::json;
namespace Daybreak {
struct Attribute {
uint32_t Id;
uint32_t BaseLevel;
uint32_t ActualLevel;
uint32_t DecrementPoints;
uint32_t IncrementPoints;
};
void to_json(json& j, const Attribute& p);
}
-15
View File
@@ -1,15 +0,0 @@
#pragma once
#include <cstdint>
#include <GWCA/GameEntities/Map.h>
#include <payloads/BagContent.h>
#include <json.hpp>
using json = nlohmann::json;
namespace Daybreak {
struct Bag {
std::list<BagContent> Items;
};
void to_json(json& j, const Bag& p);
}
@@ -1,17 +0,0 @@
#pragma once
#include <cstdint>
#include <GWCA/GameEntities/Map.h>
#include <json.hpp>
using json = nlohmann::json;
namespace Daybreak {
struct BagContent {
uint32_t Id = 0;
uint32_t Slot = 0;
uint32_t Count = 0;
std::list<uint32_t> Modifiers;
};
void to_json(json& j, const BagContent& p);
}
-18
View File
@@ -1,18 +0,0 @@
#pragma once
#include <cstdint>
#include <GWCA/GameEntities/Map.h>
#include <json.hpp>
#include <payloads/Attribute.h>
using json = nlohmann::json;
namespace Daybreak {
struct Build {
uint32_t Primary = 0;
uint32_t Secondary = 0;
std::list<Attribute> Attributes;
std::list<uint32_t> Skills;
};
void to_json(json& j, const Build& p);
}
@@ -1,21 +0,0 @@
#pragma once
#include <cstdint>
#include <GWCA/GameEntities/Map.h>
#include <json.hpp>
#include <payloads/MainPlayer.h>
#include <payloads/MapIcon.h>
using json = nlohmann::json;
namespace Daybreak {
struct GamePayload {
MainPlayer MainPlayer;
std::list<Player> Party;
std::list<WorldPlayer> WorldPlayers;
std::list<LivingEntity> LivingEntities;
std::list<MapIcon> MapIcons;
uint32_t TargetId = 0;
};
void to_json(json& j, const GamePayload& p);
}
@@ -1,14 +0,0 @@
#pragma once
#include <cstdint>
#include <json.hpp>
#include <payloads/StatePayload.h>
using json = nlohmann::json;
namespace Daybreak {
struct GameStatePayload {
std::list<StatePayload> States;
};
void to_json(json& j, const GameStatePayload& p);
}
@@ -1,24 +0,0 @@
#pragma once
#include <cstdint>
#include <GWCA/GameEntities/Map.h>
#include <json.hpp>
#include <payloads/Bag.h>
using json = nlohmann::json;
namespace Daybreak {
struct InventoryPayload {
uint32_t GoldInStorage;
uint32_t GoldOnCharacter;
Bag Backpack;
Bag BeltPouch;
Bag EquipmentPack;
Bag MaterialStorage;
Bag UnclaimedItems;
Bag EquippedItems;
std::list<Bag> Bags;
std::list<Bag> StoragePanes;
};
void to_json(json& j, const InventoryPayload& p);
}
@@ -1,25 +0,0 @@
#pragma once
#include <cstdint>
#include <GWCA/GameEntities/Map.h>
#include <json.hpp>
using json = nlohmann::json;
namespace Daybreak {
struct LivingEntity {
uint32_t Id = 0;
uint32_t Timer = 0;
float PosX = 0;
float PosY = 0;
uint32_t NpcDefinition = 0;
uint32_t PrimaryProfessionId = 0;
uint32_t SecondaryProfessionId = 0;
uint32_t Level = 0;
uint32_t EntityState = 0;
uint32_t EntityAllegiance = 0;
float Health;
float Energy;
};
void to_json(json& j, const LivingEntity& p);
}
@@ -1,15 +0,0 @@
#pragma once
#include <cstdint>
#include <GWCA/GameEntities/Map.h>
#include <json.hpp>
using json = nlohmann::json;
namespace Daybreak {
struct LoginPayload {
std::string Email;
std::string PlayerName;
};
void to_json(json& j, const LoginPayload& p);
}
@@ -1,24 +0,0 @@
#pragma once
#include <cstdint>
#include <GWCA/GameEntities/Map.h>
#include <json.hpp>
#include <payloads/WorldPlayer.h>
#include <payloads/QuestMetadata.h>
using json = nlohmann::json;
namespace Daybreak {
struct MainPlayer : public WorldPlayer {
uint32_t CurrentQuest = 0;
std::list<QuestMetadata> QuestLog;
bool HardModeUnlocked = false;
uint32_t Experience = 0;
uint32_t Morale = 0;
float CurrentHp = 0;
uint32_t MaxHp = 0;
float CurrentEnergy = 0;
uint32_t MaxEnergy = 0;
};
void to_json(json& j, const MainPlayer& p);
}
-17
View File
@@ -1,17 +0,0 @@
#pragma once
#include <cstdint>
#include <GWCA/GameEntities/Map.h>
#include <json.hpp>
using json = nlohmann::json;
namespace Daybreak {
struct MapIcon {
uint32_t Id;
float PosX;
float PosY;
uint32_t Affiliation;
};
void to_json(json& j, const MapIcon& p);
}
@@ -1,21 +0,0 @@
#pragma once
#include <cstdint>
#include <GWCA/GameEntities/Map.h>
#include <json.hpp>
using json = nlohmann::json;
namespace Daybreak {
struct MapPayload {
bool IsLoaded;
uint32_t Id;
uint32_t InstanceType;
uint32_t Timer;
uint32_t Campaign;
uint32_t Continent;
uint32_t Region;
uint32_t Type;
};
void to_json(json& j, const MapPayload& p);
}
@@ -1,14 +0,0 @@
#pragma once
#include <cstdint>
#include <json.hpp>
using json = nlohmann::json;
namespace Daybreak {
struct NamePayload {
uint32_t Id = 0;
std::string Name = "";
};
void to_json(json& j, const NamePayload& p);
}
@@ -1,14 +0,0 @@
#pragma once
#include <cstdint>
#include <GWCA/GameEntities/Map.h>
#include <json.hpp>
using json = nlohmann::json;
namespace Daybreak {
struct PathingMetadataPayload {
uint32_t TrapezoidCount;
};
void to_json(json& j, const PathingMetadataPayload& p);
}
@@ -1,16 +0,0 @@
#pragma once
#include <cstdint>
#include <GWCA/GameEntities/Map.h>
#include <payloads/PathingTrapezoid.h>
#include <json.hpp>
using json = nlohmann::json;
namespace Daybreak {
struct PathingPayload {
std::list<PathingTrapezoid> Trapezoids;
std::list<std::list<int>> AdjacencyList;
};
void to_json(json& j, const PathingPayload& p);
}
@@ -1,21 +0,0 @@
#pragma once
#include <cstdint>
#include <GWCA/GameEntities/Map.h>
#include <json.hpp>
using json = nlohmann::json;
namespace Daybreak {
struct PathingTrapezoid {
uint32_t Id;
uint32_t PathingMapId;
float XTL;
float XTR;
float XBL;
float XBR;
float YT;
float YB;
};
void to_json(json& j, const PathingTrapezoid& p);
}
-18
View File
@@ -1,18 +0,0 @@
#pragma once
#include <cstdint>
#include <GWCA/GameEntities/Map.h>
#include <json.hpp>
#include <payloads/LivingEntity.h>
#include <payloads/Build.h>
using json = nlohmann::json;
namespace Daybreak {
struct Player : public LivingEntity {
std::list<uint32_t> UnlockedProfession;
uint32_t NpcDefinition = 0;
Build Build;
};
void to_json(json& j, const Player& p);
}
@@ -1,14 +0,0 @@
#pragma once
#include <cstdint>
#include <json.hpp>
using json = nlohmann::json;
namespace Daybreak {
struct PreGamePayload {
int ChosenCharacterIndex;
std::list<std::string> Characters;
};
void to_json(json& j, const PreGamePayload& p);
}
@@ -1,18 +0,0 @@
#pragma once
#include <cstdint>
#include <GWCA/GameEntities/Map.h>
#include <json.hpp>
using json = nlohmann::json;
namespace Daybreak {
struct QuestMetadata {
uint32_t Id;
float PosX;
float PosY;
uint32_t FromId;
uint32_t ToId;
};
void to_json(json& j, const QuestMetadata& p);
}
@@ -1,17 +0,0 @@
#pragma once
#include <cstdint>
#include <json.hpp>
using json = nlohmann::json;
namespace Daybreak {
struct SessionPayload {
uint32_t FoesKilled = 0;
uint32_t FoesToKill = 0;
uint32_t MapId = 0;
uint32_t InstanceTimer = 0;
uint32_t InstanceType = 0;
};
void to_json(json& j, const SessionPayload& p);
}
@@ -1,18 +0,0 @@
#pragma once
#include <cstdint>
#include <json.hpp>
using json = nlohmann::json;
namespace Daybreak {
struct StatePayload {
uint32_t Id = 0;
float PosX = 0;
float PosY = 0;
uint32_t State = 0;
float Health = 0;
float Energy = 0;
};
void to_json(json& j, const StatePayload& p);
}
-20
View File
@@ -1,20 +0,0 @@
#pragma once
#include <cstdint>
#include <GWCA/GameEntities/Map.h>
#include <json.hpp>
using json = nlohmann::json;
namespace Daybreak {
struct Title {
uint32_t Id = 0;
uint32_t CurrentPoints = 0;
uint32_t PointsForCurrentRank = 0;
uint32_t PointsForNextRank = 0;
uint32_t TierNumber = 0;
uint32_t MaxTierNumber = 0;
bool IsPercentage = false;
};
void to_json(json& j, const Title& p);
}
@@ -1,27 +0,0 @@
#pragma once
#include <cstdint>
#include <json.hpp>
using json = nlohmann::json;
namespace Daybreak {
struct UserPayload {
std::string Email;
uint32_t CurrentKurzickPoints;
uint32_t TotalKurzickPoints;
uint32_t CurrentLuxonPoints;
uint32_t TotalLuxonPoints;
uint32_t CurrentImperialPoints;
uint32_t TotalImperialPoints;
uint32_t CurrentBalthazarPoints;
uint32_t TotalBalthazarPoints;
uint32_t CurrentSkillPoints;
uint32_t TotalSkillPoints;
uint32_t MaxKurzickPoints;
uint32_t MaxLuxonPoints;
uint32_t MaxImperialPoints;
uint32_t MaxBalthazarPoints;
};
void to_json(json& j, const UserPayload& p);
}
@@ -1,17 +0,0 @@
#pragma once
#include <cstdint>
#include <GWCA/GameEntities/Map.h>
#include <json.hpp>
#include <payloads/Player.h>
#include <payloads/Title.h>
using json = nlohmann::json;
namespace Daybreak {
struct WorldPlayer : public Player {
std::string Name = "";
Title Title;
};
void to_json(json& j, const WorldPlayer& p);
}
-13
View File
@@ -1,13 +0,0 @@
// pch.h: This is a precompiled header file.
// Files listed below are compiled only once, improving build performance for future builds.
// This also affects IntelliSense performance, including code completion and many code browsing features.
// However, files listed here are ALL re-compiled if any one of them is updated between builds.
// Do not add files here that you will be updating frequently as this negates the performance advantage.
#ifndef PCH_H
#define PCH_H
// add headers that you want to pre-compile here
#include "framework.h"
#endif //PCH_H
-5
View File
@@ -1,5 +0,0 @@
#pragma once
namespace PipeServer {
void StartServer();
}
-73
View File
@@ -1,73 +0,0 @@
#pragma once
#pragma warning(disable: 4619) // there is no warning number 'number'
#pragma warning(push)
#pragma warning(disable: 4061) // enumerator 'identifier' in switch of enum 'enumeration' is not explicitly handled by a case label
#pragma warning(disable: 4365) // 'action' : conversion from 'type_1' to 'type_2', signed/unsigned mismatch
#pragma warning(disable: 4514) // 'function' : unreferenced inline function has been removed
#pragma warning(disable: 4530) // C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc
#pragma warning(disable: 4577) // 'noexcept' used with no exception handling mode specified; termination on exception is not guaranteed. Specify /EHsc
#pragma warning(disable: 4623) // 'derived class' : default constructor was implicitly defined as deleted because a base class default constructor is inaccessible or deleted
#pragma warning(disable: 4625) // 'derived class' : copy constructor was implicitly defined as deleted because a base class copy constructor is inaccessible or deleted
#pragma warning(disable: 4626) // 'derived class' : assignment operator was implicitly defined as deleted because a base class assignment operator is inaccessible or deleted
#pragma warning(disable: 4668) // 'symbol' is not defined as a preprocessor macro, replacing with '0' for 'directives'
#pragma warning(disable: 4710) // 'function' : function not inlined
#pragma warning(disable: 4711) // function 'function' selected for inline expansion
#pragma warning(disable: 4820) // 'bytes' bytes padding added after construct 'member_name'
#pragma warning(disable: 4917) // 'declarator' : a GUID can only be associated with a class, interface or namespace
#pragma warning(disable: 5026) // 'type': move constructor was implicitly defined as deleted
#pragma warning(disable: 5027) // 'type': move assignment operator was implicitly defined as deleted
#pragma warning(disable: 5039) // 'function': pointer or reference to potentially throwing function passed to extern C function under -EHc. Undefined behavior may occur if this function throws an exception.
#pragma warning(disable: 5045) // Compiler will insert Spectre mitigation for memory load if /Qspectre switch specified
#ifndef _CRT_SECURE_NO_WARNINGS
# define _CRT_SECURE_NO_WARNINGS 1
#endif
#include <cmath>
#include <cstdio>
#include <cstdint>
#include <cstring>
#include <map>
#include <atomic>
#include <string>
#include <vector>
#include <sstream>
#include <algorithm>
#include <functional>
#include <unordered_map>
#include <utility>
#ifndef NOMINMAX
# define NOMINMAX
#endif
#ifndef WIN32_LEAN_AND_MEAN
# define WIN32_LEAN_AND_MEAN
#endif
#include <Windows.h>
#include <ShellApi.h>
#pragma warning(pop)
#pragma warning(disable: 4061) // enumerator 'identifier' in switch of enum 'enumeration' is not explicitly handled by a case label
#pragma warning(disable: 4201) // nonstandard extension used : nameless struct/union
#pragma warning(disable: 4514) // 'function' : unreferenced inline function has been removed
#pragma warning(disable: 4505) // 'function' : unreferenced local function has been removed
#pragma warning(disable: 4530) // C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc
#pragma warning(disable: 4577) // 'noexcept' used with no exception handling mode specified; termination on exception is not guaranteed. Specify /EHsc
#pragma warning(disable: 4623) // 'derived class' : default constructor was implicitly defined as deleted because a base class default constructor is inaccessible or deleted
#pragma warning(disable: 4625) // 'derived class' : copy constructor was implicitly defined as deleted because a base class copy constructor is inaccessible or deleted
#pragma warning(disable: 4626) // 'derived class' : assignment operator was implicitly defined as deleted because a base class assignment operator is inaccessible or deleted
#pragma warning(disable: 4710) // 'function' : function not inlined
#pragma warning(disable: 4711) // function 'function' selected for inline expansion
#pragma warning(disable: 4774) // 'swprintf' : format string expected in argument 3 is not a string literal
#pragma warning(disable: 4820) // 'bytes' bytes padding added after construct 'member_name'
#pragma warning(disable: 5026) // 'type': move constructor was implicitly defined as deleted
#pragma warning(disable: 5027) // 'type': move assignment operator was implicitly defined as deleted
#pragma warning(disable: 5045) // Compiler will insert Spectre mitigation for memory load if /Qspectre switch specified
#pragma warning(disable: 28159) // Consider using 'GetTickCount64' instead of 'GetTickCount'.
-36
View File
@@ -1,36 +0,0 @@
#pragma once
#include <cstdint>
#include <GWCA/GameEntities/Map.h>
#include <json.hpp>
#include <payloads/LivingEntity.h>
#include <payloads/Build.h>
#include <GWCA/GameContainers/Array.h>
using json = nlohmann::json;
namespace Daybreak::Temp {
struct GWPlayer { // total: 0x4C/76
/* +h0000 */ uint32_t agent_id;
/* +h0004 */ uint32_t h0004[3];
/* +h0010 */ uint32_t appearance_bitmap;
/* +h0014 */ uint32_t flags; // Bitwise field
/* +h0018 */ uint32_t primary;
/* +h001C */ uint32_t secondary;
/* +h0020 */ uint32_t h0020;
/* +h0024 */ wchar_t* name_enc;
/* +h0028 */ wchar_t* name;
/* +h002C */ uint32_t party_leader_player_number;
/* +h0030 */ uint32_t active_title_tier;
/* +h0034 */ uint32_t player_number;
/* +h0038 */ uint32_t party_size;
/* +h003C */ uint32_t m_buffer; // +h0000
/* +h0040 */ uint32_t m_capacity; // +h0004
/* +h0044 */ uint32_t m_size; // +h0008
/* +h0048 */ uint32_t m_param;
inline bool IsPvP() {
return (flags & 0x800) != 0;
}
};
}
-10
View File
@@ -1,10 +0,0 @@
#include "pch.h"
#include "AliveModule.h"
namespace http {
namespace modules {
void HandleAlive(const httplib::Request&, httplib::Response& res) {
res.set_content("Yes!", "text/plain");
}
}
}
-129
View File
@@ -1,129 +0,0 @@
#include "pch.h"
#include "EntityNameModule.h"
#include "payloads/NamePayload.h"
#include <GWCA/Managers/GameThreadMgr.h>
#include <GWCA/Managers/MapMgr.h>
#include <GWCA/GameEntities/Agent.h>
#include <future>
#include <json.hpp>
#include <tuple>
#include <queue>
#include <GWCA/GWCA.h>
#include <GWCA/Context/PreGameContext.h>
#include <GWCA/Managers/AgentMgr.h>
#include <Windows.h>
#include <cstdint>
#include <limits>
#include "Utils.h"
namespace Daybreak::Modules::EntityNameModule {
std::vector<std::tuple<uint32_t, std::promise<NamePayload>*, std::wstring*>> WaitingList;
std::queue<std::tuple<uint32_t, std::promise<NamePayload>>*> PromiseQueue;
std::mutex GameThreadMutex;
GW::HookEntry GameThreadHook;
volatile bool initialized = false;
std::wstring* GetAsyncName(uint32_t id) {
NamePayload namePayload;
auto agent = GW::Agents::GetAgentByID(id);
if (!agent) {
return nullptr;
}
auto agentLiving = agent->GetAsAgentLiving();
if (!agentLiving) {
return nullptr;
}
auto name = new std::wstring();
if (!GW::Agents::AsyncGetAgentName(agentLiving, *name)) {
delete(name);
return nullptr;
}
return name;
}
void EnsureInitialized() {
GameThreadMutex.lock();
if (!initialized) {
GW::GameThread::RegisterGameThreadCallback(&GameThreadHook, [&](GW::HookStatus*) {
while (!PromiseQueue.empty()) {
auto promiseRequest = PromiseQueue.front();
std::promise<NamePayload> &promise = std::get<1>(*promiseRequest);
uint32_t id = std::get<0>(*promiseRequest);
PromiseQueue.pop();
try {
auto name = GetAsyncName(id);
if (!name) {
continue;
}
WaitingList.emplace_back(id, &promise, name);
}
catch (...) {
NamePayload payload;
promise.set_value(payload);
}
}
for (auto i = 0; i < WaitingList.size(); ) {
auto item = &WaitingList[i];
auto name = std::get<2>(*item);
if (name->empty()) {
i++;
continue;
}
auto promise = std::get<1>(*item);
auto id = std::get<0>(*item);
WaitingList.erase(WaitingList.begin() + i);
NamePayload payload;
payload.Id = id;
payload.Name = Daybreak::Utils::WStringToString(*name);
delete(name);
promise->set_value(payload);
}
});
initialized = true;
}
GameThreadMutex.unlock();
}
void GetName(const httplib::Request& req, httplib::Response& res) {
auto callbackEntry = new GW::HookEntry;
uint32_t id = 0;
auto it = req.params.find("id");
if (it == req.params.end()) {
res.status = 400;
res.set_content("Missing id parameter", "text/plain");
return;
}
else {
auto idStr = it->second;
size_t pos = 0;
auto result = std::stoul(idStr, &pos);
if (pos != idStr.size()) {
res.status = 400;
res.set_content("Invalid id parameter", "text/plain");
return;
}
id = static_cast<uint32_t>(result);
}
auto response = new std::tuple<uint32_t, std::promise<NamePayload>>();
std::get<0>(*response) = id;
std::promise<NamePayload>& promise = std::get<1>(*response);
EnsureInitialized();
PromiseQueue.emplace(response);
json responsePayload = promise.get_future().get();
delete callbackEntry;
delete response;
res.set_content(responsePayload.dump(), "text/json");
}
}
-608
View File
@@ -1,608 +0,0 @@
#include "pch.h"
#include "GameModule.h"
#include <GWCA/Managers/GameThreadMgr.h>
#include <GWCA/Managers/MapMgr.h>
#include <GWCA/Managers/AgentMgr.h>
#include <GWCA/Managers/PartyMgr.h>
#include <GWCA/Managers/PlayerMgr.h>
#include <GWCA/Managers/SkillbarMgr.h>
#include <GWCA/Managers/QuestMgr.h>
#include <GWCA/Context/WorldContext.h>
#include <GWCA/GameContainers/Array.h>
#include <GWCA/GameEntities/Skill.h>
#include <GWCA/GameEntities/Quest.h>
#include <GWCA/GameEntities/Agent.h>
#include <GWCA/GameEntities/Title.h>
#include <GWCA/GameEntities/Party.h>
#include <GWCA/GameEntities/Attribute.h>
#include <GWCA/GameEntities/Player.h>
#include <GWCA/GameEntities/NPC.h>
#include <GWCA/Constants/Constants.h>
#include <temp/GWPlayer.h>
#include <future>
#include <payloads/GamePayload.h>
#include <json.hpp>
#include <queue>
#include <algorithm>
#include "Utils.h"
namespace Daybreak::Modules::GameModule {
std::queue<std::promise<GamePayload>*> PromiseQueue;
std::mutex GameThreadMutex;
GW::HookEntry GameThreadHook;
volatile bool initialized = false;
std::list<QuestMetadata> GetQuestLog() {
std::list<QuestMetadata> questMetadatas;
auto questLog = GW::QuestMgr::GetQuestLog();
if (!questLog) {
return questMetadatas;
}
for (auto& quest : *questLog) {
QuestMetadata metadata;
metadata.FromId = (uint32_t)quest.map_from;
metadata.ToId = (uint32_t)quest.map_to;
metadata.Id = (uint32_t)quest.quest_id;
metadata.PosX = quest.marker.x;
metadata.PosY = quest.marker.y;
questMetadatas.push_back(metadata);
}
return questMetadatas;
}
std::vector<GW::MapAgent> GetMapEntities() {
std::vector<GW::MapAgent> entities;
auto worldContext = GW::GetWorldContext();
for (auto& agent : worldContext->map_agents) {
entities.push_back(agent);
}
return entities;
}
std::list<GW::PartyAttribute> GetPartyAttributes() {
std::list<GW::PartyAttribute> attributes;
auto worldContext = GW::GetWorldContext();
for (auto& attribute : worldContext->attributes) {
attributes.push_back(attribute);
}
return attributes;
}
std::list<GW::ProfessionState> GetProfessions() {
std::list<GW::ProfessionState> professions;
auto worldContext = GW::GetWorldContext();
for (auto& profession : worldContext->party_profession_states) {
professions.push_back(profession);
}
return professions;
}
std::list<GW::AgentLiving> GetLivingAgents() {
std::list<GW::AgentLiving> agentList;
const GW::AgentArray* agents_ptr = GW::Agents::GetAgentArray();
GW::AgentArray* agents = GW::Agents::GetAgentArray();
if (!agents) {
return agentList;
}
for (auto* a : *agents) {
const GW::AgentLiving* agent = a ? a->GetAsAgentLiving() : nullptr;
if (agent) {
agentList.push_back(*agent);
}
}
return agentList;
}
std::vector<GW::TitleTier> GetTitleTiers() {
std::vector<GW::TitleTier> titles;
auto worldContext = GW::GetWorldContext();
for (auto& title : worldContext->title_tiers) {
titles.push_back(title);
}
return titles;
}
std::list<GW::Title> GetTitles() {
std::list<GW::Title> titles;
auto worldContext = GW::GetWorldContext();
for (auto& title : worldContext->titles) {
titles.push_back(title);
}
return titles;
}
std::list<Temp::GWPlayer> GetPlayers() {
std::list<Temp::GWPlayer> players;
auto worldContext = GW::GetWorldContext();
Temp::GWPlayer *tempPlayerArray = (Temp::GWPlayer*)worldContext->players.m_buffer;
if (!tempPlayerArray) {
return players;
}
for (auto i = 0; i < worldContext->players.m_size; i++) {
if (tempPlayerArray->agent_id != 0) {
players.push_back(*tempPlayerArray);
}
tempPlayerArray++;
}
return players;
}
std::map<uint32_t, std::list<uint32_t>> GetSkillbars() {
std::map<uint32_t, std::list<uint32_t>> skillbarMap;
auto skillbars = GW::SkillbarMgr::GetSkillbarArray();
if (!skillbars) {
return skillbarMap;
}
for (auto& skillbar : *skillbars) {
std::list<uint32_t> skillList;
skillList.push_back((uint32_t)skillbar.skills[0].skill_id);
skillList.push_back((uint32_t)skillbar.skills[1].skill_id);
skillList.push_back((uint32_t)skillbar.skills[2].skill_id);
skillList.push_back((uint32_t)skillbar.skills[3].skill_id);
skillList.push_back((uint32_t)skillbar.skills[4].skill_id);
skillList.push_back((uint32_t)skillbar.skills[5].skill_id);
skillList.push_back((uint32_t)skillbar.skills[6].skill_id);
skillList.push_back((uint32_t)skillbar.skills[7].skill_id);
skillbarMap[skillbar.agent_id] = skillList;
}
return skillbarMap;
}
std::list<LivingEntity> GetLivingEntities(
std::list<GW::AgentLiving> agents) {
std::list<LivingEntity> entities;
for (auto& agent : agents) {
LivingEntity entity;
entity.PrimaryProfessionId = agent.primary;
entity.SecondaryProfessionId = agent.secondary;
entity.EntityState = agent.type_map;
entity.EntityAllegiance = (uint32_t)agent.allegiance;
entity.NpcDefinition = agent.player_number;
entity.Id = agent.agent_id;
entity.Timer = agent.timer;
entity.Level = agent.level;
entity.PosX = agent.pos.x;
entity.PosY = agent.pos.y;
entity.Health = agent.hp;
entity.Energy = agent.energy;
if (agent.primary == 0) {
const auto npc = GW::Agents::GetNPCByID(agent.player_number);
if (npc) {
entity.PrimaryProfessionId = npc->primary;
}
}
entities.push_back(entity);
}
return entities;
}
void PopulatePlayer(
Player& player,
int playerId,
GW::ProfessionState* professionState,
std::list<uint32_t> skillbar,
GW::PartyAttribute* partyAttribute,
GW::AgentLiving* agent) {
std::list<uint32_t> unlockedProfessions;
if (professionState) {
for (auto i = 0; i < 11; i++) {
auto prof = (GW::Constants::Profession)i;
if (professionState->IsProfessionUnlocked(prof)) {
unlockedProfessions.push_back(i);
}
}
unlockedProfessions.push_back((uint32_t)professionState->primary);
}
Build build;
std::list<Attribute> attributes;
if (partyAttribute) {
for (const auto& partyAttr : partyAttribute->attribute) {
if (((uint32_t)partyAttr.id < 0) ||
((uint32_t)partyAttr.id > 44) ||
partyAttr.level <= 0) {
continue;
}
Attribute attribute;
attribute.Id = (uint32_t)partyAttr.id;
attribute.BaseLevel = partyAttr.level_base;
attribute.ActualLevel = partyAttr.level;
attribute.DecrementPoints = partyAttr.decrement_points;
attribute.IncrementPoints = partyAttr.increment_points;
attributes.push_back(attribute);
}
build.Attributes = attributes;
if (agent) {
build.Primary = (uint32_t)agent->primary;
build.Secondary = (uint32_t)agent->secondary;
}
else if (professionState) {
build.Primary = (uint32_t)professionState->primary;
build.Secondary = (uint32_t)professionState->secondary;
}
build.Skills = skillbar;
player.Build = build;
}
player.UnlockedProfession = unlockedProfessions;
player.Id = playerId;
if (agent) {
player.PosX = agent->pos.x;
player.PosY = agent->pos.y;
player.Timer = agent->timer;
player.Level = agent->level;
player.NpcDefinition = agent->player_number;
player.PrimaryProfessionId = (uint32_t)agent->primary;
player.SecondaryProfessionId = (uint32_t)agent->secondary;
player.Health = agent->hp * (agent->max_hp > 0 ? agent->max_hp : 1);
player.Energy = agent->energy * (agent->max_energy > 0 ? agent->max_energy : 1);
}
else if (professionState) {
player.PrimaryProfessionId = (uint32_t)professionState->primary;
player.SecondaryProfessionId = (uint32_t)professionState->secondary;
}
}
void PopulateWorldPlayer(
std::list<GW::Title> titles,
std::vector<GW::TitleTier> titleTiers,
WorldPlayer& player,
int playerId,
Temp::GWPlayer* gwPlayer,
GW::ProfessionState* professionState,
std::list<uint32_t> skillbar,
GW::PartyAttribute* partyAttribute,
GW::AgentLiving* agent) {
PopulatePlayer(player, playerId, professionState, skillbar, partyAttribute, agent);
if (!gwPlayer) {
return;
}
GW::Title gwTitle;
Title title;
int titleId = 0;
std::wstring nameString(gwPlayer->name);
auto name = Daybreak::Utils::WStringToString(nameString);
player.Name = name;
for (const auto &t : titles) {
if (t.current_title_tier_index == gwPlayer->active_title_tier) {
gwTitle = t;
break;
}
titleId++;
}
if (gwTitle.current_title_tier_index >= titleTiers.size()) {
return;
}
auto titleTier = titleTiers[gwTitle.current_title_tier_index];
title.CurrentPoints = gwTitle.current_points;
title.IsPercentage = gwTitle.is_percentage_based();
title.PointsForCurrentRank = gwTitle.points_needed_current_rank;
title.PointsForNextRank = titleTier.tier_number == gwTitle.max_title_rank ? gwTitle.current_points : gwTitle.points_needed_next_rank;
title.TierNumber = titleTier.tier_number;
title.MaxTierNumber = gwTitle.max_title_rank;
title.Id = titleId;
player.Title = title;
}
void PopulateMainPlayer(
MainPlayer& player,
int activeQuestId,
std::list<QuestMetadata> questLog,
std::list<GW::Title> titles,
std::vector<GW::TitleTier> titleTiers,
int playerId,
Temp::GWPlayer* gwPlayer,
GW::ProfessionState* professionState,
std::list<uint32_t> skillbar,
GW::PartyAttribute* partyAttribute,
GW::AgentLiving* agent) {
PopulateWorldPlayer(titles, titleTiers, player, playerId, gwPlayer, professionState, skillbar, partyAttribute, agent);
player.CurrentQuest = activeQuestId;
player.QuestLog = questLog;
player.HardModeUnlocked = GW::GetWorldContext()->is_hard_mode_unlocked == 1;
player.Experience = GW::GetWorldContext()->experience;
player.Morale = GW::GetWorldContext()->morale;
if (agent) {
player.CurrentEnergy = agent->max_energy * agent->energy;
player.CurrentHp = agent->max_hp * agent->hp;
player.MaxEnergy = agent->max_energy;
player.MaxHp = agent->max_hp;
}
}
GamePayload GetPayload() {
GamePayload gamePayload;
gamePayload.TargetId = 0;
if (!GW::Map::GetIsMapLoaded()) {
return gamePayload;
}
gamePayload.TargetId = GW::Agents::GetTargetId();
auto worldContext = GW::GetWorldContext();
auto activeQuestId = GW::QuestMgr::GetActiveQuestId();
auto questLog = GetQuestLog();
auto skillbars = GetSkillbars();
if (skillbars.empty()) {
return gamePayload;
}
auto agents = GetLivingAgents();
if (agents.empty()) {
return gamePayload;
}
auto titles = GetTitles();
if (titles.empty()) {
return gamePayload;
}
auto titleTiers = GetTitleTiers();
if (titleTiers.empty()) {
return gamePayload;
}
auto players = GetPlayers();
if (players.empty()) {
return gamePayload;
}
auto attributes = GetPartyAttributes();
if (attributes.empty()) {
return gamePayload;
}
auto professions = GetProfessions();
if (professions.empty()) {
return gamePayload;
}
auto mapAgents = GetMapEntities();
if (mapAgents.empty()) {
return gamePayload;
}
auto playerAgentId = GW::Agents::GetPlayerId();
std::list<MapIcon> mapIcons;
for (const auto &icon : worldContext->mission_map_icons) {
MapIcon mapIcon;
mapIcon.Id = icon.model_id;
mapIcon.Affiliation = icon.option;
mapIcon.PosX = icon.X;
mapIcon.PosY = icon.Y;
mapIcons.push_back(mapIcon);
}
gamePayload.MapIcons = mapIcons;
std::list<Player> partyMembers;
for (auto &prof : professions) {
if (prof.agent_id == playerAgentId) {
continue;
}
Player player;
auto foundAttr = std::find_if(attributes.begin(), attributes.end(), [&](GW::PartyAttribute attribute) {
return prof.agent_id == attribute.agent_id;
});
auto foundAgent = std::find_if(agents.begin(), agents.end(), [&](GW::AgentLiving agentLiving) {
return prof.agent_id == agentLiving.agent_id;
});
GW::AgentLiving* agentPtr;
if (foundAgent == agents.end()) {
agentPtr = nullptr;
}
else {
agentPtr = &*foundAgent;
}
GW::PartyAttribute* attrPtr;
if (foundAttr == attributes.end()) {
attrPtr = nullptr;
}
else {
attrPtr = &*foundAttr;
}
PopulatePlayer(player, prof.agent_id, &prof, skillbars[prof.agent_id], attrPtr, agentPtr);
partyMembers.push_back(player);
}
gamePayload.Party = partyMembers;
MainPlayer mainPlayer;
auto foundMainAttr = std::find_if(attributes.begin(), attributes.end(), [&](GW::PartyAttribute attribute) {
return playerAgentId == attribute.agent_id;
});
auto foundMainAgent = std::find_if(agents.begin(), agents.end(), [&](GW::AgentLiving agentLiving) {
return playerAgentId == agentLiving.agent_id;
});
auto foundMainProfessionsState = std::find_if(professions.begin(), professions.end(), [&](GW::ProfessionState professionState) {
return playerAgentId == professionState.agent_id;
});
auto foundMainGwPlayer = std::find_if(players.begin(), players.end(), [&](Temp::GWPlayer gwPlayer) {
return playerAgentId == gwPlayer.agent_id;
});
GW::AgentLiving* mainAgentPtr;
if (foundMainAgent == agents.end()) {
mainAgentPtr = nullptr;
}
else {
mainAgentPtr = &*foundMainAgent;
}
GW::PartyAttribute* mainAttrPtr;
if (foundMainAttr == attributes.end()) {
mainAttrPtr = nullptr;
}
else {
mainAttrPtr = &*foundMainAttr;
}
GW::ProfessionState* mainProfPtr;
if (foundMainProfessionsState == professions.end()) {
mainProfPtr = nullptr;
}
else {
mainProfPtr = &*foundMainProfessionsState;
}
Temp::GWPlayer* mainGwPlayer;
if (foundMainGwPlayer == players.end()) {
mainGwPlayer = nullptr;
}
else{
mainGwPlayer = &*foundMainGwPlayer;
}
PopulateMainPlayer(mainPlayer, (uint32_t)activeQuestId, questLog, titles, titleTiers, playerAgentId, mainGwPlayer, mainProfPtr, skillbars[playerAgentId], mainAttrPtr, mainAgentPtr);
gamePayload.MainPlayer = mainPlayer;
std::list<WorldPlayer> worldPlayers;
for (auto& gwPlayer : players) {
if (gwPlayer.agent_id == 0 ||
gwPlayer.agent_id == playerAgentId) {
continue;
}
WorldPlayer worldPlayer;
auto foundWorldProfessionsState = std::find_if(professions.begin(), professions.end(), [&](GW::ProfessionState professionState) {
return gwPlayer.agent_id == professionState.agent_id;
});
auto foundWorldAttr = std::find_if(attributes.begin(), attributes.end(), [&](GW::PartyAttribute attribute) {
return gwPlayer.agent_id == attribute.agent_id;
});
auto foundWorldAgent = std::find_if(agents.begin(), agents.end(), [&](GW::AgentLiving agentLiving) {
return gwPlayer.agent_id == agentLiving.agent_id;
});
std::list<uint32_t> skills;
auto foundSkillbar = skillbars.find(gwPlayer.agent_id);
if (foundSkillbar != skillbars.end()){
skills = foundSkillbar->second;
}
GW::AgentLiving* worldAgentPtr;
if (foundWorldAgent == agents.end()) {
worldAgentPtr = nullptr;
}
else {
worldAgentPtr = &*foundWorldAgent;
}
GW::PartyAttribute* worldAttrPtr;
if (foundWorldAttr == attributes.end()) {
worldAttrPtr = nullptr;
}
else {
worldAttrPtr = &*foundWorldAttr;
}
GW::ProfessionState* worldProfPtr;
if (foundWorldProfessionsState == professions.end()) {
worldProfPtr = nullptr;
}
else {
worldProfPtr = &*foundWorldProfessionsState;
}
auto* tempGwPlayer = &gwPlayer;
PopulateWorldPlayer(titles, titleTiers, worldPlayer, gwPlayer.agent_id, tempGwPlayer, worldProfPtr, skills, worldAttrPtr, worldAgentPtr);
worldPlayers.push_back(worldPlayer);
}
gamePayload.WorldPlayers = worldPlayers;
std::list<GW::AgentLiving> livingEntities;
for (const auto& agentLiving : agents) {
/*
* Get all living entities that are not the main player, a world player or a party member.
*/
if (!agentLiving.GetIsLivingType() ||
agentLiving.agent_id == playerAgentId) {
continue;
}
auto foundPartyMember = std::find_if(partyMembers.begin(), partyMembers.end(), [&](Daybreak::Player player) { return player.Id == agentLiving.agent_id; });
if (foundPartyMember != partyMembers.end()) {
continue;
}
auto foundWorldPlayer = std::find_if(worldPlayers.begin(), worldPlayers.end(), [&](Daybreak::WorldPlayer player) { return player.Id == agentLiving.agent_id; });
if (foundWorldPlayer != worldPlayers.end()) {
continue;
}
livingEntities.push_back(agentLiving);
}
auto livingEntityList = GetLivingEntities(livingEntities);
gamePayload.LivingEntities = livingEntityList;
return gamePayload;
}
void EnsureInitialized() {
GameThreadMutex.lock();
if (!initialized) {
GW::GameThread::RegisterGameThreadCallback(&GameThreadHook, [&](GW::HookStatus*) {
while (!PromiseQueue.empty()) {
auto promise = PromiseQueue.front();
PromiseQueue.pop();
try {
auto payload = GetPayload();
promise->set_value(payload);
}
catch (...) {
GamePayload payload;
promise->set_value(payload);
}
}
});
initialized = true;
}
GameThreadMutex.unlock();
}
void GetGameInfo(const httplib::Request&, httplib::Response& res) {
auto callbackEntry = new GW::HookEntry;
auto response = new std::promise<GamePayload>;
EnsureInitialized();
PromiseQueue.emplace(response);
json responsePayload = response->get_future().get();
delete callbackEntry;
delete response;
res.set_content(responsePayload.dump(), "text/json");
}
}
-106
View File
@@ -1,106 +0,0 @@
#include "pch.h"
#include "GameStateModule.h"
#include <GWCA/Managers/GameThreadMgr.h>
#include <GWCA/Managers/AgentMgr.h>
#include <GWCA/GameEntities/Agent.h>
#include <GWCA/Managers/MapMgr.h>
#include <future>
#include <payloads/GameStatePayload.h>
#include <json.hpp>
#include <queue>
#include <algorithm>
namespace Daybreak::Modules::GameStateModule {
std::queue<std::promise<GameStatePayload>*> PromiseQueue;
std::mutex GameThreadMutex;
GW::HookEntry GameThreadHook;
volatile bool initialized = false;
std::list<GW::AgentLiving> GetLivingAgents() {
std::list<GW::AgentLiving> agentList;
const GW::AgentArray* agents_ptr = GW::Agents::GetAgentArray();
GW::AgentArray* agents = GW::Agents::GetAgentArray();
if (!agents) {
return agentList;
}
for (auto* a : *agents) {
const GW::AgentLiving* agent = a ? a->GetAsAgentLiving() : nullptr;
if (agent) {
agentList.push_back(*agent);
}
}
return agentList;
}
std::list<StatePayload> GetStates(
std::list<GW::AgentLiving> agents) {
std::list<StatePayload> states;
for (auto& agent : agents) {
StatePayload state;
state.Id = agent.agent_id;
state.PosX = agent.pos.x;
state.PosY = agent.pos.y;
state.State = agent.type_map;
state.Health = agent.hp * (agent.max_hp > 0 ? agent.max_hp : 1);
state.Energy = agent.energy * (agent.max_energy > 0 ? agent.max_energy : 1);
states.push_back(state);
}
return states;
}
GameStatePayload GetPayload() {
GameStatePayload gamePayload;
if (!GW::Map::GetIsMapLoaded()) {
return gamePayload;
}
auto agents = GetLivingAgents();
if (agents.empty()) {
return gamePayload;
}
auto states = GetStates(agents);
gamePayload.States = states;
return gamePayload;
}
void EnsureInitialized() {
GameThreadMutex.lock();
if (!initialized) {
GW::GameThread::RegisterGameThreadCallback(&GameThreadHook, [&](GW::HookStatus*) {
while (!PromiseQueue.empty()) {
auto promise = PromiseQueue.front();
PromiseQueue.pop();
try {
auto payload = GetPayload();
promise->set_value(payload);
}
catch (...) {
GameStatePayload payload;
promise->set_value(payload);
}
}
});
initialized = true;
}
GameThreadMutex.unlock();
}
void GetGameStateInfo(const httplib::Request&, httplib::Response& res) {
auto callbackEntry = new GW::HookEntry;
auto response = new std::promise<GameStatePayload>;
EnsureInitialized();
PromiseQueue.emplace(response);
json responsePayload = response->get_future().get();
delete callbackEntry;
delete response;
res.set_content(responsePayload.dump(), "text/json");
}
}
-7
View File
@@ -1,7 +0,0 @@
#include "HttpLogger.h"
namespace http {
void ConsoleLogger(const httplib::Request req, httplib::Response res) {
std::cout << req.method << " " << req.path << std::endl << res.status << std::endl;
}
}
-116
View File
@@ -1,116 +0,0 @@
#include "pch.h"
#include "InventoryModule.h"
#include <GWCA/Managers/GameThreadMgr.h>
#include <GWCA/Managers/MapMgr.h>
#include <GWCA/Context/ItemContext.h>
#include <GWCA/Managers/ItemMgr.h>
#include <GWCA/GameEntities/Item.h>
#include <future>
#include <payloads/InventoryPayload.h>
#include <json.hpp>
#include <queue>
namespace Daybreak::Modules::InventoryModule {
std::queue<std::promise<InventoryPayload>*> PromiseQueue;
std::mutex GameThreadMutex;
GW::HookEntry GameThreadHook;
volatile bool initialized = false;
Daybreak::Bag GetBag(GW::Bag* bag) {
Bag retBag;
if (!bag) {
return retBag;
}
for (const auto &item : bag->items) {
BagContent bagContent;
if (!item) {
continue;
}
bagContent.Id = item->model_id;
bagContent.Slot = item->slot;
bagContent.Count = item->quantity;
auto modifier = item->mod_struct;
for (auto i = 0; i < item->mod_struct_size; i++) {
bagContent.Modifiers.push_back((uint32_t)(modifier->mod));
modifier++;
}
retBag.Items.push_back(bagContent);
}
return retBag;
}
InventoryPayload GetPayload() {
InventoryPayload inventoryPayload;
if (!GW::Map::GetIsMapLoaded()) {
return inventoryPayload;
}
inventoryPayload.GoldInStorage = GW::Items::GetGoldAmountInStorage();
inventoryPayload.GoldOnCharacter = GW::Items::GetGoldAmountOnCharacter();
auto inventory = GW::GetItemContext()->inventory;
inventoryPayload.Backpack = GetBag(inventory->backpack);
inventoryPayload.BeltPouch = (GetBag(inventory->belt_pouch));
inventoryPayload.Bags.push_back(GetBag(inventory->bag1));
inventoryPayload.Bags.push_back(GetBag(inventory->bag2));
inventoryPayload.EquipmentPack = (GetBag(inventory->equipment_pack));
inventoryPayload.MaterialStorage = (GetBag(inventory->material_storage));
inventoryPayload.UnclaimedItems = (GetBag(inventory->unclaimed_items));
inventoryPayload.EquippedItems = (GetBag(inventory->equipped_items));
inventoryPayload.StoragePanes.push_back(GetBag(inventory->storage1));
inventoryPayload.StoragePanes.push_back(GetBag(inventory->storage2));
inventoryPayload.StoragePanes.push_back(GetBag(inventory->storage3));
inventoryPayload.StoragePanes.push_back(GetBag(inventory->storage4));
inventoryPayload.StoragePanes.push_back(GetBag(inventory->storage5));
inventoryPayload.StoragePanes.push_back(GetBag(inventory->storage6));
inventoryPayload.StoragePanes.push_back(GetBag(inventory->storage7));
inventoryPayload.StoragePanes.push_back(GetBag(inventory->storage8));
inventoryPayload.StoragePanes.push_back(GetBag(inventory->storage9));
inventoryPayload.StoragePanes.push_back(GetBag(inventory->storage10));
inventoryPayload.StoragePanes.push_back(GetBag(inventory->storage11));
inventoryPayload.StoragePanes.push_back(GetBag(inventory->storage12));
inventoryPayload.StoragePanes.push_back(GetBag(inventory->storage13));
inventoryPayload.StoragePanes.push_back(GetBag(inventory->storage14));
return inventoryPayload;
}
void EnsureInitialized() {
GameThreadMutex.lock();
if (!initialized) {
GW::GameThread::RegisterGameThreadCallback(&GameThreadHook, [&](GW::HookStatus*) {
while (!PromiseQueue.empty()) {
auto promise = PromiseQueue.front();
PromiseQueue.pop();
try {
auto payload = GetPayload();
promise->set_value(payload);
}
catch(...){
InventoryPayload payload;
promise->set_value(payload);
}
}
});
initialized = true;
}
GameThreadMutex.unlock();
}
void GetInventoryInfo(const httplib::Request&, httplib::Response& res) {
auto callbackEntry = new GW::HookEntry;
auto response = new std::promise<InventoryPayload>;
EnsureInitialized();
PromiseQueue.emplace(response);
json responsePayload = response->get_future().get();
delete callbackEntry;
delete response;
res.set_content(responsePayload.dump(), "text/json");
}
}
-162
View File
@@ -1,162 +0,0 @@
#include "pch.h"
#include "ItemNameModule.h"
#include "payloads/NamePayload.h"
#include <GWCA/Managers/GameThreadMgr.h>
#include <GWCA/Managers/ItemMgr.h>
#include <GWCA/GameEntities/Item.h>
#include <future>
#include <json.hpp>
#include <tuple>
#include <queue>
#include <GWCA/GWCA.h>
#include <Windows.h>
#include <cstdint>
#include <limits>
#include <Utils.h>
namespace Daybreak::Modules::ItemNameModule {
std::vector<std::tuple<uint32_t, std::promise<NamePayload>*, std::wstring*>> WaitingList;
std::queue<std::tuple<uint32_t, std::vector<uint32_t>, std::promise<NamePayload>>*> PromiseQueue;
std::mutex GameThreadMutex;
GW::HookEntry GameThreadHook;
volatile bool initialized = false;
std::wstring* GetAsyncName(uint32_t id, std::vector<uint32_t> modifiers) {
GW::ItemModifier parsedModifiers[64];
for (auto i = 0; i < modifiers.size(); i++) {
GW::ItemModifier parsedModifier;
const auto mod = modifiers.at(i);
parsedModifier.mod = mod;
parsedModifiers[i] = parsedModifier;
}
auto item = GW::Items::GetItemByModelIdAndModifiers(id, parsedModifiers, modifiers.size(), 1, 23);
if (!item) {
return nullptr;
}
auto name = new std::wstring();
GW::Items::AsyncGetItemName(item, *name);
return name;
}
void EnsureInitialized() {
GameThreadMutex.lock();
if (!initialized) {
GW::GameThread::RegisterGameThreadCallback(&GameThreadHook, [&](GW::HookStatus*) {
while (!PromiseQueue.empty()) {
auto promiseRequest = PromiseQueue.front();
std::promise<NamePayload> &promise = std::get<2>(*promiseRequest);
uint32_t id = std::get<0>(*promiseRequest);
auto modifiers = std::get<1>(*promiseRequest);
PromiseQueue.pop();
try {
auto name = GetAsyncName(id, modifiers);
if (!name) {
continue;
}
WaitingList.emplace_back(id, &promise, name);
}
catch (...) {
NamePayload payload;
promise.set_value(payload);
}
}
for (size_t i = 0; i < WaitingList.size(); ) {
auto item = &WaitingList[i];
auto name = std::get<2>(*item);
if (name->empty()) {
i++;
continue;
}
auto promise = std::get<1>(*item);
auto id = std::get<0>(*item);
WaitingList.erase(WaitingList.begin() + i);
NamePayload payload;
payload.Id = id;
payload.Name = Daybreak::Utils::WStringToString(*name);
delete(name);
promise->set_value(payload);
}
});
initialized = true;
}
GameThreadMutex.unlock();
}
std::vector<std::string> SplitAndRemoveSpaces(const std::string& s) {
std::vector<std::string> result;
std::stringstream ss(s);
std::string item;
while (getline(ss, item, ',')) {
item.erase(std::remove(item.begin(), item.end(), ' '), item.end());
result.push_back(item);
}
return result;
}
void GetName(const httplib::Request& req, httplib::Response& res) {
auto callbackEntry = new GW::HookEntry;
uint32_t id = 0;
std::vector<uint32_t> modifiers;
auto id_it = req.params.find("id");
if (id_it == req.params.end()) {
res.status = 400;
res.set_content("Missing id parameter", "text/plain");
return;
}
else {
auto& idStr = id_it->second;
int parsedId;
if (!Daybreak::Utils::StringToInt(idStr, parsedId)){
res.status = 400;
res.set_content("Invalid id parameter", "text/plain");
return;
}
id = static_cast<uint32_t>(parsedId);
}
auto mod_it = req.params.find("modifiers");
if (mod_it == req.params.end()) {
res.status = 400;
res.set_content("Missing modifiers parameter", "text/plain");
return;
}
else {
auto& modifiersStr = mod_it->second;
const auto tokens = SplitAndRemoveSpaces(modifiersStr);
for (const auto& token : tokens) {
int parsedModifier;
if (!Daybreak::Utils::StringToInt(token, parsedModifier)) {
res.status = 400;
res.set_content("Invalid modifier parameter", "text/plain");
return;
}
modifiers.push_back(static_cast<uint32_t>(parsedModifier));
}
}
auto response = new std::tuple<uint32_t, std::vector<uint32_t>, std::promise<NamePayload>>();
std::get<0>(*response) = id;
std::promise<NamePayload>& promise = std::get<2>(*response);
std::get<1>(*response) = modifiers;
EnsureInitialized();
PromiseQueue.emplace(response);
json responsePayload = promise.get_future().get();
delete callbackEntry;
delete response;
res.set_content(responsePayload.dump(), "text/json");
}
}
-65
View File
@@ -1,65 +0,0 @@
#include "pch.h"
#include "LoginModule.h"
#include <GWCA/Managers/GameThreadMgr.h>
#include <GWCA/Managers/MapMgr.h>
#include <GWCA/Context/CharContext.h>
#include <future>
#include <payloads/LoginPayload.h>
#include <json.hpp>
#include <queue>
#include "Utils.h"
namespace Daybreak::Modules::LoginModule {
std::queue<std::promise<LoginPayload>*> PromiseQueue;
std::mutex GameThreadMutex;
GW::HookEntry GameThreadHook;
volatile bool initialized = false;
LoginPayload GetPayload() {
auto context = GW::GetCharContext();
LoginPayload loginPayload;
std::wstring playerEmail(context->player_email);
std::wstring playerName(context->player_name);
loginPayload.Email = Daybreak::Utils::WStringToString(playerEmail);
loginPayload.PlayerName = Daybreak::Utils::WStringToString(playerName);
return loginPayload;
}
void EnsureInitialized() {
GameThreadMutex.lock();
if (!initialized) {
GW::GameThread::RegisterGameThreadCallback(&GameThreadHook, [&](GW::HookStatus*) {
while (!PromiseQueue.empty()) {
auto promise = PromiseQueue.front();
PromiseQueue.pop();
try {
auto payload = GetPayload();
promise->set_value(payload);
}
catch (...) {
LoginPayload payload;
promise->set_value(payload);
}
}
});
initialized = true;
}
GameThreadMutex.unlock();
}
void GetLoginInfo(const httplib::Request&, httplib::Response& res) {
auto callbackEntry = new GW::HookEntry;
auto response = new std::promise<LoginPayload>;
EnsureInitialized();
PromiseQueue.emplace(response);
json responsePayload = response->get_future().get();
delete callbackEntry;
delete response;
res.set_content(responsePayload.dump(), "text/json");
}
}
-482
View File
@@ -1,482 +0,0 @@
#include "pch.h"
#include "MainPlayerModule.h"
#include <GWCA/Managers/GameThreadMgr.h>
#include <GWCA/Managers/MapMgr.h>
#include <GWCA/Managers/AgentMgr.h>
#include <GWCA/Managers/PartyMgr.h>
#include <GWCA/Managers/PlayerMgr.h>
#include <GWCA/Managers/SkillbarMgr.h>
#include <GWCA/Managers/QuestMgr.h>
#include <GWCA/Context/WorldContext.h>
#include <GWCA/GameContainers/Array.h>
#include <GWCA/GameEntities/Skill.h>
#include <GWCA/GameEntities/Quest.h>
#include <GWCA/GameEntities/Agent.h>
#include <GWCA/GameEntities/Title.h>
#include <GWCA/GameEntities/Party.h>
#include <GWCA/GameEntities/Attribute.h>
#include <GWCA/GameEntities/Player.h>
#include <GWCA/GameEntities/NPC.h>
#include <GWCA/Constants/Constants.h>
#include <temp/GWPlayer.h>
#include <future>
#include <payloads/MainPlayer.h>
#include <json.hpp>
#include <queue>
#include <algorithm>
#include "Utils.h"
namespace Daybreak::Modules::MainPlayerModule {
std::queue<std::promise<MainPlayer>*> PromiseQueue;
std::mutex GameThreadMutex;
GW::HookEntry GameThreadHook;
volatile bool initialized = false;
std::list<QuestMetadata> GetQuestLog() {
std::list<QuestMetadata> questMetadatas;
auto questLog = GW::QuestMgr::GetQuestLog();
if (!questLog) {
return questMetadatas;
}
for (auto& quest : *questLog) {
QuestMetadata metadata;
metadata.FromId = (uint32_t)quest.map_from;
metadata.ToId = (uint32_t)quest.map_to;
metadata.Id = (uint32_t)quest.quest_id;
metadata.PosX = quest.marker.x;
metadata.PosY = quest.marker.y;
questMetadatas.push_back(metadata);
}
return questMetadatas;
}
std::vector<GW::MapAgent> GetMapEntities() {
std::vector<GW::MapAgent> entities;
auto worldContext = GW::GetWorldContext();
for (auto& agent : worldContext->map_agents) {
entities.push_back(agent);
}
return entities;
}
std::list<GW::PartyAttribute> GetPartyAttributes() {
std::list<GW::PartyAttribute> attributes;
auto worldContext = GW::GetWorldContext();
for (auto& attribute : worldContext->attributes) {
attributes.push_back(attribute);
}
return attributes;
}
std::list<GW::ProfessionState> GetProfessions() {
std::list<GW::ProfessionState> professions;
auto worldContext = GW::GetWorldContext();
for (auto& profession : worldContext->party_profession_states) {
professions.push_back(profession);
}
return professions;
}
std::list<GW::AgentLiving> GetLivingAgents() {
std::list<GW::AgentLiving> agentList;
const GW::AgentArray* agents_ptr = GW::Agents::GetAgentArray();
GW::AgentArray* agents = GW::Agents::GetAgentArray();
if (!agents) {
return agentList;
}
for (auto* a : *agents) {
const GW::AgentLiving* agent = a ? a->GetAsAgentLiving() : nullptr;
if (agent) {
agentList.push_back(*agent);
}
}
return agentList;
}
std::list<GW::NPC> GetNpcs() {
std::list<GW::NPC> npcs;
auto worldContext = GW::GetWorldContext();
for (auto& npc : worldContext->npcs) {
npcs.push_back(npc);
}
return npcs;
}
std::vector<GW::TitleTier> GetTitleTiers() {
std::vector<GW::TitleTier> titles;
auto worldContext = GW::GetWorldContext();
for (auto& title : worldContext->title_tiers) {
titles.push_back(title);
}
return titles;
}
std::list<GW::Title> GetTitles() {
std::list<GW::Title> titles;
auto worldContext = GW::GetWorldContext();
for (auto& title : worldContext->titles) {
titles.push_back(title);
}
return titles;
}
std::list<Temp::GWPlayer> GetPlayers() {
std::list<Temp::GWPlayer> players;
auto worldContext = GW::GetWorldContext();
Temp::GWPlayer *tempPlayerArray = (Temp::GWPlayer*)worldContext->players.m_buffer;
if (!tempPlayerArray) {
return players;
}
for (auto i = 0; i < worldContext->players.m_size; i++) {
if (tempPlayerArray->agent_id != 0) {
players.push_back(*tempPlayerArray);
}
tempPlayerArray++;
}
return players;
}
std::map<uint32_t, std::list<uint32_t>> GetSkillbars() {
std::map<uint32_t, std::list<uint32_t>> skillbarMap;
auto skillbars = GW::SkillbarMgr::GetSkillbarArray();
if (!skillbars) {
return skillbarMap;
}
for (auto& skillbar : *skillbars) {
std::list<uint32_t> skillList;
skillList.push_back((uint32_t)skillbar.skills[0].skill_id);
skillList.push_back((uint32_t)skillbar.skills[1].skill_id);
skillList.push_back((uint32_t)skillbar.skills[2].skill_id);
skillList.push_back((uint32_t)skillbar.skills[3].skill_id);
skillList.push_back((uint32_t)skillbar.skills[4].skill_id);
skillList.push_back((uint32_t)skillbar.skills[5].skill_id);
skillList.push_back((uint32_t)skillbar.skills[6].skill_id);
skillList.push_back((uint32_t)skillbar.skills[7].skill_id);
skillbarMap[skillbar.agent_id] = skillList;
}
return skillbarMap;
}
std::list<LivingEntity> GetLivingEntities(
std::list<GW::AgentLiving> agents) {
std::list<LivingEntity> entities;
for (auto& agent : agents) {
LivingEntity entity;
entity.PrimaryProfessionId = agent.primary;
entity.SecondaryProfessionId = agent.secondary;
entity.EntityState = agent.type_map;
entity.EntityAllegiance = (uint32_t)agent.allegiance;
entity.NpcDefinition = agent.player_number;
entity.Id = agent.agent_id;
entity.Timer = agent.timer;
entity.Level = agent.level;
entity.PosX = agent.pos.x;
entity.PosY = agent.pos.y;
entities.push_back(entity);
}
return entities;
}
void PopulatePlayer(
Player& player,
int playerId,
GW::ProfessionState* professionState,
std::list<uint32_t> skillbar,
GW::PartyAttribute* partyAttribute,
GW::AgentLiving* agent) {
std::list<uint32_t> unlockedProfessions;
if (professionState) {
for (auto i = 0; i < 11; i++) {
auto prof = (GW::Constants::Profession)i;
if (professionState->IsProfessionUnlocked(prof)) {
unlockedProfessions.push_back(i);
}
}
unlockedProfessions.push_back((uint32_t)professionState->primary);
}
Build build;
std::list<Attribute> attributes;
if (partyAttribute) {
for (const auto& partyAttr : partyAttribute->attribute) {
if (((uint32_t)partyAttr.id < 0) ||
((uint32_t)partyAttr.id > 44) ||
partyAttr.level <= 0) {
continue;
}
Attribute attribute;
attribute.Id = (uint32_t)partyAttr.id;
attribute.BaseLevel = partyAttr.level_base;
attribute.ActualLevel = partyAttr.level;
attribute.DecrementPoints = partyAttr.decrement_points;
attribute.IncrementPoints = partyAttr.increment_points;
attributes.push_back(attribute);
}
build.Attributes = attributes;
if (agent) {
build.Primary = (uint32_t)agent->primary;
build.Secondary = (uint32_t)agent->secondary;
}
else if (professionState) {
build.Primary = (uint32_t)professionState->primary;
build.Secondary = (uint32_t)professionState->secondary;
}
build.Skills = skillbar;
player.Build = build;
}
player.UnlockedProfession = unlockedProfessions;
player.Id = playerId;
if (agent) {
player.PosX = agent->pos.x;
player.PosY = agent->pos.y;
player.Timer = agent->timer;
player.Level = agent->level;
player.NpcDefinition = agent->player_number;
player.PrimaryProfessionId = (uint32_t)agent->primary;
player.SecondaryProfessionId = (uint32_t)agent->secondary;
player.Health = agent->hp * (agent->max_hp > 0 ? agent->max_hp : 1);
player.Energy = agent->energy * (agent->max_energy > 0 ? agent->max_energy : 1);
}
else if (professionState) {
player.PrimaryProfessionId = (uint32_t)professionState->primary;
player.SecondaryProfessionId = (uint32_t)professionState->secondary;
}
}
void PopulateWorldPlayer(
std::list<GW::Title> titles,
std::vector<GW::TitleTier> titleTiers,
WorldPlayer& player,
int playerId,
Temp::GWPlayer* gwPlayer,
GW::ProfessionState* professionState,
std::list<uint32_t> skillbar,
GW::PartyAttribute* partyAttribute,
GW::AgentLiving* agent) {
PopulatePlayer(player, playerId, professionState, skillbar, partyAttribute, agent);
if (!gwPlayer) {
return;
}
GW::Title gwTitle;
Title title;
int titleId = 0;
std::wstring gwPlayerName(gwPlayer->name);
auto name = Daybreak::Utils::WStringToString(gwPlayerName);
player.Name = name;
for (const auto &t : titles) {
if (t.current_title_tier_index == gwPlayer->active_title_tier) {
gwTitle = t;
break;
}
titleId++;
}
if (gwTitle.current_title_tier_index >= titleTiers.size()) {
return;
}
auto titleTier = titleTiers[gwTitle.current_title_tier_index];
title.CurrentPoints = gwTitle.current_points;
title.IsPercentage = gwTitle.is_percentage_based();
title.PointsForCurrentRank = gwTitle.points_needed_current_rank;
title.PointsForNextRank = titleTier.tier_number == gwTitle.max_title_rank ? gwTitle.current_points : gwTitle.points_needed_next_rank;
title.TierNumber = titleTier.tier_number;
title.MaxTierNumber = gwTitle.max_title_rank;
title.Id = titleId;
player.Title = title;
}
void PopulateMainPlayer(
MainPlayer& player,
int activeQuestId,
std::list<QuestMetadata> questLog,
std::list<GW::Title> titles,
std::vector<GW::TitleTier> titleTiers,
int playerId,
Temp::GWPlayer* gwPlayer,
GW::ProfessionState* professionState,
std::list<uint32_t> skillbar,
GW::PartyAttribute* partyAttribute,
GW::AgentLiving* agent) {
PopulateWorldPlayer(titles, titleTiers, player, playerId, gwPlayer, professionState, skillbar, partyAttribute, agent);
player.CurrentQuest = activeQuestId;
player.QuestLog = questLog;
player.HardModeUnlocked = GW::GetWorldContext()->is_hard_mode_unlocked == 1;
player.Experience = GW::GetWorldContext()->experience;
player.Morale = GW::GetWorldContext()->morale;
if (agent) {
player.CurrentEnergy = agent->max_energy * agent->energy;
player.CurrentHp = agent->max_hp * agent->hp;
player.MaxEnergy = agent->max_energy;
player.MaxHp = agent->max_hp;
}
}
MainPlayer GetPayload() {
MainPlayer gamePayload;
if (!GW::Map::GetIsMapLoaded()) {
return gamePayload;
}
auto worldContext = GW::GetWorldContext();
auto activeQuestId = GW::QuestMgr::GetActiveQuestId();
auto questLog = GetQuestLog();
auto skillbars = GetSkillbars();
if (skillbars.empty()) {
return gamePayload;
}
auto agents = GetLivingAgents();
if (agents.empty()) {
return gamePayload;
}
auto titles = GetTitles();
if (titles.empty()) {
return gamePayload;
}
auto titleTiers = GetTitleTiers();
if (titleTiers.empty()) {
return gamePayload;
}
auto players = GetPlayers();
if (players.empty()) {
return gamePayload;
}
auto npcs = GetNpcs();
if (npcs.empty()) {
return gamePayload;
}
auto attributes = GetPartyAttributes();
if (attributes.empty()) {
return gamePayload;
}
auto professions = GetProfessions();
if (professions.empty()) {
return gamePayload;
}
auto mapAgents = GetMapEntities();
if (mapAgents.empty()) {
return gamePayload;
}
auto playerAgentId = GW::Agents::GetPlayerId();
MainPlayer mainPlayer;
auto foundMainAttr = std::find_if(attributes.begin(), attributes.end(), [&](GW::PartyAttribute attribute) {
return playerAgentId == attribute.agent_id;
});
auto foundMainAgent = std::find_if(agents.begin(), agents.end(), [&](GW::AgentLiving agentLiving) {
return playerAgentId == agentLiving.agent_id;
});
auto foundMainProfessionsState = std::find_if(professions.begin(), professions.end(), [&](GW::ProfessionState professionState) {
return playerAgentId == professionState.agent_id;
});
auto foundMainGwPlayer = std::find_if(players.begin(), players.end(), [&](Temp::GWPlayer gwPlayer) {
return playerAgentId == gwPlayer.agent_id;
});
GW::AgentLiving* mainAgentPtr;
if (foundMainAgent == agents.end()) {
mainAgentPtr = nullptr;
}
else {
mainAgentPtr = &*foundMainAgent;
}
GW::PartyAttribute* mainAttrPtr;
if (foundMainAttr == attributes.end()) {
mainAttrPtr = nullptr;
}
else {
mainAttrPtr = &*foundMainAttr;
}
GW::ProfessionState* mainProfPtr;
if (foundMainProfessionsState == professions.end()) {
mainProfPtr = nullptr;
}
else {
mainProfPtr = &*foundMainProfessionsState;
}
Temp::GWPlayer* mainGwPlayer;
if (foundMainGwPlayer == players.end()) {
mainGwPlayer = nullptr;
}
else {
mainGwPlayer = &*foundMainGwPlayer;
}
PopulateMainPlayer(mainPlayer, (uint32_t)activeQuestId, questLog, titles, titleTiers, playerAgentId, mainGwPlayer, mainProfPtr, skillbars[playerAgentId], mainAttrPtr, mainAgentPtr);
return mainPlayer;
}
void EnsureInitialized() {
GameThreadMutex.lock();
if (!initialized) {
GW::GameThread::RegisterGameThreadCallback(&GameThreadHook, [&](GW::HookStatus*) {
while (!PromiseQueue.empty()) {
auto promise = PromiseQueue.front();
PromiseQueue.pop();
try {
auto payload = GetPayload();
promise->set_value(payload);
}
catch (...) {
MainPlayer payload;
promise->set_value(payload);
}
}
});
initialized = true;
}
GameThreadMutex.unlock();
}
void GetMainPlayer(const httplib::Request&, httplib::Response& res) {
auto callbackEntry = new GW::HookEntry;
auto response = new std::promise<MainPlayer>;
EnsureInitialized();
PromiseQueue.emplace(response);
json responsePayload = response->get_future().get();
delete callbackEntry;
delete response;
res.set_content(responsePayload.dump(), "text/json");
}
}
-72
View File
@@ -1,72 +0,0 @@
#include "pch.h"
#include "MapModule.h"
#include <GWCA/Managers/GameThreadMgr.h>
#include <GWCA/Managers/MapMgr.h>
#include <future>
#include <payloads/MapPayload.h>
#include <json.hpp>
#include <queue>
namespace Daybreak::Modules::MapModule {
std::queue<std::promise<MapPayload>*> PromiseQueue;
std::mutex GameThreadMutex;
GW::HookEntry GameThreadHook;
volatile bool initialized = false;
MapPayload GetPayload() {
auto isLoaded = GW::Map::GetIsMapLoaded();
auto instanceType = GW::Map::GetInstanceType();
auto instanceTime = GW::Map::GetInstanceTime();
auto mapInfo = GW::Map::GetCurrentMapInfo();
auto isInCinematic = GW::Map::GetIsInCinematic();
auto region = GW::Map::GetRegion();
auto mapId = GW::Map::GetMapID();
MapPayload mapPayload;
mapPayload.Campaign = static_cast<uint32_t>(mapInfo->campaign);
mapPayload.Continent = static_cast<uint32_t>(mapInfo->continent);
mapPayload.Region = mapInfo->region;
mapPayload.InstanceType = (uint32_t)instanceType;
mapPayload.IsLoaded = isLoaded;
mapPayload.Timer = instanceTime;
mapPayload.Id = (uint32_t)mapId;
return mapPayload;
}
void EnsureInitialized() {
GameThreadMutex.lock();
if (!initialized) {
GW::GameThread::RegisterGameThreadCallback(&GameThreadHook, [&](GW::HookStatus*) {
while (!PromiseQueue.empty()) {
auto promise = PromiseQueue.front();
PromiseQueue.pop();
try {
auto payload = GetPayload();
promise->set_value(payload);
}
catch (...) {
MapPayload payload;
promise->set_value(payload);
}
}
});
initialized = true;
}
GameThreadMutex.unlock();
}
void GetMapInfo(const httplib::Request&, httplib::Response& res) {
auto callbackEntry = new GW::HookEntry;
auto response = new std::promise<MapPayload>;
EnsureInitialized();
PromiseQueue.emplace(response);
json responsePayload = response->get_future().get();
delete callbackEntry;
delete response;
res.set_content(responsePayload.dump(), "text/json");
}
}
@@ -1,71 +0,0 @@
#include "pch.h"
#include "PathingMetadataModule.h"
#include <GWCA/Managers/GameThreadMgr.h>
#include <GWCA/Managers/MapMgr.h>
#include <future>
#include <payloads/PathingMetadataPayload.h>
#include <json.hpp>
#include <queue>
#include <GWCA/GameEntities/Pathing.h>
namespace Daybreak::Modules::PathingMetadataModule {
std::queue<std::promise<PathingMetadataPayload>*> PromiseQueue;
std::mutex GameThreadMutex;
GW::HookEntry GameThreadHook;
volatile bool initialized = false;
PathingMetadataPayload GetPayload() {
PathingMetadataPayload pathingPayload;
pathingPayload.TrapezoidCount = 0;
if (!GW::Map::GetIsMapLoaded()) {
return pathingPayload;
}
auto pathingMap = GW::Map::GetPathingMap();
int count = 0;
for (int i = 0; i < pathingMap->size(); i++) {
auto gwPathingMap = pathingMap->at(i);
count += gwPathingMap.trapezoid_count;
}
pathingPayload.TrapezoidCount = count;
return pathingPayload;
}
void EnsureInitialized() {
GameThreadMutex.lock();
if (!initialized) {
GW::GameThread::RegisterGameThreadCallback(&GameThreadHook, [&](GW::HookStatus*) {
while (!PromiseQueue.empty()) {
auto promise = PromiseQueue.front();
PromiseQueue.pop();
try {
auto payload = GetPayload();
promise->set_value(payload);
}
catch (...) {
PathingMetadataPayload payload;
promise->set_value(payload);
}
}
});
initialized = true;
}
GameThreadMutex.unlock();
}
void GetPathingMetadata(const httplib::Request&, httplib::Response& res) {
auto callbackEntry = new GW::HookEntry;
auto response = new std::promise<PathingMetadataPayload>;
EnsureInitialized();
PromiseQueue.emplace(response);
json responsePayload = response->get_future().get();
delete callbackEntry;
delete response;
res.set_content(responsePayload.dump(), "text/json");
}
}
-98
View File
@@ -1,98 +0,0 @@
#include "pch.h"
#include "PathingModule.h"
#include <GWCA/Managers/GameThreadMgr.h>
#include <GWCA/Managers/MapMgr.h>
#include <future>
#include <payloads/PathingPayload.h>
#include <json.hpp>
#include <queue>
#include <GWCA/GameEntities/Pathing.h>
namespace Daybreak::Modules::PathingModule {
std::queue<std::promise<PathingPayload>*> PromiseQueue;
std::mutex GameThreadMutex;
GW::HookEntry GameThreadHook;
volatile bool initialized = false;
PathingPayload GetPayload() {
PathingPayload pathingPayload;
pathingPayload.Trapezoids.clear();
pathingPayload.AdjacencyList.clear();
if (!GW::Map::GetIsMapLoaded()) {
return pathingPayload;
}
auto pathingMap = GW::Map::GetPathingMap();
std::list<PathingTrapezoid> trapezoids;
std::map<int, std::list<int>> adjacencyMap;
for (int i = 0; i < pathingMap->size(); i++) {
auto gwPathingMap = pathingMap->at(i);
for (int j = 0; j < gwPathingMap.trapezoid_count; j++) {
auto gwTrapezoid = gwPathingMap.trapezoids[j];
PathingTrapezoid trapezoid;
trapezoid.Id = gwTrapezoid.id;
trapezoid.PathingMapId = i;
trapezoid.XTL = gwTrapezoid.XTL;
trapezoid.XBL = gwTrapezoid.XBL;
trapezoid.XTR = gwTrapezoid.XTR;
trapezoid.XBR = gwTrapezoid.XBR;
trapezoid.YT = gwTrapezoid.YT;
trapezoid.YB = gwTrapezoid.YB;
trapezoids.push_back(trapezoid);
for (int k = 0; k < 4; k++) {
auto adjacentTrapezoid = gwTrapezoid.adjacent[k];
if (adjacentTrapezoid) {
adjacencyMap[trapezoid.Id].push_back(adjacentTrapezoid->id);
}
}
}
}
std::list<std::list<int>> adjacencyList;
for (const auto& pair : adjacencyMap) {
adjacencyList.push_back(pair.second);
}
pathingPayload.Trapezoids = trapezoids;
pathingPayload.AdjacencyList = adjacencyList;
return pathingPayload;
}
void EnsureInitialized() {
GameThreadMutex.lock();
if (!initialized) {
GW::GameThread::RegisterGameThreadCallback(&GameThreadHook, [&](GW::HookStatus*) {
while (!PromiseQueue.empty()) {
auto promise = PromiseQueue.front();
PromiseQueue.pop();
try {
auto payload = GetPayload();
promise->set_value(payload);
}
catch (...) {
PathingPayload payload;
promise->set_value(payload);
}
}
});
initialized = true;
}
GameThreadMutex.unlock();
}
void GetPathingData(const httplib::Request&, httplib::Response& res) {
auto callbackEntry = new GW::HookEntry;
auto response = new std::promise<PathingPayload>;
EnsureInitialized();
PromiseQueue.emplace(response);
json responsePayload = response->get_future().get();
delete callbackEntry;
delete response;
res.set_content(responsePayload.dump(), "text/json");
}
}
-74
View File
@@ -1,74 +0,0 @@
#include "pch.h"
#include "MapModule.h"
#include <GWCA/Managers/GameThreadMgr.h>
#include <GWCA/Managers/MapMgr.h>
#include <future>
#include <payloads/PreGamePayload.h>
#include <json.hpp>
#include <queue>
#include <GWCA/GWCA.h>
#include <GWCA/Context/PreGameContext.h>
namespace Daybreak::Modules::PreGameModule {
std::queue<std::promise<PreGamePayload>*> PromiseQueue;
std::mutex GameThreadMutex;
GW::HookEntry GameThreadHook;
volatile bool initialized = false;
PreGamePayload GetPayload() {
PreGamePayload preGamePayload;
if (GW::Map::GetIsMapLoaded()) {
preGamePayload.Characters.clear();
preGamePayload.ChosenCharacterIndex = 0;
return preGamePayload;
}
auto context = GW::GetPreGameContext();
for (const auto& loginChar : context->chars) {
std::string charName(20, '\0');
auto length = std::wcstombs(&charName[0], loginChar.character_name, 20);
charName.resize(length);
preGamePayload.Characters.push_back(charName);
}
preGamePayload.ChosenCharacterIndex = context->index_1;
return preGamePayload;
}
void EnsureInitialized() {
GameThreadMutex.lock();
if (!initialized) {
GW::GameThread::RegisterGameThreadCallback(&GameThreadHook, [&](GW::HookStatus*) {
while (!PromiseQueue.empty()) {
auto promise = PromiseQueue.front();
PromiseQueue.pop();
try {
auto payload = GetPayload();
promise->set_value(payload);
}
catch (...) {
PreGamePayload payload;
promise->set_value(payload);
}
}
});
initialized = true;
}
GameThreadMutex.unlock();
}
void GetPreGameInfo(const httplib::Request&, httplib::Response& res) {
auto callbackEntry = new GW::HookEntry;
auto response = new std::promise<PreGamePayload>;
EnsureInitialized();
PromiseQueue.emplace(response);
json responsePayload = response->get_future().get();
delete callbackEntry;
delete response;
res.set_content(responsePayload.dump(), "text/json");
}
}
-21
View File
@@ -1,21 +0,0 @@
#include "pch.h"
#include "ProcessIdModule.h"
namespace http {
namespace modules {
static DWORD processId = 0;
int GetProcessId() {
if (processId > 0) {
return processId;
}
processId = GetCurrentProcessId();
return processId;
}
void HandleProcessId(const httplib::Request&, httplib::Response& res) {
res.set_content(std::to_string(GetProcessId()), "text/plain");
}
}
}
-76
View File
@@ -1,76 +0,0 @@
#include "pch.h"
#include "Server.h"
namespace http {
namespace server {
static httplib::Server server;
static int FindPort() {
// Initialize Winsock
WSADATA wsaData;
if (WSAStartup(MAKEWORD(2, 2), &wsaData) != 0) {
std::cout << "Failed to initialize Winsock." << std::endl;
return -1;
}
// Create a socket
SOCKET serverSocket = socket(AF_INET, SOCK_STREAM, 0);
if (serverSocket == INVALID_SOCKET) {
std::cout << "Failed to create socket." << std::endl;
return -1;
}
sockaddr_in serverAddr;
serverAddr.sin_family = AF_INET;
serverAddr.sin_addr.s_addr = INADDR_ANY;
// Start from a specific port number and find an available port
int port = 48557;
while (true) {
serverAddr.sin_port = htons(port);
if (bind(serverSocket, (struct sockaddr*)&serverAddr, sizeof(serverAddr)) == 0) {
std::cout << "Successfully bound to port " << port << std::endl;
break;
}
else {
port++; // Try the next port
}
if (port > 65534) {
std::cout << "Failed to find a port. Cannot initialize server" << std::endl;
return -1;
}
}
// Clean up
closesocket(serverSocket);
WSACleanup();
return port;
}
void Get(const std::string& pattern, httplib::Server::Handler handler) {
server.Get(pattern, handler);
}
void SetLogger(httplib::Logger logger) {
server.set_logger(logger);
}
bool StartServer() {
int port = FindPort();
if (port > 0) {
std::cout << "Initializing server on port " << port << std::endl;
server.listen("0.0.0.0", port);
return true;
}
return false;
}
void StopServer() {
server.stop();
}
}
}
-76
View File
@@ -1,76 +0,0 @@
#include "pch.h"
#include "SessionModule.h"
#include <GWCA/Managers/GameThreadMgr.h>
#include <GWCA/Managers/MapMgr.h>
#include <future>
#include <payloads/SessionPayload.h>
#include <json.hpp>
#include <queue>
#include <GWCA/Context/AgentContext.h>
#include <GWCA/Context/WorldContext.h>
namespace Daybreak::Modules::SessionModule {
std::queue<std::promise<SessionPayload>*> PromiseQueue;
std::mutex GameThreadMutex;
GW::HookEntry GameThreadHook;
volatile bool initialized = false;
SessionPayload GetPayload() {
SessionPayload sessionPayload;
sessionPayload.MapId = (uint32_t)GW::Map::GetMapID();
sessionPayload.InstanceType = (uint32_t)GW::Map::GetInstanceType();
const auto worldContext = GW::GetWorldContext();
if (!worldContext) {
return sessionPayload;
}
sessionPayload.FoesKilled = worldContext->foes_killed;
sessionPayload.FoesToKill = worldContext->foes_to_kill;
const auto agentContext = GW::GetAgentContext();
if (!agentContext) {
return sessionPayload;
}
sessionPayload.InstanceTimer = agentContext->instance_timer;
return sessionPayload;
}
void EnsureInitialized() {
GameThreadMutex.lock();
if (!initialized) {
GW::GameThread::RegisterGameThreadCallback(&GameThreadHook, [&](GW::HookStatus*) {
while (!PromiseQueue.empty()) {
auto promise = PromiseQueue.front();
PromiseQueue.pop();
try {
auto payload = GetPayload();
promise->set_value(payload);
}
catch (...) {
SessionPayload payload;
promise->set_value(payload);
}
}
});
initialized = true;
}
GameThreadMutex.unlock();
}
void GetSessionInfo(const httplib::Request&, httplib::Response& res) {
auto callbackEntry = new GW::HookEntry;
auto response = new std::promise<SessionPayload>;
EnsureInitialized();
PromiseQueue.emplace(response);
json responsePayload = response->get_future().get();
delete callbackEntry;
delete response;
res.set_content(responsePayload.dump(), "text/json");
}
}
-80
View File
@@ -1,80 +0,0 @@
#include "pch.h"
#include "UserModule.h"
#include <GWCA/Managers/GameThreadMgr.h>
#include <GWCA/Managers/MapMgr.h>
#include <future>
#include <payloads/UserPayload.h>
#include <json.hpp>
#include <queue>
#include <GWCA/Context/CharContext.h>
#include <GWCA/Context/WorldContext.h>
namespace Daybreak::Modules::UserModule {
std::queue<std::promise<UserPayload>*> PromiseQueue;
std::mutex GameThreadMutex;
GW::HookEntry GameThreadHook;
volatile bool initialized = false;
UserPayload GetPayload() {
UserPayload userPayload;
auto charContext = GW::GetCharContext();
auto worldContext = GW::GetWorldContext();
std::string emailstr(64, '\0');
auto length = std::wcstombs(&emailstr[0], charContext->player_email, 64);
emailstr.resize(length);
userPayload.Email = emailstr;
userPayload.CurrentKurzickPoints = worldContext->current_kurzick;
userPayload.CurrentLuxonPoints = worldContext->current_luxon;
userPayload.CurrentImperialPoints = worldContext->current_imperial;
userPayload.CurrentBalthazarPoints = worldContext->current_balth;
userPayload.CurrentSkillPoints = worldContext->current_skill_points;
userPayload.TotalKurzickPoints = worldContext->total_earned_kurzick;
userPayload.TotalLuxonPoints = worldContext->total_earned_luxon;
userPayload.TotalImperialPoints = worldContext->total_earned_imperial;
userPayload.TotalBalthazarPoints = worldContext->total_earned_balth;
userPayload.TotalSkillPoints = worldContext->total_earned_skill_points;
userPayload.MaxKurzickPoints = worldContext->max_kurzick;
userPayload.MaxLuxonPoints = worldContext->max_luxon;
userPayload.MaxImperialPoints = worldContext->max_imperial;
userPayload.MaxBalthazarPoints = worldContext->max_balth;
return userPayload;
}
void EnsureInitialized() {
GameThreadMutex.lock();
if (!initialized) {
GW::GameThread::RegisterGameThreadCallback(&GameThreadHook, [&](GW::HookStatus*) {
while (!PromiseQueue.empty()) {
auto promise = PromiseQueue.front();
PromiseQueue.pop();
try {
auto payload = GetPayload();
promise->set_value(payload);
}
catch (...) {
UserPayload payload;
promise->set_value(payload);
}
}
});
initialized = true;
}
GameThreadMutex.unlock();
}
void GetUserInfo(const httplib::Request&, httplib::Response& res) {
auto callbackEntry = new GW::HookEntry;
auto response = new std::promise<UserPayload>;
EnsureInitialized();
PromiseQueue.emplace(response);
json responsePayload = response->get_future().get();
delete callbackEntry;
delete response;
res.set_content(responsePayload.dump(), "text/json");
}
}
-32
View File
@@ -1,32 +0,0 @@
#include "pch.h"
#include <iostream>
#include <limits>
#include <windows.h>
#include <string>
#include <cstdint>
namespace Daybreak::Utils {
std::string WStringToString(const std::wstring& wstr)
{
if (wstr.empty()) return std::string();
int size_needed = WideCharToMultiByte(CP_UTF8, 0, &wstr[0], (int)wstr.size(), NULL, 0, NULL, NULL);
std::string strTo(size_needed, 0);
WideCharToMultiByte(CP_UTF8, 0, &wstr[0], (int)wstr.size(), &strTo[0], size_needed, NULL, NULL);
return strTo;
}
bool StringToInt(const std::string& str, int& outValue) {
size_t pos = 0;
unsigned long result = std::stoul(str, &pos);
// Ensure the entire string was processed
if (pos != str.size()) {
return false;
}
outValue = static_cast<int>(result);
return true;
}
}
-161
View File
@@ -1,161 +0,0 @@
// dllmain.cpp : Defines the entry point for the DLL application.
#include "pch.h"
#include "httplib.h"
#include <GWCA/GWCA.h>
#include <GWCA/Utilities/Scanner.h>
#include <GWCA/Utilities/Hook.h>
#include <GWCA/Utilities/Hooker.h>
#include <GWCA/Managers/RenderMgr.h>
#include <GWCA/Managers/MemoryMgr.h>
#include "AliveModule.h"
#include "ProcessIdModule.h"
#include "HttpLogger.h"
#include "Server.h"
#include "MapModule.h"
#include "LoginModule.h"
#include "PathingMetadataModule.h"
#include "PathingModule.h"
#include "PreGameModule.h"
#include "InventoryModule.h"
#include "UserModule.h"
#include "GameModule.h"
#include "MainPlayerModule.h"
#include "SessionModule.h"
#include "EntityNameModule.h"
#include "GameStateModule.h"
#include "ItemNameModule.h"
#include <mutex>
volatile bool initialized;
volatile WNDPROC oldWndProc;
std::mutex startupMutex;
HMODULE dllmodule;
HANDLE serverThread;
static FILE* stdout_proxy;
static FILE* stderr_proxy;
void Terminate()
{
http::server::StopServer();
if (serverThread) {
CloseHandle(serverThread);
}
#ifdef BUILD_TYPE_DEBUG
if (stdout_proxy)
fclose(stdout_proxy);
if (stderr_proxy)
fclose(stderr_proxy);
FreeConsole();
#endif
}
static DWORD WINAPI StartHttpServer(LPVOID)
{
// This is a new thread so you should only initialize GWCA and setup the hook on the game thread.
// When the game thread hook is setup (i.e. SetRenderCallback), you should do the next operations
// on the game from within the game thread.
http::server::SetLogger(http::ConsoleLogger);
http::server::Get("/alive", http::modules::HandleAlive);
http::server::Get("/id", http::modules::HandleProcessId);
http::server::Get("/map", Daybreak::Modules::MapModule::GetMapInfo);
http::server::Get("/login", Daybreak::Modules::LoginModule::GetLoginInfo);
http::server::Get("/pathing/metadata", Daybreak::Modules::PathingMetadataModule::GetPathingMetadata);
http::server::Get("/pathing", Daybreak::Modules::PathingModule::GetPathingData);
http::server::Get("/pregame", Daybreak::Modules::PreGameModule::GetPreGameInfo);
http::server::Get("/user", Daybreak::Modules::UserModule::GetUserInfo);
http::server::Get("/game", Daybreak::Modules::GameModule::GetGameInfo);
http::server::Get("/inventory", Daybreak::Modules::InventoryModule::GetInventoryInfo);
http::server::Get("/game/mainplayer", Daybreak::Modules::MainPlayerModule::GetMainPlayer);
http::server::Get("/game/state", Daybreak::Modules::GameStateModule::GetGameStateInfo);
http::server::Get("/session", Daybreak::Modules::SessionModule::GetSessionInfo);
http::server::Get("/entities/name", Daybreak::Modules::EntityNameModule::GetName);
http::server::Get("/items/name", Daybreak::Modules::ItemNameModule::GetName);
http::server::StartServer();
return 0;
}
LRESULT CALLBACK WndProc(const HWND hWnd, const UINT Message, const WPARAM wParam, const LPARAM lParam) {
if (Message == WM_CLOSE || (Message == WM_SYSCOMMAND && wParam == SC_CLOSE)) {
Terminate();
}
return CallWindowProc(oldWndProc, hWnd, Message, wParam, lParam);
}
LRESULT CALLBACK SafeWndProc(const HWND hWnd, const UINT Message, const WPARAM wParam, const LPARAM lParam) noexcept
{
__try {
return WndProc(hWnd, Message, wParam, lParam);
}
__except (EXCEPTION_EXECUTE_HANDLER) {
return CallWindowProc(oldWndProc, hWnd, Message, wParam, lParam);
}
}
void OnWindowCreated(IDirect3DDevice9*) {
startupMutex.lock();
if (initialized) {
startupMutex.unlock();
return;
}
#ifdef BUILD_TYPE_DEBUG
AllocConsole();
SetConsoleTitleA("Daybreak.GWCA Console");
freopen_s(&stdout_proxy, "CONOUT$", "w", stdout);
freopen_s(&stderr_proxy, "CONOUT$", "w", stderr);
#endif
auto handle = GW::MemoryMgr::GetGWWindowHandle();
oldWndProc = reinterpret_cast<WNDPROC>(SetWindowLongPtrW(handle, GWL_WNDPROC, reinterpret_cast<LONG>(SafeWndProc)));
serverThread = CreateThread(
NULL,
0,
StartHttpServer,
NULL,
0,
NULL);
startupMutex.unlock();
initialized = true;
return;
}
static DWORD WINAPI Init(LPVOID)
{
printf("Init: Setting up scanner\n");
GW::Scanner::Initialize();
printf("Init: Setting up hook base\n");
GW::HookBase::Initialize();
printf("Init: Setting up GWCA\n");
if (!GW::Initialize()) {
printf("Init: Failed to set up GWCA\n");
return 0;
}
printf("Init: Enabling hooks\n");
GW::HookBase::EnableHooks();
printf("Init: Set up render callback\n");
GW::Render::SetRenderCallback(OnWindowCreated);
printf("Init: Returning success\n");
FreeLibraryAndExitThread(dllmodule, EXIT_SUCCESS);
return 0;
}
// DLL entry point, dont do things in this thread unless you know what you are doing.
BOOL APIENTRY DllMain(HMODULE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{
DisableThreadLibraryCalls(hModule);
if (ul_reason_for_call == DLL_PROCESS_ATTACH) {
HANDLE handle = CreateThread(0, 0, Init, hModule, 0, 0);
CloseHandle(handle);
}
return TRUE;
}
@@ -1,18 +0,0 @@
#include <cstdint>
#include <payloads/Attribute.h>
#include <json.hpp>
using json = nlohmann::json;
namespace Daybreak {
void to_json(json& j, const Attribute& p) {
j = json
{
{"Id", p.Id},
{"BaseLevel", p.BaseLevel},
{"ActualLevel", p.ActualLevel},
{"DecrementPoints", p.DecrementPoints},
{"IncrementPoints", p.IncrementPoints},
};
}
}
-16
View File
@@ -1,16 +0,0 @@
#pragma once
#include <cstdint>
#include <payloads/BagContent.h>
#include <payloads/Bag.h>
#include <json.hpp>
using json = nlohmann::json;
namespace Daybreak {
void to_json(json& j, const Bag& p) {
j = json
{
{"Items", p.Items},
};
}
}
@@ -1,19 +0,0 @@
#pragma once
#include <cstdint>
#include <GWCA/GameEntities/Map.h>
#include <payloads/BagContent.h>
#include <json.hpp>
using json = nlohmann::json;
namespace Daybreak {
void to_json(json& j, const BagContent& p) {
j = json
{
{"Id", p.Id},
{"Slot", p.Slot},
{"Count", p.Count},
{"Modifiers", p.Modifiers},
};
}
}
-19
View File
@@ -1,19 +0,0 @@
#include <cstdint>
#include <GWCA/GameEntities/Map.h>
#include <json.hpp>
#include <payloads/Build.h>
#include <payloads/Attribute.h>
using json = nlohmann::json;
namespace Daybreak {
void to_json(json& j, const Build& p) {
j = json
{
{"Primary", p.Primary},
{"Secondary", p.Secondary},
{"Attributes", p.Attributes},
{"Skills", p.Skills}
};
}
}
@@ -1,22 +0,0 @@
#include <cstdint>
#include <GWCA/GameEntities/Map.h>
#include <json.hpp>
#include <payloads/MainPlayer.h>
#include <payloads/MapIcon.h>
#include <payloads/GamePayload.h>
using json = nlohmann::json;
namespace Daybreak {
void to_json(json& j, const GamePayload& p) {
j = json
{
{"MainPlayer", p.MainPlayer},
{"Party", p.Party},
{"WorldPlayers", p.WorldPlayers},
{"LivingEntities", p.LivingEntities},
{"MapIcons", p.MapIcons},
{"TargetId", p.TargetId},
};
}
}
@@ -1,14 +0,0 @@
#include <cstdint>
#include <json.hpp>
#include <payloads/GameStatePayload.h>
using json = nlohmann::json;
namespace Daybreak {
void to_json(json& j, const GameStatePayload& p) {
j = json
{
{"States", p.States},
};
}
}
@@ -1,25 +0,0 @@
#include <cstdint>
#include <GWCA/GameEntities/Map.h>
#include <json.hpp>
#include <payloads/Bag.h>
#include <payloads/InventoryPayload.h>
using json = nlohmann::json;
namespace Daybreak {
void to_json(json& j, const InventoryPayload& p) {
j = json
{
{"GoldInStorage", p.GoldInStorage},
{"GoldOnCharacter", p.GoldOnCharacter},
{"Backpack", p.Backpack},
{"BeltPouch", p.BeltPouch},
{"Bags", p.Bags},
{"EquipmentPack", p.EquipmentPack},
{"MaterialStorage", p.MaterialStorage},
{"UnclaimedItems", p.UnclaimedItems},
{"StoragePanes", p.StoragePanes},
{"EquippedItems", p.EquippedItems},
};
}
}
@@ -1,26 +0,0 @@
#include <cstdint>
#include <GWCA/GameEntities/Map.h>
#include <json.hpp>
#include <payloads/LivingEntity.h>
using json = nlohmann::json;
namespace Daybreak {
void to_json(json& j, const LivingEntity& p) {
j = json
{
{"Id", p.Id},
{"Timer", p.Timer},
{"PosX", p.PosX},
{"PosY", p.PosY},
{"NpcDefinition", p.NpcDefinition},
{"PrimaryProfessionId", p.PrimaryProfessionId},
{"SecondaryProfessionId", p.SecondaryProfessionId},
{"Level", p.Level},
{"EntityState", p.EntityState},
{"EntityAllegiance", p.EntityAllegiance},
{"Health", p.Health},
{"Energy", p.Energy}
};
}
}
@@ -1,16 +0,0 @@
#include <cstdint>
#include <GWCA/GameEntities/Map.h>
#include <json.hpp>
#include <payloads/LoginPayload.h>
using json = nlohmann::json;
namespace Daybreak {
void to_json(json& j, const LoginPayload& p) {
j = json
{
{"Email", p.Email},
{"PlayerName", p.PlayerName},
};
}
}
@@ -1,23 +0,0 @@
#include <cstdint>
#include <GWCA/GameEntities/Map.h>
#include <json.hpp>
#include <payloads/WorldPlayer.h>
#include <payloads/QuestMetadata.h>
#include <payloads/MainPlayer.h>
using json = nlohmann::json;
namespace Daybreak {
void to_json(json& j, const MainPlayer& p) {
to_json(j, (WorldPlayer)p);
j["CurrentQuest"] = p.CurrentQuest;
j["QuestLog"] = p.QuestLog;
j["HardModeUnlocked"] = p.HardModeUnlocked;
j["Experience"] = p.Experience;
j["Morale"] = p.Morale;
j["CurrentHp"] = p.CurrentHp;
j["MaxHp"] = p.MaxHp;
j["CurrentEnergy"] = p.CurrentEnergy;
j["MaxEnergy"] = p.MaxEnergy;
}
}
-18
View File
@@ -1,18 +0,0 @@
#include <cstdint>
#include <GWCA/GameEntities/Map.h>
#include <json.hpp>
#include <payloads/MapIcon.h>
using json = nlohmann::json;
namespace Daybreak {
void to_json(json& j, const MapIcon& p) {
j = json
{
{"Id", p.Id},
{"PosX", p.PosX},
{"PosY", p.PosY},
{"Affiliation", p.Affiliation},
};
}
}
@@ -1,22 +0,0 @@
#include <cstdint>
#include <GWCA/GameEntities/Map.h>
#include <json.hpp>
#include <payloads/MapPayload.h>
using json = nlohmann::json;
namespace Daybreak {
void to_json(json& j, const MapPayload& p) {
j = json
{
{"IsLoaded", p.IsLoaded},
{"Id", p.Id},
{"InstanceType", p.InstanceType},
{"Timer", p.Timer},
{"Campaign", p.Campaign},
{"Continent", p.Continent},
{"Region", p.Region},
{"Type", p.Type},
};
}
}
@@ -1,15 +0,0 @@
#include <cstdint>
#include <json.hpp>
#include <payloads/NamePayload.h>
using json = nlohmann::json;
namespace Daybreak {
void to_json(json& j, const NamePayload& p) {
j = json
{
{"Id", p.Id},
{"Name", p.Name}
};
}
}
@@ -1,15 +0,0 @@
#include <cstdint>
#include <GWCA/GameEntities/Map.h>
#include <json.hpp>
#include <payloads/PathingMetadataPayload.h>
using json = nlohmann::json;
namespace Daybreak {
void to_json(json& j, const PathingMetadataPayload& p) {
j = json
{
{"TrapezoidCount", p.TrapezoidCount},
};
}
}
@@ -1,17 +0,0 @@
#include <cstdint>
#include <GWCA/GameEntities/Map.h>
#include <payloads/PathingTrapezoid.h>
#include <json.hpp>
#include <payloads/PathingPayload.h>
using json = nlohmann::json;
namespace Daybreak {
void to_json(json& j, const PathingPayload& p) {
j = json
{
{"Trapezoids", p.Trapezoids},
{"AdjacencyList", p.AdjacencyList}
};
}
}
@@ -1,22 +0,0 @@
#include <cstdint>
#include <GWCA/GameEntities/Map.h>
#include <json.hpp>
#include <payloads/PathingTrapezoid.h>
using json = nlohmann::json;
namespace Daybreak {
void to_json(json& j, const PathingTrapezoid& p) {
j = json
{
{"Id", p.Id},
{"PathingMapId", p.PathingMapId},
{"XTL", p.XTL},
{"XTR", p.XTR},
{"XBL", p.XBL},
{"XBR", p.XBR},
{"YT", p.YT},
{"YB", p.YB},
};
}
}
-17
View File
@@ -1,17 +0,0 @@
#include <cstdint>
#include <GWCA/GameEntities/Map.h>
#include <json.hpp>
#include <payloads/LivingEntity.h>
#include <payloads/Build.h>
#include <payloads/Player.h>
using json = nlohmann::json;
namespace Daybreak {
void to_json(json& j, const Player& p) {
to_json(j, (LivingEntity)p);
j["UnlockedProfession"] = p.UnlockedProfession;
j["NpcDefinition"] = p.NpcDefinition;
j["Build"] = p.Build;
}
}
@@ -1,15 +0,0 @@
#include <cstdint>
#include <json.hpp>
#include <payloads/PreGamePayload.h>
using json = nlohmann::json;
namespace Daybreak {
void to_json(json& j, const PreGamePayload& p) {
j = json
{
{"ChosenCharacterIndex", p.ChosenCharacterIndex},
{"Characters", p.Characters},
};
}
}
@@ -1,19 +0,0 @@
#include <cstdint>
#include <GWCA/GameEntities/Map.h>
#include <json.hpp>
#include <payloads/QuestMetadata.h>
using json = nlohmann::json;
namespace Daybreak {
void to_json(json& j, const QuestMetadata& p) {
j = json
{
{"Id", p.Id},
{"PosX", p.PosX},
{"PosY", p.PosY},
{"FromId", p.FromId},
{"ToId", p.ToId},
};
}
}
@@ -1,18 +0,0 @@
#include <cstdint>
#include <json.hpp>
#include <payloads/SessionPayload.h>
using json = nlohmann::json;
namespace Daybreak {
void to_json(json& j, const SessionPayload& p) {
j = json
{
{"FoesKilled", p.FoesKilled},
{"FoesToKill", p.FoesToKill},
{"MapId", p.MapId},
{"InstanceTimer", p.InstanceTimer},
{"InstanceType", p.InstanceType},
};
}
}
@@ -1,19 +0,0 @@
#include <cstdint>
#include <json.hpp>
#include <payloads/StatePayload.h>
using json = nlohmann::json;
namespace Daybreak {
void to_json(json& j, const StatePayload& p) {
j = json
{
{"Id", p.Id},
{"PosX", p.PosX},
{"PosY", p.PosY},
{"State", p.State},
{"Health", p.Health},
{"Energy", p.Energy}
};
}
}
-21
View File
@@ -1,21 +0,0 @@
#include <cstdint>
#include <GWCA/GameEntities/Map.h>
#include <json.hpp>
#include <payloads/Title.h>
using json = nlohmann::json;
namespace Daybreak {
void to_json(json& j, const Title& p) {
j = json
{
{"Id", p.Id},
{"CurrentPoints", p.CurrentPoints},
{"PointsForCurrentRank", p.PointsForCurrentRank},
{"PointsForNextRank", p.PointsForNextRank},
{"TierNumber", p.TierNumber},
{"MaxTierNumber", p.MaxTierNumber},
{"IsPercentage", p.IsPercentage},
};
}
}

Some files were not shown because too many files have changed in this diff Show More