Updated README (#494)

Added style guide information and other small touch-ups.
This commit is contained in:
Refringe
2025-07-21 09:44:39 -04:00
committed by GitHub
parent b8f7f80953
commit e0b78ad342
+42 -26
View File
@@ -1,6 +1,6 @@
# Single Player Tarkov - Server Project
This is the Server project for the Single Player Tarkov mod for Escape From Tarkov. It can be run locally to replicate responses to the modified Escape From Tarkov client
This is the Server project for the Single Player Tarkov mod for Escape From Tarkov. It can be run locally to replicate responses to the modified Escape From Tarkov client.
# Table of Contents
@@ -17,6 +17,8 @@ This is the Server project for the Single Player Tarkov mod for Escape From Tark
- [Contributing](#contributing)
- [Branches](#branchs)
- [Pull Request Guidelines](#pull-request-guidelines)
- [Git LFS](#git-large-file-storage-lfs)
- [Style Guide](#style-guide)
- [Tests](#tests)
- [License](#license)
@@ -30,12 +32,9 @@ For a full list of features, please see [FEATURES.md](FEATURES.md)
This project has been built in [Visual Studio](https://visualstudio.microsoft.com/) (VS) and [Rider](https://www.jetbrains.com/rider/) using [.NET](https://dotnet.microsoft.com/en-us/)
Minimum required Visual Studio version is `17.13.5`
Minimum required Rider version is `2024.3`
[CSharpier](https://csharpier.com/docs/Editors) plugin is requirement for autoformatting. It is available for either of the above IDE's.
You only need one of the above.
One of the following is required:
- Minimum Visual Studio version required: `17.13.5`
- Minimum Rider version required: `2024.3`
### Initial Setup
@@ -52,30 +51,29 @@ You only need one of the above.
### Debugging
To debug the project in Visual Studio Code:[SPTarkov.Server.Core.csproj](Libraries/SPTarkov.Server.Core/SPTarkov.Server.Core.csproj)
1. Choose `Server` and `Spt Server` in the debug dropdowns
To debug the project in Visual Studio:
1. Choose `Server` and `Spt Server` in the debug drop-downs
2. Choose `Debug > Start Debugging (F5)` to run the server
[SPTarkov.Server.Core.csproj](Libraries/SPTarkov.Server.Core/SPTarkov.Server.Core.csproj)
With Rider:
And in Rider:
1. Choose the configuration called `SPTarkov.Server: Spt Server Debug`
2. Hit `(Alt + F5)` To start Debugging
2. Press `(Alt + F5)` to start debugging
### Mod Debugging
To debug a server mod in Visual Studio, you can copy the mod DLL into the `user/mods` folder and then start the server
To debug a server mod in Visual Studio, you can copy the mod DLL into the `user/mods` folder and then start the server.
## Deployment
To build the project via CLI:
1. Open the terminal at the poject root
2. Run command `dotnetn publish`
- `-c Release` for release build
- `-p:SptVersion=*.*.*` to set the version ProgramStatics uses
- `-p:SptCommit=******` to set the commit ProgramStatics uses
- `-p:SptBuildTime=*********` to set the buildTime ProgramStatic uses
- `-p:SptBuildType=*********` to set the BuildType ProgramStatic uses
- - Options for SptBuildType are in the EntryType Enum
- - LOCAL, DEBUG, RELEASE, BLEEDING_EDGE, BLEEDING_EDGE_MODS - *must be all caps*
1. Open the terminal at the project root
2. Run the command `dotnet publish`
- `-c Release` for release build
- `-p:SptVersion=*.*.*` to set the version ProgramStatics uses
- `-p:SptCommit=******` to set the commit ProgramStatics uses
- `-p:SptBuildTime=*********` to set the buildTime ProgramStatic uses
- `-p:SptBuildType=*********` to set the BuildType ProgramStatic uses
- Options for `SptBuildType`: `LOCAL`, `DEBUG`, `RELEASE`, `BLEEDING_EDGE`, `BLEEDING_EDGE_MODS`
## Contributing
@@ -86,7 +84,7 @@ We're really excited that you're interested in contributing! Before submitting y
- **master**
The default branch used for the latest stable release. This branch is protected and typically is only merged with release branches.
- **development**
The main branch for server development. PRs should target this.
The main branch for server development. **PRs should target this.**
### Pull Request Guidelines
@@ -101,14 +99,32 @@ We're really excited that you're interested in contributing! Before submitting y
- **Write Detailed Commit Messages**
Bring out your table manners, speak the Queen's English and be on your best behaviour.
### Git Large File Storage (LFS)
We use a custom git LFS server to store large files. The public server is read-only. If you are adding or modifying large files, you will need to create an issue with details about this change so that a project developer can make them to a writable endpoint of the LFS server. Bonus points if you include a patch file in the issue. **You will not be able to submit a pull request for LFS file changes.**
### Style Guide
TODO: style guidance
Ensure that your code is automatically formatted whenever you save a file.
We use [CSharpier](https://csharpier.com/) to keep the project's code styled/formatted. You can install it globally by running: `dotnet tool install -g csharpier`. You may then apply the formatting rules by running: `csharpier format .`. Please ensure this is ran before your PR is created to make merges easier. A workflow will fail if formatting changes are required.
#### Format On Save
There are Plugins for both [VS](https://marketplace.visualstudio.com/items?itemName=csharpier.csharpier-vscode) and [Rider](https://plugins.jetbrains.com/plugin/18243-csharpier) which allow you to automatically format project code when a file is saved.
In Rider, after installing the CSharpier plugin:
- Open `Settings`
- Browse to `Editor`, `Code Style`:
- Set scheme to `Project`
- Check `Enable EditorConfig Support`
- Browse to `Tools`, `CSharpier`:
- Enable "Run On Save"
- Browse to `Tools`, `Actions on save`:
- Check `Reformat and Cleanup Code`
- Set to `Reformat & Apply Syntax Style`, `Changed lines`
### Tests
We have a number of tests that are run automatically when you submit a pull request. You can run these tests locally by running The unit test sub-project. If you're adding a new feature or fixing a bug, please conceder adding tests to cover your changes so that we can ensure they don't break in the future.
We have a number of tests that are run automatically when you submit a pull request. You can run these tests locally by running The unit test sub-project. If you're adding a new feature or fixing a bug, please consider adding tests to cover your changes so that we can ensure they don't break in the future.
## License