diff --git a/TGCommandLine/ChatCommands.cs b/TGCommandLine/ChatCommands.cs index 314a8725a1..651520457d 100644 --- a/TGCommandLine/ChatCommands.cs +++ b/TGCommandLine/ChatCommands.cs @@ -80,7 +80,7 @@ namespace TGCommandLine { var IRC = Interface.GetComponent(); var info = IRC.ProviderInfos()[providerIndex]; - IList channels; + List channels; switch (parameters[1].ToLower()) { @@ -158,7 +158,7 @@ namespace TGCommandLine { var IRC = Interface.GetComponent(); var info = IRC.ProviderInfos()[providerIndex]; - IList channels; + List channels; switch (parameters[1].ToLower()) { diff --git a/TGServerService/ServerInstance/Chat.cs b/TGServerService/ServerInstance/Chat.cs index f81c97c036..ede8605480 100644 --- a/TGServerService/ServerInstance/Chat.cs +++ b/TGServerService/ServerInstance/Chat.cs @@ -1,4 +1,5 @@ using System; +using System.Linq; using System.Collections.Generic; using System.Web.Script.Serialization; using TGServerService.ChatCommands; @@ -174,6 +175,11 @@ namespace TGServerService /// public string SetProviderInfo(ChatSetupInfo info) { + info.AdminList.RemoveAll(x => String.IsNullOrWhiteSpace(x)); + info.AdminChannels.RemoveAll(x => String.IsNullOrWhiteSpace(x)); + info.GameChannels.RemoveAll(x => String.IsNullOrWhiteSpace(x)); + info.DevChannels.RemoveAll(x => String.IsNullOrWhiteSpace(x)); + info.WatchdogChannels.RemoveAll(x => String.IsNullOrWhiteSpace(x)); try { lock (ChatLock) diff --git a/TGServiceInterface/ChatSetupInfo.cs b/TGServiceInterface/ChatSetupInfo.cs index 20e522cba4..1f2d0d1967 100644 --- a/TGServiceInterface/ChatSetupInfo.cs +++ b/TGServiceInterface/ChatSetupInfo.cs @@ -103,7 +103,7 @@ namespace TGServiceInterface /// /// Sanitizes a list of /// - /// An of strings + /// A of strings void SanitizeChannelNames(IList channelnames) { for (var I = 0; I < channelnames.Count; ++I) @@ -129,9 +129,9 @@ namespace TGServiceInterface /// /// The list of admin entries /// - public IList AdminList + public List AdminList { - get { return new JavaScriptSerializer().Deserialize>(DataFields[AdminListIndex]); } + get { return new JavaScriptSerializer().Deserialize>(DataFields[AdminListIndex]); } set { DataFields[AdminListIndex] = new JavaScriptSerializer().Serialize(value); } } /// @@ -145,9 +145,9 @@ namespace TGServiceInterface /// /// The channels from which admin commands/messages can be sent/received /// - public IList AdminChannels + public List AdminChannels { - get { return new JavaScriptSerializer().Deserialize>(DataFields[AdminChannelIndex]); } + get { return new JavaScriptSerializer().Deserialize>(DataFields[AdminChannelIndex]); } set { SanitizeChannelNames(value); @@ -157,9 +157,9 @@ namespace TGServiceInterface /// /// The channels to which repo and compile messages are sent /// - public IList DevChannels + public List DevChannels { - get { return new JavaScriptSerializer().Deserialize>(DataFields[DevChannelIndex]); } + get { return new JavaScriptSerializer().Deserialize>(DataFields[DevChannelIndex]); } set { SanitizeChannelNames(value); @@ -169,9 +169,9 @@ namespace TGServiceInterface /// /// The channels to which watchdog messages are sent /// - public IList WatchdogChannels + public List WatchdogChannels { - get { return new JavaScriptSerializer().Deserialize>(DataFields[WDChannelIndex]); } + get { return new JavaScriptSerializer().Deserialize>(DataFields[WDChannelIndex]); } set { SanitizeChannelNames(value); @@ -181,9 +181,9 @@ namespace TGServiceInterface /// /// The channels to which game messages are sent /// - public IList GameChannels + public List GameChannels { - get { return new JavaScriptSerializer().Deserialize>(DataFields[GameChannelIndex]); } + get { return new JavaScriptSerializer().Deserialize>(DataFields[GameChannelIndex]); } set { SanitizeChannelNames(value); diff --git a/TGStationServer3.sln b/TGStationServer3.sln index 3a0b2804a8..19f07e4862 100644 --- a/TGStationServer3.sln +++ b/TGStationServer3.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 15 -VisualStudioVersion = 15.0.26730.16 +VisualStudioVersion = 15.0.27004.2006 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TGServerService", "TGServerService\TGServerService.csproj", "{F32EDA25-0855-411C-AF5E-F0D042917E2D}" EndProject @@ -74,15 +74,16 @@ EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tools", "Tools", "{081BB0BB-2E84-47D4-9419-A2AB8E814ABF}" ProjectSection(SolutionItems) = preProject Tools\build_byond.sh = Tools\build_byond.sh + Tools\BuildDox.ps1 = Tools\BuildDox.ps1 Tools\Config.dm = Tools\Config.dm Tools\CoverageExclusions.runsettings = Tools\CoverageExclusions.runsettings Tools\DMAPITravisTester.dme = Tools\DMAPITravisTester.dme Tools\Doxyfile = Tools\Doxyfile Tools\install_byond.sh = Tools\install_byond.sh + Tools\PostCIBuild.ps1 = Tools\PostCIBuild.ps1 Tools\SignBasics.ps1 = Tools\SignBasics.ps1 Tools\SignMSI.ps1 = Tools\SignMSI.ps1 Tools\Test.dm = Tools\Test.dm - Tools\TGS3Build.ps1 = Tools\TGS3Build.ps1 Tools\tgstation13.org.pfx = Tools\tgstation13.org.pfx Tools\UploadCoverage.ps1 = Tools\UploadCoverage.ps1 EndProjectSection diff --git a/Tools/BuildDox.ps1 b/Tools/BuildDox.ps1 new file mode 100644 index 0000000000..23138d8912 --- /dev/null +++ b/Tools/BuildDox.ps1 @@ -0,0 +1,36 @@ +$bf = $Env:APPVEYOR_BUILD_FOLDER + +$doxdir = "C:\tgsdox" + +New-Item -Path $doxdir -ItemType directory + +$publish_dox = (-not (Test-Path Env:APPVEYOR_PULL_REQUEST_NUMBER)) -and ("$Env:APPVEYOR_REPO_BRANCH" -eq "master") + +if($publish_dox){ + $github_url = "github.com/$Env:APPVEYOR_REPO_NAME" + echo "Cloning https://git@$github_url..." + git clone -b gh-pages --single-branch "https://git@$github_url" "$doxdir" 2>$null + rm -r "$doxdir\*" + Add-Content "$bf\Tools\Doxyfile" "`nPROJECT_NUMBER = $version`nINPUT = $bf`nOUTPUT_DIRECTORY = $doxdir`nPROJECT_LOGO = $bf/tgs.ico`nHAVE_DOT=YES" +}else{ + Add-Content "$bf\Tools\Doxyfile" "`nPROJECT_NUMBER = $version`nINPUT = $bf`nOUTPUT_DIRECTORY = $doxdir`nPROJECT_LOGO = $bf/tgs.ico" +} + +doxygen.exe "$bf\Tools\Doxyfile" + +if($publish_dox){ + cd $doxdir + git config --global push.default simple + git config user.name "Appveyor CI" + git config user.email "ci@appveyor.com" + echo '# THIS BRANCH IS AUTO GENERATED BY APPVEYOR CI. SEE Tools/TGS3Build.ps1 ON MASTER' > README.md + + # Need to create a .nojekyll file to allow filenames starting with an underscore + # to be seen on the gh-pages site. Therefore creating an empty .nojekyll file. + echo "" > .nojekyll + git add --all + git commit -m "Deploy code docs to GitHub Pages for Appveyor build $Env:APPVEYOR_BUILD_NUMBER" -m "Commit: $Env:APPVEYOR_REPO_COMMIT" + git push -f "https://$Env:repo_token@$github_url" 2>&1 | out-null + $Env:repo_token = "" + cd "$bf" +} diff --git a/Tools/TGS3Build.ps1 b/Tools/PostCIBuild.ps1 similarity index 52% rename from Tools/TGS3Build.ps1 rename to Tools/PostCIBuild.ps1 index ee63b551b2..2ac7d36457 100644 --- a/Tools/TGS3Build.ps1 +++ b/Tools/PostCIBuild.ps1 @@ -18,41 +18,6 @@ if (Test-Path env:snk_passphrase) $src = "$bf\TGInstallerWrapper\bin\Release" $version = [System.Diagnostics.FileVersionInfo]::GetVersionInfo("$src\TG Station Server Installer.exe").FileVersion -$doxdir = "C:\tgsdox" - -New-Item -Path $doxdir -ItemType directory - -$publish_dox = (-not (Test-Path Env:APPVEYOR_PULL_REQUEST_NUMBER)) -and ("$Env:APPVEYOR_REPO_BRANCH" -eq "master") -$github_url = "github.com/$Env:APPVEYOR_REPO_NAME" - -if($publish_dox){ - echo "Cloning https://git@$github_url..." - git clone -b gh-pages --single-branch "https://git@$github_url" "$doxdir" 2>$null - rm -r "$doxdir\*" - Add-Content "$bf\Tools\Doxyfile" "`nPROJECT_NUMBER = $version`nINPUT = $bf`nOUTPUT_DIRECTORY = $doxdir`nPROJECT_LOGO = $bf/tgs.ico`nHAVE_DOT=YES" -}else{ - Add-Content "$bf\Tools\Doxyfile" "`nPROJECT_NUMBER = $version`nINPUT = $bf`nOUTPUT_DIRECTORY = $doxdir`nPROJECT_LOGO = $bf/tgs.ico" -} - -doxygen.exe "$bf\Tools\Doxyfile" - -if($publish_dox){ - cd $doxdir - git config --global push.default simple - git config user.name "Appveyor CI" - git config user.email "ci@appveyor.com" - echo '# THIS BRANCH IS AUTO GENERATED BY APPVEYOR CI. SEE Tools/TGS3Build.ps1 ON MASTER' > README.md - - # Need to create a .nojekyll file to allow filenames starting with an underscore - # to be seen on the gh-pages site. Therefore creating an empty .nojekyll file. - echo "" > .nojekyll - git add --all - git commit -m "Deploy code docs to GitHub Pages for Appveyor build $Env:APPVEYOR_BUILD_NUMBER" -m "Commit: $Env:APPVEYOR_REPO_COMMIT" - git push -f "https://$Env:repo_token@$github_url" 2>&1 | out-null - $Env:repo_token = "" - cd "$bf" -} - $destination = "$bf\TGS3-Server-v$version.exe" Move-Item -Path "$src\TG Station Server Installer.exe" -Destination "$destination" diff --git a/appveyor.yml b/appveyor.yml index 2458efe369..724d59cbe9 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -32,14 +32,16 @@ build: verbosity: minimal publish_nuget: true after_build: - - ps: .\Tools\TGS3Build.ps1 + - ps: Tools/PostCIBuild.ps1 - ps: if($env:APPVEYOR_REPO_COMMIT_MESSAGE -match "\[TGSDeploy\]"){$env:TGSDeploy = "Do it."} - ps: $env:TGSVersion = [System.Diagnostics.FileVersionInfo]::GetVersionInfo("$env:APPVEYOR_BUILD_FOLDER/TGServerService/bin/Release/TGServerService.exe").FileVersion test_script: - set path=%ProgramFiles(x86)%\Microsoft Visual Studio\2017\TestAgent\Common7\IDE\CommonExtensions\Microsoft\TestWindow;%path% - copy "%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\Common7\IDE\CommonExtensions\Microsoft\TestWindow\Extensions\appveyor.*" "%ProgramFiles(x86)%\Microsoft Visual Studio\2017\TestAgent\Common7\IDE\CommonExtensions\Microsoft\TestWindow\Extensions" /y - vstest.console /logger:Appveyor "TGServiceTests\bin\Release\TGServiceTests.dll" /Enablecodecoverage /Settings:"Tools/CoverageExclusions.runsettings" /inIsolation /Platform:x64 - - powershell -Command "Tools/UploadCoverage.ps1" +after_test: + - ps: Tools/UploadCoverage.ps1 + - ps: Tools/BuildDox.ps1 deploy: - provider: GitHub release: "tgstation-server-v$(TGSVersion)"