diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml
index b434448..1fd44aa 100644
--- a/.github/workflows/dotnet.yml
+++ b/.github/workflows/dotnet.yml
@@ -12,17 +12,25 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v2
- - name: Setup .NET
- uses: actions/setup-dotnet@v3
+ - uses: actions/checkout@v4
+ - name: Setup .NET 10
+ uses: actions/setup-dotnet@v4
with:
- dotnet-version: 8.0.x
+ dotnet-version: '10.0.0'
+ continue-on-error: true
+ - name: Fallback - Install .NET 10 manually
+ if: failure()
+ run: |
+ wget https://dot.net/v1/dotnet-install.sh -O dotnet-install.sh
+ chmod +x dotnet-install.sh
+ ./dotnet-install.sh --channel 10.0 --install-dir $HOME/.dotnet
+ echo "$HOME/.dotnet" >> $GITHUB_PATH
- name: Check Tag
id: check-tag
run: |
if [[ v${{ github.event.ref }} =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
- echo ::set-output name=match::true
+ echo "match=true" >> $GITHUB_OUTPUT
fi
- name: Run Unit Tests
@@ -39,23 +47,13 @@ jobs:
dotnet build -c Release
dotnet pack -c Release -o /tmp/nupkgs -v m -p:IncludeSymbols=true -p:SymbolPackageFormat=snupkg
dotnet nuget push /tmp/nupkgs/NosCore.Networking.${{github.event.ref}}.nupkg -s https://api.nuget.org/v3/index.json -k ${{secrets.NUGET_API_KEY}}
- echo ::set-output name=ARTIFACT_PATH::/tmp/nupkgs/NosCore.Networking.${{github.event.ref}}.nupkg
- echo ::set-output name=ARTIFACT_NAME::NosCore.Networking.${{github.event.ref}}.nupkg
-
- - name: Gets Latest Release
- if: steps.check-tag.outputs.match == 'true'
- id: latest_release_info
- uses: jossef/action-latest-release-info@v1.1.0
- env:
- GITHUB_TOKEN: ${{ github.token }}
+ echo "ARTIFACT_PATH=/tmp/nupkgs/NosCore.Networking.${{github.event.ref}}.nupkg" >> $GITHUB_OUTPUT
+ echo "ARTIFACT_NAME=NosCore.Networking.${{github.event.ref}}.nupkg" >> $GITHUB_OUTPUT
- name: Upload Release Asset
if: steps.check-tag.outputs.match == 'true'
- uses: actions/upload-release-asset@v1
- env:
- GITHUB_TOKEN: ${{ github.token }}
+ uses: softprops/action-gh-release@v2
with:
- upload_url: ${{ steps.latest_release_info.outputs.upload_url }}
- asset_path: ${{ steps.build_artifact.outputs.ARTIFACT_PATH }}
- asset_name: ${{ steps.build_artifact.outputs.ARTIFACT_NAME }}
- asset_content_type: application/zip
+ files: ${{ steps.build_artifact.outputs.ARTIFACT_PATH }}
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
diff --git a/src/NosCore.Networking/BroadcastableExtension.cs b/src/NosCore.Networking/BroadcastableExtension.cs
index 59767bd..dd186c7 100644
--- a/src/NosCore.Networking/BroadcastableExtension.cs
+++ b/src/NosCore.Networking/BroadcastableExtension.cs
@@ -13,19 +13,41 @@
namespace NosCore.Networking
{
+ ///
+ /// Provides extension methods for broadcasting packets to instances.
+ ///
public static class IBroadcastableExtension
{
+ ///
+ /// Sends a single packet to all sessions in the broadcastable group.
+ ///
+ /// The broadcastable group to send the packet to.
+ /// The packet to send.
+ /// A task representing the asynchronous send operation.
public static Task SendPacketAsync(this IBroadcastable channelGroup, IPacket packet)
{
return channelGroup.SendPacketsAsync(new[] { packet });
}
+ ///
+ /// Sends a single packet to matching sessions in the broadcastable group.
+ ///
+ /// The broadcastable group to send the packet to.
+ /// The packet to send.
+ /// The channel matcher to filter recipients.
+ /// A task representing the asynchronous send operation.
public static Task SendPacketAsync(this IBroadcastable channelGroup, IPacket packet, IChannelMatcher matcher)
{
return channelGroup.SendPacketsAsync(new[] { packet }, matcher);
}
-
+ ///
+ /// Sends multiple packets to matching sessions in the broadcastable group.
+ ///
+ /// The broadcastable group to send the packets to.
+ /// The collection of packets to send.
+ /// The optional channel matcher to filter recipients.
+ /// A task representing the asynchronous send operation.
public static async Task SendPacketsAsync(this IBroadcastable channelGroup, IEnumerable packets,
IChannelMatcher? matcher)
{
@@ -51,6 +73,12 @@ public static async Task SendPacketsAsync(this IBroadcastable channelGroup, IEnu
}
+ ///
+ /// Sends multiple packets to all sessions in the broadcastable group.
+ ///
+ /// The broadcastable group to send the packets to.
+ /// The collection of packets to send.
+ /// A task representing the asynchronous send operation.
public static Task SendPacketsAsync(this IBroadcastable channelGroup, IEnumerable packets)
{
return channelGroup.SendPacketsAsync(packets, null);
diff --git a/src/NosCore.Networking/Encoding/Filter/RequestFilter.cs b/src/NosCore.Networking/Encoding/Filter/RequestFilter.cs
index 7037ab2..d4d13ad 100644
--- a/src/NosCore.Networking/Encoding/Filter/RequestFilter.cs
+++ b/src/NosCore.Networking/Encoding/Filter/RequestFilter.cs
@@ -12,10 +12,25 @@
namespace NosCore.Networking.Encoding.Filter
{
+ ///
+ /// Abstract base class for request filters that process incoming byte data.
+ ///
public abstract class RequestFilter : MessageToMessageDecoder
{
+ ///
+ /// Filters incoming request data.
+ ///
+ /// The channel handler context.
+ /// The incoming message bytes.
+ /// The filtered byte array, or null if the request should be blocked.
public abstract byte[]? Filter(IChannelHandlerContext context, Span message);
+ ///
+ /// Decodes the incoming byte buffer through the filter.
+ ///
+ /// The channel handler context.
+ /// The byte buffer to decode.
+ /// The output list to add filtered results to.
protected override void Decode(IChannelHandlerContext context, IByteBuffer message, List