summaryrefslogtreecommitdiff
path: root/indra/llcommon
diff options
context:
space:
mode:
authorJames Cook <james@lindenlab.com>2010-05-27 14:56:29 -0700
committerJames Cook <james@lindenlab.com>2010-05-27 14:56:29 -0700
commitc7a6a2e08f34b2cd21816a905c21e8017646001c (patch)
tree296ca43bd0267418649f0de8d2ee100e360736b0 /indra/llcommon
parent5250ac075a2bf2ce6712acdb908432229b110c1a (diff)
DEV-50013 Friendlier info if you can't change name due to time lockout
Reviewed with Leyla
Diffstat (limited to 'indra/llcommon')
-rw-r--r--indra/llcommon/llavatarname.cpp7
-rw-r--r--indra/llcommon/llavatarname.h5
-rw-r--r--indra/llcommon/llstring.cpp11
3 files changed, 18 insertions, 5 deletions
diff --git a/indra/llcommon/llavatarname.cpp b/indra/llcommon/llavatarname.cpp
index 6e0582f865..14dc41591b 100644
--- a/indra/llcommon/llavatarname.cpp
+++ b/indra/llcommon/llavatarname.cpp
@@ -46,6 +46,7 @@ static const std::string LEGACY_FIRST_NAME("legacy_first_name");
static const std::string LEGACY_LAST_NAME("legacy_last_name");
static const std::string IS_DISPLAY_NAME_DEFAULT("is_display_name_default");
static const std::string DISPLAY_NAME_EXPIRES("display_name_expires");
+static const std::string DISPLAY_NAME_NEXT_UPDATE("display_name_next_update");
LLAvatarName::LLAvatarName()
: mUsername(),
@@ -54,7 +55,8 @@ LLAvatarName::LLAvatarName()
mLegacyLastName(),
mIsDisplayNameDefault(false),
mIsDummy(false),
- mExpires(F64_MAX)
+ mExpires(F64_MAX),
+ mNextUpdate(0.0)
{ }
bool LLAvatarName::operator<(const LLAvatarName& rhs) const
@@ -74,6 +76,7 @@ LLSD LLAvatarName::asLLSD() const
sd[LEGACY_LAST_NAME] = mLegacyLastName;
sd[IS_DISPLAY_NAME_DEFAULT] = mIsDisplayNameDefault;
sd[DISPLAY_NAME_EXPIRES] = LLDate(mExpires);
+ sd[DISPLAY_NAME_NEXT_UPDATE] = LLDate(mNextUpdate);
return sd;
}
@@ -86,6 +89,8 @@ void LLAvatarName::fromLLSD(const LLSD& sd)
mIsDisplayNameDefault = sd[IS_DISPLAY_NAME_DEFAULT].asBoolean();
LLDate expires = sd[DISPLAY_NAME_EXPIRES];
mExpires = expires.secondsSinceEpoch();
+ LLDate next_update = sd[DISPLAY_NAME_NEXT_UPDATE];
+ mNextUpdate = next_update.secondsSinceEpoch();
}
std::string LLAvatarName::getCompleteName() const
diff --git a/indra/llcommon/llavatarname.h b/indra/llcommon/llavatarname.h
index 8b74e006c3..650a09a125 100644
--- a/indra/llcommon/llavatarname.h
+++ b/indra/llcommon/llavatarname.h
@@ -91,6 +91,11 @@ public:
// last checked.
// Unix time-from-epoch seconds for efficiency
F64 mExpires;
+
+ // You can only change your name every N hours, so record
+ // when the next update is allowed
+ // Unix time-from-epoch seconds
+ F64 mNextUpdate;
};
#endif
diff --git a/indra/llcommon/llstring.cpp b/indra/llcommon/llstring.cpp
index b5a73ec1d1..637064d75f 100644
--- a/indra/llcommon/llstring.cpp
+++ b/indra/llcommon/llstring.cpp
@@ -694,14 +694,17 @@ void LLStringOps::setupDatetimeInfo (bool daylight)
nowT = time (NULL);
- tmpT = localtime (&nowT);
- localT = mktime (tmpT);
-
tmpT = gmtime (&nowT);
gmtT = mktime (tmpT);
+ tmpT = localtime (&nowT);
+ localT = mktime (tmpT);
+
sLocalTimeOffset = (long) (gmtT - localT);
-
+ if (tmpT->tm_isdst)
+ {
+ sLocalTimeOffset -= 60 * 60; // 1 hour
+ }
sPacificDaylightTime = daylight;
sPacificTimeOffset = (sPacificDaylightTime? 7 : 8 ) * 60 * 60;