From de7bae0930e4830bbb90f12652d9a75088d431de Mon Sep 17 00:00:00 2001
From: Armin Weatherwax
Date: Thu, 3 Feb 2011 22:24:21 +0100
Subject: Revolution Smythe: load voice module depending on login response
---
linden/indra/newview/app_settings/settings.xml | 12 +++++++++++-
linden/indra/newview/hippolimits.cpp | 5 ++++-
linden/indra/newview/hippolimits.h | 3 ++-
linden/indra/newview/kowopenregionsettings.cpp | 7 +++++++
linden/indra/newview/llvoiceclient.cpp | 23 +++++++++++++++++------
linden/indra/newview/llvoiceclient.h | 3 +++
6 files changed, 44 insertions(+), 9 deletions(-)
(limited to 'linden/indra/newview')
diff --git a/linden/indra/newview/app_settings/settings.xml b/linden/indra/newview/app_settings/settings.xml
index 17d4c3c..fbb51e8 100644
--- a/linden/indra/newview/app_settings/settings.xml
+++ b/linden/indra/newview/app_settings/settings.xml
@@ -37,7 +37,17 @@
Value
0
-
+ VoiceModule
+
AllowEditingOfTrees
diff --git a/linden/indra/newview/hippolimits.cpp b/linden/indra/newview/hippolimits.cpp
index d4c8efb..bb2e805 100644
--- a/linden/indra/newview/hippolimits.cpp
+++ b/linden/indra/newview/hippolimits.cpp
@@ -22,7 +22,8 @@ HippoLimits::HippoLimits()
mMinPrimScale(0.001f),
mMaxPrimScale(256.0f),
mMaxLinkedPrims(-1),
- mMaxDragDistance(0.f)
+ mMaxDragDistance(0.f),
+ mVoiceConnector("SLVoice")
{
setLimits();
}
@@ -68,6 +69,7 @@ void HippoLimits::setOpenSimLimits()
mEnableTeenMode = FALSE;
mEnforceMaxBuild = FALSE;
mRenderWater = TRUE;
+ mVoiceConnector = "SLVoice";
if (gHippoGridManager->getConnectedGrid()->isRenderCompat()) {
llinfos << "Using rendering compatible OpenSim limits" << llendl;
@@ -110,6 +112,7 @@ void HippoLimits::setSecondLifeLimits()
mEnableTeenMode = FALSE;
mEnforceMaxBuild = FALSE;
mRenderWater = TRUE;
+ mVoiceConnector = "SLVoice";
}
F32 HippoLimits::getMaxPrimScale() const
diff --git a/linden/indra/newview/hippolimits.h b/linden/indra/newview/hippolimits.h
index 7792a2c..9d6b2f6 100644
--- a/linden/indra/newview/hippolimits.h
+++ b/linden/indra/newview/hippolimits.h
@@ -14,7 +14,7 @@ public:
const S32& getMaxLinkedPrims() const { return mMaxLinkedPrims; }
const S32& getMaxPhysLinkedPrims() const { return mMaxPhysLinkedPrims; }
const F32& getMaxInventoryItemsTransfer() const { return mMaxInventoryItemsTransfer; }
-
+ const std::string& getVoiceConnector() const { return mVoiceConnector; }
// Returns the max prim size we can use on a grid
F32 getMinPrimScale() const;
@@ -59,6 +59,7 @@ public:
BOOL mEnableTeenMode;
BOOL mEnforceMaxBuild;
BOOL mRenderWater;
+ std::string mVoiceConnector;
private:
void setOpenSimLimits();
diff --git a/linden/indra/newview/kowopenregionsettings.cpp b/linden/indra/newview/kowopenregionsettings.cpp
index 8aac87c..ef14d2a 100644
--- a/linden/indra/newview/kowopenregionsettings.cpp
+++ b/linden/indra/newview/kowopenregionsettings.cpp
@@ -36,6 +36,7 @@
#include "llviewerobject.h"
#include "llfloaterregioninfo.h"
#include "llfloaterworldmap.h"
+#include "llvoiceclient.h"
//DEBUG includes
//#include "llsdserialize.h" //LLSDNotationStreamer - for dumping LLSD to string
@@ -200,6 +201,12 @@ class OpenRegionInfoUpdate : public LLHTTPNode
{
gHippoLimits->mAllowParcelWindLight = body["AllowParcelWindLight"].asInteger() == 1;
}
+ if ( body.has("Voice") )
+ {
+ gSavedSettings.setString("VoiceModule", body["Voice"].asString());
+ //gVoiceClient->close();
+ //gVoiceClient->start();
+ }
if (limitschanged)
gFloaterTools->updateToolsSizeLimits();
diff --git a/linden/indra/newview/llvoiceclient.cpp b/linden/indra/newview/llvoiceclient.cpp
index 7b1ed95..5517ca2 100644
--- a/linden/indra/newview/llvoiceclient.cpp
+++ b/linden/indra/newview/llvoiceclient.cpp
@@ -62,6 +62,7 @@
#include "llfirstuse.h"
#include "llviewerwindow.h"
#include "llviewercamera.h"
+#include "hippolimits.h"
#include "llfloaterfriends.h" //VIVOX, inorder to refresh communicate panel
#include "llfloaterchat.h" // for LLFloaterChat::addChat()
@@ -1524,6 +1525,15 @@ void LLVoiceClient::setState(state inState)
mState = inState;
}
+void LLVoiceClient::close()
+{
+ setState(stateDisableCleanup);
+}
+
+void LLVoiceClient::start()
+{
+ setState(stateStart);
+}
void LLVoiceClient::stateMachine()
{
@@ -1654,12 +1664,12 @@ void LLVoiceClient::stateMachine()
//std::string exe_path = gDirUtilp->getAppRODataDir();
std::string exe_path = gDirUtilp->getExecutableDir();
exe_path += gDirUtilp->getDirDelimiter();
+#if LL_DARWIN
+ exe_path += "../Resources/";
+#endif
+ exe_path += gSavedSettings.getString("VoiceModule");
#if LL_WINDOWS
- exe_path += "SLVoice.exe";
-#elif LL_DARWIN
- exe_path += "../Resources/SLVoice";
-#else
- exe_path += "SLVoice";
+ exe_path += ".exe";
#endif
// See if the vivox executable exists
llstat s;
@@ -1687,7 +1697,8 @@ void LLVoiceClient::stateMachine()
STARTUPINFOA sinfo;
memset(&sinfo, 0, sizeof(sinfo));
std::string exe_dir = gDirUtilp->getAppRODataDir();
- cmd = "SLVoice.exe";
+ cmd = gSavedSettings.getString("VoiceModule");
+ cmd += ".exe";
cmd += args;
// So retarded. Windows requires that the second parameter to CreateProcessA be a writable (non-const) string...
diff --git a/linden/indra/newview/llvoiceclient.h b/linden/indra/newview/llvoiceclient.h
index cfc336b..9ef3be9 100644
--- a/linden/indra/newview/llvoiceclient.h
+++ b/linden/indra/newview/llvoiceclient.h
@@ -516,6 +516,9 @@ static void updatePosition(void);
// Currently this will be false only for PSTN P2P calls.
// NOTE: this will return true if the session can't be found.
bool isSessionTextIMPossible(const LLUUID &session_id);
+
+ void close();
+ void start();
private:
--
cgit v1.1