Skip to content

Commit 8dcda74

Browse files
authored
Merge branch 'master' into feature/4x4CMatrix
2 parents a1205c5 + f985702 commit 8dcda74

File tree

91 files changed

+1984
-1766
lines changed

Some content is hidden

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

91 files changed

+1984
-1766
lines changed

Client/cefweb/CWebView.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -936,10 +936,10 @@ void CWebView::OnBeforeClose(CefRefPtr<CefBrowser> browser)
936936
// //
937937
// //
938938
////////////////////////////////////////////////////////////////////
939-
bool CWebView::OnBeforePopup(CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame, const CefString& target_url, const CefString& target_frame_name,
940-
CefLifeSpanHandler::WindowOpenDisposition target_disposition, bool user_gesture, const CefPopupFeatures& popupFeatures,
941-
CefWindowInfo& windowInfo, CefRefPtr<CefClient>& client, CefBrowserSettings& settings, CefRefPtr<CefDictionaryValue>& extra_info,
942-
bool* no_javascript_access)
939+
bool CWebView::OnBeforePopup(CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame, int popup_id, const CefString& target_url,
940+
const CefString& target_frame_name, CefLifeSpanHandler::WindowOpenDisposition target_disposition, bool user_gesture,
941+
const CefPopupFeatures& popupFeatures, CefWindowInfo& windowInfo, CefRefPtr<CefClient>& client, CefBrowserSettings& settings,
942+
CefRefPtr<CefDictionaryValue>& extra_info, bool* no_javascript_access)
943943
{
944944
// ATTENTION: This method is called on the IO thread
945945

Client/cefweb/CWebView.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -152,10 +152,10 @@ class CWebView : public CWebViewInterface,
152152

153153
// CefLifeSpawnHandler methods
154154
virtual void OnBeforeClose(CefRefPtr<CefBrowser> browser) override;
155-
virtual bool OnBeforePopup(CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame, const CefString& target_url, const CefString& target_frame_name,
156-
CefLifeSpanHandler::WindowOpenDisposition target_disposition, bool user_gesture, const CefPopupFeatures& popupFeatures,
157-
CefWindowInfo& windowInfo, CefRefPtr<CefClient>& client, CefBrowserSettings& settings, CefRefPtr<CefDictionaryValue>& extra_info,
158-
bool* no_javascript_access) override;
155+
virtual bool OnBeforePopup(CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame, int popup_id, const CefString& target_url,
156+
const CefString& target_frame_name, CefLifeSpanHandler::WindowOpenDisposition target_disposition, bool user_gesture,
157+
const CefPopupFeatures& popupFeatures, CefWindowInfo& windowInfo, CefRefPtr<CefClient>& client, CefBrowserSettings& settings,
158+
CefRefPtr<CefDictionaryValue>& extra_info, bool* no_javascript_access) override;
159159
virtual void OnAfterCreated(CefRefPtr<CefBrowser> browser) override;
160160

161161
// CefJSDialogHandler methods

Client/core/CClientVariables.cpp

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

365361
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/CQueryReceiver.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ SQueryInfo CQueryReceiver::GetServerResponse()
183183

184184
// Recover server ping status if present
185185
const SString strPingStatus = strBuildNumber.Right(strBuildNumber.length() - strlen(strBuildNumber) - 1);
186-
CCore::GetSingleton().GetNetwork()->UpdatePingStatus(*strPingStatus, info.players, info.isStatusVerified);
186+
CCore::GetSingleton().GetNetwork()->UpdatePingStatus(strPingStatus.c_str(), strPingStatus.length(), info.players, info.isStatusVerified);
187187

188188
// Recover server http port if present
189189
const SString strNetRoute = strPingStatus.Right(strPingStatus.length() - strlen(strPingStatus) - 1);

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/CBuildingsPoolSA.cpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,13 @@ CBuilding* CBuildingsPoolSA::AddBuilding(CClientBuilding* pClientBuilding, uint1
5353
if (!HasFreeBuildingSlot())
5454
return nullptr;
5555

56+
auto modelInfo = pGame->GetModelInfo(modelId);
57+
58+
// Change the properties group to force dynamic models to be created as buildings instead of dummies
59+
auto prevGroup = modelInfo->GetObjectPropertiesGroup();
60+
if (prevGroup != MODEL_PROPERTIES_GROUP_STATIC)
61+
modelInfo->SetObjectPropertiesGroup(MODEL_PROPERTIES_GROUP_STATIC);
62+
5663
// Load building
5764
SFileObjectInstance instance;
5865
instance.modelID = modelId;
@@ -70,9 +77,12 @@ CBuilding* CBuildingsPoolSA::AddBuilding(CClientBuilding* pClientBuilding, uint1
7077
pBuilding->m_pLod = nullptr;
7178
pBuilding->m_iplIndex = 0;
7279

80+
// Restore changed properties group
81+
if (prevGroup != MODEL_PROPERTIES_GROUP_STATIC)
82+
modelInfo->SetObjectPropertiesGroup(prevGroup);
83+
7384
// Always stream model collosion
7485
// TODO We can setup collison bounding box and use GTA streamer for it
75-
auto modelInfo = pGame->GetModelInfo(modelId);
7686
modelInfo->AddColRef();
7787

7888
// Add building in world

Client/game_sa/CEntitySA.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -679,7 +679,7 @@ bool CEntitySA::GetBonePosition(eBone boneId, CVector& position)
679679
return false;
680680

681681
const RwV3d& pos = rwBoneMatrix->pos;
682-
position = {pos.x, pos.y, pos.z};
682+
position = CVector(pos.x, pos.y, pos.z);
683683
return true;
684684
}
685685

0 commit comments

Comments
 (0)