Merge branch 'DRTVWR-507-maint' of https://bitbucket.org/lindenlab/viewer

master
Ansariel 2020-11-05 09:22:31 +01:00
commit 538e8fb64e
9 changed files with 317 additions and 68 deletions

View File

@ -2375,16 +2375,18 @@
<key>archive</key>
<map>
<key>hash</key>
<string>58868cbca1623e93ee974efcd34bf063</string>
<string>9f4687d7d328b0c13a9e651e805e880a</string>
<key>hash_algorithm</key>
<string>md5</string>
<key>url</key>
<string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/69529/670913/llca-202009302013.549857-common-549857.tar.bz2</string>
<string>https://automated-builds-secondlife-com.s3.amazonaws.com/ct2/71501/691487/llca-202011010215.551526-common-551526.tar.bz2</string>
</map>
<key>name</key>
<string>common</string>
</map>
</map>
<key>version</key>
<string>202009302013.549857</string>
<string>202011010215.551526</string>
</map>
<key>llphysicsextensions_source</key>
<map>

View File

@ -154,6 +154,10 @@ public:
EStatus getStatus() const {return mStatus;};
void setStatus(EStatus pStatus) {mStatus = pStatus;};
static std::map<S32, std::string> sTeleportStatusName;
static const std::string& statusName(EStatus status);
virtual void toOstream(std::ostream& os) const;
virtual bool canRestartTeleport();
virtual void startTeleport() = 0;
@ -165,12 +169,19 @@ private:
EStatus mStatus;
};
std::map<S32, std::string> LLTeleportRequest::sTeleportStatusName = { { kPending, "kPending" },
{ kStarted, "kStarted" },
{ kFailed, "kFailed" },
{ kRestartPending, "kRestartPending"} };
class LLTeleportRequestViaLandmark : public LLTeleportRequest
{
public:
LLTeleportRequestViaLandmark(const LLUUID &pLandmarkId);
virtual ~LLTeleportRequestViaLandmark();
virtual void toOstream(std::ostream& os) const;
virtual bool canRestartTeleport();
virtual void startTeleport();
@ -189,6 +200,8 @@ public:
LLTeleportRequestViaLure(const LLUUID &pLureId, BOOL pIsLureGodLike);
virtual ~LLTeleportRequestViaLure();
virtual void toOstream(std::ostream& os) const;
virtual bool canRestartTeleport();
virtual void startTeleport();
@ -206,6 +219,8 @@ public:
LLTeleportRequestViaLocation(const LLVector3d &pPosGlobal);
virtual ~LLTeleportRequestViaLocation();
virtual void toOstream(std::ostream& os) const;
virtual bool canRestartTeleport();
virtual void startTeleport();
@ -228,6 +243,8 @@ public:
// LLTeleportRequestViaLocationLookAt(const LLVector3d &pPosGlobal);
virtual ~LLTeleportRequestViaLocationLookAt();
virtual void toOstream(std::ostream& os) const;
virtual bool canRestartTeleport();
virtual void startTeleport();
@ -568,6 +585,8 @@ void LLAgent::init()
void LLAgent::cleanup()
{
mRegionp = NULL;
mTeleportRequest = NULL;
mTeleportCanceled = NULL;
if (mTeleportFinishedSlot.connected())
{
mTeleportFinishedSlot.disconnect();
@ -1019,7 +1038,12 @@ void LLAgent::setRegion(LLViewerRegion *regionp)
if (mRegionp != regionp)
{
LL_INFOS("AgentLocation") << "Moving agent into region: " << regionp->getName() << LL_ENDL;
LL_INFOS("AgentLocation","Teleport") << "Moving agent into region: handle " << regionp->getHandle()
<< " id " << regionp->getRegionID()
<< " name " << regionp->getName()
<< " previous region "
<< (mRegionp ? mRegionp->getRegionID() : LLUUID::null)
<< LL_ENDL;
if (mRegionp)
{
// NaCl - Antispam Registry clear anti-spam queues when changing regions
@ -3183,6 +3207,7 @@ void LLAgent::handlePreferredMaturityResult(U8 pServerMaturity)
else
{
mMaturityPreferenceNumRetries = 0;
LL_WARNS() << "Too many retries for maturity preference" << LL_ENDL;
reportPreferredMaturityError();
}
}
@ -3234,6 +3259,7 @@ void LLAgent::reportPreferredMaturityError()
mIsMaturityRatingChangingDuringTeleport = false;
if (hasPendingTeleportRequest())
{
LL_WARNS("Teleport") << "Teleport failing due to preferred maturity error" << LL_ENDL;
setTeleportState(LLAgent::TELEPORT_NONE);
}
@ -4513,7 +4539,7 @@ bool LLAgent::teleportBridgeGlobal(const LLVector3d& pos_global)
// protected
bool LLAgent::teleportCore(bool is_local)
{
LL_INFOS("Teleport") << "In teleport core!" << LL_ENDL;
LL_DEBUGS("Teleport") << "In teleport core" << LL_ENDL;
if ((TELEPORT_NONE != mTeleportState) && (mTeleportState != TELEPORT_PENDING))
{
LL_WARNS() << "Attempt to teleport when already teleporting." << LL_ENDL;
@ -4580,11 +4606,13 @@ bool LLAgent::teleportCore(bool is_local)
add(LLStatViewer::TELEPORT, 1);
if (is_local)
{
LL_INFOS("Teleport") << "Setting teleport state to TELEPORT_LOCAL" << LL_ENDL;
gAgent.setTeleportState( LLAgent::TELEPORT_LOCAL );
}
else
{
gTeleportDisplay = TRUE;
LL_INFOS("Teleport") << "Non-local, setting teleport state to TELEPORT_START" << LL_ENDL;
gAgent.setTeleportState( LLAgent::TELEPORT_START );
//release geometry from old location
@ -4668,6 +4696,7 @@ void LLAgent::startTeleportRequest()
if (!isMaturityPreferenceSyncedWithServer())
{
gTeleportDisplay = TRUE;
LL_INFOS("Teleport") << "Maturity preference not synced yet, setting teleport state to TELEPORT_PENDING" << LL_ENDL;
setTeleportState(TELEPORT_PENDING);
}
else
@ -4711,10 +4740,19 @@ void LLAgent::handleTeleportFinished()
{
if (mRegionp->capabilitiesReceived())
{
LL_DEBUGS("Teleport") << "capabilities have been received for region handle "
<< mRegionp->getHandle()
<< " id " << mRegionp->getRegionID()
<< ", calling onCapabilitiesReceivedAfterTeleport()"
<< LL_ENDL;
onCapabilitiesReceivedAfterTeleport();
}
else
{
LL_DEBUGS("Teleport") << "Capabilities not yet received for region handle "
<< mRegionp->getHandle()
<< " id " << mRegionp->getRegionID()
<< LL_ENDL;
mRegionp->setCapabilitiesReceivedCallback(boost::bind(&LLAgent::onCapabilitiesReceivedAfterTeleport));
}
}
@ -4752,6 +4790,18 @@ void LLAgent::handleTeleportFailed()
/*static*/
void LLAgent::onCapabilitiesReceivedAfterTeleport()
{
if (gAgent.getRegion())
{
LL_DEBUGS("Teleport") << "running after capabilities received callback has been triggered, agent region "
<< gAgent.getRegion()->getHandle()
<< " id " << gAgent.getRegion()->getRegionID()
<< " name " << gAgent.getRegion()->getName()
<< LL_ENDL;
}
else
{
LL_WARNS("Teleport") << "called when agent region is null!" << LL_ENDL;
}
check_merchant_status();
}
@ -4768,8 +4818,8 @@ void LLAgent::teleportRequest(const U64& region_handle, const LLVector3& pos_loc
LLViewerRegion* regionp = getRegion();
if (regionp && teleportCore(region_handle == regionp->getHandle()))
{
LL_INFOS("") << "TeleportLocationRequest: '" << region_handle << "':"
<< pos_local << LL_ENDL;
LL_INFOS("Teleport") << "Sending TeleportLocationRequest: '" << region_handle << "':"
<< pos_local << LL_ENDL;
LLMessageSystem* msg = gMessageSystem;
msg->newMessage("TeleportLocationRequest");
msg->nextBlockFast(_PREHASH_AgentData);
@ -4827,6 +4877,11 @@ void LLAgent::doTeleportViaLandmark(const LLUUID& landmark_asset_id)
LLViewerRegion *regionp = getRegion();
if(regionp && teleportCore())
{
LL_INFOS("Teleport") << "Sending TeleportLandmarkRequest. Current region handle " << regionp->getHandle()
<< " region id " << regionp->getRegionID()
<< " requested landmark id " << landmark_asset_id
<< LL_ENDL;
LLMessageSystem* msg = gMessageSystem;
msg->newMessageFast(_PREHASH_TeleportLandmarkRequest);
msg->nextBlockFast(_PREHASH_Info);
@ -4859,6 +4914,11 @@ void LLAgent::doTeleportViaLure(const LLUUID& lure_id, BOOL godlike)
teleport_flags |= TELEPORT_FLAGS_VIA_LURE;
}
LL_INFOS("Teleport") << "Sending TeleportLureRequest."
<< " Current region handle " << regionp->getHandle()
<< " region id " << regionp->getRegionID()
<< " lure id " << lure_id
<< LL_ENDL;
// send the message
LLMessageSystem* msg = gMessageSystem;
msg->newMessageFast(_PREHASH_TeleportLureRequest);
@ -4881,6 +4941,8 @@ void LLAgent::teleportCancel()
LLViewerRegion* regionp = getRegion();
if(regionp)
{
LL_INFOS("Teleport") << "Sending TeleportCancel" << LL_ENDL;
// send the message
LLMessageSystem* msg = gMessageSystem;
msg->newMessage("TeleportCancel");
@ -4893,13 +4955,14 @@ void LLAgent::teleportCancel()
}
clearTeleportRequest();
gAgent.setTeleportState( LLAgent::TELEPORT_NONE );
gPipeline.resetVertexBuffers();
gPipeline.resetVertexBuffers();
}
void LLAgent::restoreCanceledTeleportRequest()
{
if (mTeleportCanceled != NULL)
{
LL_INFOS() << "Restoring canceled teleport request, setting state to TELEPORT_REQUESTED" << LL_ENDL;
gAgent.setTeleportState( LLAgent::TELEPORT_REQUESTED );
mTeleportRequest = mTeleportCanceled;
mTeleportCanceled.reset();
@ -4961,7 +5024,6 @@ void LLAgent::doTeleportViaLocation(const LLVector3d& pos_global)
}
else if(regionp && teleportCore(isLocal))
{
LL_WARNS() << "Using deprecated teleportlocationrequest." << LL_ENDL;
// send the message
LLMessageSystem* msg = gMessageSystem;
msg->newMessageFast(_PREHASH_TeleportLocationRequest);
@ -4982,6 +5044,14 @@ void LLAgent::doTeleportViaLocation(const LLVector3d& pos_global)
msg->addVector3Fast(_PREHASH_Position, pos);
pos.mV[VX] += 1;
msg->addVector3Fast(_PREHASH_LookAt, pos);
LL_WARNS("Teleport") << "Sending deprecated(?) TeleportLocationRequest."
<< " pos_global " << pos_global
<< " region_x " << region_x
<< " region_y " << region_y
<< " region_handle " << region_handle
<< LL_ENDL;
sendReliableMessage();
}
// <FS:TT> Client LSL Bridge
@ -5088,7 +5158,11 @@ void LLAgent::setTeleportState(ETeleportState state)
" for previously failed teleport. Ignore!" << LL_ENDL;
return;
}
LL_DEBUGS("Teleport") << "Setting teleport state to " << state << " Previous state: " << mTeleportState << LL_ENDL;
LL_DEBUGS("Teleport") << "Setting teleport state to "
<< LLAgent::teleportStateName(state) << "(" << state << ")"
<< " Previous state: "
<< teleportStateName(mTeleportState) << "(" << mTeleportState << ")"
<< LL_ENDL;
mTeleportState = state;
if (mTeleportState > TELEPORT_NONE && gSavedSettings.getBOOL("FreezeTime"))
{
@ -5439,6 +5513,34 @@ void LLAgent::observeFriends()
}
}
std::map<S32, std::string> LLAgent::sTeleportStateName = { { TELEPORT_NONE, "TELEPORT_NONE" },
{ TELEPORT_START, "TELEPORT_START" },
{ TELEPORT_REQUESTED, "TELEPORT_REQUESTED" },
{ TELEPORT_MOVING, "TELEPORT_MOVING" },
{ TELEPORT_START_ARRIVAL, "TELEPORT_START_ARRIVAL" },
{ TELEPORT_ARRIVING, "TELEPORT_ARRIVING" },
{ TELEPORT_LOCAL, "TELEPORT_LOCAL" },
{ TELEPORT_PENDING, "TELEPORT_PENDING" } };
const std::string& LLAgent::teleportStateName(S32 state)
{
static std::string invalid_state_str("INVALID");
auto iter = LLAgent::sTeleportStateName.find(state);
if (iter != LLAgent::sTeleportStateName.end())
{
return iter->second;
}
else
{
return invalid_state_str;
}
}
const std::string& LLAgent::getTeleportStateName() const
{
return teleportStateName(getTeleportState());
}
void LLAgent::parseTeleportMessages(const std::string& xml_filename)
{
LLXMLNodePtr root;
@ -5602,40 +5704,70 @@ void LLTeleportRequest::restartTeleport()
llassert(0);
}
// TODO this enum -> name idiom should be in a common class rather than repeated various places.
const std::string& LLTeleportRequest::statusName(EStatus status)
{
static std::string invalid_status_str("INVALID");
auto iter = LLTeleportRequest::sTeleportStatusName.find(status);
if (iter != LLTeleportRequest::sTeleportStatusName.end())
{
return iter->second;
}
else
{
return invalid_status_str;
}
}
std::ostream& operator<<(std::ostream& os, const LLTeleportRequest& req)
{
req.toOstream(os);
return os;
}
void LLTeleportRequest::toOstream(std::ostream& os) const
{
os << "status " << statusName(mStatus) << "(" << mStatus << ")";
}
//-----------------------------------------------------------------------------
// LLTeleportRequestViaLandmark
//-----------------------------------------------------------------------------
LLTeleportRequestViaLandmark::LLTeleportRequestViaLandmark(const LLUUID &pLandmarkId)
: LLTeleportRequest(),
mLandmarkId(pLandmarkId)
{
LL_INFOS("Teleport") << "LLTeleportRequestViaLandmark created." << LL_ENDL;
LL_INFOS("Teleport") << "LLTeleportRequestViaLandmark created, " << *this << LL_ENDL;
}
LLTeleportRequestViaLandmark::~LLTeleportRequestViaLandmark()
{
LL_INFOS("Teleport") << "~LLTeleportRequestViaLandmark" << LL_ENDL;
LL_INFOS("Teleport") << "~LLTeleportRequestViaLandmark, " << *this << LL_ENDL;
}
void LLTeleportRequestViaLandmark::toOstream(std::ostream& os) const
{
os << "landmark " << mLandmarkId << " ";
LLTeleportRequest::toOstream(os);
}
bool LLTeleportRequestViaLandmark::canRestartTeleport()
{
LL_INFOS("Teleport") << "LLTeleportRequestViaLandmark::canRestartTeleport? -> true" << LL_ENDL;
LL_INFOS("Teleport") << "LLTeleportRequestViaLandmark::canRestartTeleport? -> true, " << *this << LL_ENDL;
return true;
}
void LLTeleportRequestViaLandmark::startTeleport()
{
LL_INFOS("Teleport") << "LLTeleportRequestViaLandmark::startTeleport" << LL_ENDL;
LL_INFOS("Teleport") << "LLTeleportRequestViaLandmark::startTeleport, " << *this << LL_ENDL;
gAgent.doTeleportViaLandmark(getLandmarkId());
}
void LLTeleportRequestViaLandmark::restartTeleport()
{
LL_INFOS("Teleport") << "LLTeleportRequestViaLandmark::restartTeleport" << LL_ENDL;
LL_INFOS("Teleport") << "LLTeleportRequestViaLandmark::restartTeleport, " << *this << LL_ENDL;
gAgent.doTeleportViaLandmark(getLandmarkId());
}
//-----------------------------------------------------------------------------
// LLTeleportRequestViaLure
//-----------------------------------------------------------------------------
@ -5652,6 +5784,12 @@ LLTeleportRequestViaLure::~LLTeleportRequestViaLure()
LL_INFOS("Teleport") << "~LLTeleportRequestViaLure" << LL_ENDL;
}
void LLTeleportRequestViaLure::toOstream(std::ostream& os) const
{
os << "mIsLureGodLike " << (S32) mIsLureGodLike << " ";
LLTeleportRequestViaLandmark::toOstream(os);
}
bool LLTeleportRequestViaLure::canRestartTeleport()
{
// stinson 05/17/2012 : cannot restart a teleport via lure because of server-side restrictions
@ -5690,6 +5828,12 @@ LLTeleportRequestViaLocation::~LLTeleportRequestViaLocation()
{
}
void LLTeleportRequestViaLocation::toOstream(std::ostream& os) const
{
os << "mPosGlobal " << mPosGlobal << " ";
LLTeleportRequest::toOstream(os);
}
bool LLTeleportRequestViaLocation::canRestartTeleport()
{
LL_INFOS("Teleport") << "LLTeleportRequestViaLocation::canRestartTeleport -> true" << LL_ENDL;
@ -5729,6 +5873,11 @@ LLTeleportRequestViaLocationLookAt::~LLTeleportRequestViaLocationLookAt()
{
}
void LLTeleportRequestViaLocationLookAt::toOstream(std::ostream& os) const
{
LLTeleportRequestViaLocation::toOstream(os);
}
bool LLTeleportRequestViaLocationLookAt::canRestartTeleport()
{
LL_INFOS("Teleport") << "LLTeleportRequestViaLocationLookAt::canRestartTeleport -> true" << LL_ENDL;

View File

@ -702,6 +702,10 @@ public:
TELEPORT_PENDING = 7
};
static std::map<S32, std::string> sTeleportStateName;
static const std::string& teleportStateName(S32);
const std::string& getTeleportStateName() const;
public:
static void parseTeleportMessages(const std::string& xml_filename);
const void getTeleportSourceSLURL(LLSLURL& slurl) const;

View File

@ -1125,7 +1125,6 @@ LLFolderViewItem* LLInventoryPanel::buildViewsTree(const LLUUID& id,
if(items)
{
bool has_items = parentp->getItemsCount() > 0;
for (LLViewerInventoryItem::item_array_t::const_iterator item_iter = items->begin();
item_iter != items->end();
++item_iter)
@ -1133,19 +1132,14 @@ LLFolderViewItem* LLInventoryPanel::buildViewsTree(const LLUUID& id,
const LLViewerInventoryItem* item = (*item_iter);
if (typedViewsFilter(item->getUUID(), item))
{
if (has_items)
{
// This can be optimized: we don't need to call getItemByID()
// each time, especially since content is growing, we can just
// iter over copy of mItemMap in some way
LLFolderViewItem* view_itemp = getItemByID(item->getUUID());
buildViewsTree(item->getUUID(), id, item, view_itemp, parentp);
}
else
{
buildViewsTree(item->getUUID(), id, item, NULL, parentp);
}
// This can be optimized: we don't need to call getItemByID()
// each time, especially since content is growing, we can just
// iter over copy of mItemMap in some way
LLFolderViewItem* view_itemp = getItemByID(item->getUUID());
buildViewsTree(item->getUUID(), id, item, view_itemp, parentp);
}
}
}
mInventory->unlockDirectDescendentArrays(id);

View File

@ -471,6 +471,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
if( (gAgent.getTeleportState() != LLAgent::TELEPORT_START) && (teleport_percent > 100.f) )
{
// Give up. Don't keep the UI locked forever.
LL_WARNS("Teleport") << "Giving up on teleport. elapsed time " << teleport_elapsed << " exceeds max time " << teleport_save_time << LL_ENDL;
gAgent.setTeleportState( LLAgent::TELEPORT_NONE );
gAgent.setTeleportMessage(std::string());
}
@ -509,7 +510,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
gTeleportDisplayTimer.reset();
gViewerWindow->setShowProgress(TRUE,!gSavedSettings.getBOOL("FSDisableTeleportScreens"));
gViewerWindow->setProgressPercent(llmin(teleport_percent, 0.0f));
LL_INFOS("Teleport") << "A teleport request has been sent, setting state to TELEPORT_REQUESTED" << LL_ENDL;
gAgent.setTeleportState( LLAgent::TELEPORT_REQUESTED );
gAgent.setTeleportMessage(
LLAgent::sTeleportProgressMessages["requesting"]);
@ -535,6 +536,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
gTeleportArrivalTimer.reset();
gViewerWindow->setProgressCancelButtonVisible(FALSE, LLTrans::getString("Cancel"));
gViewerWindow->setProgressPercent(75.f);
LL_INFOS("Teleport") << "Changing state to TELEPORT_ARRIVING" << LL_ENDL;
gAgent.setTeleportState( LLAgent::TELEPORT_ARRIVING );
gAgent.setTeleportMessage(
LLAgent::sTeleportProgressMessages["arriving"]);
@ -556,6 +558,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
{
arrival_fraction = 1.f;
//LLFirstUse::useTeleport();
LL_INFOS("Teleport") << "arrival_fraction is " << arrival_fraction << " changing state to TELEPORT_NONE" << LL_ENDL;
gAgent.setTeleportState( LLAgent::TELEPORT_NONE );
}
gViewerWindow->setProgressCancelButtonVisible(FALSE, LLTrans::getString("Cancel"));
@ -573,6 +576,10 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
// </FS:CR>
{
//LLFirstUse::useTeleport();
LL_INFOS("Teleport") << "State is local and gTeleportDisplayTimer " << gTeleportDisplayTimer.getElapsedTimeF32()
<< " exceeds teleport_local_delete " << teleport_local_delay
<< "; setting state to TELEPORT_NONE"
<< LL_ENDL;
gAgent.setTeleportState( LLAgent::TELEPORT_NONE );
}
}

View File

@ -488,6 +488,7 @@ void give_money(const LLUUID& uuid, LLViewerRegion* region, S32 amount, BOOL is_
void send_complete_agent_movement(const LLHost& sim_host)
{
LL_DEBUGS("Teleport", "Messaging") << "Sending CompleteAgentMovement to sim_host " << sim_host << LL_ENDL;
LLMessageSystem* msg = gMessageSystem;
msg->newMessageFast(_PREHASH_CompleteAgentMovement);
msg->nextBlockFast(_PREHASH_AgentData);
@ -3643,12 +3644,12 @@ BOOL LLPostTeleportNotifiers::tick()
// We're going to pretend to be a new agent
void process_teleport_finish(LLMessageSystem* msg, void**)
{
LL_DEBUGS("Messaging") << "Got teleport location message" << LL_ENDL;
LL_DEBUGS("Teleport","Messaging") << "Received TeleportFinish message" << LL_ENDL;
LLUUID agent_id;
msg->getUUIDFast(_PREHASH_Info, _PREHASH_AgentID, agent_id);
if (agent_id != gAgent.getID())
{
LL_WARNS("Messaging") << "Got teleport notification for wrong agent!" << LL_ENDL;
LL_WARNS("Teleport","Messaging") << "Got teleport notification for wrong agent " << agent_id << " expected " << gAgent.getID() << ", ignoring!" << LL_ENDL;
return;
}
@ -3658,12 +3659,13 @@ void process_teleport_finish(LLMessageSystem* msg, void**)
{
// Server either ignored teleport cancel message or did not receive it in time.
// This message can't be ignored since teleport is complete at server side
LL_INFOS("Teleport") << "Restoring canceled teleport request" << LL_ENDL;
gAgent.restoreCanceledTeleportRequest();
}
else
{
// Race condition? Make sure all variables are set correctly for teleport to work
LL_WARNS("Messaging") << "Teleport 'finish' message without 'start'" << LL_ENDL;
LL_WARNS("Teleport","Messaging") << "Teleport 'finish' message without 'start'. Setting state to TELEPORT_REQUESTED" << LL_ENDL;
gTeleportDisplay = TRUE;
LLViewerMessage::getInstance()->mTeleportStartedSignal();
gAgent.setTeleportState(LLAgent::TELEPORT_REQUESTED);
@ -3672,7 +3674,7 @@ void process_teleport_finish(LLMessageSystem* msg, void**)
}
else if (gAgent.getTeleportState() == LLAgent::TELEPORT_MOVING)
{
LL_WARNS("Messaging") << "Teleport message in the middle of other teleport" << LL_ENDL;
LL_WARNS("Teleport","Messaging") << "Teleport message in the middle of other teleport" << LL_ENDL;
}
// Teleport is finished; it can't be cancelled now.
@ -3724,6 +3726,14 @@ void process_teleport_finish(LLMessageSystem* msg, void**)
std::string seedCap;
msg->getStringFast(_PREHASH_Info, _PREHASH_SeedCapability, seedCap);
LL_DEBUGS("Teleport") << "TeleportFinish message params are:"
<< " sim_ip " << sim_ip
<< " sim_port " << sim_port
<< " region_handle " << region_handle
<< " teleport_flags " << teleport_flags
<< " seedCap " << seedCap
<< LL_ENDL;
// update home location if we are teleporting out of prelude - specific to teleporting to welcome area
if((teleport_flags & TELEPORT_FLAGS_SET_HOME_TO_TARGET)
&& (!gAgent.isGodlike()))
@ -3775,7 +3785,7 @@ void process_teleport_finish(LLMessageSystem* msg, void**)
gAgent.standUp();
// now, use the circuit info to tell simulator about us!
LL_INFOS("Messaging") << "process_teleport_finish() Enabling "
LL_INFOS("Teleport","Messaging") << "process_teleport_finish() sending UseCircuitCode to enable sim_host "
<< sim_host << " with code " << msg->mOurCircuitCode << LL_ENDL;
msg->newMessageFast(_PREHASH_UseCircuitCode);
msg->nextBlockFast(_PREHASH_CircuitCode);
@ -3784,11 +3794,12 @@ void process_teleport_finish(LLMessageSystem* msg, void**)
msg->addUUIDFast(_PREHASH_ID, gAgent.getID());
msg->sendReliable(sim_host);
LL_INFOS("Teleport") << "Calling send_complete_agent_movement() and setting state to TELEPORT_MOVING" << LL_ENDL;
send_complete_agent_movement(sim_host);
gAgent.setTeleportState( LLAgent::TELEPORT_MOVING );
gAgent.setTeleportMessage(LLAgent::sTeleportProgressMessages["contacting"]);
LL_DEBUGS("CrossingCaps") << "Calling setSeedCapability from process_teleport_finish(). Seed cap == "
LL_DEBUGS("CrossingCaps") << "Calling setSeedCapability(). Seed cap == "
<< seedCap << LL_ENDL;
regionp->setSeedCapability(seedCap);
@ -3836,6 +3847,8 @@ void process_avatar_init_complete(LLMessageSystem* msg, void**)
void process_agent_movement_complete(LLMessageSystem* msg, void**)
{
LL_INFOS("Teleport","Messaging") << "Received ProcessAgentMovementComplete" << LL_ENDL;
gShiftFrame = true;
gAgentMovementCompleted = true;
@ -3845,13 +3858,13 @@ void process_agent_movement_complete(LLMessageSystem* msg, void**)
msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_SessionID, session_id);
if((gAgent.getID() != agent_id) || (gAgent.getSessionID() != session_id))
{
LL_WARNS("Messaging") << "Incorrect id in process_agent_movement_complete()"
<< LL_ENDL;
LL_WARNS("Teleport", "Messaging") << "Incorrect agent or session id in process_agent_movement_complete()"
<< " agent " << agent_id << " expected " << gAgent.getID()
<< " session " << session_id << " expected " << gAgent.getSessionID()
<< ", ignoring" << LL_ENDL;
return;
}
LL_DEBUGS("Messaging") << "process_agent_movement_complete()" << LL_ENDL;
// *TODO: check timestamp to make sure the movement compleation
// makes sense.
LLVector3 agent_pos;
@ -3868,7 +3881,7 @@ void process_agent_movement_complete(LLMessageSystem* msg, void**)
{
// Could happen if you were immediately god-teleported away on login,
// maybe other cases. Continue, but warn.
LL_WARNS("Messaging") << "agent_movement_complete() with NULL avatarp." << LL_ENDL;
LL_WARNS("Teleport", "Messaging") << "agent_movement_complete() with NULL avatarp." << LL_ENDL;
}
F32 x, y;
@ -3878,13 +3891,15 @@ void process_agent_movement_complete(LLMessageSystem* msg, void**)
{
if (gAgent.getRegion())
{
LL_WARNS("Messaging") << "current region " << gAgent.getRegion()->getOriginGlobal() << LL_ENDL;
LL_WARNS("Teleport", "Messaging") << "current region origin "
<< gAgent.getRegion()->getOriginGlobal() << " id " << gAgent.getRegion()->getRegionID() << LL_ENDL;
}
LL_WARNS("Messaging") << "Agent being sent to invalid home region: "
<< x << ":" << y
<< " current pos " << gAgent.getPositionGlobal()
<< LL_ENDL;
LL_WARNS("Teleport", "Messaging") << "Agent being sent to invalid home region: "
<< x << ":" << y
<< " current pos " << gAgent.getPositionGlobal()
<< ", calling forceDisconnect()"
<< LL_ENDL;
LLAppViewer::instance()->forceDisconnect(LLTrans::getString("SentToInvalidRegion"));
return;
@ -3893,13 +3908,13 @@ void process_agent_movement_complete(LLMessageSystem* msg, void**)
// <FS:Ansariel> Crash fix
if (!gAgent.getRegion())
{
LL_WARNS("Messaging") << "Agent was disconnected from the region" << LL_ENDL;
LL_WARNS(""Teleport",Messaging") << "Agent was disconnected from the region" << LL_ENDL;
LLAppViewer::instance()->forceDisconnect(LLTrans::getString("YouHaveBeenDisconnected"));
return;
}
// </FS:Ansariel>
LL_INFOS("Messaging") << "Changing home region to " << x << ":" << y << LL_ENDL;
LL_INFOS("Teleport","Messaging") << "Changing home region to region id " << regionp->getRegionID() << " handle " << region_handle << " == x,y " << x << "," << y << LL_ENDL;
// set our upstream host the new simulator and shuffle things as
// appropriate.
@ -3953,6 +3968,7 @@ void process_agent_movement_complete(LLMessageSystem* msg, void**)
gAgentCamera.slamLookAt(look_at);
gAgentCamera.updateCamera();
LL_INFOS("Teleport") << "Agent movement complete, setting state to TELEPORT_START_ARRIVAL" << LL_ENDL;
gAgent.setTeleportState( LLAgent::TELEPORT_START_ARRIVAL );
// <FS:Ansariel> [Legacy Bake]
@ -3986,6 +4002,8 @@ void process_agent_movement_complete(LLMessageSystem* msg, void**)
else
{
// This is initial log-in or a region crossing
LL_INFOS("Teleport") << "State is not TELEPORT_MOVING, so this is initial log-in or region crossing. "
<< "Setting state to TELEPORT_NONE" << LL_ENDL;
gAgent.setTeleportState( LLAgent::TELEPORT_NONE );
if(LLStartUp::getStartupState() < STATE_STARTED)
@ -7600,6 +7618,8 @@ std::string formatted_time(const time_t& the_time)
void process_teleport_failed(LLMessageSystem *msg, void**)
{
LL_WARNS("Teleport","Messaging") << "Received TeleportFailed message" << LL_ENDL;
std::string message_id; // Tag from server, like "RegionEntryAccessBlocked"
std::string big_reason; // Actual message to display
LLSD args;
@ -7618,6 +7638,7 @@ void process_teleport_failed(LLMessageSystem *msg, void**)
// Nothing found in the map - use what the server returned in the original message block
msg->getStringFast(_PREHASH_Info, _PREHASH_Reason, big_reason);
}
LL_WARNS("Teleport") << "AlertInfo message_id " << message_id << " reason: " << big_reason << LL_ENDL;
LLSD llsd_block;
std::string llsd_raw;
@ -7627,10 +7648,11 @@ void process_teleport_failed(LLMessageSystem *msg, void**)
std::istringstream llsd_data(llsd_raw);
if (!LLSDSerialize::deserialize(llsd_block, llsd_data, llsd_raw.length()))
{
LL_WARNS() << "process_teleport_failed: Attempted to read alert parameter data into LLSD but failed:" << llsd_raw << LL_ENDL;
LL_WARNS("Teleport") << "process_teleport_failed: Attempted to read alert parameter data into LLSD but failed:" << llsd_raw << LL_ENDL;
}
else
{
LL_WARNS("Teleport") << "AlertInfo llsd block received: " << llsd_block << LL_ENDL;
if(llsd_block.has("REGION_NAME"))
{
std::string region_name = llsd_block["REGION_NAME"].asString();
@ -7646,6 +7668,7 @@ void process_teleport_failed(LLMessageSystem *msg, void**)
{
if( gAgent.getTeleportState() != LLAgent::TELEPORT_NONE )
{
LL_WARNS("Teleport") << "called handle_teleport_access_blocked, setting state to TELEPORT_NONE" << LL_ENDL;
gAgent.setTeleportState( LLAgent::TELEPORT_NONE );
}
return;
@ -7668,6 +7691,7 @@ void process_teleport_failed(LLMessageSystem *msg, void**)
args["REASON"] = message_id;
}
}
LL_WARNS("Teleport") << "Displaying CouldNotTeleportReason string, REASON= " << args["REASON"] << LL_ENDL;
// <FS:Ansariel> Stop typing after teleport (possible fix for FIRE-7273)
gAgent.stopTyping();
@ -7681,17 +7705,21 @@ void process_teleport_failed(LLMessageSystem *msg, void**)
if( gAgent.getTeleportState() != LLAgent::TELEPORT_NONE )
{
LL_WARNS("Teleport") << "End of process_teleport_failed(). Reason message arg is " << args["REASON"]
<< ". Setting state to TELEPORT_NONE" << LL_ENDL;
gAgent.setTeleportState( LLAgent::TELEPORT_NONE );
}
}
void process_teleport_local(LLMessageSystem *msg,void**)
{
LL_INFOS("Teleport","Messaging") << "Received TeleportLocal message" << LL_ENDL;
LLUUID agent_id;
msg->getUUIDFast(_PREHASH_Info, _PREHASH_AgentID, agent_id);
if (agent_id != gAgent.getID())
{
LL_WARNS("Messaging") << "Got teleport notification for wrong agent!" << LL_ENDL;
LL_WARNS("Teleport", "Messaging") << "Got teleport notification for wrong agent " << agent_id << " expected " << gAgent.getID() << ", ignoring!" << LL_ENDL;
return;
}
@ -7703,6 +7731,7 @@ void process_teleport_local(LLMessageSystem *msg,void**)
msg->getVector3Fast(_PREHASH_Info, _PREHASH_LookAt, look_at);
msg->getU32Fast(_PREHASH_Info, _PREHASH_TeleportFlags, teleport_flags);
LL_INFOS("Teleport") << "Message params are location_id " << location_id << " teleport_flags " << teleport_flags << LL_ENDL;
if( gAgent.getTeleportState() != LLAgent::TELEPORT_NONE )
{
if( gAgent.getTeleportState() == LLAgent::TELEPORT_LOCAL )
@ -7715,6 +7744,8 @@ void process_teleport_local(LLMessageSystem *msg,void**)
}
else
{
LL_WARNS("Teleport") << "State is not TELEPORT_LOCAL: " << gAgent.getTeleportStateName()
<< ", setting state to TELEPORT_NONE" << LL_ENDL;
gAgent.setTeleportState( LLAgent::TELEPORT_NONE );
}
}

View File

@ -4954,9 +4954,7 @@ LLViewerTexture* LLViewerObject::getBakedTextureForMagicId(const LLUUID& id)
}
LLVOAvatar* avatar = getAvatar();
if (avatar && !isHUDAttachment()
&& isMesh()
&& getVolume() && getVolume()->getParams().getSculptID().notNull()) // checking for the rigged mesh by params instead of using isRiggedMesh() to avoid false negatives when skin info isn't ready
if (avatar && !isHUDAttachment())
{
LLAvatarAppearanceDefines::EBakedTextureIndex texIndex = LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary::assetIdToBakedTextureIndex(id);
LLViewerTexture* bakedTexture = avatar->getBakedTexture(texIndex);

View File

@ -298,6 +298,7 @@ void LLViewerRegionImpl::requestBaseCapabilitiesCoro(U64 regionHandle)
LL_INFOS("AppInit", "Capabilities") << "Requesting seed from " << url
<< " region name " << regionp->getName()
<< " handle " << regionp->getHandle()
<< " (attempt #" << mSeedCapAttempts + 1 << ")" << LL_ENDL;
LL_DEBUGS("AppInit", "Capabilities") << "Capabilities requested: " << capabilityNames << LL_ENDL;
@ -361,9 +362,9 @@ void LLViewerRegionImpl::requestBaseCapabilitiesCoro(U64 regionHandle)
log_capabilities(mCapabilities);
#endif
LL_DEBUGS("AppInit", "Capabilities", "Teleport") << "received caps for handle " << regionHandle
<< " region name " << regionp->getName() << LL_ENDL;
regionp->setCapabilitiesReceived(true);
LL_DEBUGS("AppInit", "Capabilities") << "received caps for handle " << regionHandle
<< " region name " << regionp->getName() << LL_ENDL;
if (STATE_SEED_GRANTED_WAIT == LLStartUp::getStartupState())
{

View File

@ -149,7 +149,7 @@ def make_translation_table(mod_tree, base_tree, lang, args):
try:
mod_xui_tree = mod_tree[xui_path]
except:
failure("xui tree not found for base language", args.base_lang)
failure("xui tree not found for base language", args.base_lang,"or target lang", lang)
if args.rev == args.rev_base:
failure("Revs are the same, nothing to compare")
@ -222,8 +222,56 @@ def make_translation_table(mod_tree, base_tree, lang, args):
data.append([val, transl_val, new_val, "", "", filename, name, attr])
all_en_strings.add(val)
rows += 1
return data
def find_deletions(mod_tree, base_tree, lang, args, f):
transl_xui_path = "{}/{}".format(xui_base, lang)
try:
transl_xui_tree = mod_tree[transl_xui_path]
except:
failure("xui tree not found for base language", args.base_lang,"or target lang", lang)
for transl_blob in transl_xui_tree.traverse():
if transl_blob.type == "tree": # directory, skip
continue
transl_filename = transl_blob.path
mod_filename = transl_filename.replace("/xui/{}/".format(lang), "/xui/{}/".format(args.base_lang))
#print("checking",transl_filename,"against",mod_filename)
try:
mod_blob = mod_tree[mod_filename]
except:
print(" delete file", transl_filename, file=f)
continue
mod_dict = read_xml_elements(mod_blob)
if len(mod_dict) == 0:
print(" delete file", transl_filename, file=f)
continue
transl_dict = read_xml_elements(transl_blob)
#print("mod vs transl", len(mod_dict), len(transl_dict))
lines = 0
for elt_key in transl_dict:
if not elt_key in mod_dict:
if lines == 0:
print(" in file", transl_filename, file=f)
lines += 1
print(" delete element", elt_key, file=f)
else:
transl_elt = transl_dict[elt_key]
mod_elt = mod_dict[elt_key]
for a in transl_elt.attrib:
if not a in mod_elt.attrib:
if lines == 0:
print(" in file", transl_filename, file=f)
lines += 1
print(" delete attribute", a, "from", elt_key, file=f)
if transl_elt.text and (not mod_elt.text):
if lines == 0:
print(" in file", transl_filename, file=f)
lines += 1
print(" delete text from", elt_key, file=f)
def save_translation_file(per_lang_data, aux_data, outfile):
langs = sorted(per_lang_data.keys())
@ -274,10 +322,12 @@ if __name__ == "__main__":
parser = argparse.ArgumentParser(description="analyze viewer xui files for needed translations", usage=usage_msg)
parser.add_argument("-v","--verbose", action="store_true", help="verbose flag")
parser.add_argument("--missing", action="store_true", default = False, help="include all fields for which a translation does not exist")
parser.add_argument("--deleted", action="store_true", default = False, help="show all translated entities which don't exist in english")
parser.add_argument("--skip_spreadsheet", action="store_true", default = False, help="skip creating the translation spreadsheet")
parser.add_argument("--rev", help="revision with modified strings, default HEAD", default="HEAD")
parser.add_argument("--rev_base", help="previous revision to compare against, default master", default="master")
parser.add_argument("--base_lang", help="base language, default en (normally leave unchanged - other values are only useful for testing)", default="en")
parser.add_argument("--lang", help="target languages, or all", nargs="+", default = ["all"])
parser.add_argument("--lang", help="target languages, or 'all_valid' or 'supported'; default is 'supported'", nargs="+", default = ["supported"])
args = parser.parse_args()
cwd = os.getcwd()
@ -304,15 +354,19 @@ if __name__ == "__main__":
xui_base_tree = mod_tree[xui_base]
# Find target languages
# all languages present in the codebase
valid_langs = [tree.name.lower() for tree in xui_base_tree if tree.name.lower() != args.base_lang.lower()]
# offically supported languages
supported_langs = ["fr", "es", "it", "pt", "ja", "de"]
langs = [l.lower() for l in args.lang]
if "all" in args.lang:
if "supported" in args.lang:
langs = supported_langs
if "all_valid" in args.lang:
langs = valid_langs
langs = sorted(langs)
for lang in langs:
if not lang in valid_langs:
failure("Unknown target language {}. Valid values are {} or all".format(lang,",".join(sorted(valid_langs))))
failure("Unknown target language {}. Valid values are {}".format(lang,", ".join(sorted(valid_langs) + ["all_valid","supported"])))
print("Target language(s) are", ",".join(sorted(langs)))
sys.stdout.flush()
@ -328,13 +382,22 @@ if __name__ == "__main__":
["Mod Commit", mod_commit.hexsha],
["Base Commit", base_commit.hexsha],
] }
per_lang_data = {}
for lang in langs:
print("Creating spreadsheet for language", lang)
sys.stdout.flush()
per_lang_data[lang] = make_translation_table(mod_tree, base_tree, lang, args)
print("Saving output file", outfile)
save_translation_file(per_lang_data, aux_data, outfile)
if not args.skip_spreadsheet:
per_lang_data = {}
for lang in langs:
print("Creating spreadsheet for language", lang)
sys.stdout.flush()
per_lang_data[lang] = make_translation_table(mod_tree, base_tree, lang, args)
print("Saving output file", outfile)
save_translation_file(per_lang_data, aux_data, outfile)
if args.deleted:
deletion_file = "Translate_deletions.txt"
print("Saving deletion info to", deletion_file)
with open(deletion_file,"w") as f:
for lang in langs:
find_deletions(mod_tree, base_tree, lang, args, f)