本文整理汇总了C++中LLMessageSystem类的典型用法代码示例。如果您正苦于以下问题:C++ LLMessageSystem类的具体用法?C++ LLMessageSystem怎么用?C++ LLMessageSystem使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了LLMessageSystem类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LLMapLayerResponder
// public
void LLWorldMap::sendMapLayerRequest()
{
if (!gAgent.getRegion()) return;
LLSD body;
body["Flags"] = mCurrentMap;
std::string url = gAgent.getRegion()->getCapability(
gAgent.isGodlike() ? "MapLayerGod" : "MapLayer");
if (!url.empty())
{
llinfos << "LLWorldMap::sendMapLayerRequest via capability" << llendl;
LLHTTPClient::post(url, body, new LLMapLayerResponder());
}
else
{
llinfos << "LLWorldMap::sendMapLayerRequest via message system" << llendl;
LLMessageSystem* msg = gMessageSystem;
S32 layer = mCurrentMap;
// Request for layer
msg->newMessageFast(_PREHASH_MapLayerRequest);
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
msg->addU32Fast(_PREHASH_Flags, layer);
msg->addU32Fast(_PREHASH_EstateID, 0); // Filled in on sim
msg->addBOOLFast(_PREHASH_Godlike, FALSE); // Filled in on sim
gAgent.sendReliableMessage();
if (mRequestLandForSale)
{
msg->newMessageFast(_PREHASH_MapLayerRequest);
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
msg->addU32Fast(_PREHASH_Flags, 2);
msg->addU32Fast(_PREHASH_EstateID, 0); // Filled in on sim
msg->addBOOLFast(_PREHASH_Godlike, FALSE); // Filled in on sim
gAgent.sendReliableMessage();
}
}
}
示例2: sendItemRequest
void LLWorldMapMessage::sendItemRequest(U32 type, U64 handle)
{
//LL_INFOS("World Map") << "Send item request : type = " << type << LL_ENDL;
LLMessageSystem* msg = gMessageSystem;
msg->newMessageFast(_PREHASH_MapItemRequest);
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
msg->addU32Fast(_PREHASH_Flags, LAYER_FLAG);
msg->addU32Fast(_PREHASH_EstateID, 0); // Filled in on sim
msg->addBOOLFast(_PREHASH_Godlike, FALSE); // Filled in on sim
msg->nextBlockFast(_PREHASH_RequestData);
msg->addU32Fast(_PREHASH_ItemType, type);
msg->addU64Fast(_PREHASH_RegionHandle, handle); // If zero, filled in on sim
gAgent.sendReliableMessage();
}
示例3: switch
void ImportTracker::get_update(S32 newid, BOOL justCreated, BOOL createSelected)
{
switch (state)
{
//lgg crap
case WAND:
if(justCreated && createSelected)
{
numberExpected--;
if(numberExpected<=0)
state=IDLE;
LLMessageSystem* msg = gMessageSystem;
msg->newMessageFast(_PREHASH_ObjectImage);
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
msg->nextBlockFast(_PREHASH_ObjectData);
msg->addU32Fast(_PREHASH_ObjectLocalID, (U32)newid);
msg->addStringFast(_PREHASH_MediaURL, NULL);
LLPrimitive obj;
obj.setNumTEs(U8(10));
S32 shinnyLevel = 0;
if(gSavedSettings.getString("EmeraldBuildPrefs_Shiny")== "None") shinnyLevel = 0;
if(gSavedSettings.getString("EmeraldBuildPrefs_Shiny")== "Low") shinnyLevel = 1;
if(gSavedSettings.getString("EmeraldBuildPrefs_Shiny")== "Medium") shinnyLevel = 2;
if(gSavedSettings.getString("EmeraldBuildPrefs_Shiny")== "High") shinnyLevel = 3;
for (int i = 0; i < 10; i++)
{
LLTextureEntry tex = LLTextureEntry(LLUUID(gSavedSettings.getString("EmeraldBuildPrefs_Texture")));
tex.setColor(gSavedSettings.getColor4("EmeraldBuildPrefs_Color"));
tex.setAlpha(1.0 - ((gSavedSettings.getF32("EmeraldBuildPrefs_Alpha")) / 100.0));
tex.setGlow(gSavedSettings.getF32("EmeraldBuildPrefs_Glow"));
if(gSavedSettings.getBOOL("EmeraldBuildPrefs_FullBright"))
{
tex.setFullbright(TEM_FULLBRIGHT_MASK);
}
tex.setShiny((U8) shinnyLevel & TEM_SHINY_MASK);
obj.setTE(U8(i), tex);
}
obj.packTEMessage(gMessageSystem);
msg->sendReliable(gAgent.getRegion()->getHost());
msg->newMessage("ObjectFlagUpdate");
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID() );
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
msg->addU32Fast(_PREHASH_ObjectLocalID, (U32)newid );
msg->addBOOLFast(_PREHASH_UsePhysics, gSavedSettings.getBOOL("EmeraldBuildPrefs_Physical"));
msg->addBOOL("IsTemporary", gSavedSettings.getBOOL("EmeraldBuildPrefs_Temporary"));
msg->addBOOL("IsPhantom", gSavedSettings.getBOOL("EmeraldBuildPrefs_Phantom") );
msg->addBOOL("CastsShadows", true );
msg->sendReliable(gAgent.getRegion()->getHost());
if(gSavedSettings.getBOOL("EmeraldBuildPrefs_EmbedItem"))
{
LLViewerInventoryItem* item = (LLViewerInventoryItem*)gInventory.getItem((LLUUID)gSavedSettings.getString("EmeraldBuildPrefs_Item"));
LLViewerObject* objectp = find((U32)newid);
if(objectp)
if(item)
{
if(item->getType()==LLAssetType::AT_LSL_TEXT)
{
LLToolDragAndDrop::dropScript(objectp,
item,
TRUE,
LLToolDragAndDrop::SOURCE_AGENT,
gAgent.getID());
}else
{
LLToolDragAndDrop::dropInventory(objectp,item,LLToolDragAndDrop::SOURCE_AGENT,gAgent.getID());
}
}
}
msg->newMessageFast(_PREHASH_ObjectPermissions);
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
msg->nextBlockFast(_PREHASH_HeaderData);
msg->addBOOLFast(_PREHASH_Override, FALSE);
msg->nextBlockFast(_PREHASH_ObjectData);
msg->addU32Fast(_PREHASH_ObjectLocalID, (U32)newid);
msg->addU8Fast(_PREHASH_Field, PERM_NEXT_OWNER);
msg->addBOOLFast(_PREHASH_Set, PERM_ITEM_UNRESTRICTED);
U32 flags = 0;
if ( gSavedSettings.getBOOL("NextOwnerCopy") )
{
flags |= PERM_COPY;
}
if ( gSavedSettings.getBOOL("NextOwnerModify") )
{
flags |= PERM_MODIFY;
}
if ( gSavedSettings.getBOOL("NextOwnerTransfer") )
//.........这里部分代码省略.........
示例4: activateGesture
void LLGestureManager::activateGestures(LLViewerInventoryItem::item_array_t& items)
{
// Load up the assets
S32 count = 0;
LLViewerInventoryItem::item_array_t::const_iterator it;
for (it = items.begin(); it != items.end(); ++it)
{
LLViewerInventoryItem* item = *it;
if (isGestureActive(item->getUUID()))
{
continue;
}
else
{ // Make gesture active and persistent through login sessions. -spatters 07-12-06
activateGesture(item->getUUID());
}
count++;
}
mLoadingCount = count;
mDeactivateSimilarNames.clear();
for (it = items.begin(); it != items.end(); ++it)
{
LLViewerInventoryItem* item = *it;
if (isGestureActive(item->getUUID()))
{
continue;
}
// Don't inform server, we'll do that in bulk
const BOOL no_inform_server = FALSE;
const BOOL deactivate_similar = TRUE;
activateGestureWithAsset(item->getUUID(), item->getAssetUUID(),
no_inform_server,
deactivate_similar);
}
// Inform the database of this change
LLMessageSystem* msg = gMessageSystem;
BOOL start_message = TRUE;
for (it = items.begin(); it != items.end(); ++it)
{
LLViewerInventoryItem* item = *it;
if (isGestureActive(item->getUUID()))
{
continue;
}
if (start_message)
{
msg->newMessage("ActivateGestures");
msg->nextBlock("AgentData");
msg->addUUID("AgentID", gAgent.getID());
msg->addUUID("SessionID", gAgent.getSessionID());
msg->addU32("Flags", 0x0);
start_message = FALSE;
}
msg->nextBlock("Data");
msg->addUUID("ItemID", item->getUUID());
msg->addUUID("AssetID", item->getAssetUUID());
msg->addU32("GestureFlags", 0x0);
if (msg->getCurrentSendTotal() > MTUBYTES)
{
gAgent.sendReliableMessage();
start_message = TRUE;
}
}
if (!start_message)
{
gAgent.sendReliableMessage();
}
}
示例5: file
// static
void LLGestureManager::onLoadComplete(LLVFS *vfs,
const LLUUID& asset_uuid,
LLAssetType::EType type,
void* user_data, S32 status, LLExtStat ext_status)
{
LLLoadInfo* info = (LLLoadInfo*)user_data;
LLUUID item_id = info->mItemID;
BOOL inform_server = info->mInformServer;
BOOL deactivate_similar = info->mDeactivateSimilar;
delete info;
info = NULL;
LLGestureManager& self = LLGestureManager::instance();
self.mLoadingCount--;
if (0 == status)
{
LLVFile file(vfs, asset_uuid, type, LLVFile::READ);
S32 size = file.getSize();
std::vector<char> buffer(size+1);
file.read((U8*)&buffer[0], size);
// ensure there's a trailing NULL so strlen will work.
buffer[size] = '\0';
LLMultiGesture* gesture = new LLMultiGesture();
LLDataPackerAsciiBuffer dp(&buffer[0], size+1);
BOOL ok = gesture->deserialize(dp);
if (ok)
{
if (deactivate_similar)
{
self.deactivateSimilarGestures(gesture, item_id);
// Display deactivation message if this was the last of the bunch.
if (self.mLoadingCount == 0
&& self.mDeactivateSimilarNames.length() > 0)
{
// we're done with this set of deactivations
LLSD args;
args["NAMES"] = self.mDeactivateSimilarNames;
LLNotificationsUtil::add("DeactivatedGesturesTrigger", args);
}
}
LLViewerInventoryItem* item = gInventory.getItem(item_id);
if(item)
{
gesture->mName = item->getName();
}
else
{
// Watch this item and set gesture name when item exists in inventory
item_ref_t ids;
ids.push_back(item_id);
self.fetchItems(ids);
}
self.mActive[item_id] = gesture;
// Everything has been successful. Add to the active list.
gInventory.addChangedMask(LLInventoryObserver::LABEL, item_id);
if (inform_server)
{
// Inform the database of this change
LLMessageSystem* msg = gMessageSystem;
msg->newMessage("ActivateGestures");
msg->nextBlock("AgentData");
msg->addUUID("AgentID", gAgent.getID());
msg->addUUID("SessionID", gAgent.getSessionID());
msg->addU32("Flags", 0x0);
msg->nextBlock("Data");
msg->addUUID("ItemID", item_id);
msg->addUUID("AssetID", asset_uuid);
msg->addU32("GestureFlags", 0x0);
gAgent.sendReliableMessage();
}
callback_map_t::iterator i_cb = self.mCallbackMap.find(item_id);
if(i_cb != self.mCallbackMap.end())
{
i_cb->second(gesture);
self.mCallbackMap.erase(i_cb);
}
self.notifyObservers();
}
else
{
llwarns << "Unable to load gesture" << llendl;
self.mActive.erase(item_id);
//.........这里部分代码省略.........
示例6: setMouseCapture
//.........这里部分代码省略.........
// mouse has moved
mHasMoved = TRUE;
//------------------------------------------------------
// Handle grabbing
//------------------------------------------------------
LLVector3d x_part;
x_part.setVec(LLViewerCamera::getInstance()->getLeftAxis());
x_part.mdV[VZ] = 0.0;
x_part.normVec();
LLVector3d y_part;
if( mVerticalDragging )
{
y_part.setVec(LLViewerCamera::getInstance()->getUpAxis());
// y_part.setVec(0.f, 0.f, 1.f);
}
else
{
// drag toward camera
y_part = x_part % LLVector3d::z_axis;
y_part.mdV[VZ] = 0.0;
y_part.normVec();
}
mGrabHiddenOffsetFromCamera = mGrabHiddenOffsetFromCamera
+ (x_part * (-dx * GRAB_SENSITIVITY_X))
+ (y_part * ( dy * GRAB_SENSITIVITY_Y));
}
// need to return offset from mGrabStartPoint
LLVector3d grab_point_global = gAgent.getCameraPositionGlobal() + mGrabHiddenOffsetFromCamera;
grab_pos_region = objectp->getRegion()->getPosRegionFromGlobal( grab_point_global );
}
// only send message if something has changed since last message
BOOL changed_since_last_update = FALSE;
// test if touch data needs to be updated
if ((pick.mObjectFace != mLastFace) ||
(pick.mUVCoords != mLastUVCoords) ||
(pick.mSTCoords != mLastSTCoords) ||
(pick.mIntersection != mLastIntersection) ||
(pick.mNormal != mLastNormal) ||
(pick.mBinormal != mLastBinormal) ||
(grab_pos_region != mLastGrabPos))
{
changed_since_last_update = TRUE;
}
if (changed_since_last_update)
{
LLMessageSystem *msg = gMessageSystem;
msg->newMessageFast(_PREHASH_ObjectGrabUpdate);
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
msg->nextBlockFast(_PREHASH_ObjectData);
msg->addUUIDFast(_PREHASH_ObjectID, objectp->getID() );
msg->addVector3Fast(_PREHASH_GrabOffsetInitial, mGrabOffsetFromCenterInitial );
msg->addVector3Fast(_PREHASH_GrabPosition, grab_pos_region );
msg->addU32Fast(_PREHASH_TimeSinceLast, dt_milliseconds );
msg->nextBlock("SurfaceInfo");
msg->addVector3("UVCoord", LLVector3(pick.mUVCoords));
msg->addVector3("STCoord", LLVector3(pick.mSTCoords));
msg->addS32Fast(_PREHASH_FaceIndex, pick.mObjectFace);
msg->addVector3("Position", pick.mIntersection);
msg->addVector3("Normal", pick.mNormal);
msg->addVector3("Binormal", pick.mBinormal);
msg->sendMessage( objectp->getRegion()->getHost() );
mLastUVCoords = pick.mUVCoords;
mLastSTCoords = pick.mSTCoords;
mLastFace = pick.mObjectFace;
mLastIntersection = pick.mIntersection;
mLastNormal= pick.mNormal;
mLastBinormal= pick.mBinormal;
mLastGrabPos = grab_pos_region;
}
// update point-at / look-at
if (pick.mObjectFace != -1) // if the intersection was on the surface of the obejct
{
LLVector3 local_edit_point = pick.mIntersection;
local_edit_point -= objectp->getPositionAgent();
local_edit_point = local_edit_point * ~objectp->getRenderRotation();
gAgent.setPointAt(POINTAT_TARGET_GRAB, objectp, local_edit_point );
gAgent.setLookAt(LOOKAT_TARGET_SELECT, objectp, local_edit_point );
}
gViewerWindow->setCursor(UI_CURSOR_HAND);
}
示例7: sendReportViaLegacy
void LLFloaterReporter::sendReportViaLegacy(const LLSD & report)
{
LLViewerRegion *regionp = gAgent.getRegion();
if (!regionp) return;
LLMessageSystem *msg = gMessageSystem;
msg->newMessageFast(_PREHASH_UserReport);
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
msg->nextBlockFast(_PREHASH_ReportData);
msg->addU8Fast(_PREHASH_ReportType, report["report-type"].asInteger());
msg->addU8(_PREHASH_Category, report["category"].asInteger());
msg->addVector3Fast(_PREHASH_Position, LLVector3(report["position"]));
msg->addU8Fast(_PREHASH_CheckFlags, report["check-flags"].asInteger());
msg->addUUIDFast(_PREHASH_ScreenshotID, report["screenshot-id"].asUUID());
msg->addUUIDFast(_PREHASH_ObjectID, report["object-id"].asUUID());
msg->addUUID("AbuserID", report["abuser-id"].asUUID());
msg->addString("AbuseRegionName", report["abuse-region-name"].asString());
msg->addUUID("AbuseRegionID", report["abuse-region-id"].asUUID());
msg->addStringFast(_PREHASH_Summary, report["summary"].asString());
msg->addString("VersionString", report["version-string"]);
msg->addStringFast(_PREHASH_Details, report["details"] );
msg->sendReliable(regionp->getHost());
}
示例8: people
// static
void LLPanelDirFindAllOld::onClickSearch(void *userdata)
{
LLPanelDirFindAllOld *self = (LLPanelDirFindAllOld *)userdata;
if (self->childGetValue("name").asString().length() < self->mMinSearchChars)
{
return;
};
BOOL inc_pg = self->childGetValue("incpg").asBoolean();
BOOL inc_mature = self->childGetValue("incmature").asBoolean();
BOOL inc_adult = self->childGetValue("incadult").asBoolean();
if (!(inc_pg || inc_mature || inc_adult))
{
LLNotificationsUtil::add("NoContentToSearch");
return;
}
self->setupNewSearch();
// Figure out scope
U32 scope = 0x0;
scope |= DFQ_PEOPLE; // people (not just online = 0x01 | 0x02)
// places handled below
scope |= DFQ_EVENTS; // events
scope |= DFQ_GROUPS; // groups
if (inc_pg)
{
scope |= DFQ_INC_PG;
}
if (inc_mature)
{
scope |= DFQ_INC_MATURE;
}
if (inc_adult)
{
scope |= DFQ_INC_ADULT;
}
if (self->hasChild("filter_gaming") && self->childGetValue("filter_gaming").asBoolean())
{
scope |= DFQ_FILTER_GAMING;
}
// send the message
LLMessageSystem *msg = gMessageSystem;
S32 start_row = 0;
sendDirFindQuery(msg, self->mSearchID, self->childGetValue("name").asString(), scope, start_row);
// Also look up classified ads. JC 12/2005
BOOL filter_auto_renew = FALSE;
U32 classified_flags = pack_classified_flags_request(filter_auto_renew, inc_pg, inc_mature, inc_adult);
msg->newMessage("DirClassifiedQuery");
msg->nextBlock("AgentData");
msg->addUUID("AgentID", gAgent.getID());
msg->addUUID("SessionID", gAgent.getSessionID());
msg->nextBlock("QueryData");
msg->addUUID("QueryID", self->mSearchID);
msg->addString("QueryText", self->childGetValue("name").asString());
msg->addU32("QueryFlags", classified_flags);
msg->addU32("Category", 0); // all categories
msg->addS32("QueryStart", 0);
gAgent.sendReliableMessage();
// Need to use separate find places query because places are
// sent using the more compact DirPlacesReply message.
U32 query_flags = DFQ_DWELL_SORT;
if (inc_pg)
{
query_flags |= DFQ_INC_PG;
}
if (inc_mature)
{
query_flags |= DFQ_INC_MATURE;
}
if (inc_adult)
{
query_flags |= DFQ_INC_ADULT;
}
msg->newMessage("DirPlacesQuery");
msg->nextBlock("AgentData");
msg->addUUID("AgentID", gAgent.getID() );
msg->addUUID("SessionID", gAgent.getSessionID());
msg->nextBlock("QueryData");
msg->addUUID("QueryID", self->mSearchID );
msg->addString("QueryText", self->childGetValue("name").asString());
msg->addU32("QueryFlags", query_flags );
msg->addS32("QueryStart", 0 ); // Always get the first 100 when using find ALL
msg->addS8("Category", LLParcel::C_ANY);
msg->addString("SimName", NULL);
gAgent.sendReliableMessage();
}
示例9: send_generic_message
void send_generic_message(const std::string& method,
const std::vector<std::string>& strings,
const LLUUID& invoice)
{
LLMessageSystem* msg = gMessageSystem;
msg->newMessage("GenericMessage");
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", method);
msg->addUUID("Invoice", invoice);
if(strings.empty())
{
msg->nextBlock("ParamList");
msg->addString("Parameter", NULL);
}
else
{
std::vector<std::string>::const_iterator it = strings.begin();
std::vector<std::string>::const_iterator end = strings.end();
for(; it != end; ++it)
{
msg->nextBlock("ParamList");
msg->addString("Parameter", *it);
}
}
gAgent.sendReliableMessage();
}
示例10: send_ObjectGrab_message
void send_ObjectGrab_message(LLViewerObject* object, const LLPickInfo & pick, const LLVector3 &grab_offset)
{
if (!object) return;
LLMessageSystem *msg = gMessageSystem;
msg->newMessageFast(_PREHASH_ObjectGrab);
msg->nextBlockFast( _PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
msg->nextBlockFast( _PREHASH_ObjectData);
msg->addU32Fast( _PREHASH_LocalID, object->mLocalID);
msg->addVector3Fast(_PREHASH_GrabOffset, grab_offset);
msg->nextBlock("SurfaceInfo");
msg->addVector3("UVCoord", LLVector3(pick.mUVCoords));
msg->addVector3("STCoord", LLVector3(pick.mSTCoords));
msg->addS32Fast(_PREHASH_FaceIndex, pick.mObjectFace);
msg->addVector3("Position", pick.mIntersection);
msg->addVector3("Normal", pick.mNormal);
msg->addVector3("Binormal", pick.mBinormal);
msg->sendMessage( object->getRegion()->getHost());
/* Diagnostic code
llinfos << "mUVCoords: " << pick.mUVCoords
<< ", mSTCoords: " << pick.mSTCoords
<< ", mObjectFace: " << pick.mObjectFace
<< ", mIntersection: " << pick.mIntersection
<< ", mNormal: " << pick.mNormal
<< ", mBinormal: " << pick.mBinormal
<< llendl;
llinfos << "Avatar pos: " << gAgent.getPositionAgent() << llendl;
llinfos << "Object pos: " << object->getPosition() << llendl;
*/
}
示例11: send_ObjectDeGrab_message
void send_ObjectDeGrab_message(LLViewerObject* object, const LLPickInfo & pick)
{
if (!object) return;
LLMessageSystem *msg = gMessageSystem;
msg->newMessageFast(_PREHASH_ObjectDeGrab);
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
msg->nextBlockFast(_PREHASH_ObjectData);
msg->addU32Fast(_PREHASH_LocalID, object->mLocalID);
msg->nextBlock("SurfaceInfo");
msg->addVector3("UVCoord", LLVector3(pick.mUVCoords));
msg->addVector3("STCoord", LLVector3(pick.mSTCoords));
msg->addS32Fast(_PREHASH_FaceIndex, pick.mObjectFace);
msg->addVector3("Position", pick.mIntersection);
msg->addVector3("Normal", pick.mNormal);
msg->addVector3("Binormal", pick.mBinormal);
msg->sendMessage(object->getRegion()->getHost());
}
示例12: callback
// static
void LLFloaterPostcard::uploadCallback(const LLUUID& asset_id, void *user_data, S32 result, LLExtStat ext_status) // StoreAssetData callback (fixed)
{
LLFloaterPostcard *self = (LLFloaterPostcard *)user_data;
LLUploadDialog::modalUploadFinished();
if (result)
{
LLSD args;
args["REASON"] = std::string(LLAssetStorage::getErrorString(result));
LLNotifications::instance().add("ErrorUploadingPostcard", args);
}
else
{
// only create the postcard once the upload succeeds
// request the postcard
LLMessageSystem* msg = gMessageSystem;
msg->newMessage("SendPostcard");
msg->nextBlock("AgentData");
msg->addUUID("AgentID", gAgent.getID());
msg->addUUID("SessionID", gAgent.getSessionID());
msg->addUUID("AssetID", self->mAssetID);
msg->addVector3d("PosGlobal", self->mPosTakenGlobal);
msg->addString("To", self->childGetValue("to_form").asString());
msg->addString("From", self->childGetValue("from_form").asString());
msg->addString("Name", self->childGetValue("name_form").asString());
msg->addString("Subject", self->childGetValue("subject_form").asString());
msg->addString("Msg", self->childGetValue("msg_form").asString());
msg->addBOOL("AllowPublish", FALSE);
msg->addBOOL("MaturePublish", FALSE);
gAgent.sendReliableMessage();
}
self->close();
}
示例13: setupNewSearch
void LLPanelDirClassified::performQuery()
{
lldebugs << "LLPanelDirClassified::performQuery()" << llendl;
// This sets mSearchID and clears the list of results
setupNewSearch();
// send the message
LLMessageSystem *msg = gMessageSystem;
msg->newMessageFast(_PREHASH_DirClassifiedQuery);
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID() );
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
BOOL filter_mature = !childGetValue("incmature").asBoolean();
BOOL filter_auto_renew = FALSE;
U32 query_flags = pack_classified_flags(filter_mature, filter_auto_renew);
//if (gAgent.isTeen()) query_flags |= DFQ_PG_SIMS_ONLY;
U32 category = childGetValue("Category").asInteger();
msg->nextBlockFast(_PREHASH_QueryData);
msg->addUUIDFast(_PREHASH_QueryID, mSearchID );
msg->addStringFast(_PREHASH_QueryText, childGetValue("name").asString());
msg->addU32Fast(_PREHASH_QueryFlags, query_flags);
msg->addU32Fast(_PREHASH_Category, category);
msg->addS32Fast(_PREHASH_QueryStart,mSearchStart);
gAgent.sendReliableMessage();
}
示例14: sendMapBlockRequest
// public
void LLWorldMap::sendMapBlockRequest(U16 min_x, U16 min_y, U16 max_x, U16 max_y, bool return_nonexistent)
{
S32 layer = mCurrentMap;
LLMessageSystem* msg = gMessageSystem;
msg->newMessageFast(_PREHASH_MapBlockRequest);
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
U32 flags = layer;
flags |= (return_nonexistent ? 0x10000 : 0);
msg->addU32Fast(_PREHASH_Flags, flags);
msg->addU32Fast(_PREHASH_EstateID, 0); // Filled in on sim
msg->addBOOLFast(_PREHASH_Godlike, FALSE); // Filled in on sim
msg->nextBlockFast(_PREHASH_PositionData);
msg->addU16Fast(_PREHASH_MinX, min_x);
msg->addU16Fast(_PREHASH_MinY, min_y);
msg->addU16Fast(_PREHASH_MaxX, max_x);
msg->addU16Fast(_PREHASH_MaxY, max_y);
gAgent.sendReliableMessage();
if (mRequestLandForSale)
{
msg->newMessageFast(_PREHASH_MapBlockRequest);
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
msg->addU32Fast(_PREHASH_Flags, 2);
msg->addU32Fast(_PREHASH_EstateID, 0); // Filled in on sim
msg->addBOOLFast(_PREHASH_Godlike, FALSE); // Filled in on sim
msg->nextBlockFast(_PREHASH_PositionData);
msg->addU16Fast(_PREHASH_MinX, min_x);
msg->addU16Fast(_PREHASH_MinY, min_y);
msg->addU16Fast(_PREHASH_MaxX, max_x);
msg->addU16Fast(_PREHASH_MaxY, max_y);
gAgent.sendReliableMessage();
}
}
示例15: startGrab
void LLToolGrab::startGrab()
{
// Compute grab_offset in the OBJECT's root's coordinate frame
// (sometimes root == object)
LLViewerObject* objectp = mGrabPick.getObject();
if (!objectp)
{
return;
}
LLViewerObject *root = (LLViewerObject *)objectp->getRoot();
// drag from center
LLVector3d grab_start_global = root->getPositionGlobal();
// Where the grab starts, relative to the center of the root object of the set.
// JC - This code looks wonky, but I believe it does the right thing.
// Otherwise, when you grab a linked object set, it "pops" on the start
// of the drag.
LLVector3d grab_offsetd = root->getPositionGlobal() - objectp->getPositionGlobal();
LLVector3 grab_offset;
grab_offset.setVec(grab_offsetd);
LLQuaternion rotation = root->getRotation();
rotation.conjQuat();
grab_offset = grab_offset * rotation;
// This planar drag starts at the grab point
mDragStartPointGlobal = grab_start_global;
mDragStartFromCamera = grab_start_global - gAgent.getCameraPositionGlobal();
LLMessageSystem *msg = gMessageSystem;
msg->newMessageFast(_PREHASH_ObjectGrab);
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
msg->nextBlockFast(_PREHASH_ObjectData);
msg->addU32Fast(_PREHASH_LocalID, objectp->mLocalID);
msg->addVector3Fast(_PREHASH_GrabOffset, grab_offset );
msg->nextBlock("SurfaceInfo");
msg->addVector3("UVCoord", LLVector3(mGrabPick.mUVCoords));
msg->addVector3("STCoord", LLVector3(mGrabPick.mSTCoords));
msg->addS32Fast(_PREHASH_FaceIndex, mGrabPick.mObjectFace);
msg->addVector3("Position", mGrabPick.mIntersection);
msg->addVector3("Normal", mGrabPick.mNormal);
msg->addVector3("Binormal", mGrabPick.mBinormal);
msg->sendMessage( objectp->getRegion()->getHost());
mGrabOffsetFromCenterInitial = grab_offset;
mGrabHiddenOffsetFromCamera = mDragStartFromCamera;
mGrabTimer.reset();
mLastUVCoords = mGrabPick.mUVCoords;
mLastSTCoords = mGrabPick.mSTCoords;
mLastFace = mGrabPick.mObjectFace;
mLastIntersection = mGrabPick.mIntersection;
mLastNormal = mGrabPick.mNormal;
mLastBinormal = mGrabPick.mBinormal;
mLastGrabPos = LLVector3(-1.f, -1.f, -1.f);
}