Skip to content

Commit

Permalink
Modify command output in bitmod_provision, add new solution & CI to e…
Browse files Browse the repository at this point in the history
…xclude unstable/indev plugins, and add sample configs for provision plugin.
  • Loading branch information
Mooshua committed Aug 31, 2023
1 parent e016822 commit c57c3ce
Show file tree
Hide file tree
Showing 4 changed files with 119 additions and 6 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: BitMod.Tests
name: BitMod.Nightlies

on: [push, pull_request]

Expand Down Expand Up @@ -26,15 +26,15 @@ jobs:
dotnet-quality: 'ga'

- name: Build ${{ matrix.runtime }}
run: dotnet publish BitMod.sln -c Release -r ${{ matrix.runtime }}
run: dotnet publish BitMod.Stable.sln -c Release -r ${{ matrix.runtime }}

- name: Upload Files
uses: actions/upload-artifact@v3
with:
name: nightly_${{ matrix.runtime }}
name: nightly-${{ matrix.runtime }}
path: build/
test:
name: Tests
name: Test Nightlies
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand Down
89 changes: 89 additions & 0 deletions BitMod.Stable.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@

Microsoft Visual Studio Solution File, Format Version 12.00
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BitMod", "api\BitMod\BitMod.csproj", "{20CD73A1-A74C-4205-AD74-9B48EEEFB3EC}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "api", "api", "{621F6C25-527F-4BA1-BF59-1D19021A9B88}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "upstream", "upstream", "{382D2698-5A85-4BA7-85C7-CD58874F8169}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BitMod.Plugins", "standalone\BitMod.Plugins\BitMod.Plugins.csproj", "{8D614C4F-22BE-461A-BD7D-80507EAA823F}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{11BEBA9D-0E44-4A6D-A5EF-5A53B977EC06}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "standalone", "standalone", "{2EF5B35B-16D2-49CE-82D5-37883FCF6EA7}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BitMod.Launcher", "standalone\BitMod.Launcher\BitMod.Launcher.csproj", "{46F25EB1-C8E0-4703-A5CA-616433688BE7}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BitMod.Config", "standalone\BitMod.Config\BitMod.Config.csproj", "{0D18FC47-D9D6-409D-8E7F-18AEE75C4267}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BitMod.Logging", "standalone\BitMod.Logging\BitMod.Logging.csproj", "{10FD03DE-6B69-40EA-98C7-5B4D77D46455}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "samples", "samples", "{D86C6A21-BE31-48C4-BEF3-72DC1871BD85}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BitMod.Commands", "builtin\BitMod.Commands\BitMod.Commands.csproj", "{95ECB03D-E249-408B-9B51-EB408D687A38}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "McMaster.NETCore.Plugins", "upstream\DotNetCorePlugins\src\Plugins\McMaster.NETCore.Plugins.csproj", "{E3329930-AED7-44DD-89BB-0D4830645020}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "builtin", "builtin", "{CCEA8B6B-5212-4C12-BB31-A70501DE31D0}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BitMod.Whitelist", "builtin\BitMod.Whitelist\BitMod.Whitelist.csproj", "{24DAB423-21F1-4231-922F-084C415C7D09}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "plugins", "plugins", "{40317A0E-F34B-4367-BF2C-C2540A521B28}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BitMod.Provision", "builtin\BitMod.Provision\BitMod.Provision.csproj", "{4D61086F-8EBB-4FD1-86AD-AA8EDF2E1686}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{20CD73A1-A74C-4205-AD74-9B48EEEFB3EC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{20CD73A1-A74C-4205-AD74-9B48EEEFB3EC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{20CD73A1-A74C-4205-AD74-9B48EEEFB3EC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{20CD73A1-A74C-4205-AD74-9B48EEEFB3EC}.Release|Any CPU.Build.0 = Release|Any CPU
{8D614C4F-22BE-461A-BD7D-80507EAA823F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8D614C4F-22BE-461A-BD7D-80507EAA823F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8D614C4F-22BE-461A-BD7D-80507EAA823F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8D614C4F-22BE-461A-BD7D-80507EAA823F}.Release|Any CPU.Build.0 = Release|Any CPU
{46F25EB1-C8E0-4703-A5CA-616433688BE7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{46F25EB1-C8E0-4703-A5CA-616433688BE7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{46F25EB1-C8E0-4703-A5CA-616433688BE7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{46F25EB1-C8E0-4703-A5CA-616433688BE7}.Release|Any CPU.Build.0 = Release|Any CPU
{0D18FC47-D9D6-409D-8E7F-18AEE75C4267}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0D18FC47-D9D6-409D-8E7F-18AEE75C4267}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0D18FC47-D9D6-409D-8E7F-18AEE75C4267}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0D18FC47-D9D6-409D-8E7F-18AEE75C4267}.Release|Any CPU.Build.0 = Release|Any CPU
{10FD03DE-6B69-40EA-98C7-5B4D77D46455}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{10FD03DE-6B69-40EA-98C7-5B4D77D46455}.Debug|Any CPU.Build.0 = Debug|Any CPU
{10FD03DE-6B69-40EA-98C7-5B4D77D46455}.Release|Any CPU.ActiveCfg = Release|Any CPU
{10FD03DE-6B69-40EA-98C7-5B4D77D46455}.Release|Any CPU.Build.0 = Release|Any CPU
{95ECB03D-E249-408B-9B51-EB408D687A38}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{95ECB03D-E249-408B-9B51-EB408D687A38}.Debug|Any CPU.Build.0 = Debug|Any CPU
{95ECB03D-E249-408B-9B51-EB408D687A38}.Release|Any CPU.ActiveCfg = Release|Any CPU
{95ECB03D-E249-408B-9B51-EB408D687A38}.Release|Any CPU.Build.0 = Release|Any CPU
{E3329930-AED7-44DD-89BB-0D4830645020}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E3329930-AED7-44DD-89BB-0D4830645020}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E3329930-AED7-44DD-89BB-0D4830645020}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E3329930-AED7-44DD-89BB-0D4830645020}.Release|Any CPU.Build.0 = Release|Any CPU
{24DAB423-21F1-4231-922F-084C415C7D09}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{24DAB423-21F1-4231-922F-084C415C7D09}.Debug|Any CPU.Build.0 = Debug|Any CPU
{24DAB423-21F1-4231-922F-084C415C7D09}.Release|Any CPU.ActiveCfg = Release|Any CPU
{24DAB423-21F1-4231-922F-084C415C7D09}.Release|Any CPU.Build.0 = Release|Any CPU
{4D61086F-8EBB-4FD1-86AD-AA8EDF2E1686}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4D61086F-8EBB-4FD1-86AD-AA8EDF2E1686}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4D61086F-8EBB-4FD1-86AD-AA8EDF2E1686}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4D61086F-8EBB-4FD1-86AD-AA8EDF2E1686}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{20CD73A1-A74C-4205-AD74-9B48EEEFB3EC} = {621F6C25-527F-4BA1-BF59-1D19021A9B88}
{46F25EB1-C8E0-4703-A5CA-616433688BE7} = {2EF5B35B-16D2-49CE-82D5-37883FCF6EA7}
{0D18FC47-D9D6-409D-8E7F-18AEE75C4267} = {2EF5B35B-16D2-49CE-82D5-37883FCF6EA7}
{10FD03DE-6B69-40EA-98C7-5B4D77D46455} = {2EF5B35B-16D2-49CE-82D5-37883FCF6EA7}
{8D614C4F-22BE-461A-BD7D-80507EAA823F} = {2EF5B35B-16D2-49CE-82D5-37883FCF6EA7}
{E3329930-AED7-44DD-89BB-0D4830645020} = {382D2698-5A85-4BA7-85C7-CD58874F8169}
{95ECB03D-E249-408B-9B51-EB408D687A38} = {CCEA8B6B-5212-4C12-BB31-A70501DE31D0}
{24DAB423-21F1-4231-922F-084C415C7D09} = {CCEA8B6B-5212-4C12-BB31-A70501DE31D0}
{4D61086F-8EBB-4FD1-86AD-AA8EDF2E1686} = {CCEA8B6B-5212-4C12-BB31-A70501DE31D0}
EndGlobalSection
EndGlobal
7 changes: 5 additions & 2 deletions builtin/BitMod.Provision/Host/ProvisionHost.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using BattleBitAPI.Common;
using BattleBitAPI.Server;

using BitMod.Attributes.Injects;
using BitMod.Attributes.Targets;
Expand Down Expand Up @@ -41,18 +42,20 @@ private void Provision(BitServer server)
var globalAdapter = new ProvisionConfigAdapter(_config);
var localAdapter = globalAdapter.GetServer(server);

_logger.Information("Provision for for server {@Server}: {@Local}", server.ToString(), localAdapter);

if (localAdapter == null)
return;

if (localAdapter.HasMapcycle())
{
_logger.Verbose("Provisioning {@Server}'s mapcycle to {@Mapcycle}", server.ToString(), localAdapter.GetMapcycle());
_logger.Debug("Provisioning {@Server}'s mapcycle to {@Mapcycle}", server.ToString(), localAdapter.GetMapcycle());
server.MapRotation.SetRotation(localAdapter.GetMapcycle());
}

if (localAdapter.HasGamemodes())
{
_logger.Verbose("Provisioning {@Server}'s gamemodes to {@Gamemodes}", server.ToString(), localAdapter.GetGamemodes());
_logger.Debug("Provisioning {@Server}'s gamemodes to {@Gamemodes}", server.ToString(), localAdapter.GetGamemodes());
server.GamemodeRotation.SetRotation(localAdapter.GetGamemodes());
}
}
Expand Down
21 changes: 21 additions & 0 deletions standalone/BitMod.Launcher/configs/provisions.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
"Provisions"
{
// The IP/Port pair of your server.
// For example, 127.0.0.1:20000
"ServerIP:ServerPort"
{
"gamemodes"
{
// The gamemodes in index-value pairs.
// Note that these values are not yet validated for correctness!
"0" "TDM"
"1" "CONQ"
}

// "mapcycle"
// {
// If you want to enforce a custom mapcycle, do it here.
// Same format as gamemodes.
// }
}
}

0 comments on commit c57c3ce

Please sign in to comment.