Commit e2f3fb1c authored by Rye Mutt's avatar Rye Mutt 🍞
Browse files

Replace usage of slower UDP packet functions with fast variants to reduce mutex locks and stutter

parent 9b3b346d
......@@ -250,9 +250,9 @@ void LLLandmark::requestRegionHandle(
}
LL_DEBUGS("Landmark") << "Landmark requesting information about: "
<< region_id << LL_ENDL;
msg->newMessage("RegionHandleRequest");
msg->nextBlock("RequestBlock");
msg->addUUID("RegionID", region_id);
msg->newMessageFast(_PREHASH_RegionHandleRequest);
msg->nextBlockFast(_PREHASH_RequestBlock);
msg->addUUIDFast(_PREHASH_RegionID, region_id);
msg->sendReliable(upstream_host);
}
else if(callback)
......@@ -280,12 +280,12 @@ void LLLandmark::setRegionHandle(const LLUUID& region_id, U64 region_handle)
void LLLandmark::processRegionIDAndHandle(LLMessageSystem* msg, void**)
{
LLUUID region_id;
msg->getUUID("ReplyBlock", "RegionID", region_id);
msg->getUUIDFast(_PREHASH_ReplyBlock, _PREHASH_RegionID, region_id);
mRegions.erase(region_id);
CacheInfo info;
const F32 CACHE_EXPIRY_SECONDS = 60.0f * 10.0f; // ten minutes
info.mTimer.setTimerExpirySec(CACHE_EXPIRY_SECONDS);
msg->getU64("ReplyBlock", "RegionHandle", info.mRegionHandle);
msg->getU64Fast(_PREHASH_ReplyBlock, _PREHASH_RegionHandle, info.mRegionHandle);
region_map_t::value_type vt(region_id, info);
mRegions.insert(vt);
......
......@@ -951,7 +951,7 @@ BOOL LLCircuitData::updateWatchDogTimers(LLMessageSystem *msgsys)
// Send off the another ping.
pingTimerStart();
msgsys->newMessageFast(_PREHASH_StartPingCheck);
msgsys->nextBlock(_PREHASH_PingID);
msgsys->nextBlockFast(_PREHASH_PingID);
msgsys->addU8Fast(_PREHASH_PingID, nextPingID());
msgsys->addU32Fast(_PREHASH_OldestUnacked, packet_id);
msgsys->sendMessage(mHost);
......
......@@ -81,10 +81,10 @@ void LLTransferManager::init()
mValid = TRUE;
// Register message system handlers
gMessageSystem->setHandlerFunc("TransferRequest", processTransferRequest, NULL);
gMessageSystem->setHandlerFunc("TransferInfo", processTransferInfo, NULL);
gMessageSystem->setHandlerFunc("TransferPacket", processTransferPacket, NULL);
gMessageSystem->setHandlerFunc("TransferAbort", processTransferAbort, NULL);
gMessageSystem->setHandlerFuncFast(_PREHASH_TransferRequest, processTransferRequest, NULL);
gMessageSystem->setHandlerFuncFast(_PREHASH_TransferInfo, processTransferInfo, NULL);
gMessageSystem->setHandlerFuncFast(_PREHASH_TransferPacket, processTransferPacket, NULL);
gMessageSystem->setHandlerFuncFast(_PREHASH_TransferAbort, processTransferAbort, NULL);
}
......@@ -212,17 +212,17 @@ void LLTransferManager::processTransferRequest(LLMessageSystem *msgp, void **)
LLTransferChannelType channel_type;
F32 priority;
msgp->getUUID("TransferInfo", "TransferID", transfer_id);
msgp->getUUIDFast(_PREHASH_TransferInfo, _PREHASH_TransferID, transfer_id);
S32 temp_source_type;
msgp->getS32("TransferInfo", "SourceType", temp_source_type);
msgp->getS32Fast(_PREHASH_TransferInfo, _PREHASH_SourceType, temp_source_type);
source_type = (LLTransferSourceType)temp_source_type;
S32 temp_channel_type;
msgp->getS32("TransferInfo", "ChannelType", temp_channel_type);
msgp->getS32Fast(_PREHASH_TransferInfo, _PREHASH_ChannelType, temp_channel_type);
channel_type = (LLTransferChannelType)temp_channel_type;
msgp->getF32("TransferInfo", "Priority", priority);
msgp->getF32Fast(_PREHASH_TransferInfo, _PREHASH_Priority, priority);
LLTransferSourceChannel *tscp = gTransferManager.getSourceChannel(msgp->getSender(), channel_type);
......@@ -238,7 +238,7 @@ void LLTransferManager::processTransferRequest(LLMessageSystem *msgp, void **)
return;
}
S32 size = msgp->getSize("TransferInfo", "Params");
S32 size = msgp->getSizeFast(_PREHASH_TransferInfo, _PREHASH_Params);
if(size > MAX_PARAMS_SIZE)
{
LL_WARNS() << "LLTransferManager::processTransferRequest params too big."
......@@ -258,7 +258,7 @@ void LLTransferManager::processTransferRequest(LLMessageSystem *msgp, void **)
return;
}
U8 tmp[MAX_PARAMS_SIZE];
msgp->getBinaryData("TransferInfo", "Params", tmp, size);
msgp->getBinaryDataFast(_PREHASH_TransferInfo, _PREHASH_Params, tmp, size);
LLDataPackerBinaryBuffer dpb(tmp, MAX_PARAMS_SIZE);
BOOL unpack_ok = tsp->unpackParams(dpb);
......@@ -288,17 +288,17 @@ void LLTransferManager::processTransferInfo(LLMessageSystem *msgp, void **)
LLTSCode status;
S32 size;
msgp->getUUID("TransferInfo", "TransferID", transfer_id);
msgp->getUUIDFast(_PREHASH_TransferInfo, _PREHASH_TransferID, transfer_id);
S32 temp_channel_type;
msgp->getS32("TransferInfo", "ChannelType", temp_channel_type);
msgp->getS32Fast(_PREHASH_TransferInfo, _PREHASH_ChannelType, temp_channel_type);
channel_type = (LLTransferChannelType)temp_channel_type;
S32 temp_status;
msgp->getS32("TransferInfo", "Status", temp_status);
msgp->getS32Fast(_PREHASH_TransferInfo, _PREHASH_Status, temp_status);
status = (LLTSCode)temp_status;
msgp->getS32("TransferInfo", "Size", size);
msgp->getS32Fast(_PREHASH_TransferInfo, _PREHASH_Size, size);
//LL_INFOS() << transfer_id << ":" << target_type<< ":" << channel_type << LL_ENDL;
LLTransferTargetChannel *ttcp = gTransferManager.getTargetChannel(msgp->getSender(), channel_type);
......@@ -328,7 +328,7 @@ void LLTransferManager::processTransferInfo(LLMessageSystem *msgp, void **)
}
// unpack the params
S32 params_size = msgp->getSize("TransferInfo", "Params");
S32 params_size = msgp->getSizeFast(_PREHASH_TransferInfo, _PREHASH_Params);
if(params_size > MAX_PARAMS_SIZE)
{
LL_WARNS() << "LLTransferManager::processTransferInfo params too big."
......@@ -338,7 +338,7 @@ void LLTransferManager::processTransferInfo(LLMessageSystem *msgp, void **)
else if(params_size > 0)
{
U8 tmp[MAX_PARAMS_SIZE];
msgp->getBinaryData("TransferInfo", "Params", tmp, params_size);
msgp->getBinaryDataFast(_PREHASH_TransferInfo, _PREHASH_Params, tmp, params_size);
LLDataPackerBinaryBuffer dpb(tmp, MAX_PARAMS_SIZE);
if (!ttp->unpackParams(dpb))
{
......@@ -431,16 +431,16 @@ void LLTransferManager::processTransferPacket(LLMessageSystem *msgp, void **)
S32 packet_id;
LLTSCode status;
S32 size;
msgp->getUUID("TransferData", "TransferID", transfer_id);
msgp->getUUIDFast(_PREHASH_TransferData, _PREHASH_TransferID, transfer_id);
S32 temp_channel_type;
msgp->getS32("TransferData", "ChannelType", temp_channel_type);
msgp->getS32Fast(_PREHASH_TransferData, _PREHASH_ChannelType, temp_channel_type);
channel_type = (LLTransferChannelType)temp_channel_type;
msgp->getS32("TransferData", "Packet", packet_id);
msgp->getS32Fast(_PREHASH_TransferData, _PREHASH_Packet, packet_id);
S32 temp_status;
msgp->getS32("TransferData", "Status", temp_status);
msgp->getS32Fast(_PREHASH_TransferData, _PREHASH_Status, temp_status);
status = (LLTSCode)temp_status;
// Find the transfer associated with this packet.
......@@ -461,7 +461,7 @@ void LLTransferManager::processTransferPacket(LLMessageSystem *msgp, void **)
return;
}
size = msgp->getSize("TransferData", "Data");
size = msgp->getSizeFast(_PREHASH_TransferData, _PREHASH_Data);
S32 msg_bytes = 0;
if (msgp->getReceiveCompressedSize())
......@@ -484,7 +484,7 @@ void LLTransferManager::processTransferPacket(LLMessageSystem *msgp, void **)
if (size > 0)
{
// Only pull the data out if the size is > 0
msgp->getBinaryData("TransferData", "Data", tmp_data, size);
msgp->getBinaryDataFast(_PREHASH_TransferData, _PREHASH_Data, tmp_data, size);
}
if ((!ttp->gotInfo()) || (ttp->getNextPacketID() != packet_id))
......@@ -589,10 +589,10 @@ void LLTransferManager::processTransferAbort(LLMessageSystem *msgp, void **)
LLUUID transfer_id;
LLTransferChannelType channel_type;
msgp->getUUID("TransferInfo", "TransferID", transfer_id);
msgp->getUUIDFast(_PREHASH_TransferInfo, _PREHASH_TransferID, transfer_id);
S32 temp_channel_type;
msgp->getS32("TransferInfo", "ChannelType", temp_channel_type);
msgp->getS32Fast(_PREHASH_TransferInfo, _PREHASH_ChannelType, temp_channel_type);
channel_type = (LLTransferChannelType)temp_channel_type;
// See if it's a target that we're trying to abort
......@@ -836,13 +836,13 @@ void LLTransferSourceChannel::updateTransfers()
// Send the data now, even if it's an error.
// The status code will tell the other end what to do.
gMessageSystem->newMessage("TransferPacket");
gMessageSystem->nextBlock("TransferData");
gMessageSystem->addUUID("TransferID", tsp->getID());
gMessageSystem->addS32("ChannelType", getChannelType());
gMessageSystem->addS32("Packet", packet_id); // HACK! Need to put in a REAL packet id
gMessageSystem->addS32("Status", status);
gMessageSystem->addBinaryData("Data", datap, data_size);
gMessageSystem->newMessageFast(_PREHASH_TransferPacket);
gMessageSystem->nextBlockFast(_PREHASH_TransferData);
gMessageSystem->addUUIDFast(_PREHASH_TransferID, tsp->getID());
gMessageSystem->addS32Fast(_PREHASH_ChannelType, getChannelType());
gMessageSystem->addS32Fast(_PREHASH_Packet, packet_id); // HACK! Need to put in a REAL packet id
gMessageSystem->addS32Fast(_PREHASH_Status, status);
gMessageSystem->addBinaryDataFast(_PREHASH_Data, datap, data_size);
sent_bytes = gMessageSystem->getCurrentSendTotal();
gMessageSystem->sendReliable(getHost(), LL_DEFAULT_RELIABLE_RETRIES, TRUE, F32Seconds(0.f),
LLTransferManager::reliablePacketCallback, (void**)cb_uuid);
......@@ -1002,18 +1002,18 @@ void LLTransferTargetChannel::sendTransferRequest(LLTransferTarget *targetp,
llassert(targetp);
llassert(targetp->getChannel() == this);
gMessageSystem->newMessage("TransferRequest");
gMessageSystem->nextBlock("TransferInfo");
gMessageSystem->addUUID("TransferID", targetp->getID());
gMessageSystem->addS32("SourceType", params.getType());
gMessageSystem->addS32("ChannelType", getChannelType());
gMessageSystem->addF32("Priority", priority);
gMessageSystem->newMessageFast(_PREHASH_TransferRequest);
gMessageSystem->nextBlockFast(_PREHASH_TransferInfo);
gMessageSystem->addUUIDFast(_PREHASH_TransferID, targetp->getID());
gMessageSystem->addS32Fast(_PREHASH_SourceType, params.getType());
gMessageSystem->addS32Fast(_PREHASH_ChannelType, getChannelType());
gMessageSystem->addF32Fast(_PREHASH_Priority, priority);
U8 tmp[MAX_PARAMS_SIZE];
LLDataPackerBinaryBuffer dp(tmp, MAX_PARAMS_SIZE);
params.packParams(dp);
S32 len = dp.getCurrentSize();
gMessageSystem->addBinaryData("Params", tmp, len);
gMessageSystem->addBinaryDataFast(_PREHASH_Params, tmp, len);
gMessageSystem->sendReliable(mHost);
}
......@@ -1092,18 +1092,18 @@ LLTransferSource::~LLTransferSource()
void LLTransferSource::sendTransferStatus(LLTSCode status)
{
gMessageSystem->newMessage("TransferInfo");
gMessageSystem->nextBlock("TransferInfo");
gMessageSystem->addUUID("TransferID", getID());
gMessageSystem->addS32("TargetType", LLTTT_UNKNOWN);
gMessageSystem->addS32("ChannelType", mChannelp->getChannelType());
gMessageSystem->addS32("Status", status);
gMessageSystem->addS32("Size", mSize);
gMessageSystem->newMessageFast(_PREHASH_TransferInfo);
gMessageSystem->nextBlockFast(_PREHASH_TransferInfo);
gMessageSystem->addUUIDFast(_PREHASH_TransferID, getID());
gMessageSystem->addS32Fast(_PREHASH_TargetType, LLTTT_UNKNOWN);
gMessageSystem->addS32Fast(_PREHASH_ChannelType, mChannelp->getChannelType());
gMessageSystem->addS32Fast(_PREHASH_Status, status);
gMessageSystem->addS32Fast(_PREHASH_Size, mSize);
U8 tmp[MAX_PARAMS_SIZE];
LLDataPackerBinaryBuffer dp(tmp, MAX_PARAMS_SIZE);
packParams(dp);
S32 len = dp.getCurrentSize();
gMessageSystem->addBinaryData("Params", tmp, len);
gMessageSystem->addBinaryDataFast(_PREHASH_Params, tmp, len);
gMessageSystem->sendReliable(mChannelp->getHost());
// Abort if there was as asset system issue.
......@@ -1122,10 +1122,10 @@ void LLTransferSource::abortTransfer()
{
// Send a message down, call the completion callback
LL_INFOS() << "LLTransferSource::Aborting transfer " << getID() << " to " << mChannelp->getHost() << LL_ENDL;
gMessageSystem->newMessage("TransferAbort");
gMessageSystem->nextBlock("TransferInfo");
gMessageSystem->addUUID("TransferID", getID());
gMessageSystem->addS32("ChannelType", mChannelp->getChannelType());
gMessageSystem->newMessageFast(_PREHASH_TransferAbort);
gMessageSystem->nextBlockFast(_PREHASH_TransferInfo);
gMessageSystem->addUUIDFast(_PREHASH_TransferID, getID());
gMessageSystem->addS32Fast(_PREHASH_ChannelType, mChannelp->getChannelType());
gMessageSystem->sendReliable(mChannelp->getHost());
completionCallback(LLTS_ABORT);
......@@ -1255,10 +1255,10 @@ void LLTransferTarget::abortTransfer()
{
// Send a message up, call the completion callback
LL_INFOS() << "LLTransferTarget::Aborting transfer " << getID() << " from " << mChannelp->getHost() << LL_ENDL;
gMessageSystem->newMessage("TransferAbort");
gMessageSystem->nextBlock("TransferInfo");
gMessageSystem->addUUID("TransferID", getID());
gMessageSystem->addS32("ChannelType", mChannelp->getChannelType());
gMessageSystem->newMessageFast(_PREHASH_TransferAbort);
gMessageSystem->nextBlockFast(_PREHASH_TransferInfo);
gMessageSystem->addUUIDFast(_PREHASH_TransferID, getID());
gMessageSystem->addS32Fast(_PREHASH_ChannelType, mChannelp->getChannelType());
gMessageSystem->sendReliable(mChannelp->getHost());
completionCallback(LLTS_ABORT);
......
......@@ -172,9 +172,9 @@ S32 LLXfer_File::startDownload()
gMessageSystem->nextBlockFast(_PREHASH_XferID);
gMessageSystem->addU64Fast(_PREHASH_ID, mID);
gMessageSystem->addStringFast(_PREHASH_Filename, mRemoteFilename);
gMessageSystem->addU8("FilePath", (U8) mRemotePath);
gMessageSystem->addBOOL("DeleteOnCompletion", mDeleteRemoteOnCompletion);
gMessageSystem->addBOOL("UseBigPackets", BOOL(mChunkSize == LL_XFER_LARGE_PAYLOAD));
gMessageSystem->addU8Fast(_PREHASH_FilePath, (U8) mRemotePath);
gMessageSystem->addBOOLFast(_PREHASH_DeleteOnCompletion, mDeleteRemoteOnCompletion);
gMessageSystem->addBOOLFast(_PREHASH_UseBigPackets, BOOL(mChunkSize == LL_XFER_LARGE_PAYLOAD));
gMessageSystem->addUUIDFast(_PREHASH_VFileID, LLUUID::null);
gMessageSystem->addS16Fast(_PREHASH_VFileType, -1);
......
......@@ -162,9 +162,9 @@ S32 LLXfer_Mem::startDownload()
gMessageSystem->nextBlockFast(_PREHASH_XferID);
gMessageSystem->addU64Fast(_PREHASH_ID, mID);
gMessageSystem->addStringFast(_PREHASH_Filename, mRemoteFilename);
gMessageSystem->addU8("FilePath", (U8) mRemotePath);
gMessageSystem->addBOOL("DeleteOnCompletion", mDeleteRemoteOnCompletion);
gMessageSystem->addBOOL("UseBigPackets", BOOL(mChunkSize == LL_XFER_LARGE_PAYLOAD));
gMessageSystem->addU8Fast(_PREHASH_FilePath, (U8) mRemotePath);
gMessageSystem->addBOOLFast(_PREHASH_DeleteOnCompletion, mDeleteRemoteOnCompletion);
gMessageSystem->addBOOLFast(_PREHASH_UseBigPackets, BOOL(mChunkSize == LL_XFER_LARGE_PAYLOAD));
gMessageSystem->addUUIDFast(_PREHASH_VFileID, LLUUID::null);
gMessageSystem->addS16Fast(_PREHASH_VFileType, -1);
......
......@@ -154,9 +154,9 @@ S32 LLXfer_VFile::startDownload()
gMessageSystem->nextBlockFast(_PREHASH_XferID);
gMessageSystem->addU64Fast(_PREHASH_ID, mID);
gMessageSystem->addStringFast(_PREHASH_Filename, "");
gMessageSystem->addU8("FilePath", (U8) LL_PATH_NONE);
gMessageSystem->addBOOL("DeleteOnCompletion", FALSE);
gMessageSystem->addBOOL("UseBigPackets", BOOL(mChunkSize == LL_XFER_LARGE_PAYLOAD));
gMessageSystem->addU8Fast(_PREHASH_FilePath, (U8) LL_PATH_NONE);
gMessageSystem->addBOOLFast(_PREHASH_DeleteOnCompletion, FALSE);
gMessageSystem->addBOOLFast(_PREHASH_UseBigPackets, BOOL(mChunkSize == LL_XFER_LARGE_PAYLOAD));
gMessageSystem->addUUIDFast(_PREHASH_VFileID, mRemoteID);
gMessageSystem->addS16Fast(_PREHASH_VFileType, (S16)mType);
......
......@@ -1767,7 +1767,7 @@ void process_start_ping_check(LLMessageSystem *msgsystem, void** /*user_data*/)
// Send off the response
msgsystem->newMessageFast(_PREHASH_CompletePingCheck);
msgsystem->nextBlockFast(_PREHASH_PingID);
msgsystem->addU8(_PREHASH_PingID, ping_id);
msgsystem->addU8Fast(_PREHASH_PingID, ping_id);
msgsystem->sendMessage(msgsystem->getSender());
}
......@@ -2001,17 +2001,17 @@ void LLMessageSystem::processUseCircuitCode(LLMessageSystem* msg,
void LLMessageSystem::processError(LLMessageSystem* msg, void**)
{
S32 error_code = 0;
msg->getS32("Data", "Code", error_code);
msg->getS32Fast(_PREHASH_Data, _PREHASH_Code, error_code);
std::string error_token;
msg->getString("Data", "Token", error_token);
msg->getStringFast(_PREHASH_Data, _PREHASH_Token, error_token);
LLUUID error_id;
msg->getUUID("Data", "ID", error_id);
msg->getUUIDFast(_PREHASH_Data, _PREHASH_ID, error_id);
std::string error_system;
msg->getString("Data", "System", error_system);
msg->getStringFast(_PREHASH_Data, _PREHASH_System, error_system);
std::string error_message;
msg->getString("Data", "Message", error_message);
msg->getStringFast(_PREHASH_Data, _PREHASH_Message, error_message);
LL_WARNS("Messaging") << "Message error from " << msg->getSender() << " - "
<< error_code << " " << error_token << " " << error_id << " \""
......@@ -2539,13 +2539,12 @@ bool start_messaging_system(
gMessageSystem->setHandlerFuncFast(_PREHASH_DenyTrustedCircuit,
process_deny_trusted_circuit,
NULL);
gMessageSystem->setHandlerFunc("Error", LLMessageSystem::processError);
gMessageSystem->setHandlerFuncFast(_PREHASH_Error, LLMessageSystem::processError);
// We can hand this to the null_message_callback since it is a
// trusted message, so it will automatically be denied if it isn't
// trusted and ignored if it is -- exactly what we want.
gMessageSystem->setHandlerFunc(
"RequestTrustedCircuit",
gMessageSystem->setHandlerFuncFast(_PREHASH_RequestTrustedCircuit,
null_message_callback,
NULL);
......
......@@ -1036,12 +1036,12 @@ void LLUrlEntryParcel::sendParcelInfoRequest(const LLUUID& parcel_id)
if (sRegionHost.isInvalid() || sDisconnected) return;
LLMessageSystem *msg = gMessageSystem;
msg->newMessage("ParcelInfoRequest");
msg->newMessageFast(_PREHASH_ParcelInfoRequest);
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, sAgentID );
msg->addUUID("SessionID", sSessionID);
msg->nextBlock("Data");
msg->addUUID("ParcelID", parcel_id);
msg->addUUIDFast(_PREHASH_SessionID, sSessionID);
msg->nextBlockFast(_PREHASH_Data);
msg->addUUIDFast(_PREHASH_ParcelID, parcel_id);
msg->sendReliable(sRegionHost);
}
......
......@@ -650,13 +650,13 @@ bool ALAvatarActions::handleParcelFreeze(const LLSD& notification, const LLSD& r
const auto& id = it->asUUID();
LLMessageSystem* msg = gMessageSystem;
msg->newMessage("FreezeUser");
msg->nextBlock("AgentData");
msg->addUUID("AgentID", gAgent.getID());
msg->addUUID("SessionID", gAgent.getSessionID());
msg->nextBlock("Data");
msg->addUUID("TargetID", id);
msg->addU32("Flags", flags);
msg->newMessageFast(_PREHASH_FreezeUser);
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
msg->nextBlockFast(_PREHASH_Data);
msg->addUUIDFast(_PREHASH_TargetID, id);
msg->addU32Fast(_PREHASH_Flags, flags);
gAgent.sendReliableMessage();
}
}
......@@ -679,13 +679,13 @@ bool ALAvatarActions::handleParcelEject(const LLSD& notification, const LLSD& re
const auto& id = it->asUUID();
U32 flags = (1 == option && ban_enabled) ? 0x1 : 0x0;
LLMessageSystem* msg = gMessageSystem;
msg->newMessage("EjectUser");
msg->nextBlock("AgentData");
msg->addUUID("AgentID", gAgent.getID());
msg->addUUID("SessionID", gAgent.getSessionID());
msg->nextBlock("Data");
msg->addUUID("TargetID", id);
msg->addU32("Flags", flags);
msg->newMessageFast(_PREHASH_EjectUser);
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
msg->nextBlockFast(_PREHASH_Data);
msg->addUUIDFast(_PREHASH_TargetID, id);
msg->addU32Fast(_PREHASH_Flags, flags);
gAgent.sendReliableMessage();
}
return false;
......
......@@ -3155,13 +3155,13 @@ BOOL LLAgent::setGroupContribution(const LLUUID& group_id, S32 contribution)
{
mGroups[i].mContribution = contribution;
LLMessageSystem* msg = gMessageSystem;
msg->newMessage("SetGroupContribution");
msg->nextBlock("AgentData");
msg->addUUID("AgentID", gAgentID);
msg->addUUID("SessionID", gAgentSessionID);
msg->nextBlock("Data");
msg->addUUID("GroupID", group_id);
msg->addS32("Contribution", contribution);
msg->newMessageFast(_PREHASH_SetGroupContribution);
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgentID);
msg->addUUIDFast(_PREHASH_SessionID, gAgentSessionID);
msg->nextBlockFast(_PREHASH_Data);
msg->addUUIDFast(_PREHASH_GroupID, group_id);
msg->addS32Fast(_PREHASH_Contribution, contribution);
sendReliableMessage();
return TRUE;
}
......@@ -3179,15 +3179,15 @@ BOOL LLAgent::setUserGroupFlags(const LLUUID& group_id, BOOL accept_notices, BOO
mGroups[i].mAcceptNotices = accept_notices;
mGroups[i].mListInProfile = list_in_profile;
LLMessageSystem* msg = gMessageSystem;
msg->newMessage("SetGroupAcceptNotices");
msg->nextBlock("AgentData");
msg->addUUID("AgentID", gAgentID);
msg->addUUID("SessionID", gAgentSessionID);
msg->nextBlock("Data");
msg->addUUID("GroupID", group_id);
msg->addBOOL("AcceptNotices", accept_notices);
msg->nextBlock("NewData");
msg->addBOOL("ListInProfile", list_in_profile);
msg->newMessageFast(_PREHASH_SetGroupAcceptNotices);
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgentID);
msg->addUUIDFast(_PREHASH_SessionID, gAgentSessionID);
msg->nextBlockFast(_PREHASH_Data);
msg->addUUIDFast(_PREHASH_GroupID, group_id);
msg->addBOOLFast(_PREHASH_AcceptNotices, accept_notices);
msg->nextBlockFast(_PREHASH_NewData);
msg->addBOOLFast(_PREHASH_ListInProfile, list_in_profile);
sendReliableMessage();
return TRUE;
}
......@@ -3780,8 +3780,8 @@ void LLAgent::processAgentDataUpdate(LLMessageSystem *msg, void **)
if(active_id.notNull())
{
gAgent.mGroupID = active_id;
msg->getU64(_PREHASH_AgentData, "GroupPowers", gAgent.mGroupPowers);
msg->getString(_PREHASH_AgentData, _PREHASH_GroupName, gAgent.mGroupName);
msg->getU64Fast(_PREHASH_AgentData, _PREHASH_GroupPowers, gAgent.mGroupPowers);
msg->getStringFast(_PREHASH_AgentData, _PREHASH_GroupName, gAgent.mGroupName);
}
else
{
......@@ -4320,19 +4320,19 @@ void LLAgent::teleportRequest(const U64& region_handle, const LLVector3& pos_loc
LL_INFOS("Teleport") << "Sending TeleportLocationRequest: '" << region_handle << "':"
<< pos_local << LL_ENDL;
LLMessageSystem* msg = gMessageSystem;
msg->newMessage("TeleportLocationRequest");
msg->newMessageFast(_PREHASH_TeleportLocationRequest);
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, getID());
msg->addUUIDFast(_PREHASH_SessionID, getSessionID());
msg->nextBlockFast(_PREHASH_Info);
msg->addU64("RegionHandle", region_handle);
msg->addVector3("Position", pos_local);
msg->addU64Fast(_PREHASH_RegionHandle, region_handle);
msg->addVector3Fast(_PREHASH_Position, pos_local);
// LLVector3 look_at(0,1,0);
// if (look_at_from_camera)
// {
// look_at = LLViewerCamera::getInstance()->getAtAxis();
// }
msg->addVector3("LookAt", look_at);
msg->addVector3Fast(_PREHASH_LookAt, look_at);
sendReliableMessage();
}
}
......@@ -4411,7 +4411,7 @@ void LLAgent::doTeleportViaLure(const LLUUID& lure_id, BOOL godlike)
msg->addUUIDFast(_PREHASH_SessionID, getSessionID());
msg->addUUIDFast(_PREHASH_LureID, lure_id);
// teleport_flags is a legacy field, now derived sim-side:
msg->addU32("TeleportFlags", teleport_flags);
msg->addU32Fast(_PREHASH_TeleportFlags, teleport_flags);
sendReliableMessage();
}
}
......@@ -4429,7 +4429,7 @@ void LLAgent::teleportCancel()
// send the message
LLMessageSystem* msg = gMessageSystem;
msg->newMessage("TeleportCancel");
msg->newMessageFast(_PREHASH_TeleportCancel);
msg->nextBlockFast(_PREHASH_Info);
msg->addUUIDFast(_PREHASH_AgentID, getID());
msg->addUUIDFast(_PREHASH_SessionID, getSessionID());
......@@ -4929,7 +4929,7 @@ void LLAgent::sendAgentUpdateUserInfoMessage(bool im_via_email, const std::strin
gMessageSystem->addUUIDFast(_PREHASH_SessionID, getSessionID());
gMessageSystem->nextBlockFast(_PREHASH_UserData);
gMessageSystem->addBOOLFast(_PREHASH_IMViaEMail, im_via_email);
gMessageSystem->addString("DirectoryVisibility", directory_visibility);
gMessageSystem->addStringFast(_PREHASH_DirectoryVisibility, directory_visibility);
gAgent.sendReliableMessage();
}
......
......@@ -1457,7 +1457,7 @@ void LLAgentWearables::userRemoveMultipleAttachments(llvo_vec_t& objects_to_remo
return;
LL_DEBUGS("Avatar") << "ATT [ObjectDetach] removing " << objects_to_remove.size() << " objects" << LL_ENDL;
gMessageSystem->newMessage("ObjectDetach");
gMessageSystem->newMessageFast(_PREHASH_ObjectDetach);
gMessageSystem->nextBlockFast(_PREHASH_AgentData);
gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
gMessageSystem->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
......
......@@ -296,12 +296,12 @@ void LLAvatarTracker::terminateBuddy(const LLUUID& id)
if(!buddy) return;
mBuddyInfo.erase(id);
LLMessageSystem* msg = gMessageSystem;
msg->newMessage("TerminateFriendship");
msg->nextBlock("AgentData");
msg->addUUID("AgentID", gAgent.getID());
msg->addUUID("SessionID", gAgent.getSessionID());
msg->nextBlock("ExBlock");
msg->addUUID("OtherID", id);
msg->newMessageFast(_PREHASH_TerminateFriendship);
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
msg->nextBlockFast(_PREHASH_ExBlock);
msg->addUUIDFast(_PREHASH_OtherID, id);
gAgent.sendReliableMessage();
addChangedMask(LLFriendObserver::REMOVE, id);
......@@ -781,7 +781,7 @@ void LLAvatarTracker::formFriendship(const LLUUID& id)
void LLAvatarTracker::processTerminateFriendship(LLMessageSystem* msg, void**)
{