Add some more debug messages to the LSL bridge

Tue, 05 Dec 2017 17:38:43 +0100

author
Ansariel
date
Tue, 05 Dec 2017 17:38:43 +0100
changeset 53543
98cc3f892231
parent 53542
03dc54d18896
child 53544
c0cdfa737f42

Add some more debug messages to the LSL bridge

indra/newview/fslslbridge.cpp file | annotate | diff | revisions
indra/newview/llstartup.cpp file | annotate | diff | revisions
     1.1 --- a/indra/newview/fslslbridge.cpp	Tue Dec 05 11:09:51 2017 +0100
     1.2 +++ b/indra/newview/fslslbridge.cpp	Tue Dec 05 17:38:43 2017 +0100
     1.3 @@ -536,6 +536,8 @@
     1.4  
     1.5  void FSLSLBridge::cleanUpPreCreation()
     1.6  {
     1.7 +	LL_INFOS("FSLSLBridge") << "Starting clean up prior creation - bridge category has been loaded" << LL_ENDL;
     1.8 +
     1.9  	LLInventoryModel::cat_array_t cats;
    1.10  	LLInventoryModel::item_array_t items;
    1.11  	NameCollectFunctor namefunctor(mCurrentFullName);
    1.12 @@ -547,6 +549,7 @@
    1.13  		LLUUID item_id= (*it)->getUUID();
    1.14  		if (get_is_item_worn(item_id))
    1.15  		{
    1.16 +			LL_INFOS("FSLSLBridge") << "Found worn object " << item_id << " bridge category - detaching..." << LL_ENDL;
    1.17  			mAllowedDetachables.push_back(item_id);
    1.18  			LLVOAvatarSelf::detachAttachmentIntoInventory(item_id);
    1.19  		}
    1.20 @@ -556,14 +559,21 @@
    1.21  	// any attachments we need to wait for until they got detached
    1.22  	if (mAllowedDetachables.size() == 0)
    1.23  	{
    1.24 +		LL_INFOS("FSLSLBridge") << "Not waiting for any objects to get detached. Starting pre-creation cleanup immediately" << LL_ENDL;
    1.25  		finishCleanUpPreCreation();
    1.26  	}
    1.27 +	else
    1.28 +	{
    1.29 +		LL_INFOS("FSLSLBridge") << "Waiting for any objects to get detached. Pre-creation cleanup will start after objects got detached" << LL_ENDL;
    1.30 +	}
    1.31  }
    1.32  
    1.33  // Called either by cleanUpPreCreation directly or via FSLSLBridgeStartCreationTimer
    1.34  // after all pending detachments have been processed
    1.35  void FSLSLBridge::finishCleanUpPreCreation()
    1.36  {
    1.37 +	LL_INFOS("FSLSLBridge") << "Finishing cleanup prior creation" << LL_ENDL;
    1.38 +
    1.39  	LLInventoryModel::cat_array_t cats;
    1.40  	LLInventoryModel::item_array_t items;
    1.41  	NameCollectFunctor namefunctor(mCurrentFullName);
    1.42 @@ -571,13 +581,14 @@
    1.43  
    1.44  	for (LLInventoryModel::item_array_t::iterator it = items.begin(); it != items.end(); ++it)
    1.45  	{
    1.46 -		remove_inventory_object((*it)->getUUID(), NULL);
    1.47 +		LL_INFOS("FSLSLBridge") << "Bridge folder cleanup: Deleting " << (*it)->getName() << " (" << (*it)->getUUID() << ")" << LL_ENDL;
    1.48 +		remove_inventory_item((*it)->getUUID(), NULL, true); // Don't wait for callback from server to update inventory model
    1.49  	}
    1.50  	gInventory.notifyObservers();
    1.51  
    1.52  	// clear the stored bridge ID - we are starting over.
    1.53  	mpBridge = NULL; //the object itself will get cleaned up when new one is created.
    1.54 -	mCurrentURL = "";
    1.55 +	mCurrentURL.clear();
    1.56  
    1.57  	setBridgeCreating(true);
    1.58  	mFinishCreation = false;
    1.59 @@ -755,6 +766,8 @@
    1.60  
    1.61  	if (!mpBridge) //user is attaching an existing bridge?
    1.62  	{
    1.63 +		LL_INFOS("FSLSLBridge") << "mpBridge is NULL" << LL_ENDL;
    1.64 +
    1.65  		//is it the right version?
    1.66  		if (fsObject->getName() != mCurrentFullName)
    1.67  		{
    1.68 @@ -787,8 +800,7 @@
    1.69  		mpBridge = fsObject;
    1.70  	}
    1.71  
    1.72 -	LL_DEBUGS("FSLSLBridge") << "Bridge container is attached, mpBridge not NULL, avatar is self, point is bridge, all is good." << LL_ENDL;
    1.73 -
    1.74 +	LL_INFOS("FSLSLBridge") << "Bridge container is attached, mpBridge not NULL, avatar is self, point is bridge, all is good." << LL_ENDL;
    1.75  
    1.76  	if (fsObject->getUUID() != mpBridge->getUUID())
    1.77  	{
    1.78 @@ -1228,7 +1240,7 @@
    1.79  	
    1.80  		FSLSLBridge::instance().cleanUpBridge();
    1.81  		//also clean up script remains
    1.82 -		remove_inventory_object(item->getUUID(), NULL);
    1.83 +		remove_inventory_item(item->getUUID(), NULL, true);
    1.84  		gInventory.notifyObservers();
    1.85  		LL_WARNS("FSLSLBridge") << "Can't update bridge script. Purging bridge." << LL_ENDL;
    1.86  		return;
    1.87 @@ -1331,7 +1343,7 @@
    1.88  
    1.89  	if (isBridgeValid())
    1.90  	{
    1.91 -		remove_inventory_object(mpBridge->getUUID(), NULL);
    1.92 +		remove_inventory_item(mpBridge->getUUID(), NULL, true);
    1.93  	}
    1.94  
    1.95  	gInventory.notifyObservers();
    1.96 @@ -1348,10 +1360,18 @@
    1.97  	mIsFirstCallDone = false;
    1.98  	cleanUpOldVersions();
    1.99  	cleanUpBridgeFolder();
   1.100 +	LL_INFOS("FSLSLBridge") << "Bridge cleaned up. Detaching bridge" << LL_ENDL;
   1.101  
   1.102  	mAllowDetach = true;
   1.103  	mFinishCreation = true;
   1.104 -	LLVOAvatarSelf::detachAttachmentIntoInventory(getBridge()->getUUID());
   1.105 +	if (getBridge())
   1.106 +	{
   1.107 +		LLVOAvatarSelf::detachAttachmentIntoInventory(getBridge()->getUUID());
   1.108 +	}
   1.109 +	else
   1.110 +	{
   1.111 +		LL_WARNS("FSLSLBridge") << "Cannot detach bridge - mpBridge = NULL" << LL_ENDL;
   1.112 +	}
   1.113  }
   1.114  
   1.115  //
   1.116 @@ -1507,7 +1527,8 @@
   1.117  		const LLViewerInventoryItem* itemp = *it;
   1.118  		if (!itemp->getIsLinkType() && (itemp->getUUID() != mpBridge->getUUID()))
   1.119  		{
   1.120 -			remove_inventory_object(itemp->getUUID(), NULL);
   1.121 +			LL_INFOS("FSLSLBridge") << "Bridge folder cleanup: Deleting " << itemp->getName() << " (" << itemp->getUUID() << ")" << LL_ENDL;
   1.122 +			remove_inventory_item(itemp->getUUID(), NULL, true);
   1.123  		}
   1.124  	}
   1.125  
     2.1 --- a/indra/newview/llstartup.cpp	Tue Dec 05 11:09:51 2017 +0100
     2.2 +++ b/indra/newview/llstartup.cpp	Tue Dec 05 17:38:43 2017 +0100
     2.3 @@ -2895,7 +2895,14 @@
     2.4  		// <FS:TT> Client LSL Bridge
     2.5  		if (gSavedSettings.getBOOL("UseLSLBridge"))
     2.6  		{
     2.7 -			FSLSLBridge::instance().initBridge();
     2.8 +			if (!FSLSLBridge::instance().getBridgeCreating())
     2.9 +			{
    2.10 +				FSLSLBridge::instance().initBridge();
    2.11 +			}
    2.12 +			else
    2.13 +			{
    2.14 +				LL_INFOS("FSLSLBridge") << "LSL bridge already getting created - skipping bridge init" << LL_ENDL;
    2.15 +			}
    2.16  		}
    2.17  		// </FS:TT>
    2.18  

mercurial