MafiaHub / Framework

Advanced modding framework for multiplayer modifications
https://mafiahub.dev
Other
40 stars 7 forks source link
cpp framework modding multiplayer networking nodejs v8
MafiaHub
Discord server license


A suite of tools and libraries to accelerate multi-player modification development.
Brought to you by @Segfault, @zaklaus, @DavoSK, and other contributors!

Introduction

This codebase provides a suite of tools and libraries to simplify the development of multi-player modifications and ensure consistency across all of them. The primary goal is to provide a common foundation and interface with shared functionality and data. It covers many fields we found necessary during the development of multi-player mods, such as:

MafiaHub Services are NOT part of this project, but our framework provides a simple way to integrate them. Feel free to ask us for more information about this service so we can provide the resources and a license to use it.

Contributing

We're always looking for new contributors, so if you have any ideas or suggestions, please let us know, and we'll see how we can improve it. You can reach us at our Discord server MafiaHub or raise an issue on our repository.

If you're interested in development, please read our Contribution Guidelines.

Building

We use CMake to build our projects so that you can use any of the supported build systems. We currently support Windows, Linux, and MacOS operating systems. You can follow this guide to get started:

First make sure your Git client supports LFS objects, visit Git LFS page for more info.

# Clone the repo
git clone https://github.com/MafiaHub/Framework.git
cd Framework

# Pull LFS objects
git lfs pull

Note: If you have issues cloning the repository (Git LFS-related errors), first ensure you have Git LFS support enabled. If you do, and this looks to be a server issue, please get in touch with @ZaKlaus on our Discord server to investigate it.

Build on macOS/Linux

# Configure CMake project
cmake -B build

# Build framework
cmake --build build

# Run framework tests
cmake --build build --target RunFrameworkTests

Build on Windows

Visual Studio 2022 support

Please ensure you have the cmake tools installed in your copy of Visual Studio first. Open your newly cloned Framework repository folder in Visual Studio, and it will automatically set up everything for you!

Things to note:

CLion support

The guide on how to set up the project files for CLion is available here.

Add a multi-player project to the framework

Multi-player modifications are cloned into the code/projects directory and are automatically picked up by the framework. We use this approach to efficiently manage the projects and their dependencies and perform mass changes and general maintenance during development.

# Create and navigate to the folder
mkdir -p code/projects
cd code/projects

# Clone an MP repo that uses the framework
git clone git@github.com:<your-awesome-username>/<your-amazing-project>.git

# e.g.
git clone https://github.com/MafiaHub/MafiaMP.git

Now, you can access your targets and build them within the framework.

To exclude a project from compilation, create an empty file called IGNORE in the project's root.

License

The code is licensed under the MafiaHub OSS license.

The 5th clause ensures the work can focus primarily on this repository, as we provide access to the framework and its services. This is important to ensure that the framework is not used for other purposes, such as creating other projects, that would diverge from the framework. This approach guarantees that the changes are directly made to the framework, having a healthy ecosystem in mind.