Skip to content

Commit

Permalink
Generate XML docs, disable IPv6 by default
Browse files Browse the repository at this point in the history
  • Loading branch information
sgkoishi committed Feb 24, 2024
1 parent 221da80 commit 46dcad5
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 16 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ jobs:
with:
dotnet-version: '6.0.100'

- name: Build
- name: Build and NuGet
run: |
dotnet build
dotnet nuget push **/bin/Debug/*.nupkg -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json
New-Item -ItemType Directory Artifact
Copy-Item **/bin/Debug/net6.0/* Artifact
Copy-Item LICENSE,README.md Artifact
Expand All @@ -36,12 +37,13 @@ jobs:
path: |
Artifact
- name: Set env output and package
- name: Prepare Release
id: setenvo
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
run: |
dotnet nuget push **/bin/Debug/*.nupkg -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json
echo "TAG_NAME=$(git rev-list --count HEAD)" >> $env:GITHUB_OUTPUT
dotnet build /p:GenerateDocumentationFile=true
Copy-Item **/bin/Debug/net6.0/* Artifact
tar cvf Artifact.tar Artifact
Compress-Archive -Path Artifact Artifact.zip
Expand Down
12 changes: 6 additions & 6 deletions Core/Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ public record class EnhancementsSettings
/// <summary>
/// IPv6 Dual Stack Support
/// </summary>
public Optional<bool> IPv6DualStack = Optional.Default(true);
public Optional<bool> IPv6DualStack = Optional.Default(false);

public enum UpdateOptions
{
Expand Down Expand Up @@ -320,7 +320,7 @@ public record class SoundnessSettings
/// </para>
/// <para>
/// This will try to reset the encoding.
/// Default: -1, use Encoding.Default when Win32NT && Version <= 10
/// Default: -1, use Encoding.Default when Win32NT and Version &lt;= 10
/// </para>
/// </summary>
public Optional<int> UseDefaultEncoding = Optional.Default(Environment.OSVersion.Platform == PlatformID.Win32NT && Environment.OSVersion.Version.Major < 10 ? -1 : 0);
Expand Down Expand Up @@ -580,7 +580,7 @@ public record class MitigationSettings
/// <para>
/// The default limit:
/// Socket created: 1 second
/// <seealso cref="PacketTypes.ConnectRequest"> received: +3 seconds
/// <seealso cref="PacketTypes.ConnectRequest" /> received: +3 seconds
/// </para>
/// </summary>
public Optional<Dictionary<int, double>> ConnectionStateTimeout = Optional.Default(new Dictionary<int, double> {
Expand Down Expand Up @@ -738,15 +738,15 @@ public enum ExpertCoinHandler
{
/// <summary>
/// Disable the picked up coin value. Some coins may vanish.
/// <para>
/// </summary>
DisableValue,
/// <summary>
/// Server side coin pickup.
/// <para>
/// </summary>
ServerSide,
/// <summary>
/// Untouched like vanilla.
/// <para>
/// </summary>
AsIs,
}

Expand Down
2 changes: 2 additions & 0 deletions Core/LanguagePolyfill.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member

using System.Data;
using System.Runtime.CompilerServices;

Expand Down
6 changes: 5 additions & 1 deletion Core/Utils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,11 @@ internal static void TryRenameCommand(Command command, Dictionary<string, List<s
}
}

#pragma warning disable CS1574 // XML comment has cref attribute that could not be resolved

/// <summary>
/// Converts a list of arguments back to a command.
/// This is a rough inverse of <seealso cref="TShockAPI.Commands.ParseParameters(string)"/>.
/// This is a rough inverse of <seealso cref="TShockAPI.Commands.ParseParameters(string)" />.
/// Will not add specifier for you.
/// </summary>
public static string ToCommand(string command, List<string> args)
Expand Down Expand Up @@ -283,6 +285,8 @@ public static string ToCommand(string command, List<string> args)
return result;
}

#pragma warning restore CS1574 // XML comment has cref attribute that could not be resolved

public static IEnumerable<TSPlayer> ActivePlayers => TShockAPI.TShock.Players.Where(p => p?.Active == true);

public static IEnumerable<TShockAPI.DB.UserAccount> SearchUserAccounts(string? pat)
Expand Down
10 changes: 4 additions & 6 deletions SourceGen/Commands.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

namespace Chireiden.TShock.SourceGen;

#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member

[Generator(LanguageNames.CSharp)]
public class CommandsGenerator : IIncrementalGenerator
{
Expand Down Expand Up @@ -353,11 +355,7 @@ public RelatedPermissionAttribute(string key, string permission)
}
}

public class DiagnosticException : Exception
public class DiagnosticException(Diagnostic diagnostic) : Exception
{
public Diagnostic Diagnostic;
public DiagnosticException(Diagnostic diagnostic)
{
this.Diagnostic = diagnostic;
}
public Diagnostic Diagnostic = diagnostic;
}

0 comments on commit 46dcad5

Please sign in to comment.