From 26aa6ad7cc094971c674a2b213ff9b22553312a9 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Sat, 5 Apr 2014 22:02:32 +0200 Subject: [PATCH 1/6] Refactor LSL bridge to better work with OpenSim, provided by Cinder Roxley: * Don't flip UseLSLBridge setting when in OpenSim * Check for bridge existence before using it * Cut off the bridge creation process on OpenSim * Some other refactoring --- indra/newview/fslslbridge.cpp | 46 +++++++++++++++-------- indra/newview/fslslbridge.h | 19 +++++----- indra/newview/fsradar.cpp | 2 +- indra/newview/llagent.cpp | 4 +- indra/newview/llappearancemgr.cpp | 4 +- indra/newview/llassetuploadresponders.cpp | 2 +- indra/newview/llfloaterpreference.cpp | 9 ----- indra/newview/llstartup.cpp | 9 ----- indra/newview/llviewermenu.cpp | 7 +--- indra/newview/llviewermessage.cpp | 5 +-- 10 files changed, 49 insertions(+), 58 deletions(-) diff --git a/indra/newview/fslslbridge.cpp b/indra/newview/fslslbridge.cpp index bb7fa1c16d..d0c383dce6 100644 --- a/indra/newview/fslslbridge.cpp +++ b/indra/newview/fslslbridge.cpp @@ -60,6 +60,9 @@ #include #include +#if OPENSIM +#include "llviewernetwork.h" +#endif const std::string FS_BRIDGE_FOLDER = "#LSL Bridge"; const std::string FS_BRIDGE_CONTAINER_FOLDER = "Landscaping"; @@ -111,7 +114,7 @@ FSLSLBridge::~FSLSLBridge() { } -bool FSLSLBridge::lslToViewer(std::string message, LLUUID fromID, LLUUID ownerID) +bool FSLSLBridge::lslToViewer(const std::string& message, const LLUUID& fromID, const LLUUID& ownerID) { if (!gSavedSettings.getBOOL("UseLSLBridge")) { @@ -275,9 +278,15 @@ bool FSLSLBridge::lslToViewer(std::string message, LLUUID fromID, LLUUID ownerID return status; } -bool FSLSLBridge::viewerToLSL(std::string message, FSLSLBridgeRequestResponder* responder) +bool FSLSLBridge::canUseBridge() { - if (!gSavedSettings.getBOOL("UseLSLBridge")) + static LLCachedControl sUseLSLBridge(gSavedSettings, "UseLSLBridge"); + return (isBridgeValid() && sUseLSLBridge); +} + +bool FSLSLBridge::viewerToLSL(const std::string& message, FSLSLBridgeRequestResponder* responder) +{ + if (!canUseBridge()) { return false; } @@ -291,7 +300,7 @@ bool FSLSLBridge::viewerToLSL(std::string message, FSLSLBridgeRequestResponder* return true; } -bool FSLSLBridge::updateBoolSettingValue(std::string msgVal) +bool FSLSLBridge::updateBoolSettingValue(const std::string& msgVal) { std::string boolVal = "0"; @@ -303,7 +312,7 @@ bool FSLSLBridge::updateBoolSettingValue(std::string msgVal) return viewerToLSL(msgVal + "|" + boolVal, new FSLSLBridgeRequestResponder()); } -bool FSLSLBridge::updateBoolSettingValue(std::string msgVal, bool contentVal) +bool FSLSLBridge::updateBoolSettingValue(const std::string& msgVal, bool contentVal) { std::string boolVal = "0"; @@ -356,7 +365,7 @@ void FSLSLBridge::recreateBridge() } } // clear the stored bridge ID - we are starting over. - mpBridge = 0; //the object itself will get cleaned up when new one is created. + mpBridge = NULL; //the object itself will get cleaned up when new one is created. initCreationStep(); } @@ -438,6 +447,11 @@ void FSLSLBridge::startCreation() void FSLSLBridge::initCreationStep() { +// Don't create on OpenSim. We need to fallback to another creation process there, unfortunately. +// There is no way to ensure a rock object will ever be in a grid's Library. +#if OPENSIM + if (LLGridManager::getInstance()->isInOpenSim()) return; +#endif mBridgeCreating = true; //announce yourself reportToNearbyChat(LLTrans::getString("fsbridge_creating")); @@ -715,7 +729,7 @@ void FSLSLBridge::setupBridgePrim(LLViewerObject* object) object->setVolume(LLVolumeParams(profParams, pathParams), 0); object->setScale(LLVector3(10.0f, 10.0f, 10.0f), TRUE); - for (int i = 0; i < object->getNumTEs(); i++) + for (S32 i = 0; i < object->getNumTEs(); i++) { LLViewerTexture* image = LLViewerTextureManager::getFetchedTexture( IMG_INVISIBLE ); object->setTEImage(i, image); //transparent texture @@ -904,8 +918,8 @@ void FSLSLBridgeScriptCallback::fire(const LLUUID& inv_item) std::string FSLSLBridgeScriptCallback::prepUploadFile() { - std::string fName = gDirUtilp->getExpandedFilename(LL_PATH_FS_RESOURCES, UPLOAD_SCRIPT_CURRENT); - std::string fNew = gDirUtilp->getExpandedFilename(LL_PATH_CACHE,UPLOAD_SCRIPT_CURRENT); + const std::string fName = gDirUtilp->getExpandedFilename(LL_PATH_FS_RESOURCES, UPLOAD_SCRIPT_CURRENT); + const std::string fNew = gDirUtilp->getExpandedFilename(LL_PATH_CACHE,UPLOAD_SCRIPT_CURRENT); LLFILE* fpIn = LLFile::fopen(fName, "rt"); if (!fpIn) @@ -928,7 +942,7 @@ std::string FSLSLBridgeScriptCallback::prepUploadFile() std::string bridgeScript( (char const*)&vctData[0] ); - std::string bridgekey = "BRIDGEKEY"; + const std::string bridgekey = "BRIDGEKEY"; bridgeScript.replace(bridgeScript.find(bridgekey), bridgekey.length(), FSLSLBridge::getInstance()->findFSCategory().asString()); LLFILE *fpOut = LLFile::fopen(fNew, "wt"); @@ -947,9 +961,9 @@ std::string FSLSLBridgeScriptCallback::prepUploadFile() return fNew; } -void FSLSLBridge :: checkBridgeScriptName(std::string fileName) +void FSLSLBridge::checkBridgeScriptName(const std::string& fileName) { - if ((fileName.length() == 0) || !mBridgeCreating) + if ((fileName.empty()) || !mBridgeCreating) { LL_WARNS("FSLSLBridge") << "Bridge script length was zero, or bridge was not marked as under creation. Aborting." << LL_ENDL; return; @@ -963,7 +977,7 @@ void FSLSLBridge :: checkBridgeScriptName(std::string fileName) } //need to parse out the last length of a GUID and compare to saved possible names. - std::string fileOnly = fileName.substr(fileName.length() - UPLOAD_SCRIPT_CURRENT.length(), UPLOAD_SCRIPT_CURRENT.length()); + const std::string fileOnly = fileName.substr(fileName.length() - UPLOAD_SCRIPT_CURRENT.length(), UPLOAD_SCRIPT_CURRENT.length()); if (fileOnly == UPLOAD_SCRIPT_CURRENT) { @@ -1022,7 +1036,7 @@ void FSLSLBridge::finishBridge() // // Helper functions /// -bool FSLSLBridge::isItemAttached(LLUUID iID) +bool FSLSLBridge::isItemAttached(const LLUUID& iID) { return (isAgentAvatarValid() && gAgentAvatarp->isWearingAttachment(iID)); } @@ -1122,7 +1136,7 @@ LLUUID FSLSLBridge::findFSBridgeContainerCategory() return LLUUID(); } -LLViewerInventoryItem* FSLSLBridge::findInvObject(std::string obj_name, LLUUID catID, LLAssetType::EType type) +LLViewerInventoryItem* FSLSLBridge::findInvObject(const std::string& obj_name, const LLUUID& catID, LLAssetType::EType type) { LLViewerInventoryCategory::cat_array_t cats; LLViewerInventoryItem::item_array_t items; @@ -1151,7 +1165,7 @@ LLViewerInventoryItem* FSLSLBridge::findInvObject(std::string obj_name, LLUUID c return NULL; } -void FSLSLBridge::cleanUpBridgeFolder(std::string nameToCleanUp) +void FSLSLBridge::cleanUpBridgeFolder(const std::string& nameToCleanUp) { LL_INFOS("FSLSLBridge") << "Cleaning leftover scripts and bridges for folder " << nameToCleanUp << LL_ENDL; diff --git a/indra/newview/fslslbridge.h b/indra/newview/fslslbridge.h index ad6829fa91..8779ce7818 100644 --- a/indra/newview/fslslbridge.h +++ b/indra/newview/fslslbridge.h @@ -58,11 +58,11 @@ public: FSLSLBridge(); ~FSLSLBridge(); - bool lslToViewer(std::string message, LLUUID fromID, LLUUID ownerID); - bool viewerToLSL(std::string message, FSLSLBridgeRequestResponder* responder = NULL); + bool lslToViewer(const std::string& message, const LLUUID& fromID, const LLUUID& ownerID); + bool viewerToLSL(const std::string& message, FSLSLBridgeRequestResponder* responder = NULL); - bool updateBoolSettingValue(std::string msgVal); - bool updateBoolSettingValue(std::string msgVal, bool contentVal); + bool updateBoolSettingValue(const std::string& msgVal); + bool updateBoolSettingValue(const std::string& msgVal, bool contentVal); void initBridge(); void recreateBridge(); @@ -74,9 +74,9 @@ public: void setBridge(LLViewerInventoryItem* item) { mpBridge = item; }; LLViewerInventoryItem* getBridge() { return mpBridge; }; - bool isBridgeValid() const { return NULL != mpBridge; } + bool canUseBridge(); - void checkBridgeScriptName(std::string fileName); + void checkBridgeScriptName(const std::string& fileName); std::string currentFullName() { return mCurrentFullName; } LLUUID getBridgeFolder() { return mBridgeFolderID; } @@ -100,18 +100,19 @@ private: LLUUID mBridgeUUID; bool mIsFirstCallDone; //initialization conversation + bool isBridgeValid() const { return NULL != mpBridge; } protected: - LLViewerInventoryItem* findInvObject(std::string obj_name, LLUUID catID, LLAssetType::EType type); + LLViewerInventoryItem* findInvObject(const std::string& obj_name, const LLUUID& catID, LLAssetType::EType type); LLUUID findFSCategory(); LLUUID findFSBridgeContainerCategory(); - bool isItemAttached(LLUUID iID); + bool isItemAttached(const LLUUID& iID); void createNewBridge(); void create_script_inner(LLViewerObject* object); bool isOldBridgeVersion(LLInventoryItem* item); void cleanUpBridgeFolder(); - void cleanUpBridgeFolder(std::string nameToCleanUp); + void cleanUpBridgeFolder(const std::string& nameToCleanUp); void setupBridgePrim(LLViewerObject* object); void initCreationStep(); void cleanUpBridge(); diff --git a/indra/newview/fsradar.cpp b/indra/newview/fsradar.cpp index 4bc3c25991..774a913826 100644 --- a/indra/newview/fsradar.cpp +++ b/indra/newview/fsradar.cpp @@ -169,10 +169,10 @@ void FSRadar::updateRadarList() static LLCachedControl RadarLeaveChannelAlert(gSavedSettings, "RadarLeaveChannelAlert"); static LLCachedControl nearMeRange(gSavedSettings, "NearMeRange"); static LLCachedControl limitRange(gSavedSettings, "LimitRadarByRange"); - static LLCachedControl sUseLSLBridge(gSavedSettings, "UseLSLBridge"); static LLCachedControl RenderFarClip(gSavedSettings, "RenderFarClip"); static LLCachedControl sFSLegacyRadarFriendColoring(gSavedSettings, "FSLegacyRadarFriendColoring"); static LLCachedControl sRadarColorNamesByDistance(gSavedSettings, "FSRadarColorNamesByDistance", false); + bool sUseLSLBridge = FSLSLBridge::instance().canUseBridge(); F32 drawRadius(RenderFarClip); const LLVector3d& posSelf = gAgent.getPositionGlobal(); diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index e078d8dbe2..e80f1aa7c9 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -4731,7 +4731,7 @@ void LLAgent::doTeleportViaLocation(const LLVector3d& pos_global) sendReliableMessage(); } // Client LSL Bridge - if (gSavedSettings.getBOOL("UseLSLBridge") && isLocal) + if (FSLSLBridge::instance().canUseBridge() && isLocal) { teleportBridgeGlobal(pos_global); } @@ -4771,7 +4771,7 @@ void LLAgent::doTeleportViaLocationLookAt(const LLVector3d& pos_global) teleportRequest(region_handle, pos_local, getTeleportKeepsLookAt()); // Client LSL Bridge - if (gSavedSettings.getBOOL("UseLSLBridge")) + if (FSLSLBridge::instance().canUseBridge()) { if (region_handle == to_region_handle(getPositionGlobal())) { diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index cf6f409744..d0ae14b098 100644 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -1493,7 +1493,7 @@ void LLAppearanceMgr::takeOffOutfit(const LLUUID& cat_id) gInventory.collectDescendentsIf(cat_id, cats, items, FALSE, collector); // Client LSL Bridge - if (gSavedSettings.getBOOL("UseLSLBridge")) + if (FSLSLBridge::instance().canUseBridge()) { //if replacing - make sure bridge stays. if (FSLSLBridge::instance().getBridge()) @@ -2034,7 +2034,7 @@ void LLAppearanceMgr::updateCOF(LLInventoryModel::item_array_t& body_items_new, obj_items.insert(obj_items.end(), obj_items_new.begin(), obj_items_new.end()); // [/RLVa:KB] //-TT Client LSL Bridge - if (gSavedSettings.getBOOL("UseLSLBridge")) + if (FSLSLBridge::instance().canUseBridge()) { //if replacing - make sure bridge stays. if (!append && FSLSLBridge::instance().getBridge()) diff --git a/indra/newview/llassetuploadresponders.cpp b/indra/newview/llassetuploadresponders.cpp index 154284eb6f..14433e5bad 100755 --- a/indra/newview/llassetuploadresponders.cpp +++ b/indra/newview/llassetuploadresponders.cpp @@ -610,7 +610,7 @@ void LLUpdateAgentInventoryResponder::uploadComplete(const LLSD& content) } } // Client LSL Bridge - if (gSavedSettings.getBOOL("UseLSLBridge")) + if (FSLSLBridge::instance().canUseBridge()) { FSLSLBridge::instance().checkBridgeScriptName(mFileName); } diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 0137d50032..37be33e564 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -2689,15 +2689,6 @@ BOOL LLPanelPreference::postBuild() } // -#ifdef OPENSIM // -// - if(LLGridManager::getInstance()->isInOpenSim() && !LLGridManager::getInstance()->isInAuroraSim() && hasChild("UseLSLBridge", TRUE)) - { - getChild("UseLSLBridge")->setEnabled(FALSE); - } -// -#endif // OPENSIM // - apply(); return true; } diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 70cc2c143b..7ebd3502ad 100755 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -2579,15 +2579,6 @@ LLWorld::getInstance()->addRegion(gFirstSimHandle, gFirstSim, first_sim_size_x, set_startup_status(1.0, "", ""); display_startup(); -// -#ifdef OPENSIM // - if (LLGridManager::getInstance()->isInOpenSim() && !LLGridManager::getInstance()->isInAuroraSim()) - { - gSavedSettings.setBOOL("UseLSLBridge", FALSE); - } -#endif // OPENSIM // -// - // Client LSL Bridge if (gSavedSettings.getBOOL("UseLSLBridge")) { diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 356fabc393..d3ed8fe9a9 100755 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -4295,12 +4295,7 @@ class FSSelfCheckMoveLock : public view_listener_t bool enable_bridge_function() { -#ifdef OPENSIM - if (LLGridManager::getInstance()->isInOpenSim() && !LLGridManager::getInstance()->isInAuroraSim()) - // No bridge on OpenSim yet. - return false; -#endif // OPENSIM - return (gSavedSettings.getBOOL("UseLSLBridge") && FSLSLBridge::instance().isBridgeValid()); + return FSLSLBridge::instance().canUseBridge(); } bool enable_move_lock() diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index e63b341f04..276f5dd4bf 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -4426,8 +4426,7 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data) case CHAT_TYPE_OWNER: // Client LSL Bridge { - static LLCachedControl sUseLSLBridge(gSavedSettings, "UseLSLBridge"); - if (sUseLSLBridge && FSLSLBridge::instance().lslToViewer(mesg, from_id, owner_id)) + if (FSLSLBridge::instance().lslToViewer(mesg, from_id, owner_id)) { return; } @@ -8367,7 +8366,7 @@ void process_teleport_failed(LLMessageSystem *msg, void**) gAgent.stopTyping(); llinfos << "Teleport error, reason=" << reason << llendl; - if ((!gSavedSettings.getBOOL("UseLSLBridge")) || + if (!FSLSLBridge::instance().canUseBridge() || (reason != "Could not teleport closer to destination")) { LLNotificationsUtil::add("CouldNotTeleportReason", args); From e9b2f0092dbf0555a49e5c2c787a6da42c0e39f9 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Sat, 5 Apr 2014 22:12:56 +0200 Subject: [PATCH 2/6] Don't detach LSL bridge when taking off all avatar attachments --- indra/newview/llappearancemgr.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index d0ae14b098..ed862939d0 100644 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -3893,6 +3893,12 @@ void LLAppearanceMgr::removeItemsFromAvatar(const uuid_vec_t& ids_to_remove) { continue; } + // LSL Bridge + if (FSLSLBridge::instance().canUseBridge() && linked_item == FSLSLBridge::instance().getBridge()) + { + continue; + } + // fUpdateAppearance = true; const LLUUID& linked_item_id = gInventory.getLinkedItemID(*it); From 0c2c71cc7a7e5a49e7741c4fbb15b8c5949dff9b Mon Sep 17 00:00:00 2001 From: Northspring Date: Sat, 5 Apr 2014 23:30:23 +0200 Subject: [PATCH 3/6] Updated Polish translation --- .../default/xui/pl/floater_preferences.xml | 2 +- .../skins/default/xui/pl/notifications.xml | 5 ++++- .../xui/pl/panel_preferences_privacy.xml | 2 +- .../default/xui/pl/panel_preferences_setup.xml | 18 ++++++++++++------ indra/newview/skins/default/xui/pl/strings.xml | 3 +++ 5 files changed, 21 insertions(+), 9 deletions(-) diff --git a/indra/newview/skins/default/xui/pl/floater_preferences.xml b/indra/newview/skins/default/xui/pl/floater_preferences.xml index b9cfb316a4..35e804089f 100755 --- a/indra/newview/skins/default/xui/pl/floater_preferences.xml +++ b/indra/newview/skins/default/xui/pl/floater_preferences.xml @@ -12,7 +12,7 @@ - + diff --git a/indra/newview/skins/default/xui/pl/notifications.xml b/indra/newview/skins/default/xui/pl/notifications.xml index ec03520e04..56b8c6f7bb 100755 --- a/indra/newview/skins/default/xui/pl/notifications.xml +++ b/indra/newview/skins/default/xui/pl/notifications.xml @@ -390,6 +390,9 @@ Czy na pewno chcesz kontynuować? Bufor danych zostanie przeniesiony po restarcie aplikacji [APP_NAME]. Pamiętaj: Opcja ta wyczyszcza bufor danych. + + Bufor dźwięków zostanie przeniesiony po restarcie aplikacji [APP_NAME]. + Ustawienia portu zostają zaktualizowane po restarcie aplikacji [APP_NAME]. @@ -3739,7 +3742,7 @@ Obecne ustawienie: [CURRENT_VALUE] Nie można śledzić tego awatara, ponieważ jest poza zasięgiem radaru. - Pamięć podręczna Twojej Przeglądarki jest pusta. Miej na uwadze, że możesz przez jakiś czas odczuwać obniżoną wydajność i spowolnione doczytywanie obiektów z Szafy. + Pamięć podręczna (bufor danych) Twojej Przeglądarki jest pusta. Miej na uwadze, że możesz przez jakiś czas odczuwać obniżoną wydajność i spowolnione doczytywanie obiektów z Szafy. Witaj w grupie wsparcia Phoenix/Firestorm! diff --git a/indra/newview/skins/default/xui/pl/panel_preferences_privacy.xml b/indra/newview/skins/default/xui/pl/panel_preferences_privacy.xml index ef9267b47f..e9423a2b34 100755 --- a/indra/newview/skins/default/xui/pl/panel_preferences_privacy.xml +++ b/indra/newview/skins/default/xui/pl/panel_preferences_privacy.xml @@ -5,7 +5,7 @@ Zaloguj się, by zmienić - + Date: Sun, 6 Apr 2014 13:39:43 +0200 Subject: [PATCH 6/6] Open media filter lists floater centered by default and save rect --- indra/newview/skins/default/xui/en/floater_media_lists.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/indra/newview/skins/default/xui/en/floater_media_lists.xml b/indra/newview/skins/default/xui/en/floater_media_lists.xml index e4dcf59825..c9f566a557 100644 --- a/indra/newview/skins/default/xui/en/floater_media_lists.xml +++ b/indra/newview/skins/default/xui/en/floater_media_lists.xml @@ -6,6 +6,8 @@ can_resize="true" height="254" name="floatermedialists" + positioning="centered" + save_rect="true" title="Media Lists" width="460" min_height="300"