diff options
| author | Andrey Lihatskiy <alihatskiy@productengine.com> | 2020-09-01 23:05:31 +0300 | 
|---|---|---|
| committer | Andrey Lihatskiy <alihatskiy@productengine.com> | 2020-09-01 23:05:31 +0300 | 
| commit | 7f2388194136fc45d204f09fe63a6bd32d7e99ff (patch) | |
| tree | 876718a75ec3dfdc90e893c4af0a0ddd53331abd | |
| parent | c7a13e5c9f275214f424c0b1c0ceb7c99ae62bfb (diff) | |
| parent | c6ae8017da0cb433b24560c9a721ea25ea3396b7 (diff) | |
Merge branch 'SL-13834' into DRTVWR-513-maint
| -rw-r--r-- | indra/llxml/llcontrol.cpp | 18 | ||||
| -rw-r--r-- | indra/llxml/llcontrol.h | 2 | ||||
| -rw-r--r-- | indra/newview/llappviewer.cpp | 9 | ||||
| -rw-r--r-- | indra/newview/llviewerstats.cpp | 20 | ||||
| -rw-r--r-- | indra/newview/llviewerstats.h | 2 | 
5 files changed, 45 insertions, 6 deletions
| diff --git a/indra/llxml/llcontrol.cpp b/indra/llxml/llcontrol.cpp index 80a414d00f..ead8634df4 100644 --- a/indra/llxml/llcontrol.cpp +++ b/indra/llxml/llcontrol.cpp @@ -641,6 +641,24 @@ LLSD LLControlGroup::getLLSD(const std::string& name)  	return get<LLSD>(name);  } +LLSD LLControlGroup::asLLSD(bool diffs_only) +{ +	// Dump all stored values as LLSD +	LLSD result = LLSD::emptyArray(); +	for (ctrl_name_table_t::iterator iter = mNameTable.begin(); +		 iter != mNameTable.end(); iter++) +	{ +		LLControlVariable *control = iter->second; +		if (!control || control->isType(TYPE_STRING) || (diffs_only && control->isDefault())) +		{ +			continue; +		} +		const std::string& name = iter->first; +		result[name] = getLLSD(name); +	} +	return result; +} +  BOOL LLControlGroup::controlExists(const std::string& name)  {  	ctrl_name_table_t::iterator iter = mNameTable.find(name); diff --git a/indra/llxml/llcontrol.h b/indra/llxml/llcontrol.h index 99946607f4..19508becc3 100644 --- a/indra/llxml/llcontrol.h +++ b/indra/llxml/llcontrol.h @@ -242,6 +242,8 @@ public:  	LLColor4	getColor4(const std::string& name);  	LLColor3	getColor3(const std::string& name); +	LLSD		asLLSD(bool diffs_only); +	  	// generic getter  	template<typename T> T get(const std::string& name)  	{ diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 5a47d20329..6dfc29470b 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -285,7 +285,7 @@ extern BOOL gHiDPISupport;  ////////////////////////////////////////////////////////////  // All from the last globals push... -F32 gSimLastTime; // Used in LLAppViewer::init and send_stats() +F32 gSimLastTime; // Used in LLAppViewer::init and send_viewer_stats()  F32 gSimFrames;  BOOL gShowObjectUpdates = FALSE; @@ -3973,7 +3973,9 @@ void LLAppViewer::requestQuit()  		gFloaterView->closeAllChildren(true);  	} -	send_stats(); +	// Send preferences once, when exiting +	bool include_preferences = true; +	send_viewer_stats(include_preferences);  	gLogoutTimer.reset();  	mQuitRequested = true; @@ -4771,7 +4773,8 @@ void LLAppViewer::idle()  		if (viewer_stats_timer.getElapsedTimeF32() >= SEND_STATS_PERIOD && !gDisconnected)  		{  			LL_INFOS() << "Transmitting sessions stats" << LL_ENDL; -			send_stats(); +			bool include_preferences = false; +			send_viewer_stats(include_preferences);  			viewer_stats_timer.reset();  		} diff --git a/indra/newview/llviewerstats.cpp b/indra/newview/llviewerstats.cpp index f7ded00318..013757589c 100644 --- a/indra/newview/llviewerstats.cpp +++ b/indra/newview/llviewerstats.cpp @@ -60,6 +60,7 @@  #include "llviewernetwork.h"  #include "llmeshrepository.h" //for LLMeshRepository::sBytesReceived  #include "llsdserialize.h" +#include "llsdutil.h"  #include "llcorehttputil.h"  #include "llvoicevivox.h" @@ -425,7 +426,7 @@ void update_statistics()   * If you move stats around here, make the corresponding changes in   * those locations, too.   */ -void send_stats() +void send_viewer_stats(bool include_preferences)  {  	// IW 9/23/02 I elected not to move this into LLViewerStats  	// because it depends on too many viewer.cpp globals. @@ -617,10 +618,25 @@ void send_stats()  	body["DisplayNamesEnabled"] = gSavedSettings.getBOOL("UseDisplayNames");  	body["DisplayNamesShowUsername"] = gSavedSettings.getBOOL("NameTagShowUsernames"); -	 + +	// Preferences +	if (include_preferences) +	{ +		bool diffs_only = true; // only log preferences that differ from default +		body["preferences"]["settings"] = gSavedSettings.asLLSD(diffs_only); +		body["preferences"]["settings_per_account"] = gSavedPerAccountSettings.asLLSD(diffs_only); +	} +  	body["MinimalSkin"] = false; +  	LL_INFOS("LogViewerStatsPacket") << "Sending viewer statistics: " << body << LL_ENDL; +	if (debugLoggingEnabled("LogViewerStatsPacket")) +	{ +		std::string filename("viewer_stats_packet.xml"); +		llofstream of(filename.c_str()); +		LLSDSerialize::toPrettyXML(body,of); +	}  	// The session ID token must never appear in logs  	body["session_id"] = gAgentSessionID; diff --git a/indra/newview/llviewerstats.h b/indra/newview/llviewerstats.h index d8d92d61d3..04870e0c26 100644 --- a/indra/newview/llviewerstats.h +++ b/indra/newview/llviewerstats.h @@ -294,7 +294,7 @@ static const F32 SEND_STATS_PERIOD = 300.0f;  // The following are from (older?) statistics code found in appviewer.  void update_statistics(); -void send_stats(); +void send_viewer_stats(bool include_preferences);  extern LLFrameTimer gTextureTimer;  extern U32Bytes	gTotalTextureData; | 
