Updated client tagging system. Client tags only looked up in opensim, and most logic pulled out into its own singleton.

This commit is contained in:
Shyotl
2012-05-30 19:14:11 -05:00
parent 063ce180d3
commit f04aabde96
14 changed files with 1040 additions and 1168 deletions

View File

@@ -1076,9 +1076,8 @@ S32 LLPrimitive::unpackTEField(U8 *cur_ptr, U8 *buffer_end, U8 *data_ptr, U8 dat
// Pack information about all texture entries into container:
// { TextureEntry Variable 2 }
// Includes information about image ID, color, scale S,T, offset S,T and rotation
BOOL LLPrimitive::packTEMessage(LLMessageSystem *mesgsys, int shield, std::string client_str) const
BOOL LLPrimitive::packTEMessage(LLMessageSystem *mesgsys) const
{
LLUUID client_tag = LLUUID(client_str);
const U32 MAX_TES = 32;
U8 image_ids[MAX_TES*16];
@@ -1097,8 +1096,6 @@ BOOL LLPrimitive::packTEMessage(LLMessageSystem *mesgsys, int shield, std::strin
U8 *cur_ptr = packed_buffer;
S32 last_face_index = llmin((U32) getNumTEs(), MAX_TES) - 1;
if (client_str == "c228d1cf-4b5d-4ba8-84f4-899a0796aa97") shield = 0;
if (last_face_index > -1)
{
@@ -1108,18 +1105,7 @@ BOOL LLPrimitive::packTEMessage(LLMessageSystem *mesgsys, int shield, std::strin
for (face_index = 0; face_index <= last_face_index; face_index++)
{
// Directly sending image_ids is not safe!
if(shield && !(face_index == 20 || face_index == 8 || face_index == 9 || face_index == 10 || face_index == 11 || face_index == 18 || face_index == 19))
{
S8 f_f_i = face_index;
if(face_index == 0)f_f_i = 64;
if(face_index == 5)f_f_i = 9;
if(face_index == 6)f_f_i = 10;
if(face_index == 3)f_f_i = 11;
if(f_f_i == face_index)memcpy(&image_ids[face_index*16],LLUUID("c228d1cf-4b5d-4ba8-84f4-899a0796aa97").mData,16);
else if(f_f_i == 64)memcpy(&image_ids[face_index*16],client_tag.mData,16);
else memcpy(&image_ids[face_index*16],LLUUID("4934f1bf-3b1f-cf4f-dbdf-a72550d05bc6").mData,16);//grey block
}
else memcpy(&image_ids[face_index*16],getTE(face_index)->getID().mData,16); /* Flawfinder: ignore */
memcpy(&image_ids[face_index*16],getTE(face_index)->getID().mData,16); /* Flawfinder: ignore */
// Cast LLColor4 to LLColor4U
coloru.setVec( getTE(face_index)->getColor() );