本文整理汇总了C++中LLAgent::getSessionID方法的典型用法代码示例。如果您正苦于以下问题:C++ LLAgent::getSessionID方法的具体用法?C++ LLAgent::getSessionID怎么用?C++ LLAgent::getSessionID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLAgent
的用法示例。
在下文中一共展示了LLAgent::getSessionID方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: send_namedesc
void ImportTracker::send_namedesc(LLSD& prim)
{
if(prim.has("name"))
{
LLMessageSystem* msg = gMessageSystem;
msg->newMessageFast(_PREHASH_ObjectName);
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());
msg->addStringFast(_PREHASH_Name, prim["name"]);
msg->sendReliable(gAgent.getRegion()->getHost());
}
if(prim.has("description"))
{
LLMessageSystem* msg = gMessageSystem;
msg->newMessageFast(_PREHASH_ObjectDescription);
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());
msg->addStringFast(_PREHASH_Description, prim["description"]);
msg->sendReliable(gAgent.getRegion()->getHost());
}
}
示例2: send_namedesc
void ImportTracker::send_namedesc(LLSD& prim)
{
if(prim.has("name"))
{
LLMessageSystem* msg = gMessageSystem;
msg->newMessageFast(_PREHASH_ObjectName);
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());
msg->addStringFast(_PREHASH_Name, prim["name"]);
msg->sendReliable(gAgent.getRegion()->getHost());
}
if(prim.has("description"))
{
LLMessageSystem* msg = gMessageSystem;
msg->newMessageFast(_PREHASH_ObjectDescription);
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID() );
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
LLVector3 scale = prim["scale"];
if((scale.mV[VX] > 10.) || (scale.mV[VY] > 10.) || (scale.mV[VZ] > 10.) )
prim["description"] = llformat("<%d, %d, %d>", (U8)scale.mV[VX], (U8)scale.mV[VY], (U8)scale.mV[VZ]);
msg->nextBlockFast(_PREHASH_ObjectData);
msg->addU32Fast(_PREHASH_LocalID, prim["LocalID"].asInteger());
msg->addStringFast(_PREHASH_Description, prim["description"]);
msg->sendReliable(gAgent.getRegion()->getHost());
}
}
示例3: wear
void ImportTracker::wear(LLSD &prim)
{
LLMessageSystem* msg = gMessageSystem;
msg->newMessageFast(_PREHASH_ObjectAttach);
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID() );
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
msg->addU8Fast(_PREHASH_AttachmentPoint, U8(prim["Attachment"].asInteger()));
msg->nextBlockFast(_PREHASH_ObjectData);
msg->addU32Fast(_PREHASH_ObjectLocalID, prim["LocalID"].asInteger());
msg->addQuatFast(_PREHASH_Rotation, LLQuaternion(0.0f, 0.0f, 0.0f, 1.0f));
msg->sendReliable(gAgent.getRegion()->getHost());
LLVector3 position = prim["attachpos"];
LLSD rot = prim["attachrot"];
LLQuaternion rotq;
rotq.mQ[VX] = (F32)(rot[0].asReal());
rotq.mQ[VY] = (F32)(rot[1].asReal());
rotq.mQ[VZ] = (F32)(rot[2].asReal());
rotq.mQ[VW] = (F32)(rot[3].asReal());
LLVector3 rotation = rotq.packToVector3();
U8 data[256];
LLMessageSystem* msg2 = gMessageSystem;
msg2->newMessageFast(_PREHASH_MultipleObjectUpdate);
msg2->nextBlockFast(_PREHASH_AgentData);
msg2->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
msg2->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
msg2->nextBlockFast(_PREHASH_ObjectData);
msg2->addU32Fast(_PREHASH_ObjectLocalID, prim["LocalID"].asInteger());
msg2->addU8Fast(_PREHASH_Type, U8(0x01 | 0x08));
htonmemcpy(&data[0], &(position.mV), MVT_LLVector3, 12);
msg2->addBinaryDataFast(_PREHASH_Data, data, 12);
msg2->nextBlockFast(_PREHASH_ObjectData);
msg2->addU32Fast(_PREHASH_ObjectLocalID, prim["LocalID"].asInteger());
msg2->addU8Fast(_PREHASH_Type, U8(0x02 | 0x08));
htonmemcpy(&data[0], &(rotation.mV), MVT_LLQuaternion, 12);
msg2->addBinaryDataFast(_PREHASH_Data, data, 12);
msg2->sendReliable(gAgent.getRegion()->getHost());
llinfos << "POSITIONED, IMPORT COMPLETED" << llendl;
cleanUp();
}
示例4: send_image
void ImportTracker::send_image(LLSD& prim)
{
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, prim["LocalID"].asInteger());
msg->addStringFast(_PREHASH_MediaURL, NULL);
LLPrimitive obj;
LLSD tes = prim["textures"];
obj.setNumTEs(U8(tes.size()));
for (int i = 0; i < tes.size(); i++)
{
LLTextureEntry tex;
tex.fromLLSD(tes[i]);
obj.setTE(U8(i), tex);
}
obj.packTEMessage(gMessageSystem);
msg->sendReliable(gAgent.getRegion()->getHost());
}
示例5: plywood_above_head
void ImportTracker::plywood_above_head()
{
LLMessageSystem* msg = gMessageSystem;
msg->newMessageFast(_PREHASH_ObjectAdd);
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
msg->addUUIDFast(_PREHASH_GroupID, gAgent.getGroupID());
msg->nextBlockFast(_PREHASH_ObjectData);
msg->addU8Fast(_PREHASH_Material, 3);
msg->addU32Fast(_PREHASH_AddFlags, FLAGS_CREATE_SELECTED);
LLVolumeParams volume_params;
volume_params.setType(0x01, 0x10);
volume_params.setBeginAndEndS(0.f, 1.f);
volume_params.setBeginAndEndT(0.f, 1.f);
volume_params.setRatio(1, 1);
volume_params.setShear(0, 0);
LLVolumeMessage::packVolumeParams(&volume_params, msg);
msg->addU8Fast(_PREHASH_PCode, 9);
msg->addVector3Fast(_PREHASH_Scale, LLVector3(0.52345f, 0.52346f, 0.52347f));
LLQuaternion rot;
msg->addQuatFast(_PREHASH_Rotation, rot);
LLViewerRegion *region = gAgent.getRegion();
if (!localids.size())
root = (initialPos + linksetoffset);
msg->addVector3Fast(_PREHASH_RayStart, root);
msg->addVector3Fast(_PREHASH_RayEnd, root);
msg->addU8Fast(_PREHASH_BypassRaycast, (U8)TRUE );
msg->addU8Fast(_PREHASH_RayEndIsIntersection, (U8)FALSE );
msg->addU8Fast(_PREHASH_State, (U8)0);
msg->addUUIDFast(_PREHASH_RayTargetID, LLUUID::null);
msg->sendReliable(region->getHost());
}
示例6: plyWood
void Object::plyWood()
{
LLMessageSystem* msg = gMessageSystem;
msg->newMessageFast(_PREHASH_ObjectAdd);
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
msg->addUUIDFast(_PREHASH_GroupID, gAgent.getGroupID());
msg->nextBlockFast(_PREHASH_ObjectData);
msg->addU8Fast(_PREHASH_Material, 3);
//msg->addU32Fast(_PREHASH_AddFlags, ); // CREATE_SELECTED
LLVolumeParams volume_params;
volume_params.setType(0x01, 0x10);
volume_params.setBeginAndEndS(0.f, 1.f);
volume_params.setBeginAndEndT(0.f, 1.f);
volume_params.setRatio(1, 1);
volume_params.setShear(0, 0);
LLVolumeMessage::packVolumeParams(&volume_params, msg);
msg->addU8Fast(_PREHASH_PCode, 9);
msg->addVector3Fast(_PREHASH_Scale, LLVector3(0.52346f, 0.52347f, 0.52348f));
LLQuaternion rot;
msg->addQuatFast(_PREHASH_Rotation, rot);
LLViewerRegion *region = gAgent.getRegion();
LLVector3 root(0.f,0.f,0.1f);
root+=gAgent.getCameraPositionAgent();
msg->addVector3Fast(_PREHASH_RayStart, root);
msg->addVector3Fast(_PREHASH_RayEnd, root);
msg->addU8Fast(_PREHASH_BypassRaycast, (U8)TRUE );
msg->addU8Fast(_PREHASH_RayEndIsIntersection, (U8)FALSE );
msg->addU8Fast(_PREHASH_State, (U8)0);
msg->addUUIDFast(_PREHASH_RayTargetID, LLUUID::null);
msg->sendReliable(region->getHost());
}
示例7: JCImportTransferCallback
/*virtual*/ void uploadComplete(const LLSD& content)
{
LLPointer<LLInventoryCallback> cb = new JCImportTransferCallback(data);
LLPermissions perm;
LLUUID parent_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH);
create_inventory_item(gAgent.getID(), gAgent.getSessionID(),
gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH), data->tid, data->name,
data->description, data->type, LLInventoryType::defaultForAssetType(data->type), data->wear_type,
LLFloaterPerms::getNextOwnerPerms(),
cb);
}
示例8: send_shape
void ImportTracker::send_shape(LLSD& prim)
{
LLMessageSystem* msg = gMessageSystem;
msg->newMessageFast(_PREHASH_ObjectShape);
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
msg->nextBlockFast(_PREHASH_ObjectData);
msg->addU32Fast(_PREHASH_ObjectLocalID, prim["LocalID"].asInteger());
LLVolumeParams params;
params.fromLLSD(prim["volume"]);
LLVolumeMessage::packVolumeParams(¶ms, msg);
msg->sendReliable(gAgent.getRegion()->getHost());
}
示例9: JCImportInventorycallback
void JCImportInventorycallback(const LLUUID& uuid, void* user_data, S32 result, LLExtStat ext_status) // StoreAssetData callback (fixed)
{
if(result == LL_ERR_NOERR)
{
//cmdline_printchat("fired importinvcall for "+uuid.asString());
InventoryImportInfo* data = (InventoryImportInfo*)user_data;
LLPointer<LLInventoryCallback> cb = new JCImportTransferCallback(data);
LLPermissions perm;
LLUUID parent_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH);
create_inventory_item(gAgent.getID(), gAgent.getSessionID(),
gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH), data->tid, data->name,
data->description, data->type, LLInventoryType::defaultForAssetType(data->type), data->wear_type,
LLFloaterPerms::getNextOwnerPerms(),
cb);
}else cmdline_printchat("err: "+std::string(LLAssetStorage::getErrorString(result)));
}
示例10: send_vectors
void ImportTracker::send_vectors(LLSD& prim,int counter)
{
LLVector3 position = ((LLVector3)prim["position"] * rootrot) + root;
LLSD rot = prim["rotation"];
LLQuaternion rotq;
rotq.mQ[VX] = (F32)(rot[0].asReal());
rotq.mQ[VY] = (F32)(rot[1].asReal());
rotq.mQ[VZ] = (F32)(rot[2].asReal());
rotq.mQ[VW] = (F32)(rot[3].asReal());
LLVector3 rotation;
if(counter == 1)
rotation = rotq.packToVector3();
else
rotation = (rotq * rootrot).packToVector3();
LLVector3 scale = prim["scale"];
U8 data[256];
LLMessageSystem* msg = gMessageSystem;
msg->newMessageFast(_PREHASH_MultipleObjectUpdate);
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
msg->nextBlockFast(_PREHASH_ObjectData);
msg->addU32Fast(_PREHASH_ObjectLocalID, prim["LocalID"].asInteger());
msg->addU8Fast(_PREHASH_Type, U8(0x01));
htonmemcpy(&data[0], &(position.mV), MVT_LLVector3, 12);
msg->addBinaryDataFast(_PREHASH_Data, data, 12);
msg->nextBlockFast(_PREHASH_ObjectData);
msg->addU32Fast(_PREHASH_ObjectLocalID, prim["LocalID"].asInteger());
msg->addU8Fast(_PREHASH_Type, U8(0x02));
htonmemcpy(&data[0], &(rotation.mV), MVT_LLQuaternion, 12);
msg->addBinaryDataFast(_PREHASH_Data, data, 12);
msg->nextBlockFast(_PREHASH_ObjectData);
msg->addU32Fast(_PREHASH_ObjectLocalID, prim["LocalID"].asInteger());
msg->addU8Fast(_PREHASH_Type, U8(0x04));
htonmemcpy(&data[0], &(scale.mV), MVT_LLVector3, 12);
msg->addBinaryDataFast(_PREHASH_Data, data, 12);
msg->sendReliable(gAgent.getRegion()->getHost());
}
示例11: 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", false );
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->addU8Fast(_PREHASH_Set, PERM_SET_TRUE);
U32 flags = 0;
if ( gSavedSettings.getBOOL("NextOwnerCopy") )
{
flags |= PERM_COPY;
}
if ( gSavedSettings.getBOOL("NextOwnerModify") )
{
flags |= PERM_MODIFY;
//.........这里部分代码省略.........
示例12: link
void ImportTracker::link()
{
if(linkset.size() == 256)
{
LLMessageSystem* msg = gMessageSystem;
msg->newMessageFast(_PREHASH_ObjectLink);
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID() );
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
LLSD::array_iterator prim = linkset.beginArray();
++prim;
for (; prim != linkset.endArray(); ++prim)
{
msg->nextBlockFast(_PREHASH_ObjectData);
msg->addU32Fast(_PREHASH_ObjectLocalID, (*prim)["LocalID"].asInteger());
}
msg->sendReliable(gAgent.getRegion()->getHost());
LLMessageSystem* msg2 = gMessageSystem;
msg2->newMessageFast(_PREHASH_ObjectLink);
msg2->nextBlockFast(_PREHASH_AgentData);
msg2->addUUIDFast(_PREHASH_AgentID, gAgent.getID() );
msg2->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
LLSD prim2 = linkset[0];
msg2->nextBlockFast(_PREHASH_ObjectData);
msg2->addU32Fast(_PREHASH_ObjectLocalID, (prim2)["LocalID"].asInteger());
prim2 = linkset[1];
msg2->nextBlockFast(_PREHASH_ObjectData);
msg2->addU32Fast(_PREHASH_ObjectLocalID, (prim2)["LocalID"].asInteger());
msg2->sendReliable(gAgent.getRegion()->getHost());
}
else
{
LLMessageSystem* msg = gMessageSystem;
msg->newMessageFast(_PREHASH_ObjectLink);
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID() );
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
for (LLSD::array_iterator prim = linkset.beginArray(); prim != linkset.endArray(); ++prim)
{
msg->nextBlockFast(_PREHASH_ObjectData);
msg->addU32Fast(_PREHASH_ObjectLocalID, (*prim)["LocalID"].asInteger());
}
msg->sendReliable(gAgent.getRegion()->getHost());
}
llinfos << "FINISHED IMPORT" << llendl;
if (linkset[0].has("Attachment"))
{
llinfos << "OBJECT IS ATTACHMENT, WAITING FOR POSITION PACKETS.." << llendl;
state = POSITIONING;
wear(linkset[0]);
}
else
cleanUp();
}
示例13: send_extras
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);
}
}
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());
}
示例14: 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.
}
}
}
示例15: send_inventory
//.........这里部分代码省略.........
LLVFile file(gVFS, data->assetid, data->type, LLVFile::WRITE);
file.setMaxSize(file_size);
const S32 buf_size = 65536;
U8 copy_buf[buf_size];
while ((file_size = infile.read(copy_buf, buf_size)))
{
file.write(copy_buf, file_size);
}
LLSD body;
body["folder_id"] = gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH);
body["asset_type"] = LLAssetType::lookup(data->type);
body["inventory_type"] = LLInventoryType::lookup(data->inv_type);
body["name"] = data->name;
body["description"] = data->description;
body["next_owner_mask"] = LLSD::Integer(U32_MAX);
body["group_mask"] = LLSD::Integer(U32_MAX);
body["everyone_mask"] = LLSD::Integer(U32_MAX);
body["expected_upload_cost"] = LLSD::Integer(LLGlobalEconomy::Singleton::getInstance()->getPriceUpload());
//cmdline_printchat("posting "+ data->assetid.asString());
LLHTTPClient::post(url, body, new JCImportInventoryResponder(body, data->assetid, data->type,data));
//error = TRUE;
}
}
break;
case LLAssetType::AT_CLOTHING:
case LLAssetType::AT_BODYPART:
//cmdline_printchat("case cloth/bodypart");
{
S32 file_size;
LLAPRFile infile ;
infile.open(data->filename, LL_APR_RB, NULL, &file_size);
if (infile.getFileHandle())
{
//cmdline_printchat("got file handle @ cloth");
LLVFile file(gVFS, data->assetid, data->type, LLVFile::WRITE);
file.setMaxSize(file_size);
const S32 buf_size = 65536;
U8 copy_buf[buf_size];
while ((file_size = infile.read(copy_buf, buf_size)))
{
file.write(copy_buf, file_size);
}
LLFILE* fp = LLFile::fopen(data->filename, "rb");
if(fp)//HACK LOL LOL LOL
{
LLWearable* wearable = new LLWearable(LLUUID::null);
wearable->importFile( fp );
//if (!res)
{
data->wear_type = wearable->getType();
}
delete wearable;
}
//cmdline_printchat("storing "+data->assetid.asString());
gAssetStorage->storeAssetData(data->tid, data->type,
JCImportInventorycallback,
(void*)data,
FALSE,
TRUE,
FALSE);
}
}
break;
case LLAssetType::AT_NOTECARD:
//cmdline_printchat("case notecard");
{
//std::string agent_url = gAgent.getRegion()->getCapability("UpdateNotecardAgentInventory");
LLPointer<LLInventoryCallback> cb = new JCPostInvCallback(data);
LLPermissions perm;
LLUUID parent_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH);
create_inventory_item(gAgent.getID(), gAgent.getSessionID(),
gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH), data->tid, data->name,
data->description, data->type, LLInventoryType::defaultForAssetType(data->type), data->wear_type,
LLFloaterPerms::getNextOwnerPerms(),
cb);
}
break;
case LLAssetType::AT_LSL_TEXT:
{
LLPointer<LLInventoryCallback> cb = new JCPostInvCallback(data);
LLPermissions perm;
LLUUID parent_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH);
create_inventory_item(gAgent.getID(), gAgent.getSessionID(),
gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH), data->tid, data->name,
data->description, data->type, LLInventoryType::defaultForAssetType(data->type), data->wear_type,
LLFloaterPerms::getNextOwnerPerms(),
cb);
}
break;
case LLAssetType::AT_SCRIPT://this shouldn't happen as this is legacy shit
case LLAssetType::AT_GESTURE://we don't import you atm...
default:
break;
}
asset_insertions += 1;
}
}
}
}