예제 #1
0
// static
BOOL LLKeyTool::callback(LLUUID id, LLKeyType key_type, LLAssetType::EType asset_type, BOOL is)
{
	BOOL wanted = FALSE;
	std::list<LLKeyTool*>::iterator kt_iter = mKeyTools.begin();
	std::list<LLKeyTool*>::iterator kt_end = mKeyTools.end();
	for( ; kt_iter != kt_end; ++kt_iter)
	{
		if((*kt_iter)->mKey == id)
		{
			LLKeyTool* tool = (*kt_iter);
			BOOL call = FALSE;

			if(key_type != KT_ASSET)
			{
				if(tool->mKeyTypesDone.find(key_type) == tool->mKeyTypesDone.end())
				{
					tool->mKeyTypesDone[key_type] = TRUE;
					call = TRUE;
				}
			}
			else // asset type
			{
				if(tool->mAssetTypesDone.find(asset_type) == tool->mAssetTypesDone.end())
				{
					tool->mAssetTypesDone[asset_type] = TRUE;
					call = TRUE;
				}
			}
			
			if(call)
			{
				tool->mKeyTypesDone[key_type] = is;
				llinfos << tool->mKey << (is ? " is " : " is not ") << aWhat(key_type, asset_type) << llendl;
				if(tool->mCallback)
				{
					tool->mCallback(id, key_type, asset_type, is, tool->mUserData);
					wanted = TRUE;
				}
				if(key_type == KT_TASK)
					tool->mObjectPropertiesFamilyRequests--;
				else if(key_type == KT_PARCEL)
					tool->mParcelInfoRequests--;
				else if(key_type == KT_ASSET)
				{
					if(asset_type == LLAssetType::AT_TEXTURE)
						tool->mImageRequests--;
					else
						tool->mTransferRequests--;
				}
			}
		}
	}
	return wanted;
}
예제 #2
0
// static
void LLKeyTool::callback(LLUUID id, LLKeyType key_type, LLAssetType::EType asset_type, BOOL is)
{
	std::list<LLKeyTool*>::iterator kt_iter = mKeyTools.begin();
	std::list<LLKeyTool*>::iterator kt_end = mKeyTools.end();
	for( ; kt_iter != kt_end; ++kt_iter)
	{
		if((*kt_iter)->mKey == id)
		{
			LLKeyTool* tool = (*kt_iter);
			BOOL call = FALSE;

			if(key_type != KT_ASSET)
			{
				if(tool->mKeyTypesDone.find(key_type) == tool->mKeyTypesDone.end())
				{
					tool->mKeyTypesDone[key_type] = TRUE;
					call = TRUE;
				}
			}
			else // asset type
			{
				if(tool->mAssetTypesDone.find(asset_type) == tool->mAssetTypesDone.end())
				{
					tool->mAssetTypesDone[asset_type] = TRUE;
					call = TRUE;
				}
			}
			
			if(call)
			{
				tool->mKeyTypesDone[key_type] = is;
				llinfos << tool->mKey << (is ? " is " : " is not ") << aWhat(key_type, asset_type) << llendl;
				if(tool->mCallback)
				{
					tool->mCallback(id, key_type, asset_type, is, tool->mUserData);
				}
			}
		}
	}
}