diff options
author | Eugene Mutavchi <emutavchi@productengine.com> | 2010-04-14 13:18:40 +0300 |
---|---|---|
committer | Eugene Mutavchi <emutavchi@productengine.com> | 2010-04-14 13:18:40 +0300 |
commit | 079963c9295243c731916127e39bfa39ae9690ca (patch) | |
tree | ea750dcc1fdfdd24cac83d83dfd70385ca1cc1f8 /indra/newview | |
parent | f4a03a397575b1b4a54bfe289a155acd6c831441 (diff) |
Fixed normal bug EXT-6302 (TP requests need to display destination region maturity)
Added:
- parsing of region information from "lure" binary bucket
- displaying destination region maturity by teleport offer
Reviewed by Mike Antipov at https://codereview.productengine.com/secondlife/r/229/
--HG--
branch : product-engine
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llviewermessage.cpp | 57 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/notifications.xml | 2 |
2 files changed, 58 insertions, 1 deletions
diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 32df7d8410..48e781e95d 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -32,6 +32,7 @@ #include "llviewerprecompiledheaders.h" #include "llviewermessage.h" +#include "boost/lexical_cast.hpp" #include "llanimationstates.h" #include "llaudioengine.h" @@ -1860,6 +1861,53 @@ protected: } }; +static void parse_lure_bucket(const std::string& bucket, + U64& region_handle, + LLVector3& pos, + LLVector3& look_at, + U8& region_access) +{ + // tokenize the bucket + typedef boost::tokenizer<boost::char_separator<char> > tokenizer; + boost::char_separator<char> sep("|", "", boost::keep_empty_tokens); + tokenizer tokens(bucket, sep); + tokenizer::iterator iter = tokens.begin(); + + S32 gx = boost::lexical_cast<S32>((*(iter)).c_str()); + S32 gy = boost::lexical_cast<S32>((*(++iter)).c_str()); + S32 rx = boost::lexical_cast<S32>((*(++iter)).c_str()); + S32 ry = boost::lexical_cast<S32>((*(++iter)).c_str()); + S32 rz = boost::lexical_cast<S32>((*(++iter)).c_str()); + S32 lx = boost::lexical_cast<S32>((*(++iter)).c_str()); + S32 ly = boost::lexical_cast<S32>((*(++iter)).c_str()); + S32 lz = boost::lexical_cast<S32>((*(++iter)).c_str()); + + // Grab region access + region_access = SIM_ACCESS_MIN; + if (++iter != tokens.end()) + { + std::string access_str((*iter).c_str()); + LLStringUtil::trim(access_str); + if ( access_str == "A" ) + { + region_access = SIM_ACCESS_ADULT; + } + else if ( access_str == "M" ) + { + region_access = SIM_ACCESS_MATURE; + } + else if ( access_str == "PG" ) + { + region_access = SIM_ACCESS_PG; + } + } + + pos.setVec((F32)rx, (F32)ry, (F32)rz); + look_at.setVec((F32)lx, (F32)ly, (F32)lz); + + region_handle = to_region_handle(gx, gy); +} + void process_improved_im(LLMessageSystem *msg, void **user_data) { if (gNoRender) @@ -2493,10 +2541,19 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) } else { + LLVector3 pos, look_at; + U64 region_handle; + U8 region_access; + std::string region_info = ll_safe_string((char*)binary_bucket, binary_bucket_size); + parse_lure_bucket(region_info, region_handle, pos, look_at, region_access); + + std::string region_access_str = LLViewerRegion::accessToString(region_access); + LLSD args; // *TODO: Translate -> [FIRST] [LAST] (maybe) args["NAME_SLURL"] = LLSLURL::buildCommand("agent", from_id, "about"); args["MESSAGE"] = message; + args["MATURITY"] = region_access_str; LLSD payload; payload["from_id"] = from_id; payload["lure_id"] = session_id; diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 9ee4e13f3c..6c9564c8cf 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -5165,7 +5165,7 @@ An object named [OBJECTFROMNAME] owned by (an unknown Resident) has given you th type="offer"> [NAME_SLURL] has offered to teleport you to their location: -[MESSAGE] +[MESSAGE], ([MATURITY]) <form name="form"> <button index="0" |