Skip to content

Commit fd74826

Browse files
authored
Merge branch 'master' into 081024_CVector
2 parents ac9af8e + c128048 commit fd74826

Some content is hidden

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

61 files changed

+1669
-1586
lines changed

Client/core/CClientVariables.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -273,9 +273,6 @@ void CClientVariables::LoadDefaults()
273273
DEFAULT("host", _S("127.0.0.1")); // hostname
274274
DEFAULT("port", 22003); // port
275275
DEFAULT("password", _S("")); // password
276-
DEFAULT("qc_host", _S("127.0.0.1")); // quick connect hostname
277-
DEFAULT("qc_port", 22003); // quick connect port
278-
DEFAULT("qc_password", _S("")); // quick connect password
279276
DEFAULT("debugfile", _S("")); // debug filename
280277
DEFAULT("console_pos", CVector2D(0, 0)); // console position
281278
DEFAULT("console_size", CVector2D(200, 200)); // console size
@@ -357,7 +354,6 @@ void CClientVariables::LoadDefaults()
357354
DEFAULT("allow_discord_rpc", true); // Enable Discord Rich Presence
358355
DEFAULT("discord_rpc_share_data", false); // Consistent Rich Presence data sharing
359356
DEFAULT("discord_rpc_share_data_firsttime", false); // Display the user data sharing consent dialog box - for the first time
360-
DEFAULT("_beta_qc_rightclick_command", _S("reconnect")); // Command to run when right clicking quick connect (beta - can be removed at any time)
361357
DEFAULT("browser_enable_gpu", true); // Enable GPU in CEF? (allows stuff like WebGL to function)
362358

363359
if (!Exists("locale"))

Client/core/CCommandFuncs.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,6 @@ void CCommandFuncs::Reconnect(const char* szParameters)
302302
unsigned int uiPort;
303303

304304
CVARS_GET("host", strHost);
305-
CVARS_GET("nick", strNick);
306305
CVARS_GET("password", strPassword);
307306
CVARS_GET("port", uiPort);
308307

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

@@ -330,16 +329,16 @@ void CCommandFuncs::Reconnect(const char* szParameters)
330329
// Start the connect
331330
if (CCore::GetSingleton().GetConnectManager()->Reconnect(strHost.c_str(), usPort, strPassword.c_str(), false))
332331
{
333-
CCore::GetSingleton().GetConsole()->Printf(_("connect: Connecting to %s:%u..."), strHost.c_str(), usPort);
332+
CCore::GetSingleton().GetConsole()->Printf(_("reconnect: Reconnecting to %s:%u..."), strHost.c_str(), usPort);
334333
}
335334
else
336335
{
337-
CCore::GetSingleton().GetConsole()->Printf(_("connect: could not connect to %s:%u!"), strHost.c_str(), usPort);
336+
CCore::GetSingleton().GetConsole()->Printf(_("reconnect: could not connect to %s:%u!"), strHost.c_str(), usPort);
338337
}
339338
}
340339
else
341340
{
342-
CCore::GetSingleton().GetConsole()->Print("connect: Failed to unload current mod");
341+
CCore::GetSingleton().GetConsole()->Print("reconnect: Failed to unload current mod");
343342
}
344343
}
345344

Client/core/CConnectManager.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,8 @@ bool CConnectManager::Connect(const char* szHost, unsigned short usPort, const c
145145

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

Client/core/CMainMenu.cpp

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -912,17 +912,13 @@ bool CMainMenu::OnQuickConnectButtonClick(CGUIElement* pElement, bool left)
912912
if (m_ucFade != FADE_VISIBLE)
913913
return false;
914914

915-
// If we're right clicking, execute special command
916-
if (!left)
915+
if (left)
916+
g_pCore->GetCommands()->Execute("reconnect", "");
917+
else
917918
{
918-
std::string command;
919-
CVARS_GET("_beta_qc_rightclick_command", command);
920-
g_pCore->GetCommands()->Execute(command.data());
921-
return true;
919+
m_ServerBrowser.SetVisible(true);
920+
m_ServerBrowser.OnQuickConnectButtonClick();
922921
}
923-
924-
m_ServerBrowser.SetVisible(true);
925-
m_ServerBrowser.OnQuickConnectButtonClick();
926922
return true;
927923
}
928924

Client/core/ServerBrowser/CServerBrowser.cpp

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -924,30 +924,6 @@ void CServerBrowser::CreateHistoryList()
924924
}
925925
}
926926

927-
// If we had no history, import it from our old quick connect
928-
if (bEmpty)
929-
{
930-
std::string strAddress;
931-
CVARS_GET("qc_host", strAddress);
932-
933-
if (!strAddress.empty())
934-
{
935-
std::string strPort;
936-
CVARS_GET("qc_port", strPort);
937-
938-
if (!strPort.empty())
939-
{
940-
in_addr Address;
941-
if (CServerListItem::Parse(strAddress.c_str(), Address))
942-
{
943-
m_ServersHistory.AddUnique(Address, atoi(strPort.c_str()));
944-
CreateHistoryList(); // Restart with our new list.
945-
return;
946-
}
947-
}
948-
}
949-
}
950-
951927
m_ServersHistory.Refresh();
952928
}
953929

@@ -2030,21 +2006,6 @@ std::string CServerBrowser::GetServerPassword(const std::string& strHost)
20302006
}
20312007
}
20322008
}
2033-
2034-
// If the server is the one from old quick connect, try importing the password from that
2035-
std::string strQCEndpoint;
2036-
CVARS_GET("qc_host", strQCEndpoint);
2037-
2038-
std::string strTemp;
2039-
CVARS_GET("qc_port", strTemp);
2040-
2041-
strQCEndpoint = strQCEndpoint + ":" + strTemp;
2042-
if (strQCEndpoint == strHost)
2043-
{
2044-
CVARS_GET("qc_password", strTemp);
2045-
return strTemp;
2046-
}
2047-
20482009
return "";
20492010
}
20502011

Client/game_sa/CGameSA.cpp

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ CGameSA::CGameSA()
104104
m_pAESoundManager = new CAESoundManagerSA((CAESoundManagerSAInterface*)CLASS_CAESoundManager);
105105
m_pAudioContainer = new CAudioContainerSA();
106106
m_pWorld = new CWorldSA();
107-
m_pPools = new CPoolsSA();
107+
m_Pools = std::make_unique<CPoolsSA>();
108108
m_pClock = new CClockSA();
109109
m_pRadar = new CRadarSA();
110110
m_pCamera = new CCameraSA((CCameraSAInterface*)CLASS_CCamera);
@@ -125,7 +125,7 @@ CGameSA::CGameSA()
125125
m_pControllerConfigManager = new CControllerConfigManagerSA();
126126
m_pProjectileInfo = new CProjectileInfoSA();
127127
m_pRenderWare = new CRenderWareSA();
128-
m_pHandlingManager = new CHandlingManagerSA();
128+
m_HandlingManager = std::make_unique<CHandlingManagerSA>();
129129
m_pEventList = new CEventListSA();
130130
m_pGarages = new CGaragesSA((CGaragesSAInterface*)CLASS_CGarages);
131131
m_pTasks = new CTasksSA((CTaskManagementSystemSA*)m_pTaskManagementSystem);
@@ -208,17 +208,17 @@ CGameSA::CGameSA()
208208
m_Cheats[CHEAT_HEALTARMORMONEY] = new SCheatSA((BYTE*)VAR_HealthArmorMoney, false);
209209

210210
// Change pool sizes here
211-
m_pPools->SetPoolCapacity(TASK_POOL, 5000); // Default is 500
212-
m_pPools->SetPoolCapacity(OBJECT_POOL, MAX_OBJECTS); // Default is 350
213-
m_pPools->SetPoolCapacity(EVENT_POOL, 5000); // Default is 200
214-
m_pPools->SetPoolCapacity(COL_MODEL_POOL, 12000); // Default is 10150
215-
m_pPools->SetPoolCapacity(ENV_MAP_MATERIAL_POOL, 16000); // Default is 4096
216-
m_pPools->SetPoolCapacity(ENV_MAP_ATOMIC_POOL, 4000); // Default is 1024
217-
m_pPools->SetPoolCapacity(SPEC_MAP_MATERIAL_POOL, 16000); // Default is 4096
218-
m_pPools->SetPoolCapacity(ENTRY_INFO_NODE_POOL, MAX_ENTRY_INFO_NODES); // Default is 500
219-
m_pPools->SetPoolCapacity(POINTER_SINGLE_LINK_POOL, MAX_POINTER_SINGLE_LINKS); // Default is 70000
220-
m_pPools->SetPoolCapacity(POINTER_DOUBLE_LINK_POOL, MAX_POINTER_DOUBLE_LINKS); // Default is 3200
221-
dassert(m_pPools->GetPoolCapacity(POINTER_SINGLE_LINK_POOL) == MAX_POINTER_SINGLE_LINKS);
211+
m_Pools->SetPoolCapacity(TASK_POOL, 5000); // Default is 500
212+
m_Pools->SetPoolCapacity(OBJECT_POOL, MAX_OBJECTS); // Default is 350
213+
m_Pools->SetPoolCapacity(EVENT_POOL, 5000); // Default is 200
214+
m_Pools->SetPoolCapacity(COL_MODEL_POOL, 12000); // Default is 10150
215+
m_Pools->SetPoolCapacity(ENV_MAP_MATERIAL_POOL, 16000); // Default is 4096
216+
m_Pools->SetPoolCapacity(ENV_MAP_ATOMIC_POOL, 4000); // Default is 1024
217+
m_Pools->SetPoolCapacity(SPEC_MAP_MATERIAL_POOL, 16000); // Default is 4096
218+
m_Pools->SetPoolCapacity(ENTRY_INFO_NODE_POOL, MAX_ENTRY_INFO_NODES); // Default is 500
219+
m_Pools->SetPoolCapacity(POINTER_SINGLE_LINK_POOL, MAX_POINTER_SINGLE_LINKS); // Default is 70000
220+
m_Pools->SetPoolCapacity(POINTER_DOUBLE_LINK_POOL, MAX_POINTER_DOUBLE_LINKS); // Default is 3200
221+
dassert(m_Pools->GetPoolCapacity(POINTER_SINGLE_LINK_POOL) == MAX_POINTER_SINGLE_LINKS);
222222

223223
// Increase streaming object instances list size
224224
MemPut<WORD>(0x05B8E55, MAX_RWOBJECT_INSTANCES * 12); // Default is 1000 * 12
@@ -261,7 +261,6 @@ CGameSA::~CGameSA()
261261
delete reinterpret_cast<CAnimManagerSA*>(m_pAnimManager);
262262
delete reinterpret_cast<CTasksSA*>(m_pTasks);
263263
delete reinterpret_cast<CTaskManagementSystemSA*>(m_pTaskManagementSystem);
264-
delete reinterpret_cast<CHandlingManagerSA*>(m_pHandlingManager);
265264
delete reinterpret_cast<CStatsSA*>(m_pStats);
266265
delete reinterpret_cast<CWeatherSA*>(m_pWeather);
267266
delete reinterpret_cast<CAERadioTrackManagerSA*>(m_pCAERadioTrackManager);
@@ -276,7 +275,6 @@ CGameSA::~CGameSA()
276275
delete reinterpret_cast<CCameraSA*>(m_pCamera);
277276
delete reinterpret_cast<CRadarSA*>(m_pRadar);
278277
delete reinterpret_cast<CClockSA*>(m_pClock);
279-
delete reinterpret_cast<CPoolsSA*>(m_pPools);
280278
delete reinterpret_cast<CWorldSA*>(m_pWorld);
281279
delete reinterpret_cast<CAudioEngineSA*>(m_pAudioEngine);
282280
delete reinterpret_cast<CAEAudioHardwareSA*>(m_pAEAudioHardware);
@@ -1039,8 +1037,8 @@ void CGameSA::RemoveAllBuildings()
10391037
{
10401038
m_pIplStore->SetDynamicIplStreamingEnabled(false);
10411039

1042-
m_pPools->GetDummyPool().RemoveAllBuildingLods();
1043-
m_pPools->GetBuildingsPool().RemoveAllBuildings();
1040+
m_Pools->GetDummyPool().RemoveAllBuildingLods();
1041+
m_Pools->GetBuildingsPool().RemoveAllBuildings();
10441042

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

10511049
void CGameSA::RestoreGameBuildings()
10521050
{
1053-
m_pPools->GetBuildingsPool().RestoreAllBuildings();
1054-
m_pPools->GetDummyPool().RestoreAllBuildingsLods();
1051+
m_Pools->GetBuildingsPool().RestoreAllBuildings();
1052+
m_Pools->GetDummyPool().RestoreAllBuildingsLods();
10551053

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

1072-
bool status = m_pPools->GetBuildingsPool().Resize(size);
1070+
bool status = m_Pools->GetBuildingsPool().Resize(size);
10731071

10741072
if (shouldRemoveBuilding)
10751073
{

Client/game_sa/CGameSA.h

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ class CGameSA : public CGame
125125
CGameSA();
126126
~CGameSA();
127127

128-
CPools* GetPools() { return m_pPools; }
128+
CPools* GetPools() const noexcept { return m_Pools.get(); }
129129
CPlayerInfo* GetPlayerInfo() { return m_pPlayerInfo; }
130130
CProjectileInfo* GetProjectileInfo() { return m_pProjectileInfo; }
131131
CRadar* GetRadar() { return m_pRadar; }
@@ -155,7 +155,7 @@ class CGameSA : public CGame
155155
CCarEnterExit* GetCarEnterExit() { return m_pCarEnterExit; }
156156
CControllerConfigManager* GetControllerConfigManager() { return m_pControllerConfigManager; }
157157
CRenderWare* GetRenderWare() { return m_pRenderWare; }
158-
CHandlingManager* GetHandlingManager() { return m_pHandlingManager; }
158+
CHandlingManager* GetHandlingManager() const noexcept { return m_HandlingManager.get(); }
159159
CAnimManager* GetAnimManager() { return m_pAnimManager; }
160160
CStreaming* GetStreaming() { return m_pStreaming; }
161161
CVisibilityPlugins* GetVisibilityPlugins() { return m_pVisibilityPlugins; }
@@ -313,42 +313,42 @@ class CGameSA : public CGame
313313
bool SetBuildingPoolSize(size_t size);
314314

315315
private:
316-
CPools* m_pPools;
317-
CPlayerInfo* m_pPlayerInfo;
318-
CProjectileInfo* m_pProjectileInfo;
319-
CRadar* m_pRadar;
320-
CClock* m_pClock;
321-
CCoronas* m_pCoronas;
322-
CCheckpoints* m_pCheckpoints;
323-
CEventList* m_pEventList;
324-
CFireManager* m_pFireManager;
325-
CGarages* m_pGarages;
326-
CHud* m_pHud;
327-
CWeather* m_pWeather;
328-
CWorld* m_pWorld;
329-
CCamera* m_pCamera;
330-
CModelInfo* m_pModelInfo;
331-
CPickups* m_pPickups;
332-
CWeaponInfo* m_pWeaponInfo;
333-
CExplosionManager* m_pExplosionManager;
334-
C3DMarkers* m_p3DMarkers;
335-
CRenderWareSA* m_pRenderWare;
336-
CHandlingManager* m_pHandlingManager;
337-
CAnimManager* m_pAnimManager;
338-
CStreaming* m_pStreaming;
339-
CVisibilityPlugins* m_pVisibilityPlugins;
340-
CKeyGen* m_pKeyGen;
341-
CRopes* m_pRopes;
342-
CFx* m_pFx;
343-
CFxManagerSA* m_pFxManager;
344-
CWaterManager* m_pWaterManager;
345-
CWeaponStatManager* m_pWeaponStatsManager;
346-
CPointLights* m_pPointLights;
347-
CColStore* m_collisionStore;
348-
CObjectGroupPhysicalProperties* m_pObjectGroupPhysicalProperties;
349-
CCoverManagerSA* m_pCoverManager;
350-
CPlantManagerSA* m_pPlantManager;
351-
CBuildingRemoval* m_pBuildingRemoval;
316+
std::unique_ptr<CPools> m_Pools;
317+
CPlayerInfo* m_pPlayerInfo;
318+
CProjectileInfo* m_pProjectileInfo;
319+
CRadar* m_pRadar;
320+
CClock* m_pClock;
321+
CCoronas* m_pCoronas;
322+
CCheckpoints* m_pCheckpoints;
323+
CEventList* m_pEventList;
324+
CFireManager* m_pFireManager;
325+
CGarages* m_pGarages;
326+
CHud* m_pHud;
327+
CWeather* m_pWeather;
328+
CWorld* m_pWorld;
329+
CCamera* m_pCamera;
330+
CModelInfo* m_pModelInfo;
331+
CPickups* m_pPickups;
332+
CWeaponInfo* m_pWeaponInfo;
333+
CExplosionManager* m_pExplosionManager;
334+
C3DMarkers* m_p3DMarkers;
335+
CRenderWareSA* m_pRenderWare;
336+
std::unique_ptr<CHandlingManager> m_HandlingManager;
337+
CAnimManager* m_pAnimManager;
338+
CStreaming* m_pStreaming;
339+
CVisibilityPlugins* m_pVisibilityPlugins;
340+
CKeyGen* m_pKeyGen;
341+
CRopes* m_pRopes;
342+
CFx* m_pFx;
343+
CFxManagerSA* m_pFxManager;
344+
CWaterManager* m_pWaterManager;
345+
CWeaponStatManager* m_pWeaponStatsManager;
346+
CPointLights* m_pPointLights;
347+
CColStore* m_collisionStore;
348+
CObjectGroupPhysicalProperties* m_pObjectGroupPhysicalProperties;
349+
CCoverManagerSA* m_pCoverManager;
350+
CPlantManagerSA* m_pPlantManager;
351+
CBuildingRemoval* m_pBuildingRemoval;
352352

353353
std::unique_ptr<CRendererSA> m_pRenderer;
354354

0 commit comments

Comments
 (0)