Skip to content
This repository has been archived by the owner on Oct 21, 2023. It is now read-only.

Latest commit

 

History

History
89 lines (66 loc) · 4.75 KB

CONTRIBUTING.md

File metadata and controls

89 lines (66 loc) · 4.75 KB

How to contribute to cRPG

Contributors should follow Google Engineering Practices! For example too large PRs or PRs with no context might get ignored.

Report a bug

  • Do not open GitHub issue if the bug is a security vulnerability in cRPG, and instead follow the security policy.
  • Ensure the bug was not already reported by searching on GitHub under Issues
  • If you're unable to find an open issue addressing the problem, open a new one. Make sure to include a title and a clear description, as much relevant information as possible, and ideally a screenshot or a video pointing out the issue

Add a feature / Fix a bug

  • Discuss first with the developers on the cRPG Discord if you're adding a new feature
  • Open a new GitHub pull request with the patch
  • Ensure the PR description clearly describes the problem and solution. Include the relevant issue number if applicable.
  • Make sure the changes are correctly unit-tested. Tests can be skipped if the changes are on the mod itself since Bannerlord code is tedious to test

High Level Architecture

crpg-architecture

Run

VS Code Dev Container

  • Install VS Code extension Dev Containers
  • Run the Remote-Containers: Open Folder in Container command from the Command Palette (F1)
  • For frontend development it is recommended to enable Takeover mode. Unfortunately, for now in manual mode

More info about dev containers.

Manually

Web API (src/WebApi)

  • Download .NET 7 SDK
  • Download your favorite IDE: Visual Studio, Visual Studio Code, Rider...
  • Open the solution file Crpg.sln
  • Run dotnet dev-certs https --trust to be able to launch the API with HTTPS. The authentication creates a cookie with SameSite=None and recent version of Chrome requires HTTPS to do so
  • Build and run (can be done without IDE using dotnet cli)

By default, the Web API uses an in-memory database so no DBMS need to be downloaded.

Some features are disabled by default and require a secret key. To set a secret you can run dotnet user-secrets set "MY_SECRET_KEY" "MY_SECRET_VALUE". Here is the list of the features that can be enabled:

  • Steam authentication: Steam:ApiKey (acquired by filling out this form)
  • Epic Games authentication: EpicGames:ClientId + EpicGames:ClientSecret
  • Xbox authentication: Microsoft:ClientId + Microsoft:ClientSecret
  • Game server statistics: Datadog:ApiKey + Datadog:ApplicationKey
  • Patch notes: Github:AccessToken
  • Patreon donor synchronization: Patreon:AccessToken
  • Afdian donor synchronization: Afdian:AccessToken

Web UI (src/WebUI)

  • Download Node.js
  • Go to src/WebUI
  • Run npm install to install dependencies
  • Run npm run dev to launch the application
  • Use npm run lint to fix the coding style

The client relies on the server so you have to run both.

Mod (src/Module.Client + src/Module.Server)

  • Follow TaleWorlds' guide "Hosting a custom server"
  • Set the environment variable MB_CLIENT_PATH to your Bannerlord client installation (e.g. C:\Program Files (x86)\Steam\steamapps\common\Mount & Blade II: Bannerlord)
  • Set the environment variable MB_SERVER_PATH to your Bannerlord server installation (e.g. C:\Program Files (x86)\Steam\steamapps\common\Mount & Blade II: Dedicated Server)
  • Build to generate the Crpg.Module.dll file in the Modules folder of both the client and the server

By default, the game server is not connected to the main cRPG server so you don't get your characters when joining a server but a character is created with random items and characteristics. To connect to the main cRPG server you need to set the environment variable CRPG_API_KEY.

Custom cRPG items and maps are not stored in the git repository. If you need them for development you can copy the AssetPackages folder from the Workshop into the client module and also the SceneObj folder from the Workshop into both the client and server.