Skip to content

Commit 0c50da9

Browse files
authored
Merge branch 'master' into refactor/CPedSA-cleanup
2 parents b6f341a + d77f6f8 commit 0c50da9

File tree

607 files changed

+121814
-103396
lines changed

Some content is hidden

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

607 files changed

+121814
-103396
lines changed
Lines changed: 31 additions & 0 deletions
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+
fetch-depth: 0
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.GITHUB_TOKEN }}

.github/workflows/dockerimage.yaml

Lines changed: 1 addition & 0 deletions
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

Lines changed: 2 additions & 0 deletions
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:

.github/workflows/stale.yaml

Lines changed: 1 addition & 0 deletions
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/[email protected]

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

Lines changed: 1 addition & 0 deletions
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

Client/ceflauncher/Main.cpp

Lines changed: 7 additions & 6 deletions
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

Lines changed: 0 additions & 4 deletions
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/Main.cpp

Lines changed: 19 additions & 2 deletions
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/core/CChat.cpp

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -650,7 +650,28 @@ bool CChat::CharacterKeyHandler(CGUIKeyEventArgs KeyboardArgs)
650650

651651
// If the input isn't empty and isn't identical to the previous entry in history, add it to the history
652652
if (!m_strInputText.empty() && (m_pInputHistory->Empty() || m_pInputHistory->GetLast() != m_strInputText))
653-
m_pInputHistory->Add(m_strInputText);
653+
{
654+
if (m_strCommand.empty() && m_strInputText[0] != '/')
655+
{
656+
// If the input is not a command, store it
657+
m_pInputHistory->Add(m_strInputText);
658+
}
659+
else if (m_strCommand.compare("login") != 0)
660+
{
661+
// If the input is a command, check that it isn't the 'login' command, if it is censor it
662+
char szInput[256];
663+
strncpy(szInput, m_strInputText.c_str() + 1, 256);
664+
665+
const char* szCommand;
666+
if (szInput[0])
667+
szCommand = strtok(szInput, " ");
668+
669+
if ((strcmp(szCommand, "login") != 0))
670+
m_pInputHistory->Add(m_strInputText);
671+
else if ((m_pInputHistory->Empty() || m_pInputHistory->GetLast() != std::string("/login")))
672+
m_pInputHistory->Add("/login");
673+
}
674+
}
654675

655676
SetInputVisible(false);
656677

Client/core/CCore.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,6 @@ CCore::CCore()
136136
m_pMouseControl = new CMouseControl();
137137

138138
// Create our hook objects.
139-
// m_pFileSystemHook = new CFileSystemHook ( );
140139
m_pDirect3DHookManager = new CDirect3DHookManager();
141140
m_pDirectInputHookManager = new CDirectInputHookManager();
142141
m_pMessageLoopHook = new CMessageLoopHook();
@@ -210,7 +209,6 @@ CCore::~CCore()
210209

211210
// Delete hooks.
212211
delete m_pSetCursorPosHook;
213-
// delete m_pFileSystemHook;
214212
delete m_pDirect3DHookManager;
215213
delete m_pDirectInputHookManager;
216214

@@ -839,12 +837,8 @@ void CCore::ApplyHooks()
839837
// Create our hooks.
840838
m_pDirectInputHookManager->ApplyHook();
841839
// m_pDirect3DHookManager->ApplyHook ( );
842-
// m_pFileSystemHook->ApplyHook ( );
843840
m_pSetCursorPosHook->ApplyHook();
844841

845-
// Redirect basic files.
846-
// m_pFileSystemHook->RedirectFile ( "main.scm", "../../mta/gtafiles/main.scm" );
847-
848842
// Remove useless DirectPlay dependency (dpnhpast.dll) @ 0x745701
849843
// We have to patch here as multiplayer_sa and game_sa are loaded too late
850844
DetourLibraryFunction("kernel32.dll", "LoadLibraryA", Win32LoadLibraryA, SkipDirectPlay_LoadLibraryA);

0 commit comments

Comments
 (0)