本文整理汇总了C++中LLUUID::generate方法的典型用法代码示例。如果您正苦于以下问题:C++ LLUUID::generate方法的具体用法?C++ LLUUID::generate怎么用?C++ LLUUID::generate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLUUID
的用法示例。
在下文中一共展示了LLUUID::generate方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: mt
LLViewerObject *LLViewerObjectList::createObjectViewer(const LLPCode pcode, LLViewerRegion *regionp)
{
LLMemType mt(LLMemType::MTYPE_OBJECT);
LLUUID fullid;
fullid.generate();
LLViewerObject *objectp = LLViewerObject::createObject(fullid, pcode, regionp);
if (!objectp)
{
// llwarns << "Couldn't create object of type " << LLPrimitive::pCodeToString(pcode) << llendl;
return NULL;
}
mUUIDObjectMap[fullid] = objectp;
if(objectp->isAvatar())
{
LLVOAvatar *pAvatar = dynamic_cast<LLVOAvatar*>(objectp);
if(pAvatar)
mUUIDAvatarMap[fullid] = pAvatar;
}
mObjects.push_back(objectp);
updateActive(objectp);
return objectp;
}
示例2: onClickHop
//static
void FloaterHop::onClickHop(void* userdata)
{
FloaterHop* instance = (FloaterHop*) userdata;
std::vector<std::string> args;
if(gSavedSettings.getBOOL("HopAutoLogin"))
{
args.push_back("-autologin");
}
bool keepalive = gSavedSettings.getBOOL("HopKeepOldSessionAlive");
if(keepalive)
{
args.push_back("-multiple");
}
else
{
LLUUID cookie;
cookie.generate();
instance->mHopTimer = new HopTimer(cookie.asString(), instance);
args.push_back("-isrelogsession");
args.push_back(cookie.asString());
}
args.push_back(instance->mSLURL.getSLURLString());
// this is under development and likely changing
if(Teapot::getInstance()->launchNewViewer(args))
{
if(keepalive)
{
instance->closeFloater();
}
}
}
示例3:
CopyLibraryCategoryCommand::CopyLibraryCategoryCommand(const LLUUID& source_id,
const LLUUID& dest_id,
LLPointer<LLInventoryCallback> callback,
bool copy_subfolders):
AISCommand(callback)
{
std::string cap;
if (!getLibCap(cap))
{
LL_WARNS() << "No cap found" << LL_ENDL;
return;
}
LL_DEBUGS("Inventory") << "Copying library category: " << source_id << " => " << dest_id << LL_ENDL;
LLUUID tid;
tid.generate();
std::string url = cap + std::string("/category/") + source_id.asString() + "?tid=" + tid.asString();
if (!copy_subfolders)
{
url += ",depth=0";
}
LL_INFOS() << url << LL_ENDL;
LLCurl::ResponderPtr responder = this;
LLSD headers;
F32 timeout = HTTP_REQUEST_EXPIRY_SECS;
command_func_type cmd = boost::bind(&LLHTTPClient::copy, url, dest_id.asString(), responder, headers, timeout);
setCommandFunc(cmd);
}
示例4: send_estate_message
static void send_estate_message(
const char* request,
const LLUUID &target)
{
LLMessageSystem* msg = gMessageSystem;
LLUUID invoice;
// This seems to provide an ID so that the sim can say which request it's
// replying to. I think this can be ignored for now.
invoice.generate();
llinfos << "Sending estate request '" << request << "'" << llendl;
msg->newMessage("EstateOwnerMessage");
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
msg->addUUIDFast(_PREHASH_TransactionID, LLUUID::null); //not used
msg->nextBlock("MethodData");
msg->addString("Method", request);
msg->addUUID("Invoice", invoice);
// Agent id
msg->nextBlock("ParamList");
msg->addString("Parameter", gAgent.getID().asString().c_str());
// Target
msg->nextBlock("ParamList");
msg->addString("Parameter", target.asString().c_str());
msg->sendReliable(gAgent.getRegion()->getHost());
}
示例5: mt
LLViewerObject *LLViewerObjectList::createObject(const LLPCode pcode, LLViewerRegion *regionp,
const LLUUID &uuid, const U32 local_id, const LLHost &sender)
{
LLMemType mt(LLMemType::MTYPE_OBJECT);
LLFastTimer t(LLFastTimer::FTM_CREATE_OBJECT);
LLUUID fullid;
if (uuid == LLUUID::null)
{
fullid.generate();
}
else
{
fullid = uuid;
}
LLViewerObject *objectp = LLViewerObject::createObject(fullid, pcode, regionp);
if (!objectp)
{
// llwarns << "Couldn't create object of type " << LLPrimitive::pCodeToString(pcode) << " id:" << fullid << llendl;
return NULL;
}
mUUIDObjectMap[fullid] = objectp;
setUUIDAndLocal(fullid,
local_id,
gMessageSystem->getSenderIP(),
gMessageSystem->getSenderPort());
mObjects.put(objectp);
updateActive(objectp);
return objectp;
}
示例6: clearParcelAccessList
void LLFloaterAuction::clearParcelAccessList(LLParcel* parcel, LLViewerRegion* region, U32 list)
{
if (!region || !parcel) return;
LLUUID transactionUUID;
transactionUUID.generate();
LLMessageSystem* msg = gMessageSystem;
msg->newMessageFast(_PREHASH_ParcelAccessListUpdate);
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID() );
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID() );
msg->nextBlockFast(_PREHASH_Data);
msg->addU32Fast(_PREHASH_Flags, list);
msg->addS32(_PREHASH_LocalID, parcel->getLocalID() );
msg->addUUIDFast(_PREHASH_TransactionID, transactionUUID);
msg->addS32Fast(_PREHASH_SequenceID, 1); // sequence_id
msg->addS32Fast(_PREHASH_Sections, 0); // num_sections
// pack an empty block since there will be no data
msg->nextBlockFast(_PREHASH_List);
msg->addUUIDFast(_PREHASH_ID, LLUUID::null );
msg->addS32Fast(_PREHASH_Time, 0 );
msg->addU32Fast(_PREHASH_Flags, 0 );
msg->sendReliable( region->getHost() );
}
示例7: create
//static
void LLFloaterWebContent::create( const std::string &url, const std::string& target, const std::string& uuid )
{
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);
}
}
示例8: aDay
void SDTestObject::test<2>()
// setting and fetching scalar types
{
SDCleanupCheck check;
LLSD v;
v = true; ensureTypeAndValue("set true", v, true);
v = false; ensureTypeAndValue("set false", v, false);
v = true; ensureTypeAndValue("set true again", v, true);
v = 42; ensureTypeAndValue("set to 42", v, 42);
v = 0; ensureTypeAndValue("set to zero", v, 0);
v = -12345; ensureTypeAndValue("set to neg", v, -12345);
v = 2000000000; ensureTypeAndValue("set to big", v, 2000000000);
v = 3.14159265359;
ensureTypeAndValue("set to pi", v, 3.14159265359);
ensure_not_equals("isn't float", v.asReal(),
(float)3.14159265359);
v = 6.7e256; ensureTypeAndValue("set to big", v, 6.7e256);
LLUUID nullUUID;
LLUUID newUUID;
newUUID.generate();
v = nullUUID; ensureTypeAndValue("set to null UUID", v, nullUUID);
v = newUUID; ensureTypeAndValue("set to new UUID", v, newUUID);
v = nullUUID; ensureTypeAndValue("set to null again", v, nullUUID);
// strings must be tested with two types of string objects
std::string s = "now is the time";
const char* cs = "for all good zorks";
v = s; ensureTypeAndValue("set to std::string", v, s);
v = cs; ensureTypeAndValue("set to const char*", v, cs);
LLDate epoch;
LLDate aDay("2001-10-22T10:11:12.00Z");
v = epoch; ensureTypeAndValue("set to epoch", v, epoch);
v = aDay; ensureTypeAndValue("set to a day", v, aDay);
LLURI path("http://slurl.com/secondlife/Ambleside/57/104/26/");
v = path; ensureTypeAndValue("set to a uri", v, path);
const char source[] = "once in a blue moon";
std::vector<U8> data;
copy(&source[0], &source[sizeof(source)], back_inserter(data));
v = data; ensureTypeAndValue("set to data", v, data);
v.clear();
ensure("reset to undefined", v.type() == LLSD::TypeUndefined);
}
示例9:
LLHUDEffect *LLHUDManager::createViewerEffect(const U8 type, BOOL send_to_sim, BOOL originated_here)
{
// SJB: DO NOT USE addHUDObject!!! Not all LLHUDObjects are LLHUDEffects!
LLHUDEffect *hep = LLHUDObject::addHUDEffect(type);
if (!hep)
{
return NULL;
}
LLUUID tmp;
tmp.generate();
hep->setID(tmp);
hep->setNeedsSendToSim(send_to_sim);
hep->setOriginatedHere(originated_here);
mHUDEffects.put(hep);
return hep;
}
示例10:
control_group()
{
mCG = new LLControlGroup;
LLUUID random;
random.generate();
// generate temp dir
std::ostringstream oStr;
oStr << "/tmp/llcontrol-test-" << random << "/";
mTestConfigDir = oStr.str();
mTestConfigFile = mTestConfigDir + "settings.xml";
LLFile::mkdir(mTestConfigDir);
LLSD config;
config["TestSetting"]["Comment"] = "Dummy setting used for testing";
config["TestSetting"]["Persist"] = 1;
config["TestSetting"]["Type"] = "U32";
config["TestSetting"]["Value"] = 12;
writeSettingsFile(config);
}
示例11: updateGlobalNetList
//static
void LLFloaterMessageLog::updateGlobalNetList(bool starting)
{
//something tells me things aren't deallocated properly here, but
//valgrind isn't complaining
// Update circuit data of net list items
std::vector<LLCircuitData*> circuits = gMessageSystem->getCircuit()->getCircuitDataList();
std::vector<LLCircuitData*>::iterator circuits_end = circuits.end();
for(std::vector<LLCircuitData*>::iterator iter = circuits.begin(); iter != circuits_end; ++iter)
{
LLNetListItem* itemp = findNetListItem((*iter)->getHost());
if(!itemp)
{
LLUUID id; id.generate();
itemp = new LLNetListItem(id);
sNetListItems.push_back(itemp);
}
itemp->mCircuitData = (*iter);
}
// Clear circuit data of items whose circuits are gone
std::list<LLNetListItem*>::iterator items_end = sNetListItems.end();
for(std::list<LLNetListItem*>::iterator iter = sNetListItems.begin(); iter != items_end; ++iter)
{
if(std::find(circuits.begin(), circuits.end(), (*iter)->mCircuitData) == circuits.end())
(*iter)->mCircuitData = NULL;
}
// Remove net list items that are totally useless now
for(std::list<LLNetListItem*>::iterator iter = sNetListItems.begin(); iter != sNetListItems.end();)
{
if((*iter)->mCircuitData == NULL)
{
delete *iter;
iter = sNetListItems.erase(iter);
}
else ++iter;
}
if(!starting)
{
sInstance->refreshNetList();
sInstance->refreshNetInfo(FALSE);
}
}
示例12: requestTransfer
void LLTransferTargetChannel::requestTransfer(
const LLTransferSourceParams& source_params,
const LLTransferTargetParams& target_params,
const F32 priority)
{
LLUUID id;
id.generate();
LLTransferTarget* ttp = LLTransferTarget::createTarget(
target_params.getType(),
id,
source_params.getType());
if (!ttp)
{
llwarns << "LLTransferManager::requestTransfer aborting due to target creation failure!" << llendl;
return;
}
ttp->applyParams(target_params);
addTransferTarget(ttp);
sendTransferRequest(ttp, source_params, priority);
}
示例13: onClickIM
void lggIrcProfileFloater::onClickIM(void* data)
{
lggIrcProfileFloater* self = (lggIrcProfileFloater*)data;
LLUUID uid;
uid.generate(self->myLLSDdata["NICK"].asString()+"lgg"+self->myLLSDdata["RCHANNEL"].asString());
LLUUID computed_session_id=LLIMMgr::computeSessionID(IM_PRIVATE_IRC,uid);
if(!gIMMgr->hasSession(computed_session_id))
{
make_ui_sound("UISndNewIncomingIMSession");
gIMMgr->addSession(
llformat("%s",self->myLLSDdata["NICK"].asString().c_str()),IM_PRIVATE_IRC,uid);
}else
{
}
self->close();
}
示例14: beta
void SDTestObject::test<5>()
// conversion of String to and from UUID, Date and URI.
{
SDCleanupCheck check;
LLSD v;
LLUUID nullUUID;
LLUUID someUUID;
someUUID.generate();
v = nullUUID; checkRoundTrip("null uuid", v,
"00000000-0000-0000-0000-000000000000", nullUUID);
v = someUUID; checkRoundTrip("random uuid", v, 0, someUUID);
LLDate epoch;
LLDate beta("2003-04-30T04:00:00Z");
LLDate oneOh("2003-06-23T04:00:00Z");
v = epoch; checkRoundTrip("epoch date", v, 0, epoch);
v = beta; checkRoundTrip("beta date", v,
"2003-04-30T04:00:00Z", beta);
v = oneOh; checkRoundTrip("1.0 date", v,
"2003-06-23T04:00:00Z", oneOh);
LLURI empty;
LLURI path("http://slurl.com/secondlife/Ambleside/57/104/26/");
LLURI mail("mailto:[email protected]");
v = empty; checkRoundTrip("empty URI", v, 0, empty);
v = path; checkRoundTrip("path URI", v,
"http://slurl.com/secondlife/Ambleside/57/104/26/",
path);
v = mail; checkRoundTrip("mail URI", v,
"mailto:[email protected]", mail);
}
示例15: processChat
void LLNearbyChatHandler::processChat(const LLChat& chat_msg, const LLSD &args)
{
if(chat_msg.mMuted == TRUE)
return;
if(chat_msg.mSourceType == CHAT_SOURCE_AGENT && chat_msg.mFromID.notNull())
LLRecentPeople::instance().add(chat_msg.mFromID);
if(chat_msg.mText.empty())
return;//don't process empty messages
LLChat& tmp_chat = const_cast<LLChat&>(chat_msg);
LLNearbyChat* nearby_chat = LLFloaterReg::getTypedInstance<LLNearbyChat>("nearby_chat", LLSD());
{
//sometimes its usefull to have no name at all...
//if(tmp_chat.mFromName.empty() && tmp_chat.mFromID!= LLUUID::null)
// tmp_chat.mFromName = tmp_chat.mFromID.asString();
}
nearby_chat->addMessage(chat_msg, true, args);
if( nearby_chat->getVisible()
|| ( chat_msg.mSourceType == CHAT_SOURCE_AGENT
&& gSavedSettings.getBOOL("UseChatBubbles") ) )
return;//no need in toast if chat is visible or if bubble chat is enabled
// Handle irc styled messages for toast panel
if (tmp_chat.mChatStyle == CHAT_STYLE_IRC)
{
if(!tmp_chat.mFromName.empty())
tmp_chat.mText = tmp_chat.mFromName + tmp_chat.mText.substr(3);
else
tmp_chat.mText = tmp_chat.mText.substr(3);
}
// arrange a channel on a screen
if(!mChannel->getVisible())
{
initChannel();
}
/*
//comment all this due to EXT-4432
..may clean up after some time...
//only messages from AGENTS
if(CHAT_SOURCE_OBJECT == chat_msg.mSourceType)
{
if(chat_msg.mChatType == CHAT_TYPE_DEBUG_MSG)
return;//ok for now we don't skip messeges from object, so skip only debug messages
}
*/
LLUUID id;
id.generate();
LLNearbyChatScreenChannel* channel = dynamic_cast<LLNearbyChatScreenChannel*>(mChannel);
if(channel)
{
LLSD notification;
notification["id"] = id;
notification["message"] = chat_msg.mText;
notification["from"] = chat_msg.mFromName;
notification["from_id"] = chat_msg.mFromID;
notification["time"] = chat_msg.mTime;
notification["source"] = (S32)chat_msg.mSourceType;
notification["chat_type"] = (S32)chat_msg.mChatType;
notification["chat_style"] = (S32)chat_msg.mChatStyle;
std::string r_color_name = "White";
F32 r_color_alpha = 1.0f;
LLViewerChat::getChatColor( chat_msg, r_color_name, r_color_alpha);
notification["text_color"] = r_color_name;
notification["color_alpha"] = r_color_alpha;
notification["font_size"] = (S32)LLViewerChat::getChatFontSize() ;
channel->addNotification(notification);
}
}