本机需安装 .NET SDK(目标框架 net10.0)。依赖通过 NuGet 拉取(SPTarkov.Server.Core、SPTarkov.DI、SPTarkov.Common,版本对齐服务端 4.1.x),无需本机 SPT 程序集。
dotnet build -c Release
产物为 bin/Release/WeaponCrossModding.dll。
单元测试位于 tests/WeaponCrossModding.Tests/,用最小物品 / 槽位夹具直接驱动插件的槽位注入,覆盖各白名单追加、互斥关系与幂等:
dotnet test tests/WeaponCrossModding.Tests/WeaponCrossModding.Tests.csproj
.github/workflows/build.yml 在推送 v* 标签(或手动触发)时自动构建并打包:
dotnet restore 与 dotnet build -c Release。dotnet test tests/WeaponCrossModding.Tests/WeaponCrossModding.Tests.csproj -c Release。bin/Release/WeaponCrossModding.dll 存在。<Version>,按游戏根目录结构打包为 WeaponCrossModding-v{版本}.zip。Version(csproj)应与标签保持一致(如标签 v0.1.0 对应 <Version>0.1.0</Version>)。
将 WeaponCrossModding.dll 放入服务端 user/mods/WeaponCrossModding/ 目录,然后重启服务端:
systemctl --user restart pj568-spt-server
也可以直接解压 Release 中的 WeaponCrossModding-v{版本}.zip 到对应目录。
部署后按实机验证检查启动日志。
===============================================================
A .NET SDK is required (target framework net10.0). Dependencies are pulled from NuGet (SPTarkov.Server.Core, SPTarkov.DI, SPTarkov.Common, version-aligned with server 4.1.x), so no local SPT assemblies are needed.
dotnet build -c Release
The output is bin/Release/WeaponCrossModding.dll.
The unit tests live in tests/WeaponCrossModding.Tests/. They drive the plugin's slot injection directly with minimal item / slot fixtures, covering every whitelist addition, the conflict, and idempotency:
dotnet test tests/WeaponCrossModding.Tests/WeaponCrossModding.Tests.csproj
.github/workflows/build.yml builds and packages automatically when a v* tag is pushed (or on manual dispatch):
dotnet restore and dotnet build -c Release.dotnet test tests/WeaponCrossModding.Tests/WeaponCrossModding.Tests.csproj -c Release.bin/Release/WeaponCrossModding.dll exists.<Version> from the csproj and package it as WeaponCrossModding-v{version}.zip using the game-root layout.Version (csproj) should stay in sync with the tag (e.g. tag v0.1.0 ↔ <Version>0.1.0</Version>).
Place WeaponCrossModding.dll into the server's user/mods/WeaponCrossModding/ directory, then restart the server:
systemctl --user restart pj568-spt-server
Alternatively, extract WeaponCrossModding-v{version}.zip from a Release into the corresponding directory.
After deploying, check the startup log as described in In-game verification.