Skip to content
Snippets Groups Projects
Commit a0714f01 authored by Merov Linden's avatar Merov Linden
Browse files

Merge with viewer-development

parents e3ecffc1 de6f7e19
No related branches found
No related tags found
No related merge requests found
Showing
with 375 additions and 105 deletions
bb38ff1a763738609e1b3cada6d15fa61e5e84b9 2.1.1-release
003dd9461bfa479049afcc34545ab3431b147c7c v2start 003dd9461bfa479049afcc34545ab3431b147c7c v2start
08398e650c222336bb2b6de0cd3bba944aef11b4 2-1rn1 08398e650c222336bb2b6de0cd3bba944aef11b4 2-1rn1
0962101bfa7df0643a6e625786025fe7f8a6dc97 2-1-beta-2 0962101bfa7df0643a6e625786025fe7f8a6dc97 2-1-beta-2
...@@ -26,3 +27,8 @@ c6e6324f5be1401f077ad18a4a0f6b46451c2f7b last_sprint ...@@ -26,3 +27,8 @@ c6e6324f5be1401f077ad18a4a0f6b46451c2f7b last_sprint
7076e22f9f43f479a4ea75eac447a36364bead5a beta_2.1.3 7076e22f9f43f479a4ea75eac447a36364bead5a beta_2.1.3
7076e22f9f43f479a4ea75eac447a36364bead5a 2.2.0-beta1 7076e22f9f43f479a4ea75eac447a36364bead5a 2.2.0-beta1
9822eb3e25f7fe0c28ffd8aba45c507caa383cbc 2.2.0-beta2 9822eb3e25f7fe0c28ffd8aba45c507caa383cbc 2.2.0-beta2
b0cd7e150009809a0b5b0a9d5785cd4bb230413a 2.2.0-beta3
00a831292231faad7e44c69f76cb96f175b8dfad 2.2.0-beta4
98e0d6df638429fd2f0476667504bd5a6b298def 2.3.0-beta1
1415e6538d54fd5d568ee88343424d57c6803c2c 2.2.0-release
98e0d6df638429fd2f0476667504bd5a6b298def 2.3.0-start
...@@ -102,6 +102,26 @@ gooey.login_channel = "Second Life Alpha" ...@@ -102,6 +102,26 @@ gooey.login_channel = "Second Life Alpha"
gooey.viewer_grid = agni gooey.viewer_grid = agni
gooey.build_viewer_update_version_manager = false gooey.build_viewer_update_version_manager = false
# ========================================
# Display Names project
# ========================================
#viewer-identity-evolution.email = leyla@lindenlab.com
viewer-identity.build_Debug = false
viewer-identity.build_RelWithDebInfo = false
viewer-identity.build_viewer = true
viewer-identity.build_server = false
viewer-identity.build_server_tests = false
viewer-identity.build_Linux = true
viewer-identity.build_hg_bundle = true
viewer-identity.bulld_docs = true
viewer-identity.viewer_channel = "Second Life Project Viewer"
viewer-identity.login_channel = "Second Life Project Viewer"
viewer-identity.viewer_grid = aditi
viewer-identity.build_viewer_update_version_manager = false
# ======================================== # ========================================
# palange # palange
# ======================================== # ========================================
......
...@@ -59,6 +59,7 @@ pre_build() ...@@ -59,6 +59,7 @@ pre_build()
-t $variant \ -t $variant \
-G "$cmake_generator" \ -G "$cmake_generator" \
configure \ configure \
-DGRID:STRING="$viewer_grid" \
-DVIEWER_CHANNEL:STRING="$viewer_channel" \ -DVIEWER_CHANNEL:STRING="$viewer_channel" \
-DVIEWER_LOGIN_CHANNEL:STRING="$login_channel" \ -DVIEWER_LOGIN_CHANNEL:STRING="$login_channel" \
-DINSTALL_PROPRIETARY:BOOL=ON \ -DINSTALL_PROPRIETARY:BOOL=ON \
......
...@@ -62,6 +62,8 @@ Alejandro Rosenthal ...@@ -62,6 +62,8 @@ Alejandro Rosenthal
VWR-1184 VWR-1184
Aleric Inglewood Aleric Inglewood
SNOW-522 SNOW-522
SNOW-626
SNOW-756
SNOW-764 SNOW-764
VWR-10001 VWR-10001
VWR-10759 VWR-10759
...@@ -70,6 +72,7 @@ Aleric Inglewood ...@@ -70,6 +72,7 @@ Aleric Inglewood
VWR-13996 VWR-13996
VWR-14426 VWR-14426
SNOW-84 SNOW-84
SNOW-477
SNOW-766 SNOW-766
STORM-163 STORM-163
Ales Beaumont Ales Beaumont
...@@ -172,6 +175,7 @@ Boroondas Gupte ...@@ -172,6 +175,7 @@ Boroondas Gupte
VWR-233 VWR-233
VWR-20583 VWR-20583
VWR-20891 VWR-20891
VWR-23455
WEB-262 WEB-262
Bulli Schumann Bulli Schumann
CT-218 CT-218
...@@ -201,6 +205,8 @@ Catherine Pfeffer ...@@ -201,6 +205,8 @@ Catherine Pfeffer
Celierra Darling Celierra Darling
VWR-1274 VWR-1274
VWR-6975 VWR-6975
Cypren Christenson
STORM-417
Dale Glass Dale Glass
VWR-120 VWR-120
VWR-560 VWR-560
...@@ -380,6 +386,8 @@ Malwina Dollinger ...@@ -380,6 +386,8 @@ Malwina Dollinger
CT-138 CT-138
march Korda march Korda
SVC-1020 SVC-1020
Marine Kelley
STORM-281
Matthew Dowd Matthew Dowd
VWR-1344 VWR-1344
VWR-1651 VWR-1651
...@@ -528,6 +536,7 @@ Pf Shan ...@@ -528,6 +536,7 @@ Pf Shan
CT-230 CT-230
CT-231 CT-231
CT-321 CT-321
SNOW-422
princess niven princess niven
VWR-5733 VWR-5733
CT-85 CT-85
...@@ -549,11 +558,13 @@ Ringo Tuxing ...@@ -549,11 +558,13 @@ Ringo Tuxing
Robin Cornelius Robin Cornelius
SNOW-108 SNOW-108
SNOW-204 SNOW-204
SNOW-287
SNOW-484 SNOW-484
SNOW-504 SNOW-504
SNOW-506 SNOW-506
SNOW-507 SNOW-507
SNOW-511 SNOW-511
SNOW-512
SNOW-514 SNOW-514
SNOW-520 SNOW-520
SNOW-585 SNOW-585
...@@ -640,6 +651,7 @@ Strife Onizuka ...@@ -640,6 +651,7 @@ Strife Onizuka
VWR-183 VWR-183
VWR-2265 VWR-2265
VWR-4111 VWR-4111
SNOW-691
Tayra Dagostino Tayra Dagostino
SNOW-517 SNOW-517
SNOW-543 SNOW-543
...@@ -660,6 +672,8 @@ Techwolf Lupindo ...@@ -660,6 +672,8 @@ Techwolf Lupindo
SNOW-592 SNOW-592
SNOW-649 SNOW-649
SNOW-650 SNOW-650
SNOW-651
SNOW-654
SNOW-687 SNOW-687
SNOW-680 SNOW-680
SNOW-681 SNOW-681
...@@ -667,6 +681,7 @@ Techwolf Lupindo ...@@ -667,6 +681,7 @@ Techwolf Lupindo
SNOW-690 SNOW-690
SNOW-746 SNOW-746
VWR-12385 VWR-12385
VWR-20893
tenebrous pau tenebrous pau
VWR-247 VWR-247
Tharax Ferraris Tharax Ferraris
......
...@@ -370,6 +370,14 @@ ...@@ -370,6 +370,14 @@
</map> </map>
<!-- Server to client --> <!-- Server to client -->
<key>DisplayNameUpdate</key>
<map>
<key>flavor</key>
<string>llsd</string>
<key>trusted-sender</key>
<boolean>true</boolean>
</map>
<key>ParcelVoiceInfo</key> <key>ParcelVoiceInfo</key>
<map> <map>
<key>flavor</key> <key>flavor</key>
...@@ -426,6 +434,14 @@ ...@@ -426,6 +434,14 @@
<boolean>true</boolean> <boolean>true</boolean>
</map> </map>
<key>SetDisplayNameReply</key>
<map>
<key>flavor</key>
<string>llsd</string>
<key>trusted-sender</key>
<boolean>true</boolean>
</map>
<key>DirLandReply</key> <key>DirLandReply</key>
<map> <map>
<key>flavor</key> <key>flavor</key>
......
...@@ -123,6 +123,8 @@ if (SERVER) ...@@ -123,6 +123,8 @@ if (SERVER)
endif (WINDOWS) endif (WINDOWS)
endif (SERVER) endif (SERVER)
# Define after the custom viewer and server targets are created so individual if (LL_TESTS)
# apps can add themselves as dependencies # Define after the custom viewer and server targets are created so
# individual apps can add themselves as dependencies
add_subdirectory(${INTEGRATION_TESTS_PREFIX}integration_tests) add_subdirectory(${INTEGRATION_TESTS_PREFIX}integration_tests)
endif (LL_TESTS)
...@@ -26,6 +26,7 @@ set(cmake_SOURCE_FILES ...@@ -26,6 +26,7 @@ set(cmake_SOURCE_FILES
FindBerkeleyDB.cmake FindBerkeleyDB.cmake
FindCARes.cmake FindCARes.cmake
FindELFIO.cmake FindELFIO.cmake
FindFMOD.cmake
FindGooglePerfTools.cmake FindGooglePerfTools.cmake
FindMono.cmake FindMono.cmake
FindMT.cmake FindMT.cmake
......
...@@ -55,9 +55,10 @@ if(WINDOWS) ...@@ -55,9 +55,10 @@ if(WINDOWS)
set(release_files ${release_files} libtcmalloc_minimal.dll) set(release_files ${release_files} libtcmalloc_minimal.dll)
endif(USE_GOOGLE_PERFTOOLS) endif(USE_GOOGLE_PERFTOOLS)
if (FMOD_SDK_DIR) if (FMOD)
set(fmod_files fmod.dll) set(debug_files ${debug_files} fmod.dll)
endif (FMOD_SDK_DIR) set(release_files ${release_files} fmod.dll)
endif (FMOD)
#******************************* #*******************************
# LLKDU # LLKDU
...@@ -237,9 +238,9 @@ elseif(LINUX) ...@@ -237,9 +238,9 @@ elseif(LINUX)
libssl.so.0.9.7 libssl.so.0.9.7
) )
if (FMOD_SDK_DIR) if (FMOD)
set(fmod_files "libfmod-3.75.so") set(release_files ${release_files} "libfmod-3.75.so")
endif (FMOD_SDK_DIR) endif (FMOD)
#******************************* #*******************************
# LLKDU # LLKDU
...@@ -333,30 +334,6 @@ copy_if_different( ...@@ -333,30 +334,6 @@ copy_if_different(
) )
set(third_party_targets ${third_party_targets} ${out_targets}) set(third_party_targets ${third_party_targets} ${out_targets})
if (FMOD_SDK_DIR)
copy_if_different(
${FMOD_SDK_DIR}
"${CMAKE_CURRENT_BINARY_DIR}/Debug"
out_targets
${fmod_files}
)
set(all_targets ${all_targets} ${out_targets})
copy_if_different(
${FMOD_SDK_DIR}
"${CMAKE_CURRENT_BINARY_DIR}/Release"
out_targets
${fmod_files}
)
set(all_targets ${all_targets} ${out_targets})
copy_if_different(
${FMOD_SDK_DIR}
"${CMAKE_CURRENT_BINARY_DIR}/RelWithDbgInfo"
out_targets
${fmod_files}
)
set(all_targets ${all_targets} ${out_targets})
endif (FMOD_SDK_DIR)
#******************************* #*******************************
# LLKDU # LLKDU
set(internal_llkdu_path "${CMAKE_SOURCE_DIR}/llkdu") set(internal_llkdu_path "${CMAKE_SOURCE_DIR}/llkdu")
......
# -*- cmake -*- # -*- cmake -*-
include(Linking) set(FMOD ON CACHE BOOL "Use FMOD sound library.")
if (FMOD)
if (STANDALONE)
set(FMOD_FIND_REQUIRED ON)
include(FindFMOD)
else (STANDALONE)
if (INSTALL_PROPRIETARY) if (INSTALL_PROPRIETARY)
include(Prebuilt) include(Prebuilt)
use_prebuilt_binary(fmod) use_prebuilt_binary(fmod)
endif (INSTALL_PROPRIETARY) endif (INSTALL_PROPRIETARY)
find_library(FMOD_LIBRARY_RELEASE if (WINDOWS)
NAMES fmod fmodvc fmod-3.75 set(FMOD_LIBRARY fmod)
PATHS elseif (DARWIN)
${ARCH_PREBUILT_DIRS_RELEASE} set(FMOD_LIBRARY fmod)
) elseif (LINUX)
set(FMOD_LIBRARY fmod-3.75)
find_library(FMOD_LIBRARY_DEBUG endif (WINDOWS)
NAMES fmod fmodvc fmod-3.75
PATHS SET(FMOD_LIBRARIES ${FMOD_LIBRARY})
${ARCH_PREBUILT_DIRS_DEBUG} set(FMOD_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include)
) endif (STANDALONE)
if (FMOD_LIBRARY_RELEASE AND FMOD_LIBRARY_DEBUG)
set(FMOD_LIBRARY
debug ${FMOD_LIBRARY_DEBUG}
optimized ${FMOD_LIBRARY_RELEASE})
elseif (FMOD_LIBRARY_RELEASE)
set(FMOD_LIBRARY ${FMOD_LIBRARY_RELEASE})
endif (FMOD_LIBRARY_RELEASE AND FMOD_LIBRARY_DEBUG)
if (NOT FMOD_LIBRARY)
set(FMOD_SDK_DIR CACHE PATH "Path to the FMOD SDK.")
if (FMOD_SDK_DIR)
find_library(FMOD_LIBRARY
NAMES fmodvc fmod-3.75 fmod
PATHS
${FMOD_SDK_DIR}/api/lib
${FMOD_SDK_DIR}/api
${FMOD_SDK_DIR}/lib
${FMOD_SDK_DIR}
)
endif (FMOD_SDK_DIR)
endif (NOT FMOD_LIBRARY)
find_path(FMOD_INCLUDE_DIR fmod.h
${LIBS_PREBUILT_DIR}/include
${FMOD_SDK_DIR}/api/inc
${FMOD_SDK_DIR}/inc
${FMOD_SDK_DIR}
)
if (FMOD_LIBRARY AND FMOD_INCLUDE_DIR)
set(FMOD ON CACHE BOOL "Use closed source FMOD sound library.")
else (FMOD_LIBRARY AND FMOD_INCLUDE_DIR)
set(FMOD_LIBRARY "")
set(FMOD_INCLUDE_DIR "")
if (FMOD)
message(STATUS "No support for FMOD audio (need to set FMOD_SDK_DIR?)")
endif (FMOD)
set(FMOD OFF CACHE BOOL "Use closed source FMOD sound library.")
endif (FMOD_LIBRARY AND FMOD_INCLUDE_DIR)
if (FMOD)
message(STATUS "Building with FMOD audio support")
endif (FMOD) endif (FMOD)
# -*- cmake -*-
# - Find FMOD
# Find the FMOD includes and library
# This module defines
# FMOD_INCLUDE_DIR, where to find fmod.h and fmod_errors.h
# FMOD_LIBRARIES, the libraries needed to use FMOD.
# FMOD, If false, do not try to use FMOD.
# also defined, but not for general use are
# FMOD_LIBRARY, where to find the FMOD library.
FIND_PATH(FMOD_INCLUDE_DIR fmod.h PATH_SUFFIXES fmod)
SET(FMOD_NAMES ${FMOD_NAMES} fmod fmodvc fmod-3.75)
FIND_LIBRARY(FMOD_LIBRARY
NAMES ${FMOD_NAMES}
PATH_SUFFIXES fmod
)
IF (FMOD_LIBRARY AND FMOD_INCLUDE_DIR)
SET(FMOD_LIBRARIES ${FMOD_LIBRARY})
SET(FMOD_FOUND "YES")
ELSE (FMOD_LIBRARY AND FMOD_INCLUDE_DIR)
SET(FMOD_FOUND "NO")
ENDIF (FMOD_LIBRARY AND FMOD_INCLUDE_DIR)
IF (FMOD_FOUND)
IF (NOT FMOD_FIND_QUIETLY)
MESSAGE(STATUS "Found FMOD: ${FMOD_LIBRARIES}")
ENDIF (NOT FMOD_FIND_QUIETLY)
ELSE (FMOD_FOUND)
IF (FMOD_FIND_REQUIRED)
MESSAGE(FATAL_ERROR "Could not find FMOD library")
ENDIF (FMOD_FIND_REQUIRED)
ENDIF (FMOD_FOUND)
# Deprecated declarations.
SET (NATIVE_FMOD_INCLUDE_PATH ${FMOD_INCLUDE_DIR} )
GET_FILENAME_COMPONENT (NATIVE_FMOD_LIB_PATH ${FMOD_LIBRARY} PATH)
MARK_AS_ADVANCED(
FMOD_LIBRARY
FMOD_INCLUDE_DIR
)
...@@ -256,6 +256,10 @@ MACRO(SET_TEST_PATH LISTVAR) ...@@ -256,6 +256,10 @@ MACRO(SET_TEST_PATH LISTVAR)
set(${LISTVAR} ${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/Resources ${SHARED_LIB_STAGING_DIR}/Release/Resources /usr/lib) set(${LISTVAR} ${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/Resources ${SHARED_LIB_STAGING_DIR}/Release/Resources /usr/lib)
ELSE(WINDOWS) ELSE(WINDOWS)
# Linux uses a single staging directory anyway. # Linux uses a single staging directory anyway.
IF (STANDALONE)
set(${LISTVAR} ${CMAKE_BINARY_DIR}/llcommon /usr/lib /usr/local/lib)
ELSE (STANDALONE)
set(${LISTVAR} ${SHARED_LIB_STAGING_DIR} /usr/lib) set(${LISTVAR} ${SHARED_LIB_STAGING_DIR} /usr/lib)
ENDIF (STANDALONE)
ENDIF(WINDOWS) ENDIF(WINDOWS)
ENDMACRO(SET_TEST_PATH) ENDMACRO(SET_TEST_PATH)
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
$LicenseInfo:firstyear=2009&license=viewerlgpl$ $LicenseInfo:firstyear=2009&license=viewerlgpl$
Second Life Viewer Source Code Second Life Viewer Source Code
Copyright (C) 2010, Linden Research, Inc. Copyright (C) 2009-2010, Linden Research, Inc.
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
$LicenseInfo:firstyear=2006&license=viewerlgpl$ $LicenseInfo:firstyear=2006&license=viewerlgpl$
Second Life Viewer Source Code Second Life Viewer Source Code
Copyright (C) 2010, Linden Research, Inc. Copyright (C) 2006-2010, Linden Research, Inc.
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public
......
...@@ -14,7 +14,6 @@ include(LLVFS) ...@@ -14,7 +14,6 @@ include(LLVFS)
include_directories( include_directories(
${LLAUDIO_INCLUDE_DIRS} ${LLAUDIO_INCLUDE_DIRS}
${FMOD_INCLUDE_DIR}
${LLCOMMON_INCLUDE_DIRS} ${LLCOMMON_INCLUDE_DIRS}
${LLMATH_INCLUDE_DIRS} ${LLMATH_INCLUDE_DIRS}
${LLMESSAGE_INCLUDE_DIRS} ${LLMESSAGE_INCLUDE_DIRS}
...@@ -45,6 +44,10 @@ set(llaudio_HEADER_FILES ...@@ -45,6 +44,10 @@ set(llaudio_HEADER_FILES
) )
if (FMOD) if (FMOD)
include_directories(
${FMOD_INCLUDE_DIR}
)
list(APPEND llaudio_SOURCE_FILES list(APPEND llaudio_SOURCE_FILES
llaudioengine_fmod.cpp llaudioengine_fmod.cpp
lllistener_fmod.cpp lllistener_fmod.cpp
......
...@@ -33,6 +33,7 @@ set(llcommon_SOURCE_FILES ...@@ -33,6 +33,7 @@ set(llcommon_SOURCE_FILES
llapp.cpp llapp.cpp
llapr.cpp llapr.cpp
llassettype.cpp llassettype.cpp
llavatarname.cpp
llbase32.cpp llbase32.cpp
llbase64.cpp llbase64.cpp
llcommon.cpp llcommon.cpp
...@@ -116,6 +117,7 @@ set(llcommon_HEADER_FILES ...@@ -116,6 +117,7 @@ set(llcommon_HEADER_FILES
llallocator.h llallocator.h
llallocator_heap_profile.h llallocator_heap_profile.h
llagentconstants.h llagentconstants.h
llavatarname.h
llapp.h llapp.h
llapr.h llapr.h
llassettype.h llassettype.h
...@@ -255,6 +257,13 @@ list(APPEND llcommon_SOURCE_FILES ${llcommon_HEADER_FILES}) ...@@ -255,6 +257,13 @@ list(APPEND llcommon_SOURCE_FILES ${llcommon_HEADER_FILES})
if(LLCOMMON_LINK_SHARED) if(LLCOMMON_LINK_SHARED)
add_library (llcommon SHARED ${llcommon_SOURCE_FILES}) add_library (llcommon SHARED ${llcommon_SOURCE_FILES})
if(NOT WORD_SIZE EQUAL 32)
if(WINDOWS)
add_definitions(/FIXED:NO)
else(WINDOWS) # not windows therefore gcc LINUX and DARWIN
add_definitions(-fPIC)
endif(WINDOWS)
endif(NOT WORD_SIZE EQUAL 32)
ll_stage_sharedlib(llcommon) ll_stage_sharedlib(llcommon)
else(LLCOMMON_LINK_SHARED) else(LLCOMMON_LINK_SHARED)
add_library (llcommon ${llcommon_SOURCE_FILES}) add_library (llcommon ${llcommon_SOURCE_FILES})
......
/**
* @file llavatarname.cpp
* @brief Represents name-related data for an avatar, such as the
* username/SLID ("bobsmith123" or "james.linden") and the display
* name ("James Cook")
*
* $LicenseInfo:firstyear=2010&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2010, Linden Research, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
#include "linden_common.h"
#include "llavatarname.h"
#include "lldate.h"
#include "llsd.h"
// Store these in pre-built std::strings to avoid memory allocations in
// LLSD map lookups
static const std::string USERNAME("username");
static const std::string DISPLAY_NAME("display_name");
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(),
mDisplayName(),
mLegacyFirstName(),
mLegacyLastName(),
mIsDisplayNameDefault(false),
mIsDummy(false),
mExpires(F64_MAX),
mNextUpdate(0.0)
{ }
bool LLAvatarName::operator<(const LLAvatarName& rhs) const
{
if (mUsername == rhs.mUsername)
return mDisplayName < rhs.mDisplayName;
else
return mUsername < rhs.mUsername;
}
LLSD LLAvatarName::asLLSD() const
{
LLSD sd;
sd[USERNAME] = mUsername;
sd[DISPLAY_NAME] = mDisplayName;
sd[LEGACY_FIRST_NAME] = mLegacyFirstName;
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;
}
void LLAvatarName::fromLLSD(const LLSD& sd)
{
mUsername = sd[USERNAME].asString();
mDisplayName = sd[DISPLAY_NAME].asString();
mLegacyFirstName = sd[LEGACY_FIRST_NAME].asString();
mLegacyLastName = sd[LEGACY_LAST_NAME].asString();
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
{
std::string name;
if (!mUsername.empty())
{
name = mDisplayName + " (" + mUsername + ")";
}
else
{
// ...display names are off, legacy name is in mDisplayName
name = mDisplayName;
}
return name;
}
std::string LLAvatarName::getLegacyName() const
{
std::string name;
name.reserve( mLegacyFirstName.size() + 1 + mLegacyLastName.size() );
name = mLegacyFirstName;
name += " ";
name += mLegacyLastName;
return name;
}
/**
* @file llavatarname.h
* @brief Represents name-related data for an avatar, such as the
* username/SLID ("bobsmith123" or "james.linden") and the display
* name ("James Cook")
*
* $LicenseInfo:firstyear=2010&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2010, Linden Research, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
#ifndef LLAVATARNAME_H
#define LLAVATARNAME_H
#include <string>
class LLSD;
class LL_COMMON_API LLAvatarName
{
public:
LLAvatarName();
bool operator<(const LLAvatarName& rhs) const;
LLSD asLLSD() const;
void fromLLSD(const LLSD& sd);
// For normal names, returns "James Linden (james.linden)"
// When display names are disabled returns just "James Linden"
std::string getCompleteName() const;
// Returns "James Linden" or "bobsmith123 Resident" for backwards
// compatibility with systems like voice and muting
// *TODO: Eliminate this in favor of username only
std::string getLegacyName() const;
// "bobsmith123" or "james.linden", US-ASCII only
std::string mUsername;
// "Jose' Sanchez" or "James Linden", UTF-8 encoded Unicode
// Contains data whether or not user has explicitly set
// a display name; may duplicate their username.
std::string mDisplayName;
// For "James Linden", "James"
// For "bobsmith123", "bobsmith123"
// Used to communicate with legacy systems like voice and muting which
// rely on old-style names.
// *TODO: Eliminate this in favor of username only
std::string mLegacyFirstName;
// For "James Linden", "Linden"
// For "bobsmith123", "Resident"
// see above for rationale
std::string mLegacyLastName;
// If true, both display name and SLID were generated from
// a legacy first and last name, like "James Linden (james.linden)"
bool mIsDisplayNameDefault;
// Under error conditions, we may insert "dummy" records with
// names like "???" into caches as placeholders. These can be
// shown in UI, but are not serialized.
bool mIsDummy;
// Names can change, so need to keep track of when name was
// 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
...@@ -28,7 +28,6 @@ ...@@ -28,7 +28,6 @@
#ifndef LL_LLCHAT_H #ifndef LL_LLCHAT_H
#define LL_LLCHAT_H #define LL_LLCHAT_H
#include "llstring.h"
#include "lluuid.h" #include "lluuid.h"
#include "v3math.h" #include "v3math.h"
...@@ -71,7 +70,7 @@ typedef enum e_chat_style ...@@ -71,7 +70,7 @@ typedef enum e_chat_style
class LLChat class LLChat
{ {
public: public:
LLChat(const std::string& text = LLStringUtil::null) LLChat(const std::string& text = std::string())
: mText(text), : mText(text),
mFromName(), mFromName(),
mFromID(), mFromID(),
......
...@@ -51,7 +51,7 @@ class LLDynamicArray : public std::vector<Type> ...@@ -51,7 +51,7 @@ class LLDynamicArray : public std::vector<Type>
LLDynamicArray(S32 size=0) : std::vector<Type>(size) { if (size < BlockSize) std::vector<Type>::reserve(BlockSize); } LLDynamicArray(S32 size=0) : std::vector<Type>(size) { if (size < BlockSize) std::vector<Type>::reserve(BlockSize); }
void reset() { std::vector<Type>::resize(0); } void reset() { std::vector<Type>::clear(); }
// ACCESSORS // ACCESSORS
const Type& get(S32 index) const { return std::vector<Type>::operator[](index); } const Type& get(S32 index) const { return std::vector<Type>::operator[](index); }
......
...@@ -731,14 +731,17 @@ void LLStringOps::setupDatetimeInfo (bool daylight) ...@@ -731,14 +731,17 @@ void LLStringOps::setupDatetimeInfo (bool daylight)
nowT = time (NULL); nowT = time (NULL);
tmpT = localtime (&nowT);
localT = mktime (tmpT);
tmpT = gmtime (&nowT); tmpT = gmtime (&nowT);
gmtT = mktime (tmpT); gmtT = mktime (tmpT);
sLocalTimeOffset = (long) (gmtT - localT); tmpT = localtime (&nowT);
localT = mktime (tmpT);
sLocalTimeOffset = (long) (gmtT - localT);
if (tmpT->tm_isdst)
{
sLocalTimeOffset -= 60 * 60; // 1 hour
}
sPacificDaylightTime = daylight; sPacificDaylightTime = daylight;
sPacificTimeOffset = (sPacificDaylightTime? 7 : 8 ) * 60 * 60; sPacificTimeOffset = (sPacificDaylightTime? 7 : 8 ) * 60 * 60;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment