From 2cde962d5db94baf860eb94fecaf9671548b2c53 Mon Sep 17 00:00:00 2001 From: "dolphin@dolphin-THINK.lindenlab.com" Date: Mon, 19 Nov 2012 08:06:42 -0800 Subject: Test populating the experience keys UI with avatar name data. --- indra/llmessage/llexperiencecache.h | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'indra/llmessage/llexperiencecache.h') diff --git a/indra/llmessage/llexperiencecache.h b/indra/llmessage/llexperiencecache.h index 6be51b039e..799cdea13a 100644 --- a/indra/llmessage/llexperiencecache.h +++ b/indra/llmessage/llexperiencecache.h @@ -32,7 +32,20 @@ #include class LLUUID; -class LLExperienceData; + + +class LLExperienceData +{ +public: + bool fromLLSD(const LLSD& sd); + LLSD asLLSD() const; + + + std::string mDisplayName; + std::string mDescription; +}; + + namespace LLExperienceCache { @@ -41,12 +54,18 @@ namespace LLExperienceCache void idle(); + void exportFile(std::ostream& ostr); + void importFile(std::istream& istr); + void initClass(bool running); void erase(const LLUUID& agent_id); void fetch(const LLUUID& agent_id); void insert(const LLUUID& agent_id, const LLExperienceData& experience_data); bool get(const LLUUID& agent_id, LLExperienceData* experience_data); + typedef std::map cache_t; + + const cache_t& getCached(); }; #endif // LL_LLEXPERIENCECACHE_H -- cgit v1.2.3 From 2566e0d08fd7e8a47fc690a8163c1273d91141c2 Mon Sep 17 00:00:00 2001 From: "dolphin@dolphin-THINK.lindenlab.com" Date: Mon, 26 Nov 2012 08:42:23 -0800 Subject: Added code for simulator integration. Added signals for cache update callbacks. Added expiration timers for cached experiences. --- indra/llmessage/llexperiencecache.h | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'indra/llmessage/llexperiencecache.h') diff --git a/indra/llmessage/llexperiencecache.h b/indra/llmessage/llexperiencecache.h index 799cdea13a..2f2647d5a3 100644 --- a/indra/llmessage/llexperiencecache.h +++ b/indra/llmessage/llexperiencecache.h @@ -30,6 +30,7 @@ #define LL_LLEXPERIENCECACHE_H #include +#include class LLUUID; @@ -43,27 +44,40 @@ public: std::string mDisplayName; std::string mDescription; + F64 mExpires; }; namespace LLExperienceCache { + // dummy name used when we have nothing else + const std::string DUMMY_NAME = "\?\?\?"; + // Callback types for get() below + typedef boost::signals2::signal< + void (const LLUUID& agent_id, const LLExperienceData& experience)> + callback_signal_t; + typedef callback_signal_t::slot_type callback_slot_t; + typedef std::map cache_t; + + void setLookupURL(const std::string& lookup_url); bool hasLookupURL(); + void setMaximumLookups(int maximumLookups); void idle(); void exportFile(std::ostream& ostr); void importFile(std::istream& istr); - void initClass(bool running); + void initClass(); void erase(const LLUUID& agent_id); void fetch(const LLUUID& agent_id); void insert(const LLUUID& agent_id, const LLExperienceData& experience_data); bool get(const LLUUID& agent_id, LLExperienceData* experience_data); - typedef std::map cache_t; + // If name information is in cache, callback will be called immediately. + void get(const LLUUID& agent_id, callback_slot_t slot); const cache_t& getCached(); }; -- cgit v1.2.3 From 179e944f45476e03eb7b828e427f9d299529ad12 Mon Sep 17 00:00:00 2001 From: dolphin Date: Tue, 18 Dec 2012 16:06:00 -0800 Subject: Updated client to use new caps brought over server changes to llExperienceCache --- indra/llmessage/llexperiencecache.h | 45 ++++++++++++++++++------------------- 1 file changed, 22 insertions(+), 23 deletions(-) (limited to 'indra/llmessage/llexperiencecache.h') diff --git a/indra/llmessage/llexperiencecache.h b/indra/llmessage/llexperiencecache.h index 2f2647d5a3..396a244935 100644 --- a/indra/llmessage/llexperiencecache.h +++ b/indra/llmessage/llexperiencecache.h @@ -29,36 +29,35 @@ #ifndef LL_LLEXPERIENCECACHE_H #define LL_LLEXPERIENCECACHE_H -#include +#include "linden_common.h" #include +class LLSD; class LLUUID; -class LLExperienceData -{ -public: - bool fromLLSD(const LLSD& sd); - LLSD asLLSD() const; - - - std::string mDisplayName; - std::string mDescription; - F64 mExpires; -}; - - namespace LLExperienceCache { + const std::string PUBLIC_KEY = "public-id"; + const std::string PRIVATE_KEY = "private-id"; + const std::string CREATOR_KEY = "creator-id"; + const std::string NAME = "name"; + const std::string PROPERTIES = "properties"; + const std::string EXPIRES = "expires"; + + const int EXPERIENCE_INVALID = (1 << 0); + const int EXPERIENCE_NORMAL = (1 << 1); + const int EXPERIENCE_REGION = (1 << 2); + const static F64 DEFAULT_EXPIRATION = 600.0; + // dummy name used when we have nothing else const std::string DUMMY_NAME = "\?\?\?"; // Callback types for get() below - typedef boost::signals2::signal< - void (const LLUUID& agent_id, const LLExperienceData& experience)> + typedef boost::signals2::signal callback_signal_t; typedef callback_signal_t::slot_type callback_slot_t; - typedef std::map cache_t; + typedef std::map cache_t; void setLookupURL(const std::string& lookup_url); @@ -70,14 +69,14 @@ namespace LLExperienceCache void exportFile(std::ostream& ostr); void importFile(std::istream& istr); void initClass(); - - void erase(const LLUUID& agent_id); - void fetch(const LLUUID& agent_id); - void insert(const LLUUID& agent_id, const LLExperienceData& experience_data); - bool get(const LLUUID& agent_id, LLExperienceData* experience_data); + + void erase(const LLUUID& key, const std::string& key_type); + bool fetch(const LLUUID& key, const std::string& key_type, bool refresh = false); + void insert(LLSD& experience_data); + bool get(const LLUUID& key, const std::string& key_type, LLSD& experience_data); // If name information is in cache, callback will be called immediately. - void get(const LLUUID& agent_id, callback_slot_t slot); + void get(const LLUUID& key, const std::string& key_type, callback_slot_t slot); const cache_t& getCached(); }; -- cgit v1.2.3 From 61874872a7b4b8909f835650ab6732e24c61ffa2 Mon Sep 17 00:00:00 2001 From: dolphin Date: Wed, 13 Feb 2013 14:20:35 -0800 Subject: Updated experience cache to latest web service api Added new CAP request for experiences the avatar can sign --- indra/llmessage/llexperiencecache.h | 36 ++++++++++++++++++++++++------------ 1 file changed, 24 insertions(+), 12 deletions(-) (limited to 'indra/llmessage/llexperiencecache.h') diff --git a/indra/llmessage/llexperiencecache.h b/indra/llmessage/llexperiencecache.h index 396a244935..7a21bd9729 100644 --- a/indra/llmessage/llexperiencecache.h +++ b/indra/llmessage/llexperiencecache.h @@ -39,20 +39,28 @@ class LLUUID; namespace LLExperienceCache { - const std::string PUBLIC_KEY = "public-id"; - const std::string PRIVATE_KEY = "private-id"; - const std::string CREATOR_KEY = "creator-id"; + const std::string PRIVATE_KEY = "private_id"; + + const std::string EXPERIENCE_ID = "public_id"; + const std::string OWNER_ID = "owner_id"; const std::string NAME = "name"; const std::string PROPERTIES = "properties"; const std::string EXPIRES = "expires"; + const std::string DESCRIPTION = "description"; + + // should be in sync with experience-api/experiences/models.py + const int PROPERTY_INVALID = 1 << 0; + const int PROPERTY_NORMAL = 1 << 1; + const int PROPERTY_REGION = 1 << 2; + const int PROPERTY_PRIVILEGED = 1 << 3; + const int PROPERTY_GRID = 1 << 4; + const int PROPERTY_PRIVATE = 1 << 5; + const int PROPERTY_DISABLED = 1 << 6; + const int PROPERTY_SUSPENDED = 1 << 7; + - const int EXPERIENCE_INVALID = (1 << 0); - const int EXPERIENCE_NORMAL = (1 << 1); - const int EXPERIENCE_REGION = (1 << 2); const static F64 DEFAULT_EXPIRATION = 600.0; - // dummy name used when we have nothing else - const std::string DUMMY_NAME = "\?\?\?"; // Callback types for get() below typedef boost::signals2::signal callback_signal_t; @@ -69,16 +77,20 @@ namespace LLExperienceCache void exportFile(std::ostream& ostr); void importFile(std::istream& istr); void initClass(); + void bootstrap(const LLSD& legacyKeys, int initialExpiration); - void erase(const LLUUID& key, const std::string& key_type); - bool fetch(const LLUUID& key, const std::string& key_type, bool refresh = false); + void erase(const LLUUID& key); + bool fetch(const LLUUID& key, bool refresh=false); void insert(LLSD& experience_data); - bool get(const LLUUID& key, const std::string& key_type, LLSD& experience_data); + bool get(const LLUUID& key, LLSD& experience_data); // If name information is in cache, callback will be called immediately. - void get(const LLUUID& key, const std::string& key_type, callback_slot_t slot); + void get(const LLUUID& key, callback_slot_t slot); const cache_t& getCached(); + + LLUUID getExperienceId(const LLUUID& private_key, bool null_if_not_found=false); + }; #endif // LL_LLEXPERIENCECACHE_H -- cgit v1.2.3 From d5308c19f7c622538d61e3ebb174338ce95a7b72 Mon Sep 17 00:00:00 2001 From: dolphin Date: Wed, 13 Mar 2013 10:24:30 -0700 Subject: Fixed up expiration code for the experience cache --- indra/llmessage/llexperiencecache.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llmessage/llexperiencecache.h') diff --git a/indra/llmessage/llexperiencecache.h b/indra/llmessage/llexperiencecache.h index 7a21bd9729..1490c978b3 100644 --- a/indra/llmessage/llexperiencecache.h +++ b/indra/llmessage/llexperiencecache.h @@ -45,7 +45,7 @@ namespace LLExperienceCache const std::string OWNER_ID = "owner_id"; const std::string NAME = "name"; const std::string PROPERTIES = "properties"; - const std::string EXPIRES = "expires"; + const std::string EXPIRES = "expiration"; const std::string DESCRIPTION = "description"; // should be in sync with experience-api/experiences/models.py -- cgit v1.2.3 From 4bdecca57ec82a5dbc323432b7b5cb6aba9c1303 Mon Sep 17 00:00:00 2001 From: dolphin Date: Tue, 2 Apr 2013 15:02:23 -0700 Subject: Removed outdated experience property flags --- indra/llmessage/llexperiencecache.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'indra/llmessage/llexperiencecache.h') diff --git a/indra/llmessage/llexperiencecache.h b/indra/llmessage/llexperiencecache.h index 1490c978b3..fb00ea31f0 100644 --- a/indra/llmessage/llexperiencecache.h +++ b/indra/llmessage/llexperiencecache.h @@ -50,8 +50,6 @@ namespace LLExperienceCache // should be in sync with experience-api/experiences/models.py const int PROPERTY_INVALID = 1 << 0; - const int PROPERTY_NORMAL = 1 << 1; - const int PROPERTY_REGION = 1 << 2; const int PROPERTY_PRIVILEGED = 1 << 3; const int PROPERTY_GRID = 1 << 4; const int PROPERTY_PRIVATE = 1 << 5; -- cgit v1.2.3 From 257110c11e5546f0a5a07b087694cfc9059367b4 Mon Sep 17 00:00:00 2001 From: dolphin Date: Wed, 21 Aug 2013 15:43:09 -0700 Subject: Added new fields to the experience cache. Experience profile moved to it's own floater, will probalby be moving again. XP profile displays most data, though the presentation is not final Fixed a bug with the XP selection combobox in the script editor --- indra/llmessage/llexperiencecache.h | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'indra/llmessage/llexperiencecache.h') diff --git a/indra/llmessage/llexperiencecache.h b/indra/llmessage/llexperiencecache.h index fb00ea31f0..8b3443e5a9 100644 --- a/indra/llmessage/llexperiencecache.h +++ b/indra/llmessage/llexperiencecache.h @@ -40,13 +40,21 @@ class LLUUID; namespace LLExperienceCache { const std::string PRIVATE_KEY = "private_id"; + const std::string MISSING = "DoesNotExist"; + const std::string AGENT_ID = "agent_id"; + const std::string GROUP_ID = "group_id"; const std::string EXPERIENCE_ID = "public_id"; const std::string OWNER_ID = "owner_id"; const std::string NAME = "name"; const std::string PROPERTIES = "properties"; const std::string EXPIRES = "expiration"; - const std::string DESCRIPTION = "description"; + const std::string DESCRIPTION = "description"; + const std::string QUOTA = "quota"; + const std::string MATURITY = "maturity"; + const std::string METADATA = "extended_metadata"; + const std::string SLURL = "slurl"; + // should be in sync with experience-api/experiences/models.py const int PROPERTY_INVALID = 1 << 0; @@ -54,10 +62,12 @@ namespace LLExperienceCache const int PROPERTY_GRID = 1 << 4; const int PROPERTY_PRIVATE = 1 << 5; const int PROPERTY_DISABLED = 1 << 6; - const int PROPERTY_SUSPENDED = 1 << 7; + const int PROPERTY_SUSPENDED = 1 << 7; + // default values const static F64 DEFAULT_EXPIRATION = 600.0; + const static S32 DEFAULT_QUOTA = 128; // this is megabytes // Callback types for get() below typedef boost::signals2::signal @@ -79,7 +89,7 @@ namespace LLExperienceCache void erase(const LLUUID& key); bool fetch(const LLUUID& key, bool refresh=false); - void insert(LLSD& experience_data); + void insert(const LLSD& experience_data); bool get(const LLUUID& key, LLSD& experience_data); // If name information is in cache, callback will be called immediately. @@ -87,6 +97,7 @@ namespace LLExperienceCache const cache_t& getCached(); + // maps an experience private key to the experience id LLUUID getExperienceId(const LLUUID& private_key, bool null_if_not_found=false); }; -- cgit v1.2.3 From a0b8c3e029be9265152cb8919ebe9c2bc328b766 Mon Sep 17 00:00:00 2001 From: dolphin Date: Wed, 12 Mar 2014 11:49:17 -0700 Subject: Windows lets you erase with a const iterator but linux does not. --- indra/llmessage/llexperiencecache.h | 1 - 1 file changed, 1 deletion(-) (limited to 'indra/llmessage/llexperiencecache.h') diff --git a/indra/llmessage/llexperiencecache.h b/indra/llmessage/llexperiencecache.h index 8b3443e5a9..e6129796b7 100644 --- a/indra/llmessage/llexperiencecache.h +++ b/indra/llmessage/llexperiencecache.h @@ -45,7 +45,6 @@ namespace LLExperienceCache const std::string AGENT_ID = "agent_id"; const std::string GROUP_ID = "group_id"; const std::string EXPERIENCE_ID = "public_id"; - const std::string OWNER_ID = "owner_id"; const std::string NAME = "name"; const std::string PROPERTIES = "properties"; const std::string EXPIRES = "expiration"; -- cgit v1.2.3 From 74dcc04e69b845e62d25e83b615399f8a5d26d21 Mon Sep 17 00:00:00 2001 From: dolphin Date: Mon, 17 Mar 2014 15:57:15 -0700 Subject: Updated experience cache to get a const reference to xp data --- indra/llmessage/llexperiencecache.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llmessage/llexperiencecache.h') diff --git a/indra/llmessage/llexperiencecache.h b/indra/llmessage/llexperiencecache.h index e6129796b7..e669ee888e 100644 --- a/indra/llmessage/llexperiencecache.h +++ b/indra/llmessage/llexperiencecache.h @@ -89,7 +89,7 @@ namespace LLExperienceCache void erase(const LLUUID& key); bool fetch(const LLUUID& key, bool refresh=false); void insert(const LLSD& experience_data); - bool get(const LLUUID& key, LLSD& experience_data); + const LLSD& get(const LLUUID& key); // If name information is in cache, callback will be called immediately. void get(const LLUUID& key, callback_slot_t slot); -- cgit v1.2.3