Skip to content

Commit

Permalink
Merge branch 'master' into TheNormalnij/building_lods
Browse files Browse the repository at this point in the history
  • Loading branch information
Dutchman101 authored May 24, 2024
2 parents 3dd2446 + c5c9d4e commit 96c3175
Show file tree
Hide file tree
Showing 591 changed files with 46,903 additions and 31,387 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:

macOS:
name: macOS
runs-on: macOS-latest
runs-on: macOS-13
steps:
- uses: actions/checkout@v4

Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/sync-master-to-maetro.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ jobs:
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"
Expand Down
2 changes: 1 addition & 1 deletion Client/cefweb/CWebView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ bool CWebView::SetAudioVolume(float fVolume)

for (auto& name : frameNames)
{
auto frame = m_pWebView->GetFrame(name);
auto frame = m_pWebView->GetFrameByName(name);
frame->ExecuteJavaScript(strJSCode, "", 0);
}
m_fVolume = fVolume;
Expand Down
18 changes: 18 additions & 0 deletions Client/core/CSettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,18 @@ void CSettings::CreateGUI()
m_pEditNick->SetMaxLength(MAX_PLAYER_NICK_LENGTH);
m_pEditNick->SetTextAcceptedHandler(GUI_CALLBACK(&CSettings::OnOKButtonClick, this));

m_pButtonGenerateNick = reinterpret_cast<CGUIButton*>(pManager->CreateButton(pTabMultiplayer));
m_pButtonGenerateNick->SetPosition(CVector2D(vecSize.fX + vecTemp.fX + 50.0f + 178.0f + 5.0f, vecTemp.fY - 1.0f), false);
m_pButtonGenerateNick->SetSize(CVector2D(26.0f, 26.0f), false);
m_pButtonGenerateNick->SetClickHandler(GUI_CALLBACK(&CSettings::OnNickButtonClick, this));
m_pButtonGenerateNick->SetZOrderingEnabled(false);

m_pButtonGenerateNickIcon = reinterpret_cast<CGUIStaticImage*>(pManager->CreateStaticImage(m_pButtonGenerateNick));
m_pButtonGenerateNickIcon->SetSize(CVector2D(1, 1), true);
m_pButtonGenerateNickIcon->LoadFromFile("cgui\\images\\serverbrowser\\refresh.png");
m_pButtonGenerateNickIcon->SetProperty("MousePassThroughEnabled", "True");
m_pButtonGenerateNickIcon->SetProperty("DistributeCapturedInputs", "True");

m_pSavePasswords = reinterpret_cast<CGUICheckBox*>(pManager->CreateCheckBox(pTabMultiplayer, _("Save server passwords"), true));
m_pSavePasswords->SetPosition(CVector2D(vecTemp.fX, vecTemp.fY + 50.0f));
m_pSavePasswords->GetPosition(vecTemp, false);
Expand Down Expand Up @@ -2940,6 +2952,12 @@ bool CSettings::OnOKButtonClick(CGUIElement* pElement)
return true;
}

bool CSettings::OnNickButtonClick(CGUIElement* pElement)
{
m_pEditNick->SetText(CNickGen::GetRandomNickname());
return true;
}

bool CSettings::OnCancelButtonClick(CGUIElement* pElement)
{
CMainMenu* pMainMenu = CLocalGUI::GetSingleton().GetMainMenu();
Expand Down
3 changes: 3 additions & 0 deletions Client/core/CSettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@ class CSettings
CGUIButton* m_pButtonOK;
CGUIButton* m_pButtonCancel;
CGUILabel* m_pLabelNick;
CGUIButton* m_pButtonGenerateNick;
CGUIStaticImage* m_pButtonGenerateNickIcon;
CGUIEdit* m_pEditNick;
CGUICheckBox* m_pSavePasswords;
CGUICheckBox* m_pAutoRefreshBrowser;
Expand Down Expand Up @@ -347,6 +349,7 @@ class CSettings
bool OnVideoDefaultClick(CGUIElement* pElement);
bool OnBindsListClick(CGUIElement* pElement);
bool OnOKButtonClick(CGUIElement* pElement);
bool OnNickButtonClick(CGUIElement* pElement);
bool OnCancelButtonClick(CGUIElement* pElement);
bool OnFieldOfViewChanged(CGUIElement* pElement);
bool OnDrawDistanceChanged(CGUIElement* pElement);
Expand Down
11 changes: 11 additions & 0 deletions Client/game_sa/CGameSA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -729,6 +729,17 @@ void CGameSA::SetFireballDestructEnabled(bool isEnabled)
m_isFireballDestructEnabled = isEnabled;
}

void CGameSA::SetRoadSignsTextEnabled(bool isEnabled)
{
if (isEnabled == m_isRoadSignsTextEnabled)
return;

// Skip JMP to CCustomRoadsignMgr::RenderRoadsignAtomic
MemPut<BYTE>(0x5342ED, isEnabled ? 0xEB : 0x74);

m_isRoadSignsTextEnabled = isEnabled;
}

bool CGameSA::PerformChecks()
{
std::map<std::string, SCheatSA*>::iterator it;
Expand Down
4 changes: 4 additions & 0 deletions Client/game_sa/CGameSA.h
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,9 @@ class CGameSA : public CGame
bool IsFireballDestructEnabled() const noexcept override { return m_isFireballDestructEnabled; }
void SetFireballDestructEnabled(bool isEnabled) override;

bool IsRoadSignsTextEnabled() const noexcept override { return m_isRoadSignsTextEnabled; }
void SetRoadSignsTextEnabled(bool isEnabled) override;

unsigned long GetMinuteDuration();
void SetMinuteDuration(unsigned long ulTime);

Expand Down Expand Up @@ -336,6 +339,7 @@ class CGameSA : public CGame
bool m_areWaterCreaturesEnabled{true};
bool m_isBurnFlippedCarsEnabled{true};
bool m_isFireballDestructEnabled{true};
bool m_isRoadSignsTextEnabled{true};

static unsigned int& ClumpOffset;

Expand Down
6 changes: 3 additions & 3 deletions Client/loader/MainFunctions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -863,9 +863,9 @@ void CheckDataFiles()
{
const char* expected;
const char* fileName;
} integrityCheckList[] = {{"DFACEEEB636240C0190C7B1B0145C89E", "bass.dll"}, {"FBE6A48C4E9FAAA6569C360DD49CCE06", "bass_aac.dll"},
{"E7E69A3B369F0ABA1A4A18C831BC4364", "bass_ac3.dll"}, {"8164042444F819CA107297CA4A0408F3", "bass_fx.dll"},
{"9F48DD702AB5BE002F9223E3B45A2261", "bassflac.dll"}, {"4E89426025D1E1F524495D910B60C709", "bassmidi.dll"},
} integrityCheckList[] = {{"36CB1B284BC7CBB4F25CD00BBB044550", "bass.dll"}, {"1B909B47946167D153FB94020393E781", "bass_aac.dll"},
{"E7E69A3B369F0ABA1A4A18C831BC4364", "bass_ac3.dll"}, {"E20A57EA7D845FADC9A48A0AA919121A", "bass_fx.dll"},
{"F47DCE69DAFAA06A55A4BC1F07F80C8A", "bassflac.dll"}, {"F246D72BA73E9624FE8BE66E785FB5C5", "bassmidi.dll"},
{"5DEEC10A943E352EF7E0223327E8B48C", "bassmix.dll"}, {"2F87C5E0A1B7B28C8FC0D7E74116DDFC", "bassopus.dll"},
{"0F1B2FC6C0C703A43A24DC05352E7ADA", "basswebm.dll"}, {"893113C6C49DC1E1EF288310E68DB306", "basswma.dll"},
{"C6A44FC3CF2F5801561804272217B14D", "D3DX9_42.dll"}, {"D439E8EDD8C93D7ADE9C04BCFE9197C6", "sa.dat"},
Expand Down
5 changes: 5 additions & 0 deletions Client/mods/deathmatch/logic/CClientGame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6091,6 +6091,9 @@ bool CClientGame::SetWorldSpecialProperty(WorldSpecialProperty property, bool is
case WorldSpecialProperty::FIREBALLDESTRUCT:
g_pGame->SetFireballDestructEnabled(isEnabled);
return true;
case WorldSpecialProperty::ROADSIGNSTEXT:
g_pGame->SetRoadSignsTextEnabled(isEnabled);
return true;
}
return false;
}
Expand Down Expand Up @@ -6122,6 +6125,8 @@ bool CClientGame::IsWorldSpecialProperty(WorldSpecialProperty property)
return g_pGame->IsBurnFlippedCarsEnabled();
case WorldSpecialProperty::FIREBALLDESTRUCT:
return g_pGame->IsFireballDestructEnabled();
case WorldSpecialProperty::ROADSIGNSTEXT:
return g_pGame->IsRoadSignsTextEnabled();
}
return false;
}
Expand Down
5 changes: 5 additions & 0 deletions Client/mods/deathmatch/logic/CClientIMG.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ CClientIMG::CClientIMG(class CClientManager* pManager, ElementID ID)
CClientIMG::~CClientIMG()
{
m_pImgManager->RemoveFromList(this);
Unlink();
}

void CClientIMG::Unlink()
{
if (IsStreamed())
StreamDisable();

Expand Down
2 changes: 1 addition & 1 deletion Client/mods/deathmatch/logic/CClientIMG.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class CClientIMG : public CClientEntity
CClientIMG(class CClientManager* pManager, ElementID ID);
~CClientIMG();

void Unlink(){};
void Unlink();
void GetPosition(CVector& vecPosition) const {};
void SetPosition(const CVector& vecPosition){};

Expand Down
1 change: 1 addition & 0 deletions Client/mods/deathmatch/logic/CPacketHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2387,6 +2387,7 @@ void CPacketHandler::Packet_MapInfo(NetBitStreamInterface& bitStream)
g_pClientGame->SetWorldSpecialProperty(WorldSpecialProperty::WATERCREATURES, wsProps.data.watercreatures);
g_pClientGame->SetWorldSpecialProperty(WorldSpecialProperty::BURNFLIPPEDCARS, wsProps.data.burnflippedcars);
g_pClientGame->SetWorldSpecialProperty(WorldSpecialProperty::FIREBALLDESTRUCT, wsProps.data2.fireballdestruct);
g_pClientGame->SetWorldSpecialProperty(WorldSpecialProperty::ROADSIGNSTEXT, wsProps.data3.roadsignstext);

float fJetpackMaxHeight = 100;
if (!bitStream.Read(fJetpackMaxHeight))
Expand Down
1 change: 1 addition & 0 deletions Client/mods/deathmatch/logic/luadefs/CLuaGUIDefs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,7 @@ void CLuaGUIDefs::AddGuiGridlistClass(lua_State* luaVM)
lua_classfunction(luaVM, "getSelectedCount", "guiGridListGetSelectedCount");
lua_classfunction(luaVM, "getSelectedItems", "guiGridListGetSelectedItems");
lua_classfunction(luaVM, "getColumnCount", "guiGridListGetColumnCount");
lua_classfunction(luaVM, "getColumnWidth", "guiGridListGetColumnWidth");

lua_classfunction(luaVM, "setItemData", "guiGridListSetItemData");
lua_classfunction(luaVM, "setItemText", "guiGridListSetItemText");
Expand Down
3 changes: 3 additions & 0 deletions Client/sdk/game/CGame.h
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,9 @@ class __declspec(novtable) CGame
virtual bool IsFireballDestructEnabled() const noexcept = 0;
virtual void SetFireballDestructEnabled(bool isEnabled) = 0;

virtual bool IsRoadSignsTextEnabled() const noexcept = 0;
virtual void SetRoadSignsTextEnabled(bool isEnabled) = 0;

virtual CWeapon* CreateWeapon() = 0;
virtual CWeaponStat* CreateWeaponStat(eWeaponType weaponType, eWeaponSkill weaponSkill) = 0;

Expand Down
4 changes: 3 additions & 1 deletion Server/mods/deathmatch/logic/CConsoleCommands.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -596,8 +596,10 @@ bool CConsoleCommands::Msg(CConsole* pConsole, const char* szInArguments, CClien

// Send the message and player pointer to the script
CLuaArguments Arguments;
Arguments.PushString(szArguments);
Arguments.PushString(szArguments); // We don't want to remove this for backwards compatibility reasons
Arguments.PushElement(pPlayer);
Arguments.PushString(szMessage); // Fix #2135

bool bContinue = pSender->CallEvent("onPlayerPrivateMessage", Arguments);
if (bContinue)
{
Expand Down
23 changes: 21 additions & 2 deletions Server/mods/deathmatch/logic/CGame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@ CGame::CGame() : m_FloodProtect(4, 30000, 30000) // Max of 4 connecti
m_WorldSpecialProps[WorldSpecialProperty::WATERCREATURES] = true;
m_WorldSpecialProps[WorldSpecialProperty::BURNFLIPPEDCARS] = true;
m_WorldSpecialProps[WorldSpecialProperty::FIREBALLDESTRUCT] = true;
m_WorldSpecialProps[WorldSpecialProperty::ROADSIGNSTEXT] = true;

m_JetpackWeapons[WEAPONTYPE_MICRO_UZI] = true;
m_JetpackWeapons[WEAPONTYPE_TEC9] = true;
Expand Down Expand Up @@ -1533,6 +1534,7 @@ void CGame::AddBuiltInEvents()
m_Events.AddEvent("onResourcePreStart", "resource", NULL, false);
m_Events.AddEvent("onResourceStart", "resource", NULL, false);
m_Events.AddEvent("onResourceStop", "resource, deleted", NULL, false);
m_Events.AddEvent("onResourceStateChange", "resource, oldState, newState", nullptr, false);
m_Events.AddEvent("onResourceLoadStateChange", "resource, oldState, newState", NULL, false);

// Blip events
Expand Down Expand Up @@ -1589,6 +1591,8 @@ void CGame::AddBuiltInEvents()
m_Events.AddEvent("onPlayerProjectileCreation", "weaponType, posX, posY, posZ, force, target, rotX, rotY, rotZ, velX, velY, velZ", nullptr, false);
m_Events.AddEvent("onPlayerDetonateSatchels", "", nullptr, false);
m_Events.AddEvent("onPlayerTriggerEventThreshold", "", nullptr, false);
m_Events.AddEvent("onPlayerTeamChange", "oldTeam, newTeam", nullptr, false);
m_Events.AddEvent("onPlayerTriggerInvalidEvent", "eventName, isAdded, isRemote", nullptr, false);

// Ped events
m_Events.AddEvent("onPedVehicleEnter", "vehicle, seat, jacked", NULL, false);
Expand Down Expand Up @@ -2571,11 +2575,26 @@ void CGame::Packet_LuaEvent(CLuaEventPacket& Packet)
pElement->CallEvent(szName, *pArguments, pCaller);
}
else
{
CLuaArguments arguments;
arguments.PushString(szName);
arguments.PushBoolean(true);
arguments.PushBoolean(false);
pCaller->CallEvent("onPlayerTriggerInvalidEvent", arguments);
m_pScriptDebugging->LogError(NULL, "Client (%s) triggered serverside event %s, but event is not marked as remotely triggerable",
pCaller->GetNick(), szName);
}

}
else
m_pScriptDebugging->LogError(NULL, "Client (%s) triggered serverside event %s, but event is not added serverside", pCaller->GetNick(), szName);
else
{
CLuaArguments arguments;
arguments.PushString(szName);
arguments.PushBoolean(false);
arguments.PushBoolean(false);
pCaller->CallEvent("onPlayerTriggerInvalidEvent", arguments);
m_pScriptDebugging->LogError(NULL, "Client (%s) triggered serverside event %s, but event is not added serverside", pCaller->GetNick(), szName);
}

RegisterClientTriggeredEventUsage(pCaller);
}
Expand Down
1 change: 1 addition & 0 deletions Server/mods/deathmatch/logic/CMainConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1455,6 +1455,7 @@ const std::vector<SIntSetting>& CMainConfig::GetIntSettingList()
{true, true, 10, 50, 1000, "update_cycle_messages_limit", &m_iUpdateCycleMessagesLimit, &CMainConfig::ApplyNetOptions},
{true, true, 50, 100, 400, "ped_syncer_distance", &g_TickRateSettings.iPedSyncerDistance, &CMainConfig::OnTickRateChange},
{true, true, 50, 130, 400, "unoccupied_vehicle_syncer_distance", &g_TickRateSettings.iUnoccupiedVehicleSyncerDistance, &CMainConfig::OnTickRateChange},
{true, true, 0, 30, 130, "vehicle_contact_sync_radius", &g_TickRateSettings.iVehicleContactSyncRadius, &CMainConfig::OnTickRateChange},
{false, false, 0, 1, 2, "compact_internal_databases", &m_iCompactInternalDatabases, NULL},
{true, true, 0, 1, 2, "minclientversion_auto_update", &m_iMinClientVersionAutoUpdate, NULL},
{true, true, 0, 0, 100, "server_logic_fps_limit", &m_iServerLogicFpsLimit, NULL},
Expand Down
Loading

0 comments on commit 96c3175

Please sign in to comment.