From 7ac4c8c0efc6c2a1ccf09ae2f256698714e08b6e Mon Sep 17 00:00:00 2001 From: Timothy Schenk Date: Wed, 7 Feb 2024 16:40:36 +0100 Subject: [PATCH] chore: file header adjustment --- .editorconfig | 5 +- .gitea/workflows/docs.yaml | 174 +++++++++--------- .pre-commit-config.yaml | 7 +- Benchmarks/Argon2Benchmarks.cs | 20 +- Benchmarks/Benchmarks.csproj | 8 +- Benchmarks/BinaryConversionBenchmarks.cs | 2 +- Benchmarks/DataCacheBenchmark.cs | 2 +- Benchmarks/GenericConfig.cs | 2 +- Benchmarks/Program.cs | 2 +- Continuity.AuthServer/AuthSession.cs | 4 +- Continuity.AuthServer/ChannelSession.cs | 2 +- .../Consumers/PacketConsumer.cs | 5 +- .../Continuity.AuthServer.csproj | 42 ++--- Continuity.AuthServer/DB/Documents/Account.cs | 2 +- .../DB/Documents/Character.cs | 2 +- Continuity.AuthServer/DB/Documents/Guild.cs | 2 +- .../DB/Documents/GuildMember.cs | 2 +- .../DB/Documents/GuildRank.cs | 2 +- .../DB/Documents/InventoryItem.cs | 2 +- .../DB/Documents/InventoryTab.cs | 2 +- .../DB/Migrations/20230814114414_Initial.cs | 2 +- .../20230817230423_CharacterDataDraft.cs | 2 +- .../20231108143729_AddInventoryToCharacter.cs | 2 +- .../20231113192405_AdditionalCharacterData.cs | 2 +- .../Migrations/20231114203409_AddGuildData.cs | 2 +- .../20231115174714_GuildIsNotRequired.cs | 2 +- .../20231115183824_SwitchToDataAnnotations.cs | 2 +- ...16110504_DBPoolingAndLazyLoadingSupport.cs | 2 +- .../20231120162002_FixInventoryItemAsDbset.cs | 2 +- ...05726_MissingCascadeDeletionOnCharacter.cs | 2 +- ...4508_IndexingAndVariousOtherAnnotations.cs | 2 +- ...0231122091030_VariousDeletionBehaviours.cs | 2 +- .../20231125112400_FixEntityRelationships.cs | 2 +- Continuity.AuthServer/DB/WonderkingContext.cs | 2 +- .../LoginHandlerLoggerMessages.cs | 2 +- .../LoggerMessages/PacketLoggerMessages.cs | 2 +- .../ChannelSelectionHandler.Projections.cs | 2 +- .../PacketHandlers/ChannelSelectionHandler.cs | 9 +- .../CharacterCreationHandler.cs | 8 +- .../CharacterDeletionHandler.cs | 7 +- .../CharacterMappingItemEntry.cs | 2 +- .../CharacterNameCheckHandler.cs | 4 +- .../PacketHandlers/LoginHandler.cs | 11 +- Continuity.AuthServer/Packets/RawPacket.cs | 2 +- Continuity.AuthServer/Program.cs | 2 +- .../Services/ItemObjectPoolService.cs | 2 +- .../Services/WonderkingAuthServer.cs | 2 +- Rai.PacketMediator/IBidirectionalPacket.cs | 2 +- Rai.PacketMediator/IIncomingPacket.cs | 2 +- Rai.PacketMediator/IOutgoingPacket.cs | 2 +- Rai.PacketMediator/IPacket.cs | 2 +- Rai.PacketMediator/IPacketHandler.cs | 13 +- Rai.PacketMediator/PacketDistributor.cs | 10 +- .../PacketDistributorService.cs | 17 +- Rai.PacketMediator/PacketIdAttribute.cs | 2 +- Rai.PacketMediator/Rai.PacketMediator.csproj | 40 ++-- Wonderking/Game/Data/Character/Gender.cs | 2 +- Wonderking/Game/Data/Character/PvPLevel.cs | 2 +- Wonderking/Game/Data/Item/ContainedItem.cs | 2 +- Wonderking/Game/Data/Item/CraftMaterial.cs | 2 +- Wonderking/Game/Data/Item/ElementalStats.cs | 2 +- Wonderking/Game/Data/Item/ItemOptions.cs | 2 +- Wonderking/Game/Data/Item/Stats.cs | 2 +- Wonderking/Game/Data/ItemObject.cs | 2 +- Wonderking/Game/DataReader.cs | 2 +- Wonderking/Game/GameDataMetadataAttribute.cs | 2 +- .../CharacterStatsMappingConfiguration.cs | 2 +- .../Game/Mapping/DefaultCharacterMapping.cs | 2 +- Wonderking/Game/Mapping/DynamicStats.cs | 2 +- Wonderking/Game/Mapping/Item.cs | 2 +- Wonderking/Game/Mapping/JobSpecificMapping.cs | 2 +- Wonderking/Game/Reader/BinaryReader.cs | 2 +- .../Game/Reader/GenericReaderExtensions.cs | 2 +- Wonderking/Game/Reader/ItemReader.cs | 2 +- .../Game/Reader/ItemReaderExtensions.cs | 2 +- .../Incoming/ChannelSelectionPacket.cs | 2 +- .../Incoming/CharacterCreationPacket.cs | 2 +- .../Packets/Incoming/CharacterDeletePacket.cs | 2 +- .../Incoming/CharacterNameCheckPacket.cs | 2 +- .../Packets/Incoming/LoginInfoPacket.cs | 2 +- Wonderking/Packets/OperationCode.cs | 2 +- .../ChannelSelectionResponsePacket.cs | 2 +- .../CharacterCreationResponsePacket.cs | 2 +- .../Outgoing/CharacterDeleteResponsePacket.cs | 2 +- .../CharacterNameCheckPacketResponse.cs | 3 +- .../CharacterSelectionSetGuildNamePacket.cs | 3 +- Wonderking/Packets/Outgoing/Data/BaseStats.cs | 2 +- .../Packets/Outgoing/Data/CharacterData.cs | 2 +- Wonderking/Packets/Outgoing/Data/JobData.cs | 2 +- .../Outgoing/Data/LoginResponseReason.cs | 2 +- .../Outgoing/Data/ServerChannelData.cs | 2 +- .../Packets/Outgoing/LoginResponsePacket.cs | 3 +- .../Packets/WonderkingPacketIdAttribute.cs | 2 +- Wonderking/Utils/ByteArrayConverter.cs | 2 +- Wonderking/Wonderking.csproj | 4 +- 95 files changed, 281 insertions(+), 264 deletions(-) diff --git a/.editorconfig b/.editorconfig index 225913b..ffe4358 100644 --- a/.editorconfig +++ b/.editorconfig @@ -23,10 +23,13 @@ indent_style = space charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true +file_header_template = Licensed to Timothy Schenk under the GNU AGPL Version 3 License. + +[*.(yaml|yml)] +indent_size = 2 [*.cs] dotnet_diagnostic.MA0004.severity = none -file_header_template = Copyright (c) 2023 Timothy Schenk. Subject to the GNU AGPL Version 3 License. indent_size = 4 dotnet_sort_system_directives_first = true dotnet_diagnostic.MA0007.severity = none diff --git a/.gitea/workflows/docs.yaml b/.gitea/workflows/docs.yaml index bfaa0f7..84734ce 100644 --- a/.gitea/workflows/docs.yaml +++ b/.gitea/workflows/docs.yaml @@ -6,8 +6,8 @@ on: - develop - master paths: - - Wiki/** - - Wiki.Dockerfile + - Wiki/** + - Wiki.Dockerfile env: # Name of module and id separated by a slash @@ -25,103 +25,103 @@ jobs: outputs: sanitized_branch_name: ${{ steps.sanitize.outputs.sanitized_branch_name }} steps: - - name: Sanitize branch name - id: sanitize - run: echo "::set-output name=sanitized_branch_name::$(echo ${{ github.ref_name }} | sed 's/\//-/g')" + - name: Sanitize branch name + id: sanitize + run: echo "::set-output name=sanitized_branch_name::$(echo ${{ github.ref_name }} | sed 's/\//-/g')" docs: runs-on: ubuntu-latest container: registry.jetbrains.team/p/writerside/builder/writerside-builder:${{env.DOCKER_VERSION}} steps: - - name: Install basic dependencies - run: | - wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.5/install.sh | bash - echo "::add-path::$HOME/.nvm" - export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")" - [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" - nvm install 18 - nvm use 18 - echo "::add-path::$(dirname $(which npm))" - nvm --version - - name: Check Node.js version - run: | - node -v - npm -v - - name: Checkout repository - uses: https://github.com/actions/checkout@v3 - - name: Build docs - run: | - set -e - export DISPLAY=:99 - Xvfb :99 & - /opt/builder/bin/idea.sh helpbuilderinspect -source-dir . -product ${{env.INSTANCE}} -output-dir artifacts/ || true - echo "Test existing of ${{ env.ARTIFACT }} artifact" - test -e artifacts/${{ env.ARTIFACT }} - - name: rename artifact - run: | - mv artifacts/${{ env.ARTIFACT }} artifacts/wiki.zip - - name: Upload documentation - uses: actions/upload-artifact@v3 - with: - name: wiki.zip - path: artifacts/wiki.zip - retention-days: 14 - - name: Upload algolia-indexes - uses: actions/upload-artifact@v4 - with: - name: algolia-indexes.zip - path: artifacts/${{ env.ALGOLIA_ARTIFACT }} - retention-days: 14 + - name: Install basic dependencies + run: | + wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.5/install.sh | bash + echo "::add-path::$HOME/.nvm" + export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")" + [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" + nvm install 18 + nvm use 18 + echo "::add-path::$(dirname $(which npm))" + nvm --version + - name: Check Node.js version + run: | + node -v + npm -v + - name: Checkout repository + uses: https://github.com/actions/checkout@v3 + - name: Build docs + run: | + set -e + export DISPLAY=:99 + Xvfb :99 & + /opt/builder/bin/idea.sh helpbuilderinspect -source-dir . -product ${{env.INSTANCE}} -output-dir artifacts/ || true + echo "Test existing of ${{ env.ARTIFACT }} artifact" + test -e artifacts/${{ env.ARTIFACT }} + - name: rename artifact + run: | + mv artifacts/${{ env.ARTIFACT }} artifacts/wiki.zip + - name: Upload documentation + uses: actions/upload-artifact@v3 + with: + name: wiki.zip + path: artifacts/wiki.zip + retention-days: 14 + - name: Upload algolia-indexes + uses: actions/upload-artifact@v4 + with: + name: algolia-indexes.zip + path: artifacts/${{ env.ALGOLIA_ARTIFACT }} + retention-days: 14 build-docs-container: runs-on: ubuntu-latest container: catthehacker/ubuntu:act-latest@sha256:5f2ff408985b10de9da4a8ea735b7f07d4f98c61608180ebb8964deb37f7580a - needs: [docs, preprocess] + needs: [ docs, preprocess ] steps: - - name: Checkout repository - uses: https://github.com/actions/checkout@v3 - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - name: Login to Docker Hub - uses: docker/login-action@v3 - with: - registry: ${{ github.server_url }} - username: ${{ github.actor }} - password: ${{ secrets.REGISTRY_TOKEN }} - - name: Retrieve docs artifact - uses: actions/download-artifact@v4 - with: - name: wiki.zip - path: ${{ github.workspace }} - - name: Unzip wiki.zip into .public - run: | - mkdir .public - unzip -jo -qq ./wiki.zip/wiki.zip -d .public - - name: Build and push - uses: docker/build-push-action@v5 - with: - context: . - file: Wiki.Dockerfile - push: true - tags: forge.rainote.dev/${{ github.repository }}:${{ needs.preprocess.outputs.sanitized_branch_name }}-wiki - platforms: linux/amd64,linux/arm64 - - name: Build and push to latest - if: github.ref_name == 'master' - uses: docker/build-push-action@v5 - with: - context: . - file: Wiki.Dockerfile - push: true - tags: forge.rainote.dev/${{ github.repository }}:latest-wiki - platforms: linux/amd64, linux/arm64 + - name: Checkout repository + uses: https://github.com/actions/checkout@v3 + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + registry: ${{ github.server_url }} + username: ${{ github.actor }} + password: ${{ secrets.REGISTRY_TOKEN }} + - name: Retrieve docs artifact + uses: actions/download-artifact@v4 + with: + name: wiki.zip + path: ${{ github.workspace }} + - name: Unzip wiki.zip into .public + run: | + mkdir .public + unzip -jo -qq ./wiki.zip/wiki.zip -d .public + - name: Build and push + uses: docker/build-push-action@v5 + with: + context: . + file: Wiki.Dockerfile + push: true + tags: forge.rainote.dev/${{ github.repository }}:${{ needs.preprocess.outputs.sanitized_branch_name }}-wiki + platforms: linux/amd64,linux/arm64 + - name: Build and push to latest + if: github.ref_name == 'master' + uses: docker/build-push-action@v5 + with: + context: . + file: Wiki.Dockerfile + push: true + tags: forge.rainote.dev/${{ github.repository }}:latest-wiki + platforms: linux/amd64, linux/arm64 deploy-wiki: runs-on: ubuntu-latest container: catthehacker/ubuntu:act-latest@sha256:5f2ff408985b10de9da4a8ea735b7f07d4f98c61608180ebb8964deb37f7580a - needs: [build-docs-container, docs, preprocess] + needs: [ build-docs-container, docs, preprocess ] steps: - - name: Deploy Image to CapRrover - run: | - docker run caprover/cli-caprover:2.2.3 caprover deploy --caproverUrl ${{ secrets.CAPROVER_SERVER }} --appToken ${{ secrets.WIKI_APP_TOKEN }} --imageName forge.rainote.dev/${{ github.repository }}:${{ needs.preprocess.outputs.sanitized_branch_name }}-wiki -a ${{ secrets.WIKI_APP_NAME }} + - name: Deploy Image to CapRrover + run: | + docker run caprover/cli-caprover:2.2.3 caprover deploy --caproverUrl ${{ secrets.CAPROVER_SERVER }} --appToken ${{ secrets.WIKI_APP_TOKEN }} --imageName forge.rainote.dev/${{ github.repository }}:${{ needs.preprocess.outputs.sanitized_branch_name }}-wiki -a ${{ secrets.WIKI_APP_NAME }} diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3333cad..17b97b4 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,7 +1,7 @@ repos: - repo: local hooks: - #Use dotnet format already installed on your machine + #Use dotnet format already installed on your machine - id: dotnet-format name: dotnet-format language: system @@ -17,3 +17,8 @@ repos: hooks: - id: hadolint-docker args: [--ignore, SC2086] +- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks + rev: v2.12.0 + hooks: + - id: pretty-format-yaml + args: [--autofix, --indent, '2'] diff --git a/Benchmarks/Argon2Benchmarks.cs b/Benchmarks/Argon2Benchmarks.cs index 4beb4cd..cd08d21 100644 --- a/Benchmarks/Argon2Benchmarks.cs +++ b/Benchmarks/Argon2Benchmarks.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Timothy Schenk. Subject to the GNU AGPL Version 3 License. +// Licensed to Timothy Schenk under the GNU AGPL Version 3 License. using System.Security.Cryptography; using BenchmarkDotNet.Attributes; @@ -13,14 +13,14 @@ namespace Benchmarks; [Config(typeof(GenericConfig))] public class Argon2Benchmarks { + private byte[] _additionalData = null!; [Params(2, 4)] public int _iterations; + [Params(16)] public int _length; [Params(16, 32)] public int _memory; [Params(1, 2)] public int _parallelism; - private byte[] _salt = null!; - private byte[] _additionalData = null!; - [Params(16)] public int _length; private byte[] _password = null!; + private byte[] _salt = null!; [GlobalSetup] public void Setup() @@ -39,7 +39,7 @@ public class Argon2Benchmarks MemorySize = 1024 * _memory, DegreeOfParallelism = _parallelism, AssociatedData = _additionalData, - Salt = _salt, + Salt = _salt }.GetBytes(_length); } @@ -52,7 +52,7 @@ public class Argon2Benchmarks MemorySize = 1024 * _memory, DegreeOfParallelism = _parallelism, AssociatedData = _additionalData, - Salt = _salt, + Salt = _salt }.GetBytes(_length); } @@ -65,7 +65,7 @@ public class Argon2Benchmarks MemorySize = 1024 * _memory, DegreeOfParallelism = _parallelism, AssociatedData = _additionalData, - Salt = _salt, + Salt = _salt }.GetBytes(_length); } @@ -82,7 +82,7 @@ public class Argon2Benchmarks HashLength = _length, Salt = _salt, AssociatedData = _additionalData, - Password = _password, + Password = _password }; var argon2 = new Argon2(config); return argon2.Hash().Buffer; @@ -101,7 +101,7 @@ public class Argon2Benchmarks HashLength = _length, Salt = _salt, AssociatedData = _additionalData, - Password = _password, + Password = _password }; var argon2 = new Argon2(config); return argon2.Hash().Buffer; @@ -120,7 +120,7 @@ public class Argon2Benchmarks HashLength = _length, Salt = _salt, AssociatedData = _additionalData, - Password = _password, + Password = _password }; var argon2 = new Argon2(config); return argon2.Hash().Buffer; diff --git a/Benchmarks/Benchmarks.csproj b/Benchmarks/Benchmarks.csproj index a326f39..bc7734b 100644 --- a/Benchmarks/Benchmarks.csproj +++ b/Benchmarks/Benchmarks.csproj @@ -13,10 +13,10 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - - - - + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Benchmarks/BinaryConversionBenchmarks.cs b/Benchmarks/BinaryConversionBenchmarks.cs index 04c89b4..f75da02 100644 --- a/Benchmarks/BinaryConversionBenchmarks.cs +++ b/Benchmarks/BinaryConversionBenchmarks.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Timothy Schenk. Subject to the GNU AGPL Version 3 License. +// Licensed to Timothy Schenk under the GNU AGPL Version 3 License. using System.Buffers.Binary; using System.Security.Cryptography; diff --git a/Benchmarks/DataCacheBenchmark.cs b/Benchmarks/DataCacheBenchmark.cs index da81a55..5765fbe 100644 --- a/Benchmarks/DataCacheBenchmark.cs +++ b/Benchmarks/DataCacheBenchmark.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Timothy Schenk. Subject to the GNU AGPL Version 3 License. +// Licensed to Timothy Schenk under the GNU AGPL Version 3 License. using System.Collections.Concurrent; using System.Collections.Immutable; diff --git a/Benchmarks/GenericConfig.cs b/Benchmarks/GenericConfig.cs index 03a3b80..cae3108 100644 --- a/Benchmarks/GenericConfig.cs +++ b/Benchmarks/GenericConfig.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Timothy Schenk. Subject to the GNU AGPL Version 3 License. +// Licensed to Timothy Schenk under the GNU AGPL Version 3 License. using BenchmarkDotNet.Analysers; using BenchmarkDotNet.Columns; diff --git a/Benchmarks/Program.cs b/Benchmarks/Program.cs index 23f28e9..dc367d8 100644 --- a/Benchmarks/Program.cs +++ b/Benchmarks/Program.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Timothy Schenk. Subject to the GNU AGPL Version 3 License. +// Licensed to Timothy Schenk under the GNU AGPL Version 3 License. using System.Reflection; using BenchmarkDotNet.Running; diff --git a/Continuity.AuthServer/AuthSession.cs b/Continuity.AuthServer/AuthSession.cs index 1af7f8c..447c108 100644 --- a/Continuity.AuthServer/AuthSession.cs +++ b/Continuity.AuthServer/AuthSession.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Timothy Schenk. Subject to the GNU AGPL Version 3 License. +// Licensed to Timothy Schenk under the GNU AGPL Version 3 License. using System.Net.Sockets; using Continuity.AuthServer.Packets; @@ -12,8 +12,8 @@ namespace Continuity.AuthServer; public class AuthSession : TcpSession { - private readonly ILogger _logger; private readonly PacketDistributorService _distributorService; + private readonly ILogger _logger; private readonly IMediator _mediator; public AuthSession(TcpServer diff --git a/Continuity.AuthServer/ChannelSession.cs b/Continuity.AuthServer/ChannelSession.cs index b91d6bf..77ae088 100644 --- a/Continuity.AuthServer/ChannelSession.cs +++ b/Continuity.AuthServer/ChannelSession.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Timothy Schenk. Subject to the GNU AGPL Version 3 License. +// Licensed to Timothy Schenk under the GNU AGPL Version 3 License. using System.Security.Cryptography; using System.Text; diff --git a/Continuity.AuthServer/Consumers/PacketConsumer.cs b/Continuity.AuthServer/Consumers/PacketConsumer.cs index d227262..e58f80c 100644 --- a/Continuity.AuthServer/Consumers/PacketConsumer.cs +++ b/Continuity.AuthServer/Consumers/PacketConsumer.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Timothy Schenk. Subject to the GNU AGPL Version 3 License. +// Licensed to Timothy Schenk under the GNU AGPL Version 3 License. using System.Diagnostics; using Continuity.AuthServer.Packets; @@ -12,9 +12,8 @@ namespace Continuity.AuthServer.Consumers; [UsedImplicitly] public class PacketConsumer : IConsumer, IDisposable { - private readonly PacketDistributorService _distributorService; - private readonly ActivitySource _activitySource; + private readonly PacketDistributorService _distributorService; public PacketConsumer(PacketDistributorService distributorService) { diff --git a/Continuity.AuthServer/Continuity.AuthServer.csproj b/Continuity.AuthServer/Continuity.AuthServer.csproj index cd7e4e8..08bd7a2 100644 --- a/Continuity.AuthServer/Continuity.AuthServer.csproj +++ b/Continuity.AuthServer/Continuity.AuthServer.csproj @@ -40,14 +40,14 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - + + + + + - + all runtime; build; native; contentfiles; analyzers; buildtransitive @@ -60,10 +60,10 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - - - - + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive @@ -79,23 +79,23 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - + + + + + - - - + + + diff --git a/Continuity.AuthServer/DB/Documents/Account.cs b/Continuity.AuthServer/DB/Documents/Account.cs index f3b5187..f096980 100644 --- a/Continuity.AuthServer/DB/Documents/Account.cs +++ b/Continuity.AuthServer/DB/Documents/Account.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Timothy Schenk. Subject to the GNU AGPL Version 3 License. +// Licensed to Timothy Schenk under the GNU AGPL Version 3 License. using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; diff --git a/Continuity.AuthServer/DB/Documents/Character.cs b/Continuity.AuthServer/DB/Documents/Character.cs index 5d0c80d..1bcf8c4 100644 --- a/Continuity.AuthServer/DB/Documents/Character.cs +++ b/Continuity.AuthServer/DB/Documents/Character.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Timothy Schenk. Subject to the GNU AGPL Version 3 License. +// Licensed to Timothy Schenk under the GNU AGPL Version 3 License. using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; diff --git a/Continuity.AuthServer/DB/Documents/Guild.cs b/Continuity.AuthServer/DB/Documents/Guild.cs index 8f01574..bc41011 100644 --- a/Continuity.AuthServer/DB/Documents/Guild.cs +++ b/Continuity.AuthServer/DB/Documents/Guild.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Timothy Schenk. Subject to the GNU AGPL Version 3 License. +// Licensed to Timothy Schenk under the GNU AGPL Version 3 License. using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; diff --git a/Continuity.AuthServer/DB/Documents/GuildMember.cs b/Continuity.AuthServer/DB/Documents/GuildMember.cs index 01e55c4..0fc27c9 100644 --- a/Continuity.AuthServer/DB/Documents/GuildMember.cs +++ b/Continuity.AuthServer/DB/Documents/GuildMember.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Timothy Schenk. Subject to the GNU AGPL Version 3 License. +// Licensed to Timothy Schenk under the GNU AGPL Version 3 License. using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; diff --git a/Continuity.AuthServer/DB/Documents/GuildRank.cs b/Continuity.AuthServer/DB/Documents/GuildRank.cs index 156b7f6..a600aa6 100644 --- a/Continuity.AuthServer/DB/Documents/GuildRank.cs +++ b/Continuity.AuthServer/DB/Documents/GuildRank.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Timothy Schenk. Subject to the GNU AGPL Version 3 License. +// Licensed to Timothy Schenk under the GNU AGPL Version 3 License. namespace Continuity.AuthServer.DB.Documents; diff --git a/Continuity.AuthServer/DB/Documents/InventoryItem.cs b/Continuity.AuthServer/DB/Documents/InventoryItem.cs index ec6d870..b7a8446 100644 --- a/Continuity.AuthServer/DB/Documents/InventoryItem.cs +++ b/Continuity.AuthServer/DB/Documents/InventoryItem.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Timothy Schenk. Subject to the GNU AGPL Version 3 License. +// Licensed to Timothy Schenk under the GNU AGPL Version 3 License. using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; diff --git a/Continuity.AuthServer/DB/Documents/InventoryTab.cs b/Continuity.AuthServer/DB/Documents/InventoryTab.cs index cf28d51..b73db2d 100644 --- a/Continuity.AuthServer/DB/Documents/InventoryTab.cs +++ b/Continuity.AuthServer/DB/Documents/InventoryTab.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Timothy Schenk. Subject to the GNU AGPL Version 3 License. +// Licensed to Timothy Schenk under the GNU AGPL Version 3 License. namespace Continuity.AuthServer.DB.Documents; diff --git a/Continuity.AuthServer/DB/Migrations/20230814114414_Initial.cs b/Continuity.AuthServer/DB/Migrations/20230814114414_Initial.cs index 5abe4a3..92a1d8f 100644 --- a/Continuity.AuthServer/DB/Migrations/20230814114414_Initial.cs +++ b/Continuity.AuthServer/DB/Migrations/20230814114414_Initial.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Timothy Schenk. Subject to the GNU AGPL Version 3 License. +// Licensed to Timothy Schenk under the GNU AGPL Version 3 License. #nullable disable diff --git a/Continuity.AuthServer/DB/Migrations/20230817230423_CharacterDataDraft.cs b/Continuity.AuthServer/DB/Migrations/20230817230423_CharacterDataDraft.cs index 07b3573..9356f96 100644 --- a/Continuity.AuthServer/DB/Migrations/20230817230423_CharacterDataDraft.cs +++ b/Continuity.AuthServer/DB/Migrations/20230817230423_CharacterDataDraft.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Timothy Schenk. Subject to the GNU AGPL Version 3 License. +// Licensed to Timothy Schenk under the GNU AGPL Version 3 License. #nullable disable diff --git a/Continuity.AuthServer/DB/Migrations/20231108143729_AddInventoryToCharacter.cs b/Continuity.AuthServer/DB/Migrations/20231108143729_AddInventoryToCharacter.cs index f6edb69..23d6af0 100644 --- a/Continuity.AuthServer/DB/Migrations/20231108143729_AddInventoryToCharacter.cs +++ b/Continuity.AuthServer/DB/Migrations/20231108143729_AddInventoryToCharacter.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Timothy Schenk. Subject to the GNU AGPL Version 3 License. +// Licensed to Timothy Schenk under the GNU AGPL Version 3 License. using Microsoft.EntityFrameworkCore.Migrations; diff --git a/Continuity.AuthServer/DB/Migrations/20231113192405_AdditionalCharacterData.cs b/Continuity.AuthServer/DB/Migrations/20231113192405_AdditionalCharacterData.cs index 4582865..65972c2 100644 --- a/Continuity.AuthServer/DB/Migrations/20231113192405_AdditionalCharacterData.cs +++ b/Continuity.AuthServer/DB/Migrations/20231113192405_AdditionalCharacterData.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Timothy Schenk. Subject to the GNU AGPL Version 3 License. +// Licensed to Timothy Schenk under the GNU AGPL Version 3 License. using Microsoft.EntityFrameworkCore.Migrations; diff --git a/Continuity.AuthServer/DB/Migrations/20231114203409_AddGuildData.cs b/Continuity.AuthServer/DB/Migrations/20231114203409_AddGuildData.cs index 7295bf5..4b46e88 100644 --- a/Continuity.AuthServer/DB/Migrations/20231114203409_AddGuildData.cs +++ b/Continuity.AuthServer/DB/Migrations/20231114203409_AddGuildData.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Timothy Schenk. Subject to the GNU AGPL Version 3 License. +// Licensed to Timothy Schenk under the GNU AGPL Version 3 License. using Microsoft.EntityFrameworkCore.Migrations; diff --git a/Continuity.AuthServer/DB/Migrations/20231115174714_GuildIsNotRequired.cs b/Continuity.AuthServer/DB/Migrations/20231115174714_GuildIsNotRequired.cs index 7485680..5e5f2b5 100644 --- a/Continuity.AuthServer/DB/Migrations/20231115174714_GuildIsNotRequired.cs +++ b/Continuity.AuthServer/DB/Migrations/20231115174714_GuildIsNotRequired.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Timothy Schenk. Subject to the GNU AGPL Version 3 License. +// Licensed to Timothy Schenk under the GNU AGPL Version 3 License. using Microsoft.EntityFrameworkCore.Migrations; diff --git a/Continuity.AuthServer/DB/Migrations/20231115183824_SwitchToDataAnnotations.cs b/Continuity.AuthServer/DB/Migrations/20231115183824_SwitchToDataAnnotations.cs index 9f83c4f..e530d49 100644 --- a/Continuity.AuthServer/DB/Migrations/20231115183824_SwitchToDataAnnotations.cs +++ b/Continuity.AuthServer/DB/Migrations/20231115183824_SwitchToDataAnnotations.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Timothy Schenk. Subject to the GNU AGPL Version 3 License. +// Licensed to Timothy Schenk under the GNU AGPL Version 3 License. using Microsoft.EntityFrameworkCore.Migrations; diff --git a/Continuity.AuthServer/DB/Migrations/20231116110504_DBPoolingAndLazyLoadingSupport.cs b/Continuity.AuthServer/DB/Migrations/20231116110504_DBPoolingAndLazyLoadingSupport.cs index 82c8b55..85d2ec8 100644 --- a/Continuity.AuthServer/DB/Migrations/20231116110504_DBPoolingAndLazyLoadingSupport.cs +++ b/Continuity.AuthServer/DB/Migrations/20231116110504_DBPoolingAndLazyLoadingSupport.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Timothy Schenk. Subject to the GNU AGPL Version 3 License. +// Licensed to Timothy Schenk under the GNU AGPL Version 3 License. using Microsoft.EntityFrameworkCore.Migrations; diff --git a/Continuity.AuthServer/DB/Migrations/20231120162002_FixInventoryItemAsDbset.cs b/Continuity.AuthServer/DB/Migrations/20231120162002_FixInventoryItemAsDbset.cs index ec1650a..0687678 100644 --- a/Continuity.AuthServer/DB/Migrations/20231120162002_FixInventoryItemAsDbset.cs +++ b/Continuity.AuthServer/DB/Migrations/20231120162002_FixInventoryItemAsDbset.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Timothy Schenk. Subject to the GNU AGPL Version 3 License. +// Licensed to Timothy Schenk under the GNU AGPL Version 3 License. using Microsoft.EntityFrameworkCore.Migrations; diff --git a/Continuity.AuthServer/DB/Migrations/20231121205726_MissingCascadeDeletionOnCharacter.cs b/Continuity.AuthServer/DB/Migrations/20231121205726_MissingCascadeDeletionOnCharacter.cs index 8761e48..459bf29 100644 --- a/Continuity.AuthServer/DB/Migrations/20231121205726_MissingCascadeDeletionOnCharacter.cs +++ b/Continuity.AuthServer/DB/Migrations/20231121205726_MissingCascadeDeletionOnCharacter.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Timothy Schenk. Subject to the GNU AGPL Version 3 License. +// Licensed to Timothy Schenk under the GNU AGPL Version 3 License. using Microsoft.EntityFrameworkCore.Migrations; diff --git a/Continuity.AuthServer/DB/Migrations/20231122064508_IndexingAndVariousOtherAnnotations.cs b/Continuity.AuthServer/DB/Migrations/20231122064508_IndexingAndVariousOtherAnnotations.cs index 82980fb..c436609 100644 --- a/Continuity.AuthServer/DB/Migrations/20231122064508_IndexingAndVariousOtherAnnotations.cs +++ b/Continuity.AuthServer/DB/Migrations/20231122064508_IndexingAndVariousOtherAnnotations.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Timothy Schenk. Subject to the GNU AGPL Version 3 License. +// Licensed to Timothy Schenk under the GNU AGPL Version 3 License. using Microsoft.EntityFrameworkCore.Migrations; diff --git a/Continuity.AuthServer/DB/Migrations/20231122091030_VariousDeletionBehaviours.cs b/Continuity.AuthServer/DB/Migrations/20231122091030_VariousDeletionBehaviours.cs index 9f34ff6..02450e7 100644 --- a/Continuity.AuthServer/DB/Migrations/20231122091030_VariousDeletionBehaviours.cs +++ b/Continuity.AuthServer/DB/Migrations/20231122091030_VariousDeletionBehaviours.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Timothy Schenk. Subject to the GNU AGPL Version 3 License. +// Licensed to Timothy Schenk under the GNU AGPL Version 3 License. using Microsoft.EntityFrameworkCore.Migrations; diff --git a/Continuity.AuthServer/DB/Migrations/20231125112400_FixEntityRelationships.cs b/Continuity.AuthServer/DB/Migrations/20231125112400_FixEntityRelationships.cs index 9bfd2e8..9ec3772 100644 --- a/Continuity.AuthServer/DB/Migrations/20231125112400_FixEntityRelationships.cs +++ b/Continuity.AuthServer/DB/Migrations/20231125112400_FixEntityRelationships.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Timothy Schenk. Subject to the GNU AGPL Version 3 License. +// Licensed to Timothy Schenk under the GNU AGPL Version 3 License. using Microsoft.EntityFrameworkCore.Migrations; diff --git a/Continuity.AuthServer/DB/WonderkingContext.cs b/Continuity.AuthServer/DB/WonderkingContext.cs index e0b17b4..042257f 100644 --- a/Continuity.AuthServer/DB/WonderkingContext.cs +++ b/Continuity.AuthServer/DB/WonderkingContext.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Timothy Schenk. Subject to the GNU AGPL Version 3 License. +// Licensed to Timothy Schenk under the GNU AGPL Version 3 License. using Continuity.AuthServer.DB.Documents; using JetBrains.Annotations; diff --git a/Continuity.AuthServer/LoggerMessages/LoginHandlerLoggerMessages.cs b/Continuity.AuthServer/LoggerMessages/LoginHandlerLoggerMessages.cs index 9e965c9..86c2915 100644 --- a/Continuity.AuthServer/LoggerMessages/LoginHandlerLoggerMessages.cs +++ b/Continuity.AuthServer/LoggerMessages/LoginHandlerLoggerMessages.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Timothy Schenk. Subject to the GNU AGPL Version 3 License. +// Licensed to Timothy Schenk under the GNU AGPL Version 3 License. using Continuity.AuthServer.PacketHandlers; using Microsoft.Extensions.Logging; diff --git a/Continuity.AuthServer/LoggerMessages/PacketLoggerMessages.cs b/Continuity.AuthServer/LoggerMessages/PacketLoggerMessages.cs index 1332f01..e3d5291 100644 --- a/Continuity.AuthServer/LoggerMessages/PacketLoggerMessages.cs +++ b/Continuity.AuthServer/LoggerMessages/PacketLoggerMessages.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Timothy Schenk. Subject to the GNU AGPL Version 3 License. +// Licensed to Timothy Schenk under the GNU AGPL Version 3 License. using JetBrains.Annotations; using Microsoft.Extensions.Logging; diff --git a/Continuity.AuthServer/PacketHandlers/ChannelSelectionHandler.Projections.cs b/Continuity.AuthServer/PacketHandlers/ChannelSelectionHandler.Projections.cs index b690082..d33e3a2 100644 --- a/Continuity.AuthServer/PacketHandlers/ChannelSelectionHandler.Projections.cs +++ b/Continuity.AuthServer/PacketHandlers/ChannelSelectionHandler.Projections.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Timothy Schenk. Subject to the GNU AGPL Version 3 License. +// Licensed to Timothy Schenk under the GNU AGPL Version 3 License. using Continuity.AuthServer.DB.Documents; using Wonderking.Game.Data.Character; diff --git a/Continuity.AuthServer/PacketHandlers/ChannelSelectionHandler.cs b/Continuity.AuthServer/PacketHandlers/ChannelSelectionHandler.cs index 22a01b3..d4f2444 100644 --- a/Continuity.AuthServer/PacketHandlers/ChannelSelectionHandler.cs +++ b/Continuity.AuthServer/PacketHandlers/ChannelSelectionHandler.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Timothy Schenk. Subject to the GNU AGPL Version 3 License. +// Licensed to Timothy Schenk under the GNU AGPL Version 3 License. using Continuity.AuthServer.DB; using Continuity.AuthServer.DB.Documents; @@ -27,11 +27,12 @@ public partial class ChannelSelectionHandler : IPacketHandler() }; var accountExists = - await _wonderkingContext.Accounts.AsNoTracking().AnyAsync(a => a.Id == session.AccountId, cancellationToken: cancellationToken); + await _wonderkingContext.Accounts.AsNoTracking() + .AnyAsync(a => a.Id == session.AccountId, cancellationToken); var amountOfCharacter = await _wonderkingContext.Characters.AsNoTracking().Include(c => c.Account) .Where(c => c.Account.Id == session.AccountId).Take(3) - .CountAsync(cancellationToken: cancellationToken); + .CountAsync(cancellationToken); if (!accountExists) { @@ -52,7 +53,7 @@ public partial class ChannelSelectionHandler : IPacketHandler c.Account).Include(c => c.GuildMember) .ThenInclude(gm => gm.Guild) .Where(c => c.Account.Id == session.AccountId && c.GuildMember.Guild != null) - .Select(c => c.GuildMember.Guild.Name).Take(3).ToArrayAsync(cancellationToken: cancellationToken); + .Select(c => c.GuildMember.Guild.Name).Take(3).ToArrayAsync(cancellationToken); } else { diff --git a/Continuity.AuthServer/PacketHandlers/CharacterCreationHandler.cs b/Continuity.AuthServer/PacketHandlers/CharacterCreationHandler.cs index 082943c..6dfe60a 100644 --- a/Continuity.AuthServer/PacketHandlers/CharacterCreationHandler.cs +++ b/Continuity.AuthServer/PacketHandlers/CharacterCreationHandler.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Timothy Schenk. Subject to the GNU AGPL Version 3 License. +// Licensed to Timothy Schenk under the GNU AGPL Version 3 License. using Continuity.AuthServer.DB; using Continuity.AuthServer.DB.Documents; @@ -30,8 +30,8 @@ public class CharacterCreationHandler : IPacketHandler a.Id == session.AccountId, cancellationToken: cancellationToken); + var account = + await _wonderkingContext.Accounts.FirstOrDefaultAsync(a => a.Id == session.AccountId, cancellationToken); if (account is null) { @@ -93,7 +93,7 @@ public class CharacterCreationHandler : IPacketHandler x.Name == packet.Name && - x.Account.Id == session.AccountId, cancellationToken: cancellationToken); + x.Account.Id == session.AccountId, cancellationToken); var response = new CharacterDeleteResponsePacket { HasToBeZero = 0 }; if (character == null) diff --git a/Continuity.AuthServer/PacketHandlers/CharacterMappingItemEntry.cs b/Continuity.AuthServer/PacketHandlers/CharacterMappingItemEntry.cs index 3628168..dca32e3 100644 --- a/Continuity.AuthServer/PacketHandlers/CharacterMappingItemEntry.cs +++ b/Continuity.AuthServer/PacketHandlers/CharacterMappingItemEntry.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Timothy Schenk. Subject to the GNU AGPL Version 3 License. +// Licensed to Timothy Schenk under the GNU AGPL Version 3 License. using System.Runtime.InteropServices; diff --git a/Continuity.AuthServer/PacketHandlers/CharacterNameCheckHandler.cs b/Continuity.AuthServer/PacketHandlers/CharacterNameCheckHandler.cs index 31f0607..89482c3 100644 --- a/Continuity.AuthServer/PacketHandlers/CharacterNameCheckHandler.cs +++ b/Continuity.AuthServer/PacketHandlers/CharacterNameCheckHandler.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Timothy Schenk. Subject to the GNU AGPL Version 3 License. +// Licensed to Timothy Schenk under the GNU AGPL Version 3 License. using Continuity.AuthServer.DB; using Microsoft.EntityFrameworkCore; @@ -22,7 +22,7 @@ public class CharacterNameCheckHandler : IPacketHandler c.Name == packet.Name, - cancellationToken: cancellationToken); + cancellationToken); var responsePacket = new CharacterNameCheckPacketResponse { IsTaken = isTaken }; await session.SendAsync(responsePacket); diff --git a/Continuity.AuthServer/PacketHandlers/LoginHandler.cs b/Continuity.AuthServer/PacketHandlers/LoginHandler.cs index 7d91682..142970f 100644 --- a/Continuity.AuthServer/PacketHandlers/LoginHandler.cs +++ b/Continuity.AuthServer/PacketHandlers/LoginHandler.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Timothy Schenk. Subject to the GNU AGPL Version 3 License. +// Licensed to Timothy Schenk under the GNU AGPL Version 3 License. using System.Diagnostics; using System.Security.Cryptography; @@ -19,10 +19,10 @@ namespace Continuity.AuthServer.PacketHandlers; public class LoginHandler : IPacketHandler { + private static readonly ActivitySource _activitySource = new(nameof(Server)); private readonly IConfiguration _configuration; private readonly ILogger _logger; private readonly WonderkingContext _wonderkingContext; - private static readonly ActivitySource _activitySource = new(nameof(Server)); public LoginHandler(ILogger logger, WonderkingContext wonderkingContext, IConfiguration configuration) { @@ -35,14 +35,17 @@ public class LoginHandler : IPacketHandler { LoginResponseReason loginResponseReason; _logger.LoginData(packet.Username, packet.Password); - var account = await _wonderkingContext.Accounts.FirstOrDefaultAsync(a => a.Username == packet.Username, cancellationToken: cancellationToken); + var account = + await _wonderkingContext.Accounts.FirstOrDefaultAsync(a => a.Username == packet.Username, + cancellationToken); if (account == null) { if (_configuration.GetSection("Testing").GetValue("CreateAccountOnLogin")) { loginResponseReason = await CreateAccountOnLoginAsync(packet.Username, packet.Password); - account = await _wonderkingContext.Accounts.FirstOrDefaultAsync(a => a.Username == packet.Username, cancellationToken: cancellationToken); + account = await _wonderkingContext.Accounts.FirstOrDefaultAsync(a => a.Username == packet.Username, + cancellationToken); } else { diff --git a/Continuity.AuthServer/Packets/RawPacket.cs b/Continuity.AuthServer/Packets/RawPacket.cs index 2b860e9..67404c3 100644 --- a/Continuity.AuthServer/Packets/RawPacket.cs +++ b/Continuity.AuthServer/Packets/RawPacket.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Timothy Schenk. Subject to the GNU AGPL Version 3 License. +// Licensed to Timothy Schenk under the GNU AGPL Version 3 License. using MassTransit; using Wonderking.Packets; diff --git a/Continuity.AuthServer/Program.cs b/Continuity.AuthServer/Program.cs index 3aa856e..43d2b6c 100644 --- a/Continuity.AuthServer/Program.cs +++ b/Continuity.AuthServer/Program.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Timothy Schenk. Subject to the GNU AGPL Version 3 License. +// Licensed to Timothy Schenk under the GNU AGPL Version 3 License. using System.Net; using System.Reflection; diff --git a/Continuity.AuthServer/Services/ItemObjectPoolService.cs b/Continuity.AuthServer/Services/ItemObjectPoolService.cs index fadf175..737a373 100644 --- a/Continuity.AuthServer/Services/ItemObjectPoolService.cs +++ b/Continuity.AuthServer/Services/ItemObjectPoolService.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Timothy Schenk. Subject to the GNU AGPL Version 3 License. +// Licensed to Timothy Schenk under the GNU AGPL Version 3 License. using System.Collections.Concurrent; using Continuity.AuthServer.DB.Documents; diff --git a/Continuity.AuthServer/Services/WonderkingAuthServer.cs b/Continuity.AuthServer/Services/WonderkingAuthServer.cs index 5b625f4..0efbe62 100644 --- a/Continuity.AuthServer/Services/WonderkingAuthServer.cs +++ b/Continuity.AuthServer/Services/WonderkingAuthServer.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Timothy Schenk. Subject to the GNU AGPL Version 3 License. +// Licensed to Timothy Schenk under the GNU AGPL Version 3 License. using System.Net; using System.Net.Sockets; diff --git a/Rai.PacketMediator/IBidirectionalPacket.cs b/Rai.PacketMediator/IBidirectionalPacket.cs index 42e4c4b..88d8450 100644 --- a/Rai.PacketMediator/IBidirectionalPacket.cs +++ b/Rai.PacketMediator/IBidirectionalPacket.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Timothy Schenk. Subject to the GNU AGPL Version 3 License. +// Licensed to Timothy Schenk under the GNU AGPL Version 3 License. using JetBrains.Annotations; diff --git a/Rai.PacketMediator/IIncomingPacket.cs b/Rai.PacketMediator/IIncomingPacket.cs index 34e162d..c0f5907 100644 --- a/Rai.PacketMediator/IIncomingPacket.cs +++ b/Rai.PacketMediator/IIncomingPacket.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Timothy Schenk. Subject to the GNU AGPL Version 3 License. +// Licensed to Timothy Schenk under the GNU AGPL Version 3 License. using JetBrains.Annotations; diff --git a/Rai.PacketMediator/IOutgoingPacket.cs b/Rai.PacketMediator/IOutgoingPacket.cs index a63aa27..ebf57c1 100644 --- a/Rai.PacketMediator/IOutgoingPacket.cs +++ b/Rai.PacketMediator/IOutgoingPacket.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Timothy Schenk. Subject to the GNU AGPL Version 3 License. +// Licensed to Timothy Schenk under the GNU AGPL Version 3 License. using JetBrains.Annotations; diff --git a/Rai.PacketMediator/IPacket.cs b/Rai.PacketMediator/IPacket.cs index e78399c..1044db9 100644 --- a/Rai.PacketMediator/IPacket.cs +++ b/Rai.PacketMediator/IPacket.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Timothy Schenk. Subject to the GNU AGPL Version 3 License. +// Licensed to Timothy Schenk under the GNU AGPL Version 3 License. namespace Rai.PacketMediator; diff --git a/Rai.PacketMediator/IPacketHandler.cs b/Rai.PacketMediator/IPacketHandler.cs index 8bcbb33..72ef6bb 100644 --- a/Rai.PacketMediator/IPacketHandler.cs +++ b/Rai.PacketMediator/IPacketHandler.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Timothy Schenk. Subject to the GNU AGPL Version 3 License. +// Licensed to Timothy Schenk under the GNU AGPL Version 3 License. using System.Diagnostics; using JetBrains.Annotations; @@ -6,11 +6,9 @@ using JetBrains.Annotations; namespace Rai.PacketMediator; [UsedImplicitly(ImplicitUseTargetFlags.WithInheritors)] -public interface IPacketHandler : IPacketHandler where TIncomingPacket : IIncomingPacket +public interface IPacketHandler : IPacketHandler + where TIncomingPacket : IIncomingPacket { - [UsedImplicitly(ImplicitUseTargetFlags.WithInheritors)] - public Task HandleAsync(TIncomingPacket packet, TSession session, CancellationToken cancellationToken); - async Task IPacketHandler.TryHandleAsync(IIncomingPacket packet, TSession session, CancellationToken cancellationToken) { @@ -20,12 +18,15 @@ public interface IPacketHandler : IPacketHandle } using var activity = new ActivitySource(nameof(PacketMediator)).StartActivity(nameof(HandleAsync)); - activity?.AddTag("Handler", this.ToString()); + activity?.AddTag("Handler", ToString()); activity?.AddTag("Packet", packet.ToString()); await HandleAsync(tPacket, session, cancellationToken); return true; } + + [UsedImplicitly(ImplicitUseTargetFlags.WithInheritors)] + public Task HandleAsync(TIncomingPacket packet, TSession session, CancellationToken cancellationToken); } public interface IPacketHandler diff --git a/Rai.PacketMediator/PacketDistributor.cs b/Rai.PacketMediator/PacketDistributor.cs index d827797..f020340 100644 --- a/Rai.PacketMediator/PacketDistributor.cs +++ b/Rai.PacketMediator/PacketDistributor.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Timothy Schenk. Subject to the GNU AGPL Version 3 License. +// Licensed to Timothy Schenk under the GNU AGPL Version 3 License. using System.Collections.Concurrent; using System.Collections.Immutable; @@ -15,12 +15,10 @@ public class PacketDistributor where TPacketIdEnum : En { private readonly Channel> _channel; - private readonly ConcurrentDictionary?> _packetHandlersInstantiation; - private readonly ImmutableDictionary> _deserializationMap; - public ImmutableDictionary PacketIdMap { get; } + private readonly ConcurrentDictionary?> _packetHandlersInstantiation; public PacketDistributor(IServiceProvider serviceProvider, IEnumerable sourcesContainingPackets, IEnumerable sourcesContainingPacketHandlers) @@ -37,7 +35,7 @@ public class PacketDistributor where TPacketIdEnum : En var packetHandlers = GetAllPacketHandlersWithId(sourcesContainingPacketHandlers); - this.PacketIdMap = allOutgoingPackets.Select(x => new { PacketId = x.Key, Type = x.Value }) + PacketIdMap = allOutgoingPackets.Select(x => new { PacketId = x.Key, Type = x.Value }) .ToImmutableDictionary(x => x.Type, x => x.PacketId); var tempDeserializationMap = @@ -69,6 +67,8 @@ public class PacketDistributor where TPacketIdEnum : En _deserializationMap = tempDeserializationMap.ToImmutableDictionary(); } + public ImmutableDictionary PacketIdMap { get; } + private static IEnumerable> GetAllPackets( IEnumerable sourcesContainingPackets, Type packetType) { diff --git a/Rai.PacketMediator/PacketDistributorService.cs b/Rai.PacketMediator/PacketDistributorService.cs index bcc60c1..c1a94ee 100644 --- a/Rai.PacketMediator/PacketDistributorService.cs +++ b/Rai.PacketMediator/PacketDistributorService.cs @@ -1,10 +1,11 @@ -// Copyright (c) 2023 Timothy Schenk. Subject to the GNU AGPL Version 3 License. +// Licensed to Timothy Schenk under the GNU AGPL Version 3 License. using System.Reflection; +using Microsoft.Extensions.Hosting; namespace Rai.PacketMediator; -public class PacketDistributorService : Microsoft.Extensions.Hosting.IHostedService +public class PacketDistributorService : IHostedService where TPacketIdEnum : Enum { private readonly PacketDistributor _packetDistributor; @@ -21,20 +22,20 @@ public class PacketDistributorService : Microsoft.Exten return _packetDistributor.DequeuePacketAsync(cancellationToken); } - public Task AddPacketAsync(byte[] packetData, TPacketIdEnum operationCode, TSession session) - { - return this._packetDistributor.AddPacketAsync(packetData, operationCode, session); - } - public Task StopAsync(CancellationToken cancellationToken) { return Task.CompletedTask; } + public Task AddPacketAsync(byte[] packetData, TPacketIdEnum operationCode, TSession session) + { + return _packetDistributor.AddPacketAsync(packetData, operationCode, session); + } + public TPacketIdEnum GetOperationCodeByPacketType(IPacket packet) { var type = packet.GetType(); - this._packetDistributor.PacketIdMap.TryGetValue(type, out var value); + _packetDistributor.PacketIdMap.TryGetValue(type, out var value); if (value is null) { throw new ArgumentOutOfRangeException(type.Name); diff --git a/Rai.PacketMediator/PacketIdAttribute.cs b/Rai.PacketMediator/PacketIdAttribute.cs index f9d32a5..c4fdb64 100644 --- a/Rai.PacketMediator/PacketIdAttribute.cs +++ b/Rai.PacketMediator/PacketIdAttribute.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Timothy Schenk. Subject to the GNU AGPL Version 3 License. +// Licensed to Timothy Schenk under the GNU AGPL Version 3 License. namespace Rai.PacketMediator; diff --git a/Rai.PacketMediator/Rai.PacketMediator.csproj b/Rai.PacketMediator/Rai.PacketMediator.csproj index 45b709b..9b15be2 100644 --- a/Rai.PacketMediator/Rai.PacketMediator.csproj +++ b/Rai.PacketMediator/Rai.PacketMediator.csproj @@ -1,25 +1,25 @@  - - net8.0 - enable - enable - + + net8.0 + enable + enable + - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + diff --git a/Wonderking/Game/Data/Character/Gender.cs b/Wonderking/Game/Data/Character/Gender.cs index 76a4b0b..cdf685a 100644 --- a/Wonderking/Game/Data/Character/Gender.cs +++ b/Wonderking/Game/Data/Character/Gender.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Timothy Schenk. Subject to the GNU AGPL Version 3 License. +// Licensed to Timothy Schenk under the GNU AGPL Version 3 License. namespace Wonderking.Game.Data.Character; diff --git a/Wonderking/Game/Data/Character/PvPLevel.cs b/Wonderking/Game/Data/Character/PvPLevel.cs index 145193a..7062b7a 100644 --- a/Wonderking/Game/Data/Character/PvPLevel.cs +++ b/Wonderking/Game/Data/Character/PvPLevel.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Timothy Schenk. Subject to the GNU AGPL Version 3 License. +// Licensed to Timothy Schenk under the GNU AGPL Version 3 License. namespace Wonderking.Game.Data.Character; diff --git a/Wonderking/Game/Data/Item/ContainedItem.cs b/Wonderking/Game/Data/Item/ContainedItem.cs index 8dd432d..c89e1f3 100644 --- a/Wonderking/Game/Data/Item/ContainedItem.cs +++ b/Wonderking/Game/Data/Item/ContainedItem.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Timothy Schenk. Subject to the GNU AGPL Version 3 License. +// Licensed to Timothy Schenk under the GNU AGPL Version 3 License. using System.Runtime.InteropServices; diff --git a/Wonderking/Game/Data/Item/CraftMaterial.cs b/Wonderking/Game/Data/Item/CraftMaterial.cs index 5c4c508..67ea2dd 100644 --- a/Wonderking/Game/Data/Item/CraftMaterial.cs +++ b/Wonderking/Game/Data/Item/CraftMaterial.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Timothy Schenk. Subject to the GNU AGPL Version 3 License. +// Licensed to Timothy Schenk under the GNU AGPL Version 3 License. using System.Runtime.InteropServices; diff --git a/Wonderking/Game/Data/Item/ElementalStats.cs b/Wonderking/Game/Data/Item/ElementalStats.cs index 528629e..2907d96 100644 --- a/Wonderking/Game/Data/Item/ElementalStats.cs +++ b/Wonderking/Game/Data/Item/ElementalStats.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Timothy Schenk. Subject to the GNU AGPL Version 3 License. +// Licensed to Timothy Schenk under the GNU AGPL Version 3 License. using System.Runtime.InteropServices; diff --git a/Wonderking/Game/Data/Item/ItemOptions.cs b/Wonderking/Game/Data/Item/ItemOptions.cs index f4ba33c..abae6ca 100644 --- a/Wonderking/Game/Data/Item/ItemOptions.cs +++ b/Wonderking/Game/Data/Item/ItemOptions.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Timothy Schenk. Subject to the GNU AGPL Version 3 License. +// Licensed to Timothy Schenk under the GNU AGPL Version 3 License. namespace Wonderking.Game.Data.Item; diff --git a/Wonderking/Game/Data/Item/Stats.cs b/Wonderking/Game/Data/Item/Stats.cs index f7bb6fd..f2841d6 100644 --- a/Wonderking/Game/Data/Item/Stats.cs +++ b/Wonderking/Game/Data/Item/Stats.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Timothy Schenk. Subject to the GNU AGPL Version 3 License. +// Licensed to Timothy Schenk under the GNU AGPL Version 3 License. using System.Runtime.InteropServices; diff --git a/Wonderking/Game/Data/ItemObject.cs b/Wonderking/Game/Data/ItemObject.cs index 520c761..084ce39 100644 --- a/Wonderking/Game/Data/ItemObject.cs +++ b/Wonderking/Game/Data/ItemObject.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Timothy Schenk. Subject to the GNU AGPL Version 3 License. +// Licensed to Timothy Schenk under the GNU AGPL Version 3 License. using System.Text.Json.Serialization; using Wonderking.Game.Data.Item; diff --git a/Wonderking/Game/DataReader.cs b/Wonderking/Game/DataReader.cs index 41c3af6..39139bc 100644 --- a/Wonderking/Game/DataReader.cs +++ b/Wonderking/Game/DataReader.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Timothy Schenk. Subject to the GNU AGPL Version 3 License. +// Licensed to Timothy Schenk under the GNU AGPL Version 3 License. using System.Reflection; diff --git a/Wonderking/Game/GameDataMetadataAttribute.cs b/Wonderking/Game/GameDataMetadataAttribute.cs index db560c8..f72dd37 100644 --- a/Wonderking/Game/GameDataMetadataAttribute.cs +++ b/Wonderking/Game/GameDataMetadataAttribute.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Timothy Schenk. Subject to the GNU AGPL Version 3 License. +// Licensed to Timothy Schenk under the GNU AGPL Version 3 License. using JetBrains.Annotations; diff --git a/Wonderking/Game/Mapping/CharacterStatsMappingConfiguration.cs b/Wonderking/Game/Mapping/CharacterStatsMappingConfiguration.cs index 1776e04..b4f7f11 100644 --- a/Wonderking/Game/Mapping/CharacterStatsMappingConfiguration.cs +++ b/Wonderking/Game/Mapping/CharacterStatsMappingConfiguration.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Timothy Schenk. Subject to the GNU AGPL Version 3 License. +// Licensed to Timothy Schenk under the GNU AGPL Version 3 License. using System.Text.Json.Serialization; diff --git a/Wonderking/Game/Mapping/DefaultCharacterMapping.cs b/Wonderking/Game/Mapping/DefaultCharacterMapping.cs index e1d7ca5..99f58af 100644 --- a/Wonderking/Game/Mapping/DefaultCharacterMapping.cs +++ b/Wonderking/Game/Mapping/DefaultCharacterMapping.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Timothy Schenk. Subject to the GNU AGPL Version 3 License. +// Licensed to Timothy Schenk under the GNU AGPL Version 3 License. using System.Text.Json.Serialization; diff --git a/Wonderking/Game/Mapping/DynamicStats.cs b/Wonderking/Game/Mapping/DynamicStats.cs index 478b240..ddd98bc 100644 --- a/Wonderking/Game/Mapping/DynamicStats.cs +++ b/Wonderking/Game/Mapping/DynamicStats.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Timothy Schenk. Subject to the GNU AGPL Version 3 License. +// Licensed to Timothy Schenk under the GNU AGPL Version 3 License. using System.Text.Json.Serialization; diff --git a/Wonderking/Game/Mapping/Item.cs b/Wonderking/Game/Mapping/Item.cs index e136c1b..3044d4d 100644 --- a/Wonderking/Game/Mapping/Item.cs +++ b/Wonderking/Game/Mapping/Item.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Timothy Schenk. Subject to the GNU AGPL Version 3 License. +// Licensed to Timothy Schenk under the GNU AGPL Version 3 License. using System.Text.Json.Serialization; diff --git a/Wonderking/Game/Mapping/JobSpecificMapping.cs b/Wonderking/Game/Mapping/JobSpecificMapping.cs index df54675..e9ef0dd 100644 --- a/Wonderking/Game/Mapping/JobSpecificMapping.cs +++ b/Wonderking/Game/Mapping/JobSpecificMapping.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Timothy Schenk. Subject to the GNU AGPL Version 3 License. +// Licensed to Timothy Schenk under the GNU AGPL Version 3 License. using System.Text.Json.Serialization; using JetBrains.Annotations; diff --git a/Wonderking/Game/Reader/BinaryReader.cs b/Wonderking/Game/Reader/BinaryReader.cs index 3bcf4ce..8709336 100644 --- a/Wonderking/Game/Reader/BinaryReader.cs +++ b/Wonderking/Game/Reader/BinaryReader.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Timothy Schenk. Subject to the GNU AGPL Version 3 License. +// Licensed to Timothy Schenk under the GNU AGPL Version 3 License. using System.Runtime.InteropServices; diff --git a/Wonderking/Game/Reader/GenericReaderExtensions.cs b/Wonderking/Game/Reader/GenericReaderExtensions.cs index cfccca9..b3da49a 100644 --- a/Wonderking/Game/Reader/GenericReaderExtensions.cs +++ b/Wonderking/Game/Reader/GenericReaderExtensions.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Timothy Schenk. Subject to the GNU AGPL Version 3 License. +// Licensed to Timothy Schenk under the GNU AGPL Version 3 License. /* Nicht gemergte Änderung aus Projekt "Wonderking(net7.0)" Vor: diff --git a/Wonderking/Game/Reader/ItemReader.cs b/Wonderking/Game/Reader/ItemReader.cs index 889deb5..88eef50 100644 --- a/Wonderking/Game/Reader/ItemReader.cs +++ b/Wonderking/Game/Reader/ItemReader.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Timothy Schenk. Subject to the GNU AGPL Version 3 License. +// Licensed to Timothy Schenk under the GNU AGPL Version 3 License. using System.Buffers.Binary; using System.Text; diff --git a/Wonderking/Game/Reader/ItemReaderExtensions.cs b/Wonderking/Game/Reader/ItemReaderExtensions.cs index fc42eb0..a38dc4d 100644 --- a/Wonderking/Game/Reader/ItemReaderExtensions.cs +++ b/Wonderking/Game/Reader/ItemReaderExtensions.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Timothy Schenk. Subject to the GNU AGPL Version 3 License. +// Licensed to Timothy Schenk under the GNU AGPL Version 3 License. using Wonderking.Game.Data.Item; diff --git a/Wonderking/Packets/Incoming/ChannelSelectionPacket.cs b/Wonderking/Packets/Incoming/ChannelSelectionPacket.cs index 9d122ef..84b23e4 100644 --- a/Wonderking/Packets/Incoming/ChannelSelectionPacket.cs +++ b/Wonderking/Packets/Incoming/ChannelSelectionPacket.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Timothy Schenk. Subject to the GNU AGPL Version 3 License. +// Licensed to Timothy Schenk under the GNU AGPL Version 3 License. using Rai.PacketMediator; diff --git a/Wonderking/Packets/Incoming/CharacterCreationPacket.cs b/Wonderking/Packets/Incoming/CharacterCreationPacket.cs index 7516212..707fe04 100644 --- a/Wonderking/Packets/Incoming/CharacterCreationPacket.cs +++ b/Wonderking/Packets/Incoming/CharacterCreationPacket.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Timothy Schenk. Subject to the GNU AGPL Version 3 License. +// Licensed to Timothy Schenk under the GNU AGPL Version 3 License. using System.Text; using Rai.PacketMediator; diff --git a/Wonderking/Packets/Incoming/CharacterDeletePacket.cs b/Wonderking/Packets/Incoming/CharacterDeletePacket.cs index c5625f9..77d65a3 100644 --- a/Wonderking/Packets/Incoming/CharacterDeletePacket.cs +++ b/Wonderking/Packets/Incoming/CharacterDeletePacket.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Timothy Schenk. Subject to the GNU AGPL Version 3 License. +// Licensed to Timothy Schenk under the GNU AGPL Version 3 License. using System.Text; using Rai.PacketMediator; diff --git a/Wonderking/Packets/Incoming/CharacterNameCheckPacket.cs b/Wonderking/Packets/Incoming/CharacterNameCheckPacket.cs index 23d19b0..2f55b1b 100644 --- a/Wonderking/Packets/Incoming/CharacterNameCheckPacket.cs +++ b/Wonderking/Packets/Incoming/CharacterNameCheckPacket.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Timothy Schenk. Subject to the GNU AGPL Version 3 License. +// Licensed to Timothy Schenk under the GNU AGPL Version 3 License. using System.Text; using Rai.PacketMediator; diff --git a/Wonderking/Packets/Incoming/LoginInfoPacket.cs b/Wonderking/Packets/Incoming/LoginInfoPacket.cs index 967ca07..8f1b228 100644 --- a/Wonderking/Packets/Incoming/LoginInfoPacket.cs +++ b/Wonderking/Packets/Incoming/LoginInfoPacket.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Timothy Schenk. Subject to the GNU AGPL Version 3 License. +// Licensed to Timothy Schenk under the GNU AGPL Version 3 License. using System.Text; using Rai.PacketMediator; diff --git a/Wonderking/Packets/OperationCode.cs b/Wonderking/Packets/OperationCode.cs index ef0bfaa..07e2b5b 100644 --- a/Wonderking/Packets/OperationCode.cs +++ b/Wonderking/Packets/OperationCode.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Timothy Schenk. Subject to the GNU AGPL Version 3 License. +// Licensed to Timothy Schenk under the GNU AGPL Version 3 License. namespace Wonderking.Packets; diff --git a/Wonderking/Packets/Outgoing/ChannelSelectionResponsePacket.cs b/Wonderking/Packets/Outgoing/ChannelSelectionResponsePacket.cs index 5d5dc24..7d621d3 100644 --- a/Wonderking/Packets/Outgoing/ChannelSelectionResponsePacket.cs +++ b/Wonderking/Packets/Outgoing/ChannelSelectionResponsePacket.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Timothy Schenk. Subject to the GNU AGPL Version 3 License. +// Licensed to Timothy Schenk under the GNU AGPL Version 3 License. using System.Buffers.Binary; using System.Text; diff --git a/Wonderking/Packets/Outgoing/CharacterCreationResponsePacket.cs b/Wonderking/Packets/Outgoing/CharacterCreationResponsePacket.cs index d3d6087..a2bbb96 100644 --- a/Wonderking/Packets/Outgoing/CharacterCreationResponsePacket.cs +++ b/Wonderking/Packets/Outgoing/CharacterCreationResponsePacket.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Timothy Schenk. Subject to the GNU AGPL Version 3 License. +// Licensed to Timothy Schenk under the GNU AGPL Version 3 License. using System.Buffers.Binary; using System.Text; diff --git a/Wonderking/Packets/Outgoing/CharacterDeleteResponsePacket.cs b/Wonderking/Packets/Outgoing/CharacterDeleteResponsePacket.cs index 6e04c25..fb9628d 100644 --- a/Wonderking/Packets/Outgoing/CharacterDeleteResponsePacket.cs +++ b/Wonderking/Packets/Outgoing/CharacterDeleteResponsePacket.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Timothy Schenk. Subject to the GNU AGPL Version 3 License. +// Licensed to Timothy Schenk under the GNU AGPL Version 3 License. using Rai.PacketMediator; diff --git a/Wonderking/Packets/Outgoing/CharacterNameCheckPacketResponse.cs b/Wonderking/Packets/Outgoing/CharacterNameCheckPacketResponse.cs index c91a18b..165e6ac 100644 --- a/Wonderking/Packets/Outgoing/CharacterNameCheckPacketResponse.cs +++ b/Wonderking/Packets/Outgoing/CharacterNameCheckPacketResponse.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Timothy Schenk. Subject to the GNU AGPL Version 3 License. +// Licensed to Timothy Schenk under the GNU AGPL Version 3 License. using Rai.PacketMediator; @@ -8,6 +8,7 @@ namespace Wonderking.Packets.Outgoing; public class CharacterNameCheckPacketResponse : IOutgoingPacket { public required bool IsTaken { get; set; } + public byte[] Serialize() { Span data = stackalloc byte[1]; diff --git a/Wonderking/Packets/Outgoing/CharacterSelectionSetGuildNamePacket.cs b/Wonderking/Packets/Outgoing/CharacterSelectionSetGuildNamePacket.cs index 0c89ce9..607b795 100644 --- a/Wonderking/Packets/Outgoing/CharacterSelectionSetGuildNamePacket.cs +++ b/Wonderking/Packets/Outgoing/CharacterSelectionSetGuildNamePacket.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Timothy Schenk. Subject to the GNU AGPL Version 3 License. +// Licensed to Timothy Schenk under the GNU AGPL Version 3 License. using System.Text; using Rai.PacketMediator; @@ -9,6 +9,7 @@ namespace Wonderking.Packets.Outgoing; public class CharacterSelectionSetGuildNamePacket : IOutgoingPacket { public required string[] GuildNames { get; set; } + public byte[] Serialize() { Span data = stackalloc byte[1 + (1 + 16 + 1) * GuildNames.Length]; diff --git a/Wonderking/Packets/Outgoing/Data/BaseStats.cs b/Wonderking/Packets/Outgoing/Data/BaseStats.cs index 3f54de4..6275194 100644 --- a/Wonderking/Packets/Outgoing/Data/BaseStats.cs +++ b/Wonderking/Packets/Outgoing/Data/BaseStats.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Timothy Schenk. Subject to the GNU AGPL Version 3 License. +// Licensed to Timothy Schenk under the GNU AGPL Version 3 License. using System.Text.Json.Serialization; using JetBrains.Annotations; diff --git a/Wonderking/Packets/Outgoing/Data/CharacterData.cs b/Wonderking/Packets/Outgoing/Data/CharacterData.cs index 01911a9..e346ce3 100644 --- a/Wonderking/Packets/Outgoing/Data/CharacterData.cs +++ b/Wonderking/Packets/Outgoing/Data/CharacterData.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Timothy Schenk. Subject to the GNU AGPL Version 3 License. +// Licensed to Timothy Schenk under the GNU AGPL Version 3 License. using Wonderking.Game.Data.Character; diff --git a/Wonderking/Packets/Outgoing/Data/JobData.cs b/Wonderking/Packets/Outgoing/Data/JobData.cs index bf0f59a..57cc805 100644 --- a/Wonderking/Packets/Outgoing/Data/JobData.cs +++ b/Wonderking/Packets/Outgoing/Data/JobData.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Timothy Schenk. Subject to the GNU AGPL Version 3 License. +// Licensed to Timothy Schenk under the GNU AGPL Version 3 License. using JetBrains.Annotations; using Microsoft.EntityFrameworkCore; diff --git a/Wonderking/Packets/Outgoing/Data/LoginResponseReason.cs b/Wonderking/Packets/Outgoing/Data/LoginResponseReason.cs index cf6ee5c..ae1017c 100644 --- a/Wonderking/Packets/Outgoing/Data/LoginResponseReason.cs +++ b/Wonderking/Packets/Outgoing/Data/LoginResponseReason.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Timothy Schenk. Subject to the GNU AGPL Version 3 License. +// Licensed to Timothy Schenk under the GNU AGPL Version 3 License. namespace Wonderking.Packets.Outgoing.Data; diff --git a/Wonderking/Packets/Outgoing/Data/ServerChannelData.cs b/Wonderking/Packets/Outgoing/Data/ServerChannelData.cs index 31e0dd3..8dbbf5a 100644 --- a/Wonderking/Packets/Outgoing/Data/ServerChannelData.cs +++ b/Wonderking/Packets/Outgoing/Data/ServerChannelData.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Timothy Schenk. Subject to the GNU AGPL Version 3 License. +// Licensed to Timothy Schenk under the GNU AGPL Version 3 License. using System.Runtime.InteropServices; diff --git a/Wonderking/Packets/Outgoing/LoginResponsePacket.cs b/Wonderking/Packets/Outgoing/LoginResponsePacket.cs index 98870f2..6cadb5e 100644 --- a/Wonderking/Packets/Outgoing/LoginResponsePacket.cs +++ b/Wonderking/Packets/Outgoing/LoginResponsePacket.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Timothy Schenk. Subject to the GNU AGPL Version 3 License. +// Licensed to Timothy Schenk under the GNU AGPL Version 3 License. using System.Buffers.Binary; using Rai.PacketMediator; @@ -14,6 +14,7 @@ public class LoginResponsePacket : IOutgoingPacket public required bool IsGameMaster { get; set; } public required ServerChannelData[] ChannelData { get; set; } + public byte[] Serialize() { const int sizeOfServerChannelData = 5; diff --git a/Wonderking/Packets/WonderkingPacketIdAttribute.cs b/Wonderking/Packets/WonderkingPacketIdAttribute.cs index dfb4709..ad02682 100644 --- a/Wonderking/Packets/WonderkingPacketIdAttribute.cs +++ b/Wonderking/Packets/WonderkingPacketIdAttribute.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Timothy Schenk. Subject to the GNU AGPL Version 3 License. +// Licensed to Timothy Schenk under the GNU AGPL Version 3 License. using Rai.PacketMediator; diff --git a/Wonderking/Utils/ByteArrayConverter.cs b/Wonderking/Utils/ByteArrayConverter.cs index 8c7ff5e..c5b69ed 100644 --- a/Wonderking/Utils/ByteArrayConverter.cs +++ b/Wonderking/Utils/ByteArrayConverter.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Timothy Schenk. Subject to the GNU AGPL Version 3 License. +// Licensed to Timothy Schenk under the GNU AGPL Version 3 License. using System.Text.Json; using System.Text.Json.Serialization; diff --git a/Wonderking/Wonderking.csproj b/Wonderking/Wonderking.csproj index 3f9e136..128c281 100644 --- a/Wonderking/Wonderking.csproj +++ b/Wonderking/Wonderking.csproj @@ -22,7 +22,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive @@ -42,6 +42,6 @@ - +