Fix typo in command line packager

Wed, 06 Dec 2017 11:06:53 +0100

author
Ansariel
date
Wed, 06 Dec 2017 11:06:53 +0100
changeset 53545
ed0d7e048068
parent 53544
c0cdfa737f42
child 53546
70d57db53987

Fix typo in command line packager

indra/newview/chatbar_as_cmdline.cpp file | annotate | diff | revisions
     1.1 --- a/indra/newview/chatbar_as_cmdline.cpp	Wed Dec 06 09:46:16 2017 +0100
     1.2 +++ b/indra/newview/chatbar_as_cmdline.cpp	Wed Dec 06 11:06:53 2017 +0100
     1.3 @@ -147,7 +147,6 @@
     1.4  		}
     1.5  	}
     1.6  
     1.7 -
     1.8  private:
     1.9  	std::stack<LLViewerInventoryItem*> mStack;
    1.10  	LLUUID mDestination;
    1.11 @@ -236,143 +235,143 @@
    1.12  
    1.13  	BOOL tick()
    1.14  	{
    1.15 +		switch (mState)
    1.16  		{
    1.17 -			switch (mState) {
    1.18 -				case ZTS_COUNTDOWN:
    1.19 -					report_to_nearby_chat(llformat("%i...", mCountdown--));
    1.20 -					if (mCountdown == 0) mState = ZTS_SELECTION;
    1.21 -					break;
    1.22 -					
    1.23 -				case ZTS_SELECTION:
    1.24 -					for (LLObjectSelection::root_iterator itr = LLSelectMgr::getInstance()->getSelection()->root_begin();
    1.25 -						itr != LLSelectMgr::getInstance()->getSelection()->root_end(); ++itr)
    1.26 +			case ZTS_COUNTDOWN:
    1.27 +				report_to_nearby_chat(llformat("%i...", mCountdown--));
    1.28 +				if (mCountdown == 0) mState = ZTS_SELECTION;
    1.29 +				break;
    1.30 +
    1.31 +			case ZTS_SELECTION:
    1.32 +				for (LLObjectSelection::root_iterator itr = LLSelectMgr::getInstance()->getSelection()->root_begin();
    1.33 +					itr != LLSelectMgr::getInstance()->getSelection()->root_end(); ++itr)
    1.34 +				{
    1.35 +					LLSelectNode* node = (*itr);
    1.36 +					LLViewerObject* objectp = node->getObject();
    1.37 +					U32 localid = objectp->getLocalID();
    1.38 +					if (mDonePrims.find(localid) == mDonePrims.end())
    1.39  					{
    1.40 -						LLSelectNode* node = (*itr);
    1.41 -						LLViewerObject* objectp = node->getObject();
    1.42 -						U32 localid = objectp->getLocalID();
    1.43 -						if (mDonePrims.find(localid) == mDonePrims.end())
    1.44 +						mDonePrims.insert(localid);
    1.45 +						mToTake.push_back(localid);
    1.46 +					}
    1.47 +				}
    1.48 +				if (mToTake.size() > 0) mState = ZTS_TAKE;
    1.49 +				break;
    1.50 +
    1.51 +			case ZTS_TAKE:
    1.52 +				if (mToTake.size() > 0)
    1.53 +				{
    1.54 +					std::vector<LLPointer<LLViewerInventoryItem> > inventory = findInventoryInFolder(mFolderName);
    1.55 +					mPackSize = mToTake.size() + inventory.size();
    1.56 +
    1.57 +					LLMessageSystem* msg = gMessageSystem;
    1.58 +					msg->newMessageFast(_PREHASH_DeRezObject);
    1.59 +					msg->nextBlockFast(_PREHASH_AgentData);
    1.60 +					msg->addUUIDFast(_PREHASH_AgentID, gAgentID);
    1.61 +					msg->addUUIDFast(_PREHASH_SessionID, gAgentSessionID);
    1.62 +					msg->nextBlockFast(_PREHASH_AgentBlock);
    1.63 +					msg->addUUIDFast(_PREHASH_GroupID, LLUUID::null);
    1.64 +					msg->addU8Fast(_PREHASH_Destination, mDest);
    1.65 +					msg->addUUIDFast(_PREHASH_DestinationID, mTarget);
    1.66 +					LLUUID rand;
    1.67 +					rand.generate();
    1.68 +					msg->addUUIDFast(_PREHASH_TransactionID, rand);
    1.69 +					msg->addU8Fast(_PREHASH_PacketCount, 1);
    1.70 +					msg->addU8Fast(_PREHASH_PacketNumber, 0);
    1.71 +					msg->nextBlockFast(_PREHASH_ObjectData);
    1.72 +					msg->addU32Fast(_PREHASH_ObjectLocalID, mToTake[0]);
    1.73 +					gAgent.sendReliableMessage();
    1.74 +					mToTake.erase(mToTake.begin());
    1.75 +
    1.76 +					if (mToTake.size() % 10 == 0)
    1.77 +					{
    1.78 +						if (mToTake.size() == 0)
    1.79  						{
    1.80 -							mDonePrims.insert(localid);
    1.81 -							mToTake.push_back(localid);
    1.82 -						}
    1.83 -					}
    1.84 -					if (mToTake.size() > 0) mState = ZTS_TAKE;
    1.85 -					break;
    1.86 -					
    1.87 -				case ZTS_TAKE:
    1.88 -					if (mToTake.size() > 0)
    1.89 -					{
    1.90 -						std::vector<LLPointer<LLViewerInventoryItem> > inventory = findInventoryInFolder(mFolderName);
    1.91 -						mPackSize = mToTake.size() + inventory.size();
    1.92 -						
    1.93 -						LLMessageSystem* msg = gMessageSystem;
    1.94 -						msg->newMessageFast(_PREHASH_DeRezObject);
    1.95 -						msg->nextBlockFast(_PREHASH_AgentData);
    1.96 -						msg->addUUIDFast(_PREHASH_AgentID, gAgentID);
    1.97 -						msg->addUUIDFast(_PREHASH_SessionID, gAgentSessionID);
    1.98 -						msg->nextBlockFast(_PREHASH_AgentBlock);
    1.99 -						msg->addUUIDFast(_PREHASH_GroupID, LLUUID::null);
   1.100 -						msg->addU8Fast(_PREHASH_Destination, mDest);
   1.101 -						msg->addUUIDFast(_PREHASH_DestinationID, mTarget);
   1.102 -						LLUUID rand;
   1.103 -						rand.generate();
   1.104 -						msg->addUUIDFast(_PREHASH_TransactionID, rand);
   1.105 -						msg->addU8Fast(_PREHASH_PacketCount, 1);
   1.106 -						msg->addU8Fast(_PREHASH_PacketNumber, 0);
   1.107 -						msg->nextBlockFast(_PREHASH_ObjectData);
   1.108 -						msg->addU32Fast(_PREHASH_ObjectLocalID, mToTake[0]);
   1.109 -						gAgent.sendReliableMessage();
   1.110 -						mToTake.erase(mToTake.begin());
   1.111 -						
   1.112 -						if (mToTake.size() % 10 == 0)
   1.113 -						{
   1.114 -							if (mToTake.size() == 0)
   1.115 +							if (mPackage)
   1.116  							{
   1.117 -								if (mPackage)
   1.118 +								if (mPackageDest.notNull())
   1.119  								{
   1.120 -									if (mPackageDest != LLUUID::null)
   1.121 -									{
   1.122 -										mPeriod = 1.0f;
   1.123 -										mCountdown = 45; //reused for a basic timeout
   1.124 -										mState = ZTS_DROP;
   1.125 -									}
   1.126 -									else
   1.127 -									{
   1.128 -										report_to_nearby_chat("Ktake has taken all selected objects.");
   1.129 -										doZtCleanup();
   1.130 -										mState = ZTS_DONE;
   1.131 -									}
   1.132 +									mPeriod = 1.0f;
   1.133 +									mCountdown = 45; //reused for a basic timeout
   1.134 +									mState = ZTS_DROP;
   1.135  								}
   1.136  								else
   1.137  								{
   1.138 -									report_to_nearby_chat("Ztake has taken all selected objects. Say \"ztake off\" to deactivate ztake or select more objects to continue.");
   1.139 +									report_to_nearby_chat("Ktake has taken all selected objects.");
   1.140 +									doZtCleanup();
   1.141 +									mState = ZTS_DONE;
   1.142  								}
   1.143 -							} 
   1.144 +							}
   1.145  							else
   1.146  							{
   1.147 -								if (mPackage)
   1.148 -								{
   1.149 -									report_to_nearby_chat(llformat("Packager: %i objects left to take.", mToTake.size()));
   1.150 -								}
   1.151 -								else
   1.152 -								{
   1.153 -									report_to_nearby_chat(llformat("Ztake: %i objects left to take.", mToTake.size()));
   1.154 -								}
   1.155 +								report_to_nearby_chat("Ztake has taken all selected objects. Say \"ztake off\" to deactivate ztake or select more objects to continue.");
   1.156 +							}
   1.157 +						}
   1.158 +						else
   1.159 +						{
   1.160 +							if (mPackage)
   1.161 +							{
   1.162 +								report_to_nearby_chat(llformat("Packager: %i objects left to take.", mToTake.size()));
   1.163 +							}
   1.164 +							else
   1.165 +							{
   1.166 +								report_to_nearby_chat(llformat("Ztake: %i objects left to take.", mToTake.size()));
   1.167  							}
   1.168  						}
   1.169  					}
   1.170 +				}
   1.171 +				else
   1.172 +				{
   1.173 +					if (mPackage)
   1.174 +					{
   1.175 +						report_to_nearby_chat(llformat("Packager: no objects to take."));
   1.176 +						doZtCleanup();
   1.177 +					}
   1.178  					else
   1.179  					{
   1.180 -						if (mPackage)
   1.181 -						{
   1.182 -							report_to_nearby_chat(llformat("Packager: no objects to take."));
   1.183 -							doZtCleanup();
   1.184 +						report_to_nearby_chat(llformat("Ztake: no objects to take."));
   1.185 +					}
   1.186 +				}
   1.187 +				break;
   1.188 +
   1.189 +			case ZTS_DROP:
   1.190 +				{
   1.191 +					mCountdown --;
   1.192 +
   1.193 +					std::stack<LLViewerInventoryItem*> itemstack;
   1.194 +					std::vector<LLPointer<LLViewerInventoryItem> > inventory = findInventoryInFolder(mFolderName);
   1.195 +					for (std::vector<LLPointer<LLViewerInventoryItem> >::iterator it = inventory.begin(); it != inventory.end(); ++it)
   1.196 +					{
   1.197 +						LLViewerInventoryItem* item = *it;
   1.198 +						itemstack.push(item);
   1.199 +					}
   1.200 +
   1.201 +					if (itemstack.size() >= mPackSize || mCountdown == 0)
   1.202 +					{
   1.203 +						if (itemstack.size() < mPackSize) {
   1.204 +							report_to_nearby_chat("Phase 1 of the packager finished, but some items mave have been missed.");
   1.205  						}
   1.206  						else
   1.207  						{
   1.208 -							report_to_nearby_chat(llformat("Ztake: no objects to take."));
   1.209 -						}
   1.210 -					}
   1.211 -					break;
   1.212 -					
   1.213 -				case ZTS_DROP:
   1.214 -					{
   1.215 -						mCountdown --;
   1.216 -
   1.217 -						std::stack<LLViewerInventoryItem*> itemstack;
   1.218 -						std::vector<LLPointer<LLViewerInventoryItem> > inventory = findInventoryInFolder(mFolderName);
   1.219 -						for (std::vector<LLPointer<LLViewerInventoryItem> >::iterator it = inventory.begin(); it != inventory.end(); ++it)
   1.220 -						{
   1.221 -							LLViewerInventoryItem* item = *it;
   1.222 -							itemstack.push(item);
   1.223 +							report_to_nearby_chat("Phase 1 of the packager finished.");
   1.224  						}
   1.225  
   1.226 -						if (itemstack.size() >= mPackSize || mCountdown == 0)
   1.227 -						{
   1.228 -							if (itemstack.size() < mPackSize) {
   1.229 -								report_to_nearby_chat("Phase 1 of the packager finished, but some items mave have been missed.");
   1.230 -							}
   1.231 -							else
   1.232 -							{
   1.233 -								report_to_nearby_chat("Phase 1 of the packager finished.");
   1.234 -							}
   1.235 +						report_to_nearby_chat("Do not have the destination prim selected while transfer is running to reduce the chances of \"Inventory creation on in-world object failed.\"");
   1.236  
   1.237 -							report_to_nearby_chat("Do not have the destination prim selected while transfer is running to reduce the chances of \"Inventory creation on in-world object failed.\"");
   1.238 +						LLUUID sdest = LLUUID(mPackageDest);
   1.239 +						new JCZdrop(itemstack, sdest, mFolderName.c_str(), mPackageDest.asString().c_str(), true);
   1.240  
   1.241 -							LLUUID sdest = LLUUID(mPackageDest);
   1.242 -							new JCZdrop(itemstack, sdest, mFolderName.c_str(), mPackageDest.asString().c_str(), true);
   1.243 +						doZtCleanup();
   1.244 +						mState = ZTS_DONE;
   1.245 +					}
   1.246 +				}
   1.247 +				break;
   1.248  
   1.249 -							doZtCleanup();
   1.250 -							mState = ZTS_DONE;
   1.251 -						}
   1.252 -					}
   1.253 -					break;
   1.254 +			case ZTS_DONE:
   1.255 +				/* nothing left to do */
   1.256 +				break;
   1.257 +		}
   1.258  
   1.259 -				case ZTS_DONE:
   1.260 -					/* nothing left to do */
   1.261 -					break;
   1.262 -			}
   1.263 -		}
   1.264  		return mRunning;
   1.265  	}
   1.266  
   1.267 @@ -418,7 +417,6 @@
   1.268  public:
   1.269  	BOOL mRunning;
   1.270  
   1.271 -
   1.272  	TMZtake(const LLUUID& target) : LLEventTimer(0.33f), mTarget(target), mRunning(FALSE), mCountdown(5)
   1.273  	{
   1.274  		report_to_nearby_chat("Mtake activated. Taking selected in-world objects into inventory in: ");
   1.275 @@ -783,7 +781,7 @@
   1.276  					}
   1.277  					if ((!RlvActions::isRlvEnabled()) || (RlvActions::canSit(myObject, LLVector3::zero)))
   1.278  					{
   1.279 -						LLMessageSystem	*msg = gMessageSystem;
   1.280 +						LLMessageSystem* msg = gMessageSystem;
   1.281  						msg->newMessageFast(_PREHASH_AgentRequestSit);
   1.282  						msg->nextBlockFast(_PREHASH_AgentData);
   1.283  						msg->addUUIDFast(_PREHASH_AgentID, gAgentID);
   1.284 @@ -830,7 +828,6 @@
   1.285  				}
   1.286  				return false;
   1.287  			}
   1.288 -			
   1.289  			else if (command == sFSCmdLineGround())
   1.290  			{
   1.291  				LLVector3 agentPos = gAgent.getPositionAgent();
   1.292 @@ -911,7 +908,6 @@
   1.293  				F32 result = 0.f;
   1.294  				if (revised_text.length() > command.length() + 1)
   1.295  				{
   1.296 -
   1.297  					std::string expr = revised_text.substr(command.length()+1);
   1.298  					LLStringUtil::toUpper(expr);
   1.299  					std::string original_expr = expr;
   1.300 @@ -983,7 +979,7 @@
   1.301  
   1.302  			else if (command == sFSCmdLineClearChat())
   1.303  			{
   1.304 -				FSFloaterNearbyChat* chat = LLFloaterReg::getTypedInstance<FSFloaterNearbyChat>("fs_nearby_chat", LLSD());
   1.305 +				FSFloaterNearbyChat* chat = LLFloaterReg::findTypedInstance<FSFloaterNearbyChat>("fs_nearby_chat", LLSD());
   1.306  				if (chat)
   1.307  				{
   1.308  					chat->clearChatHistory();
   1.309 @@ -1237,11 +1233,9 @@
   1.310  								if (folder.notNull())
   1.311  								{
   1.312  									std::vector<U32> to_take;
   1.313 -									
   1.314  									std::string take;
   1.315  									while (i >> take)
   1.316  									{
   1.317 -										
   1.318  										if (!LLUUID::validate(take))
   1.319  										{
   1.320  											report_to_nearby_chat("Entered UUID is invalid! (Hint: use the \"copy key\" button in the build menu.)");
   1.321 @@ -1265,7 +1259,7 @@
   1.322  											}
   1.323  										}
   1.324  									}
   1.325 -									
   1.326 +
   1.327  									if (to_take.empty())
   1.328  									{
   1.329  										report_to_nearby_chat("No objects to take.");
   1.330 @@ -1346,8 +1340,10 @@
   1.331  				}
   1.332  				return false;
   1.333  			}
   1.334 -			else if (command == "kpackagerstop") {
   1.335 -				if (!cmd_line_mPackagerDest.isNull()) {
   1.336 +			else if (command == "kpackagerstop")
   1.337 +			{
   1.338 +				if (!cmd_line_mPackagerDest.isNull())
   1.339 +				{
   1.340  					cmd_line_mPackagerToTake.clear();
   1.341  					cmd_line_mPackagerTargetFolderName = "";
   1.342  					cmd_line_mPackagerTargetFolder.setNull();
   1.343 @@ -1371,7 +1367,6 @@
   1.344  							std::string take;
   1.345  							while (i >> take)
   1.346  							{
   1.347 -								
   1.348  								if (!LLUUID::validate(take))
   1.349  								{
   1.350  									report_to_nearby_chat("Entered UUID is invalid! (Hint: use the \"copy key\" button in the build menu.)");
   1.351 @@ -1395,7 +1390,7 @@
   1.352  									}
   1.353  								}
   1.354  							}
   1.355 -							
   1.356 +
   1.357  							if (to_take.empty())
   1.358  							{
   1.359  								report_to_nearby_chat("No objects to take.");
   1.360 @@ -1555,7 +1550,6 @@
   1.361  						S32 die_penetrated = 0;
   1.362  						while (die_iter <= dice)
   1.363  						{
   1.364 -
   1.365  							// Each die may have a different value rolled
   1.366  							result_per_die = 1 + (rand() % faces);
   1.367  							if (die_penetrated == 1)
   1.368 @@ -1774,17 +1768,16 @@
   1.369  	msg->sendReliable(gAgent.getRegionHost());
   1.370  }
   1.371  
   1.372 -bool cmdline_packager(const std::string& message, const LLUUID& fromID, const LLUUID& ownerID) {
   1.373 -	
   1.374 +bool cmdline_packager(const std::string& message, const LLUUID& fromID, const LLUUID& ownerID)
   1.375 +{
   1.376  	if (message.empty() || cmd_line_mPackagerDest.isNull() || fromID != cmd_line_mPackagerDest)
   1.377  	{
   1.378  		return false;
   1.379  	}
   1.380 -	
   1.381 +
   1.382  	std::string cmd = message.substr(0, 12);
   1.383 -	
   1.384 +
   1.385  	if (cmd == "kpackageradd") {
   1.386 -		//
   1.387  		std::string csv = message.substr(13, -1);
   1.388  		std::string::size_type start = 0;
   1.389  		std::string::size_type comma = 0;
   1.390 @@ -1821,7 +1814,7 @@
   1.391  	}
   1.392  	else if (cmd == "kpackagerend") {
   1.393  		
   1.394 -		report_to_nearby_chat("Packager: finilizing.");
   1.395 +		report_to_nearby_chat("Packager: finalizing.");
   1.396  		ztake = new JCZtake(cmd_line_mPackagerTargetFolder, true, cmd_line_mPackagerDest, cmd_line_mPackagerTargetFolderName, DRD_ACQUIRE_TO_AGENT_INVENTORY, false, cmd_line_mPackagerToTake);
   1.397  		cmd_line_mPackagerToTake.clear();
   1.398  		cmd_line_mPackagerTargetFolderName = "";

mercurial