Skip to content

Commit 55f9937

Browse files
committed
Fix looping over empty age strings on OpenSim, no longer retry on SL
1 parent ac1ef4d commit 55f9937

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

indra/newview/llfloateravatarlist.cpp

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,8 @@ void LLAvatarListEntry::processProperties(void* data, EAvatarProcessorType type)
174174
using namespace boost::gregorian;
175175
int year, month, day;
176176
const auto born = pAvatarData->born_on;
177-
if (!born.empty() && sscanf(born.c_str(),"%d/%d/%d",&month,&day,&year) == 3)
177+
if (born.empty()) return; // Opensim returns this for NPCs.
178+
if (sscanf(born.c_str(),"%d/%d/%d",&month,&day,&year) == 3)
178179
try
179180
{
180181
mAge = (day_clock::local_day() - date(year, month, day)).days();
@@ -187,10 +188,14 @@ void LLAvatarListEntry::processProperties(void* data, EAvatarProcessorType type)
187188
if (!mStats[STAT_TYPE_AGE] && (U32)mAge < sAvatarAgeAlertDays) //Only announce age once per entry.
188189
chat_avatar_status(mName, mID, STAT_TYPE_AGE, mStats[STAT_TYPE_AGE] = true, (mPosition - gAgent.getPositionGlobal()).magVec());
189190
}
190-
else // Something failed, resend request
191+
else // Something failed, resend request but only on NonSL grids
191192
{
192-
LL_WARNS() << "Failed to extract age from APT_PROPERTIES for " << mID << ", received \"" << born << "\". Requesting properties again." << LL_ENDL;
193-
inst.sendAvatarPropertiesRequest(mID);
193+
LL_WARNS() << "Failed to extract age from APT_PROPERTIES for " << mID << ", received \"" << born << "\"." << LL_ENDL;
194+
if (!gHippoGridManager->getConnectedGrid()->isSecondLife())
195+
{
196+
LL_WARNS() << "Requesting properties again." << LL_ENDL;
197+
inst.sendAvatarPropertiesRequest(mID);
198+
}
194199
}
195200
}
196201
}

0 commit comments

Comments
 (0)