summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerparcelmgr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llviewerparcelmgr.cpp')
-rw-r--r--indra/newview/llviewerparcelmgr.cpp49
1 files changed, 47 insertions, 2 deletions
diff --git a/indra/newview/llviewerparcelmgr.cpp b/indra/newview/llviewerparcelmgr.cpp
index 193dfaae96..1b669dbaf6 100644
--- a/indra/newview/llviewerparcelmgr.cpp
+++ b/indra/newview/llviewerparcelmgr.cpp
@@ -58,6 +58,7 @@
#include "llparcelselection.h"
#include "llresmgr.h"
#include "llsdutil.h"
+#include "llsdutil_math.h"
#include "llstatusbar.h"
#include "llui.h"
#include "llviewerimage.h"
@@ -155,6 +156,8 @@ LLViewerParcelMgr::LLViewerParcelMgr()
{
mAgentParcelOverlay[i] = 0;
}
+
+ mTeleportInProgress = TRUE; // the initial parcel update is treated like teleport
}
@@ -646,7 +649,7 @@ LLParcel *LLViewerParcelMgr::getAgentParcel() const
}
// Return whether the agent can build on the land they are on
-BOOL LLViewerParcelMgr::agentCanBuild() const
+bool LLViewerParcelMgr::agentCanBuild() const
{
if (mAgentParcel)
{
@@ -938,7 +941,7 @@ void LLViewerParcelMgr::sendParcelGodForceOwner(const LLUUID& owner_id)
payload["parcel_local_id"] = mCurrentParcel->getLocalID();
payload["region_host"] = region->getHost().getIPandPort();
LLNotification::Params params("ForceOwnerAuctionWarning");
- params.payload(payload).functor(callback_god_force_owner);
+ params.payload(payload).functor.function(callback_god_force_owner);
if(mCurrentParcel->getAuctionID())
{
@@ -1513,6 +1516,17 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use
LLViewerParcelMgr::getInstance()->writeAgentParcelFromBitmap(bitmap);
delete[] bitmap;
+
+ // Let interesting parties know about agent parcel change.
+ LLViewerParcelMgr* instance = LLViewerParcelMgr::getInstance();
+
+ instance->mAgentParcelChangedSignal();
+
+ if (instance->mTeleportInProgress)
+ {
+ instance->mTeleportInProgress = FALSE;
+ instance->mTeleportFinishedSignal();
+ }
}
}
@@ -2378,3 +2392,34 @@ LLViewerImage* LLViewerParcelMgr::getPassImage() const
{
return sPassImage;
}
+
+boost::signals2::connection LLViewerParcelMgr::setAgentParcelChangedCallback(parcel_changed_callback_t cb)
+{
+ return mAgentParcelChangedSignal.connect(cb);
+}
+
+boost::signals2::connection LLViewerParcelMgr::setTeleportFinishedCallback(parcel_changed_callback_t cb)
+{
+ return mTeleportFinishedSignal.connect(cb);
+}
+
+boost::signals2::connection LLViewerParcelMgr::setTeleportFailedCallback(parcel_changed_callback_t cb)
+{
+ return mTeleportFailedSignal.connect(cb);
+}
+
+/* Ok, we're notified that teleport has been finished.
+ * We should now propagate the notification via mTeleportFinishedSignal
+ * to all interested parties.
+ * However the agent parcel data has not been updated yet.
+ * Let's wait for the update and then emit the signal.
+ */
+void LLViewerParcelMgr::onTeleportFinished()
+{
+ mTeleportInProgress = TRUE;
+}
+
+void LLViewerParcelMgr::onTeleportFailed()
+{
+ mTeleportFailedSignal();
+}