diff --git a/indra/CMakeLists.txt b/indra/CMakeLists.txt index a06eed0647..afd1b664a2 100644 --- a/indra/CMakeLists.txt +++ b/indra/CMakeLists.txt @@ -35,6 +35,14 @@ else (OPENSIM) endif (OPENSIM) # +# Support for test builds +option(TESTBUILD "Generating test build" OFF) +if(TESTBUILD AND TESTBUILDPERIOD) + add_definitions(-DTESTBUILD=1 -DTESTBUILDPERIOD=${TESTBUILDPERIOD}) + message("creating test build version; test period: ${TESTBUILDPERIOD} days") +endif(TESTBUILD AND TESTBUILDPERIOD) +# + # [AVX Optimization] option(USE_AVX_OPTIMIZATION "AVX optimization support" OFF) option(USE_AVX2_OPTIMIZATION "AVX2 optimization support" OFF) diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index bf264352a4..0ad040d033 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -483,9 +483,52 @@ void downloadGridlistError( LLSD const &aData, std::string const &aURL ) LL_WARNS("SLGridStatusResponder") << "Error - output without " << LL_ENDL; } } - // +// Check for test build expiration +bool is_testbuild_expired() +{ +#if TESTBUILD + std::string datestr = __DATE__; + + std::istringstream iss_date(datestr); + std::string str_month; + S32 day; + S32 year; + S32 month = 1; + iss_date >> str_month >> day >> year; + + if (str_month == "Jan") month = 1; + else if (str_month == "Feb") month = 2; + else if (str_month == "Mar") month = 3; + else if (str_month == "Apr") month = 4; + else if (str_month == "May") month = 5; + else if (str_month == "Jun") month = 6; + else if (str_month == "Jul") month = 7; + else if (str_month == "Aug") month = 8; + else if (str_month == "Sep") month = 9; + else if (str_month == "Oct") month = 10; + else if (str_month == "Nov") month = 11; + else if (str_month == "Dec") month = 12; + + tm t = {0}; + t.tm_mon = month - 1; + t.tm_mday = day; + t.tm_year = year - 1900; + t.tm_hour = 0; + t.tm_min = 0; + t.tm_sec = 0; + + time_t expiry_time = mktime(&t) + (S32(TESTBUILDPERIOD) + 1) * 24 * 60 * 60; + time_t current_time = time(NULL); + + return current_time > expiry_time; +#else + return false; +#endif +} +// + void update_texture_fetch() { LLAppViewer::getTextureCache()->update(1); // unpauses the texture cache thread @@ -1160,6 +1203,17 @@ bool idle_startup() if (STATE_LOGIN_CLEANUP == LLStartUp::getStartupState()) { + // Check for test build expiration + if (is_testbuild_expired()) + { + LL_INFOS() << "This test version has expired and cannot be used any further." << LL_ENDL; + LLNotificationsUtil::add("TestversionExpired", LLSD(), LLSD(), login_alert_done); + LLStartUp::setStartupState(STATE_LOGIN_CONFIRM_NOTIFICATON); + show_connect_box = true; + return FALSE; + } + // + // Login block LLSD blocked = FSData::instance().allowedLogin(); if (blocked.isMap()) //hack for testing for an empty LLSD diff --git a/indra/newview/skins/default/xui/de/notifications.xml b/indra/newview/skins/default/xui/de/notifications.xml index 0ff867f9ad..e9048ad8bf 100644 --- a/indra/newview/skins/default/xui/de/notifications.xml +++ b/indra/newview/skins/default/xui/de/notifications.xml @@ -4733,6 +4733,12 @@ Dieses wird die folgenden Informationen an die aktuelle IM-Sitzung senden: name="okbutton" yestext="OK"/> + + Diese Testversion von [APP_NAME] is abgelaufen und kann nicht weiter verwendet werden. + + [NAME] hat die eine Anfrage geschickt, Informationen über Ihre [APP_NAME]-Konfiguration zu übermitteln. diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 7622be4256..53b4983361 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -10266,6 +10266,16 @@ This will send the following information to the current IM session: yestext="OK"/> + + This test version of [APP_NAME] has expired and cannot be used any further. + + + : Create time-limited test build" echo " --platform : darwin | win32 | win64 | linux32 | linux64" echo " --jobs : Build with jobs in parallel (Linux and Darwin only)" echo @@ -81,7 +84,7 @@ getArgs() # $* = the options passed in from main { if [ $# -gt 0 ]; then - while getoptex "clean build config version package no-package fmodex ninja jobs: platform: kdu quicktime opensim no-opensim avx avx2 help chan: btype:" "$@" ; do + while getoptex "clean build config version package no-package fmodex ninja jobs: platform: kdu quicktime opensim no-opensim avx avx2 testbuild: help chan: btype:" "$@" ; do #insure options are valid if [ -z "$OPTOPT" ] ; then @@ -104,6 +107,8 @@ getArgs() no-opensim) WANTS_OPENSIM=$FALSE;; avx) WANTS_AVX=$TRUE;; avx2) WANTS_AVX2=$TRUE;; + testbuild) WANTS_TESTBUILD=$TRUE + TESTBUILD_PERIOD="$OPTARG";; package) WANTS_PACKAGE=$TRUE;; no-package) WANTS_PACKAGE=$FALSE;; build) WANTS_BUILD=$TRUE;; @@ -278,8 +283,9 @@ echo -e " PLATFORM: '$PLATFORM'" | tee -a $LOG echo -e " KDU: `b2a $WANTS_KDU`" | tee -a $LOG echo -e " FMODEX: `b2a $WANTS_FMODEX`" | tee -a $LOG echo -e " OPENSIM: `b2a $WANTS_OPENSIM`" | tee -a $LOG -echo -e " AVX: `b2a $WANTS_AVX` " | tee -a $LOG -echo -e " AVX2: `b2a $WANTS_AVX2` " | tee -a $LOG +echo -e " AVX: `b2a $WANTS_AVX`" | tee -a $LOG +echo -e " AVX2: `b2a $WANTS_AVX2`" | tee -a $LOG +echo -e " TESTBUILD: `b2a $WANTS_TESTBUILD`" | tee -a $LOG echo -e " PACKAGE: `b2a $WANTS_PACKAGE`" | tee -a $LOG echo -e " CLEAN: `b2a $WANTS_CLEAN`" | tee -a $LOG echo -e " BUILD: `b2a $WANTS_BUILD`" | tee -a $LOG @@ -391,6 +397,11 @@ if [ $WANTS_CONFIG -eq $TRUE ] ; then else AVX2_OPTIMIZATION="-DUSE_AVX2_OPTIMIZATION:BOOL=OFF" fi + if [ $WANTS_TESTBUILD -eq $TRUE ] ; then + TESTBUILD="-DTESTBUILD:BOOL=ON -DTESTBUILDPERIOD:STRING=$TESTBUILD_PERIOD" + else + TESTBUILD="-DTESTBUILD:BOOL=OFF" + fi if [ $WANTS_PACKAGE -eq $TRUE ] ; then PACKAGE="-DPACKAGE:BOOL=ON" # Also delete easy-to-copy resource files, insuring that we properly refresh resoures from the source tree @@ -446,7 +457,7 @@ if [ $WANTS_CONFIG -eq $TRUE ] ; then UNATTENDED="-DUNATTENDED=ON" fi - cmake -G "$TARGET" ../indra $CHANNEL $FMODEX $KDU $OPENSIM $AVX_OPTIMIZATION $AVX2_OPTIMIZATION $PACKAGE $UNATTENDED -DLL_TESTS:BOOL=OFF -DWORD_SIZE:STRING=$WORD_SIZE -DCMAKE_BUILD_TYPE:STRING=$BTYPE \ + cmake -G "$TARGET" ../indra $CHANNEL $FMODEX $KDU $OPENSIM $AVX_OPTIMIZATION $AVX2_OPTIMIZATION $TESTBUILD $PACKAGE $UNATTENDED -DLL_TESTS:BOOL=OFF -DWORD_SIZE:STRING=$WORD_SIZE -DCMAKE_BUILD_TYPE:STRING=$BTYPE \ -DNDTARGET_ARCH:STRING="${TARGET_ARCH}" -DROOT_PROJECT_NAME:STRING=Firestorm $LL_ARGS_PASSTHRU | tee $LOG if [ $PLATFORM == "win32" ] ; then