diff --git a/Client/core/CClientVariables.cpp b/Client/core/CClientVariables.cpp index 8019c2687b..0397dbf264 100644 --- a/Client/core/CClientVariables.cpp +++ b/Client/core/CClientVariables.cpp @@ -256,6 +256,7 @@ void CClientVariables::ValidateValues() ClampValue("mtavolume", 0.0f, 1.0f); ClampValue("voicevolume", 0.0f, 1.0f); ClampValue("mapalpha", 0, 255); + ClampValue("mapimage", 0, 1); } void CClientVariables::LoadDefaults() @@ -313,7 +314,8 @@ void CClientVariables::LoadDefaults() DEFAULT("mastervolume", 1.0f); // master volume DEFAULT("mtavolume", 1.0f); // custom sound's volume DEFAULT("voicevolume", 1.0f); // voice chat output volume - DEFAULT("mapalpha", 155); // map alpha + DEFAULT("mapalpha", 155); // player map alpha + DEFAULT("mapimage", 0); // player map image DEFAULT("browser_speed", 1); // Browser speed DEFAULT("single_download", 0); // Single connection for downloads DEFAULT("packet_tag", 0); // Tag network packets diff --git a/Client/core/CConsole.h b/Client/core/CConsole.h index 5899fa645d..677e1133ff 100644 --- a/Client/core/CConsole.h +++ b/Client/core/CConsole.h @@ -41,7 +41,6 @@ class CConsole : public CConsoleInterface bool IsInputActive(); void ActivateInput(); - void HandleTextAccepted(bool bHandled); void GetCommandInfo(const std::string& strIn, std::string& strCmdOut, std::string& strCmdLineOut); void ResetHistoryChanges(); diff --git a/Client/core/CNickGen.cpp b/Client/core/CNickGen.cpp index a4cb2738e2..f877588539 100644 --- a/Client/core/CNickGen.cpp +++ b/Client/core/CNickGen.cpp @@ -8,10 +8,10 @@ *****************************************************************************/ #include "StdInc.h" -#include "time.h" +#include // These words are of a maximum length of 10 characters, capitalized, and stripped of whitespace -const char* const CNickGen::m_szAdjectives[] = { +const char* const szAdjectives[] = { "Aback", "Abaft", "Abandoned", "Abashed", "Aberrant", "Abhorrent", "Abiding", "Abject", "Ablaze", "Able", "Abnormal", "Aboard", "Aboriginal", "Abortive", "Abounding", "Abrasive", "Abrupt", "Absent", "Absorbed", "Absorbing", "Abstracted", "Absurd", "Abundant", "Abusive", "Acceptable", "Accessible", "Accidental", "Accurate", "Acid", "Acidic", "Acoustic", "Acrid", "Actually", @@ -109,7 +109,7 @@ const char* const CNickGen::m_szAdjectives[] = { "Worried", "Worthless", "Wrathful", "Wretched", "Wrong", "Wry", }; -const char* const CNickGen::m_szNouns[] = { +const char* const szNouns[] = { "Aardvark", "Buffalo", "Alligator", "Ant", "Anteater", "Antelope", "Ape", "Armadillo", "Donkey", "Baboon", "Badger", "Barracuda", "Bat", "Bear", "Beaver", "Bee", "Bison", "Boar", "Bush", "Butterfly", "Camel", "Calf", "Cat", "Kitten", "Cattle", "Chamois", "Cheetah", "Chicken", "Chick", "Chimpanzee", "Infant", "Empress", "Troop", @@ -196,10 +196,18 @@ const char* const CNickGen::m_szNouns[] = { "Vampire", "Parasite", "Tramp", "Bum", "Hobo", "Hitchhiker", "Deadbeat", "Acrobat", }; +constexpr auto numAdjectives = std::size(szAdjectives); +constexpr auto numNouns = std::size(szNouns); +constexpr auto maxNum = 100; + SString CNickGen::GetRandomNickname() { - srand((unsigned int)time(NULL)); - int iAdjective = rand() % NICKGEN_NUM_ADJECTIVES; - int iNoun = rand() % NICKGEN_NUM_NOUNS; - return SString("%s%s%i", m_szAdjectives[iAdjective], m_szNouns[iNoun], rand() % 100); + std::random_device rd; + std::mt19937 gen(rd()); + + std::uniform_int_distribution adjectiveDist(0, numAdjectives - 1); + std::uniform_int_distribution nounDist(0, numNouns - 1); + std::uniform_int_distribution numDist(0, maxNum); + + return SString("%s%s%i", szAdjectives[adjectiveDist(gen)], szNouns[nounDist(gen)], numDist(gen)); } diff --git a/Client/core/CNickGen.h b/Client/core/CNickGen.h index b98254f01b..86a3699072 100644 --- a/Client/core/CNickGen.h +++ b/Client/core/CNickGen.h @@ -9,13 +9,8 @@ #pragma once -#define NICKGEN_NUM_ADJECTIVES 1048 -#define NICKGEN_NUM_NOUNS 934 - class CNickGen { public: - static const char* const m_szAdjectives[NICKGEN_NUM_ADJECTIVES]; - static const char* const m_szNouns[NICKGEN_NUM_NOUNS]; static SString GetRandomNickname(); }; diff --git a/Client/core/CSettings.cpp b/Client/core/CSettings.cpp index 1cfe5c90eb..6792bac450 100644 --- a/Client/core/CSettings.cpp +++ b/Client/core/CSettings.cpp @@ -376,7 +376,7 @@ void CSettings::CreateGUI() m_pButtonGenerateNickIcon->SetProperty("DistributeCapturedInputs", "True"); m_pSavePasswords = reinterpret_cast(pManager->CreateCheckBox(pTabMultiplayer, _("Save server passwords"), true)); - m_pSavePasswords->SetPosition(CVector2D(vecTemp.fX, vecTemp.fY + 50.0f)); + m_pSavePasswords->SetPosition(CVector2D(vecTemp.fX, vecTemp.fY + 35.0f)); m_pSavePasswords->GetPosition(vecTemp, false); m_pSavePasswords->AutoSize(NULL, 20.0f); @@ -411,11 +411,13 @@ void CSettings::CreateGUI() m_pCheckBoxCustomizedSAFiles->AutoSize(NULL, 20.0f); m_pMapRenderingLabel = reinterpret_cast(pManager->CreateLabel(pTabMultiplayer, _("Map rendering options"))); - m_pMapRenderingLabel->SetPosition(CVector2D(vecTemp.fX, vecTemp.fY + 29.0f)); + m_pMapRenderingLabel->SetPosition(CVector2D(vecTemp.fX, vecTemp.fY + 30.0f)); m_pMapRenderingLabel->GetPosition(vecTemp, false); m_pMapRenderingLabel->SetFont("default-bold-small"); m_pMapRenderingLabel->AutoSize(); + vecTemp.fX += 5.0f; + m_pMapAlphaLabel = reinterpret_cast(pManager->CreateLabel(pTabMultiplayer, _("Opacity:"))); m_pMapAlphaLabel->SetPosition(CVector2D(vecTemp.fX, vecTemp.fY + 24.0f)); m_pMapAlphaLabel->GetPosition(vecTemp, false); @@ -433,6 +435,20 @@ void CSettings::CreateGUI() m_pMapAlphaValueLabel->GetPosition(vecTemp, false); m_pMapAlphaValueLabel->AutoSize("100%"); + m_pMapAlphaLabel->GetPosition(vecTemp, false); + vecTemp.fY += 24.0f; + + m_pPlayerMapImageLabel = reinterpret_cast(pManager->CreateLabel(pTabMultiplayer, _("Image resolution:"))); + m_pPlayerMapImageLabel->SetPosition(CVector2D(vecTemp.fX, vecTemp.fY + 2.0f)); + m_pPlayerMapImageLabel->AutoSize(); + + m_pPlayerMapImageCombo = reinterpret_cast(pManager->CreateComboBox(pTabMultiplayer, "")); + m_pPlayerMapImageCombo->SetPosition(CVector2D(vecTemp.fX + fIndentX + 5.0f, vecTemp.fY - 1.0f)); + m_pPlayerMapImageCombo->SetSize(CVector2D(170.f, 95.0f)); + m_pPlayerMapImageCombo->AddItem(_("1024 x 1024 (Default)")); // index 0 + m_pPlayerMapImageCombo->AddItem(_("2048 x 2048")); // index 1 + m_pPlayerMapImageCombo->SetReadOnly(true); + /** * Audio tab **/ @@ -625,16 +641,13 @@ void CSettings::CreateGUI() * Video tab **/ fIndentX = pManager->CGUI_GetMaxTextExtent("default-normal", _("Resolution:"), _("FOV:"), _("Draw Distance:"), _("Brightness:"), _("FX Quality:"), - _("Anisotropic filtering:"), _("Anti-aliasing:"), _("Aspect Ratio:"), _("Opacity:")); + _("Anisotropic filtering:"), _("Anti-aliasing:"), _("Aspect Ratio:")); - m_pVideoGeneralLabel = reinterpret_cast(pManager->CreateLabel(pTabVideo, _("General"))); - m_pVideoGeneralLabel->SetPosition(CVector2D(11, 13)); - m_pVideoGeneralLabel->GetPosition(vecTemp, false); - m_pVideoGeneralLabel->AutoSize(NULL, 3.0f); - m_pVideoGeneralLabel->SetFont("default-bold-small"); + vecTemp.fX = 11.0f; + vecTemp.fY = 13.0f; m_pVideoResolutionLabel = reinterpret_cast(pManager->CreateLabel(pTabVideo, _("Resolution:"))); - m_pVideoResolutionLabel->SetPosition(CVector2D(vecTemp.fX, vecTemp.fY + 26.0f)); + m_pVideoResolutionLabel->SetPosition(CVector2D(vecTemp.fX, vecTemp.fY)); m_pVideoResolutionLabel->GetPosition(vecTemp, false); m_pVideoResolutionLabel->AutoSize(); @@ -833,6 +846,10 @@ void CSettings::CreateGUI() m_pCheckBoxBlur->SetPosition(CVector2D(vecTemp.fX, vecTemp.fY + 130.0f)); m_pCheckBoxBlur->AutoSize(NULL, 20.0f); + m_pCheckBoxCoronaReflections = reinterpret_cast(pManager->CreateCheckBox(pTabVideo, _("Corona rain reflections"), true)); + m_pCheckBoxCoronaReflections->SetPosition(CVector2D(vecTemp.fX, vecTemp.fY + 150.0f)); + m_pCheckBoxCoronaReflections->AutoSize(nullptr, 20.0f); + float fPosY = vecTemp.fY; m_pCheckBoxMinimize = reinterpret_cast(pManager->CreateCheckBox(pTabVideo, _("Full Screen Minimize"), true)); m_pCheckBoxMinimize->SetPosition(CVector2D(vecTemp.fX + 245.0f, fPosY + 30.0f)); @@ -878,10 +895,6 @@ void CSettings::CreateGUI() m_pCheckBoxHighDetailPeds->SetPosition(CVector2D(vecTemp.fX + 245.0f, fPosY + 110.0f)); m_pCheckBoxHighDetailPeds->AutoSize(NULL, 20.0f); - m_pCheckBoxCoronaReflections = reinterpret_cast(pManager->CreateCheckBox(pTabVideo, _("Corona rain reflections"), true)); - m_pCheckBoxCoronaReflections->SetPosition(CVector2D(vecTemp.fX + 245.0f, fPosY + 130.0f)); - m_pCheckBoxCoronaReflections->AutoSize(NULL, 20.0f); - vecTemp.fY += 10; m_pTabs->GetSize(vecTemp); @@ -1010,6 +1023,7 @@ void CSettings::CreateGUI() 5.0f; vecTemp.fX += 10.0f; + // Fast clothes loading m_pFastClothesLabel = reinterpret_cast(pManager->CreateLabel(pTabAdvanced, _("Fast CJ clothes loading:"))); m_pFastClothesLabel->SetPosition(CVector2D(vecTemp.fX, vecTemp.fY)); @@ -1238,7 +1252,7 @@ void CSettings::CreateGUI() vecTemp.fX -= fComboWidth + 15; // Description label - vecTemp.fY = 354 + 10; + vecTemp.fY += 15.0f; m_pAdvancedSettingDescriptionLabel = reinterpret_cast(pManager->CreateLabel(pTabAdvanced, "")); m_pAdvancedSettingDescriptionLabel->SetPosition(CVector2D(vecTemp.fX + 10.f, vecTemp.fY)); m_pAdvancedSettingDescriptionLabel->SetFont("default-bold-small"); @@ -1629,12 +1643,17 @@ void CSettings::UpdateVideoTab() float fPos = SharedUtil::Unlerp(g_pCore->GetMinStreamingMemory(), uiStreamingMemory, g_pCore->GetMaxStreamingMemory()); m_pStreamingMemory->SetScrollPosition(fPos); + // Player map alpha int iVar = 0; CVARS_GET("mapalpha", iVar); int iAlphaPercent = ceil(((float)Clamp(0, iVar, 255) / 255) * 100); m_pMapAlphaValueLabel->SetText(SString("%i%%", iAlphaPercent).c_str()); float sbPos = (float)iAlphaPercent / 100.0f; m_pMapAlpha->SetScrollPosition(sbPos); + + // Player map image + CVARS_GET("mapimage", iVar); + m_pPlayerMapImageCombo->SetSelectedItemByIndex(iVar); } // @@ -1851,7 +1870,9 @@ bool CSettings::OnVideoDefaultClick(CGUIElement* pElement) CVARS_SET("streaming_memory", g_pCore->GetMaxStreamingMemory()); + // Player map defaults CVARS_SET("mapalpha", 155); + CVARS_SET("mapimage", 0); // Display restart required message if required bool bIsAntiAliasingChanged = gameSettings->GetAntiAliasing() != m_pComboAntiAliasing->GetSelectedItemIndex(); @@ -3609,12 +3630,16 @@ void CSettings::SaveData() CVARS_SET("update_auto_install", iSelected); } - // Map alpha + // Player map alpha SString sText = m_pMapAlphaValueLabel->GetText(); - float fMapAlpha = ((atof(sText.substr(0, sText.length() - 1).c_str())) / 100) * 255; CVARS_SET("mapalpha", fMapAlpha); + // Player map image + int selectedComboIndex = m_pPlayerMapImageCombo->GetSelectedItemIndex(); + if (selectedComboIndex != -1) + CVARS_SET("mapimage", selectedComboIndex); + // Language CGUIListItem* pItem = m_pInterfaceLanguageSelector->GetSelectedItem(); if (pItem) diff --git a/Client/core/CSettings.h b/Client/core/CSettings.h index db6c077df4..9c288557e6 100644 --- a/Client/core/CSettings.h +++ b/Client/core/CSettings.h @@ -196,6 +196,8 @@ class CSettings CGUIComboBox* m_pFullscreenStyleCombo; CGUILabel* m_pPriorityLabel; CGUIComboBox* m_pPriorityCombo; + CGUILabel* m_pPlayerMapImageLabel; + CGUIComboBox* m_pPlayerMapImageCombo; CGUILabel* m_pFastClothesLabel; CGUIComboBox* m_pFastClothesCombo; CGUILabel* m_pAudioGeneralLabel; diff --git a/Client/game_sa/CGameSA.cpp b/Client/game_sa/CGameSA.cpp index 07ac611c09..918091d482 100644 --- a/Client/game_sa/CGameSA.cpp +++ b/Client/game_sa/CGameSA.cpp @@ -848,6 +848,34 @@ void CGameSA::SetRoadSignsTextEnabled(bool isEnabled) m_isRoadSignsTextEnabled = isEnabled; } +void CGameSA::SetIgnoreFireStateEnabled(bool isEnabled) +{ + if (isEnabled == m_isIgnoreFireStateEnabled) + return; + + if (isEnabled) + { + MemSet((void*)0x6511B9, 0x90, 10); // CCarEnterExit::IsVehicleStealable + MemSet((void*)0x643A95, 0x90, 14); // CTaskComplexEnterCar::CreateFirstSubTask + MemSet((void*)0x6900B5, 0x90, 14); // CTaskComplexCopInCar::ControlSubTask + MemSet((void*)0x64F3DB, 0x90, 14); // CCarEnterExit::IsPlayerToQuitCarEnter + + MemSet((void*)0x685A7F, 0x90, 14); // CTaskSimplePlayerOnFoot::ProcessPlayerWeapon + } + else + { + // Restore original bytes + MemCpy((void*)0x6511B9, "\x88\x86\x90\x04\x00\x00\x85\xC0\x75\x3E", 10); + MemCpy((void*)0x643A95, "\x8B\x88\x90\x04\x00\x00\x85\xC9\x0F\x85\x99\x01\x00\x00", 14); + MemCpy((void*)0x6900B5, "\x8B\x81\x90\x04\x00\x00\x85\xC0\x0F\x85\x1A\x01\x00\x00", 14); + MemCpy((void*)0x64F3DB, "\x8B\x85\x90\x04\x00\x00\x85\xC0\x0F\x85\x1B\x01\x00\x00", 14); + + MemCpy((void*)0x685A7F, "\x8B\x86\x30\x07\x00\x00\x85\xC0\x0F\x85\x1D\x01\x00\x00", 14); + } + + m_isIgnoreFireStateEnabled = isEnabled; +} + bool CGameSA::PerformChecks() { std::map::iterator it; diff --git a/Client/game_sa/CGameSA.h b/Client/game_sa/CGameSA.h index cf4788d953..33731af858 100644 --- a/Client/game_sa/CGameSA.h +++ b/Client/game_sa/CGameSA.h @@ -249,6 +249,8 @@ class CGameSA : public CGame bool IsTunnelWeatherBlendEnabled() const noexcept override { return m_isTunnelWeatherBlendEnabled; } void SetTunnelWeatherBlendEnabled(bool isEnabled) override; + bool IsIgnoreFireStateEnabled() const noexcept override { return m_isIgnoreFireStateEnabled; } + void SetIgnoreFireStateEnabled(bool isEnabled) override; unsigned long GetMinuteDuration(); void SetMinuteDuration(unsigned long ulTime); @@ -378,6 +380,7 @@ class CGameSA : public CGame bool m_isRoadSignsTextEnabled{true}; bool m_isBuildingsRemoved{false}; bool m_isExtendedWaterCannonsEnabled{false}; + bool m_isIgnoreFireStateEnabled{false}; static unsigned int& ClumpOffset; diff --git a/Client/mods/deathmatch/CClient.cpp b/Client/mods/deathmatch/CClient.cpp index ec17655996..e532ef2f71 100644 --- a/Client/mods/deathmatch/CClient.cpp +++ b/Client/mods/deathmatch/CClient.cpp @@ -64,17 +64,17 @@ int CClient::ClientInitialize(const char* szArguments, CCoreInterface* pCore) g_pCore->GetCommands()->Add("enter_passenger", _("enters a car as passenger"), COMMAND_EnterPassenger, true, true); g_pCore->GetCommands()->Add("radio_next", _("next radio channel"), COMMAND_RadioNext, true, true); g_pCore->GetCommands()->Add("radio_previous", _("previous radio channel"), COMMAND_RadioPrevious, true, true); - g_pCore->GetCommands()->Add("radar", _("enables the radar view"), COMMAND_RadarMap, true, true); - g_pCore->GetCommands()->Add("radar_zoom_in", _("zooms the radar in"), COMMAND_RadarZoomIn, true, true); - g_pCore->GetCommands()->Add("radar_zoom_out", _("zooms the radar out"), COMMAND_RadarZoomOut, true, true); - g_pCore->GetCommands()->Add("radar_move_north", _("moves the radar north"), COMMAND_RadarMoveNorth, true, true); - g_pCore->GetCommands()->Add("radar_move_south", _("moves the radar south"), COMMAND_RadarMoveSouth, true, true); - g_pCore->GetCommands()->Add("radar_move_east", _("moves the radar east"), COMMAND_RadarMoveEast, true, true); - g_pCore->GetCommands()->Add("radar_move_west", _("moves the radar west"), COMMAND_RadarMoveWest, true, true); - g_pCore->GetCommands()->Add("radar_attach", _("attaches the radar"), COMMAND_RadarAttach, true, true); - g_pCore->GetCommands()->Add("radar_opacity_down", _("reduces radar opacity"), COMMAND_RadarOpacityDown, true, true); - g_pCore->GetCommands()->Add("radar_opacity_up", _("increases radar opacity"), COMMAND_RadarOpacityUp, true, true); - g_pCore->GetCommands()->Add("radar_help", _("toggles radar help text"), COMMAND_RadarHelp, true, true); + g_pCore->GetCommands()->Add("radar", _("enables the player-map view"), COMMAND_PlayerMap, true, true); + g_pCore->GetCommands()->Add("radar_zoom_in", _("zooms the player-map in"), COMMAND_PlayerMapZoomIn, true, true); + g_pCore->GetCommands()->Add("radar_zoom_out", _("zooms the player-map out"), COMMAND_PlayerMapZoomOut, true, true); + g_pCore->GetCommands()->Add("radar_move_north", _("moves the player-map north"), COMMAND_PlayerMapMoveNorth, true, true); + g_pCore->GetCommands()->Add("radar_move_south", _("moves the player-map south"), COMMAND_PlayerMapMoveSouth, true, true); + g_pCore->GetCommands()->Add("radar_move_east", _("moves the player-map east"), COMMAND_PlayerMapMoveEast, true, true); + g_pCore->GetCommands()->Add("radar_move_west", _("moves the player-map west"), COMMAND_PlayerMapMoveWest, true, true); + g_pCore->GetCommands()->Add("radar_attach", _("attaches the player-map"), COMMAND_PlayerMapAttach, true, true); + g_pCore->GetCommands()->Add("radar_opacity_down", _("reduces player-map opacity"), COMMAND_PlayerMapOpacityDown, true, true); + g_pCore->GetCommands()->Add("radar_opacity_up", _("increases player-map opacity"), COMMAND_PlayerMapOpacityUp, true, true); + g_pCore->GetCommands()->Add("radar_help", _("toggles player-map help text"), COMMAND_PlayerMapHelp, true, true); g_pCore->GetCommands()->Add("msg_target", _("sends a message to the targetted player"), COMMAND_MessageTarget, true); g_pCore->GetCommands()->Add("vehicle_next_weapon", _("changes to the next weapon whilst in a vehicle"), COMMAND_VehicleNextWeapon, true); g_pCore->GetCommands()->Add("vehicle_previous_weapon", _("changes to the previous weapon whilst in a vehicle"), COMMAND_VehiclePreviousWeapon, true); diff --git a/Client/mods/deathmatch/ClientCommands.cpp b/Client/mods/deathmatch/ClientCommands.cpp index 6ca4d73625..123ee59dcb 100644 --- a/Client/mods/deathmatch/ClientCommands.cpp +++ b/Client/mods/deathmatch/ClientCommands.cpp @@ -235,154 +235,137 @@ void COMMAND_Screenshot ( const char* szCmdLine ) } */ -void COMMAND_RadarMap(const char* szCmdLine) +void COMMAND_PlayerMap(const char* szCmdLine) { - int iCmd = (szCmdLine && szCmdLine[0]) ? atoi(szCmdLine) : -1; - bool bShow = (iCmd == 1) ? true : (iCmd == 0) ? false : !g_pClientGame->GetRadarMap()->GetRadarEnabled(); - g_pClientGame->GetRadarMap()->SetRadarEnabled(bShow); + int cmd = (szCmdLine && szCmdLine[0]) ? atoi(szCmdLine) : -1; + bool show = (cmd == 1) ? true : (cmd == 0) ? false : !g_pClientGame->GetPlayerMap()->GetPlayerMapEnabled(); + g_pClientGame->GetPlayerMap()->SetPlayerMapEnabled(show); } -void COMMAND_RadarZoomIn(const char* szCmdLine) +void COMMAND_PlayerMapZoomIn(const char* szCmdLine) { - CRadarMap* pRadarMap = g_pClientGame->GetRadarMap(); - - if (pRadarMap->IsRadarShowing()) - { - pRadarMap->ZoomIn(); - } + CPlayerMap* playerMap = g_pClientGame->GetPlayerMap(); + if (playerMap->IsPlayerMapShowing()) + playerMap->ZoomIn(); } -void COMMAND_RadarZoomOut(const char* szCmdLine) +void COMMAND_PlayerMapZoomOut(const char* szCmdLine) { - CRadarMap* pRadarMap = g_pClientGame->GetRadarMap(); - - if (pRadarMap->IsRadarShowing()) - { - pRadarMap->ZoomOut(); - } + CPlayerMap* playerMap = g_pClientGame->GetPlayerMap(); + if (playerMap->IsPlayerMapShowing()) + playerMap->ZoomOut(); } -void COMMAND_RadarMoveNorth(const char* szCmdLine) +void COMMAND_PlayerMapMoveNorth(const char* szCmdLine) { - CRadarMap* pRadarMap = g_pClientGame->GetRadarMap(); + CPlayerMap* playerMap = g_pClientGame->GetPlayerMap(); + if (!playerMap->IsPlayerMapShowing()) + return; - if (pRadarMap->IsRadarShowing()) + if (playerMap->IsMovingNorth()) + playerMap->SetMovingNorth(false); + else if (playerMap->IsMovingSouth()) + playerMap->SetMovingSouth(false); + else { - // Toggle on/off - if (pRadarMap->IsMovingNorth()) - pRadarMap->SetMovingNorth(false); - else if (pRadarMap->IsMovingSouth()) - pRadarMap->SetMovingSouth(false); - else - { - pRadarMap->SetMovingNorth(true); - pRadarMap->SetMovingSouth(false); - pRadarMap->SetMovingEast(false); - pRadarMap->SetMovingWest(false); - } + playerMap->SetMovingNorth(true); + playerMap->SetMovingSouth(false); + playerMap->SetMovingEast(false); + playerMap->SetMovingWest(false); } } -void COMMAND_RadarMoveSouth(const char* szCmdLine) +void COMMAND_PlayerMapMoveSouth(const char* szCmdLine) { - CRadarMap* pRadarMap = g_pClientGame->GetRadarMap(); + CPlayerMap* playerMap = g_pClientGame->GetPlayerMap(); + if (!playerMap->IsPlayerMapShowing()) + return; - if (pRadarMap->IsRadarShowing()) + if (playerMap->IsMovingSouth()) + playerMap->SetMovingSouth(false); + else if (playerMap->IsMovingNorth()) + playerMap->SetMovingNorth(false); + else { - // Toggle on/off - if (pRadarMap->IsMovingSouth()) - pRadarMap->SetMovingSouth(false); - else if (pRadarMap->IsMovingNorth()) - pRadarMap->SetMovingNorth(false); - else - { - pRadarMap->SetMovingNorth(false); - pRadarMap->SetMovingSouth(true); - pRadarMap->SetMovingEast(false); - pRadarMap->SetMovingWest(false); - } + playerMap->SetMovingNorth(false); + playerMap->SetMovingSouth(true); + playerMap->SetMovingEast(false); + playerMap->SetMovingWest(false); } } -void COMMAND_RadarMoveEast(const char* szCmdLine) +void COMMAND_PlayerMapMoveEast(const char* szCmdLine) { - CRadarMap* pRadarMap = g_pClientGame->GetRadarMap(); + CPlayerMap* playerMap = g_pClientGame->GetPlayerMap(); + if (!playerMap->IsPlayerMapShowing()) + return; - if (pRadarMap->IsRadarShowing()) + if (playerMap->IsMovingEast()) + playerMap->SetMovingEast(false); + else if (playerMap->IsMovingWest()) + playerMap->SetMovingWest(false); + else { - // Toggle on/off - if (pRadarMap->IsMovingEast()) - pRadarMap->SetMovingEast(false); - else if (pRadarMap->IsMovingWest()) - pRadarMap->SetMovingWest(false); - else - { - pRadarMap->SetMovingNorth(false); - pRadarMap->SetMovingSouth(false); - pRadarMap->SetMovingEast(true); - pRadarMap->SetMovingWest(false); - } + playerMap->SetMovingNorth(false); + playerMap->SetMovingSouth(false); + playerMap->SetMovingEast(true); + playerMap->SetMovingWest(false); } } -void COMMAND_RadarMoveWest(const char* szCmdLine) +void COMMAND_PlayerMapMoveWest(const char* szCmdLine) { - CRadarMap* pRadarMap = g_pClientGame->GetRadarMap(); + CPlayerMap* playerMap = g_pClientGame->GetPlayerMap(); + if (!playerMap->IsPlayerMapShowing()) + return; - if (pRadarMap->IsRadarShowing()) + if (playerMap->IsMovingWest()) + playerMap->SetMovingWest(false); + else if (playerMap->IsMovingEast()) + playerMap->SetMovingEast(false); + else { - // Toggle on/off - if (pRadarMap->IsMovingWest()) - pRadarMap->SetMovingWest(false); - else if (pRadarMap->IsMovingEast()) - pRadarMap->SetMovingEast(false); - else - { - pRadarMap->SetMovingNorth(false); - pRadarMap->SetMovingSouth(false); - pRadarMap->SetMovingEast(false); - pRadarMap->SetMovingWest(true); - } + playerMap->SetMovingNorth(false); + playerMap->SetMovingSouth(false); + playerMap->SetMovingEast(false); + playerMap->SetMovingWest(true); } } -void COMMAND_RadarAttach(const char* szCmdLine) +void COMMAND_PlayerMapAttach(const char* szCmdLine) { - CRadarMap* pRadarMap = g_pClientGame->GetRadarMap(); - - if (pRadarMap->IsRadarShowing()) - { - pRadarMap->SetAttachedToLocalPlayer(!g_pClientGame->GetRadarMap()->IsAttachedToLocalPlayer()); - } + CPlayerMap* playerMap = g_pClientGame->GetPlayerMap(); + if (playerMap->IsPlayerMapShowing()) + playerMap->SetAttachedToLocalPlayer(!g_pClientGame->GetPlayerMap()->IsAttachedToLocalPlayer()); } -void COMMAND_RadarOpacityDown(const char* szCmdLine) +void COMMAND_PlayerMapOpacityDown(const char* szCmdLine) { - CRadarMap* pRadarMap = g_pClientGame->GetRadarMap(); - if (pRadarMap->IsRadarShowing()) - { - int iAlpha; - g_pCore->GetCVars()->Get("mapalpha", iAlpha); - iAlpha = std::max(0, iAlpha - 20); - g_pCore->GetCVars()->Set("mapalpha", iAlpha); - } + CPlayerMap* playerMap = g_pClientGame->GetPlayerMap(); + if (!playerMap->IsPlayerMapShowing()) + return; + + int mapAlpha; + g_pCore->GetCVars()->Get("mapalpha", mapAlpha); + mapAlpha = std::max(0, mapAlpha - 20); + g_pCore->GetCVars()->Set("mapalpha", mapAlpha); } -void COMMAND_RadarOpacityUp(const char* szCmdLine) +void COMMAND_PlayerMapOpacityUp(const char* szCmdLine) { - CRadarMap* pRadarMap = g_pClientGame->GetRadarMap(); - if (pRadarMap->IsRadarShowing()) - { - int iAlpha; - g_pCore->GetCVars()->Get("mapalpha", iAlpha); - iAlpha = std::min(255, iAlpha + 20); - g_pCore->GetCVars()->Set("mapalpha", iAlpha); - } + CPlayerMap* playerMap = g_pClientGame->GetPlayerMap(); + if (!playerMap->IsPlayerMapShowing()) + return; + + int mapAlpha; + g_pCore->GetCVars()->Get("mapalpha", mapAlpha); + mapAlpha = std::min(255, mapAlpha + 20); + g_pCore->GetCVars()->Set("mapalpha", mapAlpha); } -void COMMAND_RadarHelp(const char* szCmdLine) +void COMMAND_PlayerMapHelp(const char* szCmdLine) { - g_pClientGame->GetRadarMap()->ToggleHelpText(); + g_pClientGame->GetPlayerMap()->ToggleHelpText(); } void COMMAND_MessageTarget(const char* szCmdLine) diff --git a/Client/mods/deathmatch/ClientCommands.h b/Client/mods/deathmatch/ClientCommands.h index c6aa755099..af31db12d4 100644 --- a/Client/mods/deathmatch/ClientCommands.h +++ b/Client/mods/deathmatch/ClientCommands.h @@ -21,17 +21,17 @@ void COMMAND_ShowNetstat(const char* szCmdLine); void COMMAND_EnterPassenger(const char* szCmdLine); void COMMAND_RadioNext(const char* szCmdLine); void COMMAND_RadioPrevious(const char* szCmdLine); -void COMMAND_RadarMap(const char* szCmdLine); -void COMMAND_RadarZoomIn(const char* szCmdLine); -void COMMAND_RadarZoomOut(const char* szCmdLine); -void COMMAND_RadarMoveNorth(const char* szCmdLine); -void COMMAND_RadarMoveSouth(const char* szCmdLine); -void COMMAND_RadarMoveEast(const char* szCmdLine); -void COMMAND_RadarMoveWest(const char* szCmdLine); -void COMMAND_RadarAttach(const char* szCmdLine); -void COMMAND_RadarOpacityDown(const char* szCmdLine); -void COMMAND_RadarOpacityUp(const char* szCmdLine); -void COMMAND_RadarHelp(const char* szCmdLine); +void COMMAND_PlayerMap(const char* szCmdLine); +void COMMAND_PlayerMapZoomIn(const char* szCmdLine); +void COMMAND_PlayerMapZoomOut(const char* szCmdLine); +void COMMAND_PlayerMapMoveNorth(const char* szCmdLine); +void COMMAND_PlayerMapMoveSouth(const char* szCmdLine); +void COMMAND_PlayerMapMoveEast(const char* szCmdLine); +void COMMAND_PlayerMapMoveWest(const char* szCmdLine); +void COMMAND_PlayerMapAttach(const char* szCmdLine); +void COMMAND_PlayerMapOpacityDown(const char* szCmdLine); +void COMMAND_PlayerMapOpacityUp(const char* szCmdLine); +void COMMAND_PlayerMapHelp(const char* szCmdLine); void COMMAND_MessageTarget(const char* szCmdLine); void COMMAND_VehicleNextWeapon(const char* szCmdLine); void COMMAND_VehiclePreviousWeapon(const char* szCmdLine); diff --git a/Client/mods/deathmatch/logic/CClientGame.cpp b/Client/mods/deathmatch/logic/CClientGame.cpp index 429bafb365..7169125a24 100644 --- a/Client/mods/deathmatch/logic/CClientGame.cpp +++ b/Client/mods/deathmatch/logic/CClientGame.cpp @@ -135,6 +135,7 @@ CClientGame::CClientGame(bool bLocalPlay) : m_ServerInfo(new CServerInfo()) m_Glitches[GLITCH_BADDRIVEBYHITBOX] = false; m_Glitches[GLITCH_QUICKSTAND] = false; m_Glitches[GLITCH_KICKOUTOFVEHICLE_ONMODELREPLACE] = false; + g_pMultiplayer->DisableBadDrivebyHitboxes(true); // Remove Night & Thermal vision view (if enabled). @@ -227,7 +228,7 @@ CClientGame::CClientGame(bool bLocalPlay) : m_ServerInfo(new CServerInfo()) m_pObjectSync = new CObjectSync(m_pObjectManager); #endif m_pNametags = new CNametags(m_pManager); - m_pRadarMap = new CRadarMap(m_pManager); + m_pPlayerMap = new CPlayerMap(m_pManager); // Set the screenshot path /* This is now done in CCore, to maintain a global screenshot path @@ -548,7 +549,7 @@ CClientGame::~CClientGame() #endif SAFE_DELETE(m_pBlendedWeather); SAFE_DELETE(m_pMovingObjectsManager); - SAFE_DELETE(m_pRadarMap); + SAFE_DELETE(m_pPlayerMap); SAFE_DELETE(m_pRemoteCalls); SAFE_DELETE(m_pLuaManager); SAFE_DELETE(m_pLatentTransferManager); @@ -1097,7 +1098,7 @@ void CClientGame::DoPulsePostFrame() CClientPerfStatManager::GetSingleton()->DoPulse(); } - m_pRadarMap->DoRender(); + m_pPlayerMap->DoRender(); m_pManager->DoRender(); DoPulses(); @@ -1435,8 +1436,8 @@ void CClientGame::DoPulses() } // Check for radar input - m_pRadarMap->DoPulse(); - g_pCore->GetGraphics()->SetAspectRatioAdjustmentSuspended(m_pRadarMap->IsRadarShowing()); + m_pPlayerMap->DoPulse(); + g_pCore->GetGraphics()->SetAspectRatioAdjustmentSuspended(m_pPlayerMap->IsPlayerMapShowing()); // Got a local player? if (m_pLocalPlayer) @@ -5406,8 +5407,8 @@ void CClientGame::ResetMapInfo() // Keybinds g_pCore->GetKeyBinds()->SetAllControlsEnabled(true, true, true); - // Radarmap - m_pRadarMap->SetForcedState(false); + // Player map + m_pPlayerMap->SetForcedState(false); // Camera m_pCamera->FadeOut(0.0f, 0, 0, 0); @@ -5981,7 +5982,7 @@ bool CClientGame::IsGlitchEnabled(unsigned char ucGlitch) return ucGlitch < NUM_GLITCHES && m_Glitches[ucGlitch]; } -bool CClientGame::SetWorldSpecialProperty(WorldSpecialProperty property, bool isEnabled) +bool CClientGame::SetWorldSpecialProperty(WorldSpecialProperty property, bool isEnabled) noexcept { switch (property) { @@ -5989,44 +5990,60 @@ bool CClientGame::SetWorldSpecialProperty(WorldSpecialProperty property, bool is case WorldSpecialProperty::AIRCARS: case WorldSpecialProperty::EXTRABUNNY: case WorldSpecialProperty::EXTRAJUMP: - return g_pGame->SetCheatEnabled(EnumToString(property), isEnabled); + g_pGame->SetCheatEnabled(EnumToString(property), isEnabled); + break; case WorldSpecialProperty::RANDOMFOLIAGE: g_pGame->SetRandomFoliageEnabled(isEnabled); - return true; + break; case WorldSpecialProperty::SNIPERMOON: g_pGame->SetMoonEasterEggEnabled(isEnabled); - return true; + break; case WorldSpecialProperty::EXTRAAIRRESISTANCE: g_pGame->SetExtraAirResistanceEnabled(isEnabled); - return true; + break; case WorldSpecialProperty::UNDERWORLDWARP: g_pGame->SetUnderWorldWarpEnabled(isEnabled); - return true; + break; case WorldSpecialProperty::VEHICLESUNGLARE: g_pGame->SetVehicleSunGlareEnabled(isEnabled); - return true; + break; case WorldSpecialProperty::CORONAZTEST: g_pGame->SetCoronaZTestEnabled(isEnabled); - return true; + break; case WorldSpecialProperty::WATERCREATURES: g_pGame->SetWaterCreaturesEnabled(isEnabled); - return true; + break; case WorldSpecialProperty::BURNFLIPPEDCARS: g_pGame->SetBurnFlippedCarsEnabled(isEnabled); - return true; + break; case WorldSpecialProperty::FIREBALLDESTRUCT: g_pGame->SetFireballDestructEnabled(isEnabled); - return true; + break; case WorldSpecialProperty::EXTENDEDWATERCANNONS: g_pGame->SetExtendedWaterCannonsEnabled(isEnabled); + break; case WorldSpecialProperty::ROADSIGNSTEXT: g_pGame->SetRoadSignsTextEnabled(isEnabled); - return true; + break; case WorldSpecialProperty::TUNNELWEATHERBLEND: g_pGame->SetTunnelWeatherBlendEnabled(isEnabled); - return true; + break; + case WorldSpecialProperty::IGNOREFIRESTATE: + g_pGame->SetIgnoreFireStateEnabled(isEnabled); + break; + default: + return false; } - return false; + + if (g_pNet->CanServerBitStream(eBitStreamVersion::WorldSpecialPropertyEvent)) { + NetBitStreamInterface* stream = g_pNet->AllocateNetBitStream(); + stream->WriteString(EnumToString(property)); + stream->WriteBit(isEnabled); + g_pNet->SendPacket(PACKET_ID_PLAYER_WORLD_SPECIAL_PROPERTY, stream, PACKET_PRIORITY_HIGH, PACKET_RELIABILITY_RELIABLE_ORDERED); + g_pNet->DeallocateNetBitStream(stream); + } + + return true; } bool CClientGame::IsWorldSpecialProperty(WorldSpecialProperty property) @@ -6062,6 +6079,8 @@ bool CClientGame::IsWorldSpecialProperty(WorldSpecialProperty property) return g_pGame->IsRoadSignsTextEnabled(); case WorldSpecialProperty::TUNNELWEATHERBLEND: return g_pGame->IsTunnelWeatherBlendEnabled(); + case WorldSpecialProperty::IGNOREFIRESTATE: + return g_pGame->IsIgnoreFireStateEnabled(); } return false; } @@ -6475,7 +6494,7 @@ void CClientGame::OutputServerInfo() { SString strEnabledGlitches; const char* szGlitchNames[] = {"Quick reload", "Fast fire", "Fast move", "Crouch bug", "Close damage", "Hit anim", "Fast sprint", - "Bad driveby hitboxes", "Quick stand"}; + "Bad driveby hitboxes", "Quick stand", "Kickout of vehicle on model replace"}; for (uint i = 0; i < NUM_GLITCHES; i++) { if (IsGlitchEnabled(i)) diff --git a/Client/mods/deathmatch/logic/CClientGame.h b/Client/mods/deathmatch/logic/CClientGame.h index ba6bc29334..e887199fcd 100644 --- a/Client/mods/deathmatch/logic/CClientGame.h +++ b/Client/mods/deathmatch/logic/CClientGame.h @@ -28,7 +28,7 @@ #include "CUnoccupiedVehicleSync.h" #include "CPedSync.h" #include "CObjectSync.h" -#include "CRadarMap.h" +#include "CPlayerMap.h" #include "CClientTeamManager.h" #include "CClientPedManager.h" #include "lua/CLuaManager.h" @@ -296,7 +296,7 @@ class CClientGame CBlendedWeather* GetBlendedWeather() { return m_pBlendedWeather; }; CNetAPI* GetNetAPI() { return m_pNetAPI; }; - CRadarMap* GetRadarMap() { return m_pRadarMap; }; + CPlayerMap* GetPlayerMap() { return m_pPlayerMap; }; CMovingObjectsManager* GetMovingObjectsManager() { return m_pMovingObjectsManager; } CClientPlayer* GetLocalPlayer() { return m_pLocalPlayer; } @@ -410,7 +410,7 @@ class CClientGame bool SetGlitchEnabled(unsigned char cGlitch, bool bEnabled); bool IsGlitchEnabled(unsigned char cGlitch); - bool SetWorldSpecialProperty(WorldSpecialProperty property, bool isEnabled); + bool SetWorldSpecialProperty(WorldSpecialProperty property, bool isEnabled) noexcept; bool IsWorldSpecialProperty(WorldSpecialProperty property); bool SetCloudsEnabled(bool bEnabled); @@ -694,7 +694,7 @@ class CClientGame CNetworkStats* m_pNetworkStats; CSyncDebug* m_pSyncDebug; // CScreenshot* m_pScreenshot; - CRadarMap* m_pRadarMap; + CPlayerMap* m_pPlayerMap; CTransferBox* m_pTransferBox; CResourceManager* m_pResourceManager; CScriptKeyBinds* m_pScriptKeyBinds; diff --git a/Client/mods/deathmatch/logic/CPacketHandler.cpp b/Client/mods/deathmatch/logic/CPacketHandler.cpp index ebf2ba5140..787cd4c239 100644 --- a/Client/mods/deathmatch/logic/CPacketHandler.cpp +++ b/Client/mods/deathmatch/logic/CPacketHandler.cpp @@ -572,6 +572,10 @@ void CPacketHandler::Packet_ServerDisconnected(NetBitStreamInterface& bitStream) strReason = _("Disconnected: Serial verification failed"); strErrorCode = _E("CD44"); break; + case ePlayerDisconnectType::SERIAL_DUPLICATE: + strReason = _("Disconnected: Serial already in use"); + strErrorCode = _E("CD50"); + break; case ePlayerDisconnectType::CONNECTION_DESYNC: strReason = _("Disconnected: Connection desync %s"); strErrorCode = _E("CD45"); @@ -2393,6 +2397,7 @@ void CPacketHandler::Packet_MapInfo(NetBitStreamInterface& bitStream) g_pClientGame->SetWorldSpecialProperty(WorldSpecialProperty::ROADSIGNSTEXT, wsProps.data3.roadsignstext); g_pClientGame->SetWorldSpecialProperty(WorldSpecialProperty::EXTENDEDWATERCANNONS, wsProps.data4.extendedwatercannons); g_pClientGame->SetWorldSpecialProperty(WorldSpecialProperty::TUNNELWEATHERBLEND, wsProps.data5.tunnelweatherblend); + g_pClientGame->SetWorldSpecialProperty(WorldSpecialProperty::IGNOREFIRESTATE, wsProps.data6.ignoreFireState); float fJetpackMaxHeight = 100; if (!bitStream.Read(fJetpackMaxHeight)) diff --git a/Client/mods/deathmatch/logic/CPacketHandler.h b/Client/mods/deathmatch/logic/CPacketHandler.h index ca0f6f3d69..9a50b24615 100644 --- a/Client/mods/deathmatch/logic/CPacketHandler.h +++ b/Client/mods/deathmatch/logic/CPacketHandler.h @@ -42,7 +42,8 @@ class CPacketHandler BAN, KICK, CUSTOM, - SHUTDOWN + SHUTDOWN, + SERIAL_DUPLICATE }; struct SEntityDependantStuff diff --git a/Client/mods/deathmatch/logic/CRadarMap.cpp b/Client/mods/deathmatch/logic/CPlayerMap.cpp similarity index 71% rename from Client/mods/deathmatch/logic/CRadarMap.cpp rename to Client/mods/deathmatch/logic/CPlayerMap.cpp index 4dd01baccd..0653477e5b 100644 --- a/Client/mods/deathmatch/logic/CRadarMap.cpp +++ b/Client/mods/deathmatch/logic/CPlayerMap.cpp @@ -2,8 +2,8 @@ * * PROJECT: Multi Theft Auto v1.0 * LICENSE: See LICENSE in the top level directory - * FILE: mods/deathmatch/logic/CRadarMap.cpp - * PURPOSE: Full screen radar map renderer + * FILE: mods/deathmatch/logic/CPlayerMap.cpp + * PURPOSE: Full screen player map renderer * * Multi Theft Auto is available from http://www.multitheftauto.com/ * @@ -23,15 +23,19 @@ enum MARKER_LAST_SPRITE_INDEX = MARKER_FIRST_SPRITE_INDEX + RADAR_MARKER_LIMIT - 1, }; -CRadarMap::CRadarMap(CClientManager* pManager) +constexpr std::array MAP_IMAGE_SIZES = {1024, 2048}; + +CPlayerMap::CPlayerMap(CClientManager* pManager) { + m_failedToLoadTextures = false; + // Setup our managers m_pManager = pManager; m_pRadarMarkerManager = pManager->GetRadarMarkerManager(); m_pRadarAreaManager = m_pManager->GetRadarAreaManager(); - // Set the radar bools - m_bIsRadarEnabled = false; + // Set the map bools + m_bIsPlayerMapEnabled = false; m_bForcedState = false; m_bIsAttachedToLocal = false; m_bHideHelpText = false; @@ -52,17 +56,13 @@ CRadarMap::CRadarMap(CClientManager* pManager) m_fZoom = 1; m_iHorizontalMovement = 0; m_iVerticalMovement = 0; - SetupMapVariables(); - // Create the radar and local player blip images - m_pRadarImage = - g_pCore->GetGraphics()->GetRenderItemManager()->CreateTexture(CalcMTASAPath("MTA\\cgui\\images\\radar.jpg"), NULL, false, 1024, 1024, RFORMAT_DXT1); - m_pLocalPlayerBlip = g_pCore->GetGraphics()->GetRenderItemManager()->CreateTexture(CalcMTASAPath("MTA\\cgui\\images\\radarset\\02.png")); - - // Create the marker textures - CreateMarkerTextures(); + // Create all map textures + CreateAllTextures(); // Create the text displays for the help text + const SColorRGBA colorWhiteTransparent(255, 255, 255, 200); + const SColorRGBA colorWhite(255, 255, 255, 255); struct { SColor color; @@ -70,17 +70,15 @@ CRadarMap::CRadarMap(CClientManager* pManager) float fScale; SString strMessage; } messageList[] = { - {SColorRGBA(255, 255, 255, 200), 0.92f, 1.5f, "Current Mode: Kill all humans"}, - {SColorRGBA(255, 255, 255, 255), 0.95f, 1.0f, SString("Press %s to change mode.", *GetBoundKeyName("radar_attach"))}, - {SColorRGBA(255, 255, 255, 255), 0.05f, 1.0f, - SString("Press %s/%s to zoom in/out.", *GetBoundKeyName("radar_zoom_in"), *GetBoundKeyName("radar_zoom_out"))}, - {SColorRGBA(255, 255, 255, 255), 0.08f, 1.0f, - SString("Press %s, %s, %s, %s to navigate the map.", *GetBoundKeyName("radar_move_north"), *GetBoundKeyName("radar_move_east"), - *GetBoundKeyName("radar_move_south"), *GetBoundKeyName("radar_move_west"))}, - {SColorRGBA(255, 255, 255, 255), 0.11f, 1.0f, - SString("Press %s/%s to change opacity.", *GetBoundKeyName("radar_opacity_down"), *GetBoundKeyName("radar_opacity_up"))}, - {SColorRGBA(255, 255, 255, 255), 0.14f, 1.0f, SString("Press %s to hide the map.", *GetBoundKeyName("radar"))}, - {SColorRGBA(255, 255, 255, 255), 0.17f, 1.0f, SString("Press %s to hide this help text.", *GetBoundKeyName("radar_help"))}, + {colorWhiteTransparent, 0.92f, 1.5f, ""}, + {colorWhite, 0.95f, 1.0f, SString(_("Change mode: %s"), *GetBoundKeyName("radar_attach"))}, + + {colorWhite, 0.05f, 1.0f, SString(_("Zoom: %s/%s Movement: %s, %s, %s, %s Opacity: %s/%s"), + *GetBoundKeyName("radar_zoom_in"), *GetBoundKeyName("radar_zoom_out"), *GetBoundKeyName("radar_move_north"), + *GetBoundKeyName("radar_move_east"), *GetBoundKeyName("radar_move_south"), *GetBoundKeyName("radar_move_west"), + *GetBoundKeyName("radar_opacity_down"), *GetBoundKeyName("radar_opacity_up"))}, + {colorWhite, 0.07f, 1.0f, SString(_("Toggle map: %s Toggle help text: %s"), + *GetBoundKeyName("radar"), *GetBoundKeyName("radar_help"))}, }; for (uint i = 0; i < NUMELMS(messageList); i++) @@ -98,26 +96,85 @@ CRadarMap::CRadarMap(CClientManager* pManager) // Default to attached to player SetAttachedToLocalPlayer(true); + + SetupMapVariables(); } -CRadarMap::~CRadarMap() +CPlayerMap::~CPlayerMap() { // Delete our images - SAFE_RELEASE(m_pRadarImage); - SAFE_RELEASE(m_pLocalPlayerBlip); + SAFE_RELEASE(m_mapImageTexture); + SAFE_RELEASE(m_playerMarkerTexture); - for (uint i = 0; i < m_MarkerTextureList.size(); i++) - SAFE_RELEASE(m_MarkerTextureList[i]); + for (uint i = 0; i < m_markerTextureList.size(); i++) + SAFE_RELEASE(m_markerTextureList[i]); - m_MarkerTextureList.clear(); + m_markerTextureList.clear(); // Don't need to delete the help texts as those are destroyed by the display manager } -void CRadarMap::DoPulse() +void CPlayerMap::CreateOrUpdateMapTexture() { - // If our radar image exists - if (IsRadarShowing()) + const std::uint32_t mapSize = MAP_IMAGE_SIZES[m_playerMapImageIndex]; + const SString fileName("MTA\\cgui\\images\\map_%d.png", mapSize); + + auto* newTexture = g_pCore->GetGraphics()->GetRenderItemManager()->CreateTexture(CalcMTASAPath(fileName), nullptr, false, mapSize, mapSize, RFORMAT_DXT1); + if (!newTexture) + throw std::runtime_error("Failed to load map image"); + + SAFE_RELEASE(m_mapImageTexture); + m_mapImageTexture = newTexture; +} + +void CPlayerMap::UpdateOrRevertMapTexture(std::size_t newImageIndex) +{ + const std::size_t oldImageIndex = m_playerMapImageIndex; + try + { + m_playerMapImageIndex = newImageIndex; + CreateOrUpdateMapTexture(); + } + catch (const std::exception& e) + { + m_playerMapImageIndex = oldImageIndex; + g_pCore->GetConsole()->Printf("Problem updating map image: %s", e.what()); + } +} + +void CPlayerMap::CreatePlayerBlipTexture() +{ + m_playerMarkerTexture = g_pCore->GetGraphics()->GetRenderItemManager()->CreateTexture(CalcMTASAPath("MTA\\cgui\\images\\radarset\\02.png")); + if (!m_playerMarkerTexture) + throw std::runtime_error("Failed to load player blip image"); +} + +void CPlayerMap::CreateAllTextures() +{ + try + { + // Create the map texture + m_mapImageTexture = nullptr; + m_playerMapImageIndex = g_pCore->GetCVars()->GetValue("mapimage"); + CreateOrUpdateMapTexture(); + + // Create the player blip texture + CreatePlayerBlipTexture(); + + // Create the other marker textures + CreateMarkerTextures(); + } + catch (const std::exception& e) + { + m_failedToLoadTextures = true; + g_pCore->GetConsole()->Printf("Problem initializing player map: %s", e.what()); + } +} + +void CPlayerMap::DoPulse() +{ + // If our map image exists + if (IsPlayerMapShowing()) { // If we are following the local player blip if (m_bIsAttachedToLocal) @@ -154,11 +211,11 @@ void CRadarMap::DoPulse() } // -// Precreate all the textures for the radar map markers +// Precreate all the textures for the player map markers // -void CRadarMap::CreateMarkerTextures() +void CPlayerMap::CreateMarkerTextures() { - assert(m_MarkerTextureList.empty()); + m_markerTextureList.clear(); SString strRadarSetDirectory = CalcMTASAPath("MTA\\cgui\\images\\radarset\\"); // Load the 3 shapes @@ -166,25 +223,27 @@ void CRadarMap::CreateMarkerTextures() for (uint i = 0; i < NUMELMS(shapeFileNames); i++) { CTextureItem* pTextureItem = g_pCore->GetGraphics()->GetRenderItemManager()->CreateTexture(PathJoin(strRadarSetDirectory, shapeFileNames[i])); - m_MarkerTextureList.push_back(pTextureItem); + m_markerTextureList.push_back(pTextureItem); } - assert(m_MarkerTextureList.size() == MARKER_FIRST_SPRITE_INDEX); + if (m_markerTextureList.size() != MARKER_FIRST_SPRITE_INDEX) + throw std::runtime_error("Failed to load marker textures [1]"); // Load the icons for (uint i = 0; i < RADAR_MARKER_LIMIT; i++) { CTextureItem* pTextureItem = g_pCore->GetGraphics()->GetRenderItemManager()->CreateTexture(PathJoin(strRadarSetDirectory, SString("%02u.png", i + 1))); - m_MarkerTextureList.push_back(pTextureItem); + m_markerTextureList.push_back(pTextureItem); } - assert(m_MarkerTextureList.size() == MARKER_LAST_SPRITE_INDEX + 1); + if (m_markerTextureList.size() != MARKER_LAST_SPRITE_INDEX + 1) + throw std::runtime_error("Failed to load marker textures [2]"); } // // Get a texture for a marker, including scale and color // -CTextureItem* CRadarMap::GetMarkerTexture(CClientRadarMarker* pMarker, float fLocalZ, float* pfScale, SColor* pColor) +CTextureItem* CPlayerMap::GetMarkerTexture(CClientRadarMarker* pMarker, float fLocalZ, float* pfScale, SColor* pColor) { float fScale = pMarker->GetScale(); ulong ulSprite = pMarker->GetSprite(); @@ -220,26 +279,33 @@ CTextureItem* CRadarMap::GetMarkerTexture(CClientRadarMarker* pMarker, float fLo *pfScale = fScale; *pColor = color; - if (uiListIndex >= m_MarkerTextureList.size()) + if (uiListIndex >= m_markerTextureList.size()) return NULL; - return m_MarkerTextureList[uiListIndex]; + return m_markerTextureList[uiListIndex]; } -void CRadarMap::DoRender() +void CPlayerMap::DoRender() { - bool bIsRadarShowing = IsRadarShowing(); + bool isMapShowing = IsPlayerMapShowing(); - // Render if showing - if (bIsRadarShowing) + // Render if showing and textures are all loaded + if (isMapShowing && !m_failedToLoadTextures) { // Get the alpha value from the settings - int iRadarAlpha; - g_pCore->GetCVars()->Get("mapalpha", iRadarAlpha); + int mapAlpha; + g_pCore->GetCVars()->Get("mapalpha", mapAlpha); + const SColorARGB mapColor(mapAlpha, 255, 255, 255); + + // Update the image if the user changed it via a setting + auto mapImageIndex = g_pCore->GetCVars()->GetValue("mapimage"); + if (mapImageIndex != m_playerMapImageIndex) + { + UpdateOrRevertMapTexture(mapImageIndex); + } - g_pCore->GetGraphics()->DrawTexture(m_pRadarImage, static_cast(m_iMapMinX), static_cast(m_iMapMinY), - m_fMapSize / m_pRadarImage->m_uiSizeX, m_fMapSize / m_pRadarImage->m_uiSizeY, 0.0f, 0.0f, 0.0f, - SColorARGB(iRadarAlpha, 255, 255, 255)); + g_pCore->GetGraphics()->DrawTexture(m_mapImageTexture, static_cast(m_iMapMinX), static_cast(m_iMapMinY), + m_fMapSize / m_mapImageTexture->m_uiSizeX, m_fMapSize / m_mapImageTexture->m_uiSizeY, 0.0f, 0.0f, 0.0f, mapColor); // Grab the info for the local player blip CVector2D vecLocalPos; @@ -316,11 +382,11 @@ void CRadarMap::DoRender() } } - g_pCore->GetGraphics()->DrawTexture(m_pLocalPlayerBlip, vecLocalPos.fX, vecLocalPos.fY, 1.0, 1.0, vecLocalRot.fZ, 0.5f, 0.5f); + g_pCore->GetGraphics()->DrawTexture(m_playerMarkerTexture, vecLocalPos.fX, vecLocalPos.fY, 1.0, 1.0, vecLocalRot.fZ, 0.5f, 0.5f); } // Update visibility of help text - bool bRequiredTextVisible = bIsRadarShowing && !m_bHideHelpText; + bool bRequiredTextVisible = isMapShowing && !m_bHideHelpText; if (bRequiredTextVisible != m_bTextVisible) { m_bTextVisible = bRequiredTextVisible; @@ -331,31 +397,31 @@ void CRadarMap::DoRender() } } -void CRadarMap::SetRadarEnabled(bool bIsRadarEnabled) +void CPlayerMap::SetPlayerMapEnabled(bool show) { - bool bAlreadyEnabled = (m_bIsRadarEnabled || m_bForcedState); - bool bWillShow = (bIsRadarEnabled || m_bForcedState); - if (bAlreadyEnabled != bWillShow) + bool alreadyEnabled = (m_bIsPlayerMapEnabled || m_bForcedState); + bool definitiveShow = (show || m_bForcedState); + if (alreadyEnabled != definitiveShow) { - InternalSetRadarEnabled(bWillShow); + InternalSetPlayerMapEnabled(definitiveShow); } - m_bIsRadarEnabled = bIsRadarEnabled; + m_bIsPlayerMapEnabled = show; } -void CRadarMap::SetForcedState(bool bState) +void CPlayerMap::SetForcedState(bool state) { - bool bAlreadyShowing = (m_bIsRadarEnabled || m_bForcedState); - bool bWillShow = (m_bIsRadarEnabled || bState); - if (bAlreadyShowing != bWillShow) + bool currState = (m_bIsPlayerMapEnabled || m_bForcedState); + bool definitiveState = (m_bIsPlayerMapEnabled || state); + if (currState != definitiveState) { - InternalSetRadarEnabled(bWillShow); + InternalSetPlayerMapEnabled(definitiveState); } - m_bForcedState = bState; + m_bForcedState = state; } -void CRadarMap::InternalSetRadarEnabled(bool bEnabled) +void CPlayerMap::InternalSetPlayerMapEnabled(bool enable) { - if (bEnabled) + if (enable) { m_bChatVisible = g_pCore->IsChatVisible(); m_bChatInputBlocked = g_pCore->IsChatInputBlocked(); @@ -375,7 +441,7 @@ void CRadarMap::InternalSetRadarEnabled(bool bEnabled) } } -bool CRadarMap::CalculateEntityOnScreenPosition(CClientEntity* pEntity, CVector2D& vecLocalPos) +bool CPlayerMap::CalculateEntityOnScreenPosition(CClientEntity* pEntity, CVector2D& vecLocalPos) { // If the entity exists if (pEntity) @@ -406,7 +472,7 @@ bool CRadarMap::CalculateEntityOnScreenPosition(CClientEntity* pEntity, CVector2 return false; } -bool CRadarMap::CalculateEntityOnScreenPosition(CVector vecPosition, CVector2D& vecLocalPos) +bool CPlayerMap::CalculateEntityOnScreenPosition(CVector vecPosition, CVector2D& vecLocalPos) { // Adjust to the map variables and create the map ratio float fX = vecPosition.fX + 3000.0f; @@ -428,7 +494,7 @@ bool CRadarMap::CalculateEntityOnScreenPosition(CVector vecPosition, CVector2D& return false; } -void CRadarMap::SetupMapVariables() +void CPlayerMap::SetupMapVariables() { // Calculate the map size and the middle of the screen coords m_fMapSize = static_cast(m_uiHeight * m_fZoom); @@ -524,7 +590,7 @@ void CRadarMap::SetupMapVariables() } } -void CRadarMap::ZoomIn() +void CPlayerMap::ZoomIn() { if (m_fZoom <= 4) { @@ -533,7 +599,7 @@ void CRadarMap::ZoomIn() } } -void CRadarMap::ZoomOut() +void CPlayerMap::ZoomOut() { if (m_fZoom >= 1) { @@ -559,7 +625,7 @@ void CRadarMap::ZoomOut() } } -void CRadarMap::MoveNorth() +void CPlayerMap::MoveNorth() { if (!m_bIsAttachedToLocal) { @@ -579,7 +645,7 @@ void CRadarMap::MoveNorth() } } -void CRadarMap::MoveSouth() +void CPlayerMap::MoveSouth() { if (!m_bIsAttachedToLocal) { @@ -599,7 +665,7 @@ void CRadarMap::MoveSouth() } } -void CRadarMap::MoveEast() +void CPlayerMap::MoveEast() { if (!m_bIsAttachedToLocal) { @@ -619,7 +685,7 @@ void CRadarMap::MoveEast() } } -void CRadarMap::MoveWest() +void CPlayerMap::MoveWest() { if (!m_bIsAttachedToLocal) { @@ -639,30 +705,26 @@ void CRadarMap::MoveWest() } } -void CRadarMap::SetAttachedToLocalPlayer(bool bIsAttachedToLocal) +void CPlayerMap::SetAttachedToLocalPlayer(bool bIsAttachedToLocal) { m_bIsAttachedToLocal = bIsAttachedToLocal; SetupMapVariables(); if (m_bIsAttachedToLocal) - { - m_HelpTextList[0]->SetCaption("Current Mode: Attached to local player"); - } + m_HelpTextList[0]->SetCaption(_("Following Player")); else - { - m_HelpTextList[0]->SetCaption("Current Mode: Free Move"); - } + m_HelpTextList[0]->SetCaption(_("Free Movement")); } -bool CRadarMap::IsRadarShowing() +bool CPlayerMap::IsPlayerMapShowing() { - return ((m_bIsRadarEnabled || m_bForcedState) && m_pRadarImage && m_pLocalPlayerBlip && (!g_pCore->GetConsole()->IsVisible() && !g_pCore->IsMenuVisible())); + return ((m_bIsPlayerMapEnabled || m_bForcedState) && m_mapImageTexture && m_playerMarkerTexture && (!g_pCore->GetConsole()->IsVisible() && !g_pCore->IsMenuVisible())); } -bool CRadarMap::GetBoundingBox(CVector& vecMin, CVector& vecMax) +bool CPlayerMap::GetBoundingBox(CVector& vecMin, CVector& vecMax) { - // If our radar image exists (Values are not calculated unless map is showing) - if (IsRadarShowing()) + // If our map image exists (Values are not calculated unless map is showing) + if (IsPlayerMapShowing()) { vecMin.fX = static_cast(m_iMapMinX); vecMin.fY = static_cast(m_iMapMinY); @@ -678,12 +740,12 @@ bool CRadarMap::GetBoundingBox(CVector& vecMin, CVector& vecMax) } } -void CRadarMap::ToggleHelpText() +void CPlayerMap::ToggleHelpText() { m_bHideHelpText = !m_bHideHelpText; } -SString CRadarMap::GetBoundKeyName(const SString& strCommand) +SString CPlayerMap::GetBoundKeyName(const SString& strCommand) { CCommandBind* pCommandBind = g_pCore->GetKeyBinds()->GetBindFromCommand(strCommand, 0, 0, 0, false, 0); if (!pCommandBind) diff --git a/Client/mods/deathmatch/logic/CRadarMap.h b/Client/mods/deathmatch/logic/CPlayerMap.h similarity index 77% rename from Client/mods/deathmatch/logic/CRadarMap.h rename to Client/mods/deathmatch/logic/CPlayerMap.h index a3dd8f0d51..0d6edebb6f 100644 --- a/Client/mods/deathmatch/logic/CRadarMap.h +++ b/Client/mods/deathmatch/logic/CPlayerMap.h @@ -2,8 +2,8 @@ * * PROJECT: Multi Theft Auto v1.0 * LICENSE: See LICENSE in the top level directory - * FILE: mods/deathmatch/logic/CRadarMap.h - * PURPOSE: Header for radar map class + * FILE: mods/deathmatch/logic/CPlayerMap.h + * PURPOSE: Header for player map class * * Multi Theft Auto is available from http://www.multitheftauto.com/ * @@ -16,19 +16,19 @@ #include #include -class CRadarMap +class CPlayerMap { public: - CRadarMap(class CClientManager* pManager); - virtual ~CRadarMap(); + CPlayerMap(class CClientManager* pManager); + virtual ~CPlayerMap(); void DoPulse(); void DoRender(); - bool IsRadarShowing(); + bool IsPlayerMapShowing(); - bool GetRadarEnabled() const { return m_bIsRadarEnabled; }; - void SetRadarEnabled(bool bIsRadarEnabled); + bool GetPlayerMapEnabled() const { return m_bIsPlayerMapEnabled; }; + void SetPlayerMapEnabled(bool bIsRadarEnabled); bool GetForcedState() const { return m_bForcedState; } void SetForcedState(bool bState); @@ -38,10 +38,14 @@ class CRadarMap void ToggleHelpText(); protected: - void InternalSetRadarEnabled(bool bEnabled); + void InternalSetPlayerMapEnabled(bool bEnabled); void CreateMarkerTextures(); CTextureItem* GetMarkerTexture(CClientRadarMarker* pMarker, float fLocalZ, float* pfScale, SColor* pColor); + void CreatePlayerBlipTexture(); + void CreateOrUpdateMapTexture(); + void UpdateOrRevertMapTexture(std::size_t imageIndex); + void CreateAllTextures(); public: bool IsAttachedToLocalPlayer() const { return m_bIsAttachedToLocal; }; @@ -79,9 +83,13 @@ class CRadarMap class CClientRadarMarkerManager* m_pRadarMarkerManager; class CClientRadarAreaManager* m_pRadarAreaManager; - CTextureItem* m_pRadarImage; - CTextureItem* m_pLocalPlayerBlip; - std::vector m_MarkerTextureList; + bool m_failedToLoadTextures; + + std::size_t m_playerMapImageIndex; + + CTextureItem* m_mapImageTexture; + CTextureItem* m_playerMarkerTexture; + std::vector m_markerTextureList; unsigned int m_uiHeight; unsigned int m_uiWidth; @@ -97,7 +105,7 @@ class CRadarMap float m_fZoom; - bool m_bIsRadarEnabled; + bool m_bIsPlayerMapEnabled; bool m_bForcedState; bool m_bIsAttachedToLocal; diff --git a/Client/mods/deathmatch/logic/CStaticFunctionDefinitions.cpp b/Client/mods/deathmatch/logic/CStaticFunctionDefinitions.cpp index 5efe5b417e..5612bd9976 100644 --- a/Client/mods/deathmatch/logic/CStaticFunctionDefinitions.cpp +++ b/Client/mods/deathmatch/logic/CStaticFunctionDefinitions.cpp @@ -51,7 +51,7 @@ static CClientMarkerManager* m_pMarkerManager; static CClientPickupManager* m_pPickupManager; static CMovingObjectsManager* m_pMovingObjectsManager; static CBlendedWeather* m_pBlendedWeather; -static CRadarMap* m_pRadarMap; +static CPlayerMap* m_pPlayerMap; static CClientCamera* m_pCamera; static CClientExplosionManager* m_pExplosionManager; static CClientProjectileManager* m_pProjectileManager; @@ -88,7 +88,7 @@ CStaticFunctionDefinitions::CStaticFunctionDefinitions(CLuaManager* pLuaManager, m_pPickupManager = pManager->GetPickupManager(); m_pMovingObjectsManager = m_pClientGame->GetMovingObjectsManager(); m_pBlendedWeather = m_pClientGame->GetBlendedWeather(); - m_pRadarMap = m_pClientGame->GetRadarMap(); + m_pPlayerMap = m_pClientGame->GetPlayerMap(); m_pCamera = pManager->GetCamera(); m_pExplosionManager = pManager->GetExplosionManager(); m_pProjectileManager = pManager->GetProjectileManager(); @@ -7840,25 +7840,25 @@ bool CStaticFunctionDefinitions::SetWeaponClipAmmo(CClientWeapon* pWeapon, int i bool CStaticFunctionDefinitions::ForcePlayerMap(bool& bForced) { - m_pClientGame->GetRadarMap()->SetForcedState(bForced); + m_pClientGame->GetPlayerMap()->SetForcedState(bForced); return true; } bool CStaticFunctionDefinitions::IsPlayerMapForced(bool& bForced) { - bForced = m_pRadarMap->GetForcedState(); + bForced = m_pPlayerMap->GetForcedState(); return true; } bool CStaticFunctionDefinitions::IsPlayerMapVisible(bool& bVisible) { - bVisible = m_pRadarMap->IsRadarShowing(); + bVisible = m_pPlayerMap->IsPlayerMapShowing(); return true; } bool CStaticFunctionDefinitions::GetPlayerMapBoundingBox(CVector& vecMin, CVector& vecMax) { - if (m_pRadarMap->GetBoundingBox(vecMin, vecMax)) + if (m_pPlayerMap->GetBoundingBox(vecMin, vecMax)) { return true; } diff --git a/Client/mods/deathmatch/logic/rpc/CPlayerRPCs.cpp b/Client/mods/deathmatch/logic/rpc/CPlayerRPCs.cpp index e8cda43283..321c030652 100644 --- a/Client/mods/deathmatch/logic/rpc/CPlayerRPCs.cpp +++ b/Client/mods/deathmatch/logic/rpc/CPlayerRPCs.cpp @@ -60,7 +60,7 @@ void CPlayerRPCs::ForcePlayerMap(NetBitStreamInterface& bitStream) if (bitStream.Read(ucVisible)) { bool bVisible = (ucVisible == 1); - m_pClientGame->GetRadarMap()->SetForcedState(bVisible); + m_pClientGame->GetPlayerMap()->SetForcedState(bVisible); } } diff --git a/Client/mods/deathmatch/logic/rpc/CWorldRPCs.cpp b/Client/mods/deathmatch/logic/rpc/CWorldRPCs.cpp index d92ba4788b..380767ccc7 100644 --- a/Client/mods/deathmatch/logic/rpc/CWorldRPCs.cpp +++ b/Client/mods/deathmatch/logic/rpc/CWorldRPCs.cpp @@ -619,6 +619,12 @@ void CWorldRPCs::SetSyncIntervals(NetBitStreamInterface& bitStream) bitStream.Read(g_TickRateSettings.iObjectSync); bitStream.Read(g_TickRateSettings.iKeySyncRotation); bitStream.Read(g_TickRateSettings.iKeySyncAnalogMove); + + if (bitStream.Can(eBitStreamVersion::FixSyncerDistance)) + { + bitStream.Read(g_TickRateSettings.iPedSyncerDistance); + bitStream.Read(g_TickRateSettings.iUnoccupiedVehicleSyncerDistance); + } } void CWorldRPCs::SetMoonSize(NetBitStreamInterface& bitStream) diff --git a/Client/multiplayer_sa/CMultiplayerSA.cpp b/Client/multiplayer_sa/CMultiplayerSA.cpp index 1b21f79a23..73c8fd9df4 100644 --- a/Client/multiplayer_sa/CMultiplayerSA.cpp +++ b/Client/multiplayer_sa/CMultiplayerSA.cpp @@ -1574,6 +1574,7 @@ void CMultiplayerSA::InitHooks() MemSet((void*)0x6C4453, 0x90, 0x68); InitHooks_CrashFixHacks(); + InitHooks_DeviceSelection(); // Init our 1.3 hooks. Init_13(); @@ -1861,6 +1862,7 @@ void CMultiplayerSA::DisableCloseRangeDamage(bool bDisabled) MemPut(0x73BA00, 0x86); } } + bool CMultiplayerSA::GetInteriorSoundsEnabled() { return bInteriorSoundsEnabled; diff --git a/Client/multiplayer_sa/CMultiplayerSA.h b/Client/multiplayer_sa/CMultiplayerSA.h index 802b9b56ea..d97300e6a1 100644 --- a/Client/multiplayer_sa/CMultiplayerSA.h +++ b/Client/multiplayer_sa/CMultiplayerSA.h @@ -80,6 +80,7 @@ class CMultiplayerSA : public CMultiplayer void InitHooks_ProjectileCollisionFix(); void InitHooks_ObjectStreamerOptimization(); void InitHooks_Postprocess(); + void InitHooks_DeviceSelection(); CRemoteDataStorage* CreateRemoteDataStorage(); void DestroyRemoteDataStorage(CRemoteDataStorage* pData); void AddRemoteDataStorage(CPlayerPed* pPed, CRemoteDataStorage* pData); diff --git a/Client/multiplayer_sa/CMultiplayerSA_DeviceSelection.cpp b/Client/multiplayer_sa/CMultiplayerSA_DeviceSelection.cpp new file mode 100644 index 0000000000..586f387270 --- /dev/null +++ b/Client/multiplayer_sa/CMultiplayerSA_DeviceSelection.cpp @@ -0,0 +1,155 @@ +/***************************************************************************** + * + * PROJECT: Multi Theft Auto v1.0 + * LICENSE: See LICENSE in the top level directory + * FILE: multiplayer_sa/CMultiplayerSA_DeviceSelection.cpp + * + * Multi Theft Auto is available from http://www.multitheftauto.com/ + * + *****************************************************************************/ + +#include "StdInc.h" +#define FUNC_rwDeviceSystemRequest 0x7F2AB0 +#define FUNC_DialogFunc 0x745E50 +#define FUNC_RwEngineGetSubSystemInfo 0x7F2C30 +#define CLASS_RwGlobals 0xC97B24 +#define CLASS_IDirect3D9 0xC97C20 +#define NUM_DialogFuncStackPushAddress 0x746239 + +// This is copied from SilentPatch: +// https://github.com/CookiePLMonster/SilentPatch/blob/dev/SilentPatch/FriendlyMonitorNames.cpp +std::unordered_map GetFriendlyMonitorNamesForDevicePaths() +{ + std::unordered_map monitorNames; + + HMODULE user32Lib = LoadLibrary(TEXT("user32")); + if (!user32Lib) + return monitorNames; + + auto* getDisplayConfigBufferSizes = (decltype(GetDisplayConfigBufferSizes)*)GetProcAddress(user32Lib, "GetDisplayConfigBufferSizes"); + auto* queryDisplayConfig = (decltype(QueryDisplayConfig)*)GetProcAddress(user32Lib, "QueryDisplayConfig"); + auto* displayConfigGetDeviceInfo = (decltype(DisplayConfigGetDeviceInfo)*)GetProcAddress(user32Lib, "DisplayConfigGetDeviceInfo"); + if (!getDisplayConfigBufferSizes || !queryDisplayConfig || !displayConfigGetDeviceInfo) + { + FreeLibrary(user32Lib); + return monitorNames; + } + + UINT32 pathCount, modeCount; + std::unique_ptr paths; + std::unique_ptr modes; + + LONG result = ERROR_SUCCESS; + do + { + result = getDisplayConfigBufferSizes(QDC_ONLY_ACTIVE_PATHS, &pathCount, &modeCount); + if (result != ERROR_SUCCESS) + { + break; + } + paths = std::make_unique(pathCount); + modes = std::make_unique(modeCount); + result = queryDisplayConfig(QDC_ONLY_ACTIVE_PATHS, &pathCount, paths.get(), &modeCount, modes.get(), nullptr); + } while (result == ERROR_INSUFFICIENT_BUFFER); + + if (result != ERROR_SUCCESS) + { + FreeLibrary(user32Lib); + return monitorNames; + } + + for (size_t i = 0; i < pathCount; i++) + { + DISPLAYCONFIG_TARGET_DEVICE_NAME targetName = {}; + targetName.header.adapterId = paths[i].targetInfo.adapterId; + targetName.header.id = paths[i].targetInfo.id; + targetName.header.type = DISPLAYCONFIG_DEVICE_INFO_GET_TARGET_NAME; + targetName.header.size = sizeof(targetName); + const LONG targetNameResult = DisplayConfigGetDeviceInfo(&targetName.header); + + DISPLAYCONFIG_SOURCE_DEVICE_NAME sourceName = {}; + sourceName.header.adapterId = paths[i].sourceInfo.adapterId; + sourceName.header.id = paths[i].sourceInfo.id; + sourceName.header.type = DISPLAYCONFIG_DEVICE_INFO_GET_SOURCE_NAME; + sourceName.header.size = sizeof(sourceName); + const LONG sourceNameResult = DisplayConfigGetDeviceInfo(&sourceName.header); + if (targetNameResult == ERROR_SUCCESS && sourceNameResult == ERROR_SUCCESS && targetName.monitorFriendlyDeviceName[0] != '\0') + { + char gdiDeviceName[std::size(sourceName.viewGdiDeviceName)]; + char monitorFriendlyDeviceName[std::size(targetName.monitorFriendlyDeviceName)]; + WideCharToMultiByte(CP_ACP, 0, sourceName.viewGdiDeviceName, -1, gdiDeviceName, static_cast(std::size(gdiDeviceName)), nullptr, nullptr); + WideCharToMultiByte(CP_ACP, 0, targetName.monitorFriendlyDeviceName, -1, monitorFriendlyDeviceName, + static_cast(std::size(monitorFriendlyDeviceName)), nullptr, nullptr); + + monitorNames.try_emplace(gdiDeviceName, monitorFriendlyDeviceName); + } + } + + FreeLibrary(user32Lib); + return monitorNames; +} + +struct RwSubSystemInfo +{ + char name[80]; +}; + +using rwDeviceSystemRequest = RwSubSystemInfo*(__cdecl*)(RwDevice* device, std::int32_t requestId, RwSubSystemInfo* pOut, void* pInOut, std::int32_t numIn); +static RwSubSystemInfo* RwEngineGetSubSystemInfo_Hooked(RwSubSystemInfo* subSystemInfo, std::int32_t subSystemIndex) +{ + auto* rwGlobals = *(RwGlobals**)CLASS_RwGlobals; + auto* rwDeviceSystemRequestFunc = (rwDeviceSystemRequest)(FUNC_rwDeviceSystemRequest); + if (!rwDeviceSystemRequestFunc(&rwGlobals->dOpenDevice, 14, subSystemInfo, nullptr, subSystemIndex)) + return nullptr; + + auto* pDxDevice = *(IDirect3D9**)CLASS_IDirect3D9; + if (!pDxDevice) + return subSystemInfo; + + D3DADAPTER_IDENTIFIER9 identifier; + if (FAILED(pDxDevice->GetAdapterIdentifier(subSystemIndex, 0, &identifier))) + return subSystemInfo; + + static const auto friendlyNames = GetFriendlyMonitorNamesForDevicePaths(); + + // If we can't find the friendly name, either because it doesn't exist or we're on an ancient Windows, fall back to the device name + auto it = friendlyNames.find(identifier.DeviceName); + if (it != friendlyNames.end()) + { + strncpy_s(subSystemInfo->name, it->second.c_str(), _TRUNCATE); + } + else + { + strncpy_s(subSystemInfo->name, identifier.Description, _TRUNCATE); + } + + return subSystemInfo; +} + +INT_PTR CALLBACK CustomDlgProc(HWND window, UINT msg, WPARAM wParam, LPARAM lParam) +{ + auto* orgDialogFunc = (DLGPROC)FUNC_DialogFunc; + if (msg != WM_INITDIALOG) + return orgDialogFunc(window, msg, wParam, lParam); + + orgDialogFunc(window, msg, wParam, lParam); + + // Set Icon + HMODULE hGameModule = GetModuleHandle(nullptr); + SendMessage(window, WM_SETICON, ICON_SMALL, reinterpret_cast(LoadIcon(hGameModule, MAKEINTRESOURCE(100)))); + + // Make the dialog visible in the task bar + // https://stackoverflow.com/a/1462811 + SetWindowLongPtr(window, GWL_EXSTYLE, WS_EX_APPWINDOW); + ShowWindow(window, SW_HIDE); + ShowWindow(window, SW_SHOW); + return FALSE; +} + +void CMultiplayerSA::InitHooks_DeviceSelection() +{ + // 0x746239 -> Exact address where the original DialogFunc address is being pushed as an argument to DialogBoxParamA(), + // we're replacing it with out own proxy function + MemPut(NUM_DialogFuncStackPushAddress, (DLGPROC)&CustomDlgProc); + HookInstall(FUNC_RwEngineGetSubSystemInfo, (DWORD)RwEngineGetSubSystemInfo_Hooked, 6); +} diff --git a/Client/multiplayer_sa/CMultiplayerSA_Weapons.cpp b/Client/multiplayer_sa/CMultiplayerSA_Weapons.cpp index ea0f6fab19..d7513941df 100644 --- a/Client/multiplayer_sa/CMultiplayerSA_Weapons.cpp +++ b/Client/multiplayer_sa/CMultiplayerSA_Weapons.cpp @@ -200,6 +200,33 @@ void _declspec(naked) HOOK_Fx_AddBulletImpact() } } +////////////////////////////////////////////////////////////////////////////////////////// +// +// CVisibilityPlugins::RenderWeaponPedsForPC +// +// Fix for the bright objects after weapon change sometimes +// +////////////////////////////////////////////////////////////////////////////////////////// +#define HOOKPOS_CVisibilityPlugins_RenderWeaponPedsForPC 0x733123 +#define HOOKSIZE_CVisibilityPlugins_RenderWeaponPedsForPC 5 +static constexpr DWORD CONTINUE_CVisibilityPlugins_RenderWeaponPedsForPC = 0x733128; +static void _declspec(naked) HOOK_CVisibilityPlugins_RenderWeaponPedsForPC() +{ + _asm + { + mov eax, 5DF4E0h + call eax // call CPed::ResetGunFlashAlpha + + mov eax, 5533B0h + mov ecx, ebx + + push 0 + call eax // call CPed::RemoveLighting + + jmp CONTINUE_CVisibilityPlugins_RenderWeaponPedsForPC + } +} + ////////////////////////////////////////////////////////////////////////////////////////// // // CMultiplayerSA::InitHooks_Weapons @@ -212,4 +239,5 @@ void CMultiplayerSA::InitHooks_Weapons() EZHookInstall(CWeapon_GenerateDamageEvent); EZHookInstall(CShotInfo_Update); EZHookInstall(Fx_AddBulletImpact); + EZHookInstall(CVisibilityPlugins_RenderWeaponPedsForPC); } diff --git a/Client/sdk/game/CGame.h b/Client/sdk/game/CGame.h index 2314fdad0e..06866e06ce 100644 --- a/Client/sdk/game/CGame.h +++ b/Client/sdk/game/CGame.h @@ -230,6 +230,9 @@ class __declspec(novtable) CGame virtual bool IsTunnelWeatherBlendEnabled() const noexcept = 0; virtual void SetTunnelWeatherBlendEnabled(bool isEnabled) = 0; + virtual bool IsIgnoreFireStateEnabled() const noexcept = 0; + virtual void SetIgnoreFireStateEnabled(bool isEnabled) = 0; + virtual CWeapon* CreateWeapon() = 0; virtual CWeaponStat* CreateWeaponStat(eWeaponType weaponType, eWeaponSkill weaponSkill) = 0; diff --git a/Client/sdk/game/RenderWare.h b/Client/sdk/game/RenderWare.h index 20249e01fd..d85011b291 100644 --- a/Client/sdk/game/RenderWare.h +++ b/Client/sdk/game/RenderWare.h @@ -526,3 +526,49 @@ struct RwError { int err1, err2; }; + +/*****************************************************************************/ +/** RenderWare Globals **/ +/*****************************************************************************/ + +typedef bool (*RwSystemFunc)(std::int32_t, void*, void*, std::int32_t); +struct RwDevice +{ + float gammaCorrection; + RwSystemFunc fpSystem; + float zBufferNear; + float zBufferFar; + // RwRenderStateSetFunction fpRenderStateSet; + // RwRenderStateGetFunction fpRenderStateGet; + // RwIm2DRenderLineFunction fpIm2DRenderLine; + // RwIm2DRenderTriangleFunction fpIm2DRenderTriangle; + // RwIm2DRenderPrimitiveFunction fpIm2DRenderPrimitive; + // RwIm2DRenderIndexedPrimitiveFunction fpIm2DRenderIndexedPrimitive; + // RwIm3DRenderLineFunction fpIm3DRenderLine; + // RwIm3DRenderTriangleFunction fpIm3DRenderTriangle; + // RwIm3DRenderPrimitiveFunction fpIm3DRenderPrimitive; + // RwIm3DRenderIndexedPrimitiveFunction fpIm3DRenderIndexedPrimitive; +}; +// static_assert(sizeof(RwDevice) == 0x38, "Incorrect class size: RwDevice"); + +typedef bool (*RwStandardFunc)(void*, void*, std::int32_t); +struct RwGlobals +{ + void* curCamera; + void* curWorld; + std::uint16_t renderFrame; + std::uint16_t lightFrame; + std::uint16_t pad[2]; + RwDevice dOpenDevice; + RwStandardFunc stdFunc[29]; + // RwLinkList dirtyFrameList; + // RwFileFunctions fileFuncs; + // RwStringFunctions stringFuncs; + // RwMemoryFunctions memoryFuncs; + // RwMemoryAllocFn memoryAlloc; + // RwMemoryFreeFn memoryFree; + // RwMetrics* metrics; + // RwEngineStatus engineStatus; + // RwUInt32 resArenaInitSize; +}; +//static_assert(sizeof(RwGlobals) == 0x158, "Incorrect class size: RwGlobals"); diff --git a/Server/mods/deathmatch/StdInc.h b/Server/mods/deathmatch/StdInc.h index c2e6355739..fb397aad5b 100644 --- a/Server/mods/deathmatch/StdInc.h +++ b/Server/mods/deathmatch/StdInc.h @@ -49,6 +49,7 @@ #include #include #include +#include "version.h" extern class CNetServer* g_pRealNetServer; extern class CGame* g_pGame; diff --git a/Server/mods/deathmatch/editor.conf b/Server/mods/deathmatch/editor.conf index f72486a6cb..1355e673ee 100644 --- a/Server/mods/deathmatch/editor.conf +++ b/Server/mods/deathmatch/editor.conf @@ -263,6 +263,16 @@ *NOTE* This only protects resources which use dbConnect with mysql Values: 0 - Off, 1 - Enabled. Default - 1 --> 1 + + + 1 + + + 1 diff --git a/Server/mods/deathmatch/local.conf b/Server/mods/deathmatch/local.conf index ec3defd37d..d30a608781 100644 --- a/Server/mods/deathmatch/local.conf +++ b/Server/mods/deathmatch/local.conf @@ -263,6 +263,22 @@ *NOTE* This only protects resources which use dbConnect with mysql Values: 0 - Off, 1 - Enabled. Default - 1 --> 1 + + + 1 + + + 0 + + + 1 diff --git a/Server/mods/deathmatch/logic/CCustomData.cpp b/Server/mods/deathmatch/logic/CCustomData.cpp index f18bbd37d1..545df5a0c3 100644 --- a/Server/mods/deathmatch/logic/CCustomData.cpp +++ b/Server/mods/deathmatch/logic/CCustomData.cpp @@ -21,7 +21,7 @@ void CCustomData::Copy(CCustomData* pCustomData) } } -SCustomData* CCustomData::Get(const char* szName) +SCustomData* CCustomData::Get(const char* szName) const { assert(szName); @@ -100,6 +100,7 @@ void CCustomData::Set(const char* szName, const CLuaArgument& Variable, ESyncTyp SCustomData newData; newData.Variable = Variable; newData.syncType = syncType; + newData.clientChangesMode = eCustomDataClientTrust::UNSET; m_Data[szName] = newData; UpdateSynced(szName, Variable, syncType); } @@ -120,6 +121,12 @@ bool CCustomData::Delete(const char* szName) return false; } +void CCustomData::SetClientChangesMode(const char* szName, eCustomDataClientTrust mode) +{ + SCustomData& pData = m_Data[szName]; + pData.clientChangesMode = mode; +} + CXMLNode* CCustomData::OutputToXML(CXMLNode* pNode) { std::map::const_iterator iter = m_Data.begin(); diff --git a/Server/mods/deathmatch/logic/CCustomData.h b/Server/mods/deathmatch/logic/CCustomData.h index bfb17ff529..887ef34dee 100644 --- a/Server/mods/deathmatch/logic/CCustomData.h +++ b/Server/mods/deathmatch/logic/CCustomData.h @@ -25,10 +25,18 @@ enum class ESyncType SUBSCRIBE, }; +enum class eCustomDataClientTrust : std::uint8_t +{ + UNSET, + ALLOW, + DENY, +}; + struct SCustomData { - CLuaArgument Variable; - ESyncType syncType; + CLuaArgument Variable; + ESyncType syncType; + eCustomDataClientTrust clientChangesMode; }; class CCustomData @@ -36,12 +44,14 @@ class CCustomData public: void Copy(CCustomData* pCustomData); - SCustomData* Get(const char* szName); + SCustomData* Get(const char* szName) const; SCustomData* GetSynced(const char* szName); void Set(const char* szName, const CLuaArgument& Variable, ESyncType syncType = ESyncType::BROADCAST); bool Delete(const char* szName); + void SetClientChangesMode(const char* szName, eCustomDataClientTrust mode); + unsigned short CountOnlySynchronized(); CXMLNode* OutputToXML(CXMLNode* pNode); diff --git a/Server/mods/deathmatch/logic/CElement.cpp b/Server/mods/deathmatch/logic/CElement.cpp index 59086a2f14..79a051b545 100644 --- a/Server/mods/deathmatch/logic/CElement.cpp +++ b/Server/mods/deathmatch/logic/CElement.cpp @@ -508,7 +508,7 @@ void CElement::ReadCustomData(CEvents* pEvents, CXMLNode& Node) } } -CLuaArgument* CElement::GetCustomData(const char* szName, bool bInheritData, ESyncType* pSyncType) +CLuaArgument* CElement::GetCustomData(const char* szName, bool bInheritData, ESyncType* pSyncType, eCustomDataClientTrust* clientChangesMode) { assert(szName); @@ -518,13 +518,17 @@ CLuaArgument* CElement::GetCustomData(const char* szName, bool bInheritData, ESy { if (pSyncType) *pSyncType = pData->syncType; + + if (clientChangesMode) + *clientChangesMode = pData->clientChangesMode; + return &pData->Variable; } // If none, try returning parent's custom data if (bInheritData && m_pParent) { - return m_pParent->GetCustomData(szName, true, pSyncType); + return m_pParent->GetCustomData(szName, true, pSyncType, clientChangesMode); } // None available diff --git a/Server/mods/deathmatch/logic/CElement.h b/Server/mods/deathmatch/logic/CElement.h index e3a0fa4d07..802981cd5a 100644 --- a/Server/mods/deathmatch/logic/CElement.h +++ b/Server/mods/deathmatch/logic/CElement.h @@ -136,7 +136,7 @@ class CElement void ReadCustomData(CEvents* pEvents, CXMLNode& Node); CCustomData& GetCustomDataManager() { return m_CustomData; } - CLuaArgument* GetCustomData(const char* szName, bool bInheritData, ESyncType* pSyncType = NULL); + CLuaArgument* GetCustomData(const char* szName, bool bInheritData, ESyncType* pSyncType = nullptr, eCustomDataClientTrust* clientChangesMode = nullptr); CLuaArguments* GetAllCustomData(CLuaArguments* table); bool GetCustomDataString(const char* szName, char* pOut, size_t sizeBuffer, bool bInheritData); bool GetCustomDataInt(const char* szName, int& iOut, bool bInheritData); diff --git a/Server/mods/deathmatch/logic/CGame.cpp b/Server/mods/deathmatch/logic/CGame.cpp index d4efea393f..b1a2ca18d6 100644 --- a/Server/mods/deathmatch/logic/CGame.cpp +++ b/Server/mods/deathmatch/logic/CGame.cpp @@ -58,6 +58,7 @@ #include "packets/CPlayerNetworkStatusPacket.h" #include "packets/CPlayerListPacket.h" #include "packets/CPlayerClothesPacket.h" +#include "packets/CPlayerWorldSpecialPropertyPacket.h" #include "packets/CServerInfoSyncPacket.h" #include "packets/CLuaPacket.h" #include "../utils/COpenPortsTester.h" @@ -258,6 +259,7 @@ CGame::CGame() : m_FloodProtect(4, 30000, 30000) // Max of 4 connecti m_WorldSpecialProps[WorldSpecialProperty::EXTENDEDWATERCANNONS] = true; m_WorldSpecialProps[WorldSpecialProperty::ROADSIGNSTEXT] = true; m_WorldSpecialProps[WorldSpecialProperty::TUNNELWEATHERBLEND] = true; + m_WorldSpecialProps[WorldSpecialProperty::IGNOREFIRESTATE] = false; m_JetpackWeapons[WEAPONTYPE_MICRO_UZI] = true; m_JetpackWeapons[WEAPONTYPE_TEC9] = true; @@ -1292,6 +1294,12 @@ bool CGame::ProcessPacket(CPacket& Packet) return true; } + case PACKET_ID_PLAYER_WORLD_SPECIAL_PROPERTY: + { + Packet_PlayerWorldSpecialProperty(static_cast(Packet)); + return true; + } + default: break; } @@ -1607,6 +1615,8 @@ void CGame::AddBuiltInEvents() m_Events.AddEvent("onPlayerTriggerEventThreshold", "", nullptr, false); m_Events.AddEvent("onPlayerTeamChange", "oldTeam, newTeam", nullptr, false); m_Events.AddEvent("onPlayerTriggerInvalidEvent", "eventName, isAdded, isRemote", nullptr, false); + m_Events.AddEvent("onPlayerChangesProtectedData", "element, key, value", nullptr, false); + m_Events.AddEvent("onPlayerChangesWorldSpecialProperty", "property, enabled", nullptr, false); // Ped events m_Events.AddEvent("onPedVehicleEnter", "vehicle, seat, jacked", NULL, false); @@ -1797,6 +1807,21 @@ void CGame::Packet_PlayerJoinData(CPlayerJoinDataPacket& Packet) return; } + // Check if another player is using the same serial + if (m_pMainConfig->IsCheckDuplicateSerialsEnabled() && m_pPlayerManager->GetBySerial(strSerial)) + { + // Tell the console + CLogger::LogPrintf("CONNECT: %s failed to connect (Serial already in use) (%s)\n", szNick, strIPAndSerial.c_str()); + + // Tell the player the problem + if (pPlayer->CanBitStream(eBitStreamVersion::CheckDuplicateSerials)) + DisconnectPlayer(this, *pPlayer, CPlayerDisconnectedPacket::SERIAL_DUPLICATE); + else + DisconnectPlayer(this, *pPlayer, CPlayerDisconnectedPacket::KICK); + + return; + } + // Check the nick is valid if (!CheckNickProvided(szNick)) { @@ -2652,7 +2677,24 @@ void CGame::Packet_CustomData(CCustomDataPacket& Packet) } ESyncType lastSyncType = ESyncType::BROADCAST; - pElement->GetCustomData(szName, false, &lastSyncType); + eCustomDataClientTrust clientChangesMode{}; + + pElement->GetCustomData(szName, false, &lastSyncType, &clientChangesMode); + + const bool changesAllowed = clientChangesMode == eCustomDataClientTrust::UNSET ? !m_pMainConfig->IsElementDataWhitelisted() + : clientChangesMode == eCustomDataClientTrust::ALLOW; + if (!changesAllowed) + { + CLogger::ErrorPrintf("Client trying to change protected element data %s (%s)", Packet.GetSourcePlayer()->GetNick(), + szName); + + CLuaArguments arguments; + arguments.PushElement(pElement); + arguments.PushString(szName); + arguments.PushArgument(Value); + pSourcePlayer->CallEvent("onPlayerChangesProtectedData", arguments); + return; + } if (lastSyncType != ESyncType::LOCAL) { @@ -4222,6 +4264,23 @@ void CGame::Packet_PlayerResourceStart(CPlayerResourceStartPacket& Packet) } } +void CGame::Packet_PlayerWorldSpecialProperty(CPlayerWorldSpecialPropertyPacket& packet) noexcept +{ + CPlayer* player = packet.GetSourcePlayer(); + + if (!player) + return; + + const std::string& property = packet.GetProperty(); + const bool enabled = packet.IsEnabled(); + + CLuaArguments arguments; + arguments.PushString(property); + arguments.PushBoolean(enabled); + + player->CallEvent("onPlayerChangesWorldSpecialProperty", arguments, nullptr); +} + void CGame::Packet_PlayerModInfo(CPlayerModInfoPacket& Packet) { CPlayer* pPlayer = Packet.GetSourcePlayer(); diff --git a/Server/mods/deathmatch/logic/CGame.h b/Server/mods/deathmatch/logic/CGame.h index d865e858ec..e6bd4dfccf 100644 --- a/Server/mods/deathmatch/logic/CGame.h +++ b/Server/mods/deathmatch/logic/CGame.h @@ -519,6 +519,7 @@ class CGame void Packet_PlayerNoSocket(class CPlayerNoSocketPacket& Packet); void Packet_PlayerNetworkStatus(class CPlayerNetworkStatusPacket& Packet); void Packet_PlayerResourceStart(class CPlayerResourceStartPacket& Packet); + void Packet_PlayerWorldSpecialProperty(class CPlayerWorldSpecialPropertyPacket& packet) noexcept; static void PlayerCompleteConnect(CPlayer* pPlayer); diff --git a/Server/mods/deathmatch/logic/CMainConfig.cpp b/Server/mods/deathmatch/logic/CMainConfig.cpp index d47950e73e..49c73419ca 100644 --- a/Server/mods/deathmatch/logic/CMainConfig.cpp +++ b/Server/mods/deathmatch/logic/CMainConfig.cpp @@ -79,6 +79,8 @@ CMainConfig::CMainConfig(CConsole* pConsole) : CXMLConfig(NULL) m_iBackupInterval = 3; m_iBackupAmount = 5; m_bSyncMapElementData = true; + m_elementDataWhitelisted = false; + m_checkDuplicateSerials = true; } bool CMainConfig::Load() @@ -526,6 +528,9 @@ bool CMainConfig::Load() g_TickRateSettings.iLightSync = Clamp(200, g_TickRateSettings.iLightSync, 4000); } + GetBoolean(m_pRootNode, "elementdata_whitelisted", m_elementDataWhitelisted); + GetBoolean(m_pRootNode, "check_duplicate_serials", m_checkDuplicateSerials); + ApplyNetOptions(); return true; @@ -1468,6 +1473,7 @@ const std::vector& CMainConfig::GetIntSettingList() {false, false, 0, 0, 1, "fakelag", &m_bFakeLagCommandEnabled, NULL}, {true, true, 50, 1000, 5000, "player_triggered_event_interval", &m_iPlayerTriggeredEventIntervalMs, &CMainConfig::OnPlayerTriggeredEventIntervalChange}, {true, true, 1, 100, 1000, "max_player_triggered_events_per_interval", &m_iMaxPlayerTriggeredEventsPerInterval, &CMainConfig::OnPlayerTriggeredEventIntervalChange}, + {true, true, 0, 1, 1, "resource_client_file_checks", &m_checkResourceClientFiles, nullptr}, }; static std::vector settingsList; diff --git a/Server/mods/deathmatch/logic/CMainConfig.h b/Server/mods/deathmatch/logic/CMainConfig.h index b52733229a..05df0e2f32 100644 --- a/Server/mods/deathmatch/logic/CMainConfig.h +++ b/Server/mods/deathmatch/logic/CMainConfig.h @@ -126,6 +126,9 @@ class CMainConfig : public CXMLConfig const std::vector& GetOwnerEmailAddressList() const { return m_OwnerEmailAddressList; } bool IsDatabaseCredentialsProtectionEnabled() const { return m_bDatabaseCredentialsProtectionEnabled != 0; } bool IsFakeLagCommandEnabled() const { return m_bFakeLagCommandEnabled != 0; } + bool IsElementDataWhitelisted() const { return m_elementDataWhitelisted; } + bool IsCheckDuplicateSerialsEnabled() const noexcept { return m_checkDuplicateSerials; } + bool IsCheckResourceClientFilesEnabled() const noexcept { return m_checkResourceClientFiles != 0; } SString GetSetting(const SString& configSetting); bool GetSetting(const SString& configSetting, SString& strValue); @@ -227,4 +230,7 @@ class CMainConfig : public CXMLConfig int m_bFakeLagCommandEnabled; int m_iPlayerTriggeredEventIntervalMs; int m_iMaxPlayerTriggeredEventsPerInterval; + bool m_elementDataWhitelisted; + bool m_checkDuplicateSerials; + int m_checkResourceClientFiles; }; diff --git a/Server/mods/deathmatch/logic/CPacketTranslator.cpp b/Server/mods/deathmatch/logic/CPacketTranslator.cpp index 3b6d92c3db..3cf0fa0965 100644 --- a/Server/mods/deathmatch/logic/CPacketTranslator.cpp +++ b/Server/mods/deathmatch/logic/CPacketTranslator.cpp @@ -48,6 +48,7 @@ #include "packets/CPlayerNoSocketPacket.h" #include "packets/CPlayerNetworkStatusPacket.h" #include "packets/CPlayerResourceStartPacket.h" +#include "packets/CPlayerWorldSpecialPropertyPacket.h" CPacketTranslator::CPacketTranslator(CPlayerManager* pPlayerManager) { @@ -212,6 +213,10 @@ CPacket* CPacketTranslator::Translate(const NetServerPlayerID& Socket, ePacketID pTemp = new CPlayerResourceStartPacket; break; + case PACKET_ID_PLAYER_WORLD_SPECIAL_PROPERTY: + pTemp = new CPlayerWorldSpecialPropertyPacket; + break; + default: break; } diff --git a/Server/mods/deathmatch/logic/CPlayerManager.cpp b/Server/mods/deathmatch/logic/CPlayerManager.cpp index abdf923df7..227d3677f2 100644 --- a/Server/mods/deathmatch/logic/CPlayerManager.cpp +++ b/Server/mods/deathmatch/logic/CPlayerManager.cpp @@ -138,6 +138,17 @@ CPlayer* CPlayerManager::Get(const char* szNick, bool bCaseSensitive) return NULL; } +CPlayer* CPlayerManager::GetBySerial(const std::string_view serial) const noexcept +{ + for (const auto& player : m_Players) + { + if (player->GetSerial() == serial) + return player; + } + + return nullptr; +} + void CPlayerManager::DeleteAll() { // Delete all the items in the list diff --git a/Server/mods/deathmatch/logic/CPlayerManager.h b/Server/mods/deathmatch/logic/CPlayerManager.h index bd503380f4..0380c4bce4 100644 --- a/Server/mods/deathmatch/logic/CPlayerManager.h +++ b/Server/mods/deathmatch/logic/CPlayerManager.h @@ -40,6 +40,7 @@ class CPlayerManager CPlayer* Get(const NetServerPlayerID& PlayerSocket); CPlayer* Get(const char* szNick, bool bCaseSensitive = false); + CPlayer* GetBySerial(const std::string_view serial) const noexcept; std::list::const_iterator IterBegin() { return m_Players.begin(); }; std::list::const_iterator IterEnd() { return m_Players.end(); }; diff --git a/Server/mods/deathmatch/logic/CResource.cpp b/Server/mods/deathmatch/logic/CResource.cpp index 1c2ebe3ea8..279f1937a7 100644 --- a/Server/mods/deathmatch/logic/CResource.cpp +++ b/Server/mods/deathmatch/logic/CResource.cpp @@ -35,6 +35,7 @@ #include #include #include +#include "CStaticFunctionDefinitions.h" #ifdef WIN32 #include diff --git a/Server/mods/deathmatch/logic/CResourceChecker.Data.h b/Server/mods/deathmatch/logic/CResourceChecker.Data.h index e6bdee9212..630f70fd81 100644 --- a/Server/mods/deathmatch/logic/CResourceChecker.Data.h +++ b/Server/mods/deathmatch/logic/CResourceChecker.Data.h @@ -167,8 +167,8 @@ namespace //{false, "doesPedHaveJetPack", "isPedWearingJetpack"}, // Base Encoding & Decoding - {false, "base64Encode", "encodeString"}, - {false, "base64Decode", "decodeString"}, + {true, "base64Encode", "Please manually change this to encodeString (different syntax). Refer to the wiki for details"}, + {true, "base64Decode", "Please manually change this to decodeString (different syntax). Refer to the wiki for details"}, {false, "setHelicopterRotorSpeed", "setVehicleRotorSpeed"} }; @@ -271,7 +271,7 @@ namespace {true, "setPlayerDiscordJoinParams", "See GitHub PR #2499 for more details"}, // Base Encoding & Decoding - {false, "base64Encode", "encodeString"}, - {false, "base64Decode", "decodeString"} + {true, "base64Encode", "Please manually change this to encodeString (different syntax). Refer to the wiki for details"}, + {true, "base64Decode", "Please manually change this to decodeString (different syntax). Refer to the wiki for details"} }; } // namespace diff --git a/Server/mods/deathmatch/logic/CResourceChecker.cpp b/Server/mods/deathmatch/logic/CResourceChecker.cpp index db2909cb1c..9998b089ca 100644 --- a/Server/mods/deathmatch/logic/CResourceChecker.cpp +++ b/Server/mods/deathmatch/logic/CResourceChecker.cpp @@ -13,6 +13,8 @@ #include "CResourceChecker.h" #include "CResourceChecker.Data.h" #include "CResource.h" +#include "CMainConfig.h" +#include "CGame.h" #include "CLogger.h" #include "CStaticFunctionDefinitions.h" #include @@ -28,6 +30,7 @@ extern CNetServer* g_pRealNetServer; extern CServerInterface* g_pServerInterface; +extern CGame* g_pGame; /////////////////////////////////////////////////////////////// // @@ -48,6 +51,9 @@ void CResourceChecker::CheckResourceForIssues(CResource* pResource, const string m_ulDeprecatedWarningCount = 0; m_upgradedFullPathList.clear(); + // Checking certain resource client files is optional + bool checkResourceClientFiles = g_pGame->GetConfig()->IsCheckResourceClientFilesEnabled(); + // Check each file in the resource std::list::iterator iterf = pResource->IterBegin(); for (; iterf != pResource->IterEnd(); iterf++) @@ -73,7 +79,7 @@ void CResourceChecker::CheckResourceForIssues(CResource* pResource, const string bScript = true; bClient = true; } - else if (type == CResourceFile::RESOURCE_FILE_TYPE_CLIENT_FILE) + else if (type == CResourceFile::RESOURCE_FILE_TYPE_CLIENT_FILE && checkResourceClientFiles) { bScript = false; bClient = true; @@ -361,16 +367,25 @@ void CResourceChecker::CheckMetaSourceForIssues(CXMLNode* pRootNode, const strin attributes.Delete("client"); attributes.Delete("both"); - if (!m_strReqServerVersion.empty()) + // Use "both" if client and server versions are the same + if (!m_strReqServerVersion.empty() && !m_strReqClientVersion.empty() && m_strReqServerVersion == m_strReqClientVersion) { - CXMLAttribute* pAttr = attributes.Create("server"); + CXMLAttribute* pAttr = attributes.Create("both"); pAttr->SetValue(m_strReqServerVersion); } - - if (!m_strReqClientVersion.empty()) + else { - CXMLAttribute* pAttr = attributes.Create("client"); - pAttr->SetValue(m_strReqClientVersion); + if (!m_strReqServerVersion.empty()) + { + CXMLAttribute* pAttr = attributes.Create("server"); + pAttr->SetValue(m_strReqServerVersion); + } + + if (!m_strReqClientVersion.empty()) + { + CXMLAttribute* pAttr = attributes.Create("client"); + pAttr->SetValue(m_strReqClientVersion); + } } if (pbOutHasChanged) diff --git a/Server/mods/deathmatch/logic/CResourceChecker.h b/Server/mods/deathmatch/logic/CResourceChecker.h index 50c7ec00bb..ea9e7a1be9 100644 --- a/Server/mods/deathmatch/logic/CResourceChecker.h +++ b/Server/mods/deathmatch/logic/CResourceChecker.h @@ -2,7 +2,7 @@ * * PROJECT: Multi Theft Auto v1.0 * LICENSE: See LICENSE in the top level directory - * FILE: mods/deathmatch/logic/CResourceChecker.cpp + * FILE: mods/deathmatch/logic/CResourceChecker.h * PURPOSE: Resource file content checker/validator/upgrader * * Multi Theft Auto is available from http://www.multitheftauto.com/ diff --git a/Server/mods/deathmatch/logic/CStaticFunctionDefinitions.cpp b/Server/mods/deathmatch/logic/CStaticFunctionDefinitions.cpp index 67764f8057..24c9ff6edc 100644 --- a/Server/mods/deathmatch/logic/CStaticFunctionDefinitions.cpp +++ b/Server/mods/deathmatch/logic/CStaticFunctionDefinitions.cpp @@ -954,14 +954,19 @@ bool CStaticFunctionDefinitions::SetElementID(CElement* pElement, const char* sz return true; } -bool CStaticFunctionDefinitions::SetElementData(CElement* pElement, const char* szName, const CLuaArgument& Variable, ESyncType syncType) +bool CStaticFunctionDefinitions::SetElementData(CElement* pElement, const char* szName, const CLuaArgument& Variable, ESyncType syncType, + std::optional clientTrust) { assert(pElement); assert(szName); assert(strlen(szName) <= MAX_CUSTOMDATA_NAME_LENGTH); - ESyncType lastSyncType = ESyncType::BROADCAST; - CLuaArgument* pCurrentVariable = pElement->GetCustomData(szName, false, &lastSyncType); + ESyncType lastSyncType = ESyncType::BROADCAST; + eCustomDataClientTrust lastClientTrust{}; + CLuaArgument* pCurrentVariable = pElement->GetCustomData(szName, false, &lastSyncType, &lastClientTrust); + + if (clientTrust.has_value() && lastClientTrust != clientTrust.value()) + pElement->GetCustomDataManager().SetClientChangesMode(szName, clientTrust.value()); if (!pCurrentVariable || *pCurrentVariable != Variable || lastSyncType != syncType) { @@ -10856,6 +10861,13 @@ bool CStaticFunctionDefinitions::SendSyncIntervals(CPlayer* pPlayer) BitStream.pBitStream->Write(g_TickRateSettings.iObjectSync); BitStream.pBitStream->Write(g_TickRateSettings.iKeySyncRotation); BitStream.pBitStream->Write(g_TickRateSettings.iKeySyncAnalogMove); + + if (pPlayer->CanBitStream(eBitStreamVersion::FixSyncerDistance)) + { + BitStream.pBitStream->Write(g_TickRateSettings.iPedSyncerDistance); + BitStream.pBitStream->Write(g_TickRateSettings.iUnoccupiedVehicleSyncerDistance); + } + if (pPlayer) pPlayer->Send(CLuaPacket(SET_SYNC_INTERVALS, *BitStream.pBitStream)); else diff --git a/Server/mods/deathmatch/logic/CStaticFunctionDefinitions.h b/Server/mods/deathmatch/logic/CStaticFunctionDefinitions.h index dd6202208f..8c947d6f34 100644 --- a/Server/mods/deathmatch/logic/CStaticFunctionDefinitions.h +++ b/Server/mods/deathmatch/logic/CStaticFunctionDefinitions.h @@ -83,7 +83,8 @@ class CStaticFunctionDefinitions // Element set funcs static bool ClearElementVisibleTo(CElement* pElement); static bool SetElementID(CElement* pElement, const char* szID); - static bool SetElementData(CElement* pElement, const char* szName, const CLuaArgument& Variable, ESyncType syncType); + static bool SetElementData(CElement* pElement, const char* szName, const CLuaArgument& Variable, ESyncType syncType, + std::optional clientTrust); static bool RemoveElementData(CElement* pElement, const char* szName); static bool AddElementDataSubscriber(CElement* pElement, const char* szName, CPlayer* pPlayer); static bool RemoveElementDataSubscriber(CElement* pElement, const char* szName, CPlayer* pPlayer); diff --git a/Server/mods/deathmatch/logic/lua/CLuaFunctionParseHelpers.cpp b/Server/mods/deathmatch/logic/lua/CLuaFunctionParseHelpers.cpp index ef25750c05..76540327af 100644 --- a/Server/mods/deathmatch/logic/lua/CLuaFunctionParseHelpers.cpp +++ b/Server/mods/deathmatch/logic/lua/CLuaFunctionParseHelpers.cpp @@ -285,6 +285,12 @@ ADD_ENUM(ESyncType::LOCAL, "local") ADD_ENUM(ESyncType::SUBSCRIBE, "subscribe") IMPLEMENT_ENUM_CLASS_END("sync-mode") +IMPLEMENT_ENUM_CLASS_BEGIN(eCustomDataClientTrust) +ADD_ENUM(eCustomDataClientTrust::UNSET, "default") +ADD_ENUM(eCustomDataClientTrust::ALLOW, "allow") +ADD_ENUM(eCustomDataClientTrust::DENY, "deny") +IMPLEMENT_ENUM_CLASS_END("client-trust-mode") + // // CResource from userdata // diff --git a/Server/mods/deathmatch/logic/lua/CLuaFunctionParseHelpers.h b/Server/mods/deathmatch/logic/lua/CLuaFunctionParseHelpers.h index 52a4536012..796ca3c702 100644 --- a/Server/mods/deathmatch/logic/lua/CLuaFunctionParseHelpers.h +++ b/Server/mods/deathmatch/logic/lua/CLuaFunctionParseHelpers.h @@ -38,6 +38,7 @@ DECLARE_ENUM(CAccessControlListRight::ERightType); DECLARE_ENUM(CElement::EElementType); DECLARE_ENUM(CAccountPassword::EAccountPasswordType); DECLARE_ENUM_CLASS(ESyncType); +DECLARE_ENUM_CLASS(eCustomDataClientTrust) enum eHudComponent { diff --git a/Server/mods/deathmatch/logic/luadefs/CLuaElementDefs.cpp b/Server/mods/deathmatch/logic/luadefs/CLuaElementDefs.cpp index 6cacbdcc98..f8effd7b89 100644 --- a/Server/mods/deathmatch/logic/luadefs/CLuaElementDefs.cpp +++ b/Server/mods/deathmatch/logic/luadefs/CLuaElementDefs.cpp @@ -1538,6 +1538,7 @@ int CLuaElementDefs::setElementData(lua_State* luaVM) SString strKey; CLuaArgument value; ESyncType syncType = ESyncType::BROADCAST; + std::optional clientTrust{}; CScriptArgReader argStream(luaVM); argStream.ReadUserData(pElement); @@ -1554,6 +1555,13 @@ int CLuaElementDefs::setElementData(lua_State* luaVM) else argStream.ReadEnumString(syncType, ESyncType::BROADCAST); + if (!argStream.NextIsNone()) + { + eCustomDataClientTrust trustReaded; + argStream.ReadEnumString(trustReaded); + clientTrust = trustReaded; + } + if (!argStream.HasErrors()) { LogWarningIfPlayerHasNotJoinedYet(luaVM, pElement); @@ -1566,7 +1574,7 @@ int CLuaElementDefs::setElementData(lua_State* luaVM) strKey = strKey.Left(MAX_CUSTOMDATA_NAME_LENGTH); } - if (CStaticFunctionDefinitions::SetElementData(pElement, strKey, value, syncType)) + if (CStaticFunctionDefinitions::SetElementData(pElement, strKey, value, syncType, clientTrust)) { lua_pushboolean(luaVM, true); return 1; diff --git a/Server/mods/deathmatch/logic/packets/CMapInfoPacket.cpp b/Server/mods/deathmatch/logic/packets/CMapInfoPacket.cpp index e62547b3fb..e2adf9a5bc 100644 --- a/Server/mods/deathmatch/logic/packets/CMapInfoPacket.cpp +++ b/Server/mods/deathmatch/logic/packets/CMapInfoPacket.cpp @@ -192,6 +192,7 @@ bool CMapInfoPacket::Write(NetBitStreamInterface& BitStream) const wsProps.data3.roadsignstext = g_pGame->IsWorldSpecialPropertyEnabled(WorldSpecialProperty::ROADSIGNSTEXT); wsProps.data4.extendedwatercannons = g_pGame->IsWorldSpecialPropertyEnabled(WorldSpecialProperty::EXTENDEDWATERCANNONS); wsProps.data5.tunnelweatherblend = g_pGame->IsWorldSpecialPropertyEnabled(WorldSpecialProperty::TUNNELWEATHERBLEND); + wsProps.data6.ignoreFireState = g_pGame->IsWorldSpecialPropertyEnabled(WorldSpecialProperty::IGNOREFIRESTATE); BitStream.Write(&wsProps); } diff --git a/Server/mods/deathmatch/logic/packets/CPlayerDisconnectedPacket.h b/Server/mods/deathmatch/logic/packets/CPlayerDisconnectedPacket.h index 82fdfbd1b0..541f9b191c 100644 --- a/Server/mods/deathmatch/logic/packets/CPlayerDisconnectedPacket.h +++ b/Server/mods/deathmatch/logic/packets/CPlayerDisconnectedPacket.h @@ -39,7 +39,8 @@ class CPlayerDisconnectedPacket final : public CPacket BAN, KICK, CUSTOM, - SHUTDOWN + SHUTDOWN, + SERIAL_DUPLICATE }; CPlayerDisconnectedPacket(const char* szReason); diff --git a/Server/mods/deathmatch/logic/packets/CPlayerWorldSpecialPropertyPacket.cpp b/Server/mods/deathmatch/logic/packets/CPlayerWorldSpecialPropertyPacket.cpp new file mode 100644 index 0000000000..59c3ec4c7b --- /dev/null +++ b/Server/mods/deathmatch/logic/packets/CPlayerWorldSpecialPropertyPacket.cpp @@ -0,0 +1,20 @@ +/***************************************************************************** + * + * PROJECT: Multi Theft Auto + * LICENSE: See LICENSE in the top level directory + * FILE: mods/deathmatch/logic/packets/CPlayerWorldSpecialPropertyPacket.cpp + * + * Multi Theft Auto is available from https://www.multitheftauto.com/ + * + *****************************************************************************/ + +#include "StdInc.h" +#include "CPlayerWorldSpecialPropertyPacket.h" + +bool CPlayerWorldSpecialPropertyPacket::Read(NetBitStreamInterface& stream) noexcept +{ + stream.ReadString(m_property); + stream.ReadBit(m_enabled); + + return true; +} diff --git a/Server/mods/deathmatch/logic/packets/CPlayerWorldSpecialPropertyPacket.h b/Server/mods/deathmatch/logic/packets/CPlayerWorldSpecialPropertyPacket.h new file mode 100644 index 0000000000..cb6dd9e2f1 --- /dev/null +++ b/Server/mods/deathmatch/logic/packets/CPlayerWorldSpecialPropertyPacket.h @@ -0,0 +1,34 @@ +/***************************************************************************** + * + * PROJECT: Multi Theft Auto + * LICENSE: See LICENSE in the top level directory + * FILE: mods/deathmatch/logic/packets/CPlayerWorldSpecialPropertyPacket.h + * + * Multi Theft Auto is available from https://www.multitheftauto.com/ + * + *****************************************************************************/ + +#pragma once + +#include +#include +#include "CPacket.h" + +class CPlayerWorldSpecialPropertyPacket final : public CPacket +{ +public: + CPlayerWorldSpecialPropertyPacket() noexcept {} + + ePacketID GetPacketID() const noexcept { return PACKET_ID_PLAYER_WORLD_SPECIAL_PROPERTY; } + unsigned long GetFlags() const noexcept { return PACKET_HIGH_PRIORITY | PACKET_RELIABLE | PACKET_SEQUENCED; } + virtual ePacketOrdering GetPacketOrdering() const noexcept { return PACKET_ORDERING_DEFAULT; } + + bool Read(NetBitStreamInterface& stream) noexcept; + + std::string GetProperty() const noexcept { return m_property; } + bool IsEnabled() const noexcept { return m_enabled; } + +private: + std::string m_property; + bool m_enabled; +}; diff --git a/Server/mods/deathmatch/mtaserver.conf b/Server/mods/deathmatch/mtaserver.conf index 19fe4a05d8..726199d548 100644 --- a/Server/mods/deathmatch/mtaserver.conf +++ b/Server/mods/deathmatch/mtaserver.conf @@ -268,12 +268,28 @@ Values: 0 - Off, 1 - Enabled. Default - 1 --> 1 + + 0 + + + 1 + 1000 100 + + + 1 diff --git a/Server/mods/deathmatch/mtaserver.conf.template b/Server/mods/deathmatch/mtaserver.conf.template index faf1c71a6d..13237b1b10 100644 --- a/Server/mods/deathmatch/mtaserver.conf.template +++ b/Server/mods/deathmatch/mtaserver.conf.template @@ -269,10 +269,26 @@ Values: 0 - Off, 1 - Enabled. Default - 1 --> 1 + + 0 + + + 1 + 1000 100 + + + 1 diff --git a/Shared/data/MTA San Andreas/MTA/cgui/images/map_1024.png b/Shared/data/MTA San Andreas/MTA/cgui/images/map_1024.png new file mode 100644 index 0000000000..747e6d6d49 Binary files /dev/null and b/Shared/data/MTA San Andreas/MTA/cgui/images/map_1024.png differ diff --git a/Shared/data/MTA San Andreas/MTA/cgui/images/map_2048.png b/Shared/data/MTA San Andreas/MTA/cgui/images/map_2048.png new file mode 100644 index 0000000000..c41bfbb347 Binary files /dev/null and b/Shared/data/MTA San Andreas/MTA/cgui/images/map_2048.png differ diff --git a/Shared/data/MTA San Andreas/MTA/cgui/images/radar.jpg b/Shared/data/MTA San Andreas/MTA/cgui/images/radar.jpg deleted file mode 100644 index 4249b8943f..0000000000 Binary files a/Shared/data/MTA San Andreas/MTA/cgui/images/radar.jpg and /dev/null differ diff --git a/Shared/data/MTA San Andreas/MTA/locale/en_US/client.pot b/Shared/data/MTA San Andreas/MTA/locale/en_US/client.pot index ec1109aa63..2bfd95eb7c 100644 --- a/Shared/data/MTA San Andreas/MTA/locale/en_US/client.pot +++ b/Shared/data/MTA San Andreas/MTA/locale/en_US/client.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: MTA San Andreas 1.x\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-23 16:33+0000\n" +"POT-Creation-Date: 2024-11-21 22:47+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -35,7 +35,7 @@ msgstr "" msgid "Remember decision" msgstr "" -#: Client/cefweb/CWebsiteRequests.cpp:51 Client/core/CSettings.cpp:978 +#: Client/cefweb/CWebsiteRequests.cpp:51 Client/core/CSettings.cpp:991 msgid "Allow" msgstr "" @@ -85,47 +85,47 @@ msgid "previous radio channel" msgstr "" #: Client/mods/deathmatch/CClient.cpp:67 -msgid "enables the radar view" +msgid "enables the player-map view" msgstr "" #: Client/mods/deathmatch/CClient.cpp:68 -msgid "zooms the radar in" +msgid "zooms the player-map in" msgstr "" #: Client/mods/deathmatch/CClient.cpp:69 -msgid "zooms the radar out" +msgid "zooms the player-map out" msgstr "" #: Client/mods/deathmatch/CClient.cpp:70 -msgid "moves the radar north" +msgid "moves the player-map north" msgstr "" #: Client/mods/deathmatch/CClient.cpp:71 -msgid "moves the radar south" +msgid "moves the player-map south" msgstr "" #: Client/mods/deathmatch/CClient.cpp:72 -msgid "moves the radar east" +msgid "moves the player-map east" msgstr "" #: Client/mods/deathmatch/CClient.cpp:73 -msgid "moves the radar west" +msgid "moves the player-map west" msgstr "" #: Client/mods/deathmatch/CClient.cpp:74 -msgid "attaches the radar" +msgid "attaches the player-map" msgstr "" #: Client/mods/deathmatch/CClient.cpp:75 -msgid "reduces radar opacity" +msgid "reduces player-map opacity" msgstr "" #: Client/mods/deathmatch/CClient.cpp:76 -msgid "increases radar opacity" +msgid "increases player-map opacity" msgstr "" #: Client/mods/deathmatch/CClient.cpp:77 -msgid "toggles radar help text" +msgid "toggles player-map help text" msgstr "" #: Client/mods/deathmatch/CClient.cpp:78 @@ -159,123 +159,123 @@ msgid "(Development mode) prints world sound ids into the debug window" msgstr "" #: Client/mods/deathmatch/logic/CResource.cpp:375 -#: Client/mods/deathmatch/logic/CClientGame.cpp:1089 Client/core/CCore.cpp:674 -#: Client/core/CSettings.cpp:3489 +#: Client/mods/deathmatch/logic/CClientGame.cpp:1090 Client/core/CCore.cpp:674 +#: Client/core/CSettings.cpp:3510 msgid "In-game" msgstr "" -#: Client/mods/deathmatch/logic/CClientGame.cpp:374 +#: Client/mods/deathmatch/logic/CClientGame.cpp:375 msgid "Flying a UFO around" msgstr "" -#: Client/mods/deathmatch/logic/CClientGame.cpp:374 +#: Client/mods/deathmatch/logic/CClientGame.cpp:375 msgid "Cruising around" msgstr "" -#: Client/mods/deathmatch/logic/CClientGame.cpp:374 +#: Client/mods/deathmatch/logic/CClientGame.cpp:375 msgid "Riding the waves of" msgstr "" -#: Client/mods/deathmatch/logic/CClientGame.cpp:375 +#: Client/mods/deathmatch/logic/CClientGame.cpp:376 msgid "Riding the train in" msgstr "" -#: Client/mods/deathmatch/logic/CClientGame.cpp:375 +#: Client/mods/deathmatch/logic/CClientGame.cpp:376 msgid "Flying around" msgstr "" -#: Client/mods/deathmatch/logic/CClientGame.cpp:376 +#: Client/mods/deathmatch/logic/CClientGame.cpp:377 msgid "Riding around" msgstr "" -#: Client/mods/deathmatch/logic/CClientGame.cpp:376 +#: Client/mods/deathmatch/logic/CClientGame.cpp:377 msgid "Monster truckin' around" msgstr "" -#: Client/mods/deathmatch/logic/CClientGame.cpp:376 +#: Client/mods/deathmatch/logic/CClientGame.cpp:377 msgid "Quaddin' around" msgstr "" -#: Client/mods/deathmatch/logic/CClientGame.cpp:377 +#: Client/mods/deathmatch/logic/CClientGame.cpp:378 msgid "Bunny hopping around" msgstr "" -#: Client/mods/deathmatch/logic/CClientGame.cpp:377 +#: Client/mods/deathmatch/logic/CClientGame.cpp:378 msgid "Doing weird stuff in" msgstr "" -#: Client/mods/deathmatch/logic/CClientGame.cpp:381 +#: Client/mods/deathmatch/logic/CClientGame.cpp:382 msgid "Climbing around in" msgstr "" -#: Client/mods/deathmatch/logic/CClientGame.cpp:382 #: Client/mods/deathmatch/logic/CClientGame.cpp:383 +#: Client/mods/deathmatch/logic/CClientGame.cpp:384 msgid "Doing a drive-by in" msgstr "" -#: Client/mods/deathmatch/logic/CClientGame.cpp:384 +#: Client/mods/deathmatch/logic/CClientGame.cpp:385 msgid "Blub blub..." msgstr "" -#: Client/mods/deathmatch/logic/CClientGame.cpp:385 +#: Client/mods/deathmatch/logic/CClientGame.cpp:386 msgid "Breathing water" msgstr "" -#: Client/mods/deathmatch/logic/CClientGame.cpp:386 +#: Client/mods/deathmatch/logic/CClientGame.cpp:387 msgid "Drowning in" msgstr "" -#: Client/mods/deathmatch/logic/CClientGame.cpp:387 +#: Client/mods/deathmatch/logic/CClientGame.cpp:388 msgid "Ducking for cover in" msgstr "" -#: Client/mods/deathmatch/logic/CClientGame.cpp:388 +#: Client/mods/deathmatch/logic/CClientGame.cpp:389 msgid "Fighting in" msgstr "" -#: Client/mods/deathmatch/logic/CClientGame.cpp:389 +#: Client/mods/deathmatch/logic/CClientGame.cpp:390 msgid "Throwing fists in" msgstr "" -#: Client/mods/deathmatch/logic/CClientGame.cpp:390 +#: Client/mods/deathmatch/logic/CClientGame.cpp:391 msgid "Blastin' fools in" msgstr "" -#: Client/mods/deathmatch/logic/CClientGame.cpp:391 +#: Client/mods/deathmatch/logic/CClientGame.cpp:392 msgid "Shooting up" msgstr "" -#: Client/mods/deathmatch/logic/CClientGame.cpp:392 +#: Client/mods/deathmatch/logic/CClientGame.cpp:393 msgid "Jetpacking in" msgstr "" -#: Client/mods/deathmatch/logic/CClientGame.cpp:393 +#: Client/mods/deathmatch/logic/CClientGame.cpp:394 msgid "Literally on fire in" msgstr "" -#: Client/mods/deathmatch/logic/CClientGame.cpp:394 +#: Client/mods/deathmatch/logic/CClientGame.cpp:395 msgid "Burning up in" msgstr "" -#: Client/mods/deathmatch/logic/CClientGame.cpp:395 +#: Client/mods/deathmatch/logic/CClientGame.cpp:396 msgid "Swimming in" msgstr "" -#: Client/mods/deathmatch/logic/CClientGame.cpp:396 +#: Client/mods/deathmatch/logic/CClientGame.cpp:397 msgid "Floating around in" msgstr "" -#: Client/mods/deathmatch/logic/CClientGame.cpp:397 +#: Client/mods/deathmatch/logic/CClientGame.cpp:398 msgid "Being chased by a shark" msgstr "" -#: Client/mods/deathmatch/logic/CClientGame.cpp:398 +#: Client/mods/deathmatch/logic/CClientGame.cpp:399 msgid "Choking to death in" msgstr "" -#: Client/mods/deathmatch/logic/CClientGame.cpp:533 +#: Client/mods/deathmatch/logic/CClientGame.cpp:534 #: Client/core/CMainMenu.cpp:304 Client/core/CCore.cpp:674 -#: Client/core/CSettings.cpp:3485 +#: Client/core/CSettings.cpp:3506 msgid "Main menu" msgstr "" @@ -283,25 +283,25 @@ msgstr "" #. Display an error, reset the error status and exit #. Show a message that the connection timed out and abort #. Show failed message and abort the attempt -#: Client/mods/deathmatch/logic/CClientGame.cpp:641 -#: Client/mods/deathmatch/logic/CClientGame.cpp:715 -#: Client/mods/deathmatch/logic/CClientGame.cpp:739 -#: Client/mods/deathmatch/logic/CClientGame.cpp:761 -#: Client/mods/deathmatch/logic/CClientGame.cpp:1174 -#: Client/mods/deathmatch/logic/CClientGame.cpp:1254 -#: Client/mods/deathmatch/logic/CClientGame.cpp:1264 -#: Client/mods/deathmatch/logic/CClientGame.cpp:1333 -#: Client/mods/deathmatch/logic/CClientGame.cpp:1370 -#: Client/mods/deathmatch/logic/CClientGame.cpp:1419 -#: Client/mods/deathmatch/logic/CClientGame.cpp:1431 +#: Client/mods/deathmatch/logic/CClientGame.cpp:642 +#: Client/mods/deathmatch/logic/CClientGame.cpp:716 +#: Client/mods/deathmatch/logic/CClientGame.cpp:740 +#: Client/mods/deathmatch/logic/CClientGame.cpp:762 +#: Client/mods/deathmatch/logic/CClientGame.cpp:1175 +#: Client/mods/deathmatch/logic/CClientGame.cpp:1255 +#: Client/mods/deathmatch/logic/CClientGame.cpp:1265 +#: Client/mods/deathmatch/logic/CClientGame.cpp:1334 +#: Client/mods/deathmatch/logic/CClientGame.cpp:1371 +#: Client/mods/deathmatch/logic/CClientGame.cpp:1420 +#: Client/mods/deathmatch/logic/CClientGame.cpp:1432 #: Client/mods/deathmatch/logic/CResourceFileDownloadManager.cpp:145 #: Client/loader/MainFunctions.cpp:252 Client/loader/MainFunctions.cpp:267 #: Client/loader/MainFunctions.cpp:269 Client/loader/MainFunctions.cpp:846 #: Client/loader/CInstallManager.cpp:552 Client/loader/CInstallManager.cpp:561 #: Client/core/CGUI.cpp:93 Client/core/CCore.cpp:1279 -#: Client/core/CCore.cpp:1292 Client/core/CSettings.cpp:2945 -#: Client/core/CSettings.cpp:4179 Client/core/CSettings.cpp:4207 -#: Client/core/CSettings.cpp:4777 Client/core/CConnectManager.cpp:80 +#: Client/core/CCore.cpp:1292 Client/core/CSettings.cpp:2966 +#: Client/core/CSettings.cpp:4204 Client/core/CSettings.cpp:4232 +#: Client/core/CSettings.cpp:4802 Client/core/CConnectManager.cpp:80 #: Client/core/CConnectManager.cpp:111 Client/core/CConnectManager.cpp:127 #: Client/core/CConnectManager.cpp:263 Client/core/CConnectManager.cpp:321 #: Client/core/CConnectManager.cpp:404 Client/core/CConnectManager.cpp:411 @@ -316,143 +316,166 @@ msgstr "" msgid "Error" msgstr "" -#: Client/mods/deathmatch/logic/CClientGame.cpp:641 -#: Client/mods/deathmatch/logic/CClientGame.cpp:739 +#: Client/mods/deathmatch/logic/CClientGame.cpp:642 +#: Client/mods/deathmatch/logic/CClientGame.cpp:740 #: Client/core/ServerBrowser/CServerBrowser.cpp:1307 #: Client/core/ServerBrowser/CServerBrowser.cpp:1364 msgid "Invalid nickname! Please go to Settings and set a new one!" msgstr "" #. Display the status box -#: Client/mods/deathmatch/logic/CClientGame.cpp:657 +#: Client/mods/deathmatch/logic/CClientGame.cpp:658 #: Client/core/CConnectManager.cpp:148 msgid "CONNECTING" msgstr "" -#: Client/mods/deathmatch/logic/CClientGame.cpp:657 +#: Client/mods/deathmatch/logic/CClientGame.cpp:658 msgid "Entering the game ..." msgstr "" -#: Client/mods/deathmatch/logic/CClientGame.cpp:715 +#: Client/mods/deathmatch/logic/CClientGame.cpp:716 msgid "" "Not connected; please use Quick Connect or the 'connect' command to connect " "to a server." msgstr "" -#: Client/mods/deathmatch/logic/CClientGame.cpp:761 +#: Client/mods/deathmatch/logic/CClientGame.cpp:762 msgid "Could not start the local server. See console for details." msgstr "" -#: Client/mods/deathmatch/logic/CClientGame.cpp:771 -#: Client/mods/deathmatch/logic/CClientGame.cpp:1243 +#: Client/mods/deathmatch/logic/CClientGame.cpp:772 +#: Client/mods/deathmatch/logic/CClientGame.cpp:1244 msgid "Local Server" msgstr "" -#: Client/mods/deathmatch/logic/CClientGame.cpp:771 +#: Client/mods/deathmatch/logic/CClientGame.cpp:772 msgid "Starting local server ..." msgstr "" -#: Client/mods/deathmatch/logic/CClientGame.cpp:1019 +#: Client/mods/deathmatch/logic/CClientGame.cpp:1020 msgid "Area 51" msgstr "" -#: Client/mods/deathmatch/logic/CClientGame.cpp:1028 +#: Client/mods/deathmatch/logic/CClientGame.cpp:1029 msgid "Walking around " msgstr "" -#: Client/mods/deathmatch/logic/CClientGame.cpp:1174 +#: Client/mods/deathmatch/logic/CClientGame.cpp:1175 #, c-format msgid "You were kicked from the game ( %s )" msgstr "" -#: Client/mods/deathmatch/logic/CClientGame.cpp:1243 +#: Client/mods/deathmatch/logic/CClientGame.cpp:1244 msgid "Connecting to local server..." msgstr "" -#: Client/mods/deathmatch/logic/CClientGame.cpp:1254 +#: Client/mods/deathmatch/logic/CClientGame.cpp:1255 msgid "Error connecting to server." msgstr "" -#: Client/mods/deathmatch/logic/CClientGame.cpp:1264 +#: Client/mods/deathmatch/logic/CClientGame.cpp:1265 msgid "Connecting to local server timed out. See console for details." msgstr "" -#: Client/mods/deathmatch/logic/CClientGame.cpp:1333 +#: Client/mods/deathmatch/logic/CClientGame.cpp:1334 #: Client/core/CConnectManager.cpp:263 msgid "Connection timed out" msgstr "" -#: Client/mods/deathmatch/logic/CClientGame.cpp:1370 +#: Client/mods/deathmatch/logic/CClientGame.cpp:1371 msgid "Connection with the server was lost" msgstr "" -#: Client/mods/deathmatch/logic/CClientGame.cpp:1381 +#: Client/mods/deathmatch/logic/CClientGame.cpp:1382 #: Client/core/CConnectManager.cpp:277 Client/core/CConnectManager.cpp:281 msgid "Disconnected: unknown protocol error" msgstr "" -#: Client/mods/deathmatch/logic/CClientGame.cpp:1385 +#: Client/mods/deathmatch/logic/CClientGame.cpp:1386 #: Client/core/CConnectManager.cpp:285 msgid "Disconnected: disconnected remotely" msgstr "" -#: Client/mods/deathmatch/logic/CClientGame.cpp:1389 +#: Client/mods/deathmatch/logic/CClientGame.cpp:1390 #: Client/core/CConnectManager.cpp:289 msgid "Disconnected: connection lost remotely" msgstr "" -#: Client/mods/deathmatch/logic/CClientGame.cpp:1393 +#: Client/mods/deathmatch/logic/CClientGame.cpp:1394 #: Client/core/CConnectManager.cpp:293 msgid "Disconnected: you are banned from this server" msgstr "" -#: Client/mods/deathmatch/logic/CClientGame.cpp:1397 +#: Client/mods/deathmatch/logic/CClientGame.cpp:1398 msgid "Disconnected: the server is currently full" msgstr "" -#: Client/mods/deathmatch/logic/CClientGame.cpp:1401 +#: Client/mods/deathmatch/logic/CClientGame.cpp:1402 #: Client/core/CConnectManager.cpp:300 msgid "Disconnected: disconnected from the server" msgstr "" -#: Client/mods/deathmatch/logic/CClientGame.cpp:1405 +#: Client/mods/deathmatch/logic/CClientGame.cpp:1406 #: Client/core/CConnectManager.cpp:304 msgid "Disconnected: connection to the server was lost" msgstr "" -#: Client/mods/deathmatch/logic/CClientGame.cpp:1409 +#: Client/mods/deathmatch/logic/CClientGame.cpp:1410 msgid "Disconnected: invalid password specified" msgstr "" -#: Client/mods/deathmatch/logic/CClientGame.cpp:1413 +#: Client/mods/deathmatch/logic/CClientGame.cpp:1414 #: Client/core/CConnectManager.cpp:311 msgid "Disconnected: connection was refused" msgstr "" -#: Client/mods/deathmatch/logic/CClientGame.cpp:1431 +#: Client/mods/deathmatch/logic/CClientGame.cpp:1432 msgid "MTA Client verification failed!" msgstr "" -#: Client/mods/deathmatch/logic/CClientGame.cpp:5619 +#: Client/mods/deathmatch/logic/CClientGame.cpp:5620 msgid "In a ditch" msgstr "" -#: Client/mods/deathmatch/logic/CClientGame.cpp:5619 +#: Client/mods/deathmatch/logic/CClientGame.cpp:5620 msgid "En-route to hospital" msgstr "" -#: Client/mods/deathmatch/logic/CClientGame.cpp:5619 +#: Client/mods/deathmatch/logic/CClientGame.cpp:5620 msgid "Meeting their maker" msgstr "" -#: Client/mods/deathmatch/logic/CClientGame.cpp:5620 +#: Client/mods/deathmatch/logic/CClientGame.cpp:5621 msgid "Regretting their decisions" msgstr "" -#: Client/mods/deathmatch/logic/CClientGame.cpp:5620 +#: Client/mods/deathmatch/logic/CClientGame.cpp:5621 msgid "Wasted" msgstr "" +#: Client/mods/deathmatch/logic/CPlayerMap.cpp:74 +#, c-format +msgid "Change mode: %s" +msgstr "" + +#: Client/mods/deathmatch/logic/CPlayerMap.cpp:76 +#, c-format +msgid "Zoom: %s/%s Movement: %s, %s, %s, %s Opacity: %s/%s" +msgstr "" + +#: Client/mods/deathmatch/logic/CPlayerMap.cpp:80 +#, c-format +msgid "Toggle map: %s Toggle help text: %s" +msgstr "" + +#: Client/mods/deathmatch/logic/CPlayerMap.cpp:714 +msgid "Following Player" +msgstr "" + +#: Client/mods/deathmatch/logic/CPlayerMap.cpp:716 +msgid "Free Movement" +msgstr "" + #: Client/mods/deathmatch/logic/CTransferBox.cpp:25 msgid "Map download progress:" msgstr "" @@ -556,108 +579,112 @@ msgid "Disconnected: Serial verification failed" msgstr "" #: Client/mods/deathmatch/logic/CPacketHandler.cpp:576 +msgid "Disconnected: Serial already in use" +msgstr "" + +#: Client/mods/deathmatch/logic/CPacketHandler.cpp:580 #, c-format msgid "Disconnected: Connection desync %s" msgstr "" -#: Client/mods/deathmatch/logic/CPacketHandler.cpp:585 +#: Client/mods/deathmatch/logic/CPacketHandler.cpp:589 #, c-format msgid "Disconnected: You were kicked by %s" msgstr "" -#: Client/mods/deathmatch/logic/CPacketHandler.cpp:590 +#: Client/mods/deathmatch/logic/CPacketHandler.cpp:594 #, c-format msgid "Disconnected: You were banned by %s" msgstr "" -#: Client/mods/deathmatch/logic/CPacketHandler.cpp:601 +#: Client/mods/deathmatch/logic/CPacketHandler.cpp:605 msgid "Disconnected: Server shutdown or restarting" msgstr "" -#: Client/mods/deathmatch/logic/CPacketHandler.cpp:621 +#: Client/mods/deathmatch/logic/CPacketHandler.cpp:625 msgid "You were kicked from the game" msgstr "" -#: Client/mods/deathmatch/logic/CPacketHandler.cpp:622 -#: Client/mods/deathmatch/logic/CPacketHandler.cpp:633 +#: Client/mods/deathmatch/logic/CPacketHandler.cpp:626 +#: Client/mods/deathmatch/logic/CPacketHandler.cpp:637 msgid "This server requires a non-modifed gta_sa.exe" msgstr "" -#: Client/mods/deathmatch/logic/CPacketHandler.cpp:623 -#: Client/mods/deathmatch/logic/CPacketHandler.cpp:634 +#: Client/mods/deathmatch/logic/CPacketHandler.cpp:627 +#: Client/mods/deathmatch/logic/CPacketHandler.cpp:638 msgid "Please replace gta_sa.exe" msgstr "" -#: Client/mods/deathmatch/logic/CPacketHandler.cpp:624 +#: Client/mods/deathmatch/logic/CPacketHandler.cpp:628 msgid "This server does not allow custom D3D9.DLLs" msgstr "" -#: Client/mods/deathmatch/logic/CPacketHandler.cpp:625 +#: Client/mods/deathmatch/logic/CPacketHandler.cpp:629 msgid "Remove D3D9.DLL from your GTA install directory and restart MTA" msgstr "" -#: Client/mods/deathmatch/logic/CPacketHandler.cpp:626 +#: Client/mods/deathmatch/logic/CPacketHandler.cpp:630 msgid "This server does not allow virtual machines" msgstr "" -#: Client/mods/deathmatch/logic/CPacketHandler.cpp:627 +#: Client/mods/deathmatch/logic/CPacketHandler.cpp:631 msgid "This server requires driver signing to be enabled" msgstr "" -#: Client/mods/deathmatch/logic/CPacketHandler.cpp:628 +#: Client/mods/deathmatch/logic/CPacketHandler.cpp:632 msgid "Please restart your PC" msgstr "" -#: Client/mods/deathmatch/logic/CPacketHandler.cpp:629 +#: Client/mods/deathmatch/logic/CPacketHandler.cpp:633 msgid "This server has detected missing anti-cheat components" msgstr "" -#: Client/mods/deathmatch/logic/CPacketHandler.cpp:630 +#: Client/mods/deathmatch/logic/CPacketHandler.cpp:634 msgid "Try restarting MTA" msgstr "" -#: Client/mods/deathmatch/logic/CPacketHandler.cpp:631 +#: Client/mods/deathmatch/logic/CPacketHandler.cpp:635 msgid "This server requires a non-modifed gta3.img and gta_int.img" msgstr "" -#: Client/mods/deathmatch/logic/CPacketHandler.cpp:632 +#: Client/mods/deathmatch/logic/CPacketHandler.cpp:636 msgid "Please replace gta3.img or gta_int.img" msgstr "" -#: Client/mods/deathmatch/logic/CPacketHandler.cpp:635 +#: Client/mods/deathmatch/logic/CPacketHandler.cpp:639 msgid "This server does not allow Wine" msgstr "" -#: Client/mods/deathmatch/logic/CPacketHandler.cpp:636 +#: Client/mods/deathmatch/logic/CPacketHandler.cpp:640 msgid "Ensure no other program is modifying MTA:SA" msgstr "" -#: Client/mods/deathmatch/logic/CPacketHandler.cpp:650 +#: Client/mods/deathmatch/logic/CPacketHandler.cpp:654 msgid "Time Remaining: " msgstr "" -#: Client/mods/deathmatch/logic/CPacketHandler.cpp:660 +#: Client/mods/deathmatch/logic/CPacketHandler.cpp:664 #, c-format msgid "%d day" msgid_plural "%d days" msgstr[0] "" msgstr[1] "" -#: Client/mods/deathmatch/logic/CPacketHandler.cpp:662 +#: Client/mods/deathmatch/logic/CPacketHandler.cpp:666 #, c-format msgid "%d hour" msgid_plural "%d hours" msgstr[0] "" msgstr[1] "" -#: Client/mods/deathmatch/logic/CPacketHandler.cpp:664 +#: Client/mods/deathmatch/logic/CPacketHandler.cpp:668 #, c-format msgid "%d minute" msgid_plural "%d minutes" msgstr[0] "" msgstr[1] "" -#: Client/mods/deathmatch/logic/CPacketHandler.cpp:666 +#: Client/mods/deathmatch/logic/CPacketHandler.cpp:670 #, c-format msgid "%d second" msgid_plural "%d seconds" @@ -665,7 +692,7 @@ msgstr[0] "" msgstr[1] "" #. Display the error -#: Client/mods/deathmatch/logic/CPacketHandler.cpp:670 +#: Client/mods/deathmatch/logic/CPacketHandler.cpp:674 msgid "Disconnected" msgstr "" @@ -677,8 +704,8 @@ msgstr "" #. * Webbrowser tab #. * #: Client/mods/deathmatch/logic/CLocalServer.cpp:51 -#: Client/core/CSettings.cpp:442 Client/core/CSettings.cpp:630 -#: Client/core/CSettings.cpp:904 Client/core/CSettings.cpp:2022 +#: Client/core/CSettings.cpp:458 Client/core/CSettings.cpp:917 +#: Client/core/CSettings.cpp:2043 msgid "General" msgstr "" @@ -734,7 +761,7 @@ msgstr "" #: Client/gui/CGUIMessageBox_Impl.cpp:68 Client/loader/Dialogs.cpp:136 #: Client/core/CVersionUpdater.cpp:1790 Client/core/CVersionUpdater.cpp:1806 #: Client/core/CVersionUpdater.cpp:1841 Client/core/CSettings.cpp:132 -#: Client/core/CSettings.cpp:4797 +#: Client/core/CSettings.cpp:4822 msgid "Cancel" msgstr "" @@ -770,7 +797,7 @@ msgstr "" #: Client/core/CVersionUpdater.cpp:1956 Client/core/CVersionUpdater.cpp:1968 #: Client/core/CVersionUpdater.cpp:2120 Client/core/CVersionUpdater.cpp:2129 #: Client/core/CVersionUpdater.cpp:2138 Client/core/CVersionUpdater.cpp:2152 -#: Client/core/CSettings.cpp:127 Client/core/CSettings.cpp:4798 +#: Client/core/CSettings.cpp:127 Client/core/CSettings.cpp:4823 msgid "OK" msgstr "" @@ -784,9 +811,9 @@ msgstr "" #: Client/core/CVersionUpdater.cpp:1572 Client/core/CVersionUpdater.cpp:1590 #: Client/core/CVersionUpdater.cpp:1859 Client/core/CVersionUpdater.cpp:1878 #: Client/core/CQuestionBox.cpp:195 Client/core/CMainMenu.cpp:1200 -#: Client/core/CSettings.cpp:1393 Client/core/CSettings.cpp:1417 -#: Client/core/CSettings.cpp:4502 Client/core/CSettings.cpp:4576 -#: Client/core/CSettings.cpp:4606 Client/core/CSettings.cpp:4655 +#: Client/core/CSettings.cpp:1407 Client/core/CSettings.cpp:1431 +#: Client/core/CSettings.cpp:4527 Client/core/CSettings.cpp:4601 +#: Client/core/CSettings.cpp:4631 Client/core/CSettings.cpp:4680 #: Client/core/ServerBrowser/CServerInfo.cpp:481 msgid "Yes" msgstr "" @@ -913,10 +940,10 @@ msgstr "" #: Client/loader/Dialogs.cpp:132 Client/core/CVersionUpdater.cpp:1571 #: Client/core/CVersionUpdater.cpp:1589 Client/core/CVersionUpdater.cpp:1858 #: Client/core/CVersionUpdater.cpp:1877 Client/core/CQuestionBox.cpp:194 -#: Client/core/CMainMenu.cpp:1199 Client/core/CSettings.cpp:1392 -#: Client/core/CSettings.cpp:1416 Client/core/CSettings.cpp:4501 -#: Client/core/CSettings.cpp:4575 Client/core/CSettings.cpp:4605 -#: Client/core/CSettings.cpp:4654 Client/core/ServerBrowser/CServerInfo.cpp:481 +#: Client/core/CMainMenu.cpp:1199 Client/core/CSettings.cpp:1406 +#: Client/core/CSettings.cpp:1430 Client/core/CSettings.cpp:4526 +#: Client/core/CSettings.cpp:4600 Client/core/CSettings.cpp:4630 +#: Client/core/CSettings.cpp:4679 Client/core/ServerBrowser/CServerInfo.cpp:481 msgid "No" msgstr "" @@ -1122,13 +1149,13 @@ msgid "" "Do you want to change the following setting?" msgstr "" -#: Client/loader/MainFunctions.cpp:389 Client/core/CSettings.cpp:662 -#: Client/core/CSettings.cpp:1008 +#: Client/loader/MainFunctions.cpp:389 Client/core/CSettings.cpp:675 +#: Client/core/CSettings.cpp:1021 msgid "Fullscreen mode:" msgstr "" -#: Client/loader/MainFunctions.cpp:389 Client/core/CSettings.cpp:670 -#: Client/core/CSettings.cpp:1619 +#: Client/loader/MainFunctions.cpp:389 Client/core/CSettings.cpp:683 +#: Client/core/CSettings.cpp:1633 msgid "Borderless window" msgstr "" @@ -1516,7 +1543,7 @@ msgstr "" msgid " - Unknown problem in _DialogUpdateResult" msgstr "" -#: Client/core/CVersionUpdater.cpp:2081 Client/core/CSettings.cpp:4603 +#: Client/core/CVersionUpdater.cpp:2081 Client/core/CSettings.cpp:4628 msgid "CUSTOMIZED GTA:SA FILES" msgstr "" @@ -1569,13 +1596,13 @@ msgstr "" msgid "Backwards" msgstr "" -#: Client/core/CKeyBinds.cpp:191 Client/core/CSettings.cpp:2244 -#: Client/core/CSettings.cpp:2272 +#: Client/core/CKeyBinds.cpp:191 Client/core/CSettings.cpp:2265 +#: Client/core/CSettings.cpp:2293 msgid "Left" msgstr "" -#: Client/core/CKeyBinds.cpp:192 Client/core/CSettings.cpp:2246 -#: Client/core/CSettings.cpp:2273 +#: Client/core/CKeyBinds.cpp:192 Client/core/CSettings.cpp:2267 +#: Client/core/CSettings.cpp:2294 msgid "Right" msgstr "" @@ -2032,7 +2059,7 @@ msgid "Advanced" msgstr "" #: Client/core/CSettings.cpp:147 Client/core/CSettings.cpp:338 -#: Client/core/CSettings.cpp:617 Client/core/CSettings.cpp:889 +#: Client/core/CSettings.cpp:633 Client/core/CSettings.cpp:902 msgid "Load defaults" msgstr "" @@ -2149,610 +2176,623 @@ msgstr "" msgid "Map rendering options" msgstr "" -#: Client/core/CSettings.cpp:419 Client/core/CSettings.cpp:628 +#: Client/core/CSettings.cpp:421 msgid "Opacity:" msgstr "" +#: Client/core/CSettings.cpp:441 +msgid "Image resolution:" +msgstr "" + +#: Client/core/CSettings.cpp:448 +msgid "1024 x 1024 (Default)" +msgstr "" + +#. index 0 +#: Client/core/CSettings.cpp:449 +msgid "2048 x 2048" +msgstr "" + #. * #. * Audio tab #. * -#: Client/core/CSettings.cpp:439 Client/core/CSettings.cpp:448 +#: Client/core/CSettings.cpp:455 Client/core/CSettings.cpp:464 msgid "Master volume:" msgstr "" -#: Client/core/CSettings.cpp:439 Client/core/CSettings.cpp:467 +#: Client/core/CSettings.cpp:455 Client/core/CSettings.cpp:483 msgid "Radio volume:" msgstr "" -#: Client/core/CSettings.cpp:439 Client/core/CSettings.cpp:486 +#: Client/core/CSettings.cpp:455 Client/core/CSettings.cpp:502 msgid "SFX volume:" msgstr "" -#: Client/core/CSettings.cpp:439 Client/core/CSettings.cpp:505 +#: Client/core/CSettings.cpp:455 Client/core/CSettings.cpp:521 msgid "MTA volume:" msgstr "" -#: Client/core/CSettings.cpp:440 Client/core/CSettings.cpp:524 +#: Client/core/CSettings.cpp:456 Client/core/CSettings.cpp:540 msgid "Voice volume:" msgstr "" -#: Client/core/CSettings.cpp:440 Client/core/CSettings.cpp:565 +#: Client/core/CSettings.cpp:456 Client/core/CSettings.cpp:581 msgid "Play mode:" msgstr "" -#: Client/core/CSettings.cpp:543 +#: Client/core/CSettings.cpp:559 msgid "Radio options" msgstr "" -#: Client/core/CSettings.cpp:549 +#: Client/core/CSettings.cpp:565 msgid "Radio Equalizer" msgstr "" -#: Client/core/CSettings.cpp:554 +#: Client/core/CSettings.cpp:570 msgid "Radio Auto-tune" msgstr "" -#: Client/core/CSettings.cpp:559 +#: Client/core/CSettings.cpp:575 msgid "Usertrack options" msgstr "" -#: Client/core/CSettings.cpp:573 Client/core/CSettings.cpp:3091 +#: Client/core/CSettings.cpp:589 Client/core/CSettings.cpp:3112 msgid "Radio" msgstr "" -#: Client/core/CSettings.cpp:574 Client/core/CSettings.cpp:3093 +#: Client/core/CSettings.cpp:590 Client/core/CSettings.cpp:3114 msgid "Random" msgstr "" -#: Client/core/CSettings.cpp:575 Client/core/CSettings.cpp:3095 +#: Client/core/CSettings.cpp:591 Client/core/CSettings.cpp:3116 msgid "Sequential" msgstr "" -#: Client/core/CSettings.cpp:578 +#: Client/core/CSettings.cpp:594 msgid "Automatic Media Scan" msgstr "" -#: Client/core/CSettings.cpp:585 +#: Client/core/CSettings.cpp:601 msgid "Mute options" msgstr "" -#: Client/core/CSettings.cpp:591 +#: Client/core/CSettings.cpp:607 msgid "Mute All sounds when minimized" msgstr "" -#: Client/core/CSettings.cpp:596 +#: Client/core/CSettings.cpp:612 msgid "Mute Radio sounds when minimized" msgstr "" -#: Client/core/CSettings.cpp:601 +#: Client/core/CSettings.cpp:617 msgid "Mute SFX sounds when minimized" msgstr "" -#: Client/core/CSettings.cpp:606 +#: Client/core/CSettings.cpp:622 msgid "Mute MTA sounds when minimized" msgstr "" -#: Client/core/CSettings.cpp:611 +#: Client/core/CSettings.cpp:627 msgid "Mute Voice sounds when minimized" msgstr "" #. * #. * Video tab #. * -#: Client/core/CSettings.cpp:627 Client/core/CSettings.cpp:636 +#: Client/core/CSettings.cpp:643 Client/core/CSettings.cpp:649 msgid "Resolution:" msgstr "" -#: Client/core/CSettings.cpp:627 Client/core/CSettings.cpp:683 +#: Client/core/CSettings.cpp:643 Client/core/CSettings.cpp:696 msgid "FOV:" msgstr "" -#: Client/core/CSettings.cpp:627 Client/core/CSettings.cpp:699 +#: Client/core/CSettings.cpp:643 Client/core/CSettings.cpp:712 msgid "Draw Distance:" msgstr "" -#: Client/core/CSettings.cpp:627 Client/core/CSettings.cpp:717 +#: Client/core/CSettings.cpp:643 Client/core/CSettings.cpp:730 msgid "Brightness:" msgstr "" -#: Client/core/CSettings.cpp:627 Client/core/CSettings.cpp:735 +#: Client/core/CSettings.cpp:643 Client/core/CSettings.cpp:748 msgid "FX Quality:" msgstr "" -#: Client/core/CSettings.cpp:628 Client/core/CSettings.cpp:749 +#: Client/core/CSettings.cpp:644 Client/core/CSettings.cpp:762 msgid "Anisotropic filtering:" msgstr "" -#: Client/core/CSettings.cpp:628 Client/core/CSettings.cpp:776 +#: Client/core/CSettings.cpp:644 Client/core/CSettings.cpp:789 msgid "Anti-aliasing:" msgstr "" -#: Client/core/CSettings.cpp:628 Client/core/CSettings.cpp:790 +#: Client/core/CSettings.cpp:644 Client/core/CSettings.cpp:803 msgid "Aspect Ratio:" msgstr "" -#: Client/core/CSettings.cpp:648 +#: Client/core/CSettings.cpp:661 msgid "Windowed" msgstr "" -#: Client/core/CSettings.cpp:654 +#: Client/core/CSettings.cpp:667 msgid "DPI aware" msgstr "" -#: Client/core/CSettings.cpp:669 Client/core/CSettings.cpp:1617 +#: Client/core/CSettings.cpp:682 Client/core/CSettings.cpp:1631 msgid "Standard" msgstr "" -#: Client/core/CSettings.cpp:671 Client/core/CSettings.cpp:1621 +#: Client/core/CSettings.cpp:684 Client/core/CSettings.cpp:1635 msgid "Borderless keep res" msgstr "" -#: Client/core/CSettings.cpp:675 +#: Client/core/CSettings.cpp:688 msgid "Mip Mapping" msgstr "" -#: Client/core/CSettings.cpp:743 Client/core/CSettings.cpp:1521 +#: Client/core/CSettings.cpp:756 Client/core/CSettings.cpp:1535 msgid "Low" msgstr "" -#: Client/core/CSettings.cpp:744 Client/core/CSettings.cpp:1523 +#: Client/core/CSettings.cpp:757 Client/core/CSettings.cpp:1537 msgid "Medium" msgstr "" -#: Client/core/CSettings.cpp:745 Client/core/CSettings.cpp:1090 -#: Client/core/CSettings.cpp:1525 Client/core/CSettings.cpp:3149 +#: Client/core/CSettings.cpp:758 Client/core/CSettings.cpp:1104 +#: Client/core/CSettings.cpp:1539 Client/core/CSettings.cpp:3170 msgid "High" msgstr "" -#: Client/core/CSettings.cpp:746 Client/core/CSettings.cpp:1527 +#: Client/core/CSettings.cpp:759 Client/core/CSettings.cpp:1541 msgid "Very high" msgstr "" -#: Client/core/CSettings.cpp:761 Client/core/CSettings.cpp:784 -#: Client/core/CSettings.cpp:1021 Client/core/CSettings.cpp:1075 -#: Client/core/CSettings.cpp:1205 Client/core/CSettings.cpp:1531 -#: Client/core/CSettings.cpp:3156 Client/core/CSettings.cpp:3188 -#: Client/core/CSettings.cpp:3210 Client/core/CSettings.cpp:4247 +#: Client/core/CSettings.cpp:774 Client/core/CSettings.cpp:797 +#: Client/core/CSettings.cpp:1035 Client/core/CSettings.cpp:1089 +#: Client/core/CSettings.cpp:1219 Client/core/CSettings.cpp:1545 +#: Client/core/CSettings.cpp:3177 Client/core/CSettings.cpp:3209 +#: Client/core/CSettings.cpp:3231 Client/core/CSettings.cpp:4272 msgid "Off" msgstr "" -#: Client/core/CSettings.cpp:785 Client/core/CSettings.cpp:1533 +#: Client/core/CSettings.cpp:798 Client/core/CSettings.cpp:1547 msgid "1x" msgstr "" -#: Client/core/CSettings.cpp:786 Client/core/CSettings.cpp:1535 +#: Client/core/CSettings.cpp:799 Client/core/CSettings.cpp:1549 msgid "2x" msgstr "" -#: Client/core/CSettings.cpp:787 Client/core/CSettings.cpp:1537 +#: Client/core/CSettings.cpp:800 Client/core/CSettings.cpp:1551 msgid "3x" msgstr "" -#: Client/core/CSettings.cpp:800 Client/core/CSettings.cpp:1023 -#: Client/core/CSettings.cpp:1543 Client/core/CSettings.cpp:3158 +#: Client/core/CSettings.cpp:813 Client/core/CSettings.cpp:1037 +#: Client/core/CSettings.cpp:1557 Client/core/CSettings.cpp:3179 msgid "Auto" msgstr "" -#: Client/core/CSettings.cpp:801 Client/core/CSettings.cpp:1545 +#: Client/core/CSettings.cpp:814 Client/core/CSettings.cpp:1559 msgid "4:3" msgstr "" -#: Client/core/CSettings.cpp:802 Client/core/CSettings.cpp:1547 +#: Client/core/CSettings.cpp:815 Client/core/CSettings.cpp:1561 msgid "16:10" msgstr "" -#: Client/core/CSettings.cpp:803 Client/core/CSettings.cpp:1549 +#: Client/core/CSettings.cpp:816 Client/core/CSettings.cpp:1563 msgid "16:9" msgstr "" -#: Client/core/CSettings.cpp:806 +#: Client/core/CSettings.cpp:819 msgid "HUD Match Aspect Ratio" msgstr "" -#: Client/core/CSettings.cpp:812 +#: Client/core/CSettings.cpp:825 msgid "Volumetric Shadows" msgstr "" -#: Client/core/CSettings.cpp:816 +#: Client/core/CSettings.cpp:829 msgid "Grass effect" msgstr "" -#: Client/core/CSettings.cpp:820 +#: Client/core/CSettings.cpp:833 msgid "Heat haze" msgstr "" -#: Client/core/CSettings.cpp:824 +#: Client/core/CSettings.cpp:837 msgid "Tyre Smoke etc" msgstr "" -#: Client/core/CSettings.cpp:828 +#: Client/core/CSettings.cpp:841 msgid "Dynamic ped shadows" msgstr "" -#: Client/core/CSettings.cpp:832 +#: Client/core/CSettings.cpp:845 msgid "Motion blur" msgstr "" -#: Client/core/CSettings.cpp:837 +#: Client/core/CSettings.cpp:849 +msgid "Corona rain reflections" +msgstr "" + +#: Client/core/CSettings.cpp:854 msgid "Full Screen Minimize" msgstr "" -#: Client/core/CSettings.cpp:849 +#: Client/core/CSettings.cpp:866 msgid "Enable Device Selection Dialog" msgstr "" -#: Client/core/CSettings.cpp:861 +#: Client/core/CSettings.cpp:878 msgid "Show unsafe resolutions" msgstr "" -#: Client/core/CSettings.cpp:873 +#: Client/core/CSettings.cpp:890 msgid "Render vehicles always in high detail" msgstr "" -#: Client/core/CSettings.cpp:877 +#: Client/core/CSettings.cpp:894 msgid "Render peds always in high detail" msgstr "" -#: Client/core/CSettings.cpp:881 -msgid "Corona rain reflections" -msgstr "" - -#: Client/core/CSettings.cpp:910 +#: Client/core/CSettings.cpp:923 msgid "Enable remote websites" msgstr "" -#: Client/core/CSettings.cpp:915 +#: Client/core/CSettings.cpp:928 msgid "Enable Javascript on remote websites" msgstr "" -#: Client/core/CSettings.cpp:920 +#: Client/core/CSettings.cpp:933 msgid "Enable GPU rendering" msgstr "" -#: Client/core/CSettings.cpp:924 +#: Client/core/CSettings.cpp:937 msgid "Custom blacklist" msgstr "" -#: Client/core/CSettings.cpp:935 Client/core/CSettings.cpp:970 +#: Client/core/CSettings.cpp:948 Client/core/CSettings.cpp:983 msgid "Enter a domain e.g. google.com" msgstr "" -#: Client/core/CSettings.cpp:943 +#: Client/core/CSettings.cpp:956 msgid "Block" msgstr "" -#: Client/core/CSettings.cpp:951 Client/core/CSettings.cpp:986 +#: Client/core/CSettings.cpp:964 Client/core/CSettings.cpp:999 msgid "Domain" msgstr "" -#: Client/core/CSettings.cpp:953 Client/core/CSettings.cpp:988 +#: Client/core/CSettings.cpp:966 Client/core/CSettings.cpp:1001 msgid "Remove domain" msgstr "" #. Reset vecTemp -#: Client/core/CSettings.cpp:959 +#: Client/core/CSettings.cpp:972 msgid "Custom whitelist" msgstr "" #. Misc section label -#: Client/core/CSettings.cpp:1001 +#: Client/core/CSettings.cpp:1014 msgid "Misc" msgstr "" #. Fast clothes loading -#: Client/core/CSettings.cpp:1007 Client/core/CSettings.cpp:1014 -#: Client/core/CSettings.cpp:4816 +#: Client/core/CSettings.cpp:1020 Client/core/CSettings.cpp:1028 +#: Client/core/CSettings.cpp:4841 msgid "Fast CJ clothes loading:" msgstr "" #. Browser scan speed -#: Client/core/CSettings.cpp:1007 Client/core/CSettings.cpp:1028 -#: Client/core/CSettings.cpp:4818 +#: Client/core/CSettings.cpp:1020 Client/core/CSettings.cpp:1042 +#: Client/core/CSettings.cpp:4843 msgid "Browser speed:" msgstr "" #. Single download -#: Client/core/CSettings.cpp:1007 Client/core/CSettings.cpp:1042 -#: Client/core/CSettings.cpp:4820 +#: Client/core/CSettings.cpp:1020 Client/core/CSettings.cpp:1056 +#: Client/core/CSettings.cpp:4845 msgid "Single connection:" msgstr "" #. Packet tag -#: Client/core/CSettings.cpp:1007 Client/core/CSettings.cpp:1055 -#: Client/core/CSettings.cpp:4822 +#: Client/core/CSettings.cpp:1020 Client/core/CSettings.cpp:1069 +#: Client/core/CSettings.cpp:4847 msgid "Packet tag:" msgstr "" #. Progress animation -#: Client/core/CSettings.cpp:1008 Client/core/CSettings.cpp:1068 -#: Client/core/CSettings.cpp:4824 +#: Client/core/CSettings.cpp:1021 Client/core/CSettings.cpp:1082 +#: Client/core/CSettings.cpp:4849 msgid "Progress animation:" msgstr "" #. Process priority -#: Client/core/CSettings.cpp:1008 Client/core/CSettings.cpp:1081 -#: Client/core/CSettings.cpp:4814 +#: Client/core/CSettings.cpp:1021 Client/core/CSettings.cpp:1095 +#: Client/core/CSettings.cpp:4839 msgid "Process priority:" msgstr "" #. Debug setting -#: Client/core/CSettings.cpp:1008 Client/core/CSettings.cpp:1095 -#: Client/core/CSettings.cpp:4826 +#: Client/core/CSettings.cpp:1021 Client/core/CSettings.cpp:1109 +#: Client/core/CSettings.cpp:4851 msgid "Debug setting:" msgstr "" #. Streaming memory -#: Client/core/CSettings.cpp:1009 Client/core/CSettings.cpp:1118 -#: Client/core/CSettings.cpp:4828 +#: Client/core/CSettings.cpp:1022 Client/core/CSettings.cpp:1132 +#: Client/core/CSettings.cpp:4853 msgid "Streaming memory:" msgstr "" #. Update build type -#: Client/core/CSettings.cpp:1009 Client/core/CSettings.cpp:1219 +#: Client/core/CSettings.cpp:1022 Client/core/CSettings.cpp:1233 msgid "Update build type:" msgstr "" #. UpdateAutoInstall -#: Client/core/CSettings.cpp:1009 Client/core/CSettings.cpp:1198 +#: Client/core/CSettings.cpp:1022 Client/core/CSettings.cpp:1212 msgid "Install important updates:" msgstr "" -#: Client/core/CSettings.cpp:1022 Client/core/CSettings.cpp:1050 -#: Client/core/CSettings.cpp:1063 Client/core/CSettings.cpp:3160 -#: Client/core/CSettings.cpp:3176 Client/core/CSettings.cpp:3183 +#: Client/core/CSettings.cpp:1036 Client/core/CSettings.cpp:1064 +#: Client/core/CSettings.cpp:1077 Client/core/CSettings.cpp:3181 +#: Client/core/CSettings.cpp:3197 Client/core/CSettings.cpp:3204 msgid "On" msgstr "" -#: Client/core/CSettings.cpp:1035 Client/core/CSettings.cpp:3165 +#: Client/core/CSettings.cpp:1049 Client/core/CSettings.cpp:3186 msgid "Very slow" msgstr "" -#: Client/core/CSettings.cpp:1036 Client/core/CSettings.cpp:1049 -#: Client/core/CSettings.cpp:1062 Client/core/CSettings.cpp:1076 -#: Client/core/CSettings.cpp:1102 Client/core/CSettings.cpp:1114 -#: Client/core/CSettings.cpp:1206 Client/core/CSettings.cpp:1226 -#: Client/core/CSettings.cpp:3167 Client/core/CSettings.cpp:3174 -#: Client/core/CSettings.cpp:3181 Client/core/CSettings.cpp:3190 -#: Client/core/CSettings.cpp:3203 +#: Client/core/CSettings.cpp:1050 Client/core/CSettings.cpp:1063 +#: Client/core/CSettings.cpp:1076 Client/core/CSettings.cpp:1090 +#: Client/core/CSettings.cpp:1116 Client/core/CSettings.cpp:1128 +#: Client/core/CSettings.cpp:1220 Client/core/CSettings.cpp:1240 +#: Client/core/CSettings.cpp:3188 Client/core/CSettings.cpp:3195 +#: Client/core/CSettings.cpp:3202 Client/core/CSettings.cpp:3211 +#: Client/core/CSettings.cpp:3224 msgid "Default" msgstr "" -#: Client/core/CSettings.cpp:1037 Client/core/CSettings.cpp:3169 +#: Client/core/CSettings.cpp:1051 Client/core/CSettings.cpp:3190 msgid "Fast" msgstr "" -#: Client/core/CSettings.cpp:1088 Client/core/CSettings.cpp:3145 +#: Client/core/CSettings.cpp:1102 Client/core/CSettings.cpp:3166 msgid "Normal" msgstr "" -#: Client/core/CSettings.cpp:1089 Client/core/CSettings.cpp:3147 +#: Client/core/CSettings.cpp:1103 Client/core/CSettings.cpp:3168 msgid "Above normal" msgstr "" -#: Client/core/CSettings.cpp:1125 +#: Client/core/CSettings.cpp:1139 msgid "Min" msgstr "" -#: Client/core/CSettings.cpp:1138 +#: Client/core/CSettings.cpp:1152 msgid "Max" msgstr "" #. Windows 8 compatibility -#: Client/core/CSettings.cpp:1145 +#: Client/core/CSettings.cpp:1159 msgid "Windows 8 compatibility:" msgstr "" -#: Client/core/CSettings.cpp:1149 +#: Client/core/CSettings.cpp:1163 msgid "16-bit color" msgstr "" -#: Client/core/CSettings.cpp:1154 +#: Client/core/CSettings.cpp:1168 msgid "Mouse fix" msgstr "" #. Cache path info -#: Client/core/CSettings.cpp:1172 +#: Client/core/CSettings.cpp:1186 msgid "Client resource files:" msgstr "" -#: Client/core/CSettings.cpp:1176 +#: Client/core/CSettings.cpp:1190 msgid "Show in Explorer" msgstr "" #. Auto updater section label -#: Client/core/CSettings.cpp:1191 Client/core/CSettings.cpp:1194 +#: Client/core/CSettings.cpp:1205 Client/core/CSettings.cpp:1208 msgid "Auto updater" msgstr "" #. Check for updates -#: Client/core/CSettings.cpp:1232 +#: Client/core/CSettings.cpp:1246 msgid "Check for update now" msgstr "" -#: Client/core/CSettings.cpp:1386 +#: Client/core/CSettings.cpp:1400 msgid "Some settings will be changed when you next start MTA" msgstr "" -#: Client/core/CSettings.cpp:1387 +#: Client/core/CSettings.cpp:1401 msgid "" "\n" "\n" "Do you want to restart now?" msgstr "" -#: Client/core/CSettings.cpp:1390 +#: Client/core/CSettings.cpp:1404 msgid "RESTART REQUIRED" msgstr "" -#: Client/core/CSettings.cpp:1410 +#: Client/core/CSettings.cpp:1424 msgid "Some settings will be changed when you disconnect the current server" msgstr "" -#: Client/core/CSettings.cpp:1411 +#: Client/core/CSettings.cpp:1425 msgid "" "\n" "\n" "Do you want to disconnect now?" msgstr "" -#: Client/core/CSettings.cpp:1414 +#: Client/core/CSettings.cpp:1428 msgid "DISCONNECT REQUIRED" msgstr "" #. Update the joystick name -#: Client/core/CSettings.cpp:1741 +#: Client/core/CSettings.cpp:1760 msgid "Joypad not detected - Check connections and restart game" msgstr "" -#: Client/core/CSettings.cpp:1936 +#: Client/core/CSettings.cpp:1957 msgid "Binding axis" msgstr "" -#: Client/core/CSettings.cpp:1936 +#: Client/core/CSettings.cpp:1957 msgid "Move an axis to bind, or escape to clear" msgstr "" -#: Client/core/CSettings.cpp:2013 +#: Client/core/CSettings.cpp:2034 msgid "Language:" msgstr "" -#: Client/core/CSettings.cpp:2013 +#: Client/core/CSettings.cpp:2034 msgid "Skin:" msgstr "" -#: Client/core/CSettings.cpp:2013 +#: Client/core/CSettings.cpp:2034 msgid "Presets:" msgstr "" -#: Client/core/CSettings.cpp:2062 +#: Client/core/CSettings.cpp:2083 msgid "Chat" msgstr "" -#: Client/core/CSettings.cpp:2079 +#: Client/core/CSettings.cpp:2100 msgid "Load" msgstr "" -#: Client/core/CSettings.cpp:2091 +#: Client/core/CSettings.cpp:2112 msgid "Colors" msgstr "" -#: Client/core/CSettings.cpp:2092 +#: Client/core/CSettings.cpp:2113 msgid "Layout" msgstr "" -#: Client/core/CSettings.cpp:2093 Client/core/CSettings.cpp:2339 +#: Client/core/CSettings.cpp:2114 Client/core/CSettings.cpp:2360 msgid "Options" msgstr "" -#: Client/core/CSettings.cpp:2099 +#: Client/core/CSettings.cpp:2120 msgid "Chat Background" msgstr "" -#: Client/core/CSettings.cpp:2099 +#: Client/core/CSettings.cpp:2120 msgid "Chat Text" msgstr "" -#: Client/core/CSettings.cpp:2099 +#: Client/core/CSettings.cpp:2120 msgid "Input Background" msgstr "" -#: Client/core/CSettings.cpp:2099 +#: Client/core/CSettings.cpp:2120 msgid "Input Text" msgstr "" -#: Client/core/CSettings.cpp:2122 +#: Client/core/CSettings.cpp:2143 msgid "Lines:" msgstr "" -#: Client/core/CSettings.cpp:2122 +#: Client/core/CSettings.cpp:2143 msgid "Scale:" msgstr "" -#: Client/core/CSettings.cpp:2122 +#: Client/core/CSettings.cpp:2143 msgid "Width:" msgstr "" -#: Client/core/CSettings.cpp:2125 +#: Client/core/CSettings.cpp:2146 msgid "Size" msgstr "" -#: Client/core/CSettings.cpp:2174 +#: Client/core/CSettings.cpp:2195 msgid "after" msgstr "" -#: Client/core/CSettings.cpp:2174 +#: Client/core/CSettings.cpp:2195 msgid "for" msgstr "" -#: Client/core/CSettings.cpp:2174 +#: Client/core/CSettings.cpp:2195 msgid "sec" msgstr "" -#: Client/core/CSettings.cpp:2177 +#: Client/core/CSettings.cpp:2198 msgid "Fading" msgstr "" -#: Client/core/CSettings.cpp:2183 +#: Client/core/CSettings.cpp:2204 msgid "Fade out old lines" msgstr "" -#: Client/core/CSettings.cpp:2223 +#: Client/core/CSettings.cpp:2244 msgid "Horizontal:" msgstr "" -#: Client/core/CSettings.cpp:2223 +#: Client/core/CSettings.cpp:2244 msgid "Vertical:" msgstr "" -#: Client/core/CSettings.cpp:2223 +#: Client/core/CSettings.cpp:2244 msgid "Text-Align:" msgstr "" -#: Client/core/CSettings.cpp:2223 +#: Client/core/CSettings.cpp:2244 msgid "X-Offset:" msgstr "" -#: Client/core/CSettings.cpp:2224 +#: Client/core/CSettings.cpp:2245 msgid "Y-Offset:" msgstr "" -#: Client/core/CSettings.cpp:2230 +#: Client/core/CSettings.cpp:2251 msgid "Position" msgstr "" -#: Client/core/CSettings.cpp:2245 Client/core/CSettings.cpp:2259 +#: Client/core/CSettings.cpp:2266 Client/core/CSettings.cpp:2280 msgid "Center" msgstr "" -#: Client/core/CSettings.cpp:2258 +#: Client/core/CSettings.cpp:2279 msgid "Top" msgstr "" -#: Client/core/CSettings.cpp:2260 +#: Client/core/CSettings.cpp:2281 msgid "Bottom" msgstr "" -#: Client/core/CSettings.cpp:2308 +#: Client/core/CSettings.cpp:2329 msgid "Font" msgstr "" -#: Client/core/CSettings.cpp:2345 +#: Client/core/CSettings.cpp:2366 msgid "Hide background when not typing" msgstr "" -#: Client/core/CSettings.cpp:2350 +#: Client/core/CSettings.cpp:2371 msgid "Nickname completion using the \"Tab\" key" msgstr "" -#: Client/core/CSettings.cpp:2355 +#: Client/core/CSettings.cpp:2376 msgid "Allow server to flash the window" msgstr "" -#: Client/core/CSettings.cpp:2360 +#: Client/core/CSettings.cpp:2381 msgid "Allow tray balloon notifications" msgstr "" -#: Client/core/CSettings.cpp:2365 +#: Client/core/CSettings.cpp:2386 msgid "Chat text black/white outline" msgstr "" @@ -2760,85 +2800,85 @@ msgstr "" #. SString strText = SString::Printf ( "Press a key to bind to '%s'", pItemBind->GetText ().c_str () ); #. Create a messagebox to notify the user #. sSString strText = SString::Printf ( "Press a key to bind to '%s'", pItemBind->GetText ().c_str () ); -#: Client/core/CSettings.cpp:2614 Client/core/CSettings.cpp:2621 +#: Client/core/CSettings.cpp:2635 Client/core/CSettings.cpp:2642 msgid "Press a key to bind, or escape to clear" msgstr "" -#: Client/core/CSettings.cpp:2615 +#: Client/core/CSettings.cpp:2636 msgid "Binding a primary key" msgstr "" -#: Client/core/CSettings.cpp:2622 +#: Client/core/CSettings.cpp:2643 msgid "Binding a secondary key" msgstr "" -#: Client/core/CSettings.cpp:2698 +#: Client/core/CSettings.cpp:2719 msgid "GTA GAME CONTROLS" msgstr "" -#: Client/core/CSettings.cpp:2700 +#: Client/core/CSettings.cpp:2721 msgid "MULTIPLAYER CONTROLS" msgstr "" -#: Client/core/CSettings.cpp:2945 Client/core/CSettings.cpp:4777 +#: Client/core/CSettings.cpp:2966 Client/core/CSettings.cpp:4802 msgid "Your nickname contains invalid characters!" msgstr "" -#: Client/core/CSettings.cpp:3791 +#: Client/core/CSettings.cpp:3816 msgid "Red:" msgstr "" -#: Client/core/CSettings.cpp:3791 +#: Client/core/CSettings.cpp:3816 msgid "Green:" msgstr "" -#: Client/core/CSettings.cpp:3791 +#: Client/core/CSettings.cpp:3816 msgid "Blue:" msgstr "" -#: Client/core/CSettings.cpp:3791 +#: Client/core/CSettings.cpp:3816 msgid "Transparency:" msgstr "" -#: Client/core/CSettings.cpp:3794 +#: Client/core/CSettings.cpp:3819 msgid "Color" msgstr "" -#: Client/core/CSettings.cpp:3871 +#: Client/core/CSettings.cpp:3896 msgid "Preview" msgstr "" -#: Client/core/CSettings.cpp:4179 +#: Client/core/CSettings.cpp:4204 msgid "Please disconnect before changing language" msgstr "" -#: Client/core/CSettings.cpp:4207 +#: Client/core/CSettings.cpp:4232 msgid "Please disconnect before changing skin" msgstr "" -#: Client/core/CSettings.cpp:4495 +#: Client/core/CSettings.cpp:4520 msgid "" "Volmetric shadows can cause some systems to slow down.\n" "\n" "Are you sure you want to enable them?" msgstr "" -#: Client/core/CSettings.cpp:4499 +#: Client/core/CSettings.cpp:4524 msgid "PERFORMANCE WARNING" msgstr "" -#: Client/core/CSettings.cpp:4519 +#: Client/core/CSettings.cpp:4544 msgid "" "Screen upload is required by some servers for anti-cheat purposes.\n" "\n" "(The chat box and GUI is excluded from the upload)\n" msgstr "" -#: Client/core/CSettings.cpp:4521 +#: Client/core/CSettings.cpp:4546 msgid "SCREEN UPLOAD INFORMATION" msgstr "" -#: Client/core/CSettings.cpp:4536 +#: Client/core/CSettings.cpp:4561 msgid "" "Some scripts may play sounds, such as radio, from the internet.\n" "\n" @@ -2846,11 +2886,11 @@ msgid "" "bandwidth consumption.\n" msgstr "" -#: Client/core/CSettings.cpp:4539 +#: Client/core/CSettings.cpp:4564 msgid "EXTERNAL SOUNDS" msgstr "" -#: Client/core/CSettings.cpp:4568 +#: Client/core/CSettings.cpp:4593 msgid "" "It seems that you have the Rich Presence connection option enabled.\n" "Do you want to allow servers to share their data?\n" @@ -2858,11 +2898,11 @@ msgid "" "This includes yours unique ID identifier." msgstr "" -#: Client/core/CSettings.cpp:4573 +#: Client/core/CSettings.cpp:4598 msgid "CONSENT TO ALLOW DATA SHARING" msgstr "" -#: Client/core/CSettings.cpp:4597 +#: Client/core/CSettings.cpp:4622 msgid "" "Some files in your GTA:SA data directory are customized.\n" "MTA will only use these modified files if this check box is ticked.\n" @@ -2872,7 +2912,7 @@ msgid "" "Are you sure you want to use them?" msgstr "" -#: Client/core/CSettings.cpp:4646 +#: Client/core/CSettings.cpp:4671 msgid "" "Enabling DPI awareness is an experimental feature and\n" "we only recommend it when you play MTA:SA on a scaled monitor.\n" @@ -2881,77 +2921,77 @@ msgid "" "Are you sure you want to enable this option?" msgstr "" -#: Client/core/CSettings.cpp:4652 +#: Client/core/CSettings.cpp:4677 msgid "EXPERIMENTAL FEATURE" msgstr "" -#: Client/core/CSettings.cpp:4795 +#: Client/core/CSettings.cpp:4820 msgid "Please enter a nickname" msgstr "" -#: Client/core/CSettings.cpp:4796 +#: Client/core/CSettings.cpp:4821 msgid "" "Please enter a nickname to be used ingame. \n" "This will be your name when you connect to and play in a server" msgstr "" -#: Client/core/CSettings.cpp:4814 +#: Client/core/CSettings.cpp:4839 msgid "Very experimental feature." msgstr "" -#: Client/core/CSettings.cpp:4816 +#: Client/core/CSettings.cpp:4841 msgid "Stops stalls with CJ variations (Uses 65MB more RAM)" msgstr "" -#: Client/core/CSettings.cpp:4818 +#: Client/core/CSettings.cpp:4843 msgid "Older routers may require a slower scan speed." msgstr "" -#: Client/core/CSettings.cpp:4820 +#: Client/core/CSettings.cpp:4845 msgid "Switch on to use only one connection when downloading." msgstr "" -#: Client/core/CSettings.cpp:4822 +#: Client/core/CSettings.cpp:4847 msgid "Tag network packets to help ISPs identify MTA traffic." msgstr "" -#: Client/core/CSettings.cpp:4824 +#: Client/core/CSettings.cpp:4849 msgid "Spinning circle animation at the bottom of the screen" msgstr "" -#: Client/core/CSettings.cpp:4826 +#: Client/core/CSettings.cpp:4851 msgid "Select default always. (This setting is not saved)" msgstr "" -#: Client/core/CSettings.cpp:4828 +#: Client/core/CSettings.cpp:4853 msgid "Maximum is usually best" msgstr "" -#: Client/core/CSettings.cpp:4830 Client/core/CSettings.cpp:4832 +#: Client/core/CSettings.cpp:4855 Client/core/CSettings.cpp:4857 msgid "Auto updater:" msgstr "" -#: Client/core/CSettings.cpp:4830 +#: Client/core/CSettings.cpp:4855 msgid "Select default unless you like filling out bug reports." msgstr "" -#: Client/core/CSettings.cpp:4832 +#: Client/core/CSettings.cpp:4857 msgid "Select default to automatically install important updates." msgstr "" -#: Client/core/CSettings.cpp:4834 +#: Client/core/CSettings.cpp:4859 msgid "16-bit color:" msgstr "" -#: Client/core/CSettings.cpp:4834 +#: Client/core/CSettings.cpp:4859 msgid "Enable 16 bit color modes - Requires MTA restart" msgstr "" -#: Client/core/CSettings.cpp:4836 +#: Client/core/CSettings.cpp:4861 msgid "Mouse fix:" msgstr "" -#: Client/core/CSettings.cpp:4836 +#: Client/core/CSettings.cpp:4861 msgid "Mouse movement fix - May need PC restart" msgstr "" diff --git a/Shared/mods/deathmatch/logic/Enums.cpp b/Shared/mods/deathmatch/logic/Enums.cpp index 1e3d0b2003..64aa8db8f1 100644 --- a/Shared/mods/deathmatch/logic/Enums.cpp +++ b/Shared/mods/deathmatch/logic/Enums.cpp @@ -101,6 +101,7 @@ ADD_ENUM(WorldSpecialProperty::FIREBALLDESTRUCT, "fireballdestruct") ADD_ENUM(WorldSpecialProperty::EXTENDEDWATERCANNONS, "extendedwatercannons") ADD_ENUM(WorldSpecialProperty::ROADSIGNSTEXT, "roadsignstext") ADD_ENUM(WorldSpecialProperty::TUNNELWEATHERBLEND, "tunnelweatherblend") +ADD_ENUM(WorldSpecialProperty::IGNOREFIRESTATE, "ignorefirestate") IMPLEMENT_ENUM_CLASS_END("world-special-property") IMPLEMENT_ENUM_BEGIN(ePacketID) @@ -213,4 +214,5 @@ ADD_ENUM1(PACKET_ID_CHAT_CLEAR) ADD_ENUM1(PACKET_ID_SERVER_INFO_SYNC) ADD_ENUM1(PACKET_ID_DISCORD_JOIN) ADD_ENUM1(PACKET_ID_PLAYER_RESOURCE_START) +ADD_ENUM1(PACKET_ID_PLAYER_WORLD_SPECIAL_PROPERTY) IMPLEMENT_ENUM_END("ePacketID") diff --git a/Shared/mods/deathmatch/logic/Enums.h b/Shared/mods/deathmatch/logic/Enums.h index e975d0d907..3125179714 100644 --- a/Shared/mods/deathmatch/logic/Enums.h +++ b/Shared/mods/deathmatch/logic/Enums.h @@ -91,6 +91,7 @@ enum class WorldSpecialProperty ROADSIGNSTEXT, EXTENDEDWATERCANNONS, TUNNELWEATHERBLEND, + IGNOREFIRESTATE, }; DECLARE_ENUM_CLASS(WorldSpecialProperty); diff --git a/Shared/sdk/net/Packets.h b/Shared/sdk/net/Packets.h index 0941ca49dd..411af7cb88 100644 --- a/Shared/sdk/net/Packets.h +++ b/Shared/sdk/net/Packets.h @@ -151,4 +151,5 @@ enum ePacketID PACKET_ID_SERVER_INFO_SYNC, PACKET_ID_DISCORD_JOIN, PACKET_ID_PLAYER_RESOURCE_START, + PACKET_ID_PLAYER_WORLD_SPECIAL_PROPERTY }; diff --git a/Shared/sdk/net/SyncStructures.h b/Shared/sdk/net/SyncStructures.h index 1e9b8215b3..0e42407aae 100644 --- a/Shared/sdk/net/SyncStructures.h +++ b/Shared/sdk/net/SyncStructures.h @@ -2044,6 +2044,10 @@ struct SWorldSpecialPropertiesStateSync : public ISyncStructure { BITCOUNT5 = 1 }; + enum + { + BITCOUNT6 = 1 + }; bool Read(NetBitStreamInterface& bitStream) { @@ -2068,6 +2072,11 @@ struct SWorldSpecialPropertiesStateSync : public ISyncStructure else data5.tunnelweatherblend = true; + if (bitStream.Can(eBitStreamVersion::WorldSpecialProperty_IgnoreFireState)) + isOK &= bitStream.ReadBits(reinterpret_cast(&data6), BITCOUNT6); + else + data6.ignoreFireState = false; + //// Example for adding item: // if (bitStream.Can(eBitStreamVersion::YourProperty)) // isOK &= bitStream.ReadBits(reinterpret_cast(&data9), BITCOUNT9); @@ -2091,6 +2100,9 @@ struct SWorldSpecialPropertiesStateSync : public ISyncStructure if (bitStream.Can(eBitStreamVersion::WorldSpecialProperty_TunnelWeatherBlend)) bitStream.WriteBits(reinterpret_cast(&data5), BITCOUNT5); + if (bitStream.Can(eBitStreamVersion::WorldSpecialProperty_IgnoreFireState)) + bitStream.WriteBits(reinterpret_cast(&data6), BITCOUNT6); + //// Example for adding item: // if (bitStream.Can(eBitStreamVersion::YourProperty)) // bitStream.WriteBits(reinterpret_cast(&data9), BITCOUNT9); @@ -2132,6 +2144,11 @@ struct SWorldSpecialPropertiesStateSync : public ISyncStructure { bool tunnelweatherblend : 1; } data5; + + struct + { + bool ignoreFireState : 1; + } data6; SWorldSpecialPropertiesStateSync() { @@ -2152,6 +2169,7 @@ struct SWorldSpecialPropertiesStateSync : public ISyncStructure data3.roadsignstext = true; data4.extendedwatercannons = true; data5.tunnelweatherblend = true; + data6.ignoreFireState = false; } }; diff --git a/Shared/sdk/net/bitstream.h b/Shared/sdk/net/bitstream.h index c29f739ff1..f422739ad4 100644 --- a/Shared/sdk/net/bitstream.h +++ b/Shared/sdk/net/bitstream.h @@ -572,6 +572,22 @@ enum class eBitStreamVersion : unsigned short // 2024-09-04 RespawnObject_Serverside, + // Add check_duplicate_serials + // 2024-09-04 + CheckDuplicateSerials, + + // Add ignorefirestate special world property + // 2024-11-07 + WorldSpecialProperty_IgnoreFireState, + + // Fix iPedSyncerDistance and iUnoccupiedVehicleSyncerDistance sync + // 2024-11-22 + FixSyncerDistance, + + // Add onPlayerChangesWorldSpecialProperty + // 2024-11-26 + WorldSpecialPropertyEvent, + // This allows us to automatically increment the BitStreamVersion when things are added to this enum. // Make sure you only add things above this comment. Next,