本文整理汇总了C++中LLMessageSystem::newMessageFast方法的典型用法代码示例。如果您正苦于以下问题:C++ LLMessageSystem::newMessageFast方法的具体用法?C++ LLMessageSystem::newMessageFast怎么用?C++ LLMessageSystem::newMessageFast使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLMessageSystem
的用法示例。
在下文中一共展示了LLMessageSystem::newMessageFast方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: send_properties
void ImportTracker::send_properties(LLSD& prim, int counter)
{
if(prim.has("properties"))
{
if(counter == 1)//root only shit
{
//prim["LocalID"]
LLMessageSystem* msg = gMessageSystem;
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, prim["LocalID"].asInteger());
msg->addU8Fast(_PREHASH_Field, PERM_NEXT_OWNER);
msg->addBOOLFast(_PREHASH_Set, PERM_ITEM_UNRESTRICTED);
msg->addU32Fast(_PREHASH_Mask, U32(atoi(prim["next_owner_mask"].asString().c_str())));
/*msg->sendReliable(gAgent.getRegion()->getHost());
//LLMessageSystem* msg = gMessageSystem;
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, data->mOverride);*/
msg->nextBlockFast(_PREHASH_ObjectData);
msg->addU32Fast(_PREHASH_ObjectLocalID, prim["LocalID"].asInteger());
msg->addU8Fast(_PREHASH_Field, PERM_GROUP);
msg->addBOOLFast(_PREHASH_Set, PERM_ITEM_UNRESTRICTED);
msg->addU32Fast(_PREHASH_Mask, U32(atoi(prim["group_mask"].asString().c_str())));
/*msg->sendReliable(gAgent.getRegion()->getHost());
//LLMessageSystem* msg = gMessageSystem;
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, data->mOverride);*/
msg->nextBlockFast(_PREHASH_ObjectData);
msg->addU32Fast(_PREHASH_ObjectLocalID, prim["LocalID"].asInteger());
msg->addU8Fast(_PREHASH_Field, PERM_EVERYONE);
msg->addBOOLFast(_PREHASH_Set, PERM_ITEM_UNRESTRICTED);
msg->addU32Fast(_PREHASH_Mask, U32(atoi(prim["everyone_mask"].asString().c_str())));
msg->sendReliable(gAgent.getRegion()->getHost());
msg->newMessageFast(_PREHASH_ObjectSaleInfo);
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
msg->nextBlockFast(_PREHASH_ObjectData);
msg->addU32Fast(_PREHASH_LocalID, prim["LocalID"].asInteger());
LLSaleInfo sale_info;
BOOL a;
U32 b;
sale_info.fromLLSD(prim["sale_info"],a,b);
sale_info.packMessage(msg);
msg->sendReliable(gAgent.getRegion()->getHost());
//no facilities exist to send any other information at this time.
}
}
}
示例2: doResetParcel
// Reset all the values for the parcel in preparation for a sale
void LLFloaterAuction::doResetParcel()
{
LLParcel* parcelp = mParcelp->getParcel();
LLViewerRegion* region = LLViewerParcelMgr::getInstance()->getSelectionRegion();
if (parcelp
&& region
&& !mParcelUpdateCapUrl.empty())
{
LLSD body;
std::string empty;
// request new properties update from simulator
U32 message_flags = 0x01;
body["flags"] = ll_sd_from_U32(message_flags);
// Set all the default parcel properties for auction
body["local_id"] = parcelp->getLocalID();
U32 parcel_flags = PF_ALLOW_LANDMARK |
PF_ALLOW_FLY |
PF_CREATE_GROUP_OBJECTS |
PF_ALLOW_ALL_OBJECT_ENTRY |
PF_ALLOW_GROUP_OBJECT_ENTRY |
PF_ALLOW_GROUP_SCRIPTS |
PF_RESTRICT_PUSHOBJECT |
PF_SOUND_LOCAL |
PF_ALLOW_VOICE_CHAT |
PF_USE_ESTATE_VOICE_CHAN;
body["parcel_flags"] = ll_sd_from_U32(parcel_flags);
// Build a parcel name like "Ahern (128,128) PG 4032m"
std::ostringstream parcel_name;
LLVector3 center_point( parcelp->getCenterpoint() );
center_point.snap(0); // Get rid of fractions
parcel_name << region->getName()
<< " ("
<< (S32) center_point.mV[VX]
<< ","
<< (S32) center_point.mV[VY]
<< ") "
<< region->getSimAccessString()
<< " "
<< parcelp->getArea()
<< "m";
std::string new_name(parcel_name.str().c_str());
body["name"] = new_name;
getChild<LLUICtrl>("parcel_text")->setValue(new_name); // Set name in dialog as well, since it won't get updated otherwise
body["sale_price"] = (S32) 0;
body["description"] = empty;
body["music_url"] = empty;
body["media_url"] = empty;
body["media_desc"] = empty;
body["media_type"] = LLMIMETypes::getDefaultMimeType();
body["media_width"] = (S32) 0;
body["media_height"] = (S32) 0;
body["auto_scale"] = (S32) 0;
body["media_loop"] = (S32) 0;
body["obscure_media"] = (S32) 0; // OBSOLETE - no longer used
body["obscure_music"] = (S32) 0; // OBSOLETE - no longer used
body["media_id"] = LLUUID::null;
body["group_id"] = MAINTENANCE_GROUP_ID; // Use maintenance group
body["pass_price"] = (S32) 10; // Defaults to $10
body["pass_hours"] = 0.0f;
body["category"] = (U8) LLParcel::C_NONE;
body["auth_buyer_id"] = LLUUID::null;
body["snapshot_id"] = LLUUID::null;
body["user_location"] = ll_sd_from_vector3( LLVector3::zero );
body["user_look_at"] = ll_sd_from_vector3( LLVector3::zero );
body["landing_type"] = (U8) LLParcel::L_DIRECT;
LL_INFOS() << "Sending parcel update to reset for auction via capability to: "
<< mParcelUpdateCapUrl << LL_ENDL;
LLHTTPClient::post(mParcelUpdateCapUrl, body, new LLHTTPClient::Responder());
// Send a message to clear the object return time
LLMessageSystem *msg = gMessageSystem;
msg->newMessageFast(_PREHASH_ParcelSetOtherCleanTime);
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
msg->nextBlockFast(_PREHASH_ParcelData);
msg->addS32Fast(_PREHASH_LocalID, parcelp->getLocalID());
msg->addS32Fast(_PREHASH_OtherCleanTime, 5); // 5 minute object auto-return
msg->sendReliable(region->getHost());
// Clear the access lists
clearParcelAccessList(parcelp, region, AL_ACCESS);
clearParcelAccessList(parcelp, region, AL_BAN);
clearParcelAccessList(parcelp, region, AL_ALLOW_EXPERIENCE);
clearParcelAccessList(parcelp, region, AL_BLOCK_EXPERIENCE);
}
}
示例3: get_update
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;
static std::string* shinystr = rebind_llcontrol<std::string>("EmeraldBuildPrefs_Shiny", &gSavedSettings, true);
if(*shinystr == "None") shinnyLevel = 0;
if(*shinystr == "Low") shinnyLevel = 1;
if(*shinystr == "Medium") shinnyLevel = 2;
if(*shinystr == "High") shinnyLevel = 3;
for (int i = 0; i < 10; i++)
{
static std::string* buildpreftex = rebind_llcontrol<std::string>("EmeraldBuildPrefs_Texture", &gSavedSettings, true);
LLTextureEntry tex = LLTextureEntry(LLUUID(*buildpreftex));
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());
}
}
}
//llinfos << "LGG SENDING CUBE TEXTURE.." << llendl;
}
break;
case BUILDING:
if (justCreated && (int)localids.size() < linkset.size())
{
localids.push_back(newid);
localids.sort();
localids.unique();
linkset[localids.size() -1]["LocalID"] = newid;
LLSD prim = linkset[localids.size() -1];
//MAKERIGHT
if (!(prim).has("Updated"))
{
//.........这里部分代码省略.........
示例4: handleHoverActive
// Dragging.
void LLToolGrab::handleHoverActive(S32 x, S32 y, MASK mask)
{
LLViewerObject* objectp = mGrabPick.getObject();
if (!objectp || !hasMouseCapture() ) return;
if (objectp->isDead())
{
// Bail out of drag because object has been killed
setMouseCapture(FALSE);
return;
}
//--------------------------------------------------
// Toggle spinning
//--------------------------------------------------
if (mSpinGrabbing && !(mask == MASK_SPIN) && !gGrabBtnSpin)
{
// user released ALT key, stop spinning
stopSpin();
}
else if (!mSpinGrabbing && (mask == MASK_SPIN) )
{
// user pressed ALT key, start spinning
startSpin();
}
//--------------------------------------------------
// Toggle vertical dragging
//--------------------------------------------------
if (mVerticalDragging && !(mask == MASK_VERTICAL) && !gGrabBtnVertical)
{
// ...switch to horizontal dragging
mVerticalDragging = FALSE;
mDragStartPointGlobal = gViewerWindow->clickPointInWorldGlobal(x, y, objectp);
mDragStartFromCamera = mDragStartPointGlobal - gAgentCamera.getCameraPositionGlobal();
}
else if (!mVerticalDragging && (mask == MASK_VERTICAL) )
{
// ...switch to vertical dragging
mVerticalDragging = TRUE;
mDragStartPointGlobal = gViewerWindow->clickPointInWorldGlobal(x, y, objectp);
mDragStartFromCamera = mDragStartPointGlobal - gAgentCamera.getCameraPositionGlobal();
}
const F32 RADIANS_PER_PIXEL_X = 0.01f;
const F32 RADIANS_PER_PIXEL_Y = 0.01f;
S32 dx = x - (gViewerWindow->getWindowWidth() / 2);
S32 dy = y - (gViewerWindow->getWindowHeight() / 2);
if (dx != 0 || dy != 0)
{
mAccumDeltaX += dx;
mAccumDeltaY += dy;
S32 dist_sq = mAccumDeltaX * mAccumDeltaX + mAccumDeltaY * mAccumDeltaY;
if (dist_sq > SLOP_DIST_SQ)
{
mOutsideSlop = TRUE;
}
// mouse has moved outside center
mHasMoved = TRUE;
if (mSpinGrabbing)
{
//------------------------------------------------------
// Handle spinning
//------------------------------------------------------
// x motion maps to rotation around vertical axis
LLVector3 up(0.f, 0.f, 1.f);
LLQuaternion rotation_around_vertical( dx*RADIANS_PER_PIXEL_X, up );
// y motion maps to rotation around left axis
const LLVector3 &agent_left = LLViewerCamera::getInstance()->getLeftAxis();
LLQuaternion rotation_around_left( dy*RADIANS_PER_PIXEL_Y, agent_left );
// compose with current rotation
mSpinRotation = mSpinRotation * rotation_around_vertical;
mSpinRotation = mSpinRotation * rotation_around_left;
// TODO: Throttle these
LLMessageSystem *msg = gMessageSystem;
msg->newMessageFast(_PREHASH_ObjectSpinUpdate);
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->addQuatFast(_PREHASH_Rotation, mSpinRotation );
msg->sendMessage( objectp->getRegion()->getHost() );
}
else
{
//------------------------------------------------------
// Handle grabbing
//------------------------------------------------------
//.........这里部分代码省略.........
示例5: performQueryOrDelete
void LLPanelDirEvents::performQueryOrDelete(U32 event_id)
{
S32 relative_day = mDay;
// Update the date field to show the date IN THE SERVER'S
// TIME ZONE, as that is what will be displayed in each event
// Get time UTC
time_t utc_time = time_corrected();
// Correct for offset
utc_time += relative_day * 24 * 60 * 60;
// There's only one internal tm buffer.
struct tm* internal_time;
// Convert to Pacific, based on server's opinion of whether
// it's daylight savings time there.
internal_time = utc_to_pacific_time(utc_time, gPacificDaylightTime);
std::string buffer = llformat("%d/%d",
1 + internal_time->tm_mon, // Jan = 0
internal_time->tm_mday); // 2001 = 101
childSetValue("date_text", buffer);
// Record the relative day so back and forward buttons
// offset from this day.
mDay = relative_day;
mDoneQuery = TRUE;
setupNewSearch();
U32 scope = DFQ_DATE_EVENTS;
if ( gAgent.isTeen()) scope |= DFQ_PG_SIMS_ONLY;
if ( !childGetValue("incmature").asBoolean() ) scope |= DFQ_PG_EVENTS_ONLY;
std::ostringstream params;
// Date mode for the search
if ("current" == childGetValue("date_mode").asString())
{
params << "u|";
}
else
{
params << mDay << "|";
}
// Categories are stored in the database in table indra.event_category
// XML must match.
U32 cat_id = childGetValue("category combo").asInteger();
params << cat_id << "|";
params << childGetValue("event_search_text").asString();
// send the message
if (0 == event_id)
{
sendDirFindQuery(gMessageSystem, mSearchID, params.str(), scope, mSearchStart);
}
else
{
// This delete will also perform a query.
LLMessageSystem* msg = gMessageSystem;
msg->newMessageFast(_PREHASH_EventGodDelete);
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
msg->nextBlockFast(_PREHASH_EventData);
msg->addU32Fast(_PREHASH_EventID, event_id);
msg->nextBlockFast(_PREHASH_QueryData);
msg->addUUIDFast(_PREHASH_QueryID, mSearchID);
msg->addStringFast(_PREHASH_QueryText, params.str());
msg->addU32Fast(_PREHASH_QueryFlags, scope);
msg->addS32Fast(_PREHASH_QueryStart, mSearchStart);
gAgent.sendReliableMessage();
}
}
示例6: give
void LLFloaterPay::give(S32 amount)
{
if(mCallback)
{
// if the amount is 0, that menas that we should use the
// text field.
if(amount == 0)
{
amount = atoi(childGetText("amount").c_str());
}
sLastAmount = amount;
// Try to pay an object.
if (mTargetIsObject)
{
LLViewerObject* dest_object = gObjectList.findObject(mTargetUUID);
if(dest_object)
{
LLViewerRegion* region = dest_object->getRegion();
if (region)
{
// Find the name of the root object
LLSelectNode* node = mObjectSelection->getFirstRootNode();
std::string object_name;
if (node)
{
object_name = node->mName;
}
S32 tx_type = TRANS_PAY_OBJECT;
if(dest_object->isAvatar()) tx_type = TRANS_GIFT;
mCallback(mTargetUUID, region, amount, FALSE, tx_type, object_name);
mObjectSelection = NULL;
// request the object owner in order to check if the owner needs to be unmuted
LLMessageSystem* msg = gMessageSystem;
msg->newMessageFast(_PREHASH_RequestObjectPropertiesFamily);
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
msg->nextBlockFast(_PREHASH_ObjectData);
msg->addU32Fast(_PREHASH_RequestFlags, OBJECT_PAY_REQUEST );
msg->addUUIDFast(_PREHASH_ObjectID, mTargetUUID);
msg->sendReliable( region->getHost() );
}
}
}
else
{
// just transfer the L$
// <edit>
if(childGetText("description") == "")
// </edit>
mCallback(mTargetUUID, gAgent.getRegion(), amount, mTargetIsGroup, TRANS_GIFT, LLStringUtil::null);
// <edit>
else
mCallback(mTargetUUID, gAgent.getRegion(), amount, mTargetIsGroup, TRANS_OBJECT_SALE, childGetText("description"));
// </edit>
// check if the payee needs to be unmuted
LLMuteList::getInstance()->autoRemove(mTargetUUID, LLMuteList::AR_MONEY);
}
}
}
示例7: getObjectInfo
void LLFloaterReporter::getObjectInfo(const LLUUID& object_id)
{
// TODO --
// 1 need to send to correct simulator if object is not
// in same simulator as agent
// 2 display info in widget window that gives feedback that
// we have recorded the object info
// 3 can pick avatar ==> might want to indicate when a picked
// object is an avatar, attachment, or other category
mObjectID = object_id;
if (LLUUID::null != mObjectID)
{
// get object info for the user's benefit
LLViewerObject* objectp = NULL;
objectp = gObjectList.findObject( mObjectID );
if (objectp)
{
if ( objectp->isAttachment() )
{
objectp = (LLViewerObject*)objectp->getRoot();
}
// correct the region and position information
LLViewerRegion *regionp = objectp->getRegion();
if (regionp)
{
childSetText("sim_field", regionp->getName());
// [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0a)
if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) )
{
childSetText("sim_field", RlvStrings::getString(RLV_STRING_HIDDEN_REGION));
}
// [/RLVa:KB]
LLVector3d global_pos;
global_pos.setVec(objectp->getPositionRegion());
setPosBox(global_pos);
}
if (objectp->isAvatar())
{
// we have the information we need
std::string object_owner;
LLNameValue* firstname = objectp->getNVPair("FirstName");
LLNameValue* lastname = objectp->getNVPair("LastName");
if (firstname && lastname)
{
object_owner.append(firstname->getString());
object_owner.append(1, ' ');
object_owner.append(lastname->getString());
}
else
{
object_owner.append("Unknown");
}
childSetText("object_name", object_owner);
// [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) | Added: RVLa-1.0.0e
if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES))
{
childSetVisible("object_name", false); // Hide the object name if the picked object represents an avataz
}
// [/RLVa:KB]
childSetText("owner_name", object_owner);
childSetText("abuser_name_edit", object_owner);
mAbuserID = object_id;
}
else
{
// we have to query the simulator for information
// about this object
LLMessageSystem* msg = gMessageSystem;
U32 request_flags = (mReportType == BUG_REPORT) ? BUG_REPORT_REQUEST : COMPLAINT_REPORT_REQUEST;
msg->newMessageFast(_PREHASH_RequestObjectPropertiesFamily);
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
msg->nextBlockFast(_PREHASH_ObjectData);
msg->addU32Fast(_PREHASH_RequestFlags, request_flags );
msg->addUUIDFast(_PREHASH_ObjectID, mObjectID);
LLViewerRegion* regionp = objectp->getRegion();
msg->sendReliable( regionp->getHost() );
}
}
}
}
示例8: upload_done_callback
// <edit>
void upload_done_callback(const LLUUID& uuid, void* user_data, S32 result, LLExtStat ext_status) // StoreAssetData callback (fixed)
{
LLResourceData* data = (LLResourceData*)user_data;
S32 expected_upload_cost = data ? data->mExpectedUploadCost : 0;
//LLAssetType::EType pref_loc = data->mPreferredLocation;
BOOL is_balance_sufficient = TRUE;
if(!data)
{
LLUploadDialog::modalUploadFinished();
return;
}
if(result >= 0)
{
LLFolderType::EType dest_loc = (data->mPreferredLocation == LLFolderType::FT_NONE) ? LLFolderType::assetTypeToFolderType(data->mAssetInfo.mType) : data->mPreferredLocation;
if (LLAssetType::AT_SOUND == data->mAssetInfo.mType ||
LLAssetType::AT_TEXTURE == data->mAssetInfo.mType ||
LLAssetType::AT_ANIMATION == data->mAssetInfo.mType)
{
// Charge the user for the upload.
LLViewerRegion* region = gAgent.getRegion();
if(!(can_afford_transaction(expected_upload_cost)))
{
LLFloaterBuyCurrency::buyCurrency(
llformat("Uploading %s costs",
data->mAssetInfo.getName().c_str()), // *TODO: Translate
expected_upload_cost);
is_balance_sufficient = FALSE;
}
else if(region)
{
// Charge user for upload
gStatusBar->debitBalance(expected_upload_cost);
LLMessageSystem* msg = gMessageSystem;
msg->newMessageFast(_PREHASH_MoneyTransferRequest);
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
msg->nextBlockFast(_PREHASH_MoneyData);
msg->addUUIDFast(_PREHASH_SourceID, gAgent.getID());
msg->addUUIDFast(_PREHASH_DestID, LLUUID::null);
msg->addU8("Flags", 0);
// we tell the sim how much we were expecting to pay so it
// can respond to any discrepancy
msg->addS32Fast(_PREHASH_Amount, expected_upload_cost);
msg->addU8Fast(_PREHASH_AggregatePermNextOwner, (U8)LLAggregatePermissions::AP_EMPTY);
msg->addU8Fast(_PREHASH_AggregatePermInventory, (U8)LLAggregatePermissions::AP_EMPTY);
msg->addS32Fast(_PREHASH_TransactionType, TRANS_UPLOAD_CHARGE);
msg->addStringFast(_PREHASH_Description, NULL);
msg->sendReliable(region->getHost());
}
}
if(is_balance_sufficient)
{
// Actually add the upload to inventory
llinfos << "Adding " << uuid << " to inventory." << llendl;
const LLUUID folder_id = gInventory.findCategoryUUIDForType(dest_loc);
if(folder_id.notNull())
{
U32 next_owner_perms = data->mNextOwnerPerm;
if(PERM_NONE == next_owner_perms)
{
next_owner_perms = PERM_MOVE | PERM_TRANSFER;
}
create_inventory_item(gAgent.getID(), gAgent.getSessionID(),
folder_id, data->mAssetInfo.mTransactionID, data->mAssetInfo.getName(),
data->mAssetInfo.getDescription(), data->mAssetInfo.mType,
data->mInventoryType, NOT_WEARABLE, next_owner_perms,
LLPointer<LLInventoryCallback>(NULL));
}
else
{
llwarns << "Can't find a folder to put it in" << llendl;
}
}
}
else // if(result >= 0)
{
LLSD args;
args["FILE"] = LLInventoryType::lookupHumanReadable(data->mInventoryType);
args["REASON"] = std::string(LLAssetStorage::getErrorString(result));
LLNotificationsUtil::add("CannotUploadReason", args);
}
LLUploadDialog::modalUploadFinished();
delete data;
data = NULL;
}
示例9: getObjectInfo
void LLFloaterReporter::getObjectInfo(const LLUUID& object_id)
{
// TODO --
// 1 need to send to correct simulator if object is not
// in same simulator as agent
// 2 display info in widget window that gives feedback that
// we have recorded the object info
// 3 can pick avatar ==> might want to indicate when a picked
// object is an avatar, attachment, or other category
mObjectID = object_id;
if (LLUUID::null != mObjectID)
{
// get object info for the user's benefit
LLViewerObject* objectp = NULL;
objectp = gObjectList.findObject( mObjectID );
if (objectp)
{
if ( objectp->isAttachment() )
{
objectp = (LLViewerObject*)objectp->getRoot();
mObjectID = objectp->getID();
}
// correct the region and position information
LLViewerRegion *regionp = objectp->getRegion();
if (regionp)
{
childSetText("sim_field", regionp->getName());
LLVector3d global_pos;
global_pos.setVec(objectp->getPositionRegion());
setPosBox(global_pos);
}
if (objectp->isAvatar())
{
// we have the information we need
std::string object_owner;
LLNameValue* firstname = objectp->getNVPair("FirstName");
LLNameValue* lastname = objectp->getNVPair("LastName");
if (firstname && lastname)
{
object_owner.append(firstname->getString());
object_owner.append(1, ' ');
object_owner.append(lastname->getString());
}
else
{
object_owner.append("Unknown");
}
setFromAvatar(mObjectID, object_owner);
}
else
{
// we have to query the simulator for information
// about this object
LLMessageSystem* msg = gMessageSystem;
U32 request_flags = COMPLAINT_REPORT_REQUEST;
msg->newMessageFast(_PREHASH_RequestObjectPropertiesFamily);
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
msg->nextBlockFast(_PREHASH_ObjectData);
msg->addU32Fast(_PREHASH_RequestFlags, request_flags );
msg->addUUIDFast(_PREHASH_ObjectID, mObjectID);
LLViewerRegion* regionp = objectp->getRegion();
msg->sendReliable( regionp->getHost() );
}
}
}
}
示例10: apply
void LLPrefsIMImpl::apply()
{
LLTextEditor* busy = getChild<LLTextEditor>("busy_response");
LLWString busy_response;
if (busy) busy_response = busy->getWText();
LLWStringUtil::replaceTabsWithSpaces(busy_response, 4);
LLWStringUtil::replaceChar(busy_response, '\n', '^');
LLWStringUtil::replaceChar(busy_response, ' ', '%');
if(mGotPersonalInfo)
{
gSavedPerAccountSettings.setString("BusyModeResponse", std::string(wstring_to_utf8str(busy_response)));
gSavedSettings.setBOOL("IMInChatHistory", childGetValue("include_im_in_chat_history").asBoolean());
gSavedSettings.setBOOL("IMShowTimestamps", childGetValue("show_timestamps_check").asBoolean());
gSavedSettings.setBOOL("ChatOnlineNotification", childGetValue("friends_online_notify_checkbox").asBoolean());
gSavedPerAccountSettings.setString("InstantMessageLogPath", childGetText("log_path_string"));
gSavedPerAccountSettings.setBOOL("LogInstantMessages",childGetValue("log_instant_messages").asBoolean());
gSavedPerAccountSettings.setBOOL("LogChat",childGetValue("log_chat").asBoolean());
gSavedPerAccountSettings.setBOOL("LogShowHistory",childGetValue("log_show_history").asBoolean());
gSavedPerAccountSettings.setBOOL("IMLogTimestamp",childGetValue("log_instant_messages_timestamp").asBoolean());
gSavedPerAccountSettings.setBOOL("LogChatTimestamp",childGetValue("log_chat_timestamp").asBoolean());
gSavedPerAccountSettings.setBOOL("LogChatIM",childGetValue("log_chat_IM").asBoolean());
gSavedPerAccountSettings.setBOOL("LogTimestampDate",childGetValue("log_date_timestamp").asBoolean());
gDirUtilp->setChatLogsDir(gSavedPerAccountSettings.getString("InstantMessageLogPath"));
gDirUtilp->setPerAccountChatLogsDir(gSavedSettings.getString("FirstName"),
gSavedSettings.getString("LastName") );
LLFile::mkdir(gDirUtilp->getPerAccountChatLogsDir());
bool new_im_via_email = childGetValue("send_im_to_email").asBoolean();
bool new_hide_online = childGetValue("online_visibility").asBoolean();
if((new_im_via_email != mOriginalIMViaEmail)
||(new_hide_online != mOriginalHideOnlineStatus))
{
LLMessageSystem* msg = gMessageSystem;
msg->newMessageFast(_PREHASH_UpdateUserInfo);
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
msg->nextBlockFast(_PREHASH_UserData);
msg->addBOOLFast(_PREHASH_IMViaEMail, new_im_via_email);
// This hack is because we are representing several different
// possible strings with a single checkbox. Since most users
// can only select between 2 values, we represent it as a
// checkbox. This breaks down a little bit for liaisons, but
// works out in the end.
if(new_hide_online != mOriginalHideOnlineStatus)
{
if(new_hide_online) mDirectoryVisibility = VISIBILITY_HIDDEN;
else mDirectoryVisibility = VISIBILITY_DEFAULT;
//Update showonline value, otherwise multiple applys won't work
mOriginalHideOnlineStatus = new_hide_online;
}
msg->addString("DirectoryVisibility", mDirectoryVisibility);
gAgent.sendReliableMessage();
}
}
}
示例11: requestCacheMisses
void LLViewerRegion::requestCacheMisses()
{
S32 full_count = mCacheMissFull.count();
S32 crc_count = mCacheMissCRC.count();
if (full_count == 0 && crc_count == 0) return;
LLMessageSystem* msg = gMessageSystem;
BOOL start_new_message = TRUE;
S32 blocks = 0;
S32 i;
// Send full cache miss updates. For these, we KNOW we don't
// have a viewer object.
for (i = 0; i < full_count; i++)
{
if (start_new_message)
{
msg->newMessageFast(_PREHASH_RequestMultipleObjects);
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
start_new_message = FALSE;
}
msg->nextBlockFast(_PREHASH_ObjectData);
msg->addU8Fast(_PREHASH_CacheMissType, CACHE_MISS_TYPE_FULL);
msg->addU32Fast(_PREHASH_ID, mCacheMissFull[i]);
blocks++;
if (blocks >= 255)
{
sendReliableMessage();
start_new_message = TRUE;
blocks = 0;
}
}
// Send CRC miss updates. For these, we _might_ have a viewer object,
// but probably not.
for (i = 0; i < crc_count; i++)
{
if (start_new_message)
{
msg->newMessageFast(_PREHASH_RequestMultipleObjects);
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
start_new_message = FALSE;
}
msg->nextBlockFast(_PREHASH_ObjectData);
msg->addU8Fast(_PREHASH_CacheMissType, CACHE_MISS_TYPE_CRC);
msg->addU32Fast(_PREHASH_ID, mCacheMissCRC[i]);
blocks++;
if (blocks >= 255)
{
sendReliableMessage();
start_new_message = TRUE;
blocks = 0;
}
}
// finish any pending message
if (!start_new_message)
{
sendReliableMessage();
}
mCacheMissFull.reset();
mCacheMissCRC.reset();
mCacheDirty = TRUE ;
// llinfos << "KILLDEBUG Sent cache miss full " << full_count << " crc " << crc_count << llendl;
#if LL_RECORD_VIEWER_STATS
LLViewerStatsRecorder::instance()->beginObjectUpdateEvents(this);
LLViewerStatsRecorder::instance()->recordRequestCacheMissesEvent(full_count + crc_count);
LLViewerStatsRecorder::instance()->endObjectUpdateEvents();
#endif
}
示例12: serializeSelection
void ScriptCounter::serializeSelection(bool delScript)
{
LLDynamicArray<LLViewerObject*> objectArray;
foo=LLSelectMgr::getInstance()->getSelection()->getPrimaryObject();
sstr.str("");
doDelete=false;
scriptcount=0;
objIDS.clear();
delUUIDS.clear();
objectCount=0;
countingDone=false;
reqObjectID.setNull();
if(foo)
{
if(foo->isAvatar())
{
LLVOAvatar* av=find_avatar_from_object(foo);
if(av)
{
for (LLVOAvatar::attachment_map_t::iterator iter = av->mAttachmentPoints.begin();
iter != av->mAttachmentPoints.end();
++iter)
{
LLViewerJointAttachment* attachment = iter->second;
if (!attachment->getValid())
continue ;
LLViewerObject* object = attachment->getObject();
if(object)
{
objectArray.put(object);
objectCount++;
}
}
}
}
else
{
for (LLObjectSelection::valid_root_iterator iter = LLSelectMgr::getInstance()->getSelection()->valid_root_begin();
iter != LLSelectMgr::getInstance()->getSelection()->valid_root_end(); iter++)
{
LLSelectNode* selectNode = *iter;
LLViewerObject* object = selectNode->getObject();
if(object)
{
objectArray.put(object);
objectCount++;
}
}
doDelete=delScript;
}
F32 throttle = gSavedSettings.getF32("OutBandwidth");
if((throttle == 0.f) || (throttle > 128000.f))
{
gMessageSystem->mPacketRing.setOutBandwidth(128000);
gMessageSystem->mPacketRing.setUseOutThrottle(TRUE);
}
showResult(llformat("Counting scripts, please wait..."));
if((objectCount == 1) && !(foo->isAvatar()))
{
LLViewerObject *reqObject=((LLViewerObject*)foo->getRoot());
if(reqObject->isAvatar())
{
for (LLObjectSelection::iterator iter = LLSelectMgr::getInstance()->getSelection()->begin();
iter != LLSelectMgr::getInstance()->getSelection()->end(); iter++ )
{
LLSelectNode *nodep = *iter;
LLViewerObject* objectp = nodep->getObject();
if (objectp->isRootEdit())
{
reqObjectID=objectp->getID();
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, objectp->getLocalID());
msg->sendReliable(gAgent.getRegionHost());
break;
}
}
}
else
{
reqObjectID=reqObject->getID();
LLMessageSystem* msg = gMessageSystem;
msg->newMessageFast(_PREHASH_RequestObjectPropertiesFamily);
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
msg->nextBlockFast(_PREHASH_ObjectData);
msg->addU32Fast(_PREHASH_RequestFlags, 0 );
msg->addUUIDFast(_PREHASH_ObjectID, reqObjectID);
gAgent.sendReliableMessage();
}
}
serialize(objectArray);
}
}
示例13: get_update
void ImportTracker::get_update(S32 newid, BOOL justCreated, BOOL createSelected)
{
switch (state)
{
//lgg crap to change remaining prim parameters from the ascent system build preferences subtab
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);
//sets texture stuff
LLPrimitive obj;
obj.setNumTEs(U8(10));
S32 shinnyLevel = 0;
static LLCachedControl<std::string> sshinystr(gSavedSettings, "EmeraldBuildPrefs_Shiny");
std::string shinystr = sshinystr;
//if(shinystr == "None") shinnyLevel = 0; //We're already 0.
if(shinystr == "Low") shinnyLevel = 1;
else if(shinystr == "Medium") shinnyLevel = 2;
else if(shinystr == "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());
//sets some object parameters
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->addBOOLFast(_PREHASH_IsTemporary, gSavedSettings.getBOOL("EmeraldBuildPrefs_Temporary"));
msg->addBOOLFast(_PREHASH_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)gSavedPerAccountSettings.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;
//.........这里部分代码省略.........
示例14: LLStartGroupVoteResponder
void LLPanelGroupVoting::impl::sendStartGroupProposal()
{
if ( !gAgent.hasPowerInGroup(mGroupID, GP_PROPOSAL_START) )
return;
F32 majority = 0.f;
S32 duration_seconds = (S32)mDuration->get()*24*60*60; // duration days * 24hours/day * 60min/hr * 60sec/min
switch (mMajority->getSelectedIndex())
{
case 0: // Simple Majority
majority = 0.f;
break;
case 1: // 2/3 Majority
majority = 2.f/3.f;
break;
case 2: // Unanimous
majority = 1.0f;
break;
}
S32 quorum = llfloor(mQuorum->get());
//*************************************Conversion to capability
LLSD body;
std::string url = gAgent.getRegion()->getCapability("StartGroupProposal");
if (!url.empty())
{
body["agent-id"] = gAgent.getID();
body["session-id"] = gAgent.getSessionID();
body["group-id"] = mGroupID;
body["majority"] = majority;
body["quorum"] = quorum;
body["duration"] = duration_seconds;
body["proposal-text"] = mProposalText->getText();
LLHTTPClient::post(
url,
body,
new LLStartGroupVoteResponder(mGroupID),
300);
}
else
{ //DEPRECATED!!!!!!! This is a fallback just in case our backend cap is not there. Delete this block ASAP!
LLMessageSystem *msg = gMessageSystem;
msg->newMessageFast(_PREHASH_StartGroupProposal);
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID() );
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID() );
msg->nextBlockFast(_PREHASH_ProposalData);
msg->addUUIDFast(_PREHASH_GroupID, mGroupID);
msg->addF32Fast(_PREHASH_Majority, majority );
msg->addS32Fast(_PREHASH_Quorum, quorum );
msg->addS32Fast(_PREHASH_Duration, duration_seconds );
msg->addStringFast(_PREHASH_ProposalText, mProposalText->getText());
gAgent.sendReliableMessage();
//This code was moved from the callers to here as part of deprecation.
sendGroupProposalsRequest(mGroupID);
setEnableListProposals();
}
}
示例15: send_extras
// [/RLVa:KB]
void ImportTracker::send_extras(LLSD& prim)
{
LLMessageSystem* msg = gMessageSystem;
msg->newMessageFast(_PREHASH_ObjectExtraParams);
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID() );
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
LLPrimitive obj;
if (prim.has("flexible"))
{
LLFlexibleObjectData flexi;
flexi.fromLLSD(prim["flexible"]);
U8 tmp[MAX_OBJECT_PARAMS_SIZE];
LLDataPackerBinaryBuffer dpb(tmp, MAX_OBJECT_PARAMS_SIZE);
if (flexi.pack(dpb))
{
U32 datasize = (U32)dpb.getCurrentSize();
msg->nextBlockFast(_PREHASH_ObjectData);
msg->addU32Fast(_PREHASH_ObjectLocalID, prim["LocalID"].asInteger());
msg->addU16Fast(_PREHASH_ParamType, 0x10);
msg->addBOOLFast(_PREHASH_ParamInUse, true);
msg->addU32Fast(_PREHASH_ParamSize, datasize);
msg->addBinaryDataFast(_PREHASH_ParamData, tmp, datasize);
}
}
if (prim.has("light"))
{
LLLightParams light;
light.fromLLSD(prim["light"]);
U8 tmp[MAX_OBJECT_PARAMS_SIZE];
LLDataPackerBinaryBuffer dpb(tmp, MAX_OBJECT_PARAMS_SIZE);
if (light.pack(dpb))
{
U32 datasize = (U32)dpb.getCurrentSize();
msg->nextBlockFast(_PREHASH_ObjectData);
msg->addU32Fast(_PREHASH_ObjectLocalID, prim["LocalID"].asInteger());
msg->addU16Fast(_PREHASH_ParamType, 0x20);
msg->addBOOLFast(_PREHASH_ParamInUse, true);
msg->addU32Fast(_PREHASH_ParamSize, datasize);
msg->addBinaryDataFast(_PREHASH_ParamData, tmp, datasize);
}
}
//Phox: Is this really necessary? I think not.
if (prim.has("chat"))
{
send_chat_from_viewer(prim["chat"].asString(), CHAT_TYPE_SHOUT, 0);
}
if (prim.has("sculpt"))
{
LLSculptParams sculpt;
sculpt.fromLLSD(prim["sculpt"]);
U8 tmp[MAX_OBJECT_PARAMS_SIZE];
LLDataPackerBinaryBuffer dpb(tmp, MAX_OBJECT_PARAMS_SIZE);
if (sculpt.pack(dpb))
{
U32 datasize = (U32)dpb.getCurrentSize();
msg->nextBlockFast(_PREHASH_ObjectData);
msg->addU32Fast(_PREHASH_ObjectLocalID, prim["LocalID"].asInteger());
msg->addU16Fast(_PREHASH_ParamType, 0x30);
msg->addBOOLFast(_PREHASH_ParamInUse, true);
msg->addU32Fast(_PREHASH_ParamSize, datasize);
msg->addBinaryDataFast(_PREHASH_ParamData, tmp, datasize);
}
}
msg->sendReliable(gAgent.getRegion()->getHost());
}