#3857 teleport finished/failed event
parent
46fca6f5bb
commit
dead3c1fca
|
|
@ -137,7 +137,7 @@ void LLAppearanceListener::getOutfitItems(LLSD const &data)
|
|||
LLViewerInventoryCategory *cat = gInventory.getCategory(outfit_id);
|
||||
if (!cat || cat->getPreferredType() != LLFolderType::FT_OUTFIT)
|
||||
{
|
||||
return response.error(stringize(LLTrans::getString("OutfitNotFound"), outfit_id.asString()));
|
||||
return response.error(stringize("Couldn't find outfit ", outfit_id.asString()));
|
||||
}
|
||||
LLInventoryModel::cat_array_t cat_array;
|
||||
LLInventoryModel::item_array_t item_array;
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@
|
|||
// Viewer includes
|
||||
#include "llagent.h"
|
||||
#include "llagentaccess.h"
|
||||
#include "llcallbacklist.h"
|
||||
#include "llviewerparcelaskplay.h"
|
||||
#include "llviewerwindow.h"
|
||||
#include "llviewercontrol.h"
|
||||
|
|
@ -1750,6 +1751,8 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use
|
|||
{
|
||||
instance->mTeleportFinishedSignal(instance->mTeleportInProgressPosition, false);
|
||||
}
|
||||
instance->postTeleportFinished(instance->mTeleportWithinRegion);
|
||||
instance->mTeleportWithinRegion = false;
|
||||
}
|
||||
parcel->setParcelEnvironmentVersion(parcel_environment_version);
|
||||
LL_DEBUGS("ENVIRONMENT") << "Parcel environment version is " << parcel->getParcelEnvironmentVersion() << LL_ENDL;
|
||||
|
|
@ -2719,6 +2722,8 @@ void LLViewerParcelMgr::onTeleportFinished(bool local, const LLVector3d& new_pos
|
|||
// Local teleport. We already have the agent parcel data.
|
||||
// Emit the signal immediately.
|
||||
getInstance()->mTeleportFinishedSignal(new_pos, local);
|
||||
|
||||
postTeleportFinished(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -2727,12 +2732,14 @@ void LLViewerParcelMgr::onTeleportFinished(bool local, const LLVector3d& new_pos
|
|||
// Let's wait for the update and then emit the signal.
|
||||
mTeleportInProgressPosition = new_pos;
|
||||
mTeleportInProgress = true;
|
||||
mTeleportWithinRegion = local;
|
||||
}
|
||||
}
|
||||
|
||||
void LLViewerParcelMgr::onTeleportFailed()
|
||||
{
|
||||
mTeleportFailedSignal();
|
||||
LLEventPumps::instance().obtain("LLTeleport").post(llsd::map("success", false));
|
||||
}
|
||||
|
||||
bool LLViewerParcelMgr::getTeleportInProgress()
|
||||
|
|
@ -2740,3 +2747,20 @@ bool LLViewerParcelMgr::getTeleportInProgress()
|
|||
return mTeleportInProgress // case where parcel data arrives after teleport
|
||||
|| gAgent.getTeleportState() > LLAgent::TELEPORT_NONE; // For LOCAL, no mTeleportInProgress
|
||||
}
|
||||
|
||||
void LLViewerParcelMgr::postTeleportFinished(bool local)
|
||||
{
|
||||
auto post = []()
|
||||
{
|
||||
LLEventPumps::instance().obtain("LLTeleport").post(llsd::map("success", true));
|
||||
};
|
||||
if (local)
|
||||
{
|
||||
static LLCachedControl<F32> teleport_local_delay(gSavedSettings, "TeleportLocalDelay");
|
||||
doAfterInterval(post, teleport_local_delay + 0.5f);
|
||||
}
|
||||
else
|
||||
{
|
||||
post();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -295,6 +295,8 @@ public:
|
|||
void onTeleportFailed();
|
||||
bool getTeleportInProgress();
|
||||
|
||||
void postTeleportFinished(bool local);
|
||||
|
||||
static bool isParcelOwnedByAgent(const LLParcel* parcelp, U64 group_proxy_power);
|
||||
static bool isParcelModifiableByAgent(const LLParcel* parcelp, U64 group_proxy_power);
|
||||
|
||||
|
|
@ -344,7 +346,9 @@ private:
|
|||
|
||||
std::vector<LLParcelObserver*> mObservers;
|
||||
|
||||
// Used to communicate between onTeleportFinished() and processParcelProperties()
|
||||
bool mTeleportInProgress;
|
||||
bool mTeleportWithinRegion{ false };
|
||||
LLVector3d mTeleportInProgressPosition;
|
||||
teleport_finished_signal_t mTeleportFinishedSignal;
|
||||
teleport_failed_signal_t mTeleportFailedSignal;
|
||||
|
|
|
|||
Loading…
Reference in New Issue