diff --git a/autobuild.xml b/autobuild.xml index 4a07dfeb00..b2558aae7c 100644 --- a/autobuild.xml +++ b/autobuild.xml @@ -994,11 +994,11 @@ archive hash - 4f9bf4566934e6e8611ef918186f20c5 + c96fbccf3db01230832d8795318ee627 hash_algorithm md5 url - file:///opt/firestorm/fmodstudio-2.01.08-darwin-210441530.tar.bz2 + file:///opt/firestorm/fmodstudio-2.01.09-darwin-211252249.tar.bz2 name darwin @@ -2980,9 +2980,9 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - e235c5da10f29893e14b14c7a3184d91 + ba2034b4a372fd46c3e09f56bede38a7 url - http://3p.firestormviewer.org/openjpeg-2.3.1.202821233-windows-202821233.tar.bz2 + http://3p.firestormviewer.org/openjpeg-2.4.0.211361403-windows-211361403.tar.bz2 name windows @@ -2992,16 +2992,16 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - d87183b9cab5910a4a0f15e8faebab06 + d7ac606703a9330a2d8a3f7276cb6894 url - http://3p.firestormviewer.org/openjpeg-2.3.1.202821246-windows64-202821246.tar.bz2 + http://3p.firestormviewer.org/openjpeg-2.4.0.211361407-windows64-211361407.tar.bz2 name windows64 version - 2.3.1 + 2.4.0 openssl diff --git a/indra/llaudio/llstreamingaudio_fmodstudio.cpp b/indra/llaudio/llstreamingaudio_fmodstudio.cpp index 0d3e58b3e5..ff7dcbd995 100644 --- a/indra/llaudio/llstreamingaudio_fmodstudio.cpp +++ b/indra/llaudio/llstreamingaudio_fmodstudio.cpp @@ -155,8 +155,20 @@ void LLStreamingAudio_FMODSTUDIO::update() bool diskbusy; FMOD_OPENSTATE open_state; - if (Check_FMOD_Error(mCurrentInternetStreamp->getOpenState(open_state, &progress, &starving, &diskbusy), "FMOD::Sound::getOpenState") || open_state == FMOD_OPENSTATE_ERROR) + if (Check_FMOD_Error(mCurrentInternetStreamp->getOpenState(open_state, &progress, &starving, &diskbusy), "FMOD::Sound::getOpenState")) { + LL_WARNS() << "Internet stream openstate error: open_state = " << open_state << " - progress = " << progress << " - starving = " << starving << " - diskbusy = " << diskbusy << LL_ENDL; + stop(); + return; + } + else if (open_state == FMOD_OPENSTATE_ERROR) + { + // Actually we might not get into this case at all since according to the + // FMOD API doc, one should check the result of getOpenState for further + // details, which most likely means if open_state is FMOD_OPENSTATE_ERROR, + // calling getOpenState will return anything but FMOD_OK and we end up in + // the if-case above. + LL_WARNS() << "Internet stream openstate error: progress = " << progress << " - starving = " << starving << " - diskbusy = " << diskbusy << LL_ENDL; stop(); return; } diff --git a/indra/llcommon/llqueuedthread.cpp b/indra/llcommon/llqueuedthread.cpp index e953451d49..3f3ef2be8a 100644 --- a/indra/llcommon/llqueuedthread.cpp +++ b/indra/llcommon/llqueuedthread.cpp @@ -442,7 +442,15 @@ S32 LLQueuedThread::processNextRequest() // safe to access req. if (req) { - // process request + // Image thread pool from CoolVL + if (req->getFlags() & FLAG_ASYNC) + { + req->processRequest(); + return getPending(); + } + // + + // process request bool complete = req->processRequest(); if (complete) diff --git a/indra/llcommon/llqueuedthread.h b/indra/llcommon/llqueuedthread.h index 5d3f873646..858d578b7f 100644 --- a/indra/llcommon/llqueuedthread.h +++ b/indra/llcommon/llqueuedthread.h @@ -67,6 +67,7 @@ public: FLAG_AUTO_COMPLETE = 1, FLAG_AUTO_DELETE = 2, // child-class dependent FLAG_ABORT = 4 + ,FLAG_ASYNC = 8 // Image thread pool from CoolVL }; typedef U32 handle_t; diff --git a/indra/llcommon/lluri.cpp b/indra/llcommon/lluri.cpp index 50ace5b2f5..d23b45f177 100644 --- a/indra/llcommon/lluri.cpp +++ b/indra/llcommon/lluri.cpp @@ -360,7 +360,7 @@ static BOOL isDefault(const std::string& scheme, U16 port) void LLURI::parseAuthorityAndPathUsingOpaque() { - if (mScheme == "http" || mScheme == "https" || mScheme == "hop" || mScheme == "inworldz" || mScheme == "iw" || + if (mScheme == "http" || mScheme == "https" || mScheme == "hop" || mScheme == "ftp" || mScheme == "secondlife" || mScheme == "x-grid-location-info") { diff --git a/indra/llfilesystem/lldiskcache.cpp b/indra/llfilesystem/lldiskcache.cpp index 730a5500cf..9c7688870d 100644 --- a/indra/llfilesystem/lldiskcache.cpp +++ b/indra/llfilesystem/lldiskcache.cpp @@ -43,7 +43,9 @@ static const char* subdirs = "0123456789abcdef"; LLDiskCache::LLDiskCache(const std::string cache_dir, - const int max_size_bytes, + // Fix integer overflow + //const int max_size_bytes, + const uintmax_t max_size_bytes, const bool enable_cache_debug_info) : mCacheDir(cache_dir), mMaxSizeBytes(max_size_bytes), @@ -64,7 +66,7 @@ LLDiskCache::LLDiskCache(const std::string cache_dir, void LLDiskCache::purge() { - if (mEnableCacheDebugInfo) + //if (mEnableCacheDebugInfo) { LL_INFOS() << "Total dir size before purge is " << dirFileSize(mCacheDir) << LL_ENDL; } @@ -144,7 +146,7 @@ void LLDiskCache::purge() } } - if (mEnableCacheDebugInfo) + //if (mEnableCacheDebugInfo) { auto end_time = std::chrono::high_resolution_clock::now(); auto execute_time = std::chrono::duration_cast(end_time - start_time).count(); @@ -369,3 +371,27 @@ uintmax_t LLDiskCache::dirFileSize(const std::string dir) return total_file_size; } + +// Regular disk cache cleanup +FSPurgeDiskCacheThread::FSPurgeDiskCacheThread() : + LLThread("PurgeDiskCacheThread", nullptr) +{ +} + +void FSPurgeDiskCacheThread::run() +{ + constexpr F64 CHECK_INTERVAL = 60; + mTimer.setTimerExpirySec(CHECK_INTERVAL); + mTimer.start(); + + do + { + if (mTimer.checkExpirationAndReset(CHECK_INTERVAL)) + { + LLDiskCache::instance().purge(); + } + + ms_sleep(100); + } while (!isQuitting()); +} +// diff --git a/indra/llfilesystem/lldiskcache.h b/indra/llfilesystem/lldiskcache.h index d3eb91e2ad..f2cc53d025 100644 --- a/indra/llfilesystem/lldiskcache.h +++ b/indra/llfilesystem/lldiskcache.h @@ -86,7 +86,9 @@ class LLDiskCache : * The maximum size of the cache in bytes - Based on the * setting at 'CacheSize' and 'DiskCachePercentOfTotal' */ - const int max_size_bytes, + // Fix integer overflow + //const int max_size_bytes, + const uintmax_t max_size_bytes, /** * A flag that enables extra cache debugging so that * if there are bugs, we can ask uses to enable this @@ -141,6 +143,9 @@ class LLDiskCache : */ const std::string getCacheInfo(); + // Better asset cache size control + void setMaxSizeBytes(uintmax_t size) { mMaxSizeBytes = size; } + private: /** * Utility function to gather the total size the files in a given @@ -188,4 +193,17 @@ class LLDiskCache : bool mEnableCacheDebugInfo; }; +// Regular disk cache cleanup +class FSPurgeDiskCacheThread : public LLThread +{ +public: + FSPurgeDiskCacheThread::FSPurgeDiskCacheThread(); + +protected: + void run() override; + +private: + LLTimer mTimer; +}; +// #endif // _LLDISKCACHE diff --git a/indra/llfilesystem/llfilesystem.cpp b/indra/llfilesystem/llfilesystem.cpp index 9fd2c48879..a64070eb9d 100644 --- a/indra/llfilesystem/llfilesystem.cpp +++ b/indra/llfilesystem/llfilesystem.cpp @@ -153,7 +153,9 @@ S32 LLFileSystem::getFileSize(const LLUUID& file_id, const LLAssetType::EType fi BOOL LLFileSystem::read(U8* buffer, S32 bytes) { FSZoneC(tracy::Color::Gold); // measure cache performance - BOOL success = TRUE; + // Cache fixes + //BOOL success = TRUE; + BOOL success = FALSE; std::string id; mFileID.toString(id); @@ -188,14 +190,18 @@ BOOL LLFileSystem::read(U8* buffer, S32 bytes) LLFILE* file = LLFile::fopen(filename, "rb"); if (file) { - fseek(file, mPosition, SEEK_SET); - mBytesRead = fread(buffer, 1, bytes, file); - fclose(file); - - mPosition += mBytesRead; - if (!mBytesRead) + if (fseek(file, mPosition, SEEK_SET) == 0) { - success = FALSE; + mBytesRead = fread(buffer, 1, bytes, file); + fclose(file); + + mPosition += mBytesRead; + // It probably would be correct to check for mBytesRead == bytes, + // but that will break avatar rezzing... + if (mBytesRead) + { + success = TRUE; + } } } // @@ -286,10 +292,10 @@ BOOL LLFileSystem::write(const U8* buffer, S32 bytes) LLFILE* ofs = LLFile::fopen(filename, "a+b"); if (ofs) { - fwrite(buffer, 1, bytes, ofs); + S32 bytes_written = fwrite(buffer, 1, bytes, ofs); mPosition = ftell(ofs); fclose(ofs); - success = TRUE; + success = (bytes_written == bytes); } } else if (mMode == READ_WRITE) @@ -297,21 +303,23 @@ BOOL LLFileSystem::write(const U8* buffer, S32 bytes) LLFILE* ofs = LLFile::fopen(filename, "r+b"); if (ofs) { - fseek(ofs, mPosition, SEEK_SET); - fwrite(buffer, 1, bytes, ofs); - mPosition = ftell(ofs); - fclose(ofs); - success = TRUE; + if (fseek(ofs, mPosition, SEEK_SET) == 0) + { + S32 bytes_written = fwrite(buffer, 1, bytes, ofs); + mPosition = ftell(ofs); + fclose(ofs); + success = (bytes_written == bytes); + } } else { ofs = LLFile::fopen(filename, "wb"); if (ofs) { - fwrite(buffer, 1, bytes, ofs); + S32 bytes_written = fwrite(buffer, 1, bytes, ofs); mPosition = ftell(ofs); fclose(ofs); - success = TRUE; + success = (bytes_written == bytes); } } } @@ -320,10 +328,10 @@ BOOL LLFileSystem::write(const U8* buffer, S32 bytes) LLFILE* ofs = LLFile::fopen(filename, "wb"); if (ofs) { - fwrite(buffer, 1, bytes, ofs); + S32 bytes_written = fwrite(buffer, 1, bytes, ofs); mPosition = ftell(ofs); fclose(ofs); - success = TRUE; + success = (bytes_written == bytes); } } // diff --git a/indra/llimage/llimageworker.cpp b/indra/llimage/llimageworker.cpp index 84b03a9e06..0f44df12f2 100644 --- a/indra/llimage/llimageworker.cpp +++ b/indra/llimage/llimageworker.cpp @@ -29,13 +29,100 @@ #include "llimageworker.h" #include "llimagedxt.h" + // Image thread pool from CoolVL +#include "boost/thread.hpp" +std::atomic< U32 > s_ChildThreads; + +class PoolWorkerThread : public LLThread +{ +public: + PoolWorkerThread(std::string name) : LLThread(name), + mCurrentRequest(NULL) + { + } + virtual void run() + { + while (!isQuitting()) + { + auto *pReq = mCurrentRequest.exchange(nullptr); + + if (pReq) + pReq->processRequestIntern(); + checkPause(); + } + } + bool isBusy() + { + auto *pReq = mCurrentRequest.load(); + if (!pReq) + return false; + + auto status = pReq->getStatus(); + + return status == LLQueuedThread::STATUS_QUEUED || status == LLQueuedThread::STATUS_INPROGRESS; + } + + bool runCondition() + { + return mCurrentRequest != NULL; + } + + bool setRequest(LLImageDecodeThread::ImageRequest* req) + { + LLImageDecodeThread::ImageRequest* pOld{ nullptr }; + bool bSuccess = mCurrentRequest.compare_exchange_strong(pOld, req); + wake(); + + return bSuccess; + } + +private: + std::atomic< LLImageDecodeThread::ImageRequest * > mCurrentRequest; +}; +// + //---------------------------------------------------------------------------- // MAIN THREAD -LLImageDecodeThread::LLImageDecodeThread(bool threaded) +LLImageDecodeThread::LLImageDecodeThread(bool threaded, U32 aSubThreads) : LLQueuedThread("imagedecode", threaded) { mCreationMutex = new LLMutex(); + + // Image thread pool from CoolVL + if (aSubThreads == 0) + { + aSubThreads = boost::thread::hardware_concurrency(); + if (!aSubThreads) + aSubThreads = 4U; // Use a sane default: 4 cores + if (aSubThreads > 8U) + { + // Using number of (virtual) cores - 1 (for the main image worker + // thread) - 1 (for the viewer main loop thread), further bound to + // a maximum of 32 threads (more than that is totally useless, even + // when flying over main land with 512m draw distance). + aSubThreads = llmin(aSubThreads - 2U, 32U); + } + else if (aSubThreads > 2U) + { + // Using number of (virtual) cores - 1 (for the main image worker + // thread). + --aSubThreads; + } + } + else if (aSubThreads == 1) // Disable if only 1 + aSubThreads = 0; + + s_ChildThreads = aSubThreads; + for (U32 i = 0; i < aSubThreads; ++i) + { + std::stringstream strm; + strm << "imagedecodethread" << (i + 1); + + mThreadPool.push_back(std::make_shared< PoolWorkerThread>(strm.str())); + mThreadPool[i]->start(); + } + // } //virtual @@ -53,9 +140,12 @@ S32 LLImageDecodeThread::update(F32 max_time_ms) iter != mCreationList.end(); ++iter) { creation_info& info = *iter; + // ImageRequest* req = new ImageRequest(info.handle, info.image, + // info.priority, info.discard, info.needs_aux, + // info.responder); ImageRequest* req = new ImageRequest(info.handle, info.image, - info.priority, info.discard, info.needs_aux, - info.responder); + info.priority, info.discard, info.needs_aux, + info.responder, this); bool res = addRequest(req); if (!res) @@ -95,15 +185,21 @@ LLImageDecodeThread::Responder::~Responder() LLImageDecodeThread::ImageRequest::ImageRequest(handle_t handle, LLImageFormatted* image, U32 priority, S32 discard, BOOL needs_aux, - LLImageDecodeThread::Responder* responder) + LLImageDecodeThread::Responder* responder, + LLImageDecodeThread *aQueue) : LLQueuedThread::QueuedRequest(handle, priority, FLAG_AUTO_COMPLETE), mFormattedImage(image), mDiscardLevel(discard), mNeedsAux(needs_aux), mDecodedRaw(FALSE), mDecodedAux(FALSE), - mResponder(responder) + mResponder(responder), + mQueue( aQueue ) // Image thread pool from CoolVL { + // Image thread pool from CoolVL + if (s_ChildThreads > 0) + mFlags |= FLAG_ASYNC; + // } LLImageDecodeThread::ImageRequest::~ImageRequest() @@ -118,6 +214,21 @@ LLImageDecodeThread::ImageRequest::~ImageRequest() // Returns true when done, whether or not decode was successful. bool LLImageDecodeThread::ImageRequest::processRequest() +{ + // Image thread pool from CoolVL + + // If not async, decode using this thread + if ((mFlags & FLAG_ASYNC) == 0) + return processRequestIntern(); + + // Try to dispatch to a new thread, if this isn't possible decode on this thread + if (!mQueue->enqueRequest(this)) + return processRequestIntern(); + return true; + // +} + +bool LLImageDecodeThread::ImageRequest::processRequestIntern() { const F32 decode_time_slice = .1f; bool done = true; @@ -172,6 +283,15 @@ bool LLImageDecodeThread::ImageRequest::processRequest() mDecodedAux = done && mDecodedImageAux->getData(); } + // Image thread pool from CoolVL + if (mFlags & FLAG_ASYNC) + { + setStatus(STATUS_COMPLETE); + finishRequest(true); + // always autocomplete + mQueue->completeRequest(mHashKey); + } + // return done; } @@ -191,3 +311,16 @@ bool LLImageDecodeThread::ImageRequest::tut_isOK() { return mResponder.notNull(); } + +bool LLImageDecodeThread::enqueRequest(ImageRequest * req) +{ + for (auto &pThread : mThreadPool) + { + if (!pThread->isBusy()) + { + if( pThread->setRequest(req) ) + return true; + } + } + return false; +} diff --git a/indra/llimage/llimageworker.h b/indra/llimage/llimageworker.h index 1bfb0ddfd3..6104413700 100644 --- a/indra/llimage/llimageworker.h +++ b/indra/llimage/llimageworker.h @@ -31,6 +31,9 @@ #include "llpointer.h" #include "llworkerthread.h" + // Image thread pool +class PoolWorkerThread; + class LLImageDecodeThread : public LLQueuedThread { public: @@ -50,9 +53,10 @@ public: public: ImageRequest(handle_t handle, LLImageFormatted* image, U32 priority, S32 discard, BOOL needs_aux, - LLImageDecodeThread::Responder* responder); + LLImageDecodeThread::Responder* responder, LLImageDecodeThread *aQueue); /*virtual*/ bool processRequest(); + bool processRequestIntern(); /*virtual*/ void finishRequest(bool completed); // Used by unit tests to check the consitency of the request instance @@ -66,13 +70,18 @@ public: // output LLPointer mDecodedImageRaw; LLPointer mDecodedImageAux; + LLImageDecodeThread * mQueue; // Image thread pool from CoolVL BOOL mDecodedRaw; BOOL mDecodedAux; LLPointer mResponder; }; public: - LLImageDecodeThread(bool threaded = true); + // Image thread pool from CoolVL + //LLImageDecodeThread(bool threaded = true); + LLImageDecodeThread(bool threaded = true, U32 aSubThreads = 0 ); + // + virtual ~LLImageDecodeThread(); handle_t decodeImage(LLImageFormatted* image, @@ -99,6 +108,11 @@ private: typedef std::list creation_list_t; creation_list_t mCreationList; LLMutex* mCreationMutex; + + // Image thread pool from CoolVL + std::vector< std::shared_ptr< PoolWorkerThread > > mThreadPool; + bool enqueRequest(ImageRequest*); + // }; #endif diff --git a/indra/llimagej2coj/llimagej2coj.cpp b/indra/llimagej2coj/llimagej2coj.cpp index 78d1e0313b..0e605cf8b2 100644 --- a/indra/llimagej2coj/llimagej2coj.cpp +++ b/indra/llimagej2coj/llimagej2coj.cpp @@ -26,12 +26,14 @@ #include "linden_common.h" #include "llimagej2coj.h" +#define OPENJPEG2 // this is defined so that we get static linking. #include "openjpeg.h" +#ifndef OPENJPEG2 #include "cio.h" +#endif #include "event.h" -#define OPENJPEG2 #include "lltimer.h" @@ -177,9 +179,13 @@ std::string LLImageJ2COJ::getEngineInfo() const + opj_version(); #elif defined OPJ_PACKAGE_VERSION return std::string("OpenJPEG: " OPJ_PACKAGE_VERSION ", Runtime: ") + opj_version(); +#else +#ifdef OPENJPEG2 + return llformat("OpenJPEG: %i.%i.%i, Runtime: %s", OPJ_VERSION_MAJOR, OPJ_VERSION_MINOR, OPJ_VERSION_BUILD, opj_version()); #else return std::string("OpenJPEG Runtime: ") + opj_version(); #endif +#endif } // Return string from message, eliminating final \n if present diff --git a/indra/llmessage/llregionhandle.h b/indra/llmessage/llregionhandle.h index 085757dcbc..8154a6358f 100644 --- a/indra/llmessage/llregionhandle.h +++ b/indra/llmessage/llregionhandle.h @@ -39,6 +39,29 @@ inline U64 to_region_handle(const U32 x_origin, const U32 y_origin) return region_handle; } +// FIRE-30534 Overload that takes explicit region origin and width to improve Var Region identification. +inline U64 to_region_handle(const LLVector3d& pos_global, const LLVector3d& agent_region_origin, const F32 width) +{ + U32 global_x { static_cast( pos_global.mdV[VX] ) }; + U32 global_y { static_cast( pos_global.mdV[VY] ) }; + + U32 agent_region_origin_x { static_cast( agent_region_origin.mdV[VX] ) }; + U32 agent_region_origin_y { static_cast( agent_region_origin.mdV[VY] ) }; + + if( agent_region_origin_x < global_x && ( agent_region_origin_x + width ) > global_x && + agent_region_origin_y < global_y && ( agent_region_origin_y + width ) > global_y ) + { + // target is local to current region we can make a more informed guess + return to_region_handle( agent_region_origin_x, agent_region_origin_y ); + } + // fallback to legacy 256m tile-based guess and let the region server / map work it out. + global_x -= global_x % 256; + global_y -= global_y % 256; + + return to_region_handle( global_x, global_y ); +} +// + inline U64 to_region_handle(const LLVector3d& pos_global) { U32 global_x = (U32)pos_global.mdV[VX]; diff --git a/indra/llprimitive/llmodelloader.h b/indra/llprimitive/llmodelloader.h index a67c39252c..0bd7a05217 100644 --- a/indra/llprimitive/llmodelloader.h +++ b/indra/llprimitive/llmodelloader.h @@ -95,6 +95,7 @@ public: ERROR_INVALID_PARAMETERS, ERROR_OUT_OF_RANGE, ERROR_FILE_VERSION_INVALID, + ERROR_LOD_MODEL_MISMATCH, // clean up and improve error reporting ERROR_MODEL // this error should always be last in this list, error code is passed as ERROR_MODEL+error_code } eLoadState; diff --git a/indra/llui/llurlentry.cpp b/indra/llui/llurlentry.cpp index 8b5aa53188..03e37ff69f 100644 --- a/indra/llui/llurlentry.cpp +++ b/indra/llui/llurlentry.cpp @@ -42,7 +42,7 @@ // hop:// protocol> //#define APP_HEADER_REGEX "((x-grid-location-info://[-\\w\\.]+/app)|(secondlife:///app))" -#define APP_HEADER_REGEX "(((hop|x-grid-location-info)://[-\\w\\.\\:\\@]+/app)|((hop|secondlife|inworldz|iw):///app))" +#define APP_HEADER_REGEX "(((hop|x-grid-location-info)://[-\\w\\.\\:\\@]+/app)|((hop|secondlife):///app))" // // Utility functions @@ -354,9 +354,8 @@ std::string LLUrlEntryHTTPNoProtocol::getTooltip(const std::string &url) const LLUrlEntryInvalidSLURL::LLUrlEntryInvalidSLURL() : LLUrlEntryBase() { - // Inworldz special - //mPattern = boost::regex("(http://(maps.secondlife.com|slurl.com)/secondlife/|secondlife://(/app/(worldmap|teleport)/)?)[^ /]+(/-?[0-9]+){1,3}(/?(\\?title|\\?img|\\?msg)=\\S*)?/?", - mPattern = boost::regex("(https?://(maps.secondlife.com|slurl.com)/secondlife/|(secondlife|inworldz|iw)://(/app/(worldmap|teleport)/)?)[^ /]+(/-?[0-9]+){1,3}(/?(\\?title|\\?img|\\?msg)=\\S*)?/?", + // remove legacy Inworldz URI support. restore previous with addition of https + mPattern = boost::regex("(https?://(maps.secondlife.com|slurl.com)/secondlife/|secondlife://(/app/(worldmap|teleport)/)?)[^ /]+(/-?[0-9]+){1,3}(/?(\\?title|\\?img|\\?msg)=\\S*)?/?", boost::regex::perl|boost::regex::icase); mMenuName = "menu_url_http.xml"; mTooltip = LLTrans::getString("TooltipHttpUrl"); @@ -1101,7 +1100,7 @@ LLUrlEntryObjectIM::LLUrlEntryObjectIM() { // hop:// protocol; Ansa: Stop at first space so we can use it in notifications! //mPattern = boost::regex("secondlife:///app/objectim/[\\da-f-]+\?\\S*\\w", - mPattern = boost::regex("(hop|secondlife|inworldz|iw):///app/objectim/[\\da-f-]+\?[^ \t\r\n\v\f]*", + mPattern = boost::regex("(hop|secondlife):///app/objectim/[\\da-f-]+\?[^ \t\r\n\v\f]*", // boost::regex::perl|boost::regex::icase); mMenuName = "menu_url_objectim.xml"; @@ -1230,9 +1229,7 @@ void LLUrlEntryParcel::processParcelInfo(const LLParcelData& parcel_data) // LLUrlEntryPlace::LLUrlEntryPlace() { - // Inworldz special - //mPattern = boost::regex("((hop://[-\\w\\.\\:\\@]+/)|((x-grid-location-info://[-\\w\\.]+/region/)|(secondlife://)))\\S+/?(\\d+/\\d+/\\d+|\\d+/\\d+)/?", // - mPattern = boost::regex("((hop://[-\\w\\.\\:\\@]+/)|((x-grid-location-info://[-\\w\\.]+/region/)|((secondlife|inworldz|iw)://)))\\S+/?(\\d+/\\d+/\\d+|\\d+/\\d+)/?", // + mPattern = boost::regex("((hop://[-\\w\\.\\:\\@]+/)|((x-grid-location-info://[-\\w\\.]+/region/)|(secondlife://)))\\S+/?(\\d+/\\d+/\\d+|\\d+/\\d+)/?", // boost::regex::perl|boost::regex::icase); mMenuName = "menu_url_slurl.xml"; mTooltip = LLTrans::getString("TooltipSLURL"); @@ -1415,7 +1412,7 @@ std::string LLUrlEntryTeleport::getLocation(const std::string &url) const /// FSUrlEntryWear::FSUrlEntryWear() { - mPattern = boost::regex("(hop|secondlife|inworldz|iw):///app/wear_folder/\\S+", + mPattern = boost::regex("(hop|secondlife):///app/wear_folder/\\S+", boost::regex::perl|boost::regex::icase); mMenuName = "menu_url_slapp.xml"; mTooltip = LLTrans::getString("TooltipFSUrlEntryWear"); @@ -1433,7 +1430,7 @@ std::string FSUrlEntryWear::getLabel(const std::string &url, const LLUrlLabelCal // LLUrlEntrySL::LLUrlEntrySL() { - mPattern = boost::regex("(hop|secondlife|inworldz|iw)://(\\w+)?(:\\d+)?/\\S+", // + mPattern = boost::regex("(hop|secondlife)://(\\w+)?(:\\d+)?/\\S+", // boost::regex::perl|boost::regex::icase); mMenuName = "menu_url_slapp.xml"; mTooltip = LLTrans::getString("TooltipSLAPP"); @@ -1451,7 +1448,7 @@ std::string LLUrlEntrySL::getLabel(const std::string &url, const LLUrlLabelCallb /// FSHelpDebugUrlEntrySL::FSHelpDebugUrlEntrySL() { - mPattern = boost::regex("(hop|secondlife|inworldz|iw):///app/fshelp/showdebug/\\S+", + mPattern = boost::regex("(hop|secondlife):///app/fshelp/showdebug/\\S+", boost::regex::perl|boost::regex::icase); mMenuName = "menu_url_slapp.xml"; mTooltip = LLTrans::getString("TooltipFSHelpDebugSLUrl"); @@ -1470,7 +1467,7 @@ std::string FSHelpDebugUrlEntrySL::getLabel(const std::string &url, const LLUrlL // LLUrlEntrySLLabel::LLUrlEntrySLLabel() { - mPattern = boost::regex("\\[(hop|secondlife|inworldz|iw)://\\S+[ \t]+[^\\]]+\\]", // + mPattern = boost::regex("\\[(hop|secondlife)://\\S+[ \t]+[^\\]]+\\]", // boost::regex::perl|boost::regex::icase); mMenuName = "menu_url_slapp.xml"; mTooltip = LLTrans::getString("TooltipSLAPP"); diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 7c26a5b900..bcf1886081 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -166,17 +166,6 @@ Backup 0 - OpensimPrefsAddGrid - - Comment - Transient string for adding new grids in Preferences > Opensim - Persist - 0 - Type - String - Value - - FSShowDummyAVsinRadar Comment @@ -2930,7 +2919,7 @@ Value 23 - EnableCacheDebugInfo + EnableDiskCacheDebugInfo Comment When set, display additional cache debugging information @@ -2944,7 +2933,7 @@ DiskCachePercentOfTotal Comment - The percent of total cache size (defined by CacheSize) to use for the disk cache + The percent of total cache size (defined by CacheSize) to use for the disk cache (UNUSED) Persist 1 Type @@ -2963,6 +2952,17 @@ Value cache + FSDiskCacheSize + + Comment + Controls amount of hard drive space reserved for local asset caching in MB + Persist + 1 + Type + U32 + Value + 2048 + CacheLocation Comment @@ -2999,7 +2999,7 @@ CacheSize Comment - Controls amount of hard drive space reserved for local file caching in MB + Controls amount of hard drive space reserved for local texture caching in MB Persist 1 Type @@ -9399,6 +9399,17 @@ Value salt_and_pepper.jpg + FSPhysicsPresetUser1 + + Comment + full system path to a user provided physics mesh (DAE). + Persist + 1 + Type + String + Value + + MigrateCacheDirectory Comment @@ -25693,5 +25704,16 @@ Change of this parameter will affect the layout of buttons in notification toast Value 0 + FSImageDecodeThreads + + Comment + Amount of threads to use for image decoding. 0 = autodetect, 1 = 0ff, >1 number of threads. Needs restart + Persist + 1 + Type + U32 + Value + 1 + diff --git a/indra/newview/chatbar_as_cmdline.cpp b/indra/newview/chatbar_as_cmdline.cpp index 04098fad54..7181c9dddd 100644 --- a/indra/newview/chatbar_as_cmdline.cpp +++ b/indra/newview/chatbar_as_cmdline.cpp @@ -938,8 +938,8 @@ bool cmd_line_chat(const std::string& revised_text, EChatType type, bool from_ge { region_name = LLWeb::escapeURL(revised_text.substr(command.length() + 1)); LLVector3d agentPos = gAgent.getPositionGlobal(); - agent_x = ll_round((F32)fmod(agentPos.mdV[VX], (F64)REGION_WIDTH_METERS)); - agent_y = ll_round((F32)fmod(agentPos.mdV[VY], (F64)REGION_WIDTH_METERS)); + agent_x = ll_round((F32)agentPos.mdV[VX]); + agent_y = ll_round((F32)agentPos.mdV[VY]); agent_z = ll_round((F32)agentPos.mdV[VZ]); if (!sFSCmdLineMapToKeepPos) { diff --git a/indra/newview/fs_resources/cube_phys.dae b/indra/newview/fs_resources/cube_phys.dae new file mode 100644 index 0000000000..80a92cb38c --- /dev/null +++ b/indra/newview/fs_resources/cube_phys.dae @@ -0,0 +1,74 @@ + + + + + Avastar User + Avastar 2-0-10 on Blender 2.78 (sub 0) + + 2017-02-03T17:31:59 + 2017-02-03T17:31:59 + + Z_UP + + + + + + + + + + -0.4 -0.4 -0.4 -0.4 -0.4 0.4 -0.4 0.4 -0.4 -0.4 0.4 0.4 0.4 -0.4 -0.4 0.4 -0.4 0.4 0.4 0.4 -0.4 0.4 0.4 0.4 + + + + + + + + + + -1 -0 0 0 1 0 1 -0 0 0 -1 0 0 0 -1 0 -0 1 + + + + + + + + + + + + + + + 4 4 4 4 4 4 +

0 0 1 0 3 0 2 0 2 1 3 1 7 1 6 1 6 2 7 2 5 2 4 2 4 3 5 3 1 3 0 3 2 4 6 4 4 4 0 4 7 5 3 5 1 5 5 5

+
+
+ + + 1 + + +
+
+ + + + + 5.93563 6.77334 -14.9673 + 0 0 1 0 + 0 1 0 0 + 1 0 0 0 + 1 1 1 + + + + + + + +
+ diff --git a/indra/newview/fs_resources/hex_phys.dae b/indra/newview/fs_resources/hex_phys.dae new file mode 100644 index 0000000000..21d05cca6f --- /dev/null +++ b/indra/newview/fs_resources/hex_phys.dae @@ -0,0 +1,70 @@ + + + + + Blender User + Blender 2.80.43 commit date:2019-01-29, commit time:22:41, hash:a1ae04d15a9f + + 2019-02-05T14:28:24 + 2019-02-05T14:28:24 + + Z_UP + + + + + + + 0 1 -1 0 1 1 0.8660255 0.5 -1 0.8660255 0.5 1 0.8660254 -0.5000001 -1 0.8660254 -0.5000001 1 0 -1 -1 0 -1 1 -0.8660255 -0.4999999 -1 -0.8660255 -0.4999999 1 -0.8660255 0.4999999 -1 -0.8660255 0.4999999 1 + + + + + + + + + + 0.5 0.8660255 0 1 0 0 0.5 -0.8660255 0 -0.5000001 -0.8660253 0 0 0 1 -1 0 0 -0.5000001 0.8660255 0 0 0 -1 1 -1.19209e-7 0 0.5 -0.8660255 0 -0.5000001 -0.8660254 0 0 0 1 1.37651e-7 0 1 0 0 1 1.37651e-7 0 -1 1.37651e-7 0 -1 + + + + + + + + + + 1 1 0.8333333 0.5 1 0.5 0.8333333 1 0.6666666 0.5 0.8333333 0.5 0.6666666 1 0.5 0.5 0.6666666 0.5 0.5 1 0.3333333 0.5 0.5 0.5 0.25 0.49 0.04215389 0.13 0.4578461 0.1299999 0.3333333 1 0.1666666 0.5 0.3333333 0.5 0.1666666 1 0 0.5 0.1666666 0.5 0.5421539 0.13 0.5421539 0.37 0.9578461 0.37 1 1 0.8333333 1 0.8333333 0.5 0.8333333 1 0.6666666 1 0.6666666 0.5 0.6666666 1 0.5 1 0.5 0.5 0.5 1 0.3333333 1 0.3333333 0.5 0.4578461 0.1299999 0.4578461 0.37 0.25 0.49 0.25 0.49 0.04215389 0.37 0.04215389 0.13 0.04215389 0.13 0.25 0.00999999 0.4578461 0.1299999 0.3333333 1 0.1666666 1 0.1666666 0.5 0.1666666 1 0 1 0 0.5 0.5421539 0.37 0.75 0.49 0.9578461 0.37 0.9578461 0.37 0.9578461 0.1299999 0.75 0.00999999 0.75 0.00999999 0.5421539 0.13 0.9578461 0.37 + + + + + + + + + + + + + + + 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 +

1 0 0 2 0 1 0 0 2 3 1 3 4 1 4 2 1 5 5 2 6 6 2 7 4 2 8 7 3 9 8 3 10 6 3 11 1 4 12 9 4 13 5 4 14 9 5 15 10 5 16 8 5 17 11 6 18 0 6 19 10 6 20 8 7 21 10 7 22 2 7 23 1 0 24 3 0 25 2 0 26 3 8 27 5 8 28 4 8 29 5 9 30 7 9 31 6 9 32 7 10 33 9 10 34 8 10 35 5 11 36 3 11 37 1 11 38 1 12 39 11 12 40 9 12 41 9 13 42 7 13 43 5 13 44 9 5 45 11 5 46 10 5 47 11 6 48 1 6 49 0 6 50 10 14 51 0 14 52 2 14 53 2 15 54 4 15 55 6 15 56 6 7 57 8 7 58 2 7 59

+
+
+
+
+ + + + 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 + + + + + + + +
\ No newline at end of file diff --git a/indra/newview/fsfloatercontacts.cpp b/indra/newview/fsfloatercontacts.cpp index ba91a8ebb6..e9fc95e531 100644 --- a/indra/newview/fsfloatercontacts.cpp +++ b/indra/newview/fsfloatercontacts.cpp @@ -72,6 +72,7 @@ FSFloaterContacts::FSFloaterContacts(const LLSD& seed) mFriendsList(NULL), mGroupList(NULL), mFriendFilter(NULL), + mGroupFilter(NULL), mFriendFilterSubString(LLStringUtil::null), mFriendFilterSubStringOrig(LLStringUtil::null), mAllowRightsChange(true), @@ -153,7 +154,10 @@ BOOL FSFloaterContacts::postBuild() mGroupsTab->childSetAction("titles_btn", boost::bind(&FSFloaterContacts::onGroupTitlesButtonClicked, this)); mGroupsTab->childSetAction("invite_btn", boost::bind(&FSFloaterContacts::onGroupInviteButtonClicked, this)); mGroupsTab->setDefaultBtn("chat_btn"); - + + mGroupFilter = mGroupsTab->getChild("group_filter_input"); + mGroupFilter->setCommitCallback(boost::bind(&FSFloaterContacts::onGroupFilterEdit, this, _2)); + mRlvBehaviorCallbackConnection = gRlvHandler.setBehaviourCallback(boost::bind(&FSFloaterContacts::updateRlvRestrictions, this, _1)); gSavedSettings.getControl("FSFriendListFullNameFormat")->getSignal()->connect(boost::bind(&FSFloaterContacts::onDisplayNameChanged, this)); @@ -195,10 +199,18 @@ BOOL FSFloaterContacts::tick() BOOL FSFloaterContacts::handleKeyHere(KEY key, MASK mask) { - if (FSCommon::isFilterEditorKeyCombo(key, mask) && getActiveTabName() == FRIENDS_TAB_NAME && gSavedSettings.getBOOL("FSContactListShowSearch")) + if (FSCommon::isFilterEditorKeyCombo(key, mask)) { - mFriendFilter->setFocus(TRUE); - return TRUE; + if (getActiveTabName() == FRIENDS_TAB_NAME && gSavedSettings.getBOOL("FSContactListShowSearch")) + { + mFriendFilter->setFocus(TRUE); + return TRUE; + } + else if (getActiveTabName() == GROUP_TAB_NAME) + { + mGroupFilter->setFocus(TRUE); + return true; + } } if (mask == MASK_CONTROL && key == 'W' && getHost()) @@ -1357,4 +1369,9 @@ void FSFloaterContacts::resetFriendFilter() mFriendFilter->setText(LLStringUtil::null); onFriendFilterEdit(""); } + +void FSFloaterContacts::onGroupFilterEdit(const std::string& search_string) +{ + mGroupList->setNameFilter(search_string); +} // EOF diff --git a/indra/newview/fsfloatercontacts.h b/indra/newview/fsfloatercontacts.h index 398de020e9..36246d7c4f 100644 --- a/indra/newview/fsfloatercontacts.h +++ b/indra/newview/fsfloatercontacts.h @@ -120,6 +120,7 @@ private: EAcceptance* accept, std::string& tooltip_msg); void onFriendFilterEdit(const std::string& search_string); + void onGroupFilterEdit(const std::string& search_string); // friend buttons void onViewProfileButtonClicked(); @@ -128,7 +129,6 @@ private: void onPayButtonClicked(); void onDeleteFriendButtonClicked(); void onAddFriendWizButtonClicked(LLUICtrl* ctrl); - void onContactSetsButtonClicked(); void onMapButtonClicked(); // group buttons @@ -144,6 +144,7 @@ private: LLTabContainer* mTabContainer; LLFilterEditor* mFriendFilter; + LLFilterEditor* mGroupFilter; LLPanel* mFriendsTab; FSScrollListCtrl* mFriendsList; LLPanel* mGroupsTab; diff --git a/indra/newview/fsfloatergrouptitles.cpp b/indra/newview/fsfloatergrouptitles.cpp index 30c8cab800..25e5ec8788 100644 --- a/indra/newview/fsfloatergrouptitles.cpp +++ b/indra/newview/fsfloatergrouptitles.cpp @@ -27,6 +27,8 @@ #include "llviewerprecompiledheaders.h" #include "fsfloatergrouptitles.h" +#include "fscommon.h" +#include "llfiltereditor.h" #include "llgroupactions.h" #include "llscrolllistctrl.h" #include "lltrans.h" @@ -34,7 +36,7 @@ ///////////////////////////////////////////////////// // FSGroupTitlesObserver class // -FSGroupTitlesObserver::FSGroupTitlesObserver(const LLGroupData& group_data, FSFloaterGroupTitles* parent) : +FSGroupTitlesObserver::FSGroupTitlesObserver(const LLGroupData& group_data, LLHandle parent) : LLGroupMgrObserver(group_data.mID), mGroupData(group_data), mParent(parent) @@ -49,9 +51,9 @@ FSGroupTitlesObserver::~FSGroupTitlesObserver() void FSGroupTitlesObserver::changed(LLGroupChange gc) { - if (mParent) + if (!mParent.isDead()) { - mParent->processGroupTitleResults(mGroupData); + mParent.get()->processGroupTitleResults(mGroupData); } } @@ -60,7 +62,9 @@ void FSGroupTitlesObserver::changed(LLGroupChange gc) // FSGroupTitles class // FSFloaterGroupTitles::FSFloaterGroupTitles(const LLSD& key) : - LLFloater(key) + LLFloater(key), + mFilterSubString(LLStringUtil::null), + mFilterSubStringOrig(LLStringUtil::null) { // Register observer and event listener LLGroupMgr::getInstance()->addObserver(this); @@ -85,20 +89,41 @@ BOOL FSFloaterGroupTitles::postBuild() mRefreshButton = getChild("btnRefresh"); mInfoButton = getChild("btnInfo"); mTitleList = getChild("title_list"); + mFilterEditor = getChild("filter_input"); mActivateButton->setCommitCallback(boost::bind(&FSFloaterGroupTitles::activateGroupTitle, this)); mRefreshButton->setCommitCallback(boost::bind(&FSFloaterGroupTitles::refreshGroupTitles, this)); mInfoButton->setCommitCallback(boost::bind(&FSFloaterGroupTitles::openGroupInfo, this)); mTitleList->setDoubleClickCallback(boost::bind(&FSFloaterGroupTitles::activateGroupTitle, this)); mTitleList->setCommitCallback(boost::bind(&FSFloaterGroupTitles::selectedTitleChanged, this)); + mFilterEditor->setCommitCallback(boost::bind(&FSFloaterGroupTitles::onFilterEdit, this, _2)); mTitleList->sortByColumn("title_sort_column", TRUE); + mTitleList->setFilterColumn(0); refreshGroupTitles(); return TRUE; } +void FSFloaterGroupTitles::onOpen(const LLSD& key) +{ + LLFloater::onOpen(key); + + mTitleList->setFocus(TRUE); +} + +BOOL FSFloaterGroupTitles::handleKeyHere(KEY key, MASK mask) +{ + if (FSCommon::isFilterEditorKeyCombo(key, mask)) + { + mFilterEditor->setFocus(TRUE); + return true; + } + + return LLFloater::handleKeyHere(key, mask); +} + void FSFloaterGroupTitles::changed(LLGroupChange gc) { switch (gc) @@ -231,7 +256,7 @@ void FSFloaterGroupTitles::refreshGroupTitles() for (std::vector::iterator it = gAgent.mGroups.begin(); it != gAgent.mGroups.end(); ++it) { LLGroupData& group_data = *it; - FSGroupTitlesObserver* roleObserver = new FSGroupTitlesObserver(group_data, this); + FSGroupTitlesObserver* roleObserver = new FSGroupTitlesObserver(group_data, getDerivedHandle()); mGroupTitleObserverMap[group_data.mID] = roleObserver; LLGroupMgr::getInstance()->sendGroupTitlesRequest(group_data.mID); } @@ -256,3 +281,22 @@ void FSFloaterGroupTitles::openGroupInfo() LLGroupActions::show(group_id); } } + +void FSFloaterGroupTitles::onFilterEdit(const std::string& search_string) +{ + mFilterSubStringOrig = search_string; + LLStringUtil::trimHead(mFilterSubStringOrig); + // Searches are case-insensitive + std::string search_upper = mFilterSubStringOrig; + LLStringUtil::toUpper(search_upper); + + if (mFilterSubString == search_upper) + { + return; + } + + mFilterSubString = search_upper; + + // Apply new filter. + mTitleList->setFilterString(mFilterSubStringOrig); +} diff --git a/indra/newview/fsfloatergrouptitles.h b/indra/newview/fsfloatergrouptitles.h index 24e42111f6..1cb0d5acbb 100644 --- a/indra/newview/fsfloatergrouptitles.h +++ b/indra/newview/fsfloatergrouptitles.h @@ -33,20 +33,21 @@ #include "llgroupmgr.h" class FSFloaterGroupTitles; +class LLFilterEditor; class LLScrollListCtrl; class FSGroupTitlesObserver : LLGroupMgrObserver { public: - FSGroupTitlesObserver(const LLGroupData& group_data, FSFloaterGroupTitles* parent); + FSGroupTitlesObserver(const LLGroupData& group_data, LLHandle parent); virtual ~FSGroupTitlesObserver(); virtual void changed(LLGroupChange gc); protected: - FSFloaterGroupTitles* mParent; - LLGroupData mGroupData; + LLHandle mParent; + LLGroupData mGroupData; }; class FSFloaterGroupTitles : public LLFloater, public LLGroupMgrObserver, public LLOldEvents::LLSimpleListener @@ -57,6 +58,9 @@ public: virtual ~FSFloaterGroupTitles(); /*virtual*/ BOOL postBuild(); + /*virtual*/ void onOpen(const LLSD& key); + /*virtual*/ BOOL handleKeyHere(KEY key, MASK mask); + /*virtual*/ bool hasAccelerators() const { return true; } virtual void changed(LLGroupChange gc); bool handleEvent(LLPointer event, const LLSD& userdata); // called on agent group list changes @@ -73,11 +77,16 @@ private: void activateGroupTitle(); void selectedTitleChanged(); void openGroupInfo(); + void onFilterEdit(const std::string& search_string); LLButton* mActivateButton; LLButton* mRefreshButton; LLButton* mInfoButton; LLScrollListCtrl* mTitleList; + LLFilterEditor* mFilterEditor; + + std::string mFilterSubString; + std::string mFilterSubStringOrig; typedef std::map observer_map_t; observer_map_t mGroupTitleObserverMap; diff --git a/indra/newview/fsfloaterplacedetails.cpp b/indra/newview/fsfloaterplacedetails.cpp index a21eff9f73..ed459a5d81 100644 --- a/indra/newview/fsfloaterplacedetails.cpp +++ b/indra/newview/fsfloaterplacedetails.cpp @@ -50,6 +50,7 @@ #include "llpanelplaceprofile.h" #include "llpanellandmarkinfo.h" #include "llparcel.h" +#include "llregionhandle.h" // Var region support #include "llteleporthistorystorage.h" #include "llviewercontrol.h" #include "llviewermessage.h" @@ -355,7 +356,15 @@ void FSFloaterPlaceDetails::onOpen(const LLSD& key) key["z"].asReal()); mPanelPlaceInfo->setParcelDetailLoadedCallback(boost::bind(&FSFloaterPlaceDetails::processParcelDetails, this, _1)); - mPanelPlaceInfo->displayParcelInfo(LLUUID(), mGlobalPos); + if(key.has("ox")) + { + auto region_handle = to_region_handle(key["ox"].asInteger(), key["oy"].asInteger()); + mPanelPlaceInfo->displayParcelInfo(LLUUID(), region_handle, mGlobalPos); + } + else + { + mPanelPlaceInfo->displayParcelInfo(LLUUID(), mGlobalPos); + } } updateVerbs(); diff --git a/indra/newview/fsgridhandler.cpp b/indra/newview/fsgridhandler.cpp index 392132f27c..aa5e69fa5b 100644 --- a/indra/newview/fsgridhandler.cpp +++ b/indra/newview/fsgridhandler.cpp @@ -29,6 +29,7 @@ #include "llviewerprecompiledheaders.h" +#include "llcommandhandler.h" #include "lllogininstance.h" // to check if logged in yet #include "llnotifications.h" #include "llnotificationsutil.h" @@ -36,6 +37,7 @@ #include "llviewercontrol.h" #include "llsdserialize.h" #include "llsecapi.h" +#include "llstartup.h" #include "lltrans.h" #include "llweb.h" @@ -48,6 +50,7 @@ #include "llstartup.h" #include "fscorehttputil.h" +#include "fspanellogin.h" #include "lfsimfeaturehandler.h" // void gridDownloadError( LLSD const &aData, LLGridManager* mOwner, GridEntry* mData, LLGridManager::AddState mState ) @@ -819,7 +822,6 @@ void LLGridManager::addGrid(GridEntry* grid_entry, AddState state) if (list_changed) { mGridListChangedSignal(true); - mGridListChangedSignal.disconnect_all_slots(); } } } @@ -841,7 +843,6 @@ void LLGridManager::addGrid(GridEntry* grid_entry, AddState state) if (FAIL == state) { mGridListChangedSignal(false); - mGridListChangedSignal.disconnect_all_slots(); } if (grid_entry) @@ -1384,10 +1385,6 @@ std::string LLGridManager::getAppSLURLBase(const std::string& grid) { ret = mGridList[grid][GRID_APP_SLURL_BASE].asString(); } - else if (grid == INWORLDZ_URI) - { - ret = "inworldz:///app"; - } else { std::string app_base; @@ -1422,3 +1419,61 @@ std::string LLGridManager::getAppSLURLBase(const std::string& grid) LL_DEBUGS("GridManager") << "App slurl base: " << ret << " - grid = " << grid << LL_ENDL; return ret; } + +class FSGridManagerCommandHandler : public LLCommandHandler +{ +public: + // not allowed from outside the app + FSGridManagerCommandHandler() : LLCommandHandler("gridmanager", UNTRUSTED_THROTTLE), + mDownloadConnection() + { } + + ~FSGridManagerCommandHandler() + { + if (mDownloadConnection.connected()) + { + mDownloadConnection.disconnect(); + } + } + + bool handle(const LLSD& params, const LLSD& query_map, LLMediaCtrl* web) + { + if (params.size() < 2) + { + return false; + } + + if (params[0].asString() == "addgrid") + { + std::string login_uri = LLURI::unescape(params[1].asString()); + mDownloadConnection = LLGridManager::instance().addGridListChangedCallback(boost::bind(&FSGridManagerCommandHandler::handleGridDownloadComplete, this, _1)); + LLGridManager::instance().addGrid(login_uri); + return true; + } + + return false; + } + +private: + boost::signals2::connection mDownloadConnection; + + void handleGridDownloadComplete(bool success) + { + if (mDownloadConnection.connected()) + { + mDownloadConnection.disconnect(); + } + + if (success) + { + LLGridManager::getInstance()->saveGridList(); + if (LLStartUp::getStartupState() <= STATE_LOGIN_WAIT) + { + FSPanelLogin::updateServer(); + } + } + } +}; + +// Creating the object registers with the dispatcher. +FSGridManagerCommandHandler gFSGridManagerCommandHandler; diff --git a/indra/newview/fspanellogin.cpp b/indra/newview/fspanellogin.cpp index ab9da81de5..ca6387f036 100644 --- a/indra/newview/fspanellogin.cpp +++ b/indra/newview/fspanellogin.cpp @@ -184,7 +184,8 @@ FSPanelLogin::FSPanelLogin(const LLRect &rect, mPasswordLength(0), mLocationLength(0), mShowFavorites(false), - mInitialized(false) + mInitialized(false), + mGridListChangedCallbackConnection() { setBackgroundVisible(FALSE); setBackgroundOpaque(TRUE); @@ -387,6 +388,11 @@ void FSPanelLogin::addFavoritesToStartLocation() FSPanelLogin::~FSPanelLogin() { + if (mGridListChangedCallbackConnection.connected()) + { + mGridListChangedCallbackConnection.disconnect(); + } + FSPanelLogin::sInstance = NULL; // Controls having keyboard focus by default @@ -1113,14 +1119,18 @@ void FSPanelLogin::onSelectServer() LLComboBox* server_combo = getChild("server_combo"); LLSD server_combo_val = server_combo->getSelectedValue(); #if OPENSIM && !SINGLEGRID - LL_INFOS("AppInit") << "grid "<<(!server_combo_val.isUndefined()?server_combo_val.asString():server_combo->getValue().asString())<< LL_ENDL; + LL_INFOS("AppInit") << "grid " << (!server_combo_val.isUndefined() ? server_combo_val.asString() : server_combo->getValue().asString()) << LL_ENDL; if (server_combo_val.isUndefined() && sPendingNewGridURI.empty()) { sPendingNewGridURI = server_combo->getValue().asString(); LLStringUtil::trim(sPendingNewGridURI); - LL_INFOS("AppInit") << "requesting unknown grid "<< sPendingNewGridURI << LL_ENDL; + LL_INFOS("AppInit") << "requesting unknown grid " << sPendingNewGridURI << LL_ENDL; // Previously unknown gridname was entered - LLGridManager::getInstance()->addGridListChangedCallback(boost::bind(&FSPanelLogin::gridListChanged, this, _1)); + if (mGridListChangedCallbackConnection.connected()) + { + mGridListChangedCallbackConnection.disconnect(); + } + mGridListChangedCallbackConnection = LLGridManager::getInstance()->addGridListChangedCallback(boost::bind(&FSPanelLogin::gridListChanged, this, _1)); LLGridManager::getInstance()->addGrid(sPendingNewGridURI); } else @@ -1452,6 +1462,11 @@ std::string FSPanelLogin::credentialName() void FSPanelLogin::gridListChanged(bool success) { + if (mGridListChangedCallbackConnection.connected()) + { + mGridListChangedCallbackConnection.disconnect(); + } + updateServer(); sPendingNewGridURI.clear(); // success or fail we clear the pending URI as we will not get another callback. } diff --git a/indra/newview/fspanellogin.h b/indra/newview/fspanellogin.h index 098cf9335f..ffe0b288f3 100644 --- a/indra/newview/fspanellogin.h +++ b/indra/newview/fspanellogin.h @@ -114,6 +114,8 @@ private: static std::string credentialName(); private: + boost::signals2::connection mGridListChangedCallbackConnection; + void updateLoginButtons(); void (*mCallback)(S32 option, void *userdata); diff --git a/indra/newview/fsslurl.cpp b/indra/newview/fsslurl.cpp index 22ff350b22..86e7b9794e 100644 --- a/indra/newview/fsslurl.cpp +++ b/indra/newview/fsslurl.cpp @@ -59,11 +59,6 @@ const char* LLSLURL::SLURL_REGION_PATH = "region"; const char* LLSLURL::SIM_LOCATION_HOME = "home"; const char* LLSLURL::SIM_LOCATION_LAST = "last"; -// Inworldz special -const char* LLSLURL::SLURL_INWORLDZ_SCHEME = "inworldz"; -const char* LLSLURL::SLURL_IW_SCHEME = "iw"; -const char* LLSLURL::PLACES_INWORLDZ_COM = "places.inworldz.com"; - // resolve a simstring from a slurl LLSLURL::LLSLURL(const std::string& slurl) : mHypergrid(false) @@ -244,55 +239,6 @@ LLSLURL::LLSLURL(const std::string& slurl) path_array.insert(0, slurl_uri.hostNameAndPort()); } } - else if (slurl_uri.scheme() == LLSLURL::SLURL_INWORLDZ_SCHEME || - slurl_uri.scheme() == LLSLURL::SLURL_IW_SCHEME) - { - LL_DEBUGS("SLURL") << "inworldz scheme" << LL_ENDL; - - mGrid = INWORLDZ_URI; - - if (path_array[0].asString() == LLSLURL::SLURL_APP_PATH) - { - // it's in the form iw:///(app) - // so parse the grid name to derive the grid ID - if (!slurl_uri.hostNameAndPort().empty()) - { - LL_DEBUGS("SLURL") << "(inworldz|iw):///app" << LL_ENDL; - - mGrid = LLGridManager::getInstance()->getGridByProbing(slurl_uri.hostNameAndPort()); - if (mGrid.empty()) - { - mGrid = LLGridManager::getInstance()->getGridByProbing(slurl_uri.hostName()); - } - } - else if (path_array[0].asString() == LLSLURL::SLURL_APP_PATH) - { - LL_DEBUGS("SLURL") << "(inworldz|iw):///app" << LL_ENDL; - - // for app style slurls, where no grid name is specified, assume the currently - // selected or logged in grid. - mGrid = LLGridManager::getInstance()->getGridId(); - } - - if (mGrid.empty() && LLStartUp::getStartupState() == STATE_STARTED) - { - // we couldn't find the grid in the grid manager, so bail - LL_WARNS("SLURL")<<"unable to find grid"< or /app/, so it must be iw:// - // therefore the hostname will be the region name, and it's a location type - mType = LOCATION; - // 'normalize' it so the region name is in fact the head of the path_array - path_array.insert(0, slurl_uri.hostName()); - } - } else if((slurl_uri.scheme() == LLSLURL::SLURL_HTTP_SCHEME) || (slurl_uri.scheme() == LLSLURL::SLURL_HTTPS_SCHEME) || (slurl_uri.scheme() == LLSLURL::SLURL_X_GRID_LOCATION_INFO_SCHEME) @@ -309,13 +255,6 @@ LLSLURL::LLSLURL(const std::string& slurl) else mGrid = default_grid; } - // places.inworldz.com isn't your regular everyday slurl - else if (slurl_uri.hostName() == LLSLURL::PLACES_INWORLDZ_COM) - { - // likewise, places.inworldz.com implies inworldz and a location - mGrid = INWORLDZ_URI; - mType = LOCATION; - } else { LL_DEBUGS("SLURL") << "slurl style Standalone" << LL_ENDL; @@ -402,7 +341,7 @@ LLSLURL::LLSLURL(const std::string& slurl) LL_DEBUGS("SLURL") << "It's a location hop" << LL_ENDL; mType = LOCATION; } - else if (slurl_uri.hostName() != LLSLURL::PLACES_INWORLDZ_COM) + else { LL_DEBUGS("SLURL") << "Not a valid https/http/x-grid-location-info slurl " << slurl << LL_ENDL; // not a valid https/http/x-grid-location-info slurl, so it'll likely just be a URL @@ -530,29 +469,46 @@ LLSLURL::LLSLURL(const std::string& region, const LLVector3& position, bool hype *this = LLSLURL(LLGridManager::getInstance()->getGrid(), region, position); } +// FIRE-30768: SLURL's don't work in VarRegions // create a slurl from a global position -LLSLURL::LLSLURL(const std::string& grid, const std::string& region, const LLVector3d& global_position, bool hypergrid) -: mHypergrid(hypergrid) -{ +//LLSLURL::LLSLURL(const std::string& grid, const std::string& region, const LLVector3d& global_position, bool hypergrid) +//: mHypergrid(hypergrid) +//{ // Aurora-sim var region teleports //*this = LLSLURL(grid, // region, LLVector3(global_position.mdV[VX], // global_position.mdV[VY], // global_position.mdV[VZ])); - S32 x = ll_round( (F32)fmod( (F32)global_position.mdV[VX], (F32)REGION_WIDTH_METERS ) ); - S32 y = ll_round( (F32)fmod( (F32)global_position.mdV[VY], (F32)REGION_WIDTH_METERS ) ); - S32 z = ll_round( (F32)global_position.mdV[VZ] ); +// S32 x = ll_round( (F32)fmod( (F32)global_position.mdV[VX], (F32)REGION_WIDTH_METERS ) ); +// S32 y = ll_round( (F32)fmod( (F32)global_position.mdV[VY], (F32)REGION_WIDTH_METERS ) ); +// S32 z = ll_round( (F32)global_position.mdV[VZ] ); - *this = LLSLURL(grid, region, LLVector3(x, y, z)); +// *this = LLSLURL(grid, region, LLVector3(x, y, z)); // +//} +// +// create a slurl from a global position +//LLSLURL::LLSLURL(const std::string& region, const LLVector3d& global_position, bool hypergrid) +//: mHypergrid(hypergrid) +//{ +// *this = LLSLURL(LLGridManager::getInstance()->getGrid(), region, global_position); +//} + +// create a slurl from a global position +LLSLURL::LLSLURL(const std::string& grid, const std::string& region, const LLVector3d& region_origin, const LLVector3d& global_position, bool hypergrid) + : mHypergrid(hypergrid) +{ + LLVector3 local_position = LLVector3(global_position - region_origin); + *this = LLSLURL(grid, region, local_position); } // create a slurl from a global position -LLSLURL::LLSLURL(const std::string& region, const LLVector3d& global_position, bool hypergrid) -: mHypergrid(hypergrid) +LLSLURL::LLSLURL(const std::string& region, const LLVector3d& region_origin, const LLVector3d& global_position, bool hypergrid) + : mHypergrid(hypergrid) { - *this = LLSLURL(LLGridManager::getInstance()->getGrid(), region, global_position); + *this = LLSLURL(LLGridManager::getInstance()->getGrid(), region, region_origin, global_position); } +// LLSLURL::LLSLURL(const std::string& command, const LLUUID&id, const std::string& verb) : mHypergrid(false) diff --git a/indra/newview/fsslurl.h b/indra/newview/fsslurl.h index e01764190b..d299e3db09 100644 --- a/indra/newview/fsslurl.h +++ b/indra/newview/fsslurl.h @@ -52,11 +52,6 @@ public: static const char* SIM_LOCATION_LAST; static const char* SLURL_APP_PATH; static const char* SLURL_REGION_PATH; - - // Inworldz special - static const char* SLURL_INWORLDZ_SCHEME; - static const char* SLURL_IW_SCHEME; - static const char* PLACES_INWORLDZ_COM; enum SLURL_TYPE { @@ -73,8 +68,12 @@ public: LLSLURL(const std::string& grid, const std::string& region, bool hypergrid = false); LLSLURL(const std::string& region, const LLVector3& position, bool hypergrid = false); LLSLURL(const std::string& grid, const std::string& region, const LLVector3& position, bool hypergrid = false); - LLSLURL(const std::string& grid, const std::string& region, const LLVector3d& global_position, bool hypergrid = false); LLSLURL(const std::string& region, const LLVector3d& global_position, bool hypergrid = false); +// FIRE-30768: SLURL's don't work in VarRegions (patch from Oren) +// LLSLURL(const std::string& grid, const std::string& region, const LLVector3d& global_position, bool hypergrid = false); + LLSLURL(const std::string& grid, const std::string& region, const LLVector3d& region_origin, const LLVector3d& global_position, bool hypergrid = false); + LLSLURL(const std::string& region, const LLVector3d& region_origin, const LLVector3d& global_position, bool hypergrid = false); +// LLSLURL(const std::string& command, const LLUUID&id, const std::string& verb); LLSLURL(const LLSD& path_array, bool from_app); diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index d41e5ccb93..683dad312c 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -4606,7 +4606,19 @@ bool LLAgent::teleportBridgeLocal(LLVector3& pos_local) bool LLAgent::teleportBridgeGlobal(const LLVector3d& pos_global) { - U64 region_handle = to_region_handle(pos_global); + // FIRE-30534 VarRegion fixes + // U64 region_handle = to_region_handle(pos_global); + U64 region_handle{}; + auto regionp = getRegion(); + if(regionp) + { + region_handle = to_region_handle(pos_global, regionp->getOriginGlobal(), regionp->getWidth()); + } + else + { + region_handle = to_region_handle(pos_global); + } + // LLVector3 pos_local = (LLVector3)(pos_global - from_region_handle(region_handle)); return teleportBridgeLocal(pos_local); @@ -5084,23 +5096,83 @@ void LLAgent::doTeleportViaLocation(const LLVector3d& pos_global) { return; } + // FIRE-30534 Var Region tp / map locaton fixes +// U64 handle = to_region_handle(pos_global); +// bool isLocal = (regionp->getHandle() == to_region_handle_global((F32)pos_global.mdV[VX], (F32)pos_global.mdV[VY])); +// LLSimInfo* info = LLWorldMap::getInstance()->simInfoFromHandle(handle); +// if(regionp && info) +// { +// LLVector3d region_origin = info->getGlobalOrigin(); +// LLVector3 pos_local( +// (F32)(pos_global.mdV[VX] - region_origin.mdV[VX]), +// (F32)(pos_global.mdV[VY] - region_origin.mdV[VY]), +// (F32)(pos_global.mdV[VZ])); +// // Aurora-sim var region teleports +// //teleportRequest(handle, pos_local); +// teleportRequest(info->getHandle(), pos_local); +// // +// } +// else if(regionp && teleportCore(isLocal)) +// { +// // send the message +// LLMessageSystem* msg = gMessageSystem; +// msg->newMessageFast(_PREHASH_TeleportLocationRequest); +// msg->nextBlockFast(_PREHASH_AgentData); +// msg->addUUIDFast(_PREHASH_AgentID, getID()); +// msg->addUUIDFast(_PREHASH_SessionID, getSessionID()); - U64 handle = to_region_handle(pos_global); - bool isLocal = (regionp->getHandle() == to_region_handle_global((F32)pos_global.mdV[VX], (F32)pos_global.mdV[VY])); - LLSimInfo* info = LLWorldMap::getInstance()->simInfoFromHandle(handle); - if(regionp && info) +// msg->nextBlockFast(_PREHASH_Info); +// // FIRE-17262: Wrong local teleports on a large opensim region (apparently need to divide by grid unit size) +// F32 width = REGION_WIDTH_METERS;// regionp->getWidth(); +// LLVector3 pos(fmod((F32)pos_global.mdV[VX], width), +// fmod((F32)pos_global.mdV[VY], width), +// (F32)pos_global.mdV[VZ]); +// F32 region_x = (F32)(pos_global.mdV[VX]); +// F32 region_y = (F32)(pos_global.mdV[VY]); +// U64 region_handle = to_region_handle_global(region_x, region_y); +// msg->addU64Fast(_PREHASH_RegionHandle, region_handle); +// msg->addVector3Fast(_PREHASH_Position, pos); +// pos.mV[VX] += 1; +// msg->addVector3Fast(_PREHASH_LookAt, pos); + +// LL_WARNS("Teleport") << "Sending deprecated(?) TeleportLocationRequest." +// << " pos_global " << pos_global +// << " region_x " << region_x +// << " region_y " << region_y +// << " region_handle " << region_handle +// << LL_ENDL; + +// sendReliableMessage(); + auto region_origin { regionp->getOriginGlobal() }; + LLVector3 pos_local{}; + U64 handle { to_region_handle(pos_global, region_origin, regionp->getWidth()) }; + bool is_local { regionp->getHandle() == handle }; + if(is_local) { - LLVector3d region_origin = info->getGlobalOrigin(); - LLVector3 pos_local( + pos_local.set( (F32)(pos_global.mdV[VX] - region_origin.mdV[VX]), (F32)(pos_global.mdV[VY] - region_origin.mdV[VY]), (F32)(pos_global.mdV[VZ])); -// Aurora-sim var region teleports - //teleportRequest(handle, pos_local); - teleportRequest(info->getHandle(), pos_local); -// + LL_INFOS("Teleport") << "Local in-region TP:" + << " pos_global " << pos_global + << " region " << region_origin + << " local " << pos_local + << " region_handle " << handle + << LL_ENDL; } - else if(regionp && teleportCore(isLocal)) + else + { + // determine non-local region location as best we can using global coords + // In SL we have uniform region size. This is normal. + // In opensim the handle will resolve to a 256m quantised world tile which the server maps back to a region + // it "should" also compensate for the local coords. Handle has been "correctly" determined already so we use global % 256 + static const auto width{LLWorld::getInstance()->getRegionWidthInMeters()}; + pos_local.set( fmod((F32)pos_global.mdV[VX], width), + fmod((F32)pos_global.mdV[VY], width), + (F32)pos_global.mdV[VZ] ); + } + + if(teleportCore(is_local)) // Rather a pointless if as teleportCore currently always returns true { // send the message LLMessageSystem* msg = gMessageSystem; @@ -5110,30 +5182,23 @@ void LLAgent::doTeleportViaLocation(const LLVector3d& pos_global) msg->addUUIDFast(_PREHASH_SessionID, getSessionID()); msg->nextBlockFast(_PREHASH_Info); - // FIRE-17262: Wrong local teleports on a large opensim region (apparently need to divide by grid unit size) - F32 width = REGION_WIDTH_METERS;// regionp->getWidth(); - LLVector3 pos(fmod((F32)pos_global.mdV[VX], width), - fmod((F32)pos_global.mdV[VY], width), - (F32)pos_global.mdV[VZ]); - F32 region_x = (F32)(pos_global.mdV[VX]); - F32 region_y = (F32)(pos_global.mdV[VY]); - U64 region_handle = to_region_handle_global(region_x, region_y); - msg->addU64Fast(_PREHASH_RegionHandle, region_handle); - msg->addVector3Fast(_PREHASH_Position, pos); - pos.mV[VX] += 1; - msg->addVector3Fast(_PREHASH_LookAt, pos); - - LL_WARNS("Teleport") << "Sending deprecated(?) TeleportLocationRequest." - << " pos_global " << pos_global - << " region_x " << region_x - << " region_y " << region_y - << " region_handle " << region_handle - << LL_ENDL; + msg->addU64Fast(_PREHASH_RegionHandle, handle); + msg->addVector3Fast(_PREHASH_Position, pos_local); + pos_local.mV[VX] += 1; + msg->addVector3Fast(_PREHASH_LookAt, pos_local); sendReliableMessage(); + LL_INFOS("Teleport") << "Sending deprecated TeleportLocationRequest." + << " pos_global " << pos_global + << " region coord (" << (pos_global.mdV[VX] - pos_local.mV[VX]) + << "," << (pos_global.mdV[VY] - pos_local.mV[VY]) + << " pos_local " << pos_local + << ") region_handle " << handle + << LL_ENDL; + // } // Client LSL Bridge - if (FSLSLBridge::instance().canUseBridge() && isLocal) + if (FSLSLBridge::instance().canUseBridge() && is_local) { teleportBridgeGlobal(pos_global); } @@ -5174,6 +5239,37 @@ void LLAgent::teleportViaLocationLookAt(const LLVector3d& pos_global, const LLVe //} // [RLVa:KB] - Checked: RLVa-2.0.0 +// FIRE-30534 VarRegion TP fixes +// void LLAgent::doTeleportViaLocationLookAt(const LLVector3d& pos_global, const LLVector3& look_at) +// { +// mbTeleportKeepsLookAt = look_at.isExactlyZero(); + +// if(!gAgentCamera.isfollowCamLocked()) +// { +// gAgentCamera.setFocusOnAvatar(FALSE, ANIMATE); // detach camera form avatar, so it keeps direction +// } + +// U64 region_handle = to_region_handle(pos_global); +// // Aurora-sim var region teleports +// LLSimInfo* simInfo = LLWorldMap::instance().simInfoFromHandle(region_handle); +// if (simInfo) +// { +// region_handle = simInfo->getHandle(); +// } +// // +// LLVector3 pos_local = (LLVector3)(pos_global - from_region_handle(region_handle)); +// teleportRequest(region_handle, pos_local, look_at); + +// // Client LSL Bridge +// if (FSLSLBridge::instance().canUseBridge()) +// { +// if (region_handle == to_region_handle(getPositionGlobal())) +// { +// teleportBridgeLocal(pos_local); +// } +// } +// // +// } void LLAgent::doTeleportViaLocationLookAt(const LLVector3d& pos_global, const LLVector3& look_at) { mbTeleportKeepsLookAt = look_at.isExactlyZero(); @@ -5183,28 +5279,34 @@ void LLAgent::doTeleportViaLocationLookAt(const LLVector3d& pos_global, const LL gAgentCamera.setFocusOnAvatar(FALSE, ANIMATE); // detach camera form avatar, so it keeps direction } - U64 region_handle = to_region_handle(pos_global); -// Aurora-sim var region teleports - LLSimInfo* simInfo = LLWorldMap::instance().simInfoFromHandle(region_handle); - if (simInfo) + U64 region_handle{}; + auto regionp = getRegion(); + if(regionp) { - region_handle = simInfo->getHandle(); + region_handle = to_region_handle(pos_global, regionp->getOriginGlobal(), regionp->getWidth()); } -// - LLVector3 pos_local = (LLVector3)(pos_global - from_region_handle(region_handle)); - teleportRequest(region_handle, pos_local, look_at); + else + { + region_handle = to_region_handle(pos_global); + } +// Beq Note: if region_handle was obtained to the nearest 256m tile map lookup might give us a better result. + + LLVector3 pos_within_target_region = (LLVector3)(pos_global - from_region_handle(region_handle)); + teleportRequest(region_handle, pos_within_target_region, look_at); // Client LSL Bridge - if (FSLSLBridge::instance().canUseBridge()) + if ( FSLSLBridge::instance().canUseBridge() ) { - if (region_handle == to_region_handle(getPositionGlobal())) + // refresh regionp + regionp = getRegion(); + if( regionp && ( region_handle == regionp->getHandle() ) ) { - teleportBridgeLocal(pos_local); + teleportBridgeLocal(pos_within_target_region); } } // } - +// LLAgent::ETeleportState LLAgent::getTeleportState() const { return (mTeleportRequest && (mTeleportRequest->getStatus() == LLTeleportRequest::kFailed)) ? diff --git a/indra/newview/llagentui.cpp b/indra/newview/llagentui.cpp index 065087cea6..d8541bf9d3 100644 --- a/indra/newview/llagentui.cpp +++ b/indra/newview/llagentui.cpp @@ -72,7 +72,10 @@ void LLAgentUI::buildSLURL(LLSLURL& slurl, const bool escaped /*= true*/) else #endif // - return_slurl = LLSLURL(regionp->getName(), gAgent.getPositionGlobal()); + // FIRE-30768: SLURL's don't work in VarRegions + //return_slurl = LLSLURL(regionp->getName(), gAgent.getPositionGlobal()); + return_slurl = LLSLURL(regionp->getName(), regionp->getOriginGlobal(), gAgent.getPositionGlobal()); + // } slurl = return_slurl; } diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 4b460da8bc..0a5eb3ce6f 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -735,6 +735,7 @@ LLAppViewer* LLAppViewer::sInstance = NULL; LLTextureCache* LLAppViewer::sTextureCache = NULL; LLImageDecodeThread* LLAppViewer::sImageDecodeThread = NULL; LLTextureFetch* LLAppViewer::sTextureFetch = NULL; +FSPurgeDiskCacheThread* LLAppViewer::sPurgeDiskCacheThread = NULL; // Regular disk cache cleanup std::string getRuntime() { @@ -2442,6 +2443,7 @@ bool LLAppViewer::cleanup() sTextureFetch->shutdown(); sTextureCache->shutdown(); sImageDecodeThread->shutdown(); + sPurgeDiskCacheThread->shutdown(); // Regular disk cache cleanup sTextureFetch->shutDownTextureCacheThread() ; sTextureFetch->shutDownImageDecodeThread() ; @@ -2464,6 +2466,10 @@ bool LLAppViewer::cleanup() sImageDecodeThread = NULL; delete mFastTimerLogThread; mFastTimerLogThread = NULL; + // Regular disk cache cleanup + delete sPurgeDiskCacheThread; + sPurgeDiskCacheThread = NULL; + // if (LLFastTimerView::sAnalyzePerformance) { @@ -2577,13 +2583,18 @@ bool LLAppViewer::initThreads() LLLFSThread::initClass(enable_threads && false); + // Image thread pool from CoolVL + U32 imageThreads = gSavedSettings.getU32("FSImageDecodeThreads"); + // + // Image decoding - LLAppViewer::sImageDecodeThread = new LLImageDecodeThread(enable_threads && true); + LLAppViewer::sImageDecodeThread = new LLImageDecodeThread(enable_threads && true, imageThreads); LLAppViewer::sTextureCache = new LLTextureCache(enable_threads && true); LLAppViewer::sTextureFetch = new LLTextureFetch(LLAppViewer::getTextureCache(), sImageDecodeThread, enable_threads && true, app_metrics_qa_mode); + LLAppViewer::sPurgeDiskCacheThread = new FSPurgeDiskCacheThread(); // Regular disk cache cleanup if (LLTrace::BlockTimer::sLog || LLTrace::BlockTimer::sMetricLog) { @@ -4959,11 +4970,16 @@ bool LLAppViewer::initCache() // note that the maximum size of this cache is defined as a percentage of the // total cache size - the 'CacheSize' pref - for all caches. - const unsigned int cache_total_size_mb = gSavedSettings.getU32("CacheSize"); - const double disk_cache_percent = gSavedSettings.getF32("DiskCachePercentOfTotal"); - const unsigned int disk_cache_mb = cache_total_size_mb * disk_cache_percent / 100; - const unsigned int disk_cache_bytes = disk_cache_mb * 1024 * 1024; - const bool enable_cache_debug_info = gSavedSettings.getBOOL("EnableCacheDebugInfo"); + // Better asset cache size control + //const unsigned int cache_total_size_mb = gSavedSettings.getU32("CacheSize"); + //const double disk_cache_percent = gSavedSettings.getF32("DiskCachePercentOfTotal"); + //const unsigned int disk_cache_mb = cache_total_size_mb * disk_cache_percent / 100; + const unsigned int disk_cache_mb = gSavedSettings.getU32("FSDiskCacheSize"); + // + // Fix integer overflow + //const unsigned int disk_cache_bytes = disk_cache_mb * 1024 * 1024; + const uintmax_t disk_cache_bytes = disk_cache_mb * 1024 * 1024; + const bool enable_cache_debug_info = gSavedSettings.getBOOL("EnableDiskCacheDebugInfo"); bool texture_cache_mismatch = false; if (gSavedSettings.getS32("LocalCacheVersion") != LLAppViewer::getTextureCacheVersion()) @@ -5053,6 +5069,8 @@ bool LLAppViewer::initCache() LLDiskCache::getInstance()->purge(); } } + // Regular disk cache cleanup + LLAppViewer::getPurgeDiskCacheThread()->start(); // FIRE-13066 if (mPurgeTextures && !read_only) diff --git a/indra/newview/llappviewer.h b/indra/newview/llappviewer.h index 2d17c882bc..ae783c60cb 100644 --- a/indra/newview/llappviewer.h +++ b/indra/newview/llappviewer.h @@ -59,6 +59,7 @@ class LLTextureFetch; class LLWatchdogTimeout; class LLViewerJoystick; class LLViewerRegion; +class FSPurgeDiskCacheThread; // Regular disk cache cleanup extern LLTrace::BlockTimerStatHandle FTM_FRAME; @@ -118,6 +119,7 @@ public: static LLTextureCache* getTextureCache() { return sTextureCache; } static LLImageDecodeThread* getImageDecodeThread() { return sImageDecodeThread; } static LLTextureFetch* getTextureFetch() { return sTextureFetch; } + static FSPurgeDiskCacheThread* getPurgeDiskCacheThread() { return sPurgeDiskCacheThread; } // Regular disk cache cleanup static U32 getTextureCacheVersion() ; static U32 getObjectCacheVersion() ; @@ -306,6 +308,7 @@ private: static LLTextureCache* sTextureCache; static LLImageDecodeThread* sImageDecodeThread; static LLTextureFetch* sTextureFetch; + static FSPurgeDiskCacheThread* sPurgeDiskCacheThread; // Regular disk cache cleanup S32 mNumSessions; diff --git a/indra/newview/llfloaterexperienceprofile.cpp b/indra/newview/llfloaterexperienceprofile.cpp index 1897b2e81a..33bf76ee21 100644 --- a/indra/newview/llfloaterexperienceprofile.cpp +++ b/indra/newview/llfloaterexperienceprofile.cpp @@ -693,7 +693,10 @@ void LLFloaterExperienceProfile::onClickLocation() if(region) { LLTextBox* child = getChild(EDIT TF_SLURL); - mLocationSLURL = LLSLURL(region->getName(), gAgent.getPositionGlobal()).getSLURLString(); + // FIRE-30768: SLURL's don't work in VarRegions (Patch from Oren) + //mLocationSLURL = LLSLURL(region->getName(), gAgent.getPositionGlobal()).getSLURLString(); + mLocationSLURL = LLSLURL(region->getName(), region->getOriginGlobal(), gAgent.getPositionGlobal()).getSLURLString(); + // child->setText(mLocationSLURL); onFieldChanged(); } diff --git a/indra/newview/llfloaterjoystick.cpp b/indra/newview/llfloaterjoystick.cpp index 48913cc91e..ebc9e2be22 100644 --- a/indra/newview/llfloaterjoystick.cpp +++ b/indra/newview/llfloaterjoystick.cpp @@ -45,6 +45,11 @@ #include "llcheckboxctrl.h" #include "llcombobox.h" +// FIRE-14344 - Add button preview and allow for more than 6 axes +#include "llspinctrl.h" +#include "lliconctrl.h" +// + #if LL_WINDOWS && !LL_MESA_HEADLESS // Require DirectInput version 8 #define DIRECTINPUT_VERSION 0x0800 @@ -52,18 +57,20 @@ #include #endif -// FIRE-14344 - show joystick buttons -const std::string JOYSTICK_BUTTON_ON ( "\xE2\xAC\xA4" ); // U+2B24 BLACK LARGE CIRCLE -const std::string JOYSTICK_BUTTON_OFF( "\xE2\x97\xAF" ); // U+25EF WHITE LARGE CIRCLE -// - static LLTrace::SampleStatHandle<> sJoystickAxis0("Joystick axis 0"), sJoystickAxis1("Joystick axis 1"), sJoystickAxis2("Joystick axis 2"), sJoystickAxis3("Joystick axis 3"), sJoystickAxis4("Joystick axis 4"), - sJoystickAxis5("Joystick axis 5"); -static LLTrace::SampleStatHandle<>* sJoystickAxes[6] = +// FIRE-14344 - Add button preview and allow for more than 6 axes +// sJoystickAxis5("Joystick axis 5"); +// static LLTrace::SampleStatHandle<>* sJoystickAxes[6] = + sJoystickAxis5("Joystick axis 5"), + sJoystickAxis6("Joystick axis 6"), + sJoystickAxis7("Joystick axis 7"); + +static LLTrace::SampleStatHandle<>* sJoystickAxes[MAX_JOYSTICK_AXES] = +// { &sJoystickAxis0, &sJoystickAxis1, @@ -71,6 +78,11 @@ static LLTrace::SampleStatHandle<>* sJoystickAxes[6] = &sJoystickAxis3, &sJoystickAxis4, &sJoystickAxis5 +// FIRE-14344 - Add button preview and allow for more than 6 axes + , + &sJoystickAxis6, + &sJoystickAxis7 +// }; #if LL_WINDOWS && !LL_MESA_HEADLESS @@ -100,6 +112,12 @@ LLFloaterJoystick::LLFloaterJoystick(const LLSD& data) : LLFloater(data), mHasDeviceList(false) { + // FIRE-14344 - Add button preview and allow for more than 6 axes + mAxisStatsBar = new LLStatBar*[MAX_JOYSTICK_AXES]; + mAxisViews = new LLStatView*[MAX_JOYSTICK_AXES]; + mButtonsLights = new LLIconCtrl*[MAX_JOYSTICK_BUTTONS]; + // + if (!LLViewerJoystick::getInstance()->isJoystickInitialized()) { LLViewerJoystick::getInstance()->init(false); @@ -125,7 +143,9 @@ void LLFloaterJoystick::draw() } // - for (U32 i = 0; i < 6; i++) + // FIRE-14344 - Add button preview and allow for more than 6 axes + // for (U32 i = 0; i < 6; i++) + for (U32 i = 0; i < joystick->getNumOfJoystickAxes(); i++) { F32 value = joystick->getJoystickAxis(i); // FIRE-14344 - using the frame interval seems to break the graphs @@ -143,21 +163,19 @@ void LLFloaterJoystick::draw() } } - // FIRE-14344 - show joystick buttons - std::string buttons; - for (U32 i = 0; i < 16; i++) + // FIRE-14344 - Add button preview and allow for more than 6 axes + if (mJoystickEnabled) { - U32 value = joystick->getJoystickButton(i); - if (value == 0) + // dim = button present but not pushed, white = button currently pushed + const LLColor4& bright = LLUIColorTable::instance().getColor("White").get(); + const LLColor4& dim = LLUIColorTable::instance().getColor("Gray").get(); + + for (U32 i = 0; i < joystick->getNumOfJoystickButtons(); i++) { - buttons += JOYSTICK_BUTTON_OFF; - } - else - { - buttons += JOYSTICK_BUTTON_ON; + U32 value = joystick->getJoystickButton(i); + mButtonsLights[i]->setColor(value ? bright : dim); } } - mJoystickButtons->setText(buttons); // LLFloater::draw(); @@ -168,12 +186,14 @@ BOOL LLFloaterJoystick::postBuild() center(); // Micro Save on calls to gSavedSettings //F32 range = gSavedSettings.getBOOL("Cursor3D") ? 128.f : 2.f; - // FIRE-14344 - use 1.f for the graph ranges instead of 128.f : 2.f to get better resolution - + // FIRE-14344 - use 0.5f for the graph ranges instead of 128.f : 2.f to get better autoscaling - // needs testing with an actual absolute pointer device if the range scales in a useful way when // not starting at 128.f - F32 range = 1.f; + F32 range = 0.5f; - for (U32 i = 0; i < 6; i++) + // FIRE-14344 - Add button preview and allow for more than 6 axes + // for (U32 i = 0; i < 6; i++) + for (U32 i = 0; i < MAX_JOYSTICK_AXES; i++) { std::string stat_name(llformat("Joystick axis %d", i)); std::string axisname = llformat("axis%d", i); @@ -183,8 +203,23 @@ BOOL LLFloaterJoystick::postBuild() mAxisStatsBar[i]->setStat(stat_name); mAxisStatsBar[i]->setRange(-range, range); } + // FIRE-14344 - cache axis view widgets for faster lookup later + mAxisViews[i] = getChild(llformat("axis_view_%d", i)); + + // set number of axes on spinners + LLSpinCtrl* spin; + spin = getChild(llformat("JoystickAxis%d", i)); + spin->setMaxValue(MAX_JOYSTICK_AXES - 1); + // } - + + // FIRE-14344 - Add button preview and allow for more than 6 axes + for (U32 i = 0; i < MAX_JOYSTICK_BUTTONS; i++) + { + mButtonsLights[i] = getChild(llformat("button_light_%d", i)); + } + // + mJoysticksCombo = getChild("joystick_combo"); childSetCommitCallback("joystick_combo",onCommitJoystickEnabled,this); mCheckFlycamEnabled = getChild("JoystickFlycamEnabled"); @@ -194,17 +229,20 @@ BOOL LLFloaterJoystick::postBuild() childSetAction("cancel_btn", onClickCancel, this); childSetAction("ok_btn", onClickOK, this); - // FIRE-14344 - show joystick buttons - mJoystickButtons = getChild("joystick_buttons"); - refresh(); refreshListOfDevices(); + updateAxesAndButtons(); // FIRE-14344 - Add button preview and allow for more than 6 axes return TRUE; } LLFloaterJoystick::~LLFloaterJoystick() { // Children all cleaned up by default view destructor. + + // FIRE-14344 - Add button preview and allow for more than 6 axes + delete[] mAxisStatsBar; + delete[] mButtonsLights; + delete[] mAxisViews; } @@ -462,6 +500,11 @@ void LLFloaterJoystick::onCommitJoystickEnabled(LLUICtrl*, void *joy_panel) LL_DEBUGS("Joystick") << "Selected " << device_id << " as joystick." << LL_ENDL; self->refreshListOfDevices(); + + // FIRE-14344 - Add button preview and allow for more than 6 axes + self->mJoystickEnabled = joystick_enabled; + self->updateAxesAndButtons(); + // } void LLFloaterJoystick::onClickRestoreSNDefaults(void *joy_panel) @@ -514,3 +557,32 @@ void LLFloaterJoystick::onClose(bool app_quitting) cancel(); } } + +// FIRE-14344 - Add button preview and allow for more than 6 axes +void LLFloaterJoystick::updateAxesAndButtons() +{ + U8 axes = 0; + U8 buttons = 0; + + if(mJoystickEnabled) + { + axes = LLViewerJoystick::getInstance()->getNumOfJoystickAxes(); + buttons = LLViewerJoystick::getInstance()->getNumOfJoystickButtons(); + } + + for(U8 i = 0; i < MAX_JOYSTICK_AXES; i++) + { + mAxisViews[i]->setDisplayChildren(i < axes); + mAxisViews[i]->reshape(0, 0, false); + } + + // dim = button present but not pushed, dark = button not present on this joystick + static const LLColor4& dark = LLUIColorTable::instance().getColor("DkGray").get(); + static const LLColor4& dim = LLUIColorTable::instance().getColor("Gray").get(); + + for(U8 i = 0; i < MAX_JOYSTICK_BUTTONS; i++) + { + mButtonsLights[i]->setColor(i < buttons ? dim : dark); + } +} +// diff --git a/indra/newview/llfloaterjoystick.h b/indra/newview/llfloaterjoystick.h index 5bda3a0b1e..e4fc7d92c5 100644 --- a/indra/newview/llfloaterjoystick.h +++ b/indra/newview/llfloaterjoystick.h @@ -32,6 +32,10 @@ class LLCheckBoxCtrl; class LLComboBox; +// FIRE-14344 - Add button preview and allow for more than 6 axes +class LLIconCtrl; +class LLStatView; +// class LLFloaterJoystick : public LLFloater { @@ -54,6 +58,8 @@ protected: void onClose(bool app_quitting); void onClickCloseBtn(bool app_quitting); + // FIRE-14344 - Add button preview and allow for more than 6 axes + void updateAxesAndButtons(); private: LLFloaterJoystick(const LLSD& data); @@ -96,10 +102,12 @@ private: bool mHasDeviceList; // stats view - LLStatBar* mAxisStatsBar[6]; - - // FIRE-14344 - show joystick buttons - LLTextBase* mJoystickButtons; + // FIRE-14344 - Add button preview and allow for more than 6 axes + // LLStatBar* mAxisStatsBar[6]; + LLStatBar** mAxisStatsBar; + LLIconCtrl** mButtonsLights; + LLStatView** mAxisViews; + // }; #endif diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index f24c047c25..9f34b59bf6 100644 --- a/indra/newview/llfloatermodelpreview.cpp +++ b/indra/newview/llfloatermodelpreview.cpp @@ -866,7 +866,9 @@ void LLFloaterModelPreview::draw() { if ( mModelPreview->getLoadState() == LLModelLoader::ERROR_MATERIALS ) { - childSetTextArg("status", "[STATUS]", getString("status_material_mismatch")); + // cleanup/improve errors - this error is effectively duplicated, the unused one was actually better + // childSetTextArg("status", "[STATUS]", getString("status_material_mismatch")); + childSetTextArg("status", "[STATUS]", getString("mesh_status_invalid_material_list")); } else if ( mModelPreview->getLoadState() > LLModelLoader::ERROR_MODEL ) @@ -879,6 +881,13 @@ void LLFloaterModelPreview::draw() childSetTextArg("status", "[STATUS]", getString("status_parse_error")); toggleCalculateButton(false); } + // improve error reporting + else + if ( mModelPreview->getLoadState() == LLModelLoader::ERROR_LOD_MODEL_MISMATCH ) + { + childSetTextArg("status", "[STATUS]", getString("status_lod_model_mismatch")); + toggleCalculateButton(false); + } else if (mModelPreview->getLoadState() == LLModelLoader::WARNING_BIND_SHAPE_ORIENTATION) { @@ -1130,8 +1139,21 @@ void LLFloaterModelPreview::onPhysicsUseLOD(LLUICtrl* ctrl, void* userdata) S32 file_mode = iface->getItemCount() - 1; if (which_mode < file_mode) { - S32 which_lod = num_lods - which_mode; - sInstance->mModelPreview->setPhysicsFromLOD(which_lod); + // FIRE-30963 Support pre-defined physics shapes (initially cube) + // S32 which_lod = num_lods - which_mode; + // sInstance->mModelPreview->setPhysicsFromLOD(which_lod); + if(which_mode >= num_lods) + { + // which_mode is between the last LOD entry and file selection + // so it is a preset + sInstance->mModelPreview->setPhysicsFromPreset(which_mode-num_lods); + } + else + { + S32 which_lod = num_lods - which_mode; + sInstance->mModelPreview->setPhysicsFromLOD(which_lod); + } + // } LLModelPreview *model_preview = sInstance->mModelPreview; @@ -1738,7 +1760,7 @@ void LLFloaterModelPreview::setCtrlLoadFromFile(S32 lod) LLComboBox* lod_combo = findChild("physics_lod_combo"); if (lod_combo) { - lod_combo->setCurrentByIndex(5); + lod_combo->setCurrentByIndex(lod_combo->getItemCount() - 1); // FIRE-30963 - better physics defaults } } else diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index d908a30123..1be3bfd471 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -6377,7 +6377,9 @@ static LLPanelInjector t_pref_opensim("panel_preferenc #ifdef OPENSIM LLPanelPreferenceOpensim::LLPanelPreferenceOpensim() : LLPanelPreference(), - mGridListControl(NULL) + mGridListControl(NULL), + mGridListChangedCallbackConnection(), + mGridAddedCallbackConnection() { mCommitCallbackRegistrar.add("Pref.ClearDebugSearchURL", boost::bind(&LLPanelPreferenceOpensim::onClickClearDebugSearchURL, this)); mCommitCallbackRegistrar.add("Pref.PickDebugSearchURL", boost::bind(&LLPanelPreferenceOpensim::onClickPickDebugSearchURL, this)); @@ -6385,7 +6387,21 @@ LLPanelPreferenceOpensim::LLPanelPreferenceOpensim() : LLPanelPreference(), mCommitCallbackRegistrar.add("Pref.ClearGrid", boost::bind(&LLPanelPreferenceOpensim::onClickClearGrid, this)); mCommitCallbackRegistrar.add("Pref.RefreshGrid", boost::bind( &LLPanelPreferenceOpensim::onClickRefreshGrid, this)); mCommitCallbackRegistrar.add("Pref.RemoveGrid", boost::bind( &LLPanelPreferenceOpensim::onClickRemoveGrid, this)); - mCommitCallbackRegistrar.add("Pref.SaveGrid", boost::bind(&LLPanelPreferenceOpensim::onClickSaveGrid, this)); +} + +LLPanelPreferenceOpensim::~LLPanelPreferenceOpensim() +{ +#ifdef OPENSIM + if (mGridListChangedCallbackConnection.connected()) + { + mGridListChangedCallbackConnection.disconnect(); + } + + if (mGridAddedCallbackConnection.connected()) + { + mGridAddedCallbackConnection.disconnect(); + } +#endif } BOOL LLPanelPreferenceOpensim::postBuild() @@ -6402,17 +6418,34 @@ BOOL LLPanelPreferenceOpensim::postBuild() mEditorGridMessage = findChild("message_edit"); mGridListControl = getChild("grid_list"); mGridListControl->setCommitCallback(boost::bind(&LLPanelPreferenceOpensim::onSelectGrid, this)); + mGridListChangedCallbackConnection = LLGridManager::getInstance()->addGridListChangedCallback(boost::bind(&LLPanelPreferenceOpensim::refreshGridList, this, _1)); refreshGridList(); return LLPanelPreference::postBuild(); } +void LLPanelPreferenceOpensim::onOpen(const LLSD& key) +{ + mCurrentGrid = LLGridManager::getInstance()->getGrid(); + + mEditorGridName->clear(); + mEditorGridURI->clear(); + mEditorLoginPage->clear(); + mEditorHelperURI->clear(); + mEditorWebsite->clear(); + mEditorSupport->clear(); + mEditorRegister->clear(); + mEditorPassword->clear(); + mEditorSearch->clear(); + mEditorGridMessage->clear(); +} + void LLPanelPreferenceOpensim::onSelectGrid() { - LLSD grid_info; + LLSD grid_info; std::string grid = mGridListControl->getSelectedValue(); LLGridManager::getInstance()->getGridData(grid, grid_info); - + mEditorGridName->setText(grid_info[GRID_LABEL_VALUE].asString()); mEditorGridURI->setText(grid_info[GRID_LOGIN_URI_VALUE][0].asString()); mEditorLoginPage->setText(grid_info[GRID_LOGIN_PAGE_VALUE].asString()); @@ -6434,17 +6467,21 @@ void LLPanelPreferenceOpensim::apply() void LLPanelPreferenceOpensim::cancel() { LLGridManager::getInstance()->resetGrids(); + LLGridManager::getInstance()->setGridChoice(mCurrentGrid); FSPanelLogin::updateServer(); } void LLPanelPreferenceOpensim::onClickAddGrid() { - - std::string new_grid = gSavedSettings.getString("OpensimPrefsAddGrid"); + std::string new_grid = getChild("add_grid")->getText(); if (!new_grid.empty()) { getChild("grid_management_panel")->setEnabled(FALSE); + if (mGridAddedCallbackConnection.connected()) + { + mGridAddedCallbackConnection.disconnect(); + } LLGridManager::getInstance()->addGridListChangedCallback(boost::bind(&LLPanelPreferenceOpensim::addedGrid, this, _1)); LLGridManager::getInstance()->addGrid(new_grid); } @@ -6452,52 +6489,40 @@ void LLPanelPreferenceOpensim::onClickAddGrid() void LLPanelPreferenceOpensim::addedGrid(bool success) { + if (mGridAddedCallbackConnection.connected()) + { + mGridAddedCallbackConnection.disconnect(); + } + if (success) { + const std::string& new_grid = getChild("add_grid")->getText(); + + for (auto row : mGridListControl->getAllData()) + { + if (new_grid.find(row->getColumn(1)->getValue().asString()) != std::string::npos) + { + row->setSelected(TRUE); + mGridListControl->scrollToShowSelected(); + onSelectGrid(); + break; + } + } + onClickClearGrid(); } - refreshGridList(success); -} - -// TODO: Save changes to grid entries -void LLPanelPreferenceOpensim::onClickSaveGrid() -{ - LLSD grid_info; - grid_info[GRID_VALUE] = mGridListControl->getSelectedValue(); - grid_info[GRID_LABEL_VALUE] = mEditorGridName->getValue(); - grid_info[GRID_LOGIN_URI_VALUE][0] = mEditorGridURI->getValue(); - grid_info[GRID_LOGIN_PAGE_VALUE] = mEditorLoginPage->getValue(); - grid_info[GRID_HELPER_URI_VALUE] = mEditorHelperURI->getValue(); - grid_info["about"] = mEditorWebsite->getValue(); - grid_info["help"] = mEditorSupport->getValue(); - grid_info[GRID_REGISTER_NEW_ACCOUNT] = mEditorRegister->getValue(); - grid_info[GRID_FORGOT_PASSWORD] = mEditorPassword->getValue(); - grid_info["search"] = mEditorSearch->getValue(); - grid_info["message"] = mEditorGridMessage->getValue(); - - // GridEntry* grid_entry = new GridEntry; - // grid_entry->grid = grid_info; - // grid_entry->set_current = false; - - //getChild("grid_management_panel")->setEnabled(FALSE); - //LLGridManager::getInstance()->addGridListChangedCallback(boost::bind(&LLPanelPreferenceOpensim::addedGrid, this, _1)); - //LLGridManager::getInstance()->addGrid(grid_entry, LLGridManager::MANUAL); } void LLPanelPreferenceOpensim::onClickClearGrid() { - gSavedSettings.setString("OpensimPrefsAddGrid", std::string()); + getChild("add_grid")->clear(); } void LLPanelPreferenceOpensim::onClickRefreshGrid() { std::string grid = mGridListControl->getSelectedValue(); getChild("grid_management_panel")->setEnabled(FALSE); - LLGridManager::getInstance()->addGridListChangedCallback(boost::bind(&LLPanelPreferenceOpensim::refreshGridList, this, _1)); - // FIRE-13223 grid info refresh does not update properly when applied to currently active grid - // LLGridManager::getInstance()->reFetchGrid(grid); LLGridManager::getInstance()->reFetchGrid(grid, (grid == LLGridManager::getInstance()->getGrid()) ); - // } void LLPanelPreferenceOpensim::onClickRemoveGrid() @@ -6525,8 +6550,18 @@ bool LLPanelPreferenceOpensim::removeGridCB(const LLSD& notification, const LLSD { std::string grid = notification["payload"].asString(); getChild("grid_management_panel")->setEnabled(FALSE); - /*mGridListChanged =*/ LLGridManager::getInstance()->addGridListChangedCallback(boost::bind(&LLPanelPreferenceOpensim::refreshGridList, this, _1)); + mEditorGridName->clear(); + mEditorGridURI->clear(); + mEditorLoginPage->clear(); + mEditorHelperURI->clear(); + mEditorWebsite->clear(); + mEditorSupport->clear(); + mEditorRegister->clear(); + mEditorPassword->clear(); + mEditorSearch->clear(); + mEditorGridMessage->clear(); LLGridManager::getInstance()->removeGrid(grid); + FSPanelLogin::updateServer(); } return false; } @@ -6601,7 +6636,6 @@ LLPanelPreferenceOpensim::LLPanelPreferenceOpensim() : LLPanelPreference() mCommitCallbackRegistrar.add("Pref.ClearGrid", boost::bind(&no_cb)); mCommitCallbackRegistrar.add("Pref.RefreshGrid", boost::bind(&no_cb)); mCommitCallbackRegistrar.add("Pref.RemoveGrid", boost::bind(&no_cb)); - mCommitCallbackRegistrar.add("Pref.SaveGrid", boost::bind(&no_cb)); } #endif // diff --git a/indra/newview/llfloaterpreference.h b/indra/newview/llfloaterpreference.h index 00591c6692..5722332a13 100644 --- a/indra/newview/llfloaterpreference.h +++ b/indra/newview/llfloaterpreference.h @@ -589,33 +589,36 @@ private: // class LLPanelPreferenceOpensim : public LLPanelPreference { + LOG_CLASS(LLPanelPreferenceOpensim); + public: LLPanelPreferenceOpensim(); + ~LLPanelPreferenceOpensim(); #ifdef OPENSIM -// - /*virtual*/ BOOL postBuild(); /*virtual*/ void apply(); /*virtual*/ void cancel(); protected: + boost::signals2::connection mGridListChangedCallbackConnection; + boost::signals2::connection mGridAddedCallbackConnection; + + void onOpen(const LLSD& key); + /*virtual*/ BOOL postBuild(); void onClickAddGrid(); void addedGrid(bool success); void onClickClearGrid(); void onClickRefreshGrid(); - void onClickSaveGrid(); void onClickRemoveGrid(); void onSelectGrid(); bool removeGridCB(const LLSD& notification, const LLSD& response); -// -// void onClickClearDebugSearchURL(); void onClickPickDebugSearchURL(); -// void refreshGridList(bool success = true); LLScrollListCtrl* mGridListControl; + private: LLLineEditor* mEditorGridName; LLLineEditor* mEditorGridURI; @@ -627,9 +630,9 @@ private: LLLineEditor* mEditorPassword; LLLineEditor* mEditorSearch; LLLineEditor* mEditorGridMessage; -#endif - LOG_CLASS(LLPanelPreferenceOpensim); + std::string mCurrentGrid; +#endif }; // diff --git a/indra/newview/llfloaterworldmap.cpp b/indra/newview/llfloaterworldmap.cpp index 2a2887c257..b410be19a1 100644 --- a/indra/newview/llfloaterworldmap.cpp +++ b/indra/newview/llfloaterworldmap.cpp @@ -713,10 +713,16 @@ void LLFloaterWorldMap::requestParcelInfo(const LLVector3d& pos_global) { return; } - - LLVector3 pos_region((F32)fmod(pos_global.mdV[VX], (F64)REGION_WIDTH_METERS), - (F32)fmod(pos_global.mdV[VY], (F64)REGION_WIDTH_METERS), - (F32)pos_global.mdV[VZ]); + // VarRegion slurl shenanigans + // agent_x = ll_round(region_pos.mV[VX]); + // agent_y = ll_round(region_pos.mV[VY]); + // agent_z = ll_round(region_pos.mV[VZ]); + // LLVector3 pos_region((F32)fmod(pos_global.mdV[VX], (F64)REGION_WIDTH_METERS), + // (F32)fmod(pos_global.mdV[VY], (F64)REGION_WIDTH_METERS), + // (F32)pos_global.mdV[VZ]); + auto region_origin = region->getOriginGlobal(); + auto pos_region = LLVector3(pos_global - region_origin); + // LLSD body; std::string url = region->getCapability("RemoteParcelRequest"); @@ -1022,7 +1028,12 @@ void LLFloaterWorldMap::updateLocation() return; // invalid location } std::string sim_name; - gotSimName = LLWorldMap::getInstance()->simNameFromPosGlobal( pos_global, sim_name ); + // FIRE-30768: SLURL's don't work in VarRegions + //gotSimName = LLWorldMap::getInstance()->simNameFromPosGlobal( pos_global, sim_name ); + LLSimInfo* sim_info = LLWorldMap::getInstance()->simInfoFromPosGlobal(pos_global); + if (sim_info) + sim_name = sim_info->getName(); + // if ((status != LLTracker::TRACKING_NOTHING) && (status != mTrackedStatus || pos_global != mTrackedLocation || sim_name != mTrackedSimName)) { @@ -1055,12 +1066,16 @@ void LLFloaterWorldMap::updateLocation() childSetValue("location", RlvStrings::getString(RlvStringKeys::Hidden::Region)); } - else if (gotSimName) +// FORE-30768 Slurls in Var regions are b0rked + // else if (gotSimName) + else if (sim_info) // [/RLVa:KB] // if ( gotSimName ) { - mSLURL = LLSLURL(sim_name, pos_global); + // mSLURL = LLSLURL(sim_name, pos_global); + mSLURL = LLSLURL(sim_info->getName(), sim_info->getGlobalOrigin(), pos_global); } +// else { // Empty SLURL will disable the "Copy SLURL to clipboard" button mSLURL = LLSLURL(); diff --git a/indra/newview/lllandmarkactions.cpp b/indra/newview/lllandmarkactions.cpp index 4e3f511afc..436b25ffe4 100644 --- a/indra/newview/lllandmarkactions.cpp +++ b/indra/newview/lllandmarkactions.cpp @@ -286,22 +286,78 @@ void LLLandmarkActions::createLandmarkHere() createLandmarkHere(landmark_name, landmark_desc, folder_id); } - -void LLLandmarkActions::getSLURLfromPosGlobal(const LLVector3d& global_pos, slurl_callback_t cb, bool escaped /* = true */) +// FIRE-30534 - changes related to var regions in opensim +void LLLandmarkActions::getSLURLfromPosGlobalAndLocal(const LLVector3d& global_pos, const LLVector3& region_pos, slurl_callback_t cb, bool escaped /* = true */) { std::string sim_name; - bool gotSimName = LLWorldMap::getInstance()->simNameFromPosGlobal(global_pos, sim_name); + LLVector3d tmp_global_pos{global_pos}; + tmp_global_pos.mdV[VX] -= region_pos.mV[VX]; + tmp_global_pos.mdV[VY] -= region_pos.mV[VY]; + tmp_global_pos.mdV[VZ] -= region_pos.mV[VZ]; + + bool gotSimName = LLWorldMap::getInstance()->simNameFromPosGlobal(tmp_global_pos, sim_name); if (gotSimName) { - std::string slurl = LLSLURL(sim_name, global_pos).getSLURLString(); + std::string slurl = LLSLURL(sim_name, region_pos).getSLURLString(); + cb(slurl); + return; + } + else + { + auto regionp = gAgent.getRegion(); + U64 new_region_handle{}; + if(regionp) + { + new_region_handle = to_region_handle( tmp_global_pos, regionp->getOriginGlobal(), regionp->getWidth() ); + } + else + { + new_region_handle = to_region_handle( tmp_global_pos ); + } + + LLWorldMapMessage::url_callback_t url_cb = boost::bind(&LLLandmarkActions::onRegionResponseSLURL, + cb, + global_pos, + escaped, + _2); + + LLWorldMapMessage::getInstance()->sendHandleRegionRequest(new_region_handle, url_cb, std::string("unused"), false); + } +} +// +void LLLandmarkActions::getSLURLfromPosGlobal(const LLVector3d& global_pos, slurl_callback_t cb, bool escaped /* = true */) +{ + // FIRE-30768: SLURL's don't work in VarRegions + //std::string sim_name; + //bool gotSimName = LLWorldMap::getInstance()->simNameFromPosGlobal(global_pos, sim_name); + //if (gotSimName) + //{ + // std::string slurl = LLSLURL(sim_name, global_pos).getSLURLString(); + + LLSimInfo* sim_info = LLWorldMap::getInstance()->simInfoFromPosGlobal(global_pos); + if (sim_info) + { + std::string slurl = LLSLURL(sim_info->getName(), sim_info->getGlobalOrigin(), global_pos).getSLURLString(); + // cb(slurl); return; } else { - U64 new_region_handle = to_region_handle(global_pos); - + // FIRE-30534 - changes related to var regions in opensim + // U64 new_region_handle = to_region_handle(global_pos); + auto regionp = gAgent.getRegion(); + U64 new_region_handle{}; + if(regionp) + { + new_region_handle = to_region_handle( global_pos, regionp->getOriginGlobal(), regionp->getWidth() ); + } + else + { + new_region_handle = to_region_handle( global_pos ); + } + // LLWorldMapMessage::url_callback_t url_cb = boost::bind(&LLLandmarkActions::onRegionResponseSLURL, cb, global_pos, @@ -340,19 +396,34 @@ void LLLandmarkActions::onRegionResponseSLURL(slurl_callback_t cb, bool escaped, const std::string& url) { - std::string sim_name; +// FIRE-30768: SLURL's don't work in VarRegions +// std::string sim_name; +// std::string slurl; +// bool gotSimName = LLWorldMap::getInstance()->simNameFromPosGlobal(global_pos, sim_name); +// if (gotSimName) +// { +// // Debug... +// if (sim_name.empty()) +// { +// LL_WARNS() << "Requested sim name is empty!" << LL_ENDL; +// } +// // +// slurl = LLSLURL(sim_name, global_pos).getSLURLString(); +// } + std::string slurl; - bool gotSimName = LLWorldMap::getInstance()->simNameFromPosGlobal(global_pos, sim_name); - if (gotSimName) + LLSimInfo* sim_info = LLWorldMap::getInstance()->simInfoFromPosGlobal(global_pos); + if (sim_info) { // Debug... - if (sim_name.empty()) + if (sim_info->getName().empty()) { LL_WARNS() << "Requested sim name is empty!" << LL_ENDL; } // - slurl = LLSLURL(sim_name, global_pos).getSLURLString(); + slurl = LLSLURL(sim_info->getName(), sim_info->getGlobalOrigin(), global_pos).getSLURLString(); } +// else { slurl = ""; @@ -413,7 +484,12 @@ void LLLandmarkActions::copySLURLtoClipboard(const LLUUID& landmarkInventoryItem { LLVector3d global_pos; landmark->getGlobalPos(global_pos); - LLLandmarkActions::getSLURLfromPosGlobal(global_pos,©_slurl_to_clipboard_callback,true); + // FIRE-30534 - changes related to var regions in opensim + // LLLandmarkActions::getSLURLfromPosGlobal(global_pos,©_slurl_to_clipboard_callback,true); + LLVector3 region_pos; + region_pos = landmark->getRegionPos(); + LLLandmarkActions::getSLURLfromPosGlobalAndLocal(global_pos, region_pos, ©_slurl_to_clipboard_callback,true); + // } } diff --git a/indra/newview/lllandmarkactions.h b/indra/newview/lllandmarkactions.h index 870d92811e..a153ac9403 100644 --- a/indra/newview/lllandmarkactions.h +++ b/indra/newview/lllandmarkactions.h @@ -94,6 +94,7 @@ public: * @brief Creates SLURL for given global position. */ static void getSLURLfromPosGlobal(const LLVector3d& global_pos, slurl_callback_t cb, bool escaped = true); + static void getSLURLfromPosGlobalAndLocal(const LLVector3d& global_pos, const LLVector3& region_pos, slurl_callback_t cb, bool escaped = true);// FIRE-30534 - changes related to var regions in opensim static void getRegionNameAndCoordsFromPosGlobal(const LLVector3d& global_pos, region_name_and_coords_callback_t cb); diff --git a/indra/newview/lllocationinputctrl.cpp b/indra/newview/lllocationinputctrl.cpp index 821ab12537..de802f6275 100644 --- a/indra/newview/lllocationinputctrl.cpp +++ b/indra/newview/lllocationinputctrl.cpp @@ -49,6 +49,7 @@ #include "lllandmarkactions.h" #include "lllandmarklist.h" #include "llpathfindingmanager.h" +#include "llworld.h" // FIRE-30768: SLURL's don't work in VarRegions #include "llpathfindingnavmesh.h" #include "llpathfindingnavmeshstatus.h" #include "llteleporthistory.h" @@ -775,13 +776,24 @@ void LLLocationInputCtrl::onLocationPrearrange(const LLSD& data) //mFullTitile format - region_name[, parcel_name] (local_x,local_y, local_z) if (new_item_titles.insert(result->mFullTitle).second) { - LLSD value; - value["item_type"] = TELEPORT_HISTORY; - value["global_pos"] = result->mGlobalPos.getValue(); - std::string region_name = result->mTitle.substr(0, result->mTitle.find(',')); - //TODO*: add Surl to teleportitem or parse region name from title - value["tooltip"] = LLSLURL(region_name, result->mGlobalPos).getSLURLString(); - add(result->getTitle(), value); + // FIRE-30768: SLURL's don't work in VarRegions + LLViewerRegion* regionp = LLWorld::instance().getRegionFromID(result->mRegionID); + if (regionp) + { + LLSD value; + value["item_type"] = TELEPORT_HISTORY; + value["global_pos"] = result->mGlobalPos.getValue(); + std::string region_name = result->mTitle.substr(0, result->mTitle.find(',')); + //TODO*: add Surl to teleportitem or parse region name from title + //value["tooltip"] = LLSLURL(region_name, result->mGlobalPos).getSLURLString(); + value["tooltip"] = LLSLURL(region_name, regionp->getOriginGlobal(), result->mGlobalPos).getSLURLString(); + add(result->getTitle(), value); + } + else + { + LL_WARNS("LocationInputCtrl") << "unable to resolve region " << result->mRegionID << LL_ENDL; + } + // } result = std::find_if(result + 1, th_items.end(), boost::bind( &LLLocationInputCtrl::findTeleportItemsByTitle, this, diff --git a/indra/newview/llmodelpreview.cpp b/indra/newview/llmodelpreview.cpp index 3cbe727461..c6b41ca2c0 100644 --- a/indra/newview/llmodelpreview.cpp +++ b/indra/newview/llmodelpreview.cpp @@ -644,14 +644,15 @@ void LLModelPreview::rebuildUploadData() } if (!found_model && mModel[lod][model_ind] && !mModel[lod][model_ind]->mSubmodelID) { - if (mImporterDebug) + // this is not debug, this is an important/useful error advisory + // if (mImporterDebug) { std::ostringstream out; out << "Model " << mModel[lod][model_ind]->mLabel << " was not used - mismatching lod models."; LL_INFOS() << out.str() << LL_ENDL; LLFloaterModelPreview::addStringToLog(out, true); } - load_state = LLModelLoader::ERROR_MATERIALS; + load_state = LLModelLoader::ERROR_LOD_MODEL_MISMATCH; mFMP->childDisable("calculate_btn"); } } @@ -922,7 +923,38 @@ void LLModelPreview::setPhysicsFromLOD(S32 lod) updateStatusMessages(); } } +// FIRE-30963 - better physics defaults +void LLModelPreview::setPhysicsFromPreset(S32 preset) +{ + assert_main_thread(); + mPhysicsSearchLOD = -1; + mLODFile[LLModel::LOD_PHYSICS].clear(); + mFMP->childSetValue("physics_file", mLODFile[LLModel::LOD_PHYSICS]); + mVertexBuffer[LLModel::LOD_PHYSICS].clear(); + if(preset == 1) + { + mPhysicsSearchLOD = LLModel::LOD_PHYSICS; + loadModel( gDirUtilp->getExpandedFilename(LL_PATH_FS_RESOURCES, "cube_phys.dae"), LLModel::LOD_PHYSICS); + } + else if(preset == 2) + { + mPhysicsSearchLOD = LLModel::LOD_PHYSICS; + loadModel( gDirUtilp->getExpandedFilename(LL_PATH_FS_RESOURCES, "hex_phys.dae"), LLModel::LOD_PHYSICS); + } + else if(preset == 3) + { + auto ud_physics = gSavedSettings.getString("FSPhysicsPresetUser1"); + LL_INFOS() << "Loading User defined Physics Preset [" << ud_physics << "]" << LL_ENDL; + if (ud_physics != "" && gDirUtilp->fileExists(ud_physics)) + { + // loading physics from file + mPhysicsSearchLOD = LLModel::LOD_PHYSICS; + loadModel( gDirUtilp->getExpandedFilename(LL_PATH_NONE, gDirUtilp->getDirName(ud_physics), gDirUtilp->getBaseFileName(ud_physics, false)), LLModel::LOD_PHYSICS); + } + } +} +// void LLModelPreview::clearIncompatible(S32 lod) { //Don't discard models if specified model is the physic rep @@ -2365,10 +2397,7 @@ void LLModelPreview::updateStatusMessages() //fmp->childSetEnabled("physics_optimize", !use_hull); - // Enable mesh analysis in SL only for now - //bool enable = (phys_tris > 0 || phys_hulls > 0) && fmp->mCurRequest.empty(); - bool enable = (phys_tris > 0 || phys_hulls > 0) && fmp->mCurRequest.empty() && LLGridManager::instance().isInSecondLife(); - // + bool enable = (phys_tris > 0 || phys_hulls > 0) && fmp->mCurRequest.empty(); //enable = enable && !use_hull && fmp->childGetValue("physics_optimize").asBoolean(); //enable/disable "analysis" UI @@ -2402,13 +2431,10 @@ void LLModelPreview::updateStatusMessages() fmp->childEnable("Simplify"); } - // Enable mesh analysis in SL only for now - //if (phys_tris || phys_hulls > 0) - //{ - // fmp->childEnable("Decompose"); - //} - fmp->childSetEnabled("Decompose", (phys_tris || phys_hulls > 0) && LLGridManager::instance().isInSecondLife()); - // + if (phys_tris || phys_hulls > 0) + { + fmp->childEnable("Decompose"); + } } else { diff --git a/indra/newview/llmodelpreview.h b/indra/newview/llmodelpreview.h index a0e1d2b18c..90a3fccf81 100644 --- a/indra/newview/llmodelpreview.h +++ b/indra/newview/llmodelpreview.h @@ -139,6 +139,7 @@ public: void setTexture(U32 name) { mTextureName = name; } void setPhysicsFromLOD(S32 lod); + void setPhysicsFromPreset(S32 preset);// FIRE-30963 - better physics defaults BOOL render(); void update(); void genBuffers(S32 lod, bool skinned); diff --git a/indra/newview/llnavigationbar.cpp b/indra/newview/llnavigationbar.cpp index edd2d4e91b..34b5853bb9 100644 --- a/indra/newview/llnavigationbar.cpp +++ b/indra/newview/llnavigationbar.cpp @@ -672,8 +672,11 @@ void LLNavigationBar::onTeleportFinished(const LLVector3d& global_agent_pos) */ LLAgentUI::buildLocationString(location, LLAgentUI::LOCATION_FORMAT_NO_MATURITY, gAgent.getPosAgentFromGlobal(global_agent_pos)); - std::string tooltip (LLSLURL(gAgent.getRegion()->getName(), global_agent_pos).getSLURLString()); - + // FIRE-30768: SLURL's don't work in VarRegions + //std::string tooltip (LLSLURL(gAgent.getRegion()->getName(), global_agent_pos).getSLURLString()); + std::string tooltip (LLSLURL(gAgent.getRegion()->getName(), gAgent.getRegion()->getOriginGlobal(), global_agent_pos).getSLURLString()); + // + LLLocationHistoryItem item (location, global_agent_pos, tooltip,TYPED_REGION_SLURL);// we can add into history only TYPED location //Touch it, if it is at list already, add new location otherwise @@ -760,7 +763,10 @@ void LLNavigationBar::onRegionNameResponse( LLVector3d region_pos = from_region_handle(region_handle); LLVector3d global_pos = region_pos + (LLVector3d) local_coords; - LL_INFOS() << "Teleporting to: " << LLSLURL(region_name, global_pos).getSLURLString() << LL_ENDL; + // FIRE-30768: SLURL's don't work in VarRegions + //LL_INFOS() << "Teleporting to: " << LLSLURL(region_name, global_pos).getSLURLString() << LL_ENDL; + LL_INFOS() << "Teleporting to: " << LLSLURL(region_name, region_pos, global_pos).getSLURLString() << LL_ENDL; + // gAgent.teleportViaLocation(global_pos); } else if (gSavedSettings.getBOOL("SearchFromAddressBar")) diff --git a/indra/newview/llpanelplaceinfo.cpp b/indra/newview/llpanelplaceinfo.cpp index 452d92a1a3..fb9eca1e7a 100644 --- a/indra/newview/llpanelplaceinfo.cpp +++ b/indra/newview/llpanelplaceinfo.cpp @@ -173,7 +173,7 @@ void LLPanelPlaceInfo::displayParcelInfo(const LLUUID& region_id, mPosRegion.setVec((F32)fmod(pos_global.mdV[VX], (F64)REGION_WIDTH_METERS), (F32)fmod(pos_global.mdV[VY], (F64)REGION_WIDTH_METERS), (F32)pos_global.mdV[VZ]); - + LLSD body; std::string url = region->getCapability("RemoteParcelRequest"); if (!url.empty()) @@ -186,6 +186,29 @@ void LLPanelPlaceInfo::displayParcelInfo(const LLUUID& region_id, mDescEditor->setText(getString("server_update_text")); } } +// FIRE-30768, FIRE-30534 more OS Var region fixups +void LLPanelPlaceInfo::displayParcelInfo(const LLUUID& region_id, + const U64 region_handle, + const LLVector3d& pos_global) +{ + auto region_origin = from_region_handle(region_handle); + mPosRegion.setVec(LLVector3(pos_global - region_origin)); + LLViewerRegion* region = gAgent.getRegion(); + if (!region) + return; + LLSD body; + std::string url = region->getCapability("RemoteParcelRequest"); + if (!url.empty()) + { + LLRemoteParcelInfoProcessor::getInstance()->requestRegionParcelInfo(url, + region_id, mPosRegion, pos_global, getObserverHandle()); + } + else + { + mDescEditor->setText(getString("server_update_text")); + } +} +// // virtual void LLPanelPlaceInfo::setErrorStatus(S32 status, const std::string& reason) diff --git a/indra/newview/llpanelplaceinfo.h b/indra/newview/llpanelplaceinfo.h index 10b6c8a1bc..fe9b26cbb9 100644 --- a/indra/newview/llpanelplaceinfo.h +++ b/indra/newview/llpanelplaceinfo.h @@ -85,6 +85,11 @@ public: // Sends a request to the server. void displayParcelInfo(const LLUUID& region_id, const LLVector3d& pos_global); + // FIRE-30768, FIRE-30534 more OS Var region fixups + void displayParcelInfo(const LLUUID& region_id, + const U64 region_handle, + const LLVector3d& pos_global); + // /*virtual*/ void setErrorStatus(S32 status, const std::string& reason); diff --git a/indra/newview/llpanelplaceprofile.cpp b/indra/newview/llpanelplaceprofile.cpp index 91d51d6594..ae4078f5a3 100644 --- a/indra/newview/llpanelplaceprofile.cpp +++ b/indra/newview/llpanelplaceprofile.cpp @@ -410,9 +410,14 @@ void LLPanelPlaceProfile::displaySelectedParcelInfo(LLParcel* parcel, parcel_data.name = parcel->getName(); parcel_data.sim_name = region->getName(); parcel_data.snapshot_id = parcel->getSnapshotID(); - mPosRegion.setVec((F32)fmod(pos_global.mdV[VX], (F64)REGION_WIDTH_METERS), - (F32)fmod(pos_global.mdV[VY], (F64)REGION_WIDTH_METERS), - (F32)pos_global.mdV[VZ]); + // FIRE-30768, FIRE-30534 more OS Var region fixups + // mPosRegion.setVec((F32)fmod(pos_global.mdV[VX], (F64)REGION_WIDTH_METERS), + // (F32)fmod(pos_global.mdV[VY], (F64)REGION_WIDTH_METERS), + // (F32)pos_global.mdV[VZ]); + auto region_origin = region->getOriginGlobal(); + mPosRegion.setVec(LLVector3(pos_global - region_origin)); + LL_DEBUGS("SLURL") << "LM INFO: global " << pos_global << " region_orig " << region_origin << " pos_region " << mPosRegion << LL_ENDL; + // parcel_data.global_x = pos_global.mdV[VX]; parcel_data.global_y = pos_global.mdV[VY]; parcel_data.global_z = pos_global.mdV[VZ]; diff --git a/indra/newview/llpanelplaces.cpp b/indra/newview/llpanelplaces.cpp index 04045d555d..8294158870 100644 --- a/indra/newview/llpanelplaces.cpp +++ b/indra/newview/llpanelplaces.cpp @@ -34,6 +34,7 @@ #include "llinventory.h" #include "lllandmark.h" #include "llparcel.h" +#include "llregionhandle.h" // Var region support #include "llcombobox.h" #include "llfiltereditor.h" @@ -486,6 +487,14 @@ void LLPanelPlaces::onOpen(const LLSD& key) mPosGlobal = LLVector3d(key["x"].asReal(), key["y"].asReal(), key["z"].asReal()); + // Var region support + if(key.has("ox")) + { + auto region_handle = to_region_handle(key["ox"].asInteger(), key["oy"].asInteger()); + mPlaceProfile->displayParcelInfo(LLUUID(), region_handle, mPosGlobal); + } + else + // mPlaceProfile->displayParcelInfo(LLUUID(), mPosGlobal); } diff --git a/indra/newview/llpanelplacestab.cpp b/indra/newview/llpanelplacestab.cpp index 9644b7518e..34a36b186e 100644 --- a/indra/newview/llpanelplacestab.cpp +++ b/indra/newview/llpanelplacestab.cpp @@ -60,14 +60,20 @@ void LLPanelPlacesTab::onRegionResponse(const LLVector3d& landmark_global_pos, const LLUUID& snapshot_id, bool teleport) { - std::string sim_name; - bool gotSimName = LLWorldMap::getInstance()->simNameFromPosGlobal( landmark_global_pos, sim_name ); + // FIRE-30768: SLURL's don't work in VarRegions + //std::string sim_name; + //bool gotSimName = LLWorldMap::getInstance()->simNameFromPosGlobal( landmark_global_pos, sim_name ); + LLSimInfo* sim_info = LLWorldMap::getInstance()->simInfoFromPosGlobal(landmark_global_pos); std::string sl_url; - if ( gotSimName ) + //if ( gotSimName ) + if (sim_info) { - sl_url = LLSLURL(sim_name, landmark_global_pos).getSLURLString(); + //sl_url = LLSLURL(sim_name, landmark_global_pos).getSLURLString(); + sl_url = LLSLURL(sim_info->getName(), sim_info->getGlobalOrigin(), landmark_global_pos).getSLURLString(); } + // + else { sl_url = ""; diff --git a/indra/newview/llprogressview.cpp b/indra/newview/llprogressview.cpp index 821d3d647c..9251c38d3c 100644 --- a/indra/newview/llprogressview.cpp +++ b/indra/newview/llprogressview.cpp @@ -464,9 +464,9 @@ void LLProgressView::initLogos() const S32 default_pad = 15; S32 icon_width; -#if defined(LL_FMODSTUDIO) || defined(LL_HAVOK) +//#if defined(LL_FMODSTUDIO) || defined(LL_HAVOK) // FIRE-30937: Always needed S32 icon_height; -#endif // defined(LL_FMODSTUDIO) || defined(LL_HAVOK) +//#endif // defined(LL_FMODSTUDIO) || defined(LL_HAVOK) // FIRE-30937: Always needed // We don't know final screen rect yet, so we can't precalculate position fully LLTextBox *logos_label = getChild("logos_lbl"); diff --git a/indra/newview/llremoteparcelrequest.cpp b/indra/newview/llremoteparcelrequest.cpp index 055ccd5818..85540c580f 100644 --- a/indra/newview/llremoteparcelrequest.cpp +++ b/indra/newview/llremoteparcelrequest.cpp @@ -189,6 +189,7 @@ void LLRemoteParcelInfoProcessor::regionParcelInfoCoro(std::string url, LLSD bodyData; + LL_DEBUGS("ParcelRequest") << "Remote Parcel Request for " << regionId << "local: " << posRegion << "remote: " << posGlobal << LL_ENDL;// FIRE-30534 - changes related to var regions in opensim bodyData["location"] = ll_sd_from_vector3(posRegion); if (!regionId.isNull()) { @@ -196,6 +197,7 @@ void LLRemoteParcelInfoProcessor::regionParcelInfoCoro(std::string url, } if (!posGlobal.isExactlyZero()) { + // Note: leave this to_region_handle at 256 grid cell resolution, let OpenSim Server resolve U64 regionHandle = to_region_handle(posGlobal); bodyData["region_handle"] = ll_sd_from_U64(regionHandle); } diff --git a/indra/newview/llslurl.cpp b/indra/newview/llslurl.cpp index f9b0dc241d..1d75ecd4eb 100644 --- a/indra/newview/llslurl.cpp +++ b/indra/newview/llslurl.cpp @@ -353,6 +353,7 @@ LLSLURL::LLSLURL(const std::string& region, // create a slurl from a global position LLSLURL::LLSLURL(const std::string& grid, const std::string& region, + const LLVector3d& , // FIRE-30768: SLURL's don't work in VarRegions *unused param in SL builds* const LLVector3d& global_position) { *this = LLSLURL(LLGridManager::getInstance()->getGridId(grid), @@ -363,10 +364,17 @@ LLSLURL::LLSLURL(const std::string& grid, // create a slurl from a global position LLSLURL::LLSLURL(const std::string& region, + const LLVector3d& region_origin, // FIRE-30768: SLURL's don't work in VarRegions const LLVector3d& global_position) { - *this = LLSLURL(LLGridManager::getInstance()->getGridId(), - region, global_position); + // FIRE-30768: SLURL's don't work in VarRegions + // *this = LLSLURL(LLGridManager::getInstance()->getGridId(), + // region, global_position); + *this = LLSLURL(LLGridManager::getInstance()->getGridId(), + region, + region_origin, + global_position); + // } LLSLURL::LLSLURL(const std::string& command, const LLUUID&id, const std::string& verb) diff --git a/indra/newview/llslurl.h b/indra/newview/llslurl.h index d722852ba3..fd0db1837c 100644 --- a/indra/newview/llslurl.h +++ b/indra/newview/llslurl.h @@ -71,8 +71,12 @@ public: LLSLURL(const std::string& grid, const std::string& region); LLSLURL(const std::string& region, const LLVector3& position); LLSLURL(const std::string& grid, const std::string& region, const LLVector3& position); - LLSLURL(const std::string& grid, const std::string& region, const LLVector3d& global_position); - LLSLURL(const std::string& region, const LLVector3d& global_position); + // FIRE-30768: SLURL's don't work in VarRegions + // LLSLURL(const std::string& grid, const std::string& region, const LLVector3d& global_position); + // LLSLURL(const std::string& region, const LLVector3d& global_position); + LLSLURL(const std::string& grid, const std::string& region, const LLVector3d& region_origin, const LLVector3d& global_position); + LLSLURL(const std::string& region, const LLVector3d& region_origin, const LLVector3d& global_position); + // LLSLURL(const std::string& command, const LLUUID&id, const std::string& verb); SLURL_TYPE getType() const { return mType; } diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 7eaf464a94..2fad0a3e69 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -3876,6 +3876,16 @@ void LLStartUp::setStartSLURL(const LLSLURL& slurl) gSavedSettings.setString("LoginLocation", LLSLURL::SIM_LOCATION_LAST); break; } + // Support adding grids via SLURL +#if OPENSIM && !SINGLEGRID + case LLSLURL::APP: + if (slurl.getAppCmd() == "gridmanager") + { + LLURLDispatcher::dispatch(getStartSLURL().getSLURLString(), "clicked", NULL, false); + break; + } +#endif + // default: LLGridManager::getInstance()->setGridChoice(slurl.getGrid()); break; diff --git a/indra/newview/llurldispatcher.cpp b/indra/newview/llurldispatcher.cpp index abd6e31d67..2930c46bcc 100644 --- a/indra/newview/llurldispatcher.cpp +++ b/indra/newview/llurldispatcher.cpp @@ -283,9 +283,12 @@ void LLURLDispatcherImpl::regionHandleCallback(U64 region_handle, const LLSLURL& #endif // OPENSIM // - LLVector3d global_pos = from_region_handle(region_handle); - global_pos += LLVector3d(slurl.getPosition()); - + // make Var Regions work + // LLVector3d global_pos = from_region_handle(region_handle); + // global_pos += LLVector3d(slurl.getPosition()); + LLVector3d origin_pos = from_region_handle(region_handle); + LLVector3d global_pos{origin_pos + LLVector3d(slurl.getPosition())}; + // if (teleport) { gAgent.teleportViaLocation(global_pos); @@ -302,6 +305,10 @@ void LLURLDispatcherImpl::regionHandleCallback(U64 region_handle, const LLSLURL& key["x"] = global_pos.mdV[VX]; key["y"] = global_pos.mdV[VY]; key["z"] = global_pos.mdV[VZ]; + // support Var regions + key["ox"] = origin_pos.mdV[VX]; + key["oy"] = origin_pos.mdV[VY]; + // // FIRE-817: Separate place details floater //LLFloaterSidePanelContainer::showPanel("places", key); diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp index 643c5b6b58..b494549e16 100644 --- a/indra/newview/llviewercontrol.cpp +++ b/indra/newview/llviewercontrol.cpp @@ -92,6 +92,7 @@ #include "fslslbridge.h" #include "fsradar.h" #include "llavataractions.h" +#include "lldiskcache.h" #include "llfloaterreg.h" #include "llfloatersidepanelcontainer.h" #include "llhudtext.h" @@ -1062,6 +1063,15 @@ void handlePlayBentoIdleAnimationChanged(const LLSD& newValue) } // +// Better asset cache size control +void handleDiskCacheSizeChanged(const LLSD& newValue) +{ + const unsigned int disk_cache_mb = gSavedSettings.getU32("FSDiskCacheSize"); + const U64 disk_cache_bytes = disk_cache_mb * 1024 * 1024; + LLDiskCache::getInstance()->setMaxSizeBytes(disk_cache_bytes); +} +// + //////////////////////////////////////////////////////////////////////////// void settings_setup_listeners() @@ -1316,6 +1326,9 @@ void settings_setup_listeners() // Run Prio 0 default bento pose in the background to fix splayed hands, open mouths, etc. gSavedSettings.getControl("FSPlayDefaultBentoAnimation")->getSignal()->connect(boost::bind(&handlePlayBentoIdleAnimationChanged, _2)); + + // Better asset cache size control + gSavedSettings.getControl("FSDiskCacheSize")->getSignal()->connect(boost::bind(&handleDiskCacheSizeChanged, _2)); } #if TEST_CACHED_CONTROL diff --git a/indra/newview/llviewerjoystick.cpp b/indra/newview/llviewerjoystick.cpp index 030f0b6cd2..d147560011 100644 --- a/indra/newview/llviewerjoystick.cpp +++ b/indra/newview/llviewerjoystick.cpp @@ -555,12 +555,16 @@ void LLViewerJoystick::updateStatus() ndof_update(mNdofDev); - for (int i=0; i<6; i++) + // FIRE-14344 - Add button preview and allow for more than 6 axes + // for (int i=0; i<6; i++) + for (int i = 0; i < MAX_JOYSTICK_AXES; i++) { mAxes[i] = (F32) mNdofDev->axes[i] / mNdofDev->axes_max; } - for (int i=0; i<16; i++) + // FIRE-14344 - Add button preview and allow for more than 6 axes + // for (int i=0; i<16; i++) + for (int i = 0; i < MAX_JOYSTICK_BUTTONS; i++) { mBtn[i] = mNdofDev->buttons[i]; } @@ -571,7 +575,9 @@ void LLViewerJoystick::updateStatus() // ----------------------------------------------------------------------------- F32 LLViewerJoystick::getJoystickAxis(U32 axis) const { - if (axis < 6) + // FIRE-14344 - Add button preview and allow for more than 6 axes + // if (axis < 6) + if (axis < MAX_JOYSTICK_AXES) { return mAxes[axis]; } @@ -581,7 +587,9 @@ F32 LLViewerJoystick::getJoystickAxis(U32 axis) const // ----------------------------------------------------------------------------- U32 LLViewerJoystick::getJoystickButton(U32 button) const { - if (button < 16) + // FIRE-14344 - Add button preview and allow for more than 6 axes + // if (button < 16) + if (button < MAX_JOYSTICK_BUTTONS) { return mBtn[button]; } @@ -1510,3 +1518,25 @@ void LLViewerJoystick::setSNDefaults() gSavedSettings.setF32("BuildFeathering", 12.f); gSavedSettings.setF32("FlycamFeathering", 5.f); } + +// FIRE-14344 - Add button preview and allow for more than 6 axes +U32 LLViewerJoystick::getNumOfJoystickAxes() const +{ +#if LIB_NDOF + // return number of axes or the maximum supported number of axes, whichever is smaller + return llmin((U32) mNdofDev->axes_count, (U32) MAX_JOYSTICK_AXES); +#else + return MAX_JOYSTICK_AXES; +#endif +} + +U32 LLViewerJoystick::getNumOfJoystickButtons() const +{ +#if LIB_NDOF + // return number of buttons or the maximum supported number of buttons, whichever is smaller + return llmin((U32) mNdofDev->btn_count, (U32) MAX_JOYSTICK_BUTTONS); +#else + return MAX_JOYSTICK_BUTTONS; +#endif +} +// diff --git a/indra/newview/llviewerjoystick.h b/indra/newview/llviewerjoystick.h index 782c523d4f..a6e6413b15 100644 --- a/indra/newview/llviewerjoystick.h +++ b/indra/newview/llviewerjoystick.h @@ -36,6 +36,14 @@ #define NDOF_HotPlugResult S32 #endif +// FIRE-14344 - Using the same numbers all over the place is a bad idea, so let's +// define them here in case we need to change them at some point. Better +// would be to have it all figured out at runtime, but a lot of the code +// expects a fixed size of options, so that needs bigger changes :/ +#define MAX_JOYSTICK_AXES 8 +#define MAX_JOYSTICK_BUTTONS 16 +// + typedef enum e_joystick_driver_state { JDS_UNINITIALIZED, @@ -93,8 +101,12 @@ protected: #endif private: - F32 mAxes[6]; - long mBtn[16]; +// FIRE-14344 - Add button preview and allow for more than 6 axes +// F32 mAxes[6]; +// long mBtn[16]; + F32 mAxes[MAX_JOYSTICK_AXES]; + long mBtn[MAX_JOYSTICK_BUTTONS]; +// EJoystickDriverState mDriverState; NDOF_Device *mNdofDev; bool mResetFlag; @@ -106,6 +118,12 @@ private: static F32 sLastDelta[7]; static F32 sDelta[7]; + +// FIRE-14344 - Add button preview and allow for more than 6 axes +public: + U32 getNumOfJoystickAxes() const; + U32 getNumOfJoystickButtons() const; +// }; #endif diff --git a/indra/newview/llworldmap.cpp b/indra/newview/llworldmap.cpp index 04e3461513..d5ac9c1f4a 100644 --- a/indra/newview/llworldmap.cpp +++ b/indra/newview/llworldmap.cpp @@ -380,6 +380,7 @@ LLSimInfo* LLWorldMap::simInfoFromHandle(const U64 handle) if(x >= checkRegionX && x < (checkRegionX + info->mSizeX) && y >= checkRegionY && y < (checkRegionY + info->mSizeY)) { + LL_DEBUGS("WorldMap") << "VarRegion match for map tile (" << x << "," << y << ") in " << info->mSizeX << "x" << info->mSizeY << " region at (" << checkRegionX << "," << checkRegionY << ")" << LL_ENDL;// FIRE-30534 - changes related to var regions in opensim return info; } // Aurora Sim @@ -466,7 +467,7 @@ bool LLWorldMap::insertRegion(U32 x_world, U32 y_world, U16 x_size, U16 y_size, else { U64 handle = to_region_handle(x_world, y_world); - //LL_INFOS("WorldMap") << "Map sim : " << name << ", ID : " << image_id.getString() << LL_ENDL; + LL_DEBUGS("WorldMap") << "Map sim : " << name << ", ID : " << image_id.getString() << ", HANDLE : " << handle << LL_ENDL;// FIRE-30534 - changes related to var regions in opensim // Insert the region in the region map of the world map // Loading the LLSimInfo object with what we got and insert it in the map LLSimInfo* siminfo = LLWorldMap::getInstance()->simInfoFromHandle(handle); diff --git a/indra/newview/skins/ansastorm/xui/en/panel_fs_contacts_friends.xml b/indra/newview/skins/ansastorm/xui/en/panel_fs_contacts_friends.xml index da1944551b..41e157e9e0 100644 --- a/indra/newview/skins/ansastorm/xui/en/panel_fs_contacts_friends.xml +++ b/indra/newview/skins/ansastorm/xui/en/panel_fs_contacts_friends.xml @@ -113,7 +113,7 @@ + This is my second life description and I really think it is great. But for some reason my description is super extra long because I like to talk a whole lot - Cache size ([http://wiki.firestormviewer.org/cache need a suggestion?]): + Texture Cache Size ([http://wiki.firestormviewer.org/cache need a suggestion?]): MB + + Asset Cache Size: + + + + MB + + +