508 Commits

Author SHA1 Message Date
Tixx e33f47e838 Add BEAMMP_MAX_CONCURRENT_CONNECTIONS env var 2026-06-18 22:32:06 +02:00
Tixx 54f49d81e2 Bump version to v3.9.3 2026-05-23 20:51:50 +02:00
Lion Kortlepel 4104dc1f18 fix lua result serialization causing various issues
for example, loading a library which returns a table of functions would
fail with an inexplicable (to the user) error about serialization. This
is now fixed. We no longer use a single result type, instead there are
void results and normal results, and the former simply never has to
worry about the result.

This was likely causing even more issues; if the `sol::object` was
populated before, it hitting the dtor in another path would, again, like
we've seen before, corrupt the lua stack.
2026-04-29 18:29:02 +00:00
Lion Kortlepel 57fe7cb055 fix GCC 11 compiler/libstdc++ error
GCC 11's C++ stdlib does a weird maneuver here where it needs to know
the size of the std::pair<>::second's type. So we wrap it in a ptr.
2026-04-19 21:16:43 +00:00
Lion Kortlepel 06bd719dbf clarify/fix std::visit compile time check 2026-04-19 20:34:20 +00:00
Lion Kortlepel 8f2b8b25e8 add AGPL headers to more new files 2026-04-19 18:41:06 +00:00
Lion Kortlepel f820d75851 fix TLuaValue handling to be less odd 2026-04-19 18:17:54 +00:00
Lion Kortlepel b3e8d86cef refactor Lua result handling for safety
this massively improves thread safety and cleanly serializes accesses
into the lua engine's result objects where accesses before were
extremely unsafe and could access a corrupt/invalid stack.

this fixes various obscure crashes related to accessing results,
without changing any observable behavior.
2026-04-19 18:17:54 +00:00
Lion Kortlepel 66f5f2b8b6 fix error handling from SetErrorMessageFromResult 2026-04-19 18:17:54 +00:00
Lion Kortlepel e260de55af fix sol::error crash 2026-04-19 18:17:54 +00:00
Lion Kortlepel 7089e5da9a fix race on disconnect
between the time we check for `is_open` and the actual disconnect, the
socket could already have been disconnected by another thread (TOCTOU).
Furthermore, the disconnects can race causing a segfault or similar
issue in the asio's internals.
2026-04-19 18:17:53 +00:00
Lion Kortlepel b1946ef1d9 use ReadWithTimeout until fully completed auth 2026-04-19 18:17:53 +00:00
Lion Kortlepel c08eefdf69 move TIoPollThread out and use it in TServer
the previous IoCtx was never being polled
2026-04-19 18:17:53 +00:00
Lion Kortlepel 1f55c35f2b fix ReadSocketWithTimeout to use dedicated io context polled on a new jthread
jthread so it's cancellable
2026-04-19 18:17:53 +00:00
Lion Kortlepel 0ac5da2366 add connection limiter stats to status command 2026-04-19 18:17:53 +00:00
Lion Kortlepel 6fca901aa2 implement connection limiter to replace manual limiting code 2026-04-08 12:31:35 +00:00
Tixx d56d9892c4 Bump version to 3.9.2 2026-04-01 00:40:30 +02:00
SaltySnail 5c2a0db7ef Added timeout on read 2026-03-31 22:32:57 +02:00
Tixx 4af0e4ccac feature: BEAMMP_PROVIDER_DISABLE_MP_SET environment variable (#461)
This pull request adds BEAMMP_PROVIDER_DISABLE_MP_SET variable
(true/false/1/0) to disable MP::Set for providers.

---

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.
2026-03-21 20:11:51 +01:00
Tixx 5d2b198fb8 adding logchat boolean to MP.SendChatMessage (#471)
This PR adds a boolean parameter to the MP.SendChatMessage function that
allows logging the message or not (default true).

I took an example from the ``set_function("SendNotification" ...`` to
make the default value working.

It's my first time actually doing C++, I hope it's alright!

---

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.
2026-03-21 20:11:38 +01:00
Tixx 89392a67c2 Bump version to 3.9.1 2026-03-08 18:16:10 +01:00
TechStreet f38797a9ab feature: BEAMMP_PROVIDER_DISABLE_MP_SET environment variable 2026-02-24 17:39:22 +00:00
boubouleuh 595247d51d adding logchat boolean to MP.SendChatMessage 2026-02-02 22:33:58 +01:00
Tixx 99476a2c77 Revert "Add stack trace to server lua engine (#350)" 2026-01-15 14:44:13 +01:00
Tixx c4c894c1f7 Bump version v3.9.0 2025-10-20 22:41:29 +02:00
Tixx 039a44bba5 Bump version to v3.8.5 2025-07-31 17:26:14 +02:00
Tixx add0b86b37 Implement Dialog packet and add MP.ConfirmationDialog (#427)
This PR implements a new lua function and packet used for sends dialogs
to the client.

## Example:


https://github.com/user-attachments/assets/97bb5813-ea12-4b1d-a049-2f7ebf6b6da3

Example serverside code:
```lua
--MP.ConfirmationDialog(player_id: number, title: string, body: string, buttons: object, interaction_id: string, warning: boolean = false, reportToServer: boolean = true, reportToExtensions: boolean = true)

function onChatMessage(player_id, player_name, message)
    MP.ConfirmationDialog(player_id, "Warning", "Watch your tone buddy!!", 
        {
            {
                label = "OK",
                key = "dialogOK",
                isCancel = true
            }
        }, "interactionID", true)
end

MP.RegisterEvent("onChatMessage", "onChatMessage")


function dialogOK(player_id, interaction_id)
    MP.SendChatMessage(-1, MP.GetPlayerName(player_id) .. " clicked OK")
end

MP.RegisterEvent("dialogOK", "dialogOK")
```

### Details:
Each dialog can have multiple buttons, each button having it's own
callback event (`key`).
Each dialog can also have one button with `isCancel` being true,
settings this property to true causes the button's event to be called
when the users pressed `esc` to exit out of the dialog. If a dialog is
created without any button being the cancel button then the user will
only be able to exit the dialog by restarting the session or pressing
one of the buttons.

`interaction_id` will be sent as the event data with a button press
event, to track from which dialog the button press came. As when
multiple dialogs are opened they will stack and it will become difficult
to track what button on which dialog was pressed without having multiple
event handlers.


Waiting on https://github.com/BeamMP/BeamMP/pull/715 to be merged.

---

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-06-26 06:52:18 +02:00
Tixx 403c1d5f78 Add support for reporting to options in ConfirmationDialog 2025-06-25 13:51:20 +02:00
Tixx 6318ca79e7 Implement Dialog packet and add MP.ConfirmationDialog 2025-06-25 13:22:05 +02:00
Tixx 22c0a966bb Add nettest command 2025-06-21 20:32:25 +02:00
Tixx 731599f16e Json vehicle state and apply paint packet (#416)
Converts the vehicle stored client side from a raw string to parsed json
data. This allows us to more easily edit the vehicle state serverside,
which I've started using in this PR for updating the state after a paint
packet.

---

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-06-19 17:46:49 +02:00
Tixx 38c6766b2b Bump version to v3.8.4 2025-06-14 20:14:42 +02:00
Tixx 068f553fa9 Add BEAMMP_PROVIDER_IP_ENV 2025-05-17 01:04:55 +02:00
Tixx b7cf304d49 Client resource hash database and client resource protection (#430)
# Mod database
This PR adds a local database of mods, which is used to cache mod hashes
and protection status.

## Mod hash caching
Mod hashes will now be cached based on last write date. This will speed
up server startup because only the mods with changes will have to be
hashed.

## Mod protection
You can now protect mods! This will allow you to host a server with
copyrighted content without actually hosting the copyrighted content.
Just run `protectmod <filename with .zip> <true/false>` in the console
to protect a mod. Users that join a server with protected mods will have
to obtain the file themselves and put it in their launcher's resources
folder. The launcher will inform the user about this if the file is
missing.

## Mod reloading
You can now reload client mods while the server is running by using
`reloadmods` in the console. Keep in mind that this is mainly intended
for development, therefore it will **not** force client to rejoin and
neither will is hot-reload mods on the client.

---

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-11 01:32:19 +02:00
Tixx ea9c808233 Bump version 2025-05-05 23:53:17 +02:00
Tixx 40c8c0c5c2 Add protectmod and reloadmods console commands 2025-04-26 21:15:16 +02:00
Tixx a5ca50866f Lowercase lua extension check 2025-04-19 21:59:50 +02:00
Tixx 7db40e068e Replace obsolete function 2025-04-01 09:43:49 +02:00
Tixx 7a439bb5b9 Add mod hash caching and mod protection 2025-03-31 08:04:15 +02:00
Tixx 6c3174ac08 Add custom IP bind option (#425)
This PR adds an option in the server config to bind to a custom IP.

- [x] Review config comment and make sure that it is not confused with
port forwarding
- [x] Validate IP addresses

---

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-03-29 20:39:02 +01:00
Tixx 3f7cf7a258 Bump version 2025-03-16 08:08:40 +01:00
Tixx 71b8a61c97 Add custom IP bind option 2025-03-15 20:45:48 +01:00
Tixx 2f577a2358 Store vehicles in parsed json 2025-01-25 22:16:06 +01:00
Tixx bd9b6212e2 Bump version 2025-01-19 13:41:14 +01:00
Tixx ec21cbbe86 Bump version 2025-01-18 21:40:07 +01:00
Tixx 26f1be0a51 Switch to curl 2025-01-11 22:18:50 +01:00
Tixx d7e75ae0c7 Fix windows build 2025-01-11 22:18:19 +01:00
Tixx b4d4967529 Bump version 2024-12-09 09:52:58 +01:00
0R3Z 99136f133a remove sentry leftovers 2024-11-16 19:02:50 +01:00
Tixx 976ab68ca3 Bump version 2024-11-05 23:13:46 +01:00