From 69de1f4eb7cdd063bbdd7b4019a6a9799fc5dc5f Mon Sep 17 00:00:00 2001 From: James Cook Date: Fri, 16 Apr 2010 19:06:17 -0700 Subject: Accept expires timestamp as UTC datetime in LLSD --- indra/llcommon/llavatarname.cpp | 2 +- indra/llcommon/llavatarname.h | 2 +- indra/llmessage/llavatarnamecache.cpp | 33 ++++++++++++++++----------------- indra/newview/llviewermessage.cpp | 1 + indra/newview/llviewerregion.cpp | 5 +++++ 5 files changed, 24 insertions(+), 19 deletions(-) diff --git a/indra/llcommon/llavatarname.cpp b/indra/llcommon/llavatarname.cpp index 48ff7f3cc8..5debf88818 100644 --- a/indra/llcommon/llavatarname.cpp +++ b/indra/llcommon/llavatarname.cpp @@ -39,7 +39,7 @@ LLAvatarName::LLAvatarName() : mSLID(), mDisplayName(), mIsDisplayNameDefault(false), - mExpires(U32_MAX), + mExpires(F64_MAX), mBadge() { } diff --git a/indra/llcommon/llavatarname.h b/indra/llcommon/llavatarname.h index 5a0306c57e..72e2980b5c 100644 --- a/indra/llcommon/llavatarname.h +++ b/indra/llcommon/llavatarname.h @@ -58,7 +58,7 @@ public: // Names can change, so need to keep track of when name was // last checked. // Unix time-from-epoch seconds - U32 mExpires; + F64 mExpires; // Can be a viewer UI image name ("Person_Check") or a server-side // image UUID, or empty string. diff --git a/indra/llmessage/llavatarnamecache.cpp b/indra/llmessage/llavatarnamecache.cpp index 8268624b84..2c143266fe 100644 --- a/indra/llmessage/llavatarnamecache.cpp +++ b/indra/llmessage/llavatarnamecache.cpp @@ -60,7 +60,7 @@ namespace LLAvatarNameCache // agent IDs that have been requested, but with no reply // maps agent ID to frame time request was made - typedef std::map pending_queue_t; + typedef std::map pending_queue_t; pending_queue_t sPendingQueue; // Callbacks to fire when we received a name. @@ -96,12 +96,12 @@ namespace LLAvatarNameCache agents - seconds_until_display_name_update - + display_name_next_update + 2010-04-16T21:34:02+00:00Z + display_name_expires + 2010-04-16T21:32:26.142178+00:00Z display_name MickBot390 LLQABot - seconds_until_display_name_expires - sl_id mickbot390.llqabot id @@ -110,12 +110,12 @@ namespace LLAvatarNameCache false - seconds_until_display_name_update - + display_name_next_update + 2010-04-16T21:34:02+00:00Z + display_name_expires + 2010-04-16T21:32:26.142178+00:00Z display_name Bjork Gudmundsdottir - seconds_until_display_name_expires - 3600 sl_id sardonyx.linden id @@ -155,10 +155,9 @@ void LLAvatarNameCache::processNameFromService(const LLSD& row) av_name.mSLID = row["sl_id"].asString(); av_name.mDisplayName = row["display_name"].asString(); av_name.mIsDisplayNameDefault = row["is_display_name_default"].asBoolean(); + av_name.mExpires = row["display_name_expires"].asReal(); - U32 now = (U32)LLFrameTimer::getTotalSeconds(); - S32 seconds_until_expires = row["seconds_until_display_name_expires"].asInteger(); - av_name.mExpires = now + seconds_until_expires; + llinfos << "JAMESDEBUG expires " << av_name.mExpires << " now " << LLFrameTimer::getTotalSeconds() << llendl; // HACK for pretty stars //if (row["last_name"].asString() == "Linden") @@ -287,7 +286,7 @@ void LLAvatarNameCache::idle() requestNames(); // Move requests from Ask queue to Pending queue - U32 now = (U32)LLFrameTimer::getTotalSeconds(); + F64 now = LLFrameTimer::getTotalSeconds(); ask_queue_t::const_iterator it = sAskQueue.begin(); for ( ; it != sAskQueue.end(); ++it) { @@ -298,9 +297,9 @@ void LLAvatarNameCache::idle() bool LLAvatarNameCache::isRequestPending(const LLUUID& agent_id) { - const U32 PENDING_TIMEOUT_SECS = 5 * 60; - U32 now = (U32)LLFrameTimer::getTotalSeconds(); - U32 expire_time = now - PENDING_TIMEOUT_SECS; + const F64 PENDING_TIMEOUT_SECS = 5.0 * 60.0; + F64 now = LLFrameTimer::getTotalSeconds(); + F64 expire_time = now - PENDING_TIMEOUT_SECS; pending_queue_t::const_iterator it = sPendingQueue.find(agent_id); if (it != sPendingQueue.end()) @@ -313,7 +312,7 @@ bool LLAvatarNameCache::isRequestPending(const LLUUID& agent_id) void LLAvatarNameCache::eraseExpired() { - U32 now = (U32)LLFrameTimer::getTotalSeconds(); + F64 now = LLFrameTimer::getTotalSeconds(); cache_t::iterator it = sCache.begin(); while (it != sCache.end()) { diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 13f52d8db7..000eb45121 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -4615,6 +4615,7 @@ void process_money_balance_reply( LLMessageSystem* msg, void** ) msg->getS32("TransactionInfo", "Amount", amount); msg->getString("TransactionInfo", "ItemDescription", item_description); llinfos << "JAMESDEBUG money_balance_reply source " << source_id + << " dest " << dest_id << " item " << item_description << llendl; } diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index 2b907ee24a..feade68edc 100644 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -176,6 +176,9 @@ public: } } + // JAMESDEBUG *TODO* THIS IS WRONG!!!!!!!!!!!!!!!!!!!!! + // this isn't necessarily the region the viewer is in + // Avatar name lookup library needs to know who to ask std::string name_lookup_url = mRegion->getCapability("GetDisplayNames"); // capabilities require URLs with slashes before query params, like: @@ -188,6 +191,8 @@ public: name_lookup_url += '/'; } LLAvatarNameCache::setNameLookupURL(name_lookup_url); + + llinfos << "JAMESDEBUG cap " << name_lookup_url << llendl; if (STATE_SEED_GRANTED_WAIT == LLStartUp::getStartupState()) { -- cgit v1.2.3