Commit Graph

170 Commits

Author SHA1 Message Date
Tixx
0341d401e7 Download check (#184)
This PR makes it so that the mod hash and download confirmation are
verified before proceeding.

---

By creating this pull request, I understand that code that is AI
generated or otherwise automatically generated may be rejected without
further discussion.
I declare that I fully understand all code I pushed into this PR, and
wrote all this code myself and own the rights to this code.
2025-05-05 23:46:32 +02:00
Tixx
d3263acead Log corrupted download confirmation 2025-05-01 20:54:28 +02:00
Tixx
4de0bc9a40 Check download confirmation packet 2025-05-01 20:47:16 +02:00
Tixx
25a1061700 Verify mod hash after downloading 2025-05-01 20:42:01 +02:00
Tixx
dc78883451 Notify user about missing protected mods 2025-04-01 09:09:49 +02:00
Tixx
dd5256ae22 Increase download speed calculation precision 2025-03-29 00:19:25 +01:00
Tixx
e24cbf61bb Only fail on socket error or connection closed 2025-03-29 00:19:24 +01:00
Tixx
472e2d16b6 Fix recv return type and better download error handling 2025-03-29 00:19:24 +01:00
Tixx
a4005c5876 Include chrono 2025-03-15 23:06:49 +01:00
Tixx
d3bddb0203 Properly handle the future 2025-02-23 22:04:15 +01:00
Tixx
8373a70c4b Mod download improvements (#162)
This PR adds multiple features relating to mod downloads.
1. With this PR the launcher will convert old style mods (without hash)
to new style mods (with hash). This is so people don't have to
re-download all of their mods after joining a server which was
previously on a version below 3.6.0
2. This PR will save the last used date of mods in a JSON file in the
caching directory. This will allow for smart deletion of cached mods

---

By creating this pull request, I understand that code that is AI
generated or otherwise automatically generated may be rejected without
further discussion.
I declare that I fully understand all code I pushed into this PR, and
wrote all this code myself and own the rights to this code.
2025-01-18 22:56:33 +01:00
Tixx
d52a791dd9 Create mods.json if its missing 2025-01-18 22:29:49 +01:00
Tixx
e5e40e186b Server info (#161)
Adds an `I` packet to the core handler, which allows the mod to use the
newly added [information packet
](https://github.com/BeamMP/BeamMP-Server/pull/382) in the server.
Usage:
Mod sends `I0.0.0.0:0000` and the launcher will send either
`I0.0.0.0:0000;` back if something went wrong, or `I0.0.0.0:0000;{Server
information JSON}` if it succeeded.

---

By creating this pull request, I understand that code that is AI
generated or otherwise automatically generated may be rejected without
further discussion.
I declare that I fully understand all code I pushed into this PR, and
wrote all this code myself and own the rights to this code.
2025-01-18 20:52:44 +01:00
Tixx
8d4ba6f158 Implement size header for info packet 2025-01-12 16:57:33 +01:00
Tixx
a5d450b680 Raise buffer and remove timeout 2025-01-11 22:13:12 +01:00
Tixx
f4e985976f Strip packet letter in log 2025-01-11 21:55:08 +01:00
Tixx
db9ec53a6e Up curl connection timeout to 2 minutes (#160)
In some cases it can take longer than 10 seconds to connect to the
backend, so in this PR I've raised the limit to 2 minutes.

---

By creating this pull request, I understand that code that is AI
generated or otherwise automatically generated may be rejected without
further discussion.
I declare that I fully understand all code I pushed into this PR, and
wrote all this code myself and own the rights to this code.
2025-01-11 21:54:35 +01:00
Tixx
333a95262b Check port and timeout recv 2025-01-11 21:50:39 +01:00
Tixx
e53885a8a8 Raise http get timeout to 2 minutes 2025-01-11 21:45:06 +01:00
Tixx
ad8eab3d66 Log error buffer 2024-12-29 16:39:56 +01:00
Tixx
e880da5cf9 Up curl connection timeout to 2 minutes 2024-12-25 00:54:19 +01:00
Tixx
649514ca1a Save mod usage date 2024-12-24 13:53:50 +01:00
Tixx
7149075d53 Implement core server information packet 2024-12-22 23:56:29 +01:00
Tixx
c485fba26b Change an easily confusable warning to debug 2024-12-22 12:13:59 +01:00
Tixx
d35567dd47 Look for new mods in the old format 2024-12-22 12:07:25 +01:00
Tixx
46e6fda26e Update license header 2024-12-07 11:26:09 +01:00
Tixx
d58ff960ec Fix github regex 2024-11-07 21:39:18 +01:00
Tixx
bd4c9c34a9 Add BeamMP github to the list of allowed links 2024-11-02 22:33:26 +01:00
Tixx
8519e279a7 Add beammp.gg to the list of allowed links 2024-11-02 22:18:46 +01:00
Tixx
6b6e304cfd Switch to std::async 2024-10-18 19:23:53 +02:00
Tixx
06cb366bb5 Add mutex to CoreSend 2024-10-16 23:12:02 +02:00
Tixx
0b35f0484f put blocking http requests on another thread 2024-10-16 23:12:02 +02:00
Tixx
ca9dd1ae75 Switch to only timeout on connection 2024-10-14 20:29:19 +02:00
Lion
9ebd218856 Fix empty modlist (#136)
This PR fixes the launcher getting confused when the server sends an
empty mod list using the new downloading system.
Related server PR: https://github.com/BeamMP/BeamMP-Server/pull/377
2024-10-12 22:10:47 +02:00
Tixx
d9874ce70e Make return from parsemodinfo look better 2024-10-12 21:12:12 +02:00
Tixx
3f12bb757a Mod info logs and check for old format 2024-10-10 21:35:27 +02:00
Lion Kortlepel
7d52e44434 only listen on localhost ipv4 2024-10-10 16:14:16 +02:00
Tixx
4fbd25b551 Handle new modlist being empty but still valid 2024-10-09 19:41:38 +02:00
Tixx
3cf1a2e51b Add mod info debug log 2024-10-09 19:39:27 +02:00
Lion Kortlepel
49874fd633 Revert "remove 'D' socket initialization code"
This reverts commit 6a23518eff.
2024-10-09 18:00:43 +02:00
Lion Kortlepel
6a23518eff remove 'D' socket initialization code 2024-10-09 17:36:54 +02:00
Lion Kortlepel
3297b3e62e fix not recognizing empty mod lists on new mod list 2024-10-09 17:35:50 +02:00
Lion Kortlepel
7b59cb6f87 fix various commandline argument related things 2024-10-07 00:33:43 +02:00
Lion
259b21502e Add command-line options (#90)
This PR adds command-line options as outlined in #74 

Closes #74
2024-10-06 23:49:47 +02:00
snepsnepsnep
ace96b7e33 follow HTTP redirects 2024-10-05 23:45:50 +02:00
Tixx
2ddb576e72 Log core port 2024-10-05 17:20:40 +02:00
Tixx
aca61886d0 add command-line options 2024-10-05 17:20:40 +02:00
Lion
768f11f6ec Add mod hashing, improve download protocol (#129) 2024-10-04 23:36:57 +02:00
Lion Kortlepel
85908e42d5 fix download code, error checking 2024-10-04 23:12:23 +02:00
Lion Kortlepel
5c77e60f29 remove mis-merged code 2024-10-04 23:04:30 +02:00