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
2025-01-25 21:28:15 +01:00
2024-09-18 15:58:55 +02:00
2024-09-18 15:58:55 +02:00
2024-06-26 14:12:45 +02:00
2024-05-10 14:57:22 +02:00
2024-11-16 19:02:50 +01:00
2024-09-18 15:58:55 +02:00
2025-01-11 22:18:19 +01:00
2024-11-16 19:02:50 +01:00
2024-01-23 21:00:11 +01:00
2024-11-14 18:29:30 +01:00
2025-01-11 22:18:19 +01:00

BeamMP-Server

CMake Windows Build CMake Linux Build

This is the server for the multiplayer mod BeamMP for the game BeamNG.drive. The server is the point through which all clients communicate. You can write Lua mods for the server, there are detailed instructions on the BeamMP Wiki.

For Linux, you need the runtime dependencies, which are listed below under Runtime Dependencies

Support + Contact

Feel free to ask any questions via the following channels:

Minimum Requirements

These values are guesstimated and are subject to change with each release.

  • RAM: 30-100 MiB usable (not counting OS overhead)
  • CPU: >1GHz, preferably multicore
  • OS: Windows, Linux (theoretically any POSIX)
  • GPU: None
  • HDD: 10 MiB + Mods/Plugins
  • Bandwidth: 5-10 Mb/s upload

Contributing

TLDR; Issues with the "help wanted" or "good first issue" label or with nobody assigned.

To contribute, look at the active issues. Any issues that have the "help wanted" label or don't have anyone assigned are good tasks to take on. You can either contribute by programming or by testing and adding more info and ideas.

Fork this repository, make a new branch for your feature, implement your feature or fix, and then create a pull-request here. Even incomplete features and fixes can be pull-requested.

If you need support with understanding the codebase, please write us in the Discord. You'll need to be proficient in modern C++.

About Building from Source

We only allow building unmodified (original) source code for public use. master is considered unstable and we will not provide technical support if such a build doesn't work, so always build from a tag. You can checkout a tag with git checkout tags/TAGNAME, where TAGNAME is the tag, for example v3.4.1. See the tags for possible versions/tags, as well as the releases to check which version is marked as a release/prerelease. We recommend using the latest release.

Supported Operating Systems

The code itself supports (latest stable) Linux, Windows and FreeBSD. In terms of actual build support, for now we usually only distribute Windows binaries and Linux. For any other distro or OS, you just have to find the same libraries listed in Runtime Dependencies further down the page, and it should build fine.

Recommended compilers: MSVC, GCC, CLANG.

You can find precompiled binaries under Releases.

Build Instructions

On Linux, you need some dependencies to build the server (on Windows, you don't):

liblua5.3-dev curl zip unzip tar cmake make git g++

You can install these with your distribution's package manager. You will need sudo or need root for ONLY this step.

The names of each package may change depending on your platform.

If you are building for ARM (like aarch64), you need to run export VCPKG_FORCE_SYSTEM_BINARIES=1 before the following commands.

You can build on Windows, Linux or other platforms by following these steps:

  1. Check out the repository with git: git clone --recursive https://github.com/BeamMP/BeamMP-Server.
  2. Go into the directory cd BeamMP-Server.
  3. Specify the server version to build by checking out a tag: git checkout tags/v3.4.1 - Possible versions/tags
  4. Run CMake cmake -S . -B bin -DCMAKE_BUILD_TYPE=Release - this can take a few minutes and may take a lot of disk space and bandwidth.
  5. Build via cmake --build bin --parallel --config Release -t BeamMP-Server.
  6. Your executable can be found in bin/.

When you make changes to the code, you only have to run step 4 again.

Building for FreeBSD

Building is only supported for major release branches of FreeBSD that are currently not EOL. The build process is the same as on Linux, although build dependencies can be universally installed from ports via pkg:

pkg install git cmake-core zip bash devel/ninja devel/pkgconf lua53

After installing the necessary build dependencies, follow the Linux build instructions beginning from step 3. Beware that running the initial cmake command will compile vcpkg from source, as vcpkg has no native FreeBSD port - this may take some time.

On systems with a single logical CPU core, make may fail to build the server when using the --parallel option when calling CMake. If you see error messages related to make, simply omit the --parallel from the command: cmake --build bin --config Release -t BeamMP-Server.

Runtime Dependencies

These are needed to run the server.

Debian, Ubuntu and friends: liblua5.3-0

Other Linux distros: liblua of some kind.

Windows: No libraries.

Support

The BeamMP project is supported by community donations via our Patreon. This brings perks such as Patreon-only channels on our Discord, early access to new updates, and more server keys.

Description
Server for the multiplayer mod BeamMP for BeamNG.drive
Readme AGPL-3.0 12 MiB
Languages
C++ 92.9%
CMake 4.2%
C 1.2%
Shell 1%
Lua 0.7%