mirror of
https://github.com/opensim/opensim.git
synced 2026-08-17 19:47:32 +08:00
Compare commits
35 Commits
0.7-releas
...
0.7.0.1-re
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
105a51e3dd | ||
|
|
e971b1606f | ||
|
|
b280b8218e | ||
|
|
b0c86fea4c | ||
|
|
f30cd8391e | ||
|
|
d44b7d9637 | ||
|
|
a0fa6dc967 | ||
|
|
db629af6d3 | ||
|
|
dc08e1cbf9 | ||
|
|
73678947da | ||
|
|
2f52a3a153 | ||
|
|
8b6f39b206 | ||
|
|
b9dc4ab4a1 | ||
|
|
d97c741e67 | ||
|
|
a34add9534 | ||
|
|
ed3073eae1 | ||
|
|
eafe6b294e | ||
|
|
fb23093087 | ||
|
|
a46538485b | ||
|
|
62ffc566c3 | ||
|
|
df976c9eb4 | ||
|
|
63dd24a651 | ||
|
|
692e684ced | ||
|
|
875a623654 | ||
|
|
81751a1753 | ||
|
|
44332d145a | ||
|
|
4a7588b0f0 | ||
|
|
72060741e1 | ||
|
|
4fcf76eb0b | ||
|
|
0e3daf703f | ||
|
|
02aa938ce1 | ||
|
|
18117d8c9a | ||
|
|
536699cf43 | ||
|
|
79d33418f0 | ||
|
|
2f562639b9 |
@@ -20,6 +20,7 @@
|
||||
<delete dir="${distbindir}/.nant"/>
|
||||
<delete>
|
||||
<fileset basedir="${distbindir}">
|
||||
<include name="compile.bat"/>
|
||||
<include name="BUILDING.txt"/>
|
||||
<include name="Makefile"/>
|
||||
<include name="nant-color"/>
|
||||
@@ -29,7 +30,7 @@
|
||||
<include name="TESTING.txt"/>
|
||||
<include name="TestResult.xml"/>
|
||||
<include name="bin/OpenSim.Server.ini"/>
|
||||
<include name="bin/Regions/*"/>
|
||||
<include name="bin/Regions/Regions.ini"/>
|
||||
<include name="bin/*.db"/>
|
||||
<include name="**/.git/**"/>
|
||||
<include name=".gitignore"/>
|
||||
|
||||
@@ -62,6 +62,7 @@ namespace OpenSim.Data
|
||||
|
||||
List<RegionData> GetDefaultRegions(UUID scopeID);
|
||||
List<RegionData> GetFallbackRegions(UUID scopeID, int x, int y);
|
||||
List<RegionData> GetHyperlinks(UUID scopeID);
|
||||
}
|
||||
|
||||
[Flags]
|
||||
|
||||
@@ -310,23 +310,23 @@ namespace OpenSim.Data.MSSQL
|
||||
|
||||
public List<RegionData> GetDefaultRegions(UUID scopeID)
|
||||
{
|
||||
string sql = "SELECT * FROM [" + m_Realm + "] WHERE (flags & 1) <> 0";
|
||||
if (scopeID != UUID.Zero)
|
||||
sql += " AND ScopeID = @scopeID";
|
||||
|
||||
using (SqlConnection conn = new SqlConnection(m_ConnectionString))
|
||||
using (SqlCommand cmd = new SqlCommand(sql, conn))
|
||||
{
|
||||
cmd.Parameters.Add(m_database.CreateParameter("@scopeID", scopeID));
|
||||
conn.Open();
|
||||
return RunCommand(cmd);
|
||||
}
|
||||
|
||||
return Get((int)RegionFlags.DefaultRegion, scopeID);
|
||||
}
|
||||
|
||||
public List<RegionData> GetFallbackRegions(UUID scopeID, int x, int y)
|
||||
{
|
||||
string sql = "SELECT * FROM [" + m_Realm + "] WHERE (flags & 2) <> 0";
|
||||
// TODO: distance-sort results
|
||||
return Get((int)RegionFlags.FallbackRegion, scopeID);
|
||||
}
|
||||
|
||||
public List<RegionData> GetHyperlinks(UUID scopeID)
|
||||
{
|
||||
return Get((int)RegionFlags.Hyperlink, scopeID);
|
||||
}
|
||||
|
||||
private List<RegionData> Get(int regionFlags, UUID scopeID)
|
||||
{
|
||||
string sql = "SELECT * FROM [" + m_Realm + "] WHERE (flags & " + regionFlags.ToString() + ") <> 0";
|
||||
if (scopeID != UUID.Zero)
|
||||
sql += " AND ScopeID = @scopeID";
|
||||
|
||||
@@ -335,7 +335,6 @@ namespace OpenSim.Data.MSSQL
|
||||
{
|
||||
cmd.Parameters.Add(m_database.CreateParameter("@scopeID", scopeID));
|
||||
conn.Open();
|
||||
// TODO: distance-sort results
|
||||
return RunCommand(cmd);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -281,22 +281,26 @@ namespace OpenSim.Data.MySQL
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public List<RegionData> GetDefaultRegions(UUID scopeID)
|
||||
{
|
||||
string command = "select * from `"+m_Realm+"` where (flags & 1) <> 0";
|
||||
if (scopeID != UUID.Zero)
|
||||
command += " and ScopeID = ?scopeID";
|
||||
|
||||
MySqlCommand cmd = new MySqlCommand(command);
|
||||
|
||||
cmd.Parameters.AddWithValue("?scopeID", scopeID.ToString());
|
||||
|
||||
return RunCommand(cmd);
|
||||
return Get((int)RegionFlags.DefaultRegion, scopeID);
|
||||
}
|
||||
|
||||
public List<RegionData> GetFallbackRegions(UUID scopeID, int x, int y)
|
||||
{
|
||||
string command = "select * from `"+m_Realm+"` where (flags & 2) <> 0";
|
||||
// TODO: distance-sort results
|
||||
return Get((int)RegionFlags.FallbackRegion, scopeID);
|
||||
}
|
||||
|
||||
public List<RegionData> GetHyperlinks(UUID scopeID)
|
||||
{
|
||||
return Get((int)RegionFlags.Hyperlink, scopeID);
|
||||
}
|
||||
|
||||
private List<RegionData> Get(int regionFlags, UUID scopeID)
|
||||
{
|
||||
string command = "select * from `" + m_Realm + "` where (flags & " + regionFlags.ToString() + ") <> 0";
|
||||
if (scopeID != UUID.Zero)
|
||||
command += " and ScopeID = ?scopeID";
|
||||
|
||||
@@ -304,7 +308,6 @@ namespace OpenSim.Data.MySQL
|
||||
|
||||
cmd.Parameters.AddWithValue("?scopeID", scopeID.ToString());
|
||||
|
||||
// TODO: distance-sort results
|
||||
return RunCommand(cmd);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -164,30 +164,29 @@ namespace OpenSim.Data.Null
|
||||
|
||||
public List<RegionData> GetDefaultRegions(UUID scopeID)
|
||||
{
|
||||
if (Instance != this)
|
||||
return Instance.GetDefaultRegions(scopeID);
|
||||
|
||||
List<RegionData> ret = new List<RegionData>();
|
||||
|
||||
foreach (RegionData r in m_regionData.Values)
|
||||
{
|
||||
if ((Convert.ToInt32(r.Data["flags"]) & 1) != 0)
|
||||
ret.Add(r);
|
||||
}
|
||||
|
||||
return ret;
|
||||
return Get((int)RegionFlags.DefaultRegion, scopeID);
|
||||
}
|
||||
|
||||
public List<RegionData> GetFallbackRegions(UUID scopeID, int x, int y)
|
||||
{
|
||||
return Get((int)RegionFlags.FallbackRegion, scopeID);
|
||||
}
|
||||
|
||||
public List<RegionData> GetHyperlinks(UUID scopeID)
|
||||
{
|
||||
return Get((int)RegionFlags.Hyperlink, scopeID);
|
||||
}
|
||||
|
||||
private List<RegionData> Get(int regionFlags, UUID scopeID)
|
||||
{
|
||||
if (Instance != this)
|
||||
return Instance.GetFallbackRegions(scopeID, x, y);
|
||||
return Instance.Get(regionFlags, scopeID);
|
||||
|
||||
List<RegionData> ret = new List<RegionData>();
|
||||
|
||||
foreach (RegionData r in m_regionData.Values)
|
||||
{
|
||||
if ((Convert.ToInt32(r.Data["flags"]) & 2) != 0)
|
||||
if ((Convert.ToInt32(r.Data["flags"]) & regionFlags) != 0)
|
||||
ret.Add(r);
|
||||
}
|
||||
|
||||
|
||||
@@ -31,6 +31,7 @@ using System.Net.Sockets;
|
||||
using System.Net;
|
||||
using System.Net.NetworkInformation;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using log4net;
|
||||
|
||||
namespace OpenSim.Framework
|
||||
@@ -180,8 +181,16 @@ namespace OpenSim.Framework
|
||||
throw new ArgumentException("[NetworkUtil] Unable to resolve defaultHostname to an IPv4 address for an IPv4 client");
|
||||
}
|
||||
|
||||
static IPAddress externalIPAddress;
|
||||
|
||||
static NetworkUtil()
|
||||
{
|
||||
try
|
||||
{
|
||||
externalIPAddress = GetExternalIP();
|
||||
}
|
||||
catch { /* ignore */ }
|
||||
|
||||
try
|
||||
{
|
||||
foreach (NetworkInterface ni in NetworkInterface.GetAllNetworkInterfaces())
|
||||
@@ -244,5 +253,80 @@ namespace OpenSim.Framework
|
||||
}
|
||||
return defaultHostname;
|
||||
}
|
||||
|
||||
public static IPAddress GetExternalIPOf(IPAddress user)
|
||||
{
|
||||
if (externalIPAddress == null)
|
||||
return user;
|
||||
|
||||
if (user.ToString() == "127.0.0.1")
|
||||
{
|
||||
m_log.Info("[NetworkUtil] 127.0.0.1 user detected, sending '" + externalIPAddress + "' instead of '" + user + "'");
|
||||
return externalIPAddress;
|
||||
}
|
||||
// Check if we're accessing localhost.
|
||||
foreach (IPAddress host in Dns.GetHostAddresses(Dns.GetHostName()))
|
||||
{
|
||||
if (host.Equals(user) && host.AddressFamily == AddressFamily.InterNetwork)
|
||||
{
|
||||
m_log.Info("[NetworkUtil] Localhost user detected, sending '" + externalIPAddress + "' instead of '" + user + "'");
|
||||
return externalIPAddress;
|
||||
}
|
||||
}
|
||||
|
||||
// Check for same LAN segment
|
||||
foreach (KeyValuePair<IPAddress, IPAddress> subnet in m_subnets)
|
||||
{
|
||||
byte[] subnetBytes = subnet.Value.GetAddressBytes();
|
||||
byte[] localBytes = subnet.Key.GetAddressBytes();
|
||||
byte[] destBytes = user.GetAddressBytes();
|
||||
|
||||
if (subnetBytes.Length != destBytes.Length || subnetBytes.Length != localBytes.Length)
|
||||
return user;
|
||||
|
||||
bool valid = true;
|
||||
|
||||
for (int i = 0; i < subnetBytes.Length; i++)
|
||||
{
|
||||
if ((localBytes[i] & subnetBytes[i]) != (destBytes[i] & subnetBytes[i]))
|
||||
{
|
||||
valid = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (subnet.Key.AddressFamily != AddressFamily.InterNetwork)
|
||||
valid = false;
|
||||
|
||||
if (valid)
|
||||
{
|
||||
m_log.Info("[NetworkUtil] Local LAN user detected, sending '" + externalIPAddress + "' instead of '" + user + "'");
|
||||
return externalIPAddress;
|
||||
}
|
||||
}
|
||||
|
||||
// Otherwise, return user address
|
||||
return user;
|
||||
}
|
||||
|
||||
private static IPAddress GetExternalIP()
|
||||
{
|
||||
string whatIsMyIp = "http://www.whatismyip.com/automation/n09230945.asp";
|
||||
WebClient wc = new WebClient();
|
||||
UTF8Encoding utf8 = new UTF8Encoding();
|
||||
string requestHtml = "";
|
||||
try
|
||||
{
|
||||
requestHtml = utf8.GetString(wc.DownloadData(whatIsMyIp));
|
||||
}
|
||||
catch (WebException we)
|
||||
{
|
||||
m_log.Info("[NetworkUtil]: Exception in GetExternalIP: " + we.ToString());
|
||||
return null;
|
||||
}
|
||||
|
||||
IPAddress externalIp = IPAddress.Parse(requestHtml);
|
||||
return externalIp;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -319,6 +319,13 @@ namespace OpenSim.Framework.Servers.HttpServer
|
||||
OSHttpRequest req = new OSHttpRequest(context, request);
|
||||
OSHttpResponse resp = new OSHttpResponse(new HttpResponse(context, request),context);
|
||||
HandleRequest(req, resp);
|
||||
|
||||
// !!!HACK ALERT!!!
|
||||
// There seems to be a bug in the underlying http code that makes subsequent requests
|
||||
// come up with trash in Accept headers. Until that gets fixed, we're cleaning them up here.
|
||||
if (request.AcceptTypes != null)
|
||||
for (int i = 0; i < request.AcceptTypes.Length; i++)
|
||||
request.AcceptTypes[i] = string.Empty;
|
||||
}
|
||||
|
||||
// public void ConvertIHttpClientContextToOSHttp(object stateinfo)
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace OpenSim
|
||||
{
|
||||
public class VersionInfo
|
||||
{
|
||||
private const string VERSION_NUMBER = "0.7";
|
||||
private const string VERSION_NUMBER = "0.7.0.1";
|
||||
private const Flavour VERSION_FLAVOUR = Flavour.Release;
|
||||
|
||||
public enum Flavour
|
||||
|
||||
@@ -307,21 +307,6 @@ namespace OpenSim
|
||||
config.Set("EventQueue", true);
|
||||
}
|
||||
|
||||
{
|
||||
IConfig config = defaultConfig.Configs["StandAlone"];
|
||||
|
||||
if (null == config)
|
||||
config = defaultConfig.AddConfig("StandAlone");
|
||||
|
||||
config.Set("accounts_authenticate", true);
|
||||
config.Set("welcome_message", "Welcome to OpenSimulator");
|
||||
config.Set("inventory_plugin", "OpenSim.Data.SQLite.dll");
|
||||
config.Set("inventory_source", "");
|
||||
config.Set("userDatabase_plugin", "OpenSim.Data.SQLite.dll");
|
||||
config.Set("user_source", "");
|
||||
config.Set("LibrariesXMLFile", string.Format(".{0}inventory{0}Libraries.xml", Path.DirectorySeparatorChar));
|
||||
}
|
||||
|
||||
{
|
||||
IConfig config = defaultConfig.Configs["Network"];
|
||||
|
||||
|
||||
@@ -233,6 +233,11 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
|
||||
return m_GridService.GetFallbackRegions(scopeID, x, y);
|
||||
}
|
||||
|
||||
public List<GridRegion> GetHyperlinks(UUID scopeID)
|
||||
{
|
||||
return m_GridService.GetHyperlinks(scopeID);
|
||||
}
|
||||
|
||||
public int GetRegionFlags(UUID scopeID, UUID regionID)
|
||||
{
|
||||
return m_GridService.GetRegionFlags(scopeID, regionID);
|
||||
|
||||
@@ -136,6 +136,11 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid.Tests
|
||||
900 * (int)Constants.RegionSize, 1100 * (int)Constants.RegionSize);
|
||||
Assert.IsNotNull(results, "Retrieved GetRegionRange list is null");
|
||||
Assert.That(results.Count, Is.EqualTo(2), "Retrieved neighbour collection is not the number expected");
|
||||
|
||||
results = m_LocalConnector.GetHyperlinks(UUID.Zero);
|
||||
Assert.IsNotNull(results, "Retrieved GetHyperlinks list is null");
|
||||
Assert.That(results.Count, Is.EqualTo(0), "Retrieved linked regions collection is not the number expected");
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2728,7 +2728,9 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
IUserAgentVerificationModule userVerification = RequestModuleInterface<IUserAgentVerificationModule>();
|
||||
if (userVerification != null && ep != null)
|
||||
{
|
||||
if (!userVerification.VerifyClient(aCircuit, ep.Address.ToString()))
|
||||
System.Net.IPAddress addr = NetworkUtil.GetExternalIPOf(ep.Address);
|
||||
|
||||
if (!userVerification.VerifyClient(aCircuit, /*ep.Address.ToString() */ addr.ToString()))
|
||||
{
|
||||
// uh-oh, this is fishy
|
||||
m_log.DebugFormat("[Scene]: User Client Verification for {0} {1} in {2} returned false", aCircuit.firstname, aCircuit.lastname, RegionInfo.RegionName);
|
||||
|
||||
@@ -1999,8 +1999,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
/// </summary>
|
||||
public void ScheduleGroupForFullUpdate()
|
||||
{
|
||||
if (IsAttachment)
|
||||
m_log.DebugFormat("[SOG]: Scheduling full update for {0} {1}", Name, LocalId);
|
||||
// if (IsAttachment)
|
||||
// m_log.DebugFormat("[SOG]: Scheduling full update for {0} {1}", Name, LocalId);
|
||||
|
||||
checkAtTargets();
|
||||
RootPart.ScheduleFullUpdate();
|
||||
|
||||
@@ -930,7 +930,12 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
/// </summary>
|
||||
public void MakeChildAgent()
|
||||
{
|
||||
Animator.ResetAnimations();
|
||||
// It looks like m_animator is set to null somewhere, and MakeChild
|
||||
// is called after that. Probably in aborted teleports.
|
||||
if (m_animator == null)
|
||||
m_animator = new ScenePresenceAnimator(this);
|
||||
else
|
||||
Animator.ResetAnimations();
|
||||
|
||||
// m_log.DebugFormat(
|
||||
// "[SCENEPRESENCE]: Downgrading root agent {0}, {1} to a child agent in {2}",
|
||||
|
||||
@@ -1934,13 +1934,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
}
|
||||
else
|
||||
{
|
||||
if (llVecDist(new LSL_Vector(0,0,0), targetPos) <= 10.0f)
|
||||
{
|
||||
part.OffsetPosition = new Vector3((float)targetPos.x, (float)targetPos.y, (float)targetPos.z);
|
||||
SceneObjectGroup parent = part.ParentGroup;
|
||||
parent.HasGroupChanged = true;
|
||||
parent.ScheduleGroupForTerseUpdate();
|
||||
}
|
||||
LSL_Vector rel_vec = SetPosAdjust(currentPos, targetPos);
|
||||
part.OffsetPosition = new Vector3((float)rel_vec.x, (float)rel_vec.y, (float)rel_vec.z);
|
||||
SceneObjectGroup parent = part.ParentGroup;
|
||||
parent.HasGroupChanged = true;
|
||||
parent.ScheduleGroupForTerseUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -770,8 +770,10 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
||||
item.Name, startParam, postOnRez,
|
||||
stateSource, m_MaxScriptQueue);
|
||||
|
||||
m_log.DebugFormat("[XEngine] Loaded script {0}.{1}, script UUID {2}, prim UUID {3} @ {4}",
|
||||
part.ParentGroup.RootPart.Name, item.Name, assetID, part.UUID, part.ParentGroup.RootPart.AbsolutePosition.ToString());
|
||||
m_log.DebugFormat(
|
||||
"[XEngine] Loaded script {0}.{1}, script UUID {2}, prim UUID {3} @ {4}.{5}",
|
||||
part.ParentGroup.RootPart.Name, item.Name, assetID, part.UUID,
|
||||
part.ParentGroup.RootPart.AbsolutePosition, part.ParentGroup.Scene.RegionInfo.RegionName);
|
||||
|
||||
if (presence != null)
|
||||
{
|
||||
|
||||
@@ -109,6 +109,9 @@ namespace OpenSim.Server.Handlers.Grid
|
||||
case "get_fallback_regions":
|
||||
return GetFallbackRegions(request);
|
||||
|
||||
case "get_hyperlinks":
|
||||
return GetHyperlinks(request);
|
||||
|
||||
case "get_region_flags":
|
||||
return GetRegionFlags(request);
|
||||
}
|
||||
@@ -483,6 +486,36 @@ namespace OpenSim.Server.Handlers.Grid
|
||||
return encoding.GetBytes(xmlString);
|
||||
}
|
||||
|
||||
byte[] GetHyperlinks(Dictionary<string, object> request)
|
||||
{
|
||||
//m_log.DebugFormat("[GRID HANDLER]: GetHyperlinks");
|
||||
UUID scopeID = UUID.Zero;
|
||||
if (request.ContainsKey("SCOPEID"))
|
||||
UUID.TryParse(request["SCOPEID"].ToString(), out scopeID);
|
||||
else
|
||||
m_log.WarnFormat("[GRID HANDLER]: no scopeID in request to get linked regions");
|
||||
|
||||
List<GridRegion> rinfos = m_GridService.GetHyperlinks(scopeID);
|
||||
|
||||
Dictionary<string, object> result = new Dictionary<string, object>();
|
||||
if ((rinfos == null) || ((rinfos != null) && (rinfos.Count == 0)))
|
||||
result["result"] = "null";
|
||||
else
|
||||
{
|
||||
int i = 0;
|
||||
foreach (GridRegion rinfo in rinfos)
|
||||
{
|
||||
Dictionary<string, object> rinfoDict = rinfo.ToKeyValuePairs();
|
||||
result["region" + i] = rinfoDict;
|
||||
i++;
|
||||
}
|
||||
}
|
||||
string xmlString = ServerUtils.BuildXmlResponse(result);
|
||||
//m_log.DebugFormat("[GRID HANDLER]: resp string: {0}", xmlString);
|
||||
UTF8Encoding encoding = new UTF8Encoding();
|
||||
return encoding.GetBytes(xmlString);
|
||||
}
|
||||
|
||||
byte[] GetRegionFlags(Dictionary<string, object> request)
|
||||
{
|
||||
UUID scopeID = UUID.Zero;
|
||||
|
||||
@@ -556,6 +556,56 @@ namespace OpenSim.Services.Connectors
|
||||
return rinfos;
|
||||
}
|
||||
|
||||
public List<GridRegion> GetHyperlinks(UUID scopeID)
|
||||
{
|
||||
Dictionary<string, object> sendData = new Dictionary<string, object>();
|
||||
|
||||
sendData["SCOPEID"] = scopeID.ToString();
|
||||
|
||||
sendData["METHOD"] = "get_hyperlinks";
|
||||
|
||||
List<GridRegion> rinfos = new List<GridRegion>();
|
||||
string reply = string.Empty;
|
||||
try
|
||||
{
|
||||
reply = SynchronousRestFormsRequester.MakeRequest("POST",
|
||||
m_ServerURI + "/grid",
|
||||
ServerUtils.BuildQueryString(sendData));
|
||||
|
||||
//m_log.DebugFormat("[GRID CONNECTOR]: reply was {0}", reply);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.DebugFormat("[GRID CONNECTOR]: Exception when contacting grid server: {0}", e.Message);
|
||||
return rinfos;
|
||||
}
|
||||
|
||||
if (reply != string.Empty)
|
||||
{
|
||||
Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(reply);
|
||||
|
||||
if (replyData != null)
|
||||
{
|
||||
Dictionary<string, object>.ValueCollection rinfosList = replyData.Values;
|
||||
foreach (object r in rinfosList)
|
||||
{
|
||||
if (r is Dictionary<string, object>)
|
||||
{
|
||||
GridRegion rinfo = new GridRegion((Dictionary<string, object>)r);
|
||||
rinfos.Add(rinfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
m_log.DebugFormat("[GRID CONNECTOR]: GetHyperlinks {0} received null response",
|
||||
scopeID);
|
||||
}
|
||||
else
|
||||
m_log.DebugFormat("[GRID CONNECTOR]: GetHyperlinks received null reply");
|
||||
|
||||
return rinfos;
|
||||
}
|
||||
|
||||
public virtual int GetRegionFlags(UUID scopeID, UUID regionID)
|
||||
{
|
||||
Dictionary<string, object> sendData = new Dictionary<string, object>();
|
||||
|
||||
@@ -358,7 +358,7 @@ namespace OpenSim.Services.Connectors.Hypergrid
|
||||
|
||||
private bool GetBoolResponse(XmlRpcRequest request, out string reason)
|
||||
{
|
||||
//m_log.Debug("[HGrid]: Linking to " + uri);
|
||||
//m_log.Debug("[USER AGENT CONNECTOR]: GetBoolResponse from/to " + m_ServerURL);
|
||||
XmlRpcResponse response = null;
|
||||
try
|
||||
{
|
||||
@@ -366,14 +366,14 @@ namespace OpenSim.Services.Connectors.Hypergrid
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.Debug("[USER AGENT CONNECTOR]: Unable to contact remote server ");
|
||||
m_log.DebugFormat("[USER AGENT CONNECTOR]: Unable to contact remote server {0}", m_ServerURL);
|
||||
reason = "Exception: " + e.Message;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (response.IsFault)
|
||||
{
|
||||
m_log.ErrorFormat("[HGrid]: remote call returned an error: {0}", response.FaultString);
|
||||
m_log.ErrorFormat("[HGrid]: remote call to {0} returned an error: {1}", m_ServerURL, response.FaultString);
|
||||
reason = "XMLRPC Fault";
|
||||
return false;
|
||||
}
|
||||
@@ -383,15 +383,29 @@ namespace OpenSim.Services.Connectors.Hypergrid
|
||||
// m_log.Debug(">> " + ((DictionaryEntry)o).Key + ":" + ((DictionaryEntry)o).Value);
|
||||
try
|
||||
{
|
||||
if (hash == null)
|
||||
{
|
||||
m_log.ErrorFormat("[USER AGENT CONNECTOR]: Got null response from {0}! THIS IS BAAAAD", m_ServerURL);
|
||||
reason = "Internal error 1";
|
||||
return false;
|
||||
}
|
||||
bool success = false;
|
||||
reason = string.Empty;
|
||||
Boolean.TryParse((string)hash["result"], out success);
|
||||
if (hash.ContainsKey("result"))
|
||||
Boolean.TryParse((string)hash["result"], out success);
|
||||
else
|
||||
{
|
||||
reason = "Internal error 2";
|
||||
m_log.WarnFormat("[USER AGENT CONNECTOR]: response from {0} does not have expected key 'result'", m_ServerURL);
|
||||
}
|
||||
|
||||
return success;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.Error("[HGrid]: Got exception while parsing GetEndPoint response " + e.StackTrace);
|
||||
m_log.ErrorFormat("[HGrid]: Got exception on GetBoolResponse response.");
|
||||
if (hash.ContainsKey("result") && hash["result"] != null)
|
||||
m_log.ErrorFormat("Reply was ", (string)hash["result"]);
|
||||
reason = "Exception: " + e.Message;
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -357,6 +357,12 @@ namespace OpenSim.Services.Connectors.SimianGrid
|
||||
return new List<GridRegion>(0);
|
||||
}
|
||||
|
||||
public List<GridRegion> GetHyperlinks(UUID scopeID)
|
||||
{
|
||||
// Hypergrid/linked regions are not supported
|
||||
return new List<GridRegion>();
|
||||
}
|
||||
|
||||
public int GetRegionFlags(UUID scopeID, UUID regionID)
|
||||
{
|
||||
const int REGION_ONLINE = 4;
|
||||
|
||||
@@ -50,7 +50,7 @@ namespace OpenSim.Services.GridService
|
||||
private bool m_DeleteOnUnregister = true;
|
||||
private static GridService m_RootInstance = null;
|
||||
protected IConfigSource m_config;
|
||||
protected HypergridLinker m_HypergridLinker;
|
||||
protected static HypergridLinker m_HypergridLinker;
|
||||
|
||||
protected IAuthenticationService m_AuthenticationService = null;
|
||||
protected bool m_AllowDuplicateNames = false;
|
||||
@@ -124,7 +124,7 @@ namespace OpenSim.Services.GridService
|
||||
{
|
||||
// Regions reserved for the null key cannot be taken.
|
||||
if ((string)region.Data["PrincipalID"] == UUID.Zero.ToString())
|
||||
return "Region location us reserved";
|
||||
return "Region location is reserved";
|
||||
|
||||
// Treat it as an auth request
|
||||
//
|
||||
@@ -210,6 +210,7 @@ namespace OpenSim.Services.GridService
|
||||
{
|
||||
int newFlags = 0;
|
||||
string regionName = rdata.RegionName.Trim().Replace(' ', '_');
|
||||
newFlags = ParseFlags(newFlags, gridConfig.GetString("DefaultRegionFlags", String.Empty));
|
||||
newFlags = ParseFlags(newFlags, gridConfig.GetString("Region_" + regionName, String.Empty));
|
||||
newFlags = ParseFlags(newFlags, gridConfig.GetString("Region_" + rdata.RegionID.ToString(), String.Empty));
|
||||
rdata.Data["flags"] = newFlags.ToString();
|
||||
@@ -425,6 +426,22 @@ namespace OpenSim.Services.GridService
|
||||
return ret;
|
||||
}
|
||||
|
||||
public List<GridRegion> GetHyperlinks(UUID scopeID)
|
||||
{
|
||||
List<GridRegion> ret = new List<GridRegion>();
|
||||
|
||||
List<RegionData> regions = m_Database.GetHyperlinks(scopeID);
|
||||
|
||||
foreach (RegionData r in regions)
|
||||
{
|
||||
if ((Convert.ToInt32(r.Data["flags"]) & (int)OpenSim.Data.RegionFlags.RegionOnline) != 0)
|
||||
ret.Add(RegionData2RegionInfo(r));
|
||||
}
|
||||
|
||||
m_log.DebugFormat("[GRID SERVICE]: Hyperlinks returned {0} regions", ret.Count);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public int GetRegionFlags(UUID scopeID, UUID regionID)
|
||||
{
|
||||
RegionData region = m_Database.Get(regionID, scopeID);
|
||||
|
||||
@@ -62,6 +62,7 @@ namespace OpenSim.Services.GridService
|
||||
protected GatekeeperServiceConnector m_GatekeeperConnector;
|
||||
|
||||
protected UUID m_ScopeID = UUID.Zero;
|
||||
protected bool m_Check4096 = true;
|
||||
|
||||
// Hyperlink regions are hyperlinks on the map
|
||||
public readonly Dictionary<UUID, GridRegion> m_HyperlinkRegions = new Dictionary<UUID, GridRegion>();
|
||||
@@ -116,6 +117,8 @@ namespace OpenSim.Services.GridService
|
||||
if (scope != string.Empty)
|
||||
UUID.TryParse(scope, out m_ScopeID);
|
||||
|
||||
m_Check4096 = gridConfig.GetBoolean("Check4096", true);
|
||||
|
||||
m_GatekeeperConnector = new GatekeeperServiceConnector(m_AssetService);
|
||||
|
||||
m_log.DebugFormat("[HYPERGRID LINKER]: Loaded all services...");
|
||||
@@ -277,7 +280,7 @@ namespace OpenSim.Services.GridService
|
||||
}
|
||||
|
||||
uint x, y;
|
||||
if (!Check4096(handle, out x, out y))
|
||||
if (m_Check4096 && !Check4096(handle, out x, out y))
|
||||
{
|
||||
RemoveHyperlinkRegion(regInfo.RegionID);
|
||||
reason = "Region is too far (" + x + ", " + y + ")";
|
||||
@@ -332,18 +335,50 @@ namespace OpenSim.Services.GridService
|
||||
/// <returns></returns>
|
||||
public bool Check4096(ulong realHandle, out uint x, out uint y)
|
||||
{
|
||||
GridRegion defRegion = DefaultRegion;
|
||||
|
||||
uint ux = 0, uy = 0;
|
||||
Utils.LongToUInts(realHandle, out ux, out uy);
|
||||
x = ux / Constants.RegionSize;
|
||||
y = uy / Constants.RegionSize;
|
||||
|
||||
if ((Math.Abs((int)defRegion.RegionLocX - ux) >= 4096 * Constants.RegionSize) ||
|
||||
(Math.Abs((int)defRegion.RegionLocY - uy) >= 4096 * Constants.RegionSize))
|
||||
const uint limit = (4096 - 1) * Constants.RegionSize;
|
||||
uint xmin = ux - limit;
|
||||
uint xmax = ux + limit;
|
||||
uint ymin = uy - limit;
|
||||
uint ymax = uy + limit;
|
||||
// World map boundary checks
|
||||
if (xmin < 0 || xmin > ux)
|
||||
xmin = 0;
|
||||
if (xmax > int.MaxValue || xmax < ux)
|
||||
xmax = int.MaxValue;
|
||||
if (ymin < 0 || ymin > uy)
|
||||
ymin = 0;
|
||||
if (ymax > int.MaxValue || ymax < uy)
|
||||
ymax = int.MaxValue;
|
||||
|
||||
// Check for any regions that are within the possible teleport range to the linked region
|
||||
List<GridRegion> regions = m_GridService.GetRegionRange(m_ScopeID, (int)xmin, (int)xmax, (int)ymin, (int)ymax);
|
||||
if (regions.Count == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Check for regions which are not linked regions
|
||||
List<GridRegion> hyperlinks = m_GridService.GetHyperlinks(m_ScopeID);
|
||||
// would like to use .Except, but doesn't seem to exist
|
||||
//IEnumerable<GridRegion> availableRegions = regions.Except(hyperlinks);
|
||||
List<GridRegion> availableRegions = regions.FindAll(delegate(GridRegion region)
|
||||
{
|
||||
// Ewww! n^2
|
||||
if (hyperlinks.Find(delegate(GridRegion r) { return r.RegionID == region.RegionID; }) == null) // not hyperlink. good.
|
||||
return true;
|
||||
|
||||
return false;
|
||||
});
|
||||
if (availableRegions.Count == 0)
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -378,32 +413,31 @@ namespace OpenSim.Services.GridService
|
||||
|
||||
public void HandleShow(string module, string[] cmd)
|
||||
{
|
||||
MainConsole.Instance.Output("Not Implemented Yet");
|
||||
//if (cmd.Length != 2)
|
||||
//{
|
||||
// MainConsole.Instance.Output("Syntax: show hyperlinks");
|
||||
// return;
|
||||
//}
|
||||
//List<GridRegion> regions = new List<GridRegion>(m_HypergridService.m_HyperlinkRegions.Values);
|
||||
//if (regions == null || regions.Count < 1)
|
||||
//{
|
||||
// MainConsole.Instance.Output("No hyperlinks");
|
||||
// return;
|
||||
//}
|
||||
if (cmd.Length != 2)
|
||||
{
|
||||
MainConsole.Instance.Output("Syntax: show hyperlinks");
|
||||
return;
|
||||
}
|
||||
List<RegionData> regions = m_Database.GetHyperlinks(UUID.Zero);
|
||||
if (regions == null || regions.Count < 1)
|
||||
{
|
||||
MainConsole.Instance.Output("No hyperlinks");
|
||||
return;
|
||||
}
|
||||
|
||||
//MainConsole.Instance.Output("Region Name Region UUID");
|
||||
//MainConsole.Instance.Output("Location URI");
|
||||
//MainConsole.Instance.Output("Owner ID ");
|
||||
//MainConsole.Instance.Output("-------------------------------------------------------------------------------");
|
||||
//foreach (GridRegion r in regions)
|
||||
//{
|
||||
// MainConsole.Instance.Output(String.Format("{0,-20} {1}\n{2,-20} {3}\n{4,-39} \n\n",
|
||||
// r.RegionName, r.RegionID,
|
||||
// String.Format("{0},{1}", r.RegionLocX, r.RegionLocY), "http://" + r.ExternalHostName + ":" + r.HttpPort.ToString(),
|
||||
// r.EstateOwner.ToString()));
|
||||
//}
|
||||
//return;
|
||||
MainConsole.Instance.Output("Region Name Region UUID");
|
||||
MainConsole.Instance.Output("Location URI");
|
||||
MainConsole.Instance.Output("-------------------------------------------------------------------------------");
|
||||
foreach (RegionData r in regions)
|
||||
{
|
||||
MainConsole.Instance.Output(String.Format("{0,-39} {1}\n{2,-39} {3}\n",
|
||||
r.RegionName, r.RegionID,
|
||||
String.Format("{0},{1} ({2},{3})", r.posX, r.posY, r.posX / 256, r.posY / 256),
|
||||
"http://" + r.Data["serverIP"].ToString() + ":" + r.Data["serverHttpPort"].ToString()));
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
public void RunCommand(string module, string[] cmdparams)
|
||||
{
|
||||
List<string> args = new List<string>(cmdparams);
|
||||
|
||||
@@ -49,61 +49,64 @@ namespace OpenSim.Services.HypergridService
|
||||
LogManager.GetLogger(
|
||||
MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
IGridService m_GridService;
|
||||
IPresenceService m_PresenceService;
|
||||
IUserAccountService m_UserAccountService;
|
||||
IUserAgentService m_UserAgentService;
|
||||
ISimulationService m_SimulationService;
|
||||
private static bool m_Initialized = false;
|
||||
|
||||
string m_AuthDll;
|
||||
private static IGridService m_GridService;
|
||||
private static IPresenceService m_PresenceService;
|
||||
private static IUserAccountService m_UserAccountService;
|
||||
private static IUserAgentService m_UserAgentService;
|
||||
private static ISimulationService m_SimulationService;
|
||||
|
||||
UUID m_ScopeID;
|
||||
bool m_AllowTeleportsToAnyRegion;
|
||||
string m_ExternalName;
|
||||
GridRegion m_DefaultGatewayRegion;
|
||||
private static UUID m_ScopeID;
|
||||
private static bool m_AllowTeleportsToAnyRegion;
|
||||
private static string m_ExternalName;
|
||||
private static GridRegion m_DefaultGatewayRegion;
|
||||
|
||||
public GatekeeperService(IConfigSource config, ISimulationService simService)
|
||||
{
|
||||
IConfig serverConfig = config.Configs["GatekeeperService"];
|
||||
if (serverConfig == null)
|
||||
throw new Exception(String.Format("No section GatekeeperService in config file"));
|
||||
if (!m_Initialized)
|
||||
{
|
||||
m_Initialized = true;
|
||||
|
||||
string accountService = serverConfig.GetString("UserAccountService", String.Empty);
|
||||
string homeUsersService = serverConfig.GetString("HomeUsersSecurityService", string.Empty);
|
||||
string gridService = serverConfig.GetString("GridService", String.Empty);
|
||||
string presenceService = serverConfig.GetString("PresenceService", String.Empty);
|
||||
string simulationService = serverConfig.GetString("SimulationService", String.Empty);
|
||||
IConfig serverConfig = config.Configs["GatekeeperService"];
|
||||
if (serverConfig == null)
|
||||
throw new Exception(String.Format("No section GatekeeperService in config file"));
|
||||
|
||||
//m_AuthDll = serverConfig.GetString("AuthenticationService", String.Empty);
|
||||
string accountService = serverConfig.GetString("UserAccountService", String.Empty);
|
||||
string homeUsersService = serverConfig.GetString("UserAgentService", string.Empty);
|
||||
string gridService = serverConfig.GetString("GridService", String.Empty);
|
||||
string presenceService = serverConfig.GetString("PresenceService", String.Empty);
|
||||
string simulationService = serverConfig.GetString("SimulationService", String.Empty);
|
||||
|
||||
// These 3 are mandatory, the others aren't
|
||||
if (gridService == string.Empty || presenceService == string.Empty || m_AuthDll == string.Empty)
|
||||
throw new Exception("Incomplete specifications, Gatekeeper Service cannot function.");
|
||||
|
||||
string scope = serverConfig.GetString("ScopeID", UUID.Zero.ToString());
|
||||
UUID.TryParse(scope, out m_ScopeID);
|
||||
//m_WelcomeMessage = serverConfig.GetString("WelcomeMessage", "Welcome to OpenSim!");
|
||||
m_AllowTeleportsToAnyRegion = serverConfig.GetBoolean("AllowTeleportsToAnyRegion", true);
|
||||
m_ExternalName = serverConfig.GetString("ExternalName", string.Empty);
|
||||
// These 3 are mandatory, the others aren't
|
||||
if (gridService == string.Empty || presenceService == string.Empty)
|
||||
throw new Exception("Incomplete specifications, Gatekeeper Service cannot function.");
|
||||
|
||||
string scope = serverConfig.GetString("ScopeID", UUID.Zero.ToString());
|
||||
UUID.TryParse(scope, out m_ScopeID);
|
||||
//m_WelcomeMessage = serverConfig.GetString("WelcomeMessage", "Welcome to OpenSim!");
|
||||
m_AllowTeleportsToAnyRegion = serverConfig.GetBoolean("AllowTeleportsToAnyRegion", true);
|
||||
m_ExternalName = serverConfig.GetString("ExternalName", string.Empty);
|
||||
|
||||
Object[] args = new Object[] { config };
|
||||
m_GridService = ServerUtils.LoadPlugin<IGridService>(gridService, args);
|
||||
m_PresenceService = ServerUtils.LoadPlugin<IPresenceService>(presenceService, args);
|
||||
Object[] args = new Object[] { config };
|
||||
m_GridService = ServerUtils.LoadPlugin<IGridService>(gridService, args);
|
||||
m_PresenceService = ServerUtils.LoadPlugin<IPresenceService>(presenceService, args);
|
||||
|
||||
if (accountService != string.Empty)
|
||||
m_UserAccountService = ServerUtils.LoadPlugin<IUserAccountService>(accountService, args);
|
||||
if (homeUsersService != string.Empty)
|
||||
m_UserAgentService = ServerUtils.LoadPlugin<IUserAgentService>(homeUsersService, args);
|
||||
if (accountService != string.Empty)
|
||||
m_UserAccountService = ServerUtils.LoadPlugin<IUserAccountService>(accountService, args);
|
||||
if (homeUsersService != string.Empty)
|
||||
m_UserAgentService = ServerUtils.LoadPlugin<IUserAgentService>(homeUsersService, args);
|
||||
|
||||
if (simService != null)
|
||||
m_SimulationService = simService;
|
||||
else if (simulationService != string.Empty)
|
||||
m_SimulationService = ServerUtils.LoadPlugin<ISimulationService>(simulationService, args);
|
||||
if (simService != null)
|
||||
m_SimulationService = simService;
|
||||
else if (simulationService != string.Empty)
|
||||
m_SimulationService = ServerUtils.LoadPlugin<ISimulationService>(simulationService, args);
|
||||
|
||||
if (m_GridService == null || m_PresenceService == null || m_SimulationService == null)
|
||||
throw new Exception("Unable to load a required plugin, Gatekeeper Service cannot function.");
|
||||
if (m_GridService == null || m_PresenceService == null || m_SimulationService == null)
|
||||
throw new Exception("Unable to load a required plugin, Gatekeeper Service cannot function.");
|
||||
|
||||
m_log.Debug("[GATEKEEPER SERVICE]: Starting...");
|
||||
m_log.Debug("[GATEKEEPER SERVICE]: Starting...");
|
||||
}
|
||||
}
|
||||
|
||||
public GatekeeperService(IConfigSource config)
|
||||
@@ -280,18 +283,23 @@ namespace OpenSim.Services.HypergridService
|
||||
return false;
|
||||
}
|
||||
|
||||
Object[] args = new Object[] { userURL };
|
||||
IUserAgentService userAgentService = new UserAgentServiceConnector(userURL); //ServerUtils.LoadPlugin<IUserAgentService>(m_AuthDll, args);
|
||||
if (userAgentService != null)
|
||||
if (userURL == m_ExternalName)
|
||||
return m_UserAgentService.VerifyAgent(aCircuit.SessionID, aCircuit.ServiceSessionID);
|
||||
else
|
||||
{
|
||||
try
|
||||
Object[] args = new Object[] { userURL };
|
||||
IUserAgentService userAgentService = new UserAgentServiceConnector(userURL);
|
||||
if (userAgentService != null)
|
||||
{
|
||||
return userAgentService.VerifyAgent(aCircuit.SessionID, aCircuit.ServiceSessionID);
|
||||
}
|
||||
catch
|
||||
{
|
||||
m_log.DebugFormat("[GATEKEEPER SERVICE]: Unable to contact authentication service at {0}", userURL);
|
||||
return false;
|
||||
try
|
||||
{
|
||||
return userAgentService.VerifyAgent(aCircuit.SessionID, aCircuit.ServiceSessionID);
|
||||
}
|
||||
catch
|
||||
{
|
||||
m_log.DebugFormat("[GATEKEEPER SERVICE]: Unable to contact authentication service at {0}", userURL);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -62,11 +62,18 @@ namespace OpenSim.Services.HypergridService
|
||||
protected static IGridUserService m_GridUserService;
|
||||
protected static IGridService m_GridService;
|
||||
protected static GatekeeperServiceConnector m_GatekeeperConnector;
|
||||
protected static IGatekeeperService m_GatekeeperService;
|
||||
|
||||
protected static string m_GridName;
|
||||
|
||||
protected static bool m_BypassClientVerification;
|
||||
|
||||
public UserAgentService(IConfigSource config)
|
||||
{
|
||||
if (!m_Initialized)
|
||||
{
|
||||
m_Initialized = true;
|
||||
|
||||
m_log.DebugFormat("[HOME USERS SECURITY]: Starting...");
|
||||
|
||||
IConfig serverConfig = config.Configs["UserAgentService"];
|
||||
@@ -75,16 +82,25 @@ namespace OpenSim.Services.HypergridService
|
||||
|
||||
string gridService = serverConfig.GetString("GridService", String.Empty);
|
||||
string gridUserService = serverConfig.GetString("GridUserService", String.Empty);
|
||||
string gatekeeperService = serverConfig.GetString("GatekeeperService", String.Empty);
|
||||
|
||||
if (gridService == string.Empty || gridUserService == string.Empty)
|
||||
m_BypassClientVerification = serverConfig.GetBoolean("BypassClientVerification", false);
|
||||
|
||||
if (gridService == string.Empty || gridUserService == string.Empty || gatekeeperService == string.Empty)
|
||||
throw new Exception(String.Format("Incomplete specifications, UserAgent Service cannot function."));
|
||||
|
||||
Object[] args = new Object[] { config };
|
||||
m_GridService = ServerUtils.LoadPlugin<IGridService>(gridService, args);
|
||||
m_GridUserService = ServerUtils.LoadPlugin<IGridUserService>(gridUserService, args);
|
||||
m_GatekeeperConnector = new GatekeeperServiceConnector();
|
||||
m_GatekeeperService = ServerUtils.LoadPlugin<IGatekeeperService>(gatekeeperService, args);
|
||||
|
||||
m_Initialized = true;
|
||||
m_GridName = serverConfig.GetString("ExternalName", string.Empty);
|
||||
if (m_GridName == string.Empty)
|
||||
{
|
||||
serverConfig = config.Configs["GatekeeperService"];
|
||||
m_GridName = serverConfig.GetString("ExternalName", string.Empty);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -131,7 +147,13 @@ namespace OpenSim.Services.HypergridService
|
||||
agentCircuit.ServiceSessionID = "http://" + region.ExternalHostName + ":" + region.HttpPort + ";" + UUID.Random();
|
||||
TravelingAgentInfo old = UpdateTravelInfo(agentCircuit, region);
|
||||
|
||||
bool success = m_GatekeeperConnector.CreateAgent(region, agentCircuit, (uint)Constants.TeleportFlags.ViaLogin, out reason);
|
||||
//bool success = m_GatekeeperConnector.CreateAgent(region, agentCircuit, (uint)Constants.TeleportFlags.ViaLogin, out reason);
|
||||
bool success = false;
|
||||
string gridName = "http://" + gatekeeper.ExternalHostName + ":" + gatekeeper.HttpPort;
|
||||
if (m_GridName == gridName)
|
||||
success = m_GatekeeperService.LoginAgent(agentCircuit, finalDestination, out reason);
|
||||
else
|
||||
success = m_GatekeeperConnector.CreateAgent(region, agentCircuit, (uint)Constants.TeleportFlags.ViaLogin, out reason);
|
||||
|
||||
if (!success)
|
||||
{
|
||||
@@ -171,7 +193,7 @@ namespace OpenSim.Services.HypergridService
|
||||
m_TravelingAgents[agentCircuit.SessionID] = travel;
|
||||
}
|
||||
travel.UserID = agentCircuit.AgentID;
|
||||
travel.GridExternalName = region.ExternalHostName + ":" + region.HttpPort;
|
||||
travel.GridExternalName = "http://" + region.ExternalHostName + ":" + region.HttpPort;
|
||||
travel.ServiceToken = agentCircuit.ServiceSessionID;
|
||||
if (old != null)
|
||||
travel.ClientToken = old.ClientToken;
|
||||
@@ -207,16 +229,16 @@ namespace OpenSim.Services.HypergridService
|
||||
return false;
|
||||
|
||||
TravelingAgentInfo travel = m_TravelingAgents[sessionID];
|
||||
|
||||
return travel.GridExternalName == thisGridExternalName;
|
||||
}
|
||||
|
||||
public bool VerifyClient(UUID sessionID, string token)
|
||||
{
|
||||
m_log.DebugFormat("[USER AGENT SERVICE]: Verifying Client session {0} with token {1}", sessionID, token);
|
||||
//return true;
|
||||
if (m_BypassClientVerification)
|
||||
return true;
|
||||
|
||||
// Commenting this for now until I understand better what part of a sender's
|
||||
// info stays unchanged throughout a session
|
||||
m_log.DebugFormat("[USER AGENT SERVICE]: Verifying Client session {0} with token {1}", sessionID, token);
|
||||
|
||||
if (m_TravelingAgents.ContainsKey(sessionID))
|
||||
return m_TravelingAgents[sessionID].ClientToken == token;
|
||||
|
||||
@@ -92,6 +92,7 @@ namespace OpenSim.Services.Interfaces
|
||||
|
||||
List<GridRegion> GetDefaultRegions(UUID scopeID);
|
||||
List<GridRegion> GetFallbackRegions(UUID scopeID, int x, int y);
|
||||
List<GridRegion> GetHyperlinks(UUID scopeID);
|
||||
|
||||
int GetRegionFlags(UUID scopeID, UUID regionID);
|
||||
}
|
||||
|
||||
@@ -45,6 +45,7 @@ namespace OpenSim.Services.InventoryService
|
||||
MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
protected IXInventoryData m_Database;
|
||||
protected bool m_AllowDelete = true;
|
||||
|
||||
public XInventoryService(IConfigSource config) : base(config)
|
||||
{
|
||||
@@ -60,6 +61,7 @@ namespace OpenSim.Services.InventoryService
|
||||
{
|
||||
dllName = authConfig.GetString("StorageProvider", dllName);
|
||||
connString = authConfig.GetString("ConnectionString", connString);
|
||||
m_AllowDelete = authConfig.GetBoolean("AllowDelete", true);
|
||||
// realm = authConfig.GetString("Realm", realm);
|
||||
}
|
||||
|
||||
@@ -304,10 +306,15 @@ namespace OpenSim.Services.InventoryService
|
||||
//
|
||||
public virtual bool DeleteFolders(UUID principalID, List<UUID> folderIDs)
|
||||
{
|
||||
if (!m_AllowDelete)
|
||||
return false;
|
||||
|
||||
// Ignore principal ID, it's bogus at connector level
|
||||
//
|
||||
foreach (UUID id in folderIDs)
|
||||
{
|
||||
if (!ParentIsTrash(id))
|
||||
continue;
|
||||
InventoryFolderBase f = new InventoryFolderBase();
|
||||
f.ID = id;
|
||||
PurgeFolder(f);
|
||||
@@ -319,6 +326,12 @@ namespace OpenSim.Services.InventoryService
|
||||
|
||||
public virtual bool PurgeFolder(InventoryFolderBase folder)
|
||||
{
|
||||
if (!m_AllowDelete)
|
||||
return false;
|
||||
|
||||
if (!ParentIsTrash(folder.ID))
|
||||
return false;
|
||||
|
||||
XInventoryFolder[] subFolders = m_Database.GetFolders(
|
||||
new string[] { "parentFolderID" },
|
||||
new string[] { folder.ID.ToString() });
|
||||
@@ -358,6 +371,9 @@ namespace OpenSim.Services.InventoryService
|
||||
|
||||
public virtual bool DeleteItems(UUID principalID, List<UUID> itemIDs)
|
||||
{
|
||||
if (!m_AllowDelete)
|
||||
return false;
|
||||
|
||||
// Just use the ID... *facepalms*
|
||||
//
|
||||
foreach (UUID id in itemIDs)
|
||||
@@ -519,5 +535,29 @@ namespace OpenSim.Services.InventoryService
|
||||
|
||||
return newItem;
|
||||
}
|
||||
|
||||
private bool ParentIsTrash(UUID folderID)
|
||||
{
|
||||
XInventoryFolder[] folder = m_Database.GetFolders(new string[] {"folderID"}, new string[] {folderID.ToString()});
|
||||
if (folder.Length < 1)
|
||||
return false;
|
||||
|
||||
UUID parentFolder = folder[0].parentFolderID;
|
||||
|
||||
while (parentFolder != UUID.Zero)
|
||||
{
|
||||
XInventoryFolder[] parent = m_Database.GetFolders(new string[] {"folderID"}, new string[] {parentFolder.ToString()});
|
||||
if (parent.Length < 1)
|
||||
return false;
|
||||
|
||||
if (parent[0].type == (int)AssetType.TrashFolder)
|
||||
return true;
|
||||
if (parent[0].type == (int)AssetType.RootFolder)
|
||||
return false;
|
||||
|
||||
parentFolder = parent[0].parentFolderID;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -173,6 +173,8 @@ namespace OpenSim.Services.LLLoginService
|
||||
// Web map
|
||||
private string mapTileURL;
|
||||
|
||||
private string searchURL;
|
||||
|
||||
// Error Flags
|
||||
private string errorReason;
|
||||
private string errorMessage;
|
||||
@@ -221,7 +223,7 @@ namespace OpenSim.Services.LLLoginService
|
||||
public LLLoginResponse(UserAccount account, AgentCircuitData aCircuit, GridUserInfo pinfo,
|
||||
GridRegion destination, List<InventoryFolderBase> invSkel, FriendInfo[] friendsList, ILibraryService libService,
|
||||
string where, string startlocation, Vector3 position, Vector3 lookAt, List<InventoryItemBase> gestures, string message,
|
||||
GridRegion home, IPEndPoint clientIP, string mapTileURL)
|
||||
GridRegion home, IPEndPoint clientIP, string mapTileURL, string searchURL)
|
||||
: this()
|
||||
{
|
||||
FillOutInventoryData(invSkel, libService);
|
||||
@@ -238,6 +240,7 @@ namespace OpenSim.Services.LLLoginService
|
||||
BuddList = ConvertFriendListItem(friendsList);
|
||||
StartLocation = where;
|
||||
MapTileURL = mapTileURL;
|
||||
SearchURL = searchURL;
|
||||
|
||||
FillOutHomeData(pinfo, home);
|
||||
LookAt = String.Format("[r{0},r{1},r{2}]", lookAt.X, lookAt.Y, lookAt.Z);
|
||||
@@ -410,6 +413,7 @@ namespace OpenSim.Services.LLLoginService
|
||||
InitialOutfitHash["gender"] = "female";
|
||||
initialOutfit.Add(InitialOutfitHash);
|
||||
mapTileURL = String.Empty;
|
||||
searchURL = String.Empty;
|
||||
}
|
||||
|
||||
|
||||
@@ -473,6 +477,9 @@ namespace OpenSim.Services.LLLoginService
|
||||
responseData["region_x"] = (Int32)(RegionX);
|
||||
responseData["region_y"] = (Int32)(RegionY);
|
||||
|
||||
if (searchURL != String.Empty)
|
||||
responseData["search"] = searchURL;
|
||||
|
||||
if (mapTileURL != String.Empty)
|
||||
responseData["map-server-url"] = mapTileURL;
|
||||
|
||||
@@ -575,6 +582,9 @@ namespace OpenSim.Services.LLLoginService
|
||||
if (mapTileURL != String.Empty)
|
||||
map["map-server-url"] = OSD.FromString(mapTileURL);
|
||||
|
||||
if (searchURL != String.Empty)
|
||||
map["search"] = OSD.FromString(searchURL);
|
||||
|
||||
if (m_buddyList != null)
|
||||
{
|
||||
map["buddy-list"] = ArrayListToOSDArray(m_buddyList.ToArray());
|
||||
@@ -932,6 +942,12 @@ namespace OpenSim.Services.LLLoginService
|
||||
set { mapTileURL = value; }
|
||||
}
|
||||
|
||||
public string SearchURL
|
||||
{
|
||||
get { return searchURL; }
|
||||
set { searchURL = value; }
|
||||
}
|
||||
|
||||
public string Message
|
||||
{
|
||||
get { return welcomeMessage; }
|
||||
|
||||
@@ -74,6 +74,7 @@ namespace OpenSim.Services.LLLoginService
|
||||
protected string m_GatekeeperURL;
|
||||
protected bool m_AllowRemoteSetLoginLevel;
|
||||
protected string m_MapTileURL;
|
||||
protected string m_SearchURL;
|
||||
|
||||
IConfig m_LoginServerConfig;
|
||||
|
||||
@@ -102,6 +103,7 @@ namespace OpenSim.Services.LLLoginService
|
||||
m_MinLoginLevel = m_LoginServerConfig.GetInt("MinLoginLevel", 0);
|
||||
m_GatekeeperURL = m_LoginServerConfig.GetString("GatekeeperURI", string.Empty);
|
||||
m_MapTileURL = m_LoginServerConfig.GetString("MapTileURL", string.Empty);
|
||||
m_SearchURL = m_LoginServerConfig.GetString("SearchURL", string.Empty);
|
||||
|
||||
// These are required; the others aren't
|
||||
if (accountService == string.Empty || authService == string.Empty)
|
||||
@@ -358,7 +360,7 @@ namespace OpenSim.Services.LLLoginService
|
||||
// Finally, fill out the response and return it
|
||||
//
|
||||
LLLoginResponse response = new LLLoginResponse(account, aCircuit, guinfo, destination, inventorySkel, friendsList, m_LibraryService,
|
||||
where, startLocation, position, lookAt, gestures, m_WelcomeMessage, home, clientIP, m_MapTileURL);
|
||||
where, startLocation, position, lookAt, gestures, m_WelcomeMessage, home, clientIP, m_MapTileURL, m_SearchURL);
|
||||
|
||||
m_log.DebugFormat("[LLOGIN SERVICE]: All clear. Sending login response to client.");
|
||||
return response;
|
||||
@@ -754,10 +756,8 @@ namespace OpenSim.Services.LLLoginService
|
||||
m_log.Debug("[LLOGIN SERVICE] Launching agent at " + destination.RegionName);
|
||||
if (m_UserAgentService.LoginAgentToGrid(aCircuit, gatekeeper, destination, out reason))
|
||||
{
|
||||
// We may need to do this at some point,
|
||||
// so leaving it here in comments.
|
||||
//IPAddress addr = NetworkUtil.GetIPFor(clientIP.Address, destination.ExternalEndPoint.Address);
|
||||
m_UserAgentService.SetClientToken(aCircuit.SessionID, /*addr.Address.ToString() */ clientIP.Address.ToString());
|
||||
IPAddress addr = NetworkUtil.GetExternalIPOf(clientIP.Address);
|
||||
m_UserAgentService.SetClientToken(aCircuit.SessionID, addr.ToString() /* clientIP.Address.ToString() */);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
@@ -241,36 +241,6 @@ namespace OpenSim.Tools.Configger
|
||||
config.Set("EventQueue", true);
|
||||
}
|
||||
|
||||
{
|
||||
IConfig config = defaultConfig.Configs["StandAlone"];
|
||||
|
||||
if (null == config)
|
||||
config = defaultConfig.AddConfig("StandAlone");
|
||||
|
||||
config.Set("accounts_authenticate", true);
|
||||
config.Set("welcome_message", "Welcome to OpenSimulator");
|
||||
config.Set("inventory_plugin", "OpenSim.Data.SQLite.dll");
|
||||
config.Set("inventory_source", "");
|
||||
config.Set("userDatabase_plugin", "OpenSim.Data.SQLite.dll");
|
||||
config.Set("user_source", "");
|
||||
config.Set("LibrariesXMLFile", string.Format(".{0}inventory{0}Libraries.xml", Path.DirectorySeparatorChar));
|
||||
}
|
||||
|
||||
{
|
||||
IConfig config = defaultConfig.Configs["Network"];
|
||||
|
||||
if (null == config)
|
||||
config = defaultConfig.AddConfig("Network");
|
||||
|
||||
config.Set("default_location_x", 1000);
|
||||
config.Set("default_location_y", 1000);
|
||||
config.Set("grid_send_key", "null");
|
||||
config.Set("grid_recv_key", "null");
|
||||
config.Set("user_send_key", "null");
|
||||
config.Set("user_recv_key", "null");
|
||||
config.Set("secure_inventory_server", "true");
|
||||
}
|
||||
|
||||
return defaultConfig;
|
||||
}
|
||||
|
||||
|
||||
@@ -54,6 +54,8 @@ ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003
|
||||
LocalServiceModule = "OpenSim.Services.GridService.dll:GridService"
|
||||
Realm = "regions"
|
||||
; AllowDuplicateNames = "True"
|
||||
; Check4096 = "False"
|
||||
|
||||
;; Next, we can specify properties of regions, including default and fallback regions
|
||||
;; The syntax is: Region_<RegionName> = "<flags>"
|
||||
;; or: Region_<RegionID> = "<flags>"
|
||||
@@ -207,6 +209,7 @@ ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003
|
||||
;; for the service
|
||||
GridUserService = "OpenSim.Services.UserAccountService.dll:GridUserService"
|
||||
GridService = "OpenSim.Services.GridService.dll:GridService"
|
||||
GatekeeperService = "OpenSim.Services.HypergridService.dll:GatekeeperService"
|
||||
|
||||
;; The interface that local users get when they are in other grids.
|
||||
;; This restricts the inventory operations while in other grids.
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
|
||||
LibraryModule = true
|
||||
LLLoginServiceInConnector = true
|
||||
GridInfoServiceInConnector = true
|
||||
|
||||
[AssetService]
|
||||
LocalServiceModule = "OpenSim.Services.AssetService.dll:AssetService"
|
||||
|
||||
@@ -48,6 +48,9 @@
|
||||
;;--- For MySql region storage (alternative)
|
||||
;StorageProvider = "OpenSim.Data.MySQL.dll:MySqlRegionData"
|
||||
|
||||
; If HG, do you want this check on the distance to be performed?
|
||||
; Check4096 = "False"
|
||||
|
||||
;; Next, we can specify properties of regions, including default and fallback regions
|
||||
;; The syntax is: Region_<RegioName> = "<flags>"
|
||||
;; where <flags> can be DefaultRegion, FallbackRegion, NoDirectLogin, Persistent, LockedOut
|
||||
@@ -73,3 +76,47 @@
|
||||
; If false, HG TPs happen only to the Default regions specified in [GridService] section
|
||||
AllowTeleportsToAnyRegion = true
|
||||
|
||||
[GridInfoService]
|
||||
; These settings are used to return information on a get_grid_info call.
|
||||
; Client launcher scripts and third-party clients make use of this to
|
||||
; autoconfigure the client and to provide a nice user experience. If you
|
||||
; want to facilitate that, you should configure the settings here according
|
||||
; to your grid or standalone setup.
|
||||
;
|
||||
; See http://opensimulator.org/wiki/GridInfo
|
||||
|
||||
; login uri: for grid this is the login server URI
|
||||
login = http://127.0.0.1:9000/
|
||||
|
||||
; long grid name: the long name of your grid
|
||||
gridname = "the lost continent of hippo"
|
||||
|
||||
; short grid name: the short name of your grid
|
||||
gridnick = "hippogrid"
|
||||
|
||||
; login page: optional: if it exists it will be used to tell the client to use
|
||||
; this as splash page
|
||||
; currently unused
|
||||
;welcome = http://127.0.0.1/welcome
|
||||
|
||||
; helper uri: optional: if it exists if will be used to tell the client to use
|
||||
; this for all economy related things
|
||||
; currently unused
|
||||
;economy = http://127.0.0.1:9000/
|
||||
|
||||
; web page of grid: optional: page providing further information about your grid
|
||||
; currently unused
|
||||
;about = http://127.0.0.1/about/
|
||||
|
||||
; account creation: optional: page providing further information about obtaining
|
||||
; a user account on your grid
|
||||
; currently unused
|
||||
;register = http://127.0.0.1/register
|
||||
|
||||
; help: optional: page providing further assistance for users of your grid
|
||||
; currently unused
|
||||
;help = http://127.0.0.1/help
|
||||
|
||||
; password help: optional: page providing password assistance for users of your grid
|
||||
; currently unused
|
||||
;password = http://127.0.0.1/password
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
NeighbourServiceInConnector = true
|
||||
LibraryModule = true
|
||||
LLLoginServiceInConnector = true
|
||||
GridInfoServiceInConnector = true
|
||||
AuthenticationServiceInConnector = true
|
||||
SimulationServiceInConnector = true
|
||||
|
||||
@@ -114,6 +115,8 @@
|
||||
;; for the service
|
||||
GridUserService = "OpenSim.Services.UserAccountService.dll:GridUserService"
|
||||
GridService = "OpenSim.Services.GridService.dll:GridService"
|
||||
GatekeeperService = "OpenSim.Services.HypergridService.dll:GatekeeperService"
|
||||
|
||||
|
||||
;; The interface that local users get when they are in other grids
|
||||
;; This greatly restricts the inventory operations while in other grids
|
||||
|
||||
Reference in New Issue
Block a user