Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 18 additions & 44 deletions .github/workflows/buildMod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
push:
paths-ignore:
- '**.yml'
- '!.github/workflows/BuildMod.yml'
- '!.github/workflows/buildMod.yml'
- '**.json'
- '!qpm.json'
- '**.ps1'
Expand All @@ -20,7 +20,7 @@ env:

jobs:
build:
runs-on: ubuntu-22.04
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
Expand All @@ -29,57 +29,29 @@ jobs:
submodules: true
lfs: true

# - name: Extract branch name
# shell: bash
# run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
# id: extract_branch

- name: Get Version
shell: pwsh
run: |
$branchParts = '${{ github.ref_name }}'.Split('/'); $branchMain = $branchParts[0]; if ($branchParts[0] -match "^\d+$") { $branchMain = 'pr'; $branchSub = "$($branchParts[0])." } elseif ($branchParts.Length -eq 2) { $branchSub = "$($branchParts[1].Replace('.', '-'))." }; echo "version=$((Get-Content ./qpm.shared.json -Raw | ConvertFrom-Json).config.info.version.Split('-')[0])-$($branchMain).${{ github.run_number }}+$($branchSub)ra${{ github.run_attempt }}.$($env:GITHUB_SHA.Substring(0, 7))" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append



$branchParts = '${{ github.ref_name }}'.Split('/'); $branchMain = $branchParts[0]; if ($branchParts[0] -match "^\d+$") { $branchMain = 'pr'; $branchSub = "$($branchParts[0])." } elseif ($branchParts.Length -eq 2) { $branchSub = "$($branchParts[1].Replace('.', '-'))." }; echo "version=$((Get-Content ./qpm.shared.json -Raw | ConvertFrom-Json).config.info.version.Replace('+', '-').Split('-')[0])-$($branchMain).${{ github.run_number }}+$($branchSub)ra${{ github.run_attempt }}.$($env:GITHUB_SHA.Substring(0, 7))" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
$branchParts = '${{ github.ref_name }}'.Split('/'); $branchMain = $branchParts[0]; if ($branchParts[0] -match "^\d+$") { $branchMain = 'pr'; $branchSub = "$($branchParts[0])." } elseif ($branchParts.Length -eq 2) { $branchSub = "$($branchParts[1].Replace('.', '-'))." }; echo "qmodversion=$((Get-Content ./qpm.shared.json -Raw | ConvertFrom-Json).config.info.version.Replace('+', '-').Split('-')[0])+$($branchMain).$($branchSub)r${{ github.run_number }}a${{ github.run_attempt }}.$($env:GITHUB_SHA.Substring(0, 7))" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append

- uses: seanmiddleditch/gha-setup-ninja@v5

- name: Create ndkpath.txt
run: |
echo "$ANDROID_NDK_LATEST_HOME" > ${GITHUB_WORKSPACE}/ndkpath.txt

- name: Get QPM
if: steps.cache-qpm.outputs.cache-hit != 'true'
uses: dawidd6/action-download-artifact@v6
uses: Fernthedev/qpm-action@v1
with:
github_token: ${{secrets.GITHUB_TOKEN}}
workflow: cargo-build.yml
name: linux-qpm
path: QPM
repo: QuestPackageManager/QPM.CLI
resolve_ndk: true
#required
workflow_token: ${{secrets.GITHUB_TOKEN}}
restore: true # will run restore on download
cache: true #will cache dependencies
version: '${{ env.version }}'
#qpm_qmod: '${{ env.module_id }}_${{ env.qmodversion }}.qmod'

- name: QPM Collapse
run: |
chmod +x ./QPM/qpm
./QPM/qpm collapse
qpm collapse

- name: QPM Dependencies Cache
id: cache-qpm-deps
uses: actions/cache@v2
env:
cache-name: cache-qpm-deps
with:
path: /home/runner/.local/share/QPM-RS/cache
key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('qpm.json') }}
restore-keys: |
${{ runner.os }}-${{ env.cache-name }}-
${{ runner.os }}-${{ env.cache-name }}

- name: QPM Set Version & Restore
run: |
./QPM/qpm package edit --version ${{ env.version }}
./QPM/qpm restore

- name: Check dependency Folders
run: |
echo "Checking extern includes"
Expand All @@ -106,9 +78,11 @@ jobs:
echo "NAME=${files[0]}" >> $GITHUB_OUTPUT

- name: Package QMOD
shell: pwsh
run: |
cd ${GITHUB_WORKSPACE}
./QPM/qpm qmod zip -i ./build/ -i ./extern/libs/ ${module_id}_${version}.qmod
cd ${{ github.workspace }}
qpm package edit --version ${{ env.qmodversion }}
qpm qmod zip -i ./build/ -i ./extern/libs/ ${{ env.module_id }}_${{ env.qmodversion }}.qmod


- name: Upload non-debug artifact
Expand All @@ -131,5 +105,5 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: ${{ env.module_id }}-(UNZIP-for-QMOD).qmod
path: ./${{ env.module_id }}_${{ env.version }}.qmod
path: ./${{ env.module_id }}_${{ env.qmodversion }}.qmod
if-no-files-found: warn
103 changes: 18 additions & 85 deletions .github/workflows/buildModPR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@ on:
env:
module_id: MultiplayerCore
version_num: 0.1.0
# ndkname: android-ndk-r24

jobs:
build:
runs-on: ubuntu-22.04
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
Expand All @@ -24,94 +23,26 @@ jobs:
shell: pwsh
run: |
$branchParts = '${{ github.ref_name }}'.Split('/'); $branchMain = $branchParts[0]; if ($branchParts[0] -match "^\d+$") { $branchMain = 'pr'; $branchSub = "$($branchParts[0])." } elseif ($branchParts.Length -eq 2) { $branchSub = "$($branchParts[1].Replace('.', '-'))." }; echo "version=$((Get-Content ./qpm.shared.json -Raw | ConvertFrom-Json).config.info.version.Split('-')[0])-$($branchMain).${{ github.run_number }}+$($branchSub)ra${{ github.run_attempt }}.$($env:GITHUB_SHA.Substring(0, 7))" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append

$branchParts = '${{ github.ref_name }}'.Split('/'); $branchMain = $branchParts[0]; if ($branchParts[0] -match "^\d+$") { $branchMain = 'pr'; $branchSub = "$($branchParts[0])." } elseif ($branchParts.Length -eq 2) { $branchSub = "$($branchParts[1].Replace('.', '-'))." }; echo "qmodversion=$((Get-Content ./qpm.shared.json -Raw | ConvertFrom-Json).config.info.version.Split('-')[0])+$($branchMain).$($branchSub)r${{ github.run_number }}a${{ github.run_attempt }}.$($env:GITHUB_SHA.Substring(0, 7))" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append

- uses: seanmiddleditch/gha-setup-ninja@v3

# - name: Install Powershell
# run: sudo apt-get install -y powershell

# - name: Cache Android NDK
# id: cache-ndk
# uses: actions/cache@v2
# env:
# cache-name: cache-ndk
# with:
# path: ndk
# key: ${{ runner.os }}-${{ env.cache-name }}-${{ env.ndkname }}
# restore-keys: |
# ${{ runner.os }}-${{ env.cache-name }}-${{ env.ndkname }}

# - name: Install Android NDK
# if: steps.cache-ndk.outputs.cache-hit != 'true'
# run: |
# wget -q -O ndk.zip https://dl.google.com/android/repository/${ndkname}-linux-x86_64.zip
# unzip -q ndk.zip
# mv ${ndkname} ndk

# - name: Create ndkpath.txt
# run: |
# cd ndk
# pwd > ${GITHUB_WORKSPACE}/ndkpath.txt


# extract branch name
# - name: Extract branch name
# if: github.event_name != 'pull_request'
# shell: bash
# run: echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_ENV
# id: extract_branch

# extract branch name on pull request
# - name: Print branch name
# if: github.event_name == 'pull_request'
# run: echo "BRANCH_NAME=$(echo ${GITHUB_HEAD_REF})" >> $GITHUB_ENV

# - name: Set version
# run: echo "version=$(echo $version_num-$BRANCH_NAME.${{ github.run_number }})" >> $GITHUB_ENV

# print branch name and version
# - name: Get branch name
# run: |
# echo 'The branch name is' $BRANCH_NAME
# echo 'The version is' $version

# - name: Create ndkpath.txt
# run: |
# echo "$ANDROID_NDK_LATEST_HOME" > ${GITHUB_WORKSPACE}/ndkpath.txt

- name: Get QPM
if: steps.cache-qpm.outputs.cache-hit != 'true'
uses: dawidd6/action-download-artifact@v6
uses: Fernthedev/qpm-action@v1
with:
github_token: ${{secrets.GITHUB_TOKEN}}
workflow: cargo-build.yml
name: linux-qpm
path: QPM
repo: QuestPackageManager/QPM.CLI
resolve_ndk: true
#required
workflow_token: ${{secrets.GITHUB_TOKEN}}
restore: true # will run restore on download
cache: true #will cache dependencies
version: '${{ env.version }}'
#qpm_qmod: '${{ env.module_id }}_${{ env.qmodversion }}.qmod'


- name: QPM Collapse
run: |
chmod +x ./QPM/qpm
./QPM/qpm collapse
qpm collapse

- name: QPM Dependencies Cache
id: cache-qpm-deps
uses: actions/cache@v2
env:
cache-name: cache-qpm-deps
with:
path: /home/runner/.local/share/QPM-RS/cache
key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('qpm.shared.json') }}
restore-keys: |
${{ runner.os }}-${{ env.cache-name }}-
${{ runner.os }}-${{ env.cache-name }}

- name: QPM Set Version & Restore
run: |
./QPM/qpm package edit --version ${{ env.version }}
./QPM/qpm restore

- name: Check dependency Folders
run: |
echo "Checking extern includes"
Expand All @@ -138,10 +69,12 @@ jobs:
echo "NAME=${files[0]}" >> $GITHUB_OUTPUT

- name: Package QMOD
shell: pwsh
run: |
cd ${GITHUB_WORKSPACE}
./QPM/qpm qmod zip -i ./build/ -i ./extern/libs/ ${module_id}_${version}.qmod

cd ${{ github.workspace }}
qpm package edit --version ${{ env.qmodversion }}
qpm qmod zip -i ./build/ -i ./extern/libs/ ${{ env.module_id }}_${{ env.qmodversion }}.qmod


- name: Upload non-debug artifact
uses: actions/upload-artifact@v3
Expand All @@ -163,5 +96,5 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: ${{ env.module_id }}-(UNZIP-for-QMOD).qmod
path: ./${{ env.module_id }}_${{ env.version }}.qmod
path: ./${{ env.module_id }}_${{ env.qmodversion }}.qmod
if-no-files-found: warn
4 changes: 2 additions & 2 deletions build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ elseif (-not $Version) {
} else {
$VERSION = $Version
}
if ($release -ne $true -and -not $VERSION.Contains('-Dev') -and -not $actions) {
$VERSION += "-Dev"
if ($release -ne $true -and -not $VERSION.Contains('+Dev') -and -not $actions) {
$VERSION += "+Dev"
}

if ([string]::IsNullOrEmpty($env:version) -and $VERSION) {
Expand Down
11 changes: 6 additions & 5 deletions qpm.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,20 @@
"info": {
"name": "MultiplayerCore",
"id": "multiplayer-core",
"version": "1.5.2-Dev",
"version": "1.6.0",
"url": "https://github.com/EnderdracheLP/MultiplayerCore.Quest",
"additionalData": {
"soLink": "https://github.com/EnderdracheLP/MultiplayerCore.Quest/releases/download/1.5.1/libMultiplayerCore.so",
"debugSoLink": "https://github.com/EnderdracheLP/MultiplayerCore.Quest/releases/download/1.5.1/debug_libMultiplayerCore.so",
"soLink": "https://github.com/EnderdracheLP/MultiplayerCore.Quest/releases/download/1.6.0/libMultiplayerCore.so",
"debugSoLink": "https://github.com/EnderdracheLP/MultiplayerCore.Quest/releases/download/1.6.0/debug_libMultiplayerCore.so",
"overrideSoName": "libMultiplayerCore.so",
"modLink": "https://github.com/EnderdracheLP/MultiplayerCore.Quest/releases/download/1.5.1/MultiplayerCore_1.5.1.qmod",
"branchName": "version/1.5.1",
"modLink": "https://github.com/EnderdracheLP/MultiplayerCore.Quest/releases/download/1.6.0/MultiplayerCore_1.6.0.qmod",
"branchName": "version/1.6.0",
"cmake": true
}
},
"workspace": {
"scripts": {},
"ndk": "^27.2.12479018",
"qmodIncludeDirs": [],
"qmodIncludeFiles": [],
"qmodOutput": null
Expand Down
11 changes: 6 additions & 5 deletions qpm.shared.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,20 @@
"info": {
"name": "MultiplayerCore",
"id": "multiplayer-core",
"version": "1.5.2-Dev",
"version": "1.6.0",
"url": "https://github.com/EnderdracheLP/MultiplayerCore.Quest",
"additionalData": {
"soLink": "https://github.com/EnderdracheLP/MultiplayerCore.Quest/releases/download/1.5.1/libMultiplayerCore.so",
"debugSoLink": "https://github.com/EnderdracheLP/MultiplayerCore.Quest/releases/download/1.5.1/debug_libMultiplayerCore.so",
"soLink": "https://github.com/EnderdracheLP/MultiplayerCore.Quest/releases/download/1.6.0/libMultiplayerCore.so",
"debugSoLink": "https://github.com/EnderdracheLP/MultiplayerCore.Quest/releases/download/1.6.0/debug_libMultiplayerCore.so",
"overrideSoName": "libMultiplayerCore.so",
"modLink": "https://github.com/EnderdracheLP/MultiplayerCore.Quest/releases/download/1.5.1/MultiplayerCore_1.5.1.qmod",
"branchName": "version/1.5.1",
"modLink": "https://github.com/EnderdracheLP/MultiplayerCore.Quest/releases/download/1.6.0/MultiplayerCore_1.6.0.qmod",
"branchName": "version/1.6.0",
"cmake": true
}
},
"workspace": {
"scripts": {},
"ndk": "^27.2.12479018",
"qmodIncludeDirs": [],
"qmodIncludeFiles": [],
"qmodOutput": null
Expand Down
4 changes: 4 additions & 0 deletions src/Hooks/ConnectionDiagnosticHooks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,10 @@ MAKE_AUTO_HOOK_MATCH(MultiplayerModeSelectionFlowCoordinator_PresentConnectionEr
INFO("Connection Failed Reason: CFR-{} - {}, ConnectionType: {}", reason.value__, MultiplayerCore::Utils::EnumUtils::GetEnumName(reason), connectionType.value__);
MultiplayerModeSelectionFlowCoordinator_PresentConnectionErrorDialog(self, connectionType, reason);

if (reason == GlobalNamespace::ConnectionFailedReason::ConnectionCanceled) {
return;
}

// Diagnosing connection errors
// Attempt dns resolve
if (!self->_multiplayerModeSelectionViewController->_networkConfig || ! self->_multiplayerModeSelectionViewController->_networkConfig->graphUrl)
Expand Down
Loading