本文整理汇总了C++中LLUUID::asString方法的典型用法代码示例。如果您正苦于以下问题:C++ LLUUID::asString方法的具体用法?C++ LLUUID::asString怎么用?C++ LLUUID::asString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLUUID
的用法示例。
在下文中一共展示了LLUUID::asString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: exportNextTexture
void LLObjectBackup::exportNextTexture()
{
if (mTexturesList.empty())
{
LL_INFOS("ObjectBackup") << "Finished exporting textures." << LL_ENDL;
return;
}
LLUUID id;
std::list<LLUUID>::iterator iter;
iter = mTexturesList.begin();
while (true)
{
if (iter == mTexturesList.end())
{
mNextTextureReady = true;
return;
}
id = (*iter);
if (id.isNull())
{
// NULL texture id: just remove and ignore.
mTexturesList.remove(id);
iter = mTexturesList.begin();
continue;
}
LLViewerTexture* imagep = LLViewerTextureManager::findTexture(id);
if (imagep != NULL)
{
S32 cur_discard = imagep->getDiscardLevel();
if (cur_discard > 0)
{
if (imagep->getBoostLevel() != LLViewerTexture::BOOST_PREVIEW)
{
// we want to force discard 0: this one does this.
imagep->setBoostLevel(LLViewerTexture::BOOST_PREVIEW);
}
}
else
{
break;
}
}
else
{
LL_WARNS("ObjectBackup") << "We *DON'T* have the texture " << id.asString() << LL_ENDL;
mNonExportedTextures |= TEXTURE_MISSING;
mTexturesList.remove(id);
return;
}
iter++;
}
mTexturesList.remove(id);
LL_INFOS("ObjectBackup") << "Requesting texture " << id << LL_ENDL;
LLImageJ2C* mFormattedImage = new LLImageJ2C;
CacheReadResponder* responder = new CacheReadResponder(id, mFormattedImage);
LLAppViewer::getTextureCache()->readFromCache(id, LLWorkerThread::PRIORITY_HIGH, 0, 999999, responder);
}
示例2: create
//static
void LLFloaterWebContent::create( const std::string &url, const std::string& target, const std::string& uuid, bool show_chrome, const LLRect& preferred_media_size)
{
lldebugs << "url = " << url << ", target = " << target << ", uuid = " << uuid << llendl;
std::string tag = target;
if(target.empty() || target == "_blank")
{
if(!uuid.empty())
{
tag = uuid;
}
else
{
// create a unique tag for this instance
LLUUID id;
id.generate();
tag = id.asString();
}
}
S32 browser_window_limit = gSavedSettings.getS32("WebContentWindowLimit");
if(LLFloaterReg::findInstance("web_content", tag) != NULL)
{
// There's already a web browser for this tag, so we won't be opening a new window.
}
else if(browser_window_limit != 0)
{
// showInstance will open a new window. Figure out how many web browsers are already open,
// and close the least recently opened one if this will put us over the limit.
LLFloaterReg::const_instance_list_t &instances = LLFloaterReg::getFloaterList("web_content");
lldebugs << "total instance count is " << instances.size() << llendl;
for(LLFloaterReg::const_instance_list_t::const_iterator iter = instances.begin(); iter != instances.end(); iter++)
{
lldebugs << " " << (*iter)->getKey() << llendl;
}
if(instances.size() >= (size_t)browser_window_limit)
{
// Destroy the least recently opened instance
(*instances.begin())->closeFloater();
}
}
LLFloaterWebContent *browser = dynamic_cast<LLFloaterWebContent*> (LLFloaterReg::showInstance("web_content", tag));
llassert(browser);
if(browser)
{
browser->mUUID = uuid;
// tell the browser instance to load the specified URL
browser->open_media(url, target);
LLViewerMedia::proxyWindowOpened(target, uuid);
browser->getChild<LLLayoutPanel>("status_bar")->setVisible(show_chrome);
browser->getChild<LLLayoutPanel>("nav_controls")->setVisible(show_chrome);
if (!show_chrome)
{
browser->setResizeLimits(100, 100);
}
if (!preferred_media_size.isEmpty())
{
//ignore x, y for now
browser->geometryChanged(browser->getRect().mLeft, browser->getRect().mBottom, preferred_media_size.getWidth(), preferred_media_size.getHeight());
}
}
}
示例3: setGroupID
void LLPanelGroupGeneral::setGroupID(const LLUUID& id)
{
LLPanelGroupTab::setGroupID(id);
// <FS> Get group key display and copy URI/name button pointers
LLTextEditor* groupKeyEditor = getChild<LLTextEditor>("group_key");
LLButton* copyURIButton = getChild<LLButton>("copy_uri");
LLButton* copyNameButton = getChild<LLButton>("copy_name");
// happens when a new group is created
// </FS>
if(id == LLUUID::null)
{
// <FS>
if (groupKeyEditor)
groupKeyEditor->setValue(LLSD());
if (copyURIButton)
copyURIButton->setEnabled(FALSE);
if (copyNameButton)
copyNameButton->setEnabled(FALSE);
// </FS>
reset();
return;
}
// <FS>
// fill in group key
if (groupKeyEditor)
groupKeyEditor->setValue(id.asString());
// activate copy URI button
if (copyURIButton)
copyURIButton->setEnabled(TRUE);
// </FS>
BOOL accept_notices = FALSE;
BOOL list_in_profile = FALSE;
LLGroupData data;
if(gAgent.getGroupData(mGroupID,data))
{
accept_notices = data.mAcceptNotices;
list_in_profile = data.mListInProfile;
}
mCtrlReceiveNotices = getChild<LLCheckBoxCtrl>("receive_notices");
if (mCtrlReceiveNotices)
{
mCtrlReceiveNotices->set(accept_notices);
mCtrlReceiveNotices->setEnabled(data.mID.notNull());
}
mCtrlListGroup = getChild<LLCheckBoxCtrl>("list_groups_in_profile");
if (mCtrlListGroup)
{
mCtrlListGroup->set(list_in_profile);
mCtrlListGroup->setEnabled(data.mID.notNull());
}
// <exodus>
mCtrlReceiveGroupChat = getChild<LLCheckBoxCtrl>("receive_chat");
if (mCtrlReceiveGroupChat)
{
if(data.mID.notNull())
{
mCtrlReceiveGroupChat->set(!exoGroupMuteList::instance().isMuted(data.mID));
}
mCtrlReceiveGroupChat->setEnabled(data.mID.notNull());
}
// </exodus>
mCtrlShowInGroupList->setEnabled(data.mID.notNull());
mActiveTitleLabel = getChild<LLTextBox>("active_title_label");
mComboActiveTitle = getChild<LLComboBox>("active_title");
mFounderName->setVisible(true);
mInsignia->setImageAssetID(LLUUID::null);
resetDirty();
activate();
}
示例4: exportTexture
bool FSFloaterObjectExport::exportTexture(const LLUUID& texture_id)
{
if(texture_id.isNull())
{
LL_WARNS("export") << "Attempted to export NULL texture." << LL_ENDL;
return false;
}
if (mTextureChecked.count(texture_id) != 0)
{
return mTextureChecked[texture_id];
}
if (gAssetStorage->mStaticVFS->getExists(texture_id, LLAssetType::AT_TEXTURE))
{
LL_DEBUGS("export") << "Texture " << texture_id.asString() << " is local static." << LL_ENDL;
// no need to save the texture data as the viewer already has it in a local file.
mTextureChecked[texture_id] = true;
return true;
}
//TODO: check for local file static texture. The above will only get the static texture in the static db, not individual textures.
LLViewerFetchedTexture* imagep = LLViewerTextureManager::getFetchedTexture(texture_id);
bool texture_export = false;
std::string name;
std::string description;
if (LLGridManager::getInstance()->isInSecondLife())
{
if (imagep->mComment.find("a") != imagep->mComment.end())
{
if (LLUUID(imagep->mComment["a"]) == gAgentID)
{
texture_export = true;
LL_DEBUGS("export") << texture_id << " pass texture export comment check." << LL_ENDL;
}
}
}
if (texture_export)
{
FSExportPermsCheck::canExportAsset(texture_id, &name, &description);
}
else
{
texture_export = FSExportPermsCheck::canExportAsset(texture_id, &name, &description);
}
mTextureChecked[texture_id] = texture_export;
if (!texture_export)
{
LL_DEBUGS("export") << "Texture " << texture_id << " failed export check." << LL_ENDL;
return false;
}
LL_DEBUGS("export") << "Loading image texture " << texture_id << LL_ENDL;
mRequestedTexture[texture_id].name = name;
mRequestedTexture[texture_id].description = description;
LLViewerFetchedTexture* image = LLViewerTextureManager::getFetchedTexture(texture_id, FTT_DEFAULT, MIPMAP_TRUE);
image->setBoostLevel(LLViewerTexture::BOOST_MAX_LEVEL);
image->forceToSaveRawImage(0);
image->setLoadedCallback(FSFloaterObjectExport::onImageLoaded, 0, TRUE, FALSE, this, &mCallbackTextureList);
return true;
}
示例5: inviteToSession
void LLIMMgr::inviteToSession(
const LLUUID& session_id,
const std::string& session_name,
const LLUUID& caller_id,
const std::string& caller_name,
EInstantMessage type,
EInvitationType inv_type,
const std::string& session_handle,
const std::string& session_uri)
{
//ignore invites from muted residents
if (LLMuteList::getInstance()->isMuted(caller_id))
{
return;
}
std::string notify_box_type;
BOOL ad_hoc_invite = FALSE;
if(type == IM_SESSION_P2P_INVITE)
{
//P2P is different...they only have voice invitations
notify_box_type = "VoiceInviteP2P";
}
else if ( gAgent.isInGroup(session_id) )
{
//only really old school groups have voice invitations
notify_box_type = "VoiceInviteGroup";
}
else if ( inv_type == INVITATION_TYPE_VOICE )
{
//else it's an ad-hoc
//and a voice ad-hoc
notify_box_type = "VoiceInviteAdHoc";
ad_hoc_invite = TRUE;
}
else if ( inv_type == INVITATION_TYPE_IMMEDIATE )
{
notify_box_type = "InviteAdHoc";
ad_hoc_invite = TRUE;
}
LLSD payload;
payload["session_id"] = session_id;
payload["session_name"] = session_name;
payload["caller_id"] = caller_id;
payload["caller_name"] = caller_name;
payload["type"] = type;
payload["inv_type"] = inv_type;
payload["session_handle"] = session_handle;
payload["session_uri"] = session_uri;
payload["notify_box_type"] = notify_box_type;
LLVoiceChannel* channelp = LLVoiceChannel::getChannelByID(session_id);
if (channelp && channelp->callStarted())
{
// you have already started a call to the other user, so just accept the invite
LLNotifications::instance().forceResponse(LLNotification::Params("VoiceInviteP2P").payload(payload), 0);
return;
}
if (type == IM_SESSION_P2P_INVITE || ad_hoc_invite)
{
if ( // we're rejecting non-friend voice calls and this isn't a friend
(gSavedSettings.getBOOL("VoiceCallsFriendsOnly") && (LLAvatarTracker::instance().getBuddyInfo(caller_id) == NULL))
)
{
// silently decline the call
LLNotifications::instance().forceResponse(LLNotification::Params("VoiceInviteP2P").payload(payload), 1);
return;
}
}
if ( !mPendingInvitations.has(session_id.asString()) )
{
if (caller_name.empty())
{
gCacheName->get(caller_id, true, // voice
boost::bind(&LLIMMgr::onInviteNameLookup, _1, _2, _3, payload));
}
else
{
LLSD args;
args["NAME"] = caller_name;
args["GROUP"] = session_name;
LLNotifications::instance().add(notify_box_type,
args,
payload,
&inviteUserResponse);
}
mPendingInvitations[session_id.asString()] = LLSD();
}
}
示例6: getMutelistString
// <FS:Ansariel> Server-side storage
std::string exoGroupMuteList::getMutelistString(const LLUUID& group) const
{
return std::string("Group:" + group.asString());
}
示例7: copyUUID
void LLInspectAvatar::copyUUID()
{
gClipboard.copyFromString(utf8str_to_wstring(mAvatarID.asString()));
}
示例8: resolveClientTag
LLSD FSData::resolveClientTag(LLUUID id, bool new_system, LLColor4 color){
//WS: Create a new LLSD based on the data from the LegacyClientList if
LLSD curtag;
curtag["uuid"]=id.asString();
curtag["id_based"]=new_system;
curtag["tex_color"]=color.getValue();
// If we don't want to display anything...return
if(gSavedSettings.getU32("FSClientTagsVisibility2") == 0)
{
return curtag;
}
//WS: Do we want to use Legacy Clienttags?
if(gSavedSettings.getU32("FSUseLegacyClienttags") > 0)
{
if(LegacyClientList.has(id.asString()))
{
curtag=LegacyClientList[id.asString()];
}
else
{
if(id == LLUUID("5d9581af-d615-bc16-2667-2f04f8eeefe4"))//green
{
curtag["name"]="Phoenix";
curtag["color"] = LLColor4::green.getValue();
curtag["alt"] = "ed63fbd0-589e-fe1d-a3d0-16905efaa96b";
}
else if(id == LLUUID("e35f7d40-6071-4b29-9727-5647bdafb5d5"))//white
{
curtag["name"] = "Phoenix";
curtag["color"] = LLColor4::white.getValue();
curtag["alt"] = "ed63fbd0-589e-fe1d-a3d0-16905efaa96b";
}
else if(id == LLUUID("ae4e92fb-023d-23ba-d060-3403f953ab1a"))//pink
{
curtag["name"] = "Phoenix";
curtag["color"] = LLColor4::pink.getValue();
curtag["alt"] = "ed63fbd0-589e-fe1d-a3d0-16905efaa96b";
}
else if(id == LLUUID("e71b780e-1a57-400d-4649-959f69ec7d51"))//red
{
curtag["name"] = "Phoenix";
curtag["color"] = LLColor4::red.getValue();
curtag["alt"] = "ed63fbd0-589e-fe1d-a3d0-16905efaa96b";
}
else if(id == LLUUID("c1c189f5-6dab-fc03-ea5a-f9f68f90b018"))//orange
{
curtag["name"] = "Phoenix";
curtag["color"] = LLColor4::orange.getValue();
curtag["alt"] = "ed63fbd0-589e-fe1d-a3d0-16905efaa96b";
}
else if(id == LLUUID("8cf0577c-22d3-6a73-523c-15c0a90d6c27")) //purple
{
curtag["name"] = "Phoenix";
curtag["color"] = LLColor4::purple.getValue();
curtag["alt"] = "ed63fbd0-589e-fe1d-a3d0-16905efaa96b";
}
else if(id == LLUUID("5f0e7c32-38c3-9214-01f0-fb16a5b40128"))//yellow
{
curtag["name"] = "Phoenix";
curtag["color"] = LLColor4::yellow.getValue();
curtag["alt"] = "ed63fbd0-589e-fe1d-a3d0-16905efaa96b";
}
else if(id == LLUUID("5bb6e4a6-8e24-7c92-be2e-91419bb0ebcb"))//blue
{
curtag["name"] = "Phoenix";
curtag["color"] = LLColor4::blue.getValue();
curtag["alt"] = "ed63fbd0-589e-fe1d-a3d0-16905efaa96b";
}
else if(id == LLUUID("ed63fbd0-589e-fe1d-a3d0-16905efaa96b"))//default (red)
{
curtag["name"] = "Phoenix";
curtag["color"] = LLColor4::red.getValue();
}
else if(id == LLUUID("c228d1cf-4b5d-4ba8-84f4-899a0796aa97"))//viewer 2.0
{
curtag["name"] = "LL Viewer";
}
else if(id == LLUUID("cc7a030f-282f-c165-44d2-b5ee572e72bf"))
{
curtag["name"] = "Imprudence";
}
else if(id == LLUUID("54d93609-1392-2a93-255c-a9dd429ecca5"))
{
curtag["name"] = "Emergence";
}
else if(id == LLUUID("8873757c-092a-98fb-1afd-ecd347566fcd"))
{
curtag["name"] = "Ascent";
}
else if(id == LLUUID("f25263b7-6167-4f34-a4ef-af65213b2e39"))
{
curtag["name"] = "Singularity";
}
if(curtag.has("name")) curtag["tpvd"]=true;
}
}
// Filtering starts here:
//.........这里部分代码省略.........
示例9: semi_transparent
LLGroupNotifyBox::LLGroupNotifyBox(const std::string& subject,
const std::string& message,
const std::string& from_name,
const LLUUID& group_id,
const LLUUID& group_insignia,
const std::string& group_name,
const LLDate& time_stamp,
const bool& has_inventory,
const std::string& inventory_name,
const LLSD& inventory_offer)
: LLPanel("groupnotify", LLGroupNotifyBox::getGroupNotifyRect(), BORDER_YES),
mAnimating(TRUE),
mTimer(),
mGroupID(group_id),
mHasInventory(has_inventory),
mInventoryOffer(NULL)
{
const S32 VPAD = 2;
const S32 TOP = getRect().getHeight() - 32; // Get past the top menu bar
const S32 BOTTOM_PAD = VPAD * 2;
const S32 BTN_TOP = BOTTOM_PAD + BTN_HEIGHT + VPAD;
const S32 RIGHT = getRect().getWidth() - HPAD - HPAD;
const S32 LINE_HEIGHT = 16;
const S32 LABEL_WIDTH = 64;
const S32 ICON_WIDTH = 64;
time_t timestamp = (time_t)time_stamp.secondsSinceEpoch();
if (!timestamp) time(×tamp);
std::string time_buf;
timeToFormattedString(timestamp, gSavedSettings.getString("TimestampFormat"), time_buf);
if (mHasInventory)
{
mInventoryOffer = new LLOfferInfo(inventory_offer);
}
setFocusRoot(TRUE);
setFollows(FOLLOWS_TOP|FOLLOWS_RIGHT);
setBackgroundVisible(TRUE);
setBackgroundOpaque(TRUE);
setBackgroundColor( gColors.getColor("GroupNotifyBoxColor") );
LLIconCtrl* icon;
LLTextEditor* text;
S32 y = TOP;
S32 x = HPAD + HPAD;
class NoticeText : public LLTextBox
{
public:
NoticeText(const std::string& name, const LLRect& rect, const std::string& text = LLStringUtil::null, const LLFontGL* font = NULL)
: LLTextBox(name, rect, text, font)
{
setHAlign(LLFontGL::RIGHT);
setFontShadow(LLFontGL::DROP_SHADOW_SOFT);
setBorderVisible(FALSE);
setColor( gColors.getColor("GroupNotifyTextColor") );
setBackgroundColor( gColors.getColor("GroupNotifyBoxColor") );
}
};
// Title
addChild(new NoticeText(std::string("title"),LLRect(x,y,RIGHT - HPAD,y - LINE_HEIGHT),LLTrans::getString("GroupNotifyGroupNotice"),LLFontGL::getFontSansSerifHuge()));
y -= llfloor(1.5f*LINE_HEIGHT);
x += HPAD + HPAD + ICON_WIDTH;
std::stringstream from;
from << LLTrans::getString("GroupNotifySentBy") << " " + from_name << LLTrans::getString(",") + " " << group_name;
addChild(new NoticeText(std::string("group"),LLRect(x,y,RIGHT - HPAD,y - LINE_HEIGHT),from.str(),LLFontGL::getFontSansSerif()));
y -= (LINE_HEIGHT + VPAD);
x = HPAD + HPAD;
// TODO: change this to be the group icon.
if (!group_insignia.isNull())
{
icon = new LLIconCtrl(std::string("icon"),
LLRect(x, y, x+ICON_WIDTH, y-ICON_WIDTH),
group_insignia.asString());
}
else
{
icon = new LLIconCtrl(std::string("icon"),
LLRect(x, y, x+ICON_WIDTH, y-ICON_WIDTH),
std::string("notify_box_icon.tga"));
}
icon->setMouseOpaque(FALSE);
addChild(icon);
x += HPAD + HPAD + ICON_WIDTH;
// If we have inventory with this message, leave room for the name.
S32 box_bottom = BTN_TOP + (mHasInventory ? (LINE_HEIGHT + 2*VPAD) : 0);
//.........这里部分代码省略.........
示例10: inviteToSession
void LLIMMgr::inviteToSession(
const LLUUID& session_id,
const std::string& session_name,
const LLUUID& caller_id,
const std::string& caller_name,
EInstantMessage type,
EInvitationType inv_type,
const std::string& session_handle,
const std::string& session_uri)
{
//ignore invites from muted residents
if (LLMuteList::getInstance()->isMuted(caller_id))
{
return;
}
std::string notify_box_type;
BOOL ad_hoc_invite = FALSE;
if(type == IM_SESSION_P2P_INVITE)
{
//P2P is different...they only have voice invitations
notify_box_type = "VoiceInviteP2P";
}
else if ( gAgent.isInGroup(session_id) )
{
//only really old school groups have voice invitations
notify_box_type = "VoiceInviteGroup";
}
else if ( inv_type == INVITATION_TYPE_VOICE )
{
//else it's an ad-hoc
//and a voice ad-hoc
notify_box_type = "VoiceInviteAdHoc";
ad_hoc_invite = TRUE;
}
else if ( inv_type == INVITATION_TYPE_IMMEDIATE )
{
notify_box_type = "InviteAdHoc";
ad_hoc_invite = TRUE;
}
LLSD payload;
payload["session_id"] = session_id;
payload["session_name"] = session_name;
payload["caller_id"] = caller_id;
payload["caller_name"] = caller_name;
payload["type"] = type;
payload["inv_type"] = inv_type;
payload["session_handle"] = session_handle;
payload["session_uri"] = session_uri;
payload["notify_box_type"] = notify_box_type;
LLVoiceChannel* channelp = LLVoiceChannel::getChannelByID(session_id);
if (channelp && channelp->callStarted())
{
// you have already started a call to the other user, so just accept the invite
LLNotifications::instance().forceResponse(LLNotification::Params("VoiceInviteP2P").payload(payload), 0);
return;
}
if (type == IM_SESSION_P2P_INVITE || ad_hoc_invite)
{
// is the inviter a friend?
if (LLAvatarTracker::instance().getBuddyInfo(caller_id) == NULL)
{
// if not, and we are ignoring voice invites from non-friends
// then silently decline
if (gSavedSettings.getBOOL("VoiceCallsFriendsOnly"))
{
// invite not from a friend, so decline
LLNotifications::instance().forceResponse(LLNotification::Params("VoiceInviteP2P").payload(payload), 1);
return;
}
}
}
if ( !mPendingInvitations.has(session_id.asString()) )
{
if (caller_name.empty())
{
gCacheName->getName(caller_id, onInviteNameLookup, new LLSD(payload));
}
else
{
LLSD args;
args["NAME"] = caller_name;
//args["GROUP"] = session_name;
LLGroupMgrGroupData* temp = LLGroupMgr::getInstance()->getGroupData(session_id);
bool waiting = false;
if(temp)
{
if (temp->isGroupPropertiesDataComplete())
{
args["GROUP"] = temp->mName;
}
else
{
waiting = true;
}
//.........这里部分代码省略.........
示例11: copy_group_profile_uri
static void copy_group_profile_uri(const LLUUID& id)
{
gViewerWindow->getWindow()->copyTextToClipboard(utf8str_to_wstring("secondlife:///app/group/"+id.asString()+"/about"));
}
示例12: variable_table_push
//.........这里部分代码省略.........
vector.pushvalue(L, value.mdV[i]);
}
block_variable_table.push(L);
}
break;
case MVT_LLVector4:
{
LLVector4 value;
msg->getVector4Fast(block_name, var_name, value, block_num);
LLLuaTable vector(L);
for(int i = 0; i < 4; i++)
{
vector.pushvalue(L, value.mV[i]);
}
block_variable_table.push(L);
}
break;
case MVT_LLQuaternion:
{
LLQuaternion value;
msg->getQuatFast(block_name, var_name, value, block_num);
LLLuaTable quat(L);
for(int i = 0; i < 4; i++)
{
quat.pushvalue(L, value.mQ[i]);
}
block_variable_table.push(L);
}
break;
case MVT_LLUUID:
{
LLUUID value;
msg->getUUIDFast(block_name, var_name, value, block_num);
block_variable_table.pushvalue(L, value.asString().c_str());
}
break;
case MVT_BOOL:
{
BOOL value;
msg->getBOOLFast(block_name, var_name, value, block_num);
block_variable_table.pushvalue(L, value);
}
break;
case MVT_IP_ADDR:
{
U32 value;
msg->getIPAddrFast(block_name, var_name, value, block_num);
block_variable_table.pushvalue(L, LLHost(value, 0).getIPString().c_str());
}
break;
case MVT_IP_PORT:
{
U16 value;
msg->getIPPort(block_name, var_name, value, block_num);
block_variable_table.pushvalue(L, value);
}
case MVT_VARIABLE:
case MVT_FIXED:
default:
{
S32 size = msg->getSize(block_name, block_num, var_name);
if(size)
{
std::ostringstream stream;
char* value = new char[size + 1];
msg->getBinaryDataFast(block_name, var_name, value, size, block_num);
示例13: getAssetData
// IW - uuid is passed by value to avoid side effects, please don't re-add &
void LLAssetStorage::getAssetData(const LLUUID uuid, LLAssetType::EType type, LLGetAssetCallback callback, void *user_data, BOOL is_priority)
{
LL_DEBUGS("AssetStorage") << "LLAssetStorage::getAssetData() - " << uuid << "," << LLAssetType::lookup(type) << llendl;
LL_DEBUGS("AssetStorage") << "ASSET_TRACE requesting " << uuid << " type " << LLAssetType::lookup(type) << llendl;
if (user_data)
{
// The *user_data should not be passed without a callback to clean it up.
llassert(callback != NULL)
}
if (mShutDown)
{
LL_DEBUGS("AssetStorage") << "ASSET_TRACE cancelled " << uuid << " type " << LLAssetType::lookup(type) << " shutting down" << llendl;
if (callback)
{
callback(mVFS, uuid, type, user_data, LL_ERR_ASSET_REQUEST_FAILED, LL_EXSTAT_NONE);
}
return;
}
if (uuid.isNull())
{
// Special case early out for NULL uuid and for shutting down
if (callback)
{
callback(mVFS, uuid, type, user_data, LL_ERR_ASSET_REQUEST_NOT_IN_DATABASE, LL_EXSTAT_NULL_UUID);
}
return;
}
/* <edit> */
if(std::find(mBlackListedAsset.begin(),mBlackListedAsset.end(),uuid) != mBlackListedAsset.end())
{
llinfos << "Blacklisted asset " << uuid.asString() << " was trying to be accessed!!!!!!" << llendl;
if (callback)
{
callback(mVFS, uuid, type, user_data, LL_ERR_ASSET_REQUEST_NOT_IN_DATABASE, LL_EXSTAT_NULL_UUID);
}
return;
}
/* </edit> */
// Try static VFS first.
if (findInStaticVFSAndInvokeCallback(uuid,type,callback,user_data))
{
LL_DEBUGS("AssetStorage") << "ASSET_TRACE asset " << uuid << " found in static VFS" << llendl;
return;
}
BOOL exists = mVFS->getExists(uuid, type);
LLVFile file(mVFS, uuid, type);
U32 size = exists ? file.getSize() : 0;
if (size > 0)
{
// we've already got the file
// theoretically, partial files w/o a pending request shouldn't happen
// unless there's a weird error
if (callback)
{
callback(mVFS, uuid, type, user_data, LL_ERR_NOERR, LL_EXSTAT_VFS_CACHED);
}
LL_DEBUGS("AssetStorage") << "ASSET_TRACE asset " << uuid << " found in VFS" << llendl;
}
else
{
if (exists)
{
llwarns << "Asset vfile " << uuid << ":" << type << " found with bad size " << file.getSize() << ", removing" << llendl;
file.remove();
}
BOOL duplicate = FALSE;
// check to see if there's a pending download of this uuid already
for (request_list_t::iterator iter = mPendingDownloads.begin();
iter != mPendingDownloads.end(); ++iter )
{
LLAssetRequest *tmp = *iter;
if ((type == tmp->getType()) && (uuid == tmp->getUUID()))
{
if (callback == tmp->mDownCallback && user_data == tmp->mUserData)
{
// this is a duplicate from the same subsystem - throw it away
llwarns << "Discarding duplicate request for asset " << uuid
<< "." << LLAssetType::lookup(type) << llendl;
return;
}
// this is a duplicate request
// queue the request, but don't actually ask for it again
duplicate = TRUE;
}
}
if (duplicate)
//.........这里部分代码省略.........
示例14: timestr
BOOL LLImageJ2COJ::encodeImpl(LLImageJ2C &base, const LLImageRaw &raw_image, const char* comment_text, F32 encode_time, BOOL reversible)
{
const S32 MAX_COMPS = 5;
opj_cparameters_t parameters; /* compression parameters */
opj_event_mgr_t event_mgr; /* event manager */
/*
configure the event callbacks (not required)
setting of each callback is optional
*/
memset(&event_mgr, 0, sizeof(opj_event_mgr_t));
event_mgr.error_handler = error_callback;
event_mgr.warning_handler = warning_callback;
event_mgr.info_handler = info_callback;
/* set encoding parameters to default values */
opj_set_default_encoder_parameters(¶meters);
parameters.cod_format = 0;
parameters.cp_disto_alloc = 1;
if (reversible)
{
parameters.tcp_numlayers = 1;
parameters.tcp_rates[0] = 0.0f;
}
else
{
parameters.tcp_numlayers = 5;
parameters.tcp_rates[0] = 1920.0f;
parameters.tcp_rates[1] = 480.0f;
parameters.tcp_rates[2] = 120.0f;
parameters.tcp_rates[3] = 30.0f;
parameters.tcp_rates[4] = 10.0f;
parameters.irreversible = 1;
if (raw_image.getComponents() >= 3)
{
parameters.tcp_mct = 1;
}
}
std::string comment_metadata;
if (!comment_text)
{
//Inserting owner id, upload time, and dimensions
//See http://wiki.secondlife.com/wiki/Texture_meta-data for details.
extern LLUUID gAgentID;
time_t now = time(NULL);
tm * ptime = gmtime(&now);
//std::string color_avg(llformat("c=%02x%02x%02x%02x")); //Perhaps do this some day...
std::string timestr(llformat("z=%04i%02i%02i%02i%02i%02i",ptime->tm_year+1900,ptime->tm_mon+1,ptime->tm_mday,ptime->tm_hour,ptime->tm_min,ptime->tm_sec));
comment_metadata=llformat("a=%s&%s&h=%u&w=%u",gAgentID.asString().c_str(),timestr.c_str(),(U32)raw_image.getHeight(),(U32)raw_image.getWidth());
parameters.cp_comment = (char *) comment_metadata.c_str();
}
else
{
// Awful hacky cast, too lazy to copy right now.
parameters.cp_comment = (char *) comment_text;
}
//
// Fill in the source image from our raw image
//
OPJ_COLOR_SPACE color_space = CLRSPC_SRGB;
opj_image_cmptparm_t cmptparm[MAX_COMPS];
opj_image_t * image = NULL;
S32 numcomps = llmin((S32)raw_image.getComponents(),(S32)MAX_COMPS); //Clamp avoid overrunning buffer -Shyotl
S32 width = raw_image.getWidth();
S32 height = raw_image.getHeight();
memset(&cmptparm[0], 0, MAX_COMPS * sizeof(opj_image_cmptparm_t));
for(S32 c = 0; c < numcomps; c++) {
cmptparm[c].prec = 8;
cmptparm[c].bpp = 8;
cmptparm[c].sgnd = 0;
cmptparm[c].dx = parameters.subsampling_dx;
cmptparm[c].dy = parameters.subsampling_dy;
cmptparm[c].w = width;
cmptparm[c].h = height;
}
/* create the image */
image = opj_image_create(numcomps, &cmptparm[0], color_space);
image->x1 = width;
image->y1 = height;
S32 i = 0;
const U8 *src_datap = raw_image.getData();
for (S32 y = height - 1; y >= 0; y--)
{
for (S32 x = 0; x < width; x++)
{
const U8 *pixel = src_datap + (y*width + x) * numcomps;
for (S32 c = 0; c < numcomps; c++)
{
image->comps[c].data[i] = *pixel;
pixel++;
}
i++;
//.........这里部分代码省略.........
示例15: addAnimation
void AnimationExplorer::addAnimation(const LLUUID& id, const LLUUID& played_by, F64 time)
{
// don't add animations that are played by ourselves when the filter box is checked
if(played_by==gAgentAvatarp->getID())
{
if(mNoOwnedAnimationsCheckBox->getValue().asBoolean())
{
return;
}
}
// set object name to UUID at first
std::string playedByName=played_by.asString();
// find out if the object is still in reach
LLViewerObject* vo=gObjectList.findObject(played_by);
if(vo)
{
// if it was an avatar, get the name here
if(vo->isAvatar())
{
playedByName=std::string(vo->getNVPair("FirstName")->getString())+" "+
std::string(vo->getNVPair("LastName")->getString());
}
// not an avatar, do a lookup by UUID
else
{
// find out if we know the name to this UUID already
std::map<LLUUID,std::string>::iterator iter=mKnownIDs.find(played_by);
// if we don't know it yet, start a lookup
if(iter==mKnownIDs.end())
{
// if we are not already looking up this object's name, send a request out
if(std::find(mRequestedIDs.begin(),mRequestedIDs.end(),played_by)==mRequestedIDs.end())
{
// remember which object names we already requested
mRequestedIDs.push_back(played_by);
LLMessageSystem* msg = gMessageSystem;
msg->newMessageFast(_PREHASH_ObjectSelect);
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
msg->nextBlockFast(_PREHASH_ObjectData);
msg->addU32Fast(_PREHASH_ObjectLocalID,vo->getLocalID());
msg->sendReliable(gAgentAvatarp->getRegion()->getHost());
msg->newMessageFast(_PREHASH_ObjectDeselect);
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
msg->nextBlockFast(_PREHASH_ObjectData);
msg->addU32Fast(_PREHASH_ObjectLocalID,vo->getLocalID());
msg->sendReliable(gAgentAvatarp->getRegion()->getHost());
}
}
else
{
// we know the name already
playedByName=mKnownIDs[played_by];
}
}
}
// insert the item into the scroll list
LLSD item;
item["columns"][0]["column"]="played_by";
item["columns"][0]["value"]=playedByName;
item["columns"][1]["column"]="played";
item["columns"][1]["value"]=LLTrans::getString("animation_explorer_still_playing");
item["columns"][2]["column"]="timestamp";
item["columns"][2]["value"]=time;
item["columns"][3]["column"]="animation_id";
item["columns"][3]["value"]=id;
item["columns"][4]["column"]="object_id";
item["columns"][4]["value"]=played_by;
mAnimationScrollList->addElement(item,ADD_TOP);
}