diff --git a/.editorconfig b/.editorconfig deleted file mode 100644 index f9e0819..0000000 --- a/.editorconfig +++ /dev/null @@ -1,79 +0,0 @@ -[*.{cs,vb}] - -# IDE0049: Simplify Names -dotnet_style_predefined_type_for_locals_parameters_members = false -dotnet_style_operator_placement_when_wrapping = beginning_of_line -tab_width = 4 -indent_size = 4 -end_of_line = crlf -dotnet_style_coalesce_expression = true:suggestion -dotnet_style_null_propagation = true:suggestion -dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion -dotnet_style_prefer_auto_properties = true:silent -dotnet_style_object_initializer = true:suggestion -dotnet_style_collection_initializer = true:suggestion - -[*.cs] -csharp_indent_labels = one_less_than_current -csharp_space_around_binary_operators = before_and_after -csharp_using_directive_placement = outside_namespace:silent -csharp_prefer_simple_using_statement = true:suggestion -csharp_prefer_braces = true:silent -csharp_style_namespace_declarations = block_scoped:silent -csharp_style_prefer_method_group_conversion = true:silent -csharp_style_prefer_top_level_statements = true:silent -csharp_style_expression_bodied_methods = false:silent -csharp_style_expression_bodied_constructors = false:silent -csharp_style_expression_bodied_operators = false:silent -csharp_style_expression_bodied_properties = true:silent -csharp_style_expression_bodied_indexers = true:silent -csharp_style_expression_bodied_accessors = true:silent -csharp_style_expression_bodied_lambdas = true:silent -csharp_style_expression_bodied_local_functions = false:silent -[*.{cs,vb}] -#### Naming styles #### - -# Naming rules - -dotnet_naming_rule.interface_should_be_begins_with_i.severity = suggestion -dotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface -dotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i - -dotnet_naming_rule.types_should_be_pascal_case.severity = suggestion -dotnet_naming_rule.types_should_be_pascal_case.symbols = types -dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case - -dotnet_naming_rule.non_field_members_should_be_pascal_case.severity = suggestion -dotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members -dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case - -# Symbol specifications - -dotnet_naming_symbols.interface.applicable_kinds = interface -dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected -dotnet_naming_symbols.interface.required_modifiers = - -dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum -dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected -dotnet_naming_symbols.types.required_modifiers = - -dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method -dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected -dotnet_naming_symbols.non_field_members.required_modifiers = - -# Naming styles - -dotnet_naming_style.begins_with_i.required_prefix = I -dotnet_naming_style.begins_with_i.required_suffix = -dotnet_naming_style.begins_with_i.word_separator = -dotnet_naming_style.begins_with_i.capitalization = pascal_case - -dotnet_naming_style.pascal_case.required_prefix = -dotnet_naming_style.pascal_case.required_suffix = -dotnet_naming_style.pascal_case.word_separator = -dotnet_naming_style.pascal_case.capitalization = pascal_case - -dotnet_naming_style.pascal_case.required_prefix = -dotnet_naming_style.pascal_case.required_suffix = -dotnet_naming_style.pascal_case.word_separator = -dotnet_naming_style.pascal_case.capitalization = pascal_case diff --git a/.github/workflows/ctest.yml b/.github/workflows/ctest.yml new file mode 100644 index 0000000..15d2d94 --- /dev/null +++ b/.github/workflows/ctest.yml @@ -0,0 +1,108 @@ +# This starter workflow is for a CMake project running on multiple platforms. There is a different starter workflow if you just want a single platform. +# See: https://github.com/actions/starter-workflows/blob/main/ci/cmake-single-platform.yml +name: CTest on multiple platforms + +on: + workflow_dispatch: + push: + branches: [ "master", "api-v2", "asio" ] + paths: + - '**.cpp' + - '**.h' + - '**.hpp' + - '**.c' + - '**/CMakeLists.txt' + pull_request: + branches: [ "master", "api-v2", "asio" ] + paths: + - '**.cpp' + - '**.h' + - '**.hpp' + - '**.c' + - '**/CMakeLists.txt' + +jobs: + build: + runs-on: ${{ matrix.os }} + + strategy: + # Set fail-fast to false to ensure that feedback is delivered for all matrix combinations. Consider changing this to true when your workflow is stable. + fail-fast: false + + # Set up a matrix to run the following 3 configurations: + # 1. + # 2. + # 3. + # + # To add more build types (Release, Debug, RelWithDebInfo, etc.) customize the build_type list. + matrix: + os: [ubuntu-latest, windows-latest] + build_type: [Release] + c_compiler: [gcc, cl] + include: + - os: windows-latest + c_compiler: cl + cpp_compiler: cl + - os: ubuntu-latest + c_compiler: gcc + cpp_compiler: g++ + exclude: + - os: windows-latest + c_compiler: gcc + - os: ubuntu-latest + c_compiler: cl + + steps: + - uses: actions/checkout@v3 + + - name: Install vcpkg + # Install vcpkg to a known location + run: git clone https://github.com/microsoft/vcpkg.git ${{ github.workspace }}/vcpkg + + - name: Bootstrap vcpkg linux + # Bootstrap vcpkg using the appropriate triplet for the current runner operating system + if: matrix.os == 'ubuntu-latest' + run: ${{ github.workspace }}/vcpkg/bootstrap-vcpkg.sh -disableMetrics + + - name: Bootstrap vcpkg windows + # Bootstrap vcpkg using the appropriate triplet for the current runner operating system + if: matrix.os == 'windows-latest' + run: ${{ github.workspace }}/vcpkg/bootstrap-vcpkg.bat -disableMetrics + + - name: Install asio and gtest linux + # Install dependencies using the appropriate triplet for the current runner operating system + run: ${{ github.workspace }}/vcpkg/vcpkg install asio:x64-linux gtest:x64-linux + if: matrix.os == 'ubuntu-latest' + + - name: Install asio and gtest windows + # Install dependencies using the appropriate triplet for the current runner operating system + run: ${{ github.workspace }}/vcpkg/vcpkg install asio:x64-windows gtest:x64-windows + if: matrix.os == 'windows-latest' + + - name: Set reusable strings + # Turn repeated input strings (such as the build output directory) into step outputs. These step outputs can be used throughout the workflow file. + id: strings + shell: bash + run: | + echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT" + + - name: Configure CMake + # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. + # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type + run: > + cmake -B ${{ steps.strings.outputs.build-output-dir }} + -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} + -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} + -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} + -DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake + -S ${{ github.workspace }} + + - name: Build + # Build your program with the given configuration. Note that --config is needed because the default Windows generator is a multi-config generator (Visual Studio generator). + run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }} + + - name: Test + working-directory: ${{ steps.strings.outputs.build-output-dir }} + # Execute tests defined by the CMake configuration. Note that --build-config is needed because the default Windows generator is a multi-config generator (Visual Studio generator). + # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail + run: ctest --build-config --rerun-failed --output-on-failure --exclude-regex integration* ${{ matrix.build_type }} diff --git a/.github/workflows/doxygen.yml b/.github/workflows/doxygen.yml new file mode 100644 index 0000000..64ae3c4 --- /dev/null +++ b/.github/workflows/doxygen.yml @@ -0,0 +1,52 @@ +on: + workflow_dispatch: + push: + branches: [ "master", "api-v2", "asio" ] + paths: + - '**.h' + - '**.md' + - '**doxygen.yml' + - '**doxyfile' + pull_request: + branches: [ "master", "api-v2", "asio" ] + paths: + - '**.h' + - '**.md' + - '**doxygen.yml' + - '**doxyfile' + +name: Build doxygen documentation +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Install Doxygen and Dot + run: sudo apt install doxygen graphviz + + - name: Run doxygen + run: doxygen doxyfile + + - name: Upload artifact + uses: actions/upload-pages-artifact@v2 + with: + path: docs/html + + deploy: + runs-on: ubuntu-latest + needs: + - build + + permissions: + pages: write + id-token: write + + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + + steps: + - name: Deploy to Github Pages + id: deployment + uses: actions/deploy-pages@v2 diff --git a/.gitignore b/.gitignore index b10ac88..fdc1059 100644 --- a/.gitignore +++ b/.gitignore @@ -3,12 +3,15 @@ ## ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore +docs + # User-specific files *.rsuser *.suo *.user *.userosscache *.sln.docstates +CMakeSettings.json # User-specific files (MonoDevelop/Xamarin Studio) *.userprefs diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..57e5729 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,21 @@ +cmake_minimum_required(VERSION 3.15) + +project(Pine) + +set(CMAKE_CXX_STANDARD 20) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + +enable_testing() + +find_package(asio CONFIG REQUIRED) +find_package(GTest CONFIG REQUIRED) + +if (WIN32) + add_definitions(-D_WIN32_WINNT=0x0A00) +endif() + +add_subdirectory(client) +add_subdirectory(examples) +add_subdirectory(shared) +add_subdirectory(server) +add_subdirectory(tests) \ No newline at end of file diff --git a/Pine.sln b/Pine.sln deleted file mode 100644 index 18cc104..0000000 --- a/Pine.sln +++ /dev/null @@ -1,195 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.4.32916.344 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{3BA13E00-8ADB-43C3-B9D3-5A4E7AE49C67}" - ProjectSection(SolutionItems) = preProject - .editorconfig = .editorconfig - .gitattributes = .gitattributes - .gitignore = .gitignore - LICENSE.txt = LICENSE.txt - README.md = README.md - specs.md = specs.md - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Server", "Server\Server.vcxproj", "{F11A6291-405C-4A94-AB56-F0027FDD4B4D}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Pine", "Pine\Pine.csproj", "{4A7FBB45-D550-4AED-9850-82EC1FB1AB1F}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Shared", "Shared\Shared.vcxproj", "{FFA917E0-C449-48C7-BDF3-9877CBD96B46}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ServerUnitTest", "ServerUnitTest\ServerUnitTest.vcxproj", "{B53D4CAB-38CB-4597-AF97-D37FCCDD5D14}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|ARM = Debug|ARM - Debug|arm64 = Debug|arm64 - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - MinSizeRel|ARM = MinSizeRel|ARM - MinSizeRel|arm64 = MinSizeRel|arm64 - MinSizeRel|x64 = MinSizeRel|x64 - MinSizeRel|x86 = MinSizeRel|x86 - Release|ARM = Release|ARM - Release|arm64 = Release|arm64 - Release|x64 = Release|x64 - Release|x86 = Release|x86 - RelWithDebInfo|ARM = RelWithDebInfo|ARM - RelWithDebInfo|arm64 = RelWithDebInfo|arm64 - RelWithDebInfo|x64 = RelWithDebInfo|x64 - RelWithDebInfo|x86 = RelWithDebInfo|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {F11A6291-405C-4A94-AB56-F0027FDD4B4D}.Debug|ARM.ActiveCfg = Debug|x64 - {F11A6291-405C-4A94-AB56-F0027FDD4B4D}.Debug|ARM.Build.0 = Debug|x64 - {F11A6291-405C-4A94-AB56-F0027FDD4B4D}.Debug|arm64.ActiveCfg = Debug|x64 - {F11A6291-405C-4A94-AB56-F0027FDD4B4D}.Debug|arm64.Build.0 = Debug|x64 - {F11A6291-405C-4A94-AB56-F0027FDD4B4D}.Debug|x64.ActiveCfg = Debug|x64 - {F11A6291-405C-4A94-AB56-F0027FDD4B4D}.Debug|x64.Build.0 = Debug|x64 - {F11A6291-405C-4A94-AB56-F0027FDD4B4D}.Debug|x86.ActiveCfg = Debug|Win32 - {F11A6291-405C-4A94-AB56-F0027FDD4B4D}.Debug|x86.Build.0 = Debug|Win32 - {F11A6291-405C-4A94-AB56-F0027FDD4B4D}.MinSizeRel|ARM.ActiveCfg = Release|x64 - {F11A6291-405C-4A94-AB56-F0027FDD4B4D}.MinSizeRel|ARM.Build.0 = Release|x64 - {F11A6291-405C-4A94-AB56-F0027FDD4B4D}.MinSizeRel|arm64.ActiveCfg = Debug|x64 - {F11A6291-405C-4A94-AB56-F0027FDD4B4D}.MinSizeRel|arm64.Build.0 = Debug|x64 - {F11A6291-405C-4A94-AB56-F0027FDD4B4D}.MinSizeRel|x64.ActiveCfg = Debug|x64 - {F11A6291-405C-4A94-AB56-F0027FDD4B4D}.MinSizeRel|x64.Build.0 = Debug|x64 - {F11A6291-405C-4A94-AB56-F0027FDD4B4D}.MinSizeRel|x86.ActiveCfg = Debug|Win32 - {F11A6291-405C-4A94-AB56-F0027FDD4B4D}.MinSizeRel|x86.Build.0 = Debug|Win32 - {F11A6291-405C-4A94-AB56-F0027FDD4B4D}.Release|ARM.ActiveCfg = Release|x64 - {F11A6291-405C-4A94-AB56-F0027FDD4B4D}.Release|ARM.Build.0 = Release|x64 - {F11A6291-405C-4A94-AB56-F0027FDD4B4D}.Release|arm64.ActiveCfg = Release|x64 - {F11A6291-405C-4A94-AB56-F0027FDD4B4D}.Release|arm64.Build.0 = Release|x64 - {F11A6291-405C-4A94-AB56-F0027FDD4B4D}.Release|x64.ActiveCfg = Release|x64 - {F11A6291-405C-4A94-AB56-F0027FDD4B4D}.Release|x64.Build.0 = Release|x64 - {F11A6291-405C-4A94-AB56-F0027FDD4B4D}.Release|x86.ActiveCfg = Release|Win32 - {F11A6291-405C-4A94-AB56-F0027FDD4B4D}.Release|x86.Build.0 = Release|Win32 - {F11A6291-405C-4A94-AB56-F0027FDD4B4D}.RelWithDebInfo|ARM.ActiveCfg = Release|x64 - {F11A6291-405C-4A94-AB56-F0027FDD4B4D}.RelWithDebInfo|ARM.Build.0 = Release|x64 - {F11A6291-405C-4A94-AB56-F0027FDD4B4D}.RelWithDebInfo|arm64.ActiveCfg = Release|x64 - {F11A6291-405C-4A94-AB56-F0027FDD4B4D}.RelWithDebInfo|arm64.Build.0 = Release|x64 - {F11A6291-405C-4A94-AB56-F0027FDD4B4D}.RelWithDebInfo|x64.ActiveCfg = Release|x64 - {F11A6291-405C-4A94-AB56-F0027FDD4B4D}.RelWithDebInfo|x64.Build.0 = Release|x64 - {F11A6291-405C-4A94-AB56-F0027FDD4B4D}.RelWithDebInfo|x86.ActiveCfg = Release|Win32 - {F11A6291-405C-4A94-AB56-F0027FDD4B4D}.RelWithDebInfo|x86.Build.0 = Release|Win32 - {4A7FBB45-D550-4AED-9850-82EC1FB1AB1F}.Debug|ARM.ActiveCfg = Debug|x64 - {4A7FBB45-D550-4AED-9850-82EC1FB1AB1F}.Debug|ARM.Build.0 = Debug|x64 - {4A7FBB45-D550-4AED-9850-82EC1FB1AB1F}.Debug|ARM.Deploy.0 = Debug|x64 - {4A7FBB45-D550-4AED-9850-82EC1FB1AB1F}.Debug|arm64.ActiveCfg = Debug|ARM64 - {4A7FBB45-D550-4AED-9850-82EC1FB1AB1F}.Debug|arm64.Build.0 = Debug|ARM64 - {4A7FBB45-D550-4AED-9850-82EC1FB1AB1F}.Debug|arm64.Deploy.0 = Debug|ARM64 - {4A7FBB45-D550-4AED-9850-82EC1FB1AB1F}.Debug|x64.ActiveCfg = Debug|x64 - {4A7FBB45-D550-4AED-9850-82EC1FB1AB1F}.Debug|x64.Build.0 = Debug|x64 - {4A7FBB45-D550-4AED-9850-82EC1FB1AB1F}.Debug|x64.Deploy.0 = Debug|x64 - {4A7FBB45-D550-4AED-9850-82EC1FB1AB1F}.Debug|x86.ActiveCfg = Debug|x86 - {4A7FBB45-D550-4AED-9850-82EC1FB1AB1F}.Debug|x86.Build.0 = Debug|x86 - {4A7FBB45-D550-4AED-9850-82EC1FB1AB1F}.Debug|x86.Deploy.0 = Debug|x86 - {4A7FBB45-D550-4AED-9850-82EC1FB1AB1F}.MinSizeRel|ARM.ActiveCfg = Debug|x64 - {4A7FBB45-D550-4AED-9850-82EC1FB1AB1F}.MinSizeRel|ARM.Build.0 = Debug|x64 - {4A7FBB45-D550-4AED-9850-82EC1FB1AB1F}.MinSizeRel|ARM.Deploy.0 = Debug|x64 - {4A7FBB45-D550-4AED-9850-82EC1FB1AB1F}.MinSizeRel|arm64.ActiveCfg = Debug|ARM64 - {4A7FBB45-D550-4AED-9850-82EC1FB1AB1F}.MinSizeRel|arm64.Build.0 = Debug|ARM64 - {4A7FBB45-D550-4AED-9850-82EC1FB1AB1F}.MinSizeRel|arm64.Deploy.0 = Debug|ARM64 - {4A7FBB45-D550-4AED-9850-82EC1FB1AB1F}.MinSizeRel|x64.ActiveCfg = Debug|x64 - {4A7FBB45-D550-4AED-9850-82EC1FB1AB1F}.MinSizeRel|x64.Build.0 = Debug|x64 - {4A7FBB45-D550-4AED-9850-82EC1FB1AB1F}.MinSizeRel|x64.Deploy.0 = Debug|x64 - {4A7FBB45-D550-4AED-9850-82EC1FB1AB1F}.MinSizeRel|x86.ActiveCfg = Debug|x86 - {4A7FBB45-D550-4AED-9850-82EC1FB1AB1F}.MinSizeRel|x86.Build.0 = Debug|x86 - {4A7FBB45-D550-4AED-9850-82EC1FB1AB1F}.MinSizeRel|x86.Deploy.0 = Debug|x86 - {4A7FBB45-D550-4AED-9850-82EC1FB1AB1F}.Release|ARM.ActiveCfg = Release|x64 - {4A7FBB45-D550-4AED-9850-82EC1FB1AB1F}.Release|ARM.Build.0 = Release|x64 - {4A7FBB45-D550-4AED-9850-82EC1FB1AB1F}.Release|ARM.Deploy.0 = Release|x64 - {4A7FBB45-D550-4AED-9850-82EC1FB1AB1F}.Release|arm64.ActiveCfg = Release|ARM64 - {4A7FBB45-D550-4AED-9850-82EC1FB1AB1F}.Release|arm64.Build.0 = Release|ARM64 - {4A7FBB45-D550-4AED-9850-82EC1FB1AB1F}.Release|arm64.Deploy.0 = Release|ARM64 - {4A7FBB45-D550-4AED-9850-82EC1FB1AB1F}.Release|x64.ActiveCfg = Release|x64 - {4A7FBB45-D550-4AED-9850-82EC1FB1AB1F}.Release|x64.Build.0 = Release|x64 - {4A7FBB45-D550-4AED-9850-82EC1FB1AB1F}.Release|x64.Deploy.0 = Release|x64 - {4A7FBB45-D550-4AED-9850-82EC1FB1AB1F}.Release|x86.ActiveCfg = Release|x86 - {4A7FBB45-D550-4AED-9850-82EC1FB1AB1F}.Release|x86.Build.0 = Release|x86 - {4A7FBB45-D550-4AED-9850-82EC1FB1AB1F}.Release|x86.Deploy.0 = Release|x86 - {4A7FBB45-D550-4AED-9850-82EC1FB1AB1F}.RelWithDebInfo|ARM.ActiveCfg = Release|x64 - {4A7FBB45-D550-4AED-9850-82EC1FB1AB1F}.RelWithDebInfo|ARM.Build.0 = Release|x64 - {4A7FBB45-D550-4AED-9850-82EC1FB1AB1F}.RelWithDebInfo|ARM.Deploy.0 = Release|x64 - {4A7FBB45-D550-4AED-9850-82EC1FB1AB1F}.RelWithDebInfo|arm64.ActiveCfg = Release|ARM64 - {4A7FBB45-D550-4AED-9850-82EC1FB1AB1F}.RelWithDebInfo|arm64.Build.0 = Release|ARM64 - {4A7FBB45-D550-4AED-9850-82EC1FB1AB1F}.RelWithDebInfo|arm64.Deploy.0 = Release|ARM64 - {4A7FBB45-D550-4AED-9850-82EC1FB1AB1F}.RelWithDebInfo|x64.ActiveCfg = Release|x64 - {4A7FBB45-D550-4AED-9850-82EC1FB1AB1F}.RelWithDebInfo|x64.Build.0 = Release|x64 - {4A7FBB45-D550-4AED-9850-82EC1FB1AB1F}.RelWithDebInfo|x64.Deploy.0 = Release|x64 - {4A7FBB45-D550-4AED-9850-82EC1FB1AB1F}.RelWithDebInfo|x86.ActiveCfg = Release|x86 - {4A7FBB45-D550-4AED-9850-82EC1FB1AB1F}.RelWithDebInfo|x86.Build.0 = Release|x86 - {4A7FBB45-D550-4AED-9850-82EC1FB1AB1F}.RelWithDebInfo|x86.Deploy.0 = Release|x86 - {FFA917E0-C449-48C7-BDF3-9877CBD96B46}.Debug|ARM.ActiveCfg = Debug|x64 - {FFA917E0-C449-48C7-BDF3-9877CBD96B46}.Debug|ARM.Build.0 = Debug|x64 - {FFA917E0-C449-48C7-BDF3-9877CBD96B46}.Debug|arm64.ActiveCfg = Debug|x64 - {FFA917E0-C449-48C7-BDF3-9877CBD96B46}.Debug|arm64.Build.0 = Debug|x64 - {FFA917E0-C449-48C7-BDF3-9877CBD96B46}.Debug|x64.ActiveCfg = Debug|x64 - {FFA917E0-C449-48C7-BDF3-9877CBD96B46}.Debug|x64.Build.0 = Debug|x64 - {FFA917E0-C449-48C7-BDF3-9877CBD96B46}.Debug|x86.ActiveCfg = Debug|Win32 - {FFA917E0-C449-48C7-BDF3-9877CBD96B46}.Debug|x86.Build.0 = Debug|Win32 - {FFA917E0-C449-48C7-BDF3-9877CBD96B46}.MinSizeRel|ARM.ActiveCfg = Debug|x64 - {FFA917E0-C449-48C7-BDF3-9877CBD96B46}.MinSizeRel|ARM.Build.0 = Debug|x64 - {FFA917E0-C449-48C7-BDF3-9877CBD96B46}.MinSizeRel|arm64.ActiveCfg = Debug|x64 - {FFA917E0-C449-48C7-BDF3-9877CBD96B46}.MinSizeRel|arm64.Build.0 = Debug|x64 - {FFA917E0-C449-48C7-BDF3-9877CBD96B46}.MinSizeRel|x64.ActiveCfg = Debug|x64 - {FFA917E0-C449-48C7-BDF3-9877CBD96B46}.MinSizeRel|x64.Build.0 = Debug|x64 - {FFA917E0-C449-48C7-BDF3-9877CBD96B46}.MinSizeRel|x86.ActiveCfg = Debug|Win32 - {FFA917E0-C449-48C7-BDF3-9877CBD96B46}.MinSizeRel|x86.Build.0 = Debug|Win32 - {FFA917E0-C449-48C7-BDF3-9877CBD96B46}.Release|ARM.ActiveCfg = Release|x64 - {FFA917E0-C449-48C7-BDF3-9877CBD96B46}.Release|ARM.Build.0 = Release|x64 - {FFA917E0-C449-48C7-BDF3-9877CBD96B46}.Release|arm64.ActiveCfg = Release|x64 - {FFA917E0-C449-48C7-BDF3-9877CBD96B46}.Release|arm64.Build.0 = Release|x64 - {FFA917E0-C449-48C7-BDF3-9877CBD96B46}.Release|x64.ActiveCfg = Release|x64 - {FFA917E0-C449-48C7-BDF3-9877CBD96B46}.Release|x64.Build.0 = Release|x64 - {FFA917E0-C449-48C7-BDF3-9877CBD96B46}.Release|x86.ActiveCfg = Release|Win32 - {FFA917E0-C449-48C7-BDF3-9877CBD96B46}.Release|x86.Build.0 = Release|Win32 - {FFA917E0-C449-48C7-BDF3-9877CBD96B46}.RelWithDebInfo|ARM.ActiveCfg = Release|x64 - {FFA917E0-C449-48C7-BDF3-9877CBD96B46}.RelWithDebInfo|ARM.Build.0 = Release|x64 - {FFA917E0-C449-48C7-BDF3-9877CBD96B46}.RelWithDebInfo|arm64.ActiveCfg = Release|x64 - {FFA917E0-C449-48C7-BDF3-9877CBD96B46}.RelWithDebInfo|arm64.Build.0 = Release|x64 - {FFA917E0-C449-48C7-BDF3-9877CBD96B46}.RelWithDebInfo|x64.ActiveCfg = Release|x64 - {FFA917E0-C449-48C7-BDF3-9877CBD96B46}.RelWithDebInfo|x64.Build.0 = Release|x64 - {FFA917E0-C449-48C7-BDF3-9877CBD96B46}.RelWithDebInfo|x86.ActiveCfg = Release|Win32 - {FFA917E0-C449-48C7-BDF3-9877CBD96B46}.RelWithDebInfo|x86.Build.0 = Release|Win32 - {B53D4CAB-38CB-4597-AF97-D37FCCDD5D14}.Debug|ARM.ActiveCfg = Debug|x64 - {B53D4CAB-38CB-4597-AF97-D37FCCDD5D14}.Debug|ARM.Build.0 = Debug|x64 - {B53D4CAB-38CB-4597-AF97-D37FCCDD5D14}.Debug|arm64.ActiveCfg = Debug|x64 - {B53D4CAB-38CB-4597-AF97-D37FCCDD5D14}.Debug|arm64.Build.0 = Debug|x64 - {B53D4CAB-38CB-4597-AF97-D37FCCDD5D14}.Debug|x64.ActiveCfg = Debug|x64 - {B53D4CAB-38CB-4597-AF97-D37FCCDD5D14}.Debug|x64.Build.0 = Debug|x64 - {B53D4CAB-38CB-4597-AF97-D37FCCDD5D14}.Debug|x86.ActiveCfg = Debug|Win32 - {B53D4CAB-38CB-4597-AF97-D37FCCDD5D14}.Debug|x86.Build.0 = Debug|Win32 - {B53D4CAB-38CB-4597-AF97-D37FCCDD5D14}.MinSizeRel|ARM.ActiveCfg = Debug|x64 - {B53D4CAB-38CB-4597-AF97-D37FCCDD5D14}.MinSizeRel|ARM.Build.0 = Debug|x64 - {B53D4CAB-38CB-4597-AF97-D37FCCDD5D14}.MinSizeRel|arm64.ActiveCfg = Debug|x64 - {B53D4CAB-38CB-4597-AF97-D37FCCDD5D14}.MinSizeRel|arm64.Build.0 = Debug|x64 - {B53D4CAB-38CB-4597-AF97-D37FCCDD5D14}.MinSizeRel|x64.ActiveCfg = Debug|x64 - {B53D4CAB-38CB-4597-AF97-D37FCCDD5D14}.MinSizeRel|x64.Build.0 = Debug|x64 - {B53D4CAB-38CB-4597-AF97-D37FCCDD5D14}.MinSizeRel|x86.ActiveCfg = Debug|Win32 - {B53D4CAB-38CB-4597-AF97-D37FCCDD5D14}.MinSizeRel|x86.Build.0 = Debug|Win32 - {B53D4CAB-38CB-4597-AF97-D37FCCDD5D14}.Release|ARM.ActiveCfg = Release|x64 - {B53D4CAB-38CB-4597-AF97-D37FCCDD5D14}.Release|ARM.Build.0 = Release|x64 - {B53D4CAB-38CB-4597-AF97-D37FCCDD5D14}.Release|arm64.ActiveCfg = Release|x64 - {B53D4CAB-38CB-4597-AF97-D37FCCDD5D14}.Release|arm64.Build.0 = Release|x64 - {B53D4CAB-38CB-4597-AF97-D37FCCDD5D14}.Release|x64.ActiveCfg = Release|x64 - {B53D4CAB-38CB-4597-AF97-D37FCCDD5D14}.Release|x64.Build.0 = Release|x64 - {B53D4CAB-38CB-4597-AF97-D37FCCDD5D14}.Release|x86.ActiveCfg = Release|Win32 - {B53D4CAB-38CB-4597-AF97-D37FCCDD5D14}.Release|x86.Build.0 = Release|Win32 - {B53D4CAB-38CB-4597-AF97-D37FCCDD5D14}.RelWithDebInfo|ARM.ActiveCfg = Release|x64 - {B53D4CAB-38CB-4597-AF97-D37FCCDD5D14}.RelWithDebInfo|ARM.Build.0 = Release|x64 - {B53D4CAB-38CB-4597-AF97-D37FCCDD5D14}.RelWithDebInfo|arm64.ActiveCfg = Release|x64 - {B53D4CAB-38CB-4597-AF97-D37FCCDD5D14}.RelWithDebInfo|arm64.Build.0 = Release|x64 - {B53D4CAB-38CB-4597-AF97-D37FCCDD5D14}.RelWithDebInfo|x64.ActiveCfg = Release|x64 - {B53D4CAB-38CB-4597-AF97-D37FCCDD5D14}.RelWithDebInfo|x64.Build.0 = Release|x64 - {B53D4CAB-38CB-4597-AF97-D37FCCDD5D14}.RelWithDebInfo|x86.ActiveCfg = Release|Win32 - {B53D4CAB-38CB-4597-AF97-D37FCCDD5D14}.RelWithDebInfo|x86.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {F68D352A-0905-4C97-99C9-B1002AB5895B} - EndGlobalSection -EndGlobal diff --git a/Pine/App.xaml b/Pine/App.xaml deleted file mode 100644 index b5e8437..0000000 --- a/Pine/App.xaml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - diff --git a/Pine/App.xaml.cs b/Pine/App.xaml.cs deleted file mode 100644 index 7a06375..0000000 --- a/Pine/App.xaml.cs +++ /dev/null @@ -1,56 +0,0 @@ -using Microsoft.UI.Xaml; -using Microsoft.UI.Xaml.Controls; -using Microsoft.UI.Xaml.Controls.Primitives; -using Microsoft.UI.Xaml.Data; -using Microsoft.UI.Xaml.Input; -using Microsoft.UI.Xaml.Media; -using Microsoft.UI.Xaml.Navigation; -using Microsoft.UI.Xaml.Shapes; -using Pine.Client; -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Runtime.InteropServices.WindowsRuntime; -using Windows.ApplicationModel; -using Windows.ApplicationModel.Activation; -using Windows.Foundation; -using Windows.Foundation.Collections; - -// To learn more about WinUI, the WinUI project structure, -// and more about our project templates, see: http://aka.ms/winui-project-info. - -namespace Pine -{ - /// - /// Provides application-specific behavior to supplement the default Application class. - /// - public partial class App : Application - { - /// - /// Initializes the singleton application object. This is the first line of authored code - /// executed, and as such is the logical equivalent of main() or WinMain(). - /// - public App() - { - InitializeComponent(); - - PineClient = new PineClient(); - _ = PineClient.ConnectAsync("127.0.0.1", 45321); - } - - /// - /// Invoked when the application is launched. - /// - /// Details about the launch request and process. - protected override void OnLaunched(Microsoft.UI.Xaml.LaunchActivatedEventArgs args) - { - m_window = new MainWindow(); - m_window.Activate(); - } - - public static PineClient PineClient { get; private set; } - - private Window m_window; - } -} diff --git a/Pine/Assets/LockScreenLogo.scale-200.png b/Pine/Assets/LockScreenLogo.scale-200.png deleted file mode 100644 index 7440f0d..0000000 Binary files a/Pine/Assets/LockScreenLogo.scale-200.png and /dev/null differ diff --git a/Pine/Assets/SplashScreen.scale-200.png b/Pine/Assets/SplashScreen.scale-200.png deleted file mode 100644 index 32f486a..0000000 Binary files a/Pine/Assets/SplashScreen.scale-200.png and /dev/null differ diff --git a/Pine/Assets/Square150x150Logo.scale-200.png b/Pine/Assets/Square150x150Logo.scale-200.png deleted file mode 100644 index 53ee377..0000000 Binary files a/Pine/Assets/Square150x150Logo.scale-200.png and /dev/null differ diff --git a/Pine/Assets/Square44x44Logo.scale-200.png b/Pine/Assets/Square44x44Logo.scale-200.png deleted file mode 100644 index f713bba..0000000 Binary files a/Pine/Assets/Square44x44Logo.scale-200.png and /dev/null differ diff --git a/Pine/Assets/Square44x44Logo.targetsize-24_altform-unplated.png b/Pine/Assets/Square44x44Logo.targetsize-24_altform-unplated.png deleted file mode 100644 index dc9f5be..0000000 Binary files a/Pine/Assets/Square44x44Logo.targetsize-24_altform-unplated.png and /dev/null differ diff --git a/Pine/Assets/StoreLogo.png b/Pine/Assets/StoreLogo.png deleted file mode 100644 index a4586f2..0000000 Binary files a/Pine/Assets/StoreLogo.png and /dev/null differ diff --git a/Pine/Assets/Wide310x150Logo.scale-200.png b/Pine/Assets/Wide310x150Logo.scale-200.png deleted file mode 100644 index 8b4a5d0..0000000 Binary files a/Pine/Assets/Wide310x150Logo.scale-200.png and /dev/null differ diff --git a/Pine/Client/PineClient.cs b/Pine/Client/PineClient.cs deleted file mode 100644 index c74e541..0000000 --- a/Pine/Client/PineClient.cs +++ /dev/null @@ -1,136 +0,0 @@ -using Pine.SocketMessages; -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Linq; -using System.Net.Sockets; -using System.Text; -using System.Threading.Tasks; - -namespace Pine.Client -{ - public class PineClient - { - private readonly TcpClient tcpClient; - private NetworkStream stream; - - public PineClient() - { - tcpClient = new TcpClient(); - } - - ~PineClient() - { - tcpClient.Close(); - tcpClient.Dispose(); - } - - public async Task ConnectAsync(string host, int port) - { - try - { - await tcpClient.ConnectAsync(host, port); - - - if (tcpClient.Connected) - stream = tcpClient.GetStream(); - else - return false; - - await ValidateConnection(); - - if (!await CheckVersion()) - return false; - - OnConnected?.Invoke(this, tcpClient.Connected); - - return tcpClient.Connected; - - } - catch (SocketException e) - { - OnConnectionFailed?.Invoke(this, (Int32)e.SocketErrorCode); - - return false; - } - } - - public async Task ReceiveRawMessage(UInt64 size) - { - byte[] buffer = new byte[size]; - await stream.ReadAsync(buffer); - return buffer; - } - - public async Task SendRawMessage(byte[] buffer) - { - await tcpClient.Client.SendAsync(buffer, SocketFlags.None); - } - - public async Task ReceiveMessage() - { - Message message = new(); - - byte[] header = await ReceiveRawMessage(MessageHeader.Size); - MessageHeader messageHeader = new(header); - - if (messageHeader.Type == MessageType.Invalid) - return message; - - byte[] body = await ReceiveRawMessage(messageHeader.BodySize); - - if (messageHeader.Type == MessageType.Hello) - { - HelloMessage hello = new(); - - if (!hello.ParseBody(body)) - return message; - - message = hello; - } - else - return message; - - message.Header = messageHeader; - - return message; - } - - public async Task SendMessage(Message message) - { - await SendRawMessage(message.Serialize()); - } - - public async Task CheckVersion() - { - Message helloReceived = await ReceiveMessage(); - - if (helloReceived.Header.Type != MessageType.Hello) - return false; - - if (((HelloMessage)helloReceived).Version != HelloMessage.CURRENT_VERSION) - return false; - - HelloMessage hello = new() - { - Version = HelloMessage.CURRENT_VERSION - }; - - await SendRawMessage(hello.Serialize()); - - return true; - } - - public async Task ValidateConnection() - { - byte[] buffer = await ReceiveRawMessage(8); - - UInt64 key = BitConverter.ToUInt64(buffer) ^ 0xF007CAFEC0C0CA7E; - - await SendRawMessage(BitConverter.GetBytes(key)); - } - - public event EventHandler OnConnected; - public event EventHandler OnConnectionFailed; - } -} diff --git a/Pine/Package.appxmanifest b/Pine/Package.appxmanifest deleted file mode 100644 index 08438f6..0000000 --- a/Pine/Package.appxmanifest +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - - - - - Pine - Jacquwes - Assets\StoreLogo.png - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Pine/Pine.csproj b/Pine/Pine.csproj deleted file mode 100644 index 652e832..0000000 --- a/Pine/Pine.csproj +++ /dev/null @@ -1,80 +0,0 @@ - - - WinExe - net6.0-windows10.0.19041.0 - 10.0.17763.0 - Pine - app.manifest - x86;x64;ARM64 - win10-x86;win10-x64;win10-arm64 - win10-$(Platform).pubxml - true - true - fr-FR - F62AF7D470EBFA86DAAB336F44CF926A87B4DEEB - Pine_TemporaryKey.pfx - True - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - MSBuild:Compile - - - - - MSBuild:Compile - - - - - MSBuild:Compile - - - - - MSBuild:Compile - - - - - - true - - diff --git a/Pine/Properties/launchSettings.json b/Pine/Properties/launchSettings.json deleted file mode 100644 index c26d684..0000000 --- a/Pine/Properties/launchSettings.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "profiles": { - "Pine (Package)": { - "commandName": "MsixPackage" - }, - "Pine (Unpackaged)": { - "commandName": "Project" - } - } -} \ No newline at end of file diff --git a/Pine/SocketMessages/HelloMessage.cs b/Pine/SocketMessages/HelloMessage.cs deleted file mode 100644 index cf0c90f..0000000 --- a/Pine/SocketMessages/HelloMessage.cs +++ /dev/null @@ -1,42 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reflection; -using System.Text; -using System.Threading.Tasks; - -namespace Pine.SocketMessages -{ - public class HelloMessage : Message - { - public static readonly UInt64 CURRENT_VERSION = 0x0; - - public HelloMessage() - { - Header.Type = MessageType.Hello; - Header.BodySize = Size; - } - - public override bool ParseBody(byte[] buffer) - { - if ((UInt64)buffer.LongLength != Size) - return false; - - Version = BitConverter.ToUInt64(buffer, 0); - return true; - } - - public override byte[] Serialize() - { - byte[] buffer = Array.Empty(); - buffer = buffer.Concat(Header.Serialize()).ToArray(); - - buffer = buffer.Concat(BitConverter.GetBytes(Version)).ToArray(); - - return buffer; - } - - public static readonly UInt64 Size = sizeof(UInt64); - public UInt64 Version { get; set; } = 0; - } -} diff --git a/Pine/SocketMessages/LoginMessage.cs b/Pine/SocketMessages/LoginMessage.cs deleted file mode 100644 index 3e75600..0000000 --- a/Pine/SocketMessages/LoginMessage.cs +++ /dev/null @@ -1,51 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reflection; -using System.Text; -using System.Threading.Tasks; - -namespace Pine.SocketMessages -{ - internal class LoginMessage : Message - { - public LoginMessage() - { - Header.Type = MessageType.Login; - Header.BodySize = Size; - } - - public override bool ParseBody(byte[] buffer) - { - if ((UInt64)buffer.LongLength != Size) - return false; - - Username = Encoding.ASCII.GetString(buffer); - return true; - } - - public override byte[] Serialize() - { - byte[] buffer = Array.Empty(); - buffer = buffer.Concat(Header.Serialize()).ToArray(); - - buffer = buffer.Concat(Encoding.ASCII.GetBytes(Username)).ToArray(); - Array.Resize(ref buffer, (int)MessageHeader.Size + (int)Size); - - return buffer; - } - - public bool SetUsername(string username) - { - if (username.Length > UsernameMaxLength) - return false; - Username = username; - return true; - } - - public static readonly int UsernameMaxLength = 0x20; - - public string Username { get; private set; } = new('\0', UsernameMaxLength); - public static readonly UInt64 Size = (UInt64)UsernameMaxLength; - } -} diff --git a/Pine/SocketMessages/Message.cs b/Pine/SocketMessages/Message.cs deleted file mode 100644 index e99bef2..0000000 --- a/Pine/SocketMessages/Message.cs +++ /dev/null @@ -1,82 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Pine.SocketMessages -{ - public enum MessageType : byte - { - Invalid, - Hello, - Login - } - - public class MessageHeader - { - public MessageHeader() - { - Type = MessageType.Invalid; - } - - public MessageHeader(byte[] buffer) - { - Parse(buffer); - } - - public void Parse(byte[] buffer) - { - BodySize = BitConverter.ToUInt64(buffer, 1); - - byte messageType = buffer[0]; - switch (messageType) - { - case (byte)MessageType.Hello: - Type = MessageType.Hello; - if (BodySize != HelloMessage.Size) - Type = MessageType.Invalid; - break; - case (byte)MessageType.Login: - Type = MessageType.Login; - break; - default: - Type = MessageType.Invalid; - break; - } - } - - public byte[] Serialize() - { - byte[] buffer = new byte[9]; - buffer[0] = (byte)Type; - Array.Copy(BitConverter.GetBytes(BodySize), 0, buffer, 1, 8); - return buffer; - } - - public MessageType Type { get; set; } - public UInt64 BodySize { get; set; } - - public static readonly UInt64 Size = sizeof(MessageType) + sizeof(UInt64); - } - - public class Message - { - public MessageHeader Header { get; set; } - - public Message() - { - Header = new(); - } - - public virtual bool ParseBody(byte[] buffer) - { - return false; - } - - public virtual byte[] Serialize() - { - return new byte[9]; - } - } -} diff --git a/Pine/Views/Identify/IdentifyControl.xaml b/Pine/Views/Identify/IdentifyControl.xaml deleted file mode 100644 index 2db5c03..0000000 --- a/Pine/Views/Identify/IdentifyControl.xaml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - -