Skip to content

Commit 31e4b34

Browse files
authored
Merge branch 'master' into feature/2dfx
2 parents ee4593b + bd999a5 commit 31e4b34

File tree

3,408 files changed

+353611
-176613
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

3,408 files changed

+353611
-176613
lines changed

.github/CODE_OF_CONDUCT.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Please refer to the [forum rules](https://forum.mtasa.com/topic/12275-forum-rules/).
1+
Please refer to the [forum rules](https://forum.multitheftauto.com/topic/12275-forum-rules/).

.github/ISSUE_TEMPLATE/bug_report.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ body:
5959
description: |
6060
Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks.
6161
62-
**Warning!** Do not post any personal information or sensitive logs here. You are responsible for redacting any personal information from the logs. If you need to post sensitive logs, you can use our [private log uploader](https://upload.mtasa.com/) which will only allow MTA staff to access the file, just paste the link to it here.
62+
**Warning!** Do not post any personal information or sensitive logs here. You are responsible for redacting any personal information from the logs. If you need to post sensitive logs, you can use our [private log uploader](https://upload.multitheftauto.com/) which will only allow MTA staff to access the file, just paste the link to it here.
6363
render: shell
6464
- type: checkboxes
6565
id: terms

.github/SECURITY.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Please submit your security vulnerabilities and cheats to our [private bugtracke
77

88
Please do not submit vulnerabilities and cheats publicly, on GitHub or anywhere else.
99

10-
[private bugtracker]: https://forum.mtasa.com/forum/156-private-bugs/
10+
[private bugtracker]: https://forum.multitheftauto.com/forum/156-private-bugs/
1111

1212
## Bug Bounty
1313

@@ -16,4 +16,4 @@ We also run a bug bounty programme. Please read
1616

1717
Payment is by PayPal only -- please include your PayPal email when posting on the [private bugtracker].
1818

19-
[bounty]: https://forum.mtasa.com/topic/66858-bounty-for-finding-security-flaws-and-working-cheats-in-mta/
19+
[bounty]: https://forum.multitheftauto.com/topic/66858-bounty-for-finding-security-flaws-and-working-cheats-in-mta/
+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Crowdin Auto-Merge
2+
3+
on:
4+
schedule:
5+
- cron: '0 0 * * 5' # This cron expression runs the workflow every Friday at midnight (UTC)
6+
workflow_dispatch:
7+
8+
jobs:
9+
crowdin-auto-merge:
10+
if: github.event.repository.fork == false
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v4
15+
with:
16+
token: ${{ secrets.POT_CI_PAT }}
17+
18+
- name: Setup Git
19+
run: |
20+
git config --global user.name 'github-actions[bot]'
21+
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
22+
23+
- name: Auto-merge pull request
24+
run: |
25+
PR_NUMBER=$(gh pr list --repo ${{ github.repository }} --author 'MTABot' --base 'master' --head 'l10n/master' --state open --json number --jq '.[0].number')
26+
if [ -n "$PR_NUMBER" ]; then
27+
gh pr merge $PR_NUMBER --squash --repo ${{ github.repository }} --admin --subject "New Crowdin updates (PR #$PR_NUMBER)" --body ""
28+
git push origin --delete l10n/master
29+
fi
30+
env:
31+
GITHUB_TOKEN: ${{ secrets.POT_CI_PAT }}

.github/workflows/dockerimage.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ jobs:
2626
dockerfile: Dockerfile.armhf
2727
- tag: arm64
2828
dockerfile: Dockerfile.arm64
29+
if: github.event.repository.fork == false
2930
runs-on: ubuntu-latest
3031
steps:
3132
- uses: actions/checkout@v4

.github/workflows/rebuild-pots.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on: [push, workflow_dispatch]
44

55
jobs:
66
test:
7+
if: github.event.repository.fork == false
78
runs-on: ubuntu-latest
89
steps:
910
- uses: actions/checkout@v4
@@ -23,6 +24,7 @@ jobs:
2324
run: pytest "utils/localization/tests"
2425
shell: bash -l {0}
2526
rebuild-pots:
27+
if: github.event.repository.fork == false
2628
runs-on: ubuntu-latest
2729
needs: test
2830
steps:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: "Update crowdin-translators.json"
2+
3+
on:
4+
workflow_dispatch:
5+
delete:
6+
branches:
7+
- l10n/master
8+
9+
jobs:
10+
generate_translators:
11+
if: github.event.repository.fork == false
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v4
16+
with:
17+
ref: master
18+
token: ${{ secrets.POT_CI_PAT }}
19+
20+
- name: Setup Node.js
21+
uses: actions/setup-node@v4
22+
with:
23+
node-version: latest
24+
cache: 'npm'
25+
cache-dependency-path: ./utils/localization/generate-translators/package-lock.json
26+
27+
- name: Install dependencies
28+
working-directory: ./utils/localization/generate-translators
29+
run: npm clean-install
30+
31+
- name: Generate translators
32+
working-directory: ./utils/localization/generate-translators
33+
env:
34+
CROWDIN_TOKEN: "${{ secrets.CROWDIN_TOKEN }}"
35+
CROWDIN_ORGANIZATION: "multitheftauto"
36+
CROWDIN_PROJECT_ID: "13" # Multi Theft Auto
37+
CROWDIN_IGNORE_USER_ID: "2" # multitheftautoqa
38+
run: npm run ci
39+
40+
- name: Commit changes
41+
env:
42+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
43+
run: |
44+
git config --global user.name 'github-actions[bot]'
45+
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
46+
47+
git add ./utils/localization/generate-translators/crowdin-translators.json
48+
49+
if ! git diff-index --quiet HEAD; then
50+
git commit -m "Update crowdin-translators.json" -m "[ci skip]"
51+
git push
52+
fi

.github/workflows/stale.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ on:
66

77
jobs:
88
stale:
9+
if: github.event.repository.fork == false
910
runs-on: ubuntu-latest
1011
steps:
1112
- uses: multitheftauto/stale-action@v3.0.0

.github/workflows/sync-master-to-maetro.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ on:
77

88
jobs:
99
sync-master-to-maetro:
10+
if: github.event.repository.fork == false
1011
runs-on: ubuntu-latest
1112
steps:
1213
- uses: actions/checkout@v4

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -416,3 +416,4 @@ utils/DXFiles/
416416
!*.dll
417417
!*.exe
418418
utils/vswhere.exe
419+
*.generated.h

Client/ceflauncher/Main.cpp

+7-6
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
/*****************************************************************************
22
*
3-
* PROJECT: Multi Theft Auto v1.0
4-
* (Shared logic for modifications)
3+
* PROJECT: Multi Theft Auto
54
* LICENSE: See LICENSE in the top level directory
65
* FILE: ceflauncher/Main.cpp
76
* PURPOSE: CEF launcher entry point
87
*
8+
* Multi Theft Auto is available from https://multitheftauto.com/
9+
*
910
*****************************************************************************/
10-
#define WIN32_LEAN_AND_MEAN
11-
#include <Windows.h>
12-
#include <string>
1311

1412
/*
1513
IMPORTANT
@@ -24,7 +22,10 @@
2422

2523
int _declspec(dllimport) InitCEF();
2624

27-
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdShow, int nCmdShow)
25+
using HINSTANCE = struct HINSTANCE__*;
26+
using LPSTR = char*;
27+
28+
int __stdcall WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdShow, int nCmdShow)
2829
{
2930
return InitCEF();
3031
}

Client/ceflauncher/premake5.lua

-4
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,15 @@ project "CEFLauncher"
33
kind "WindowedApp"
44
targetname "CEFLauncher"
55
targetdir(buildpath("mta/cef"))
6-
76
includedirs { "../sdk" }
8-
97
links { "CEFLauncher DLL"}
10-
entrypoint "WinMainCRTStartup"
118

129
vpaths {
1310
["Headers/*"] = "**.h",
1411
["Sources/*"] = "**.cpp",
1512
["*"] = "premake5.lua"
1613
}
1714

18-
1915
files {
2016
"premake5.lua",
2117
"*.h",

Client/ceflauncher_DLL/CCefApp.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class CCefApp : public CefApp, public CefRenderProcessHandler
1919
CCefApp() {}
2020
virtual CefRefPtr<CefRenderProcessHandler> GetRenderProcessHandler() override { return this; };
2121

22-
// http://magpcss.org/ceforum/apidocs3/projects/(default)/CefRenderProcessHandler.html#OnFocusedNodeChanged(CefRefPtr%3CCefBrowser%3E,CefRefPtr%3CCefFrame%3E,CefRefPtr%3CCefDOMNode%3E)
22+
// https://magpcss.org/ceforum/apidocs3/projects/(default)/CefRenderProcessHandler.html#OnFocusedNodeChanged(CefRefPtr%3CCefBrowser%3E,CefRefPtr%3CCefFrame%3E,CefRefPtr%3CCefDOMNode%3E)
2323
virtual void OnFocusedNodeChanged(CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame, CefRefPtr<CefDOMNode> node) override
2424
{
2525
if (m_bHasInputFocus)
@@ -53,7 +53,7 @@ class CCefApp : public CefApp, public CefRenderProcessHandler
5353
}
5454
}
5555

56-
// http://magpcss.org/ceforum/apidocs3/projects/(default)/CefRenderProcessHandler.html#OnContextCreated(CefRefPtr%3CCefBrowser%3E,CefRefPtr%3CCefFrame%3E,CefRefPtr%3CCefV8Context%3E)
56+
// https://magpcss.org/ceforum/apidocs3/projects/(default)/CefRenderProcessHandler.html#OnContextCreated(CefRefPtr%3CCefBrowser%3E,CefRefPtr%3CCefFrame%3E,CefRefPtr%3CCefV8Context%3E)
5757
// //
5858
virtual void OnContextCreated(CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame, CefRefPtr<CefV8Context> context) override
5959
{

Client/ceflauncher_DLL/Main.cpp

+19-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
/*****************************************************************************
22
*
3-
* PROJECT: Multi Theft Auto v1.0
4-
* (Shared logic for modifications)
3+
* PROJECT: Multi Theft Auto
54
* LICENSE: See LICENSE in the top level directory
65
* FILE: ceflauncher/Main.cpp
76
* PURPOSE: CEF launcher entry point
87
*
8+
* Multi Theft Auto is available from https://multitheftauto.com/
9+
*
910
*****************************************************************************/
11+
1012
#define WIN32_LEAN_AND_MEAN
1113
#include <Windows.h>
1214
#include <delayimp.h>
@@ -44,5 +46,20 @@ int _declspec(dllexport) InitCEF()
4446
sandboxInfo = scopedSandbox.sandbox_info();
4547
#endif
4648

49+
if (HANDLE job = CreateJobObjectW(nullptr, nullptr); job != nullptr)
50+
{
51+
JOBOBJECT_EXTENDED_LIMIT_INFORMATION limits{};
52+
limits.BasicLimitInformation.LimitFlags = JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE;
53+
54+
if (SetInformationJobObject(job, JobObjectExtendedLimitInformation, &limits, sizeof(limits)))
55+
{
56+
AssignProcessToJobObject(job, GetCurrentProcess());
57+
}
58+
else
59+
{
60+
CloseHandle(job);
61+
}
62+
}
63+
4764
return CefExecuteProcess(mainArgs, app, sandboxInfo);
4865
}

Client/cefweb/CAjaxResourceHandler.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* FILE: core/AjaxResourceHandler.h
66
* PURPOSE: CEF Handler for Ajax Requests with delayed results
77
*
8-
* Multi Theft Auto is available from http://www.multitheftauto.com/
8+
* Multi Theft Auto is available from https://www.multitheftauto.com/
99
*
1010
*****************************************************************************/
1111
#pragma once

Client/cefweb/CWebApp.cpp

+9-4
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,13 @@ CefRefPtr<CefResourceHandler> CWebApp::HandleError(const SString& strError, unsi
2121

2222
void CWebApp::OnBeforeCommandLineProcessing(const CefString& process_type, CefRefPtr<CefCommandLine> command_line)
2323
{
24-
command_line->AppendSwitch("disable-gpu-compositing");
25-
command_line->AppendSwitch("disable-gpu");
24+
CWebCore* pWebCore = static_cast<CWebCore*>(g_pCore->GetWebCore());
25+
26+
if (!pWebCore->GetGPUEnabled())
27+
command_line->AppendSwitch("disable-gpu");
28+
29+
command_line->AppendSwitch("disable-gpu-compositing"); // always disable this, causes issues with official builds
30+
2631
// command_line->AppendSwitch("disable-d3d11");
2732
command_line->AppendSwitch("enable-begin-frame-scheduling");
2833

@@ -41,7 +46,7 @@ CefRefPtr<CefResourceHandler> CWebApp::Create(CefRefPtr<CefBrowser> browser, Cef
4146
{
4247
// browser or frame are NULL if the request does not orginate from a browser window
4348
// This is for exmaple true for the application cache or CEFURLRequests
44-
// (http://www.html5rocks.com/en/tutorials/appcache/beginner/)
49+
// (https://www.html5rocks.com/en/tutorials/appcache/beginner/)
4550
if (!browser || !frame)
4651
return nullptr;
4752

@@ -57,7 +62,7 @@ CefRefPtr<CefResourceHandler> CWebApp::Create(CefRefPtr<CefBrowser> browser, Cef
5762
SString host = UTF16ToMbUTF8(urlParts.host.str);
5863
if (scheme_name == "http" && host == "mta")
5964
{
60-
// Scheme format: http://mta/resourceName/file.html or http://mta/local/file.html for the current resource
65+
// Scheme format: https://mta/resourceName/file.html or https://mta/local/file.html for the current resource
6166

6267
// Get resource name and path
6368
SString path = UTF16ToMbUTF8(urlParts.path.str).substr(1); // Remove slash at the front

Client/cefweb/CWebCore.cpp

+10-2
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,13 @@ CWebCore::~CWebCore()
4949
delete m_pXmlConfig;
5050
}
5151

52-
bool CWebCore::Initialise()
52+
bool CWebCore::Initialise(bool gpuEnabled)
5353
{
5454
CefMainArgs mainArgs;
5555
void* sandboxInfo = nullptr;
56+
57+
m_bGPUEnabled = gpuEnabled;
58+
5659
CefRefPtr<CWebApp> app(new CWebApp);
5760

5861
#ifdef CEF_ENABLE_SANDBOX
@@ -406,7 +409,7 @@ std::unordered_set<SString> CWebCore::AllowPendingPages(bool bRemember)
406409
}
407410

408411
// Trigger an event now
409-
auto pCurrentMod = g_pCore->GetModManager()->GetCurrentMod();
412+
auto pCurrentMod = g_pCore->GetModManager()->GetClient();
410413
if (!pCurrentMod)
411414
return std::unordered_set<SString>();
412415

@@ -869,3 +872,8 @@ void CWebCore::StaticFetchBlacklistFinished(const SHttpDownloadResult& result)
869872
OutputDebugLine("Updated browser blacklist!");
870873
#endif
871874
}
875+
876+
bool CWebCore::GetGPUEnabled() const noexcept
877+
{
878+
return m_bGPUEnabled;
879+
}

Client/cefweb/CWebCore.h

+7-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#include <cef3/cef/include/cef_app.h>
2020
#define MTA_BROWSERDATA_PATH "mta/cef/browserdata.xml"
2121
#define BROWSER_LIST_UPDATE_INTERVAL (24*60*60)
22-
#define BROWSER_UPDATE_URL "http://cef.multitheftauto.com/get.php"
22+
#define BROWSER_UPDATE_URL "https://cef.multitheftauto.com/get.php"
2323
#define GetNextSibling(hwnd) GetWindow(hwnd, GW_HWNDNEXT) // Re-define the conflicting macro
2424
#define GetFirstChild(hwnd) GetTopWindow(hwnd)
2525

@@ -54,7 +54,7 @@ class CWebCore : public CWebCoreInterface
5454
public:
5555
CWebCore();
5656
~CWebCore();
57-
bool Initialise() override;
57+
bool Initialise(bool gpuEnabled) override;
5858

5959
CWebViewInterface* CreateWebView(unsigned int uiWidth, unsigned int uiHeight, bool bIsLocal, CWebBrowserItem* pWebBrowserRenderItem, bool bTransparent);
6060
void DestroyWebView(CWebViewInterface* pWebViewInterface);
@@ -108,6 +108,8 @@ class CWebCore : public CWebCoreInterface
108108
static void StaticFetchWhitelistFinished(const SHttpDownloadResult& result);
109109
static void StaticFetchBlacklistFinished(const SHttpDownloadResult& result);
110110

111+
bool GetGPUEnabled() const noexcept;
112+
111113
private:
112114
typedef std::pair<bool, eWebFilterType> WebFilterPair;
113115

@@ -129,4 +131,7 @@ class CWebCore : public CWebCoreInterface
129131
CXMLFile* m_pXmlConfig;
130132
int m_iWhitelistRevision;
131133
int m_iBlacklistRevision;
134+
135+
// Shouldn't be changed after init
136+
bool m_bGPUEnabled;
132137
};

0 commit comments

Comments
 (0)