summaryrefslogtreecommitdiff
path: root/indra/newview/llfloaterland.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llfloaterland.cpp')
-rwxr-xr-xindra/newview/llfloaterland.cpp68
1 files changed, 44 insertions, 24 deletions
diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp
index f9c39a02c9..ce32aeda94 100755
--- a/indra/newview/llfloaterland.cpp
+++ b/indra/newview/llfloaterland.cpp
@@ -81,6 +81,8 @@
#include "llgroupactions.h"
+const F64 COVENANT_REFRESH_TIME_SEC = 60.0f;
+
static std::string OWNER_ONLINE = "0";
static std::string OWNER_OFFLINE = "1";
static std::string OWNER_GROUP = "2";
@@ -2444,33 +2446,33 @@ void LLPanelLandAccess::refresh()
cit != parcel->mAccessList.end(); ++cit)
{
const LLAccessEntry& entry = (*cit).second;
- std::string suffix;
+ std::string prefix;
if (entry.mTime != 0)
{
LLStringUtil::format_map_t args;
S32 now = time(NULL);
S32 seconds = entry.mTime - now;
if (seconds < 0) seconds = 0;
- suffix.assign(" (");
+ prefix.assign(" (");
if (seconds >= 120)
{
args["[MINUTES]"] = llformat("%d", (seconds/60));
std::string buf = parent_floater->getString ("Minutes", args);
- suffix.append(buf);
+ prefix.append(buf);
}
else if (seconds >= 60)
{
- suffix.append("1 " + parent_floater->getString("Minute"));
+ prefix.append("1 " + parent_floater->getString("Minute"));
}
else
{
args["[SECONDS]"] = llformat("%d", seconds);
std::string buf = parent_floater->getString ("Seconds", args);
- suffix.append(buf);
+ prefix.append(buf);
}
- suffix.append(" " + parent_floater->getString("Remaining") + ")");
+ prefix.append(" " + parent_floater->getString("Remaining") + ") ");
}
- mListAccess->addNameItem(entry.mID, ADD_DEFAULT, TRUE, suffix);
+ mListAccess->addNameItem(entry.mID, ADD_DEFAULT, TRUE, "", prefix);
}
mListAccess->sortByName(TRUE);
}
@@ -2490,33 +2492,33 @@ void LLPanelLandAccess::refresh()
cit != parcel->mBanList.end(); ++cit)
{
const LLAccessEntry& entry = (*cit).second;
- std::string suffix;
+ std::string prefix;
if (entry.mTime != 0)
{
LLStringUtil::format_map_t args;
S32 now = time(NULL);
S32 seconds = entry.mTime - now;
if (seconds < 0) seconds = 0;
- suffix.assign(" (");
+ prefix.assign(" (");
if (seconds >= 120)
{
args["[MINUTES]"] = llformat("%d", (seconds/60));
std::string buf = parent_floater->getString ("Minutes", args);
- suffix.append(buf);
+ prefix.append(buf);
}
else if (seconds >= 60)
{
- suffix.append("1 " + parent_floater->getString("Minute"));
+ prefix.append("1 " + parent_floater->getString("Minute"));
}
else
{
args["[SECONDS]"] = llformat("%d", seconds);
std::string buf = parent_floater->getString ("Seconds", args);
- suffix.append(buf);
+ prefix.append(buf);
}
- suffix.append(" " + parent_floater->getString("Remaining") + ")");
+ prefix.append(" " + parent_floater->getString("Remaining") + ") ");
}
- mListBanned->addNameItem(entry.mID, ADD_DEFAULT, TRUE, suffix);
+ mListBanned->addNameItem(entry.mID, ADD_DEFAULT, TRUE, "", prefix);
}
mListBanned->sortByName(TRUE);
}
@@ -2919,14 +2921,23 @@ void LLPanelLandAccess::onClickRemoveBanned(void* data)
//---------------------------------------------------------------------------
LLPanelLandCovenant::LLPanelLandCovenant(LLParcelSelectionHandle& parcel)
: LLPanel(),
- mParcel(parcel)
-{
+ mParcel(parcel),
+ mNextUpdateTime(0)
+{
}
LLPanelLandCovenant::~LLPanelLandCovenant()
{
}
+BOOL LLPanelLandCovenant::postBuild()
+{
+ mLastRegionID = LLUUID::null;
+ mNextUpdateTime = 0;
+
+ return TRUE;
+}
+
// virtual
void LLPanelLandCovenant::refresh()
{
@@ -2973,14 +2984,23 @@ void LLPanelLandCovenant::refresh()
changeable_clause->setText(getString("can_not_change"));
}
}
-
- // send EstateCovenantInfo message
- LLMessageSystem *msg = gMessageSystem;
- msg->newMessage("EstateCovenantRequest");
- msg->nextBlockFast(_PREHASH_AgentData);
- msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
- msg->addUUIDFast(_PREHASH_SessionID,gAgent.getSessionID());
- msg->sendReliable(region->getHost());
+
+ if (mLastRegionID != region->getRegionID()
+ || mNextUpdateTime < LLTimer::getElapsedSeconds())
+ {
+ // Request Covenant Info
+ // Note: LLPanelLandCovenant doesn't change Covenant's content and any
+ // changes made by Estate floater should be requested by Estate floater
+ LLMessageSystem *msg = gMessageSystem;
+ msg->newMessage("EstateCovenantRequest");
+ msg->nextBlockFast(_PREHASH_AgentData);
+ msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
+ msg->addUUIDFast(_PREHASH_SessionID,gAgent.getSessionID());
+ msg->sendReliable(region->getHost());
+
+ mLastRegionID = region->getRegionID();
+ mNextUpdateTime = LLTimer::getElapsedSeconds() + COVENANT_REFRESH_TIME_SEC;
+ }
}
// static