TPV Compliance issues resolved:
Message Builder is removed entirely as per requested Message Log was updated to be less dependent on the message builder for later removal Version reporting was fixed - Missed some tidbits from Inertia removal Signed-off-by: Beeks <HgDelirium@gmail.com>
This commit is contained in:
@@ -197,7 +197,6 @@ set(viewer_SOURCE_FILES
|
||||
llfloaterlandmark.cpp
|
||||
llfloatermap.cpp
|
||||
llfloatermemleak.cpp
|
||||
llfloatermessagebuilder.cpp
|
||||
llfloatermessagelog.cpp
|
||||
llfloatermute.cpp
|
||||
llfloaternamedesc.cpp
|
||||
@@ -648,7 +647,6 @@ set(viewer_HEADER_FILES
|
||||
llfloaterlandmark.h
|
||||
llfloatermap.h
|
||||
llfloatermemleak.h
|
||||
llfloatermessagebuilder.h
|
||||
llfloatermessagelog.h
|
||||
llfloatermute.h
|
||||
llfloaternamedesc.h
|
||||
|
||||
@@ -2393,7 +2393,7 @@ void LLAppViewer::writeSystemInfo()
|
||||
|
||||
// Dump some debugging info
|
||||
LL_INFOS("SystemInfo") << gSecondLife
|
||||
<< " version " << gSavedSettings.getU32("SpecifiedVersionMaj") << "." << gSavedSettings.getU32("SpecifiedVersionMin") << "." << gSavedSettings.getU32("SpecifiedVersionPatch")
|
||||
<< " version " << LL_VERSION_MAJOR << "." << LL_VERSION_MINOR << "." << LL_VERSION_PATCH
|
||||
<< LL_ENDL;
|
||||
|
||||
// Dump the local time and time zone
|
||||
@@ -2451,15 +2451,13 @@ void LLAppViewer::handleViewerCrash()
|
||||
|
||||
//We already do this in writeSystemInfo(), but we do it again here to make /sure/ we have a version
|
||||
//to check against no matter what
|
||||
// <edit>
|
||||
//gDebugInfo["ClientInfo"]["Name"] = gSavedSettings.getString("VersionChannelName");
|
||||
gDebugInfo["ClientInfo"]["Name"] = gSavedSettings.getString("SpecifiedChannel");
|
||||
|
||||
gDebugInfo["ClientInfo"]["MajorVersion"] = (S32)gSavedSettings.getU32("SpecifiedVersionMaj");
|
||||
gDebugInfo["ClientInfo"]["MinorVersion"] = (S32)gSavedSettings.getU32("SpecifiedVersionMin");
|
||||
gDebugInfo["ClientInfo"]["PatchVersion"] = (S32)gSavedSettings.getU32("SpecifiedVersionPatch");
|
||||
gDebugInfo["ClientInfo"]["BuildVersion"] = (S32)gSavedSettings.getU32("SpecifiedVersionBuild");
|
||||
// </edit>
|
||||
gDebugInfo["ClientInfo"]["Name"] = LL_CHANNEL;
|
||||
|
||||
gDebugInfo["ClientInfo"]["MajorVersion"] = LL_VERSION_MAJOR;
|
||||
gDebugInfo["ClientInfo"]["MinorVersion"] = LL_VERSION_MINOR;
|
||||
gDebugInfo["ClientInfo"]["PatchVersion"] = LL_VERSION_PATCH;
|
||||
gDebugInfo["ClientInfo"]["BuildVersion"] = LL_VERSION_BUILD;
|
||||
|
||||
LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel();
|
||||
if ( parcel && parcel->getMusicURL()[0])
|
||||
@@ -4118,15 +4116,12 @@ void LLAppViewer::handleLoginComplete()
|
||||
initMainloopTimeout("Mainloop Init");
|
||||
|
||||
// Store some data to DebugInfo in case of a freeze.
|
||||
// <edit>
|
||||
//gDebugInfo["ClientInfo"]["Name"] = gSavedSettings.getString("VersionChannelName");
|
||||
gDebugInfo["ClientInfo"]["Name"] = gSavedSettings.getString("SpecifiedChannel");
|
||||
// </edit>
|
||||
gDebugInfo["ClientInfo"]["Name"] = LL_CHANNEL;
|
||||
|
||||
gDebugInfo["ClientInfo"]["MajorVersion"] = (S32)gSavedSettings.getU32("SpecifiedVersionMaj");
|
||||
gDebugInfo["ClientInfo"]["MinorVersion"] = (S32)gSavedSettings.getU32("SpecifiedVersionMin");
|
||||
gDebugInfo["ClientInfo"]["PatchVersion"] = (S32)gSavedSettings.getU32("SpecifiedVersionPatch");
|
||||
gDebugInfo["ClientInfo"]["BuildVersion"] = (S32)gSavedSettings.getU32("SpecifiedVersionBuild");
|
||||
gDebugInfo["ClientInfo"]["MajorVersion"] = LL_VERSION_MAJOR;
|
||||
gDebugInfo["ClientInfo"]["MinorVersion"] = LL_VERSION_MINOR;
|
||||
gDebugInfo["ClientInfo"]["PatchVersion"] = LL_VERSION_PATCH;
|
||||
gDebugInfo["ClientInfo"]["BuildVersion"] = LL_VERSION_BUILD;
|
||||
|
||||
LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel();
|
||||
if ( parcel && parcel->getMusicURL()[0])
|
||||
|
||||
@@ -288,18 +288,14 @@ void LLFloaterAbout::show(void*)
|
||||
static std::string get_viewer_release_notes_url()
|
||||
{
|
||||
std::ostringstream version;
|
||||
// <edit>
|
||||
version << gSavedSettings.getU32("SpecifiedVersionMaj") << "." //LL_VERSION_MAJOR
|
||||
<< gSavedSettings.getU32("SpecifiedVersionMin") << "." //LL_VERSION_MINOR
|
||||
<< gSavedSettings.getU32("SpecifiedVersionPatch") << "." //LL_VERSION_PATCH
|
||||
<< gSavedSettings.getU32("SpecifiedVersionBuild"); //LL_VERSION_BUILD
|
||||
// </edit>
|
||||
version << LL_VERSION_MAJOR
|
||||
<< "." << LL_VERSION_MINOR
|
||||
<< "." << LL_VERSION_PATCH
|
||||
<< "." << LL_VERSION_BUILD;
|
||||
LLSD query;
|
||||
// <edit>
|
||||
//query["channel"] = gSavedSettings.getString("VersionChannelName");
|
||||
query["channel"] = gSavedSettings.getString("SpecifiedChannel");
|
||||
// I think the version below is only numbers..
|
||||
// </edit>
|
||||
|
||||
query["channel"] = LL_CHANNEL;
|
||||
|
||||
query["version"] = version.str();
|
||||
|
||||
std::ostringstream url;
|
||||
|
||||
@@ -1,978 +0,0 @@
|
||||
// <edit>
|
||||
#include "llviewerprecompiledheaders.h"
|
||||
#include "llfloatermessagebuilder.h"
|
||||
#include "lluictrlfactory.h"
|
||||
#include "llmessagetemplate.h"
|
||||
#include "llagent.h"
|
||||
#include "llchat.h"
|
||||
#include "llfloaterchat.h"
|
||||
#include "llviewerregion.h" // getHandle
|
||||
#include "llcombobox.h"
|
||||
#include "llselectmgr.h" // fill in stuff about selected object
|
||||
#include "llparcel.h"
|
||||
#include "llviewerparcelmgr.h" // same for parcel
|
||||
#include "llscrolllistctrl.h"
|
||||
#include "llworld.h"
|
||||
#include "lltemplatemessagebuilder.h"
|
||||
|
||||
////////////////////////////////
|
||||
// LLNetListItem
|
||||
////////////////////////////////
|
||||
LLNetListItem::LLNetListItem(LLUUID id)
|
||||
: mID(id),
|
||||
mAutoName(TRUE),
|
||||
mName("No name"),
|
||||
mPreviousRegionName(""),
|
||||
mCircuitData(NULL)
|
||||
{
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
// LLFloaterMessageBuilder
|
||||
////////////////////////////////
|
||||
std::list<LLNetListItem*> LLFloaterMessageBuilder::sNetListItems;
|
||||
|
||||
LLFloaterMessageBuilder::LLFloaterMessageBuilder(std::string initial_text)
|
||||
: LLFloater(),
|
||||
LLEventTimer(1.0f),
|
||||
mNetInfoMode(NI_NET),
|
||||
mInitialText(initial_text)
|
||||
{
|
||||
LLUICtrlFactory::getInstance()->buildFloater(this, "floater_message_builder.xml");
|
||||
}
|
||||
LLFloaterMessageBuilder::~LLFloaterMessageBuilder()
|
||||
{
|
||||
}
|
||||
void LLFloaterMessageBuilder::show(std::string initial_text)
|
||||
{
|
||||
(new LLFloaterMessageBuilder(initial_text))->open();
|
||||
}
|
||||
BOOL LLFloaterMessageBuilder::tick()
|
||||
{
|
||||
refreshNetList();
|
||||
return FALSE;
|
||||
}
|
||||
LLNetListItem* LLFloaterMessageBuilder::findNetListItem(LLHost host)
|
||||
{
|
||||
std::list<LLNetListItem*>::iterator end = sNetListItems.end();
|
||||
for(std::list<LLNetListItem*>::iterator iter = sNetListItems.begin(); iter != end; ++iter)
|
||||
if((*iter)->mCircuitData && (*iter)->mCircuitData->getHost() == host)
|
||||
return (*iter);
|
||||
return NULL;
|
||||
}
|
||||
LLNetListItem* LLFloaterMessageBuilder::findNetListItem(LLUUID id)
|
||||
{
|
||||
std::list<LLNetListItem*>::iterator end = sNetListItems.end();
|
||||
for(std::list<LLNetListItem*>::iterator iter = sNetListItems.begin(); iter != end; ++iter)
|
||||
if((*iter)->mID == id)
|
||||
return (*iter);
|
||||
return NULL;
|
||||
}
|
||||
void LLFloaterMessageBuilder::refreshNetList()
|
||||
{
|
||||
LLScrollListCtrl* scrollp = getChild<LLScrollListCtrl>("net_list");
|
||||
// Update circuit data of net list items
|
||||
std::vector<LLCircuitData*> circuits = gMessageSystem->getCircuit()->getCircuitDataList();
|
||||
std::vector<LLCircuitData*>::iterator circuits_end = circuits.end();
|
||||
for(std::vector<LLCircuitData*>::iterator iter = circuits.begin(); iter != circuits_end; ++iter)
|
||||
{
|
||||
LLNetListItem* itemp = findNetListItem((*iter)->getHost());
|
||||
if(!itemp)
|
||||
{
|
||||
LLUUID id; id.generate();
|
||||
itemp = new LLNetListItem(id);
|
||||
sNetListItems.push_back(itemp);
|
||||
}
|
||||
itemp->mCircuitData = (*iter);
|
||||
}
|
||||
// Clear circuit data of items whose circuits are gone
|
||||
std::list<LLNetListItem*>::iterator items_end = sNetListItems.end();
|
||||
for(std::list<LLNetListItem*>::iterator iter = sNetListItems.begin(); iter != items_end; ++iter)
|
||||
{
|
||||
if(std::find(circuits.begin(), circuits.end(), (*iter)->mCircuitData) == circuits.end())
|
||||
(*iter)->mCircuitData = NULL;
|
||||
}
|
||||
// Remove net list items that are totally useless now
|
||||
for(std::list<LLNetListItem*>::iterator iter = sNetListItems.begin(); iter != sNetListItems.end();)
|
||||
{
|
||||
if((*iter)->mCircuitData == NULL)
|
||||
iter = sNetListItems.erase(iter);
|
||||
else ++iter;
|
||||
}
|
||||
// Update names of net list items
|
||||
items_end = sNetListItems.end();
|
||||
for(std::list<LLNetListItem*>::iterator iter = sNetListItems.begin(); iter != items_end; ++iter)
|
||||
{
|
||||
LLNetListItem* itemp = (*iter);
|
||||
if(itemp->mAutoName)
|
||||
{
|
||||
if(itemp->mCircuitData)
|
||||
{
|
||||
LLViewerRegion* regionp = LLWorld::getInstance()->getRegion(itemp->mCircuitData->getHost());
|
||||
if(regionp)
|
||||
{
|
||||
std::string name = regionp->getName();
|
||||
if(name == "") name = llformat("%s (awaiting region name)", itemp->mCircuitData->getHost().getString().c_str());
|
||||
itemp->mName = name;
|
||||
itemp->mPreviousRegionName = name;
|
||||
}
|
||||
else
|
||||
{
|
||||
itemp->mName = itemp->mCircuitData->getHost().getString();
|
||||
if(itemp->mPreviousRegionName != "")
|
||||
itemp->mName.append(llformat(" (was %s)", itemp->mPreviousRegionName.c_str()));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// an item just for an event queue, not handled yet
|
||||
itemp->mName = "Something else";
|
||||
}
|
||||
}
|
||||
}
|
||||
// Rebuild scroll list from scratch
|
||||
LLUUID selected_id = scrollp->getFirstSelected() ? scrollp->getFirstSelected()->getUUID() : LLUUID::null;
|
||||
S32 scroll_pos = scrollp->getScrollPos();
|
||||
scrollp->clearRows();
|
||||
for(std::list<LLNetListItem*>::iterator iter = sNetListItems.begin(); iter != items_end; ++iter)
|
||||
{
|
||||
LLNetListItem* itemp = (*iter);
|
||||
LLSD element;
|
||||
element["id"] = itemp->mID;
|
||||
LLSD& text_column = element["columns"][0];
|
||||
text_column["column"] = "text";
|
||||
text_column["value"] = itemp->mName + (itemp->mCircuitData->getHost() == gAgent.getRegionHost() ? " (main)" : "");
|
||||
|
||||
LLSD& state_column = element["columns"][ 1];
|
||||
state_column["column"] = "state";
|
||||
state_column["value"] = "";
|
||||
|
||||
LLScrollListItem* scroll_itemp = scrollp->addElement(element);
|
||||
BOOL has_live_circuit = itemp->mCircuitData && itemp->mCircuitData->isAlive();
|
||||
|
||||
LLScrollListText* state = (LLScrollListText*)scroll_itemp->getColumn(1);
|
||||
|
||||
if(has_live_circuit)
|
||||
state->setText(std::string("Alive"));
|
||||
else
|
||||
state->setText(std::string("Alive"));
|
||||
}
|
||||
if(selected_id.notNull()) scrollp->selectByID(selected_id);
|
||||
if(scroll_pos < scrollp->getItemCount()) scrollp->setScrollPos(scroll_pos);
|
||||
}
|
||||
BOOL LLFloaterMessageBuilder::postBuild()
|
||||
{
|
||||
childSetText("message_edit", mInitialText);
|
||||
childSetAction("send_btn", onClickSend, this);
|
||||
std::vector<std::string> names;
|
||||
LLComboBox* combo;
|
||||
LLMessageSystem::message_template_name_map_t::iterator temp_end = gMessageSystem->mMessageTemplates.end();
|
||||
LLMessageSystem::message_template_name_map_t::iterator temp_iter;
|
||||
std::vector<std::string>::iterator names_end;
|
||||
std::vector<std::string>::iterator names_iter;
|
||||
for(temp_iter = gMessageSystem->mMessageTemplates.begin(); temp_iter != temp_end; ++temp_iter)
|
||||
if((*temp_iter).second->getTrust() == MT_NOTRUST)
|
||||
names.push_back((*temp_iter).second->mName);
|
||||
std::sort(names.begin(), names.end());
|
||||
combo = getChild<LLComboBox>("untrusted_message_combo");
|
||||
names_end = names.end();
|
||||
for(names_iter = names.begin(); names_iter != names_end; ++names_iter)
|
||||
combo->add((*names_iter));
|
||||
names.clear();
|
||||
for(temp_iter = gMessageSystem->mMessageTemplates.begin(); temp_iter != temp_end; ++temp_iter)
|
||||
if((*temp_iter).second->getTrust() == MT_TRUST)
|
||||
names.push_back((*temp_iter).second->mName);
|
||||
std::sort(names.begin(), names.end());
|
||||
combo = getChild<LLComboBox>("trusted_message_combo");
|
||||
names_end = names.end();
|
||||
for(names_iter = names.begin(); names_iter != names_end; ++names_iter)
|
||||
combo->add((*names_iter));
|
||||
childSetCommitCallback("untrusted_message_combo", onCommitPacketCombo, this);
|
||||
childSetCommitCallback("trusted_message_combo", onCommitPacketCombo, this);
|
||||
return TRUE;
|
||||
}
|
||||
inline std::vector<std::string> split(std::string input, std::string separator)
|
||||
{
|
||||
S32 size = input.length();
|
||||
char* buffer = new char[size + 1];
|
||||
strncpy(buffer, input.c_str(), size);
|
||||
buffer[size] = '\0';
|
||||
std::vector<std::string> lines;
|
||||
char* result = strtok(buffer, separator.c_str());
|
||||
while(result)
|
||||
{
|
||||
lines.push_back(result);
|
||||
result = strtok(NULL, separator.c_str());
|
||||
}
|
||||
delete[] buffer;
|
||||
return lines;
|
||||
}
|
||||
std::string mvtstr(e_message_variable_type var_type)
|
||||
{
|
||||
switch(var_type)
|
||||
{
|
||||
case MVT_U8:
|
||||
return "U8";
|
||||
break;
|
||||
case MVT_U16:
|
||||
return "U16";
|
||||
break;
|
||||
case MVT_U32:
|
||||
return "U32";
|
||||
break;
|
||||
case MVT_U64:
|
||||
return "U64";
|
||||
break;
|
||||
case MVT_S8:
|
||||
return "S8";
|
||||
break;
|
||||
case MVT_S16:
|
||||
return "S16";
|
||||
break;
|
||||
case MVT_S32:
|
||||
return "S32";
|
||||
break;
|
||||
case MVT_S64:
|
||||
return "S64";
|
||||
break;
|
||||
case MVT_F32:
|
||||
return "F32";
|
||||
break;
|
||||
case MVT_F64:
|
||||
return "F64";
|
||||
break;
|
||||
case MVT_LLVector3:
|
||||
return "LLVector3";
|
||||
break;
|
||||
case MVT_LLVector3d:
|
||||
return "LLVector3d";
|
||||
break;
|
||||
case MVT_LLVector4:
|
||||
return "LLVector4";
|
||||
break;
|
||||
case MVT_LLQuaternion:
|
||||
return "LLQuaternion";
|
||||
break;
|
||||
case MVT_LLUUID:
|
||||
return "LLUUID";
|
||||
break;
|
||||
case MVT_BOOL:
|
||||
return "BOOL";
|
||||
break;
|
||||
case MVT_IP_ADDR:
|
||||
return "IPADDR";
|
||||
break;
|
||||
case MVT_IP_PORT:
|
||||
return "IPPORT";
|
||||
break;
|
||||
case MVT_VARIABLE:
|
||||
return "Variable";
|
||||
break;
|
||||
case MVT_FIXED:
|
||||
return "Fixed";
|
||||
break;
|
||||
default:
|
||||
return "Missingno.";
|
||||
break;
|
||||
}
|
||||
}
|
||||
// static
|
||||
BOOL LLFloaterMessageBuilder::addField(e_message_variable_type var_type, const char* var_name, std::string input, BOOL hex)
|
||||
{
|
||||
LLStringUtil::trim(input);
|
||||
if(input.length() < 1 && var_type != MVT_VARIABLE)
|
||||
return FALSE;
|
||||
U8 valueU8;
|
||||
U16 valueU16;
|
||||
U32 valueU32;
|
||||
U64 valueU64;
|
||||
S8 valueS8;
|
||||
S16 valueS16;
|
||||
S32 valueS32;
|
||||
// S64 valueS64;
|
||||
F32 valueF32;
|
||||
F64 valueF64;
|
||||
LLVector3 valueVector3;
|
||||
LLVector3d valueVector3d;
|
||||
LLVector4 valueVector4;
|
||||
LLQuaternion valueQuaternion;
|
||||
LLUUID valueLLUUID;
|
||||
BOOL valueBOOL;
|
||||
std::string input_lower = input;
|
||||
LLStringUtil::toLower(input_lower);
|
||||
if(input_lower == "$agentid")
|
||||
input = gAgent.getID().asString();
|
||||
else if(input_lower == "$sessionid")
|
||||
input = gAgent.getSessionID().asString();
|
||||
else if(input_lower == "$uuid")
|
||||
{
|
||||
LLUUID id;
|
||||
id.generate();
|
||||
input = id.asString();
|
||||
}
|
||||
else if(input_lower == "$circuitcode")
|
||||
{
|
||||
std::stringstream temp_stream;
|
||||
temp_stream << gMessageSystem->mOurCircuitCode;
|
||||
input = temp_stream.str();
|
||||
}
|
||||
else if(input_lower == "$regionhandle")
|
||||
{
|
||||
std::stringstream temp_stream;
|
||||
temp_stream << (gAgent.getRegion() ? gAgent.getRegion()->getHandle() : 0);
|
||||
input = temp_stream.str();
|
||||
}
|
||||
else if(input_lower == "$position" || input_lower == "$pos")
|
||||
{
|
||||
std::stringstream temp_stream;
|
||||
valueVector3 = gAgent.getPositionAgent();
|
||||
temp_stream << "<" << valueVector3[0] << ", " << valueVector3[1] << ", " << valueVector3[2] << ">";
|
||||
input = temp_stream.str();
|
||||
}
|
||||
if(hex)
|
||||
{
|
||||
if(var_type != MVT_VARIABLE && var_type != MVT_FIXED)
|
||||
return FALSE;
|
||||
int len = input_lower.length();
|
||||
const char* cstr = input_lower.c_str();
|
||||
std::string new_input("");
|
||||
BOOL nibble = FALSE;
|
||||
char byte = 0;
|
||||
for(int i = 0; i < len; i++)
|
||||
{
|
||||
char c = cstr[i];
|
||||
if(c >= 0x30 && c <= 0x39)
|
||||
c -= 0x30;
|
||||
else if(c >= 0x61 && c <= 0x66)
|
||||
c -= 0x57;
|
||||
else if(c != 0x20)
|
||||
return FALSE;
|
||||
else
|
||||
continue;
|
||||
if(!nibble)
|
||||
byte = c << 4;
|
||||
else
|
||||
new_input.push_back(byte | c);
|
||||
nibble = !nibble;
|
||||
}
|
||||
if(nibble)
|
||||
return FALSE;
|
||||
input = new_input;
|
||||
}
|
||||
std::stringstream stream(input);
|
||||
std::vector<std::string> tokens;
|
||||
switch(var_type)
|
||||
{
|
||||
case MVT_U8:
|
||||
if(input.substr(0, 1) == "-")
|
||||
return FALSE;
|
||||
if((stream >> valueU32).fail())
|
||||
return FALSE;
|
||||
valueU8 = (U8)valueU32;
|
||||
gMessageSystem->addU8(var_name, valueU8);
|
||||
return TRUE;
|
||||
break;
|
||||
case MVT_U16:
|
||||
if(input.substr(0, 1) == "-")
|
||||
return FALSE;
|
||||
if((stream >> valueU16).fail())
|
||||
return FALSE;
|
||||
gMessageSystem->addU16(var_name, valueU16);
|
||||
return TRUE;
|
||||
break;
|
||||
case MVT_U32:
|
||||
if(input.substr(0, 1) == "-")
|
||||
return FALSE;
|
||||
if((stream >> valueU32).fail())
|
||||
return FALSE;
|
||||
gMessageSystem->addU32(var_name, valueU32);
|
||||
return TRUE;
|
||||
break;
|
||||
case MVT_U64:
|
||||
if(input.substr(0, 1) == "-")
|
||||
return FALSE;
|
||||
if((stream >> valueU64).fail())
|
||||
return FALSE;
|
||||
gMessageSystem->addU64(var_name, valueU64);
|
||||
return TRUE;
|
||||
break;
|
||||
case MVT_S8:
|
||||
if((stream >> valueS8).fail())
|
||||
return FALSE;
|
||||
gMessageSystem->addS8(var_name, valueS8);
|
||||
return TRUE;
|
||||
break;
|
||||
case MVT_S16:
|
||||
if((stream >> valueS16).fail())
|
||||
return FALSE;
|
||||
gMessageSystem->addS16(var_name, valueS16);
|
||||
return TRUE;
|
||||
break;
|
||||
case MVT_S32:
|
||||
if((stream >> valueS32).fail())
|
||||
return FALSE;
|
||||
gMessageSystem->addS32(var_name, valueS32);
|
||||
return TRUE;
|
||||
break;
|
||||
/*
|
||||
case MVT_S64:
|
||||
if((stream >> valueS64).fail())
|
||||
return FALSE;
|
||||
gMessageSystem->addS64(var_name, valueS64);
|
||||
return TRUE;
|
||||
break;
|
||||
*/
|
||||
case MVT_F32:
|
||||
if((stream >> valueF32).fail())
|
||||
return FALSE;
|
||||
gMessageSystem->addF32(var_name, valueF32);
|
||||
return TRUE;
|
||||
break;
|
||||
case MVT_F64:
|
||||
if((stream >> valueF64).fail())
|
||||
return FALSE;
|
||||
gMessageSystem->addF64(var_name, valueF64);
|
||||
return TRUE;
|
||||
break;
|
||||
case MVT_LLVector3:
|
||||
LLStringUtil::trim(input);
|
||||
if(input.substr(0, 1) != "<" || input.substr(input.length() - 1, 1) != ">")
|
||||
return FALSE;
|
||||
tokens = split(input.substr(1, input.length() - 2), ",");
|
||||
if(tokens.size() != 3)
|
||||
return FALSE;
|
||||
for(int i = 0; i < 3; i++)
|
||||
{
|
||||
stream.clear();
|
||||
stream.str(tokens[i]);
|
||||
if((stream >> valueF32).fail())
|
||||
return FALSE;
|
||||
valueVector3.mV[i] = valueF32;
|
||||
}
|
||||
gMessageSystem->addVector3(var_name, valueVector3);
|
||||
return TRUE;
|
||||
break;
|
||||
case MVT_LLVector3d:
|
||||
LLStringUtil::trim(input);
|
||||
if(input.substr(0, 1) != "<" || input.substr(input.length() - 1, 1) != ">")
|
||||
return FALSE;
|
||||
tokens = split(input.substr(1, input.length() - 2), ",");
|
||||
if(tokens.size() != 3)
|
||||
return FALSE;
|
||||
for(int i = 0; i < 3; i++)
|
||||
{
|
||||
stream.clear();
|
||||
stream.str(tokens[i]);
|
||||
if((stream >> valueF64).fail())
|
||||
return FALSE;
|
||||
valueVector3d.mdV[i] = valueF64;
|
||||
}
|
||||
gMessageSystem->addVector3d(var_name, valueVector3d);
|
||||
return TRUE;
|
||||
break;
|
||||
case MVT_LLVector4:
|
||||
LLStringUtil::trim(input);
|
||||
if(input.substr(0, 1) != "<" || input.substr(input.length() - 1, 1) != ">")
|
||||
return FALSE;
|
||||
tokens = split(input.substr(1, input.length() - 2), ",");
|
||||
if(tokens.size() != 4)
|
||||
return FALSE;
|
||||
for(int i = 0; i < 4; i++)
|
||||
{
|
||||
stream.clear();
|
||||
stream.str(tokens[i]);
|
||||
if((stream >> valueF32).fail())
|
||||
return FALSE;
|
||||
valueVector4.mV[i] = valueF32;
|
||||
}
|
||||
gMessageSystem->addVector4(var_name, valueVector4);
|
||||
return TRUE;
|
||||
break;
|
||||
case MVT_LLQuaternion:
|
||||
LLStringUtil::trim(input);
|
||||
if(input.substr(0, 1) != "<" || input.substr(input.length() - 1, 1) != ">")
|
||||
return FALSE;
|
||||
tokens = split(input.substr(1, input.length() - 2), ",");
|
||||
if(tokens.size() != 3)
|
||||
return FALSE;
|
||||
for(int i = 0; i < 3; i++)
|
||||
{
|
||||
stream.clear();
|
||||
stream.str(tokens[i]);
|
||||
if((stream >> valueF32).fail())
|
||||
return FALSE;
|
||||
valueVector3.mV[i] = valueF32;
|
||||
}
|
||||
valueQuaternion.unpackFromVector3(valueVector3);
|
||||
gMessageSystem->addQuat(var_name, valueQuaternion);
|
||||
return TRUE;
|
||||
break;
|
||||
case MVT_LLUUID:
|
||||
if((stream >> valueLLUUID).fail())
|
||||
return FALSE;
|
||||
gMessageSystem->addUUID(var_name, valueLLUUID);
|
||||
return TRUE;
|
||||
break;
|
||||
case MVT_BOOL:
|
||||
if(input_lower == "true")
|
||||
valueBOOL = TRUE;
|
||||
else if(input_lower == "false")
|
||||
valueBOOL = FALSE;
|
||||
else if((stream >> valueBOOL).fail())
|
||||
return FALSE;
|
||||
//gMessageSystem->addBOOL(var_name, valueBOOL);
|
||||
gMessageSystem->addU8(var_name, (U8)valueBOOL);
|
||||
return TRUE;
|
||||
break;
|
||||
case MVT_IP_ADDR:
|
||||
if((stream >> valueU32).fail())
|
||||
return FALSE;
|
||||
gMessageSystem->addIPAddr(var_name, valueU32);
|
||||
return TRUE;
|
||||
break;
|
||||
case MVT_IP_PORT:
|
||||
if((stream >> valueU16).fail())
|
||||
return FALSE;
|
||||
gMessageSystem->addIPPort(var_name, valueU16);
|
||||
return TRUE;
|
||||
break;
|
||||
case MVT_VARIABLE:
|
||||
if(!hex)
|
||||
{
|
||||
char* buffer = new char[input.size() + 1];
|
||||
strncpy(buffer, input.c_str(), input.size());
|
||||
buffer[input.size()] = '\0';
|
||||
gMessageSystem->addBinaryData(var_name, buffer, input.size() + 1);
|
||||
delete[] buffer;
|
||||
}
|
||||
else
|
||||
gMessageSystem->addBinaryData(var_name, input.c_str(), input.size());
|
||||
return TRUE;
|
||||
break;
|
||||
case MVT_FIXED:
|
||||
if(!hex)
|
||||
{
|
||||
char* buffer = new char[input.size() + 1];
|
||||
strncpy(buffer, input.c_str(), input.size());
|
||||
buffer[input.size()] = '\0';
|
||||
gMessageSystem->addBinaryData(var_name, buffer, input.size());
|
||||
delete[] buffer;
|
||||
}
|
||||
else
|
||||
gMessageSystem->addBinaryData(var_name, input.c_str(), input.size());
|
||||
return TRUE;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
// static
|
||||
void LLFloaterMessageBuilder::onCommitPacketCombo(LLUICtrl* ctrl, void* user_data)
|
||||
{
|
||||
LLFloaterMessageBuilder* floaterp = (LLFloaterMessageBuilder*)user_data;
|
||||
LLViewerObject* selected_objectp = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject();
|
||||
LLParcel* agent_parcelp = LLViewerParcelMgr::getInstance()->getAgentParcel();
|
||||
std::string message = ctrl->getValue();
|
||||
std::map<const char *, LLMessageTemplate*>::iterator template_iter;
|
||||
template_iter = gMessageSystem->mMessageTemplates.find( LLMessageStringTable::getInstance()->getString(message.c_str()) );
|
||||
if(template_iter == gMessageSystem->mMessageTemplates.end())
|
||||
{
|
||||
floaterp->childSetText("message_edit", std::string(""));
|
||||
return;
|
||||
}
|
||||
std::string text(llformat((*template_iter).second->getTrust() == MT_NOTRUST ? "out %s\n" : "in %s\n", message.c_str()));
|
||||
LLMessageTemplate* temp = (*template_iter).second;
|
||||
LLMessageTemplate::message_block_map_t::iterator blocks_end = temp->mMemberBlocks.end();
|
||||
for (LLMessageTemplate::message_block_map_t::iterator blocks_iter = temp->mMemberBlocks.begin();
|
||||
blocks_iter != blocks_end; ++blocks_iter)
|
||||
{
|
||||
LLMessageBlock* block = (*blocks_iter);
|
||||
const char* block_name = block->mName;
|
||||
std::string block_name_string = std::string(block_name);
|
||||
S32 num_blocks = 1;
|
||||
if(block->mType == MBT_MULTIPLE)
|
||||
num_blocks = block->mNumber;
|
||||
else if(("ObjectLink" == message && "ObjectData" == block_name_string))
|
||||
num_blocks = 2;
|
||||
for(S32 i = 0; i < num_blocks; i++)
|
||||
{
|
||||
text.append(llformat("[%s]\n", block_name));
|
||||
LLMessageBlock::message_variable_map_t::iterator var_end = block->mMemberVariables.end();
|
||||
for (LLMessageBlock::message_variable_map_t::iterator var_iter = block->mMemberVariables.begin();
|
||||
var_iter != var_end; ++var_iter)
|
||||
{
|
||||
LLMessageVariable* variable = (*var_iter);
|
||||
const char* var_name = variable->getName();
|
||||
std::string var_name_string = std::string(var_name);
|
||||
text.append(llformat("%s = ", var_name));
|
||||
std::string value("");
|
||||
S32 size = variable->getSize();
|
||||
switch(variable->getType())
|
||||
{
|
||||
case MVT_U8:
|
||||
case MVT_U16:
|
||||
case MVT_U32:
|
||||
case MVT_U64:
|
||||
case MVT_S8:
|
||||
case MVT_S16:
|
||||
case MVT_S32:
|
||||
case MVT_IP_ADDR:
|
||||
case MVT_IP_PORT:
|
||||
if("RegionHandle" == var_name_string || "Handle" == var_name_string)
|
||||
value = "$RegionHandle";
|
||||
else if("CircuitCode" == var_name_string || "ViewerCircuitCode" == var_name_string
|
||||
|| ("Code" == var_name_string && "CircuitCode" == block_name_string) )
|
||||
{
|
||||
value = "$CircuitCode";
|
||||
}
|
||||
else if(selected_objectp &&
|
||||
(
|
||||
"ObjectLocalID" == var_name_string
|
||||
|| "TaskLocalID" == var_name_string
|
||||
|| ("LocalID" == var_name_string &&
|
||||
(
|
||||
"ObjectData" == block_name_string
|
||||
|| "UpdateData" == block_name_string
|
||||
|| "InventoryData" == block_name_string
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
{
|
||||
std::stringstream temp_stream;
|
||||
temp_stream << selected_objectp->getLocalID();
|
||||
value = temp_stream.str();
|
||||
}
|
||||
else if( agent_parcelp &&
|
||||
"LocalID" == var_name_string &&
|
||||
(
|
||||
"ParcelData" == block_name_string
|
||||
|| message.find("Parcel") != message.npos
|
||||
)
|
||||
)
|
||||
{
|
||||
std::stringstream temp_stream;
|
||||
temp_stream << agent_parcelp->getLocalID();
|
||||
value = temp_stream.str();
|
||||
}
|
||||
else if("PCode" == var_name_string)
|
||||
value = "9";
|
||||
else if("PathCurve" == var_name_string)
|
||||
value = "16";
|
||||
else if("ProfileCurve" == var_name_string)
|
||||
value = "1";
|
||||
else if("PathScaleX" == var_name_string || "PathScaleY" == var_name_string)
|
||||
value = "100";
|
||||
else if("BypassRaycast" == var_name_string)
|
||||
value = "1";
|
||||
else
|
||||
value = "0";
|
||||
break;
|
||||
case MVT_F32:
|
||||
case MVT_F64:
|
||||
value = "0.0";
|
||||
break;
|
||||
case MVT_LLVector3:
|
||||
case MVT_LLVector3d:
|
||||
case MVT_LLQuaternion:
|
||||
if("Position" == var_name_string || "RayStart" == var_name_string || "RayEnd" == var_name_string)
|
||||
value = "$Position";
|
||||
else if("Scale" == var_name_string)
|
||||
value = "<0.5, 0.5, 0.5>";
|
||||
else
|
||||
value = "<0, 0, 0>";
|
||||
break;
|
||||
case MVT_LLVector4:
|
||||
value = "<0, 0, 0, 0>";
|
||||
break;
|
||||
case MVT_LLUUID:
|
||||
if("AgentID" == var_name_string)
|
||||
value = "$AgentID";
|
||||
else if("SessionID" == var_name_string)
|
||||
value = "$SessionID";
|
||||
else if("ObjectID" == var_name_string && selected_objectp)
|
||||
value = selected_objectp->getID().asString();
|
||||
else if("ParcelID" == var_name_string && agent_parcelp)
|
||||
value = agent_parcelp->getID().asString();
|
||||
else
|
||||
value = "00000000-0000-0000-0000-000000000000";
|
||||
break;
|
||||
case MVT_BOOL:
|
||||
value = "false";
|
||||
break;
|
||||
case MVT_VARIABLE:
|
||||
value = "Hello, world!";
|
||||
break;
|
||||
case MVT_FIXED:
|
||||
for(S32 si = 0; si < size; si++)
|
||||
//value.append(std::string("0123456789abcdef").substr(si & 0xf, 1));
|
||||
value.append("a");
|
||||
break;
|
||||
default:
|
||||
value = "";
|
||||
break;
|
||||
}
|
||||
text.append(llformat("%s\n", value.c_str()));
|
||||
}
|
||||
}
|
||||
}
|
||||
text = text.substr(0, text.length() - 1);
|
||||
floaterp->childSetText("message_edit", text);
|
||||
}
|
||||
// static
|
||||
void LLFloaterMessageBuilder::onClickSend(void* user_data)
|
||||
{
|
||||
LLFloaterMessageBuilder* floaterp = (LLFloaterMessageBuilder*)user_data;
|
||||
std::vector<std::string> lines = split(floaterp->childGetText("message_edit"), "\n");
|
||||
if(!lines.size())
|
||||
{
|
||||
LLFloaterChat::addChat(LLChat("Not enough information :O"));
|
||||
return;
|
||||
}
|
||||
std::vector<std::string> tokens = split(lines[0], " ");
|
||||
if(!tokens.size())
|
||||
{
|
||||
LLFloaterChat::addChat(LLChat("Not enough information :O"));
|
||||
return;
|
||||
}
|
||||
std::string dir_str = tokens[0];
|
||||
LLStringUtil::toLower(dir_str);
|
||||
// Direction
|
||||
BOOL outgoing;
|
||||
if(dir_str == "out")
|
||||
outgoing = TRUE;
|
||||
else if(dir_str == "in")
|
||||
outgoing = FALSE;
|
||||
else
|
||||
{
|
||||
LLFloaterChat::addChat(LLChat("Expected direction 'in' or 'out'"));
|
||||
return;
|
||||
}
|
||||
// Message
|
||||
std::string message = "Invalid";
|
||||
if(tokens.size() > 1)
|
||||
{
|
||||
if(tokens.size() > 2)
|
||||
{
|
||||
LLFloaterChat::addChat(LLChat("Unexpected extra stuff at the top"));
|
||||
return;
|
||||
}
|
||||
message = tokens[1];
|
||||
LLStringUtil::trim(message);
|
||||
}
|
||||
// Body
|
||||
std::vector<parts_block> parts;
|
||||
if(lines.size() > 1)
|
||||
{
|
||||
std::vector<std::string>::iterator line_end = lines.end();
|
||||
std::vector<std::string>::iterator line_iter = lines.begin();
|
||||
++line_iter;
|
||||
std::string current_block("");
|
||||
int current_block_index = -1;
|
||||
for( ; line_iter != line_end; ++line_iter)
|
||||
{
|
||||
std::string line = (*line_iter);
|
||||
LLStringUtil::trim(line);
|
||||
if(!line.length())
|
||||
continue;
|
||||
if(line.substr(0, 1) == "[" && line.substr(line.size() - 1, 1) == "]")
|
||||
{
|
||||
current_block = line.substr(1, line.length() - 2);
|
||||
LLStringUtil::trim(current_block);
|
||||
++current_block_index;
|
||||
parts_block pb;
|
||||
pb.name = current_block;
|
||||
parts.push_back(pb);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(current_block.empty())
|
||||
{
|
||||
LLFloaterChat::addChat(LLChat("Unexpected field when no block yet"));
|
||||
return;
|
||||
}
|
||||
int eqpos = line.find("=");
|
||||
if(eqpos == line.npos)
|
||||
{
|
||||
LLFloaterChat::addChat(LLChat("Missing an equal sign"));
|
||||
return;
|
||||
}
|
||||
std::string field = line.substr(0, eqpos);
|
||||
LLStringUtil::trim(field);
|
||||
if(!field.length())
|
||||
{
|
||||
LLFloaterChat::addChat(LLChat("Missing name of field"));
|
||||
return;
|
||||
}
|
||||
std::string value = line.substr(eqpos + 1);
|
||||
LLStringUtil::trim(value);
|
||||
parts_var pv;
|
||||
if(value.substr(0, 1) == "|")
|
||||
{
|
||||
pv.hex = TRUE;
|
||||
value = value.substr(1);
|
||||
LLStringUtil::trim(value);
|
||||
}
|
||||
else
|
||||
pv.hex = FALSE;
|
||||
pv.name = field;
|
||||
pv.value = value;
|
||||
parts[current_block_index].vars.push_back(pv);
|
||||
}
|
||||
}
|
||||
}
|
||||
// Verification
|
||||
std::map<const char *, LLMessageTemplate*>::iterator template_iter;
|
||||
template_iter = gMessageSystem->mMessageTemplates.find( LLMessageStringTable::getInstance()->getString(message.c_str()) );
|
||||
if(template_iter == gMessageSystem->mMessageTemplates.end())
|
||||
{
|
||||
LLFloaterChat::addChat(LLChat(llformat("Don't know how to build a '%s' message", message.c_str())));
|
||||
return;
|
||||
}
|
||||
LLMessageTemplate* temp = (*template_iter).second;
|
||||
std::vector<parts_block>::iterator parts_end = parts.end();
|
||||
std::vector<parts_block>::iterator parts_iter = parts.begin();
|
||||
LLMessageTemplate::message_block_map_t::iterator blocks_end = temp->mMemberBlocks.end();
|
||||
for (LLMessageTemplate::message_block_map_t::iterator blocks_iter = temp->mMemberBlocks.begin();
|
||||
blocks_iter != blocks_end; )
|
||||
{
|
||||
LLMessageBlock* block = (*blocks_iter);
|
||||
const char* block_name = block->mName;
|
||||
if(parts_iter == parts_end)
|
||||
{
|
||||
if(block->mType != MBT_VARIABLE)
|
||||
LLFloaterChat::addChat(LLChat(llformat("Expected '%s' block", block_name)));
|
||||
else
|
||||
{
|
||||
++blocks_iter;
|
||||
continue;
|
||||
}
|
||||
return;
|
||||
}
|
||||
else if((*parts_iter).name != block_name)
|
||||
{
|
||||
if(block->mType != MBT_VARIABLE)
|
||||
LLFloaterChat::addChat(LLChat(llformat("Expected '%s' block", block_name)));
|
||||
else
|
||||
{
|
||||
++blocks_iter;
|
||||
continue;
|
||||
}
|
||||
return;
|
||||
}
|
||||
std::vector<parts_var>::iterator part_var_end = (*parts_iter).vars.end();
|
||||
std::vector<parts_var>::iterator part_var_iter = (*parts_iter).vars.begin();
|
||||
LLMessageBlock::message_variable_map_t::iterator var_end = block->mMemberVariables.end();
|
||||
for (LLMessageBlock::message_variable_map_t::iterator var_iter = block->mMemberVariables.begin();
|
||||
var_iter != var_end; ++var_iter)
|
||||
{
|
||||
LLMessageVariable* variable = (*var_iter);
|
||||
const char* var_name = variable->getName();
|
||||
if(part_var_iter == part_var_end)
|
||||
{
|
||||
LLFloaterChat::addChat(LLChat(llformat("Expected '%s' field under '%s' block", var_name, block_name)));
|
||||
return;
|
||||
}
|
||||
else if((*part_var_iter).name != var_name)
|
||||
{
|
||||
LLFloaterChat::addChat(LLChat(llformat("Expected '%s' field under '%s' block", var_name, block_name)));
|
||||
return;
|
||||
}
|
||||
(*part_var_iter).var_type = variable->getType();
|
||||
++part_var_iter;
|
||||
}
|
||||
if(part_var_iter != part_var_end)
|
||||
{
|
||||
LLFloaterChat::addChat(LLChat(llformat("Unexpected field(s) at end of '%s' block", block_name)));
|
||||
return;
|
||||
}
|
||||
++parts_iter;
|
||||
// test
|
||||
if((block->mType != MBT_SINGLE) && (parts_iter != parts_end) && ((*parts_iter).name == block_name))
|
||||
{
|
||||
// block will repeat
|
||||
}
|
||||
else ++blocks_iter;
|
||||
}
|
||||
if(parts_iter != parts_end)
|
||||
{
|
||||
LLFloaterChat::addChat(LLChat("Unexpected block(s) at end"));
|
||||
return;
|
||||
}
|
||||
// Build and send
|
||||
gMessageSystem->newMessage( message.c_str() );
|
||||
for(parts_iter = parts.begin(); parts_iter != parts_end; ++parts_iter)
|
||||
{
|
||||
const char* block_name = (*parts_iter).name.c_str();
|
||||
gMessageSystem->nextBlock(block_name);
|
||||
std::vector<parts_var>::iterator part_var_end = (*parts_iter).vars.end();
|
||||
for(std::vector<parts_var>::iterator part_var_iter = (*parts_iter).vars.begin();
|
||||
part_var_iter != part_var_end; ++part_var_iter)
|
||||
{
|
||||
parts_var pv = (*part_var_iter);
|
||||
if(!addField(pv.var_type, pv.name.c_str(), pv.value, pv.hex))
|
||||
{
|
||||
LLFloaterChat::addChat(LLChat(llformat("Error adding the provided data for %s '%s' to '%s' block", mvtstr(pv.var_type).c_str(), pv.name.c_str(), block_name)));
|
||||
gMessageSystem->clearMessage();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
LLScrollListCtrl* scrollp = floaterp->getChild<LLScrollListCtrl>("net_list");
|
||||
LLScrollListItem* selected_itemp = scrollp->getFirstSelected();
|
||||
|
||||
//if a specific circuit is selected, send it to that, otherwise send it to the current sim
|
||||
if(selected_itemp)
|
||||
{
|
||||
LLNetListItem* itemp = findNetListItem(selected_itemp->getUUID());
|
||||
LLScrollListText* textColumn = (LLScrollListText*)selected_itemp->getColumn(1);
|
||||
|
||||
//why would you send data through a dead circuit?
|
||||
if(textColumn->getValue().asString() == "Dead")
|
||||
{
|
||||
LLFloaterChat::addChat(LLChat("No sending messages through dead circuits!"));
|
||||
return;
|
||||
}
|
||||
if(outgoing)
|
||||
{
|
||||
gMessageSystem->sendMessage(itemp->mCircuitData->getHost());
|
||||
} else {
|
||||
U8 builtMessageBuffer[MAX_BUFFER_SIZE];
|
||||
|
||||
S32 message_size = gMessageSystem->mTemplateMessageBuilder->buildMessage(builtMessageBuffer, MAX_BUFFER_SIZE, 0);
|
||||
gMessageSystem->clearMessage();
|
||||
gMessageSystem->checkMessages(0, true, builtMessageBuffer, itemp->mCircuitData->getHost(), message_size);
|
||||
|
||||
}
|
||||
} else {
|
||||
if(outgoing)
|
||||
{
|
||||
gMessageSystem->sendMessage(gAgent.getRegionHost());
|
||||
} else {
|
||||
U8 builtMessageBuffer[MAX_BUFFER_SIZE];
|
||||
|
||||
S32 message_size = gMessageSystem->mTemplateMessageBuilder->buildMessage(builtMessageBuffer, MAX_BUFFER_SIZE, 0);
|
||||
gMessageSystem->clearMessage();
|
||||
gMessageSystem->checkMessages(0, true, builtMessageBuffer, gAgent.getRegionHost(), message_size);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
BOOL LLFloaterMessageBuilder::handleKeyHere(KEY key, MASK mask)
|
||||
{
|
||||
if(key == KEY_RETURN && (mask & MASK_CONTROL))
|
||||
{
|
||||
onClickSend(this);
|
||||
return TRUE;
|
||||
}
|
||||
if(key == KEY_ESCAPE)
|
||||
{
|
||||
releaseFocus();
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
// </edit>
|
||||
@@ -1,55 +0,0 @@
|
||||
// <edit>]
|
||||
#ifndef LL_LLFLOATERMESSAGEBUILDER_H
|
||||
#define LL_LLFLOATERMESSAGEBUILDER_H
|
||||
#include "llfloater.h"
|
||||
#include "lltemplatemessagereader.h"
|
||||
#include "llmessagelog.h"
|
||||
|
||||
class LLNetListItem
|
||||
{
|
||||
public:
|
||||
LLNetListItem(LLUUID id);
|
||||
LLUUID mID;
|
||||
BOOL mAutoName;
|
||||
std::string mName;
|
||||
std::string mPreviousRegionName;
|
||||
LLCircuitData* mCircuitData;
|
||||
};
|
||||
|
||||
class LLFloaterMessageBuilder : public LLFloater, public LLEventTimer
|
||||
{
|
||||
public:
|
||||
LLFloaterMessageBuilder(std::string initial_text);
|
||||
~LLFloaterMessageBuilder();
|
||||
static void show(std::string initial_text);
|
||||
static std::list<LLNetListItem*> sNetListItems;
|
||||
BOOL postBuild();
|
||||
BOOL tick();
|
||||
static BOOL addField(e_message_variable_type var_type, const char* var_name, std::string input, BOOL hex);
|
||||
static void onClickSend(void* user_data);
|
||||
static void onCommitPacketCombo(LLUICtrl* ctrl, void* user_data);
|
||||
static LLFloaterMessageBuilder* sInstance;
|
||||
BOOL handleKeyHere(KEY key, MASK mask);
|
||||
std::string mInitialText;
|
||||
struct parts_var
|
||||
{
|
||||
std::string name;
|
||||
std::string value;
|
||||
BOOL hex;
|
||||
e_message_variable_type var_type;
|
||||
};
|
||||
struct parts_block
|
||||
{
|
||||
std::string name;
|
||||
std::vector<parts_var> vars;
|
||||
};
|
||||
static LLNetListItem* findNetListItem(LLHost host);
|
||||
static LLNetListItem* findNetListItem(LLUUID id);
|
||||
void refreshNetList();
|
||||
enum ENetInfoMode { NI_NET, NI_LOG };
|
||||
ENetInfoMode mNetInfoMode;
|
||||
static void onCommitMessageLog(LLUICtrl* ctrl, void* user_data);
|
||||
static void onCommitFilter(LLUICtrl* ctrl, void* user_data);
|
||||
};
|
||||
#endif
|
||||
// </edit>
|
||||
@@ -10,7 +10,7 @@
|
||||
#include "llmessagetemplate.h"
|
||||
#include <boost/tokenizer.hpp>
|
||||
#include "llmenugl.h"
|
||||
#include "llfloatermessagebuilder.h"
|
||||
|
||||
#include "llagent.h"
|
||||
////////////////////////////////
|
||||
// LLFloaterMessageLogItem
|
||||
@@ -505,7 +505,6 @@ BOOL LLFloaterMessageLog::postBuild()
|
||||
childSetAction("filter_apply_btn", onClickFilterApply, this);
|
||||
childSetCommitCallback("filter_edit", onCommitFilter, this);
|
||||
childSetAction("clear_log_btn", onClickClearLog, this);
|
||||
childSetAction("send_to_message_builder_btn", onClickSendToMessageBuilder, this);
|
||||
childSetText("filter_edit", sMessageLogFilterString);
|
||||
refreshNetList();
|
||||
refreshNetInfo(TRUE);
|
||||
@@ -684,7 +683,6 @@ void LLFloaterMessageLog::setNetInfoMode(ENetInfoMode mode)
|
||||
mNetInfoMode = mode;
|
||||
if(mNetInfoMode == NI_NET)
|
||||
refreshNetInfo(TRUE);
|
||||
childSetEnabled("send_to_message_builder_btn", mNetInfoMode == NI_LOG);
|
||||
}
|
||||
// static
|
||||
void LLFloaterMessageLog::onLog(LLMessageLogEntry entry)
|
||||
@@ -940,23 +938,4 @@ void LLFloaterMessageLog::onClickFilterMenu(void* user_data)
|
||||
sInstance->childSetText("filter_edit", filter);
|
||||
sInstance->startApplyingFilter(filter, FALSE);
|
||||
}
|
||||
// static
|
||||
void LLFloaterMessageLog::onClickSendToMessageBuilder(void* user_data)
|
||||
{
|
||||
LLFloaterMessageLog* floaterp = (LLFloaterMessageLog*)user_data;
|
||||
LLScrollListCtrl* scrollp = floaterp->getChild<LLScrollListCtrl>("message_log");
|
||||
LLScrollListItem* selected_itemp = scrollp->getFirstSelected();
|
||||
if(!selected_itemp) return;
|
||||
LLUUID id = selected_itemp->getUUID();
|
||||
std::vector<LLFloaterMessageLogItem>::iterator end = sFloaterMessageLogItems.end();
|
||||
for(std::vector<LLFloaterMessageLogItem>::iterator iter = sFloaterMessageLogItems.begin(); iter != end; ++iter)
|
||||
{
|
||||
if(iter->mID == id)
|
||||
{
|
||||
std::string message_text = iter->getFull(FALSE);
|
||||
LLFloaterMessageBuilder::show(message_text);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
// </edit>
|
||||
|
||||
@@ -2,7 +2,17 @@
|
||||
#include "llfloater.h"
|
||||
#include "llmessagelog.h"
|
||||
#include "lltemplatemessagereader.h"
|
||||
#include "llfloatermessagebuilder.h"
|
||||
|
||||
class LLNetListItem
|
||||
{
|
||||
public:
|
||||
LLNetListItem(LLUUID id);
|
||||
LLUUID mID;
|
||||
BOOL mAutoName;
|
||||
std::string mName;
|
||||
std::string mPreviousRegionName;
|
||||
LLCircuitData* mCircuitData;
|
||||
};
|
||||
|
||||
class LLFloaterMessageLogItem : public LLMessageLogEntry
|
||||
{
|
||||
@@ -79,6 +89,5 @@ public:
|
||||
ENetInfoMode mNetInfoMode;
|
||||
static void onClickFilterChoice(void* user_data);
|
||||
static void onClickFilterMenu(void* user_data);
|
||||
static void onClickSendToMessageBuilder(void* user_data);
|
||||
};
|
||||
// </edit>
|
||||
|
||||
@@ -707,10 +707,10 @@ LLSD LLFloaterReporter::gatherReport()
|
||||
|
||||
if ( mReportType == BUG_REPORT)
|
||||
{
|
||||
summary << short_platform << " V" << gSavedSettings.getU32("SpecifiedVersionMaj") << "."
|
||||
<< gSavedSettings.getU32("SpecifiedVersionMin") << "."
|
||||
<< gSavedSettings.getU32("SpecifiedVersionPatch") << "."
|
||||
<< gSavedSettings.getU32("SpecifiedVersionBuild")
|
||||
summary << short_platform << " V" << LL_VERSION_MAJOR << "."
|
||||
<< LL_VERSION_MINOR << "."
|
||||
<< LL_VERSION_PATCH << "."
|
||||
<< LL_VERSION_BUILD
|
||||
<< " (" << regionp->getName() << ")"
|
||||
<< "[" << category_name << "] "
|
||||
<< "\"" << childGetValue("summary_edit").asString() << "\"";
|
||||
@@ -728,10 +728,10 @@ LLSD LLFloaterReporter::gatherReport()
|
||||
std::ostringstream details;
|
||||
if (mReportType != BUG_REPORT)
|
||||
{
|
||||
details << "V" << gSavedSettings.getU32("SpecifiedVersionMaj") << "." // client version moved to body of email for abuse reports
|
||||
<< gSavedSettings.getU32("SpecifiedVersionMin") << "."
|
||||
<< gSavedSettings.getU32("SpecifiedVersionPatch") << "."
|
||||
<< gSavedSettings.getU32("SpecifiedVersionBuild") << std::endl << std::endl;
|
||||
details << "V" << LL_VERSION_MAJOR << "." // client version moved to body of email for abuse reports
|
||||
<< LL_VERSION_MINOR << "."
|
||||
<< LL_VERSION_PATCH << "."
|
||||
<< LL_VERSION_BUILD << std::endl << std::endl;
|
||||
}
|
||||
std::string object_name = childGetText("object_name");
|
||||
std::string owner_name = childGetText("owner_name");
|
||||
@@ -752,9 +752,9 @@ LLSD LLFloaterReporter::gatherReport()
|
||||
std::string version_string;
|
||||
version_string = llformat(
|
||||
"%d.%d.%d %s %s %s %s",
|
||||
gSavedSettings.getU32("SpecifiedVersionMaj"),
|
||||
gSavedSettings.getU32("SpecifiedVersionMin"),
|
||||
gSavedSettings.getU32("SpecifiedVersionPatch"),
|
||||
LL_VERSION_MAJOR,
|
||||
LL_VERSION_MINOR,
|
||||
LL_VERSION_PATCH,
|
||||
platform,
|
||||
gSysCPU.getFamily().c_str(),
|
||||
gGLManager.mGLRenderer.c_str(),
|
||||
|
||||
@@ -304,10 +304,8 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect,
|
||||
|
||||
// childSetAction("quit_btn", onClickQuit, this);
|
||||
|
||||
// <edit>
|
||||
//std::string channel = gSavedSettings.getString("VersionChannelName");
|
||||
std::string channel = gSavedSettings.getString("SpecifiedChannel");
|
||||
// </edit>
|
||||
std::string channel = LL_CHANNEL;
|
||||
|
||||
std::string version = llformat("%d.%d.%d (%d)",
|
||||
LL_VERSION_MAJOR,
|
||||
LL_VERSION_MINOR,
|
||||
@@ -971,9 +969,9 @@ void LLPanelLogin::loadLoginPage()
|
||||
// <edit>
|
||||
// Channel and Version
|
||||
std::string version = llformat("%d.%d.%d (%d)",
|
||||
gSavedSettings.getU32("SpecifiedVersionMaj"), gSavedSettings.getU32("SpecifiedVersionMin"), gSavedSettings.getU32("SpecifiedVersionPatch"), gSavedSettings.getU32("SpecifiedVersionBuild"));
|
||||
LL_VERSION_MAJOR, LL_VERSION_MINOR, LL_VERSION_PATCH, LL_VERSION_BUILD);
|
||||
|
||||
//char* curl_channel = curl_escape(gSavedSettings.getString("VersionChannelName").c_str(), 0);
|
||||
//char* curl_channel = curl_escape(LL_CHANNEL.c_str(), 0);
|
||||
char* curl_channel = curl_escape(gSavedSettings.getString("SpecifiedChannel").c_str(), 0);
|
||||
// </edit>
|
||||
char* curl_version = curl_escape(version.c_str(), 0);
|
||||
@@ -1138,17 +1136,6 @@ void LLPanelLogin::onClickConnect(void *)
|
||||
if (sInstance && sInstance->mCallback)
|
||||
{
|
||||
|
||||
|
||||
U32 specified_ver_maj = (U32)sInstance->getChild<LLSpinCtrl>("vermaj_spin")->getValue().asInteger();
|
||||
gSavedSettings.setU32("SpecifiedVersionMaj", specified_ver_maj);
|
||||
U32 specified_ver_min = (U32)sInstance->getChild<LLSpinCtrl>("vermin_spin")->getValue().asInteger();
|
||||
gSavedSettings.setU32("SpecifiedVersionMin", specified_ver_min);
|
||||
U32 specified_ver_patch = (U32)sInstance->getChild<LLSpinCtrl>("verpatch_spin")->getValue().asInteger();
|
||||
gSavedSettings.setU32("SpecifiedVersionPatch", specified_ver_patch);
|
||||
U32 specified_ver_build = (U32)sInstance->getChild<LLSpinCtrl>("verbuild_spin")->getValue().asInteger();
|
||||
gSavedSettings.setU32("SpecifiedVersionBuild", specified_ver_build);
|
||||
|
||||
// </edit>
|
||||
// tell the responder we're not here anymore
|
||||
if ( gResponsePtr )
|
||||
gResponsePtr->setParent( 0 );
|
||||
|
||||
@@ -929,9 +929,9 @@ bool idle_startup()
|
||||
if(!start_messaging_system(
|
||||
message_template_path,
|
||||
port,
|
||||
gSavedSettings.getU32("SpecifiedVersionMaj"),
|
||||
gSavedSettings.getU32("SpecifiedVersionMin"),
|
||||
gSavedSettings.getU32("SpecifiedVersionPatch"),
|
||||
LL_VERSION_MAJOR,
|
||||
LL_VERSION_MINOR,
|
||||
LL_VERSION_PATCH,
|
||||
FALSE,
|
||||
std::string(),
|
||||
responder,
|
||||
@@ -3898,9 +3898,8 @@ bool update_dialog_callback(const LLSD& notification, const LLSD& response)
|
||||
// userserver no longer exists.
|
||||
query_map["userserver"] = LLViewerLogin::getInstance()->getGridLabel();
|
||||
// <edit>
|
||||
//query_map["channel"] = gSavedSettings.getString("VersionChannelName");
|
||||
query_map["channel"] = gSavedSettings.getString("SpecifiedChannel");
|
||||
// </edit>
|
||||
query_map["channel"] = LL_CHANNEL;
|
||||
|
||||
// *TODO constantize this guy
|
||||
// *NOTE: This URL is also used in win_setup/lldownloader.cpp
|
||||
LLURI update_url = LLURI::buildHTTP("secondlife.com", 80, "update.php", query_map);
|
||||
|
||||
@@ -66,10 +66,10 @@ void LLTranslate::translateMessage(LLHTTPClient::ResponderPtr &result, const std
|
||||
//<edit>
|
||||
std::string user_agent = llformat("%s %d.%d.%d (%d)",
|
||||
gSavedSettings.getString("SpecifiedChannel").c_str(),
|
||||
gSavedSettings.getU32("SpecifiedVersionMaj"),
|
||||
gSavedSettings.getU32("SpecifiedVersionMin"),
|
||||
gSavedSettings.getU32("SpecifiedVersionPatch"),
|
||||
gSavedSettings.getU32("SpecifiedVersionBuild") );
|
||||
LL_VERSION_MAJOR,
|
||||
LL_VERSION_MINOR,
|
||||
LL_VERSION_PATCH,
|
||||
LL_VERSION_BUILD );
|
||||
//</edit>
|
||||
|
||||
if (!m_Header.size())
|
||||
|
||||
@@ -138,10 +138,10 @@ void LLUserAuth::authenticate(
|
||||
|
||||
XMLRPC_VectorAppendString(params, "version", std::string(
|
||||
gSavedSettings.getString("SpecifiedChannel") + " " +
|
||||
llformat("%d", gSavedSettings.getU32("SpecifiedVersionMaj")) + "." +
|
||||
llformat("%d", gSavedSettings.getU32("SpecifiedVersionMin")) + "." +
|
||||
llformat("%d", gSavedSettings.getU32("SpecifiedVersionPatch")) + "." +
|
||||
llformat("%d", gSavedSettings.getU32("SpecifiedVersionBuild"))
|
||||
llformat("%d", LL_VERSION_MAJOR) + "." +
|
||||
llformat("%d", LL_VERSION_MINOR) + "." +
|
||||
llformat("%d", LL_VERSION_PATCH) + "." +
|
||||
llformat("%d", LL_VERSION_BUILD)
|
||||
).c_str(), 0); // Includes channel name
|
||||
|
||||
XMLRPC_VectorAppendString(params, "channel", gSavedSettings.getString("SpecifiedChannel").c_str(), 0);
|
||||
@@ -240,10 +240,10 @@ void LLUserAuth::authenticate(
|
||||
|
||||
XMLRPC_VectorAppendString(params, "version", std::string(
|
||||
gSavedSettings.getString("SpecifiedChannel") + " " +
|
||||
llformat("%d", gSavedSettings.getU32("SpecifiedVersionMaj")) + "." +
|
||||
llformat("%d", gSavedSettings.getU32("SpecifiedVersionMin")) + "." +
|
||||
llformat("%d", gSavedSettings.getU32("SpecifiedVersionPatch")) + "." +
|
||||
llformat("%d", gSavedSettings.getU32("SpecifiedVersionBuild"))
|
||||
llformat("%d", LL_VERSION_MAJOR) + "." +
|
||||
llformat("%d", LL_VERSION_MINOR) + "." +
|
||||
llformat("%d", LL_VERSION_PATCH) + "." +
|
||||
llformat("%d", LL_VERSION_BUILD)
|
||||
).c_str(), 0); // Includes channel name
|
||||
|
||||
XMLRPC_VectorAppendString(params, "channel", gSavedSettings.getString("SpecifiedChannel").c_str(), 0);
|
||||
|
||||
@@ -247,10 +247,8 @@ std::string LLViewerMedia::getCurrentUserAgent()
|
||||
|
||||
// Just in case we need to check browser differences in A/B test
|
||||
// builds.
|
||||
// <edit>
|
||||
//std::string channel = gSavedSettings.getString("VersionChannelName");
|
||||
std::string channel = gSavedSettings.getString("SpecifiedChannel");
|
||||
// </edit>
|
||||
|
||||
std::string channel = LL_CHANNEL;
|
||||
|
||||
// append our magic version number string to the browser user agent id
|
||||
// See the HTTP 1.0 and 1.1 specifications for allowed formats:
|
||||
@@ -260,7 +258,7 @@ std::string LLViewerMedia::getCurrentUserAgent()
|
||||
// http://www.mozilla.org/build/revised-user-agent-strings.html
|
||||
std::ostringstream codec;
|
||||
codec << "SecondLife/";
|
||||
codec << gSavedSettings.getU32("SpecifiedVersionMaj") << "." << gSavedSettings.getU32("SpecifiedVersionMin") << "." << gSavedSettings.getU32("SpecifiedVersionPatch") << "." << gSavedSettings.getU32("SpecifiedVersionBuild");
|
||||
codec << LL_VERSION_MAJOR << "." << LL_VERSION_MINOR << "." << LL_VERSION_PATCH << "." << LL_VERSION_BUILD;
|
||||
codec << " (" << channel << "; " << skin_name << " skin)";
|
||||
llinfos << codec.str() << llendl;
|
||||
|
||||
|
||||
@@ -244,7 +244,6 @@
|
||||
#include "dofloaterhex.h"
|
||||
#include "hgfloatertexteditor.h"
|
||||
#include "llfloatermessagelog.h"
|
||||
#include "llfloatermessagebuilder.h"
|
||||
#include "llao.h"
|
||||
#include "llfloatervfs.h"
|
||||
#include "llfloatervfsexplorer.h"
|
||||
@@ -433,7 +432,6 @@ void handle_hide_typing_notification(void*);
|
||||
void handle_close_all_notifications(void*);
|
||||
void handle_reopen_with_hex_editor(void*);
|
||||
void handle_open_message_log(void*);
|
||||
void handle_open_message_builder(void*);
|
||||
void handle_edit_ao(void*);
|
||||
void handle_local_assets(void*);
|
||||
void handle_vfs_explorer(void*);
|
||||
@@ -756,11 +754,8 @@ void init_menus()
|
||||
menu->append(new LLMenuItemCallGL( "Toggle IM Typing Notification", &handle_hide_typing_notification, NULL));
|
||||
menu->append(new LLMenuItemCallGL( "Close All Dialogs",
|
||||
&handle_close_all_notifications, NULL, NULL, 'D', MASK_CONTROL | MASK_ALT | MASK_SHIFT));
|
||||
if (gSavedSettings.getBOOL("AscentPowerfulWizard"))
|
||||
{
|
||||
menu->append(new LLMenuItemCallGL( "Message Log", &handle_open_message_log, NULL));
|
||||
menu->append(new LLMenuItemCallGL( "Message Builder", &handle_open_message_builder, NULL));
|
||||
}
|
||||
menu->append(new LLMenuItemCallGL( "Message Log", &handle_open_message_log, NULL));
|
||||
|
||||
menu->append(new LLMenuItemCallGL( "Sound Explorer",
|
||||
&handle_sounds_explorer, NULL));
|
||||
menu->append(new LLMenuItemCallGL( "Asset Blacklist",
|
||||
@@ -3398,11 +3393,6 @@ void handle_open_message_log(void*)
|
||||
LLFloaterMessageLog::show();
|
||||
}
|
||||
|
||||
void handle_open_message_builder(void*)
|
||||
{
|
||||
LLFloaterMessageBuilder::show("");
|
||||
}
|
||||
|
||||
void handle_edit_ao(void*)
|
||||
{
|
||||
LLFloaterAO::show();
|
||||
|
||||
@@ -27,5 +27,4 @@
|
||||
</text>
|
||||
<text_editor name="net_info" follows="left|top|right|bottom" left="10" top="-400" bottom="30" right="-10" enabled="false" max_length="65535">
|
||||
</text_editor>
|
||||
<button name="send_to_message_builder_btn" follows="right|bottom" left="210" top="-570" right="-10" bottom="10" label="Send to Message Builder" enabled="false"/>
|
||||
</floater>
|
||||
|
||||
@@ -164,10 +164,10 @@
|
||||
Other
|
||||
</combo_item>
|
||||
</combo_item>
|
||||
<combo_item name="Ridiculous1" value="0">
|
||||
<combo_item name="Ridiculous1" value="69">
|
||||
User keeps licking finger and touching me
|
||||
</combo_item>
|
||||
<combo_item name="Ridiculous2" value="0">
|
||||
<combo_item name="Ridiculous2" value="70">
|
||||
User won't stay on their side of the car
|
||||
</combo_item>
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
width="20" />
|
||||
<text type="string" length="50" bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
|
||||
bottom="-37" drop_shadow_visible="true" enabled="true" follows="left|top"
|
||||
font="SansSerifSmall" h_pad="0" halign="left" height="12" left="210"
|
||||
font="SansSerifSmall" h_pad="0" halign="left" height="12" left="213"
|
||||
mouse_opaque="true" name="drive_label" v_pad="0" width="128">
|
||||
Drive:
|
||||
</text>
|
||||
@@ -32,18 +32,22 @@
|
||||
Them
|
||||
</combo_item>
|
||||
</combo_box>
|
||||
<scroll_list bottom="30" can_resize="true" column_padding="0" draw_heading="true"
|
||||
follows="left|top|bottom" left="5" multi_select="true"
|
||||
<line_editor bottom_delta="-22" follows="left|top" font="SansSerifSmall" height="18" max_length="255"
|
||||
width="255" name="dir_path" left="10" select_all_on_focus_received="true" select_on_focus="true"/>
|
||||
<button bottom_delta="-1" follows="top|left" height="18" label=">" left_delta="257"
|
||||
name="directory_button" tool_tip="Go to this filepath" width="20" />
|
||||
<scroll_list bottom="25" can_resize="true" column_padding="0" draw_heading="true"
|
||||
follows="left|top|bottom" left="7" multi_select="true"
|
||||
name="file_list" width="280" search_column="1"
|
||||
tool_tip="Hold shift or control while clicking to select multiple files"
|
||||
top="-46">
|
||||
top="-68">
|
||||
<column name="file_type" width="0" />
|
||||
<column image="ff_edit_mine_button.tga" name="icon_inventory_type"
|
||||
tool_tip="Inventory Type" width="20" />
|
||||
<column dynamicwidth="true" label="Filename" name="file_name" tool_tip="Filename" />
|
||||
</scroll_list>
|
||||
<text type="string" length="50" bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
|
||||
bottom="12" drop_shadow_visible="true" enabled="true" follows="left|bottom"
|
||||
bottom="9" drop_shadow_visible="true" enabled="true" follows="left|bottom"
|
||||
font="SansSerifSmall" h_pad="0" halign="left" height="12" left="10"
|
||||
mouse_opaque="true" name="filter_label" v_pad="0" width="128">
|
||||
Filter:
|
||||
|
||||
Reference in New Issue
Block a user