Skip to content

Commit

Permalink
GWCA Integration (#426)
Browse files Browse the repository at this point in the history
* GWCA integration
GWCAMemoryReader partial implementation

* Complete Daybreak.GWCA implementation
Fix metrics view
Upgrade dependencies

* Update version

* Add solution dir property

* Another try

* Fix version check

* Fix codeql pipeline

* Codeql fixes

* Fetch submodules

* Final codeql change
  • Loading branch information
AlexMacocian authored Oct 26, 2023
1 parent f3b8221 commit 7671e0c
Show file tree
Hide file tree
Showing 156 changed files with 39,453 additions and 73 deletions.
15 changes: 11 additions & 4 deletions .github/workflows/cd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,31 +57,38 @@ jobs:
- name: Setup MSBuild.exe
uses: microsoft/[email protected]

- name: Fetch submodules
run: |
git submodule update --init --recursive
- name: Build CMake Files
run: cmake -S . -B build -A Win32

- name: Setup project secrets
run: |
dotnet user-secrets --project Daybreak\Daybreak.csproj set AadApplicationId "${{ secrets.AadApplicationId }}"
dotnet user-secrets --project Daybreak\Daybreak.csproj set AadTenantId "${{ secrets.AadTenantId }}"
- name: Restore project
run: msbuild $env:Solution_Path /t:Restore /p:Configuration=$env:Configuration /p:RuntimeIdentifier=$env:RuntimeIdentifier
run: msbuild $env:Solution_Path /t:Restore /p:Configuration=$env:Configuration /p:RuntimeIdentifier=$env:RuntimeIdentifier --property:SolutionDir=$GITHUB_WORKSPACE
env:
RuntimeIdentifier: win-${{ matrix.targetplatform }}

- name: Build Daybreak project
run: dotnet build Daybreak -c $env:Configuration
run: dotnet build Daybreak -c $env:Configuration --property:SolutionDir=$env:GITHUB_WORKSPACE

- name: Set version variable
run: |
$version = .\Scripts\GetBuildVersion.ps1
echo "::set-env name=Version::$version"
- name: Create publish launcher files
run: dotnet publish .\Daybreak\Daybreak.csproj -c $env:Configuration -r $env:RuntimeIdentifier -p:PublishReadyToRun=true -p:PublishSingleFile=true --self-contained true -o .\Publish
run: dotnet publish .\Daybreak\Daybreak.csproj -c $env:Configuration -r $env:RuntimeIdentifier --property:SolutionDir=$env:GITHUB_WORKSPACE -p:PublishReadyToRun=true -p:PublishSingleFile=true --self-contained true -o .\Publish
env:
RuntimeIdentifier: win-${{ matrix.targetplatform }}

- name: Create publish installer files
run: dotnet publish .\Daybreak.Installer\Daybreak.Installer.csproj -c $env:Configuration -r $env:RuntimeIdentifier -p:PublishReadyToRun=true -p:PublishSingleFile=true --self-contained true -o .\Publish
run: dotnet publish .\Daybreak.Installer\Daybreak.Installer.csproj -c $env:Configuration -r $env:RuntimeIdentifier --property:SolutionDir=$env:GITHUB_WORKSPACE -p:PublishReadyToRun=true -p:PublishSingleFile=true --self-contained true -o .\Publish
env:
RuntimeIdentifier: win-${{ matrix.targetplatform }}

Expand Down
13 changes: 10 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,18 @@ jobs:
- name: Setup MSBuild.exe
uses: microsoft/[email protected]

- name: Execute Unit Tests
run: dotnet test $env:Test_Project_Path
- name: Fetch submodules
run: |
git submodule update --init --recursive
- name: Build CMake Files
run: cmake -S . -B build -A Win32

- name: Execute Unit Tests
run: dotnet test $env:Test_Project_Path --property:SolutionDir=$env:GITHUB_WORKSPACE

- name: Restore the Wpf application to populate the obj folder
run: msbuild $env:Solution_Path /t:Restore /p:Configuration=$env:Configuration /p:RuntimeIdentifier=$env:RuntimeIdentifier
run: msbuild $env:Solution_Path /t:Restore /p:Configuration=$env:Configuration /p:RuntimeIdentifier=$env:RuntimeIdentifier --property:SolutionDir=$env:GITHUB_WORKSPACE
env:
Configuration: Debug
RuntimeIdentifier: win-${{ matrix.targetplatform }}
22 changes: 19 additions & 3 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,22 @@ jobs:
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support

env:
Configuration: Release
Solution_Path: Daybreak.sln
Test_Project_Path: Daybreak.Tests\Daybreak.Tests.csproj
Wpf_Project_Path: Daybreak\Daybreak.csproj
Actions_Allow_Unsecure_Commands: true

steps:
- name: Checkout repository
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Fetch submodules
run: |
git submodule update --init --recursive
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
Expand All @@ -61,8 +74,8 @@ jobs:
with:
dotnet-version: '7.x'

- name: Autobuild
uses: github/codeql-action/autobuild@v2
#- name: Autobuild
# uses: github/codeql-action/autobuild@v2

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
Expand All @@ -74,5 +87,8 @@ jobs:
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh

- name: Build Daybreak project
run: dotnet build Daybreak -c $env:Configuration --property:SolutionDir=$env:GITHUB_WORKSPACE

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
9 changes: 8 additions & 1 deletion .github/workflows/version_check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,15 @@ jobs:
id: getLatestTag
uses: WyriHaximus/github-action-get-previous-tag@v1

- name: Fetch submodules
run: |
git submodule update --init --recursive
- name: Build CMake Files
run: cmake -S . -B build -A Win32

- name: Build Daybreak project
run: dotnet build Daybreak -c $env:Configuration
run: dotnet build Daybreak -c $env:Configuration --property:SolutionDir=$env:GITHUB_WORKSPACE

- name: Set version variable
run: |
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ x86/
[Aa][Rr][Mm]/
[Aa][Rr][Mm]64/
bld/
build/
[Bb]in/
[Oo]bj/
[Oo]ut/
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "GWCA"]
path = GWCA
url = https://github.com/GregLando113/GWCA
16 changes: 16 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# CMakeList.txt : Top-level CMake project file, do global configuration
# and include sub-projects here.
#
cmake_minimum_required (VERSION 3.8)

# Enable Hot Reload for MSVC compilers if supported.
if (POLICY CMP0141)
cmake_policy(SET CMP0141 NEW)
set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "$<IF:$<AND:$<C_COMPILER_ID:MSVC>,$<CXX_COMPILER_ID:MSVC>>,$<$<CONFIG:Debug,RelWithDebInfo>:EditAndContinue>,$<$<CONFIG:Debug,RelWithDebInfo>:ProgramDatabase>>")
endif()

project ("Daybreak")

# Include sub-projects.
add_subdirectory ("Daybreak.GWCA")
add_subdirectory ("GWCA")
61 changes: 61 additions & 0 deletions CMakePresets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
{
"version": 3,
"configurePresets": [
{
"name": "windows-base",
"hidden": true,
"generator": "Ninja",
"binaryDir": "${sourceDir}/build/${presetName}",
"installDir": "${sourceDir}/install/${presetName}",
"cacheVariables": {
"CMAKE_C_COMPILER": "cl.exe",
"CMAKE_CXX_COMPILER": "cl.exe"
},
"condition": {
"type": "equals",
"lhs": "${hostSystemName}",
"rhs": "Windows"
}
},
{
"name": "x64-debug",
"displayName": "x64 Debug",
"inherits": "windows-base",
"architecture": {
"value": "x64",
"strategy": "external"
},
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug"
}
},
{
"name": "x64-release",
"displayName": "x64 Release",
"inherits": "x64-debug",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release"
}
},
{
"name": "x86-debug",
"displayName": "x86 Debug",
"inherits": "windows-base",
"architecture": {
"value": "x86",
"strategy": "external"
},
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug"
}
},
{
"name": "x86-release",
"displayName": "x86 Release",
"inherits": "x86-debug",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release"
}
}
]
}
39 changes: 39 additions & 0 deletions Daybreak.GWCA/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# CMakeList.txt : CMake project for Daybreak.GWCA, include source and define
# project specific logic here.
#

project(Daybreak.GWCA)

if(CMAKE_SIZEOF_VOID_P EQUAL 8)
message(FATAL_ERROR "You are configuring a 64bit build, this is not supported. Run cmake with `-A Win32`")
endif()

set_property(GLOBAL PROPERTY USE_FOLDERS ON)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(Daybreak.GWCA_FOLDER "${CMAKE_CURRENT_LIST_DIR}/")
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake/")

add_library(Daybreak.GWCA SHARED)
file(GLOB SOURCES
"source/pch.h"
"source/*.cpp"
"source/*/*.cpp"
"header/*.h*"
"header/*/*.h")
source_group(TREE "${CMAKE_CURRENT_SOURCE_DIR}" FILES ${SOURCES})
target_sources(Daybreak.GWCA PRIVATE ${SOURCES})
target_compile_features(Daybreak.GWCA PUBLIC cxx_std_17)
target_compile_definitions(Daybreak.GWCA PRIVATE
$<$<CONFIG:Debug>:BUILD_TYPE_DEBUG>
$<$<CONFIG:Release>:BUILD_TYPE_RELEASE>
)

target_precompile_headers(Daybreak.GWCA PRIVATE "header/pch.h")
target_include_directories(Daybreak.GWCA PUBLIC "header")

target_link_libraries(Daybreak.GWCA PUBLIC
gwca
directx
minhook)
8 changes: 8 additions & 0 deletions Daybreak.GWCA/header/AliveModule.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#pragma once
#include "httplib.h"

namespace http {
namespace modules {
void HandleAlive(const httplib::Request&, httplib::Response& res);
}
}
6 changes: 6 additions & 0 deletions Daybreak.GWCA/header/GameModule.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#pragma once
#include "httplib.h"

namespace Daybreak::Modules::GameModule {
void GetGameInfo(const httplib::Request&, httplib::Response& res);
}
6 changes: 6 additions & 0 deletions Daybreak.GWCA/header/HttpLogger.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#pragma once
#include "httplib.h"

namespace http {
void ConsoleLogger(const httplib::Request req, httplib::Response res);
}
6 changes: 6 additions & 0 deletions Daybreak.GWCA/header/InventoryModule.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#pragma once
#include "httplib.h"

namespace Daybreak::Modules::InventoryModule {
void GetInventoryInfo(const httplib::Request&, httplib::Response& res);
}
6 changes: 6 additions & 0 deletions Daybreak.GWCA/header/LoginModule.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#pragma once
#include "httplib.h"

namespace Daybreak::Modules::LoginModule {
void GetLoginInfo(const httplib::Request&, httplib::Response& res);
}
6 changes: 6 additions & 0 deletions Daybreak.GWCA/header/MainPlayerModule.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#pragma once
#include "httplib.h"

namespace Daybreak::Modules::MainPlayerModule {
void GetMainPlayer(const httplib::Request&, httplib::Response& res);
}
6 changes: 6 additions & 0 deletions Daybreak.GWCA/header/MapModule.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#pragma once
#include "httplib.h"

namespace Daybreak::Modules::MapModule {
void GetMapInfo(const httplib::Request&, httplib::Response& res);
}
6 changes: 6 additions & 0 deletions Daybreak.GWCA/header/PathingMetadataModule.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#pragma once
#include "httplib.h"

namespace Daybreak::Modules::PathingMetadataModule {
void GetPathingMetadata(const httplib::Request&, httplib::Response& res);
}
6 changes: 6 additions & 0 deletions Daybreak.GWCA/header/PathingModule.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#pragma once
#include "httplib.h"

namespace Daybreak::Modules::PathingModule {
void GetPathingData(const httplib::Request&, httplib::Response& res);
}
6 changes: 6 additions & 0 deletions Daybreak.GWCA/header/PreGameModule.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#pragma once
#include "httplib.h"

namespace Daybreak::Modules::PreGameModule {
void GetPreGameInfo(const httplib::Request&, httplib::Response& res);
}
8 changes: 8 additions & 0 deletions Daybreak.GWCA/header/ProcessIdModule.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#pragma once
#include "httplib.h"

namespace http {
namespace modules {
void HandleProcessId(const httplib::Request&, httplib::Response& res);
}
}
11 changes: 11 additions & 0 deletions Daybreak.GWCA/header/Server.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#pragma once
#include "httplib.h"
#include "pch.h"

namespace http {
namespace server {
bool StartServer();
void SetLogger(httplib::Logger logger);
void Get(const std::string& pattern, httplib::Server::Handler handler);
}
}
6 changes: 6 additions & 0 deletions Daybreak.GWCA/header/SessionModule.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#pragma once
#include "httplib.h"

namespace Daybreak::Modules::SessionModule {
void GetSessionInfo(const httplib::Request&, httplib::Response& res);
}
6 changes: 6 additions & 0 deletions Daybreak.GWCA/header/UserModule.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#pragma once
#include "httplib.h"

namespace Daybreak::Modules::UserModule {
void GetUserInfo(const httplib::Request&, httplib::Response& res);
}
5 changes: 5 additions & 0 deletions Daybreak.GWCA/header/framework.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#pragma once

#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
// Windows Header Files
#include <windows.h>
Loading

0 comments on commit 7671e0c

Please sign in to comment.