mirror of
https://github.com/FirestormViewer/phoenix-firestorm.git
synced 2026-08-14 00:48:30 +00:00
[FIRE-36421] Add custom WebRTC STUN server support for OpenSim
This commit is contained in:
@@ -2715,6 +2715,12 @@ void LLViewerRegion::setSimulatorFeatures(const LLSD& sim_features)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
mStunServers.clear();
|
||||
if (mSimulatorFeatures.has("stun-servers"))
|
||||
{
|
||||
LLStringUtil::getTokens(mSimulatorFeatures["stun-servers"].asString(), mStunServers, ",");
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -380,7 +380,8 @@ public:
|
||||
|
||||
// </FS:CR>
|
||||
#ifdef OPENSIM
|
||||
const std::set<std::string, std::less<>>& getGods() const { return mGodNames; };
|
||||
const std::set<std::string, std::less<>>& getGods() const { return mGodNames; }
|
||||
const std::vector<std::string> GetStunServers() const { return mStunServers; }
|
||||
#endif // OPENSIM
|
||||
// </FS:CR>
|
||||
|
||||
@@ -625,6 +626,7 @@ public:
|
||||
// <FS:CR> Opensim region capabilities
|
||||
#ifdef OPENSIM
|
||||
std::set<std::string, std::less<>> mGodNames;
|
||||
std::vector<std::string> mStunServers;
|
||||
#endif
|
||||
// </FS:CR>
|
||||
|
||||
|
||||
@@ -2886,6 +2886,20 @@ static llwebrtc::LLWebRTCPeerConnectionInterface::InitOptions getConnectionOptio
|
||||
// TODO: Pull these from login
|
||||
std::string grid = LLGridManager::getInstance()->getGridLoginID();
|
||||
std::transform(grid.begin(), grid.end(), grid.begin(), [](unsigned char c){ return std::tolower(c); });
|
||||
// <FS:TJ> [FIRE-36421] Add OpenSim STUN server support
|
||||
#ifdef OPENSIM
|
||||
if (!LLGridManager::getInstance()->isInSecondLife())
|
||||
{
|
||||
LLViewerRegion* regionp = gAgent.getRegion();
|
||||
if (regionp) {
|
||||
std::vector<std::string> stunServers = regionp->GetStunServers();
|
||||
servers.mUrls = regionp->GetStunServers();
|
||||
}
|
||||
options.mServers.push_back(servers);
|
||||
return options;
|
||||
}
|
||||
#endif
|
||||
// </FS:TJ>
|
||||
int num_servers = 2;
|
||||
if (grid == "agni")
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user