Skip to content

Commit

Permalink
Merge branch 'master' into waterlevel
Browse files Browse the repository at this point in the history
  • Loading branch information
Lpsd committed Jun 19, 2024
2 parents 400e88b + 75c36ed commit dfb1ea1
Show file tree
Hide file tree
Showing 3,730 changed files with 573,502 additions and 408,301 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
18 changes: 18 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -229,3 +229,21 @@ a02c4b3a71b5a6e9d77ba849edd14a8048256120
# Date: Sun Jan 9 15:36:06 2022 +0200
#
# Run clang-format

b42518e64803762d27fe6277b36044d1a71fc2c4
# Author: Marek Kulik <me@botder.com>
# Date: Fri Apr 7 15:46:10 2023 +0200
#
# Apply win-apply-clang-format.bat

483cd28a1ee618538771e3bf33f9ebddfca2cde9
# Author: patrikjuvonen <22572159+patrikjuvonen@users.noreply.github.com>
# Date: Sat Apr 8 15:17:22 2023 +0300
#
# Apply win-apply-clang-format.bat

6f26c2ad77600c2fd055d9d7a30ced5bf91d4f14
# Author: patrikjuvonen <22572159+patrikjuvonen@users.noreply.github.com>
# Date: Mon Jun 12 19:01:59 2023 +0300
#
# Apply win-apply-clang-format.bat
38 changes: 14 additions & 24 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,21 @@ jobs:
windows:
strategy:
matrix:
configuration: [release, debug]
platform: [win32, x64, arm64]
include:
- configuration: release
artifact-name: InstallFiles
- configuration: debug
artifact-name: InstallFiles-debug
name: windows-${{ matrix.configuration }}-${{ matrix.platform }}
name: windows-${{ matrix.platform }}
runs-on: windows-2022
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: actions/cache@v3
- uses: actions/cache@v4
id: cache-dxfiles
with:
path: utils/DXFiles
key: dxfiles-0001

- name: Download DirectX
if: steps.cache-dxfiles.outputs.cache-hit != 'true'
run: Invoke-WebRequest https://mirror.mtasa.com/bdata/DXFiles.zip -OutFile utils/DXFiles.zip
run: Invoke-WebRequest https://mirror-cdn.multitheftauto.com/bdata/DXFiles.zip -OutFile utils/DXFiles.zip
shell: powershell

- name: Extract DirectX
Expand All @@ -42,7 +36,7 @@ jobs:
run: utils\premake5 install_data

- name: Run Build
run: win-build.bat ${{ matrix.configuration }} ${{ matrix.platform }}
run: win-build.bat release ${{ matrix.platform }}
shell: cmd
env:
DXSDK_DIR: './utils/DXFiles/'
Expand All @@ -51,19 +45,16 @@ jobs:
- name: Create build artifacts
run: utils\premake5 compose_files

- uses: actions/upload-artifact@master
- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact-name }}
name: InstallFiles-${{ matrix.platform }}
path: InstallFiles/

macOS:
strategy:
matrix:
type: [release, debug]
name: macOS-${{ matrix.type }}
runs-on: macOS-latest
name: macOS
runs-on: macOS-13
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install MySQL
run: brew install mysql
Expand All @@ -73,24 +64,23 @@ jobs:
run: brew link --overwrite mysql

- name: Run Build
run: ./linux-build.sh --config=${{ matrix.type }}
run: ./linux-build.sh --os=macosx

linux:
strategy:
matrix:
type: [release, debug]
architecture: [x64, arm64]
include:
- architecture: x64
image-tag: latest
- architecture: arm64
image-tag: arm64
name: linux-${{ matrix.type }}-${{ matrix.architecture }}
name: linux-${{ matrix.architecture }}
runs-on: ubuntu-latest
container:
image: docker://ghcr.io/multitheftauto/mtasa-blue-build:${{ matrix.image-tag }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Run Build
run: ./linux-build.sh --arch=${{ matrix.architecture }} --config=${{ matrix.type }}
run: ./linux-build.sh --arch=${{ matrix.architecture }}
20 changes: 15 additions & 5 deletions .github/workflows/dockerimage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,15 @@ on:
branches:
- master
paths:
- '.github/**'
- '.github/workflows/build.yaml'
- '.github/workflows/dockerimage.yaml'
- 'utils/compat/**'
- 'Dockerfile'
- 'Dockerfile.i386'
- 'Dockerfile.armhf'
- 'Dockerfile.arm64'
- 'Dockerfile.osx-x64'
- 'Dockerfile.osx-arm64'

jobs:
build:
Expand All @@ -18,20 +22,26 @@ jobs:
include:
- tag: latest
dockerfile: Dockerfile
- tag: i386
dockerfile: Dockerfile.i386
- tag: armhf
dockerfile: Dockerfile.armhf
- tag: arm64
dockerfile: Dockerfile.arm64
- tag: osx-x64
dockerfile: Dockerfile.osx-x64
- tag: osx-arm64
dockerfile: Dockerfile.osx-arm64
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: docker/setup-buildx-action@v2
- uses: docker/login-action@v2
- uses: actions/checkout@v4
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.CI_PAT }}
- uses: docker/build-push-action@v3
- uses: docker/build-push-action@v5
with:
push: true
file: ./${{ matrix.dockerfile }}
Expand Down
16 changes: 7 additions & 9 deletions .github/workflows/rebuild-pots.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
- uses: conda-incubator/setup-miniconda@v2
Expand All @@ -26,7 +26,7 @@ jobs:
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
token: ${{ secrets.POT_CI_PAT }}
Expand Down Expand Up @@ -55,29 +55,27 @@ jobs:
if [[ $(git diff --unified=0 "Shared/data/MTA San Andreas/MTA/locale/en_US/client.pot" | grep -v POT-Creation-Date | grep '^[+|-][^+|-]') ]]
then
git add "Shared/data/MTA San Andreas/MTA/locale/en_US/client.pot"
git commit -m "Update client en_US pot"
git commit -m "Update client en_US pot" -m "[ci skip]"
fi
# Check that diff contains something and it's not only POT-Creation-Date
if [[ $(git diff --unified=0 "Shared/installer/locale/en_US.pot" | grep -v POT-Creation-Date | grep '^[+|-][^+|-]') ]]
then
git add "Shared/installer/locale/en_US.pot"
git commit -m "Update installer en_US pot"
git commit -m "Update installer en_US pot" -m "[ci skip]"
fi
echo "::echo::on"
# Check for local commits
if [[ $(git diff --name-only "@{upstream}..") ]]
then
echo "::set-output name=has_changes::true"
echo "has_changes=true" >> $GITHUB_ENV
else
echo "::set-output name=has_changes::false"
echo "has_changes=false" >> $GITHUB_ENV
fi
# Get rid of all other changes
git checkout -- .
git clean -fd
- if: ${{ steps.stage_changes.outputs.has_changes == 'true' }}
- if: ${{ env.has_changes == 'true' }}
name: Push changes
run: git push
2 changes: 1 addition & 1 deletion .github/workflows/stale.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: multitheftauto/stale-action@v1.0.3
- uses: multitheftauto/stale-action@v3.0.0
id: stale
with:
close-pr-message: "This draft pull request was closed because it has been marked stale for 30 days with no activity."
Expand Down
51 changes: 51 additions & 0 deletions .github/workflows/sync-master-to-maetro.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: 'Sync master to maetro'

on:
push:
branches: [ master ]
workflow_dispatch:

jobs:
sync-master-to-maetro:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.SYNC_CI_PAT }}

- id: sync_commits
name: Sync commits
run: |
# GitHub Actions bot user
git config --global user.name "Maetro Bot"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git checkout release/maetro
git merge master --no-ff --no-edit --no-commit || true
# Discard locale conflicts
git checkout --ours -- Shared/installer/locale "Shared/data/MTA San Andreas/MTA/locale"
git add --verbose Shared/installer/locale "Shared/data/MTA San Andreas/MTA/locale"
# Discard install_cef.lua conflicts
git checkout --ours -- utils/buildactions/install_cef.lua
git add --verbose utils/buildactions/install_cef.lua
# Discard d3dcompiler_47.dll conflicts (Due to old CEF version on maetro)
git checkout --ours -- "Shared/data/MTA San Andreas/MTA/d3dcompiler_47.dll"
git add --verbose "Shared/data/MTA San Andreas/MTA/d3dcompiler_47.dll"
# Discard cefweb conflicts
git checkout --ours -- Client/cefweb/CWebView.cpp
git add --verbose Client/cefweb/CWebView.cpp
git checkout --ours -- "Client/loader/MainFunctions.cpp"
git add --verbose "Client/loader/MainFunctions.cpp"
# We should be done with the merge now
printf "Synchronize changes from 1.6 master branch [ci skip]\n\n" > commit.txt
git log --expand-tabs=4 --pretty=format:'%h %s' release/maetro..master >> commit.txt
git commit --no-edit --allow-empty -F commit.txt
git push origin release/maetro
8 changes: 1 addition & 7 deletions Client/ceflauncher_DLL/CCefApp.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class CCefApp : public CefApp, public CefRenderProcessHandler
if (!node)
return;

if (node->GetType() == CefDOMNode::Type::DOM_NODE_TYPE_ELEMENT && !node->GetFormControlElementType().empty())
if (node->GetType() == CefDOMNode::Type::DOM_NODE_TYPE_ELEMENT && node->GetFormControlElementType() != CefDOMNode::FormControlType::DOM_FORM_CONTROL_TYPE_UNSUPPORTED)
{
auto message = CefProcessMessage::Create("InputFocus");
message->GetArgumentList()->SetBool(0, true);
Expand All @@ -53,12 +53,6 @@ class CCefApp : public CefApp, public CefRenderProcessHandler
}
}

virtual void OnRegisterCustomSchemes(CefRawPtr<CefSchemeRegistrar> registrar) override
{
// Register custom MTA scheme (has to be called in all proceseses)
registrar->AddCustomScheme("mtalocal", CEF_SCHEME_OPTION_CSP_BYPASSING);
}

// http://magpcss.org/ceforum/apidocs3/projects/(default)/CefRenderProcessHandler.html#OnContextCreated(CefRefPtr%3CCefBrowser%3E,CefRefPtr%3CCefFrame%3E,CefRefPtr%3CCefV8Context%3E)
// //
virtual void OnContextCreated(CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame, CefRefPtr<CefV8Context> context) override
Expand Down
6 changes: 5 additions & 1 deletion Client/ceflauncher_DLL/Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@
*****************************************************************************/
#define WIN32_LEAN_AND_MEAN
#include <Windows.h>
#include <delayimp.h>
#include "CCefApp.h"
#include <string>
#include <cef3/cef/include/cef_sandbox_win.h>

//#define CEF_ENABLE_SANDBOX
// #define CEF_ENABLE_SANDBOX
#ifdef CEF_ENABLE_SANDBOX
#pragma comment(lib, "cef_sandbox.lib")
#endif
Expand All @@ -30,6 +31,9 @@ int _declspec(dllexport) InitCEF()
std::wstring mtaPath = currentFileName.substr(0, pos - 3); // Strip "CEF"
SetDllDirectory(mtaPath.c_str());

// Load libcef.dll from the DLL directory
assert(SUCCEEDED(__HrLoadAllImportsForDll("libcef.dll")));

// Load CEF
CefMainArgs mainArgs(GetModuleHandle(NULL));
CefRefPtr<CCefApp> app{new CCefApp};
Expand Down
3 changes: 2 additions & 1 deletion Client/ceflauncher_DLL/premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ project "CEFLauncher DLL"
"*.cpp"
}

links { "CEF", "libcef.lib", "Psapi.lib", "version.lib", "Winmm.lib", "Ws2_32.lib", "DbgHelp.lib" }
links { "delayimp", "CEF", "libcef.lib", "Psapi.lib", "version.lib", "Winmm.lib", "Ws2_32.lib", "DbgHelp.lib" }
linkoptions { "/DELAYLOAD:libcef.dll" }

filter "architecture:not x86"
flags { "ExcludeFromBuild" }
Expand Down
35 changes: 3 additions & 32 deletions Client/cefweb/CWebApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,16 @@ CefRefPtr<CefResourceHandler> CWebApp::HandleError(const SString& strError, unsi
return new CefStreamResourceHandler(uiError, strError, "text/plain", CefResponse::HeaderMap(), stream);
}

void CWebApp::OnRegisterCustomSchemes(CefRawPtr<CefSchemeRegistrar> registrar)
{
// Register custom MTA scheme (has to be called in all proceseses)
registrar->AddCustomScheme("mtalocal", CEF_SCHEME_OPTION_CSP_BYPASSING);
}

void CWebApp::OnBeforeCommandLineProcessing(const CefString& process_type, CefRefPtr<CefCommandLine> command_line)
{
command_line->AppendSwitch("disable-gpu-compositing");
command_line->AppendSwitch("disable-gpu");
// command_line->AppendSwitch("disable-d3d11");
command_line->AppendSwitch("enable-begin-frame-scheduling");

// browser-signin switch(or lack thereof) produces crashes when GOOGLE API keys are present in the OS registry
command_line->AppendSwitchWithValue("allow-browser-signin", "false");

if (process_type.empty())
{
command_line->AppendSwitchWithValue("autoplay-policy", "no-user-gesture-required");
Expand All @@ -57,32 +54,6 @@ CefRefPtr<CefResourceHandler> CWebApp::Create(CefRefPtr<CefBrowser> browser, Cef
if (!CefParseURL(request->GetURL(), urlParts))
return nullptr;

if (scheme_name == "mtalocal") // Backward compatibility
{
// Get full path
SString path = UTF16ToMbUTF8(urlParts.path.str).substr(2);

// Check if we're dealing with an external resource
if (path[0] == ':')
{
size_t end = path.find_first_of('/');
if (end != std::string::npos)
{
SString resourceName = path.substr(1, end - 1);
SString resourcePath = path.substr(end);

// Call this function recursively and use the mta scheme instead
request->SetURL("http://mta/local/" + resourceName + resourcePath);
return Create(browser, frame, "http", request);
}
return HandleError("404 - Not found", 404);
}

// Redirect mtalocal://* to http://mta/local/*, call recursively
request->SetURL("http://mta/local/" + path);
return Create(browser, frame, "http", request);
}

SString host = UTF16ToMbUTF8(urlParts.host.str);
if (scheme_name == "http" && host == "mta")
{
Expand Down
1 change: 0 additions & 1 deletion Client/cefweb/CWebApp.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ class CWebApp : public CefApp, public CefSchemeHandlerFactory
// Error Handler
static CefRefPtr<CefResourceHandler> HandleError(const SString& strError, unsigned int uiError);

virtual void OnRegisterCustomSchemes(CefRawPtr<CefSchemeRegistrar> registrar) override;
virtual void OnBeforeCommandLineProcessing(const CefString& process_type, CefRefPtr<CefCommandLine> command_line) override;

// CefSchemeHandlerFactory methods
Expand Down
Loading

0 comments on commit dfb1ea1

Please sign in to comment.