Skip to content

Commit

Permalink
Merge branch 'master' into 081024_CVector
Browse files Browse the repository at this point in the history
  • Loading branch information
TracerDS authored Dec 22, 2024
2 parents ac9af8e + c128048 commit fd74826
Show file tree
Hide file tree
Showing 61 changed files with 1,669 additions and 1,586 deletions.
4 changes: 0 additions & 4 deletions Client/core/CClientVariables.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -273,9 +273,6 @@ void CClientVariables::LoadDefaults()
DEFAULT("host", _S("127.0.0.1")); // hostname
DEFAULT("port", 22003); // port
DEFAULT("password", _S("")); // password
DEFAULT("qc_host", _S("127.0.0.1")); // quick connect hostname
DEFAULT("qc_port", 22003); // quick connect port
DEFAULT("qc_password", _S("")); // quick connect password
DEFAULT("debugfile", _S("")); // debug filename
DEFAULT("console_pos", CVector2D(0, 0)); // console position
DEFAULT("console_size", CVector2D(200, 200)); // console size
Expand Down Expand Up @@ -357,7 +354,6 @@ void CClientVariables::LoadDefaults()
DEFAULT("allow_discord_rpc", true); // Enable Discord Rich Presence
DEFAULT("discord_rpc_share_data", false); // Consistent Rich Presence data sharing
DEFAULT("discord_rpc_share_data_firsttime", false); // Display the user data sharing consent dialog box - for the first time
DEFAULT("_beta_qc_rightclick_command", _S("reconnect")); // Command to run when right clicking quick connect (beta - can be removed at any time)
DEFAULT("browser_enable_gpu", true); // Enable GPU in CEF? (allows stuff like WebGL to function)

if (!Exists("locale"))
Expand Down
9 changes: 4 additions & 5 deletions Client/core/CCommandFuncs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,6 @@ void CCommandFuncs::Reconnect(const char* szParameters)
unsigned int uiPort;

CVARS_GET("host", strHost);
CVARS_GET("nick", strNick);
CVARS_GET("password", strPassword);
CVARS_GET("port", uiPort);

Expand All @@ -315,7 +314,7 @@ void CCommandFuncs::Reconnect(const char* szParameters)
// Verify and convert the port number
if (uiPort <= 0 || uiPort > 0xFFFF)
{
CCore::GetSingleton().GetConsole()->Print(_("connect: Bad port number"));
CCore::GetSingleton().GetConsole()->Print(_("reconnect: Bad port number"));
return;
}

Expand All @@ -330,16 +329,16 @@ void CCommandFuncs::Reconnect(const char* szParameters)
// Start the connect
if (CCore::GetSingleton().GetConnectManager()->Reconnect(strHost.c_str(), usPort, strPassword.c_str(), false))
{
CCore::GetSingleton().GetConsole()->Printf(_("connect: Connecting to %s:%u..."), strHost.c_str(), usPort);
CCore::GetSingleton().GetConsole()->Printf(_("reconnect: Reconnecting to %s:%u..."), strHost.c_str(), usPort);
}
else
{
CCore::GetSingleton().GetConsole()->Printf(_("connect: could not connect to %s:%u!"), strHost.c_str(), usPort);
CCore::GetSingleton().GetConsole()->Printf(_("reconnect: could not connect to %s:%u!"), strHost.c_str(), usPort);
}
}
else
{
CCore::GetSingleton().GetConsole()->Print("connect: Failed to unload current mod");
CCore::GetSingleton().GetConsole()->Print("reconnect: Failed to unload current mod");
}
}

Expand Down
2 changes: 2 additions & 0 deletions Client/core/CConnectManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,8 @@ bool CConnectManager::Connect(const char* szHost, unsigned short usPort, const c

// Display the status box
SString strBuffer(_("Connecting to %s:%u ..."), m_strHost.c_str(), m_usPort);
if (m_bReconnect)
strBuffer = SString(_("Reconnecting to %s:%u ..."), m_strHost.c_str(), m_usPort);
CCore::GetSingleton().ShowMessageBox(_("CONNECTING"), strBuffer, MB_BUTTON_CANCEL | MB_ICON_INFO, m_pOnCancelClick);
WriteDebugEvent(SString("Connecting to %s:%u ...", m_strHost.c_str(), m_usPort));

Expand Down
14 changes: 5 additions & 9 deletions Client/core/CMainMenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -912,17 +912,13 @@ bool CMainMenu::OnQuickConnectButtonClick(CGUIElement* pElement, bool left)
if (m_ucFade != FADE_VISIBLE)
return false;

// If we're right clicking, execute special command
if (!left)
if (left)
g_pCore->GetCommands()->Execute("reconnect", "");
else
{
std::string command;
CVARS_GET("_beta_qc_rightclick_command", command);
g_pCore->GetCommands()->Execute(command.data());
return true;
m_ServerBrowser.SetVisible(true);
m_ServerBrowser.OnQuickConnectButtonClick();
}

m_ServerBrowser.SetVisible(true);
m_ServerBrowser.OnQuickConnectButtonClick();
return true;
}

Expand Down
39 changes: 0 additions & 39 deletions Client/core/ServerBrowser/CServerBrowser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -924,30 +924,6 @@ void CServerBrowser::CreateHistoryList()
}
}

// If we had no history, import it from our old quick connect
if (bEmpty)
{
std::string strAddress;
CVARS_GET("qc_host", strAddress);

if (!strAddress.empty())
{
std::string strPort;
CVARS_GET("qc_port", strPort);

if (!strPort.empty())
{
in_addr Address;
if (CServerListItem::Parse(strAddress.c_str(), Address))
{
m_ServersHistory.AddUnique(Address, atoi(strPort.c_str()));
CreateHistoryList(); // Restart with our new list.
return;
}
}
}
}

m_ServersHistory.Refresh();
}

Expand Down Expand Up @@ -2030,21 +2006,6 @@ std::string CServerBrowser::GetServerPassword(const std::string& strHost)
}
}
}

// If the server is the one from old quick connect, try importing the password from that
std::string strQCEndpoint;
CVARS_GET("qc_host", strQCEndpoint);

std::string strTemp;
CVARS_GET("qc_port", strTemp);

strQCEndpoint = strQCEndpoint + ":" + strTemp;
if (strQCEndpoint == strHost)
{
CVARS_GET("qc_password", strTemp);
return strTemp;
}

return "";
}

Expand Down
38 changes: 18 additions & 20 deletions Client/game_sa/CGameSA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ CGameSA::CGameSA()
m_pAESoundManager = new CAESoundManagerSA((CAESoundManagerSAInterface*)CLASS_CAESoundManager);
m_pAudioContainer = new CAudioContainerSA();
m_pWorld = new CWorldSA();
m_pPools = new CPoolsSA();
m_Pools = std::make_unique<CPoolsSA>();
m_pClock = new CClockSA();
m_pRadar = new CRadarSA();
m_pCamera = new CCameraSA((CCameraSAInterface*)CLASS_CCamera);
Expand All @@ -125,7 +125,7 @@ CGameSA::CGameSA()
m_pControllerConfigManager = new CControllerConfigManagerSA();
m_pProjectileInfo = new CProjectileInfoSA();
m_pRenderWare = new CRenderWareSA();
m_pHandlingManager = new CHandlingManagerSA();
m_HandlingManager = std::make_unique<CHandlingManagerSA>();
m_pEventList = new CEventListSA();
m_pGarages = new CGaragesSA((CGaragesSAInterface*)CLASS_CGarages);
m_pTasks = new CTasksSA((CTaskManagementSystemSA*)m_pTaskManagementSystem);
Expand Down Expand Up @@ -208,17 +208,17 @@ CGameSA::CGameSA()
m_Cheats[CHEAT_HEALTARMORMONEY] = new SCheatSA((BYTE*)VAR_HealthArmorMoney, false);

// Change pool sizes here
m_pPools->SetPoolCapacity(TASK_POOL, 5000); // Default is 500
m_pPools->SetPoolCapacity(OBJECT_POOL, MAX_OBJECTS); // Default is 350
m_pPools->SetPoolCapacity(EVENT_POOL, 5000); // Default is 200
m_pPools->SetPoolCapacity(COL_MODEL_POOL, 12000); // Default is 10150
m_pPools->SetPoolCapacity(ENV_MAP_MATERIAL_POOL, 16000); // Default is 4096
m_pPools->SetPoolCapacity(ENV_MAP_ATOMIC_POOL, 4000); // Default is 1024
m_pPools->SetPoolCapacity(SPEC_MAP_MATERIAL_POOL, 16000); // Default is 4096
m_pPools->SetPoolCapacity(ENTRY_INFO_NODE_POOL, MAX_ENTRY_INFO_NODES); // Default is 500
m_pPools->SetPoolCapacity(POINTER_SINGLE_LINK_POOL, MAX_POINTER_SINGLE_LINKS); // Default is 70000
m_pPools->SetPoolCapacity(POINTER_DOUBLE_LINK_POOL, MAX_POINTER_DOUBLE_LINKS); // Default is 3200
dassert(m_pPools->GetPoolCapacity(POINTER_SINGLE_LINK_POOL) == MAX_POINTER_SINGLE_LINKS);
m_Pools->SetPoolCapacity(TASK_POOL, 5000); // Default is 500
m_Pools->SetPoolCapacity(OBJECT_POOL, MAX_OBJECTS); // Default is 350
m_Pools->SetPoolCapacity(EVENT_POOL, 5000); // Default is 200
m_Pools->SetPoolCapacity(COL_MODEL_POOL, 12000); // Default is 10150
m_Pools->SetPoolCapacity(ENV_MAP_MATERIAL_POOL, 16000); // Default is 4096
m_Pools->SetPoolCapacity(ENV_MAP_ATOMIC_POOL, 4000); // Default is 1024
m_Pools->SetPoolCapacity(SPEC_MAP_MATERIAL_POOL, 16000); // Default is 4096
m_Pools->SetPoolCapacity(ENTRY_INFO_NODE_POOL, MAX_ENTRY_INFO_NODES); // Default is 500
m_Pools->SetPoolCapacity(POINTER_SINGLE_LINK_POOL, MAX_POINTER_SINGLE_LINKS); // Default is 70000
m_Pools->SetPoolCapacity(POINTER_DOUBLE_LINK_POOL, MAX_POINTER_DOUBLE_LINKS); // Default is 3200
dassert(m_Pools->GetPoolCapacity(POINTER_SINGLE_LINK_POOL) == MAX_POINTER_SINGLE_LINKS);

// Increase streaming object instances list size
MemPut<WORD>(0x05B8E55, MAX_RWOBJECT_INSTANCES * 12); // Default is 1000 * 12
Expand Down Expand Up @@ -261,7 +261,6 @@ CGameSA::~CGameSA()
delete reinterpret_cast<CAnimManagerSA*>(m_pAnimManager);
delete reinterpret_cast<CTasksSA*>(m_pTasks);
delete reinterpret_cast<CTaskManagementSystemSA*>(m_pTaskManagementSystem);
delete reinterpret_cast<CHandlingManagerSA*>(m_pHandlingManager);
delete reinterpret_cast<CStatsSA*>(m_pStats);
delete reinterpret_cast<CWeatherSA*>(m_pWeather);
delete reinterpret_cast<CAERadioTrackManagerSA*>(m_pCAERadioTrackManager);
Expand All @@ -276,7 +275,6 @@ CGameSA::~CGameSA()
delete reinterpret_cast<CCameraSA*>(m_pCamera);
delete reinterpret_cast<CRadarSA*>(m_pRadar);
delete reinterpret_cast<CClockSA*>(m_pClock);
delete reinterpret_cast<CPoolsSA*>(m_pPools);
delete reinterpret_cast<CWorldSA*>(m_pWorld);
delete reinterpret_cast<CAudioEngineSA*>(m_pAudioEngine);
delete reinterpret_cast<CAEAudioHardwareSA*>(m_pAEAudioHardware);
Expand Down Expand Up @@ -1039,8 +1037,8 @@ void CGameSA::RemoveAllBuildings()
{
m_pIplStore->SetDynamicIplStreamingEnabled(false);

m_pPools->GetDummyPool().RemoveAllBuildingLods();
m_pPools->GetBuildingsPool().RemoveAllBuildings();
m_Pools->GetDummyPool().RemoveAllBuildingLods();
m_Pools->GetBuildingsPool().RemoveAllBuildings();

auto pBuildingRemoval = static_cast<CBuildingRemovalSA*>(m_pBuildingRemoval);
pBuildingRemoval->DropCaches();
Expand All @@ -1050,8 +1048,8 @@ void CGameSA::RemoveAllBuildings()

void CGameSA::RestoreGameBuildings()
{
m_pPools->GetBuildingsPool().RestoreAllBuildings();
m_pPools->GetDummyPool().RestoreAllBuildingsLods();
m_Pools->GetBuildingsPool().RestoreAllBuildings();
m_Pools->GetDummyPool().RestoreAllBuildingsLods();

m_pIplStore->SetDynamicIplStreamingEnabled(true, [](CIplSAInterface* ipl) { return memcmp("barriers", ipl->name, 8) != 0; });
m_isBuildingsRemoved = false;
Expand All @@ -1069,7 +1067,7 @@ bool CGameSA::SetBuildingPoolSize(size_t size)
static_cast<CBuildingRemovalSA*>(m_pBuildingRemoval)->DropCaches();
}

bool status = m_pPools->GetBuildingsPool().Resize(size);
bool status = m_Pools->GetBuildingsPool().Resize(size);

if (shouldRemoveBuilding)
{
Expand Down
76 changes: 38 additions & 38 deletions Client/game_sa/CGameSA.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ class CGameSA : public CGame
CGameSA();
~CGameSA();

CPools* GetPools() { return m_pPools; }
CPools* GetPools() const noexcept { return m_Pools.get(); }
CPlayerInfo* GetPlayerInfo() { return m_pPlayerInfo; }
CProjectileInfo* GetProjectileInfo() { return m_pProjectileInfo; }
CRadar* GetRadar() { return m_pRadar; }
Expand Down Expand Up @@ -155,7 +155,7 @@ class CGameSA : public CGame
CCarEnterExit* GetCarEnterExit() { return m_pCarEnterExit; }
CControllerConfigManager* GetControllerConfigManager() { return m_pControllerConfigManager; }
CRenderWare* GetRenderWare() { return m_pRenderWare; }
CHandlingManager* GetHandlingManager() { return m_pHandlingManager; }
CHandlingManager* GetHandlingManager() const noexcept { return m_HandlingManager.get(); }
CAnimManager* GetAnimManager() { return m_pAnimManager; }
CStreaming* GetStreaming() { return m_pStreaming; }
CVisibilityPlugins* GetVisibilityPlugins() { return m_pVisibilityPlugins; }
Expand Down Expand Up @@ -313,42 +313,42 @@ class CGameSA : public CGame
bool SetBuildingPoolSize(size_t size);

private:
CPools* m_pPools;
CPlayerInfo* m_pPlayerInfo;
CProjectileInfo* m_pProjectileInfo;
CRadar* m_pRadar;
CClock* m_pClock;
CCoronas* m_pCoronas;
CCheckpoints* m_pCheckpoints;
CEventList* m_pEventList;
CFireManager* m_pFireManager;
CGarages* m_pGarages;
CHud* m_pHud;
CWeather* m_pWeather;
CWorld* m_pWorld;
CCamera* m_pCamera;
CModelInfo* m_pModelInfo;
CPickups* m_pPickups;
CWeaponInfo* m_pWeaponInfo;
CExplosionManager* m_pExplosionManager;
C3DMarkers* m_p3DMarkers;
CRenderWareSA* m_pRenderWare;
CHandlingManager* m_pHandlingManager;
CAnimManager* m_pAnimManager;
CStreaming* m_pStreaming;
CVisibilityPlugins* m_pVisibilityPlugins;
CKeyGen* m_pKeyGen;
CRopes* m_pRopes;
CFx* m_pFx;
CFxManagerSA* m_pFxManager;
CWaterManager* m_pWaterManager;
CWeaponStatManager* m_pWeaponStatsManager;
CPointLights* m_pPointLights;
CColStore* m_collisionStore;
CObjectGroupPhysicalProperties* m_pObjectGroupPhysicalProperties;
CCoverManagerSA* m_pCoverManager;
CPlantManagerSA* m_pPlantManager;
CBuildingRemoval* m_pBuildingRemoval;
std::unique_ptr<CPools> m_Pools;
CPlayerInfo* m_pPlayerInfo;
CProjectileInfo* m_pProjectileInfo;
CRadar* m_pRadar;
CClock* m_pClock;
CCoronas* m_pCoronas;
CCheckpoints* m_pCheckpoints;
CEventList* m_pEventList;
CFireManager* m_pFireManager;
CGarages* m_pGarages;
CHud* m_pHud;
CWeather* m_pWeather;
CWorld* m_pWorld;
CCamera* m_pCamera;
CModelInfo* m_pModelInfo;
CPickups* m_pPickups;
CWeaponInfo* m_pWeaponInfo;
CExplosionManager* m_pExplosionManager;
C3DMarkers* m_p3DMarkers;
CRenderWareSA* m_pRenderWare;
std::unique_ptr<CHandlingManager> m_HandlingManager;
CAnimManager* m_pAnimManager;
CStreaming* m_pStreaming;
CVisibilityPlugins* m_pVisibilityPlugins;
CKeyGen* m_pKeyGen;
CRopes* m_pRopes;
CFx* m_pFx;
CFxManagerSA* m_pFxManager;
CWaterManager* m_pWaterManager;
CWeaponStatManager* m_pWeaponStatsManager;
CPointLights* m_pPointLights;
CColStore* m_collisionStore;
CObjectGroupPhysicalProperties* m_pObjectGroupPhysicalProperties;
CCoverManagerSA* m_pCoverManager;
CPlantManagerSA* m_pPlantManager;
CBuildingRemoval* m_pBuildingRemoval;

std::unique_ptr<CRendererSA> m_pRenderer;

Expand Down
Loading

0 comments on commit fd74826

Please sign in to comment.