Merge branch 'master' into careminster-presence-refactor

avinationmerge
Melanie 2010-12-30 01:40:38 +00:00
commit 3b50066ceb
13 changed files with 91 additions and 93 deletions

View File

@ -88,8 +88,6 @@ namespace OpenSim.Framework
// public static readonly UUID DEFAULT_TATTOO_ITEM = new UUID("c47e22bd-3021-4ba4-82aa-2b5cb34d35e1");
// public static readonly UUID DEFAULT_TATTOO_ASSET = new UUID("00000000-0000-2222-3333-100000001007");
private static AvatarWearable[] defaultWearables = null;
protected Dictionary<UUID, UUID> m_items = new Dictionary<UUID, UUID>();
protected List<UUID> m_ids = new List<UUID>();
@ -221,7 +219,7 @@ namespace OpenSim.Framework
{
get
{
defaultWearables = new AvatarWearable[MAX_WEARABLES]; //should be 15 of these
AvatarWearable[] defaultWearables = new AvatarWearable[MAX_WEARABLES]; //should be 15 of these
for (int i = 0; i < MAX_WEARABLES; i++)
{
defaultWearables[i] = new AvatarWearable();

View File

@ -66,7 +66,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
return;
m_log.DebugFormat("[REGION CACHE]: (on region {0}) Region {1} is up @ {2}-{3}",
m_scene.RegionInfo.RegionName, otherRegion.RegionName, otherRegion.RegionLocX, otherRegion.RegionLocY);
m_scene.RegionInfo.RegionName, otherRegion.RegionName, otherRegion.RegionLocX / Constants.RegionSize, otherRegion.RegionLocY / Constants.RegionSize);
m_neighbours[otherRegion.RegionHandle] = otherRegion;
}

View File

@ -36,6 +36,7 @@ using OpenSim.Framework;
using OpenSim.Services.Connectors;
using OpenSim.Region.Framework.Interfaces;
using OpenSim.Region.Framework.Scenes;
using OpenSim.Server.Base;
using OpenSim.Services.Interfaces;
using GridRegion = OpenSim.Services.Interfaces.GridRegion;
@ -97,8 +98,17 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
return;
}
string networkConnector = gridConfig.GetString("NetworkConnector", string.Empty);
if (networkConnector == string.Empty)
{
m_log.Error("[REMOTE GRID CONNECTOR]: Please specify a network connector under [GridService]");
return;
}
Object[] args = new Object[] { source };
m_RemoteGridService = ServerUtils.LoadPlugin<IGridService>(networkConnector, args);
m_LocalGridService = new LocalGridServicesConnector(source);
m_RemoteGridService = new GridServicesConnector(source);
}
public void PostInitialise()

View File

@ -148,7 +148,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
string regionimage = "regionImage" + m_scene.RegionInfo.RegionID.ToString();
regionimage = regionimage.Replace("-", "");
m_log.Info("[WORLD MAP]: JPEG Map location: " + m_scene.RegionInfo.ServerURI + "/index.php?method=" + regionimage);
m_log.Info("[WORLD MAP]: JPEG Map location: " + m_scene.RegionInfo.ServerURI + "index.php?method=" + regionimage);
MainServer.Instance.AddHTTPHandler(regionimage, OnHTTPGetMapImage);
MainServer.Instance.AddLLSDHandler(

View File

@ -836,8 +836,8 @@ namespace OpenSim.Region.Framework.Scenes
{
uint xcell = (uint)((int)otherRegion.RegionLocX / (int)Constants.RegionSize);
uint ycell = (uint)((int)otherRegion.RegionLocY / (int)Constants.RegionSize);
m_log.InfoFormat("[SCENE]: (on region {0}): Region {1} up in coords {2}-{3}",
RegionInfo.RegionName, otherRegion.RegionName, xcell, ycell);
//m_log.InfoFormat("[SCENE]: (on region {0}): Region {1} up in coords {2}-{3}",
// RegionInfo.RegionName, otherRegion.RegionName, xcell, ycell);
if (RegionInfo.RegionHandle != otherRegion.RegionHandle)
{

View File

@ -86,7 +86,7 @@ namespace OpenSim.Services.Connectors
#region IGridService
public virtual string RegisterRegion(UUID scopeID, GridRegion regionInfo)
public string RegisterRegion(UUID scopeID, GridRegion regionInfo)
{
Dictionary<string, object> rinfo = regionInfo.ToKeyValuePairs();
Dictionary<string, object> sendData = new Dictionary<string,object>();
@ -140,7 +140,7 @@ namespace OpenSim.Services.Connectors
return "Error communicating with grid service";
}
public virtual bool DeregisterRegion(UUID regionID)
public bool DeregisterRegion(UUID regionID)
{
Dictionary<string, object> sendData = new Dictionary<string, object>();
@ -172,7 +172,7 @@ namespace OpenSim.Services.Connectors
return false;
}
public virtual List<GridRegion> GetNeighbours(UUID scopeID, UUID regionID)
public List<GridRegion> GetNeighbours(UUID scopeID, UUID regionID)
{
Dictionary<string, object> sendData = new Dictionary<string, object>();
@ -219,7 +219,7 @@ namespace OpenSim.Services.Connectors
return rinfos;
}
public virtual GridRegion GetRegionByUUID(UUID scopeID, UUID regionID)
public GridRegion GetRegionByUUID(UUID scopeID, UUID regionID)
{
Dictionary<string, object> sendData = new Dictionary<string, object>();
@ -265,7 +265,7 @@ namespace OpenSim.Services.Connectors
return rinfo;
}
public virtual GridRegion GetRegionByPosition(UUID scopeID, int x, int y)
public GridRegion GetRegionByPosition(UUID scopeID, int x, int y)
{
Dictionary<string, object> sendData = new Dictionary<string, object>();
@ -310,7 +310,7 @@ namespace OpenSim.Services.Connectors
return rinfo;
}
public virtual GridRegion GetRegionByName(UUID scopeID, string regionName)
public GridRegion GetRegionByName(UUID scopeID, string regionName)
{
Dictionary<string, object> sendData = new Dictionary<string, object>();
@ -351,7 +351,7 @@ namespace OpenSim.Services.Connectors
return rinfo;
}
public virtual List<GridRegion> GetRegionsByName(UUID scopeID, string name, int maxNumber)
public List<GridRegion> GetRegionsByName(UUID scopeID, string name, int maxNumber)
{
Dictionary<string, object> sendData = new Dictionary<string, object>();
@ -400,7 +400,7 @@ namespace OpenSim.Services.Connectors
return rinfos;
}
public virtual List<GridRegion> GetRegionRange(UUID scopeID, int xmin, int xmax, int ymin, int ymax)
public List<GridRegion> GetRegionRange(UUID scopeID, int xmin, int xmax, int ymin, int ymax)
{
Dictionary<string, object> sendData = new Dictionary<string, object>();
@ -606,7 +606,7 @@ namespace OpenSim.Services.Connectors
return rinfos;
}
public virtual int GetRegionFlags(UUID scopeID, UUID regionID)
public int GetRegionFlags(UUID scopeID, UUID regionID)
{
Dictionary<string, object> sendData = new Dictionary<string, object>();

View File

@ -87,7 +87,7 @@ namespace OpenSim.Services.Connectors
public bool DoHelloNeighbourCall(GridRegion region, RegionInfo thisRegion)
{
string uri = region.ServerURI + "/region/" + thisRegion.RegionID + "/";
string uri = region.ServerURI + "region/" + thisRegion.RegionID + "/";
//m_log.Debug(" >>> DoHelloNeighbourCall <<< " + uri);
WebRequest HelloNeighbourRequest = WebRequest.Create(uri);

View File

@ -51,50 +51,20 @@ namespace OpenSim.Services.Connectors.SimianGrid
/// Connects region registration and neighbor lookups to the SimianGrid
/// backend
/// </summary>
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
public class SimianGridServiceConnector : IGridService, ISharedRegionModule
public class SimianGridServiceConnector : IGridService
{
private static readonly ILog m_log =
LogManager.GetLogger(
MethodBase.GetCurrentMethod().DeclaringType);
private string m_serverUrl = String.Empty;
private Dictionary<UUID, Scene> m_scenes = new Dictionary<UUID, Scene>();
private string m_ServerURI = String.Empty;
private bool m_Enabled = false;
#region ISharedRegionModule
public Type ReplaceableInterface { get { return null; } }
public void RegionLoaded(Scene scene) { }
public void PostInitialise() { }
public void Close() { }
public SimianGridServiceConnector() { }
public string Name { get { return "SimianGridServiceConnector"; } }
public void AddRegion(Scene scene)
public SimianGridServiceConnector(string serverURI)
{
if (!m_Enabled)
return;
// Every shared region module has to maintain an indepedent list of
// currently running regions
lock (m_scenes)
m_scenes[scene.RegionInfo.RegionID] = scene;
scene.RegisterModuleInterface<IGridService>(this);
m_ServerURI = serverURI.TrimEnd('/');
}
public void RemoveRegion(Scene scene)
{
if (!m_Enabled)
return;
lock (m_scenes)
m_scenes.Remove(scene.RegionInfo.RegionID);
scene.UnregisterModuleInterface<IGridService>(this);
}
#endregion ISharedRegionModule
public SimianGridServiceConnector(IConfigSource source)
{
@ -103,32 +73,29 @@ namespace OpenSim.Services.Connectors.SimianGrid
public void Initialise(IConfigSource source)
{
IConfig moduleConfig = source.Configs["Modules"];
if (moduleConfig != null)
{
string name = moduleConfig.GetString("GridServices", "");
if (name == Name)
CommonInit(source);
}
}
private void CommonInit(IConfigSource source)
{
IConfig gridConfig = source.Configs["GridService"];
if (gridConfig != null)
if (gridConfig == null)
{
string serviceUrl = gridConfig.GetString("GridServerURI");
if (!String.IsNullOrEmpty(serviceUrl))
{
if (!serviceUrl.EndsWith("/") && !serviceUrl.EndsWith("="))
serviceUrl = serviceUrl + '/';
m_serverUrl = serviceUrl;
m_Enabled = true;
}
m_log.Error("[SIMIAN GRID CONNECTOR]: GridService missing from OpenSim.ini");
throw new Exception("Grid connector init error");
}
if (String.IsNullOrEmpty(m_serverUrl))
m_log.Info("[SIMIAN GRID CONNECTOR]: No GridServerURI specified, disabling connector");
string serviceUrl = gridConfig.GetString("GridServerURI");
if (String.IsNullOrEmpty(serviceUrl))
{
m_log.Error("[SIMIAN GRID CONNECTOR]: No Server URI named in section GridService");
throw new Exception("Grid connector init error");
}
if (!serviceUrl.EndsWith("/") && !serviceUrl.EndsWith("="))
serviceUrl = serviceUrl + '/';
m_ServerURI = serviceUrl;
m_Enabled = true;
}
#region IGridService
@ -138,11 +105,11 @@ namespace OpenSim.Services.Connectors.SimianGrid
IPEndPoint ext = regionInfo.ExternalEndPoint;
if (ext == null) return "Region registration for " + regionInfo.RegionName + " failed: Could not resolve EndPoint";
// Generate and upload our map tile in PNG format to the SimianGrid AddMapTile service
Scene scene;
if (m_scenes.TryGetValue(regionInfo.RegionID, out scene))
UploadMapTile(scene);
else
m_log.Warn("Registering region " + regionInfo.RegionName + " (" + regionInfo.RegionID + ") that we are not tracking");
// Scene scene;
// if (m_scenes.TryGetValue(regionInfo.RegionID, out scene))
// UploadMapTile(scene);
// else
// m_log.Warn("Registering region " + regionInfo.RegionName + " (" + regionInfo.RegionID + ") that we are not tracking");
Vector3d minPosition = new Vector3d(regionInfo.RegionLocX, regionInfo.RegionLocY, 0.0);
Vector3d maxPosition = minPosition + new Vector3d(Constants.RegionSize, Constants.RegionSize, 4096.0);
@ -173,7 +140,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
{ "ExtraData", OSDParser.SerializeJsonString(extraData) }
};
OSDMap response = WebUtil.PostToService(m_serverUrl, requestArgs);
OSDMap response = WebUtil.PostToService(m_ServerURI, requestArgs);
if (response["Success"].AsBoolean())
return String.Empty;
else
@ -189,7 +156,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
{ "Enabled", "0" }
};
OSDMap response = WebUtil.PostToService(m_serverUrl, requestArgs);
OSDMap response = WebUtil.PostToService(m_ServerURI, requestArgs);
bool success = response["Success"].AsBoolean();
if (!success)
@ -234,9 +201,12 @@ namespace OpenSim.Services.Connectors.SimianGrid
{ "SceneID", regionID.ToString() }
};
OSDMap response = WebUtil.PostToService(m_serverUrl, requestArgs);
// m_log.DebugFormat("[SIMIAN GRID CONNECTOR] request region with uuid {0}",regionID.ToString());
OSDMap response = WebUtil.PostToService(m_ServerURI, requestArgs);
if (response["Success"].AsBoolean())
{
// m_log.DebugFormat("[SIMIAN GRID CONNECTOR] uuid request successful {0}",response["Name"].AsString());
return ResponseToGridRegion(response);
}
else
@ -259,14 +229,17 @@ namespace OpenSim.Services.Connectors.SimianGrid
{ "Enabled", "1" }
};
OSDMap response = WebUtil.PostToService(m_serverUrl, requestArgs);
// m_log.DebugFormat("[SIMIAN GRID CONNECTOR] request grid at {0}",position.ToString());
OSDMap response = WebUtil.PostToService(m_ServerURI, requestArgs);
if (response["Success"].AsBoolean())
{
// m_log.DebugFormat("[SIMIAN GRID CONNECTOR] position request successful {0}",response["Name"].AsString());
return ResponseToGridRegion(response);
}
else
{
//m_log.InfoFormat("[SIMIAN GRID CONNECTOR]: Grid service did not find a match for region at {0},{1}",
// m_log.InfoFormat("[SIMIAN GRID CONNECTOR]: Grid service did not find a match for region at {0},{1}",
// x / Constants.RegionSize, y / Constants.RegionSize);
return null;
}
@ -297,9 +270,13 @@ namespace OpenSim.Services.Connectors.SimianGrid
if (maxNumber > 0)
requestArgs["MaxNumber"] = maxNumber.ToString();
OSDMap response = WebUtil.PostToService(m_serverUrl, requestArgs);
// m_log.DebugFormat("[SIMIAN GRID CONNECTOR] request regions with name {0}",name);
OSDMap response = WebUtil.PostToService(m_ServerURI, requestArgs);
if (response["Success"].AsBoolean())
{
// m_log.DebugFormat("[SIMIAN GRID CONNECTOR] found regions with name {0}",name);
OSDArray array = response["Scenes"] as OSDArray;
if (array != null)
{
@ -330,7 +307,10 @@ namespace OpenSim.Services.Connectors.SimianGrid
{ "Enabled", "1" }
};
OSDMap response = WebUtil.PostToService(m_serverUrl, requestArgs);
m_log.WarnFormat("[SIMIAN GRID CONNECTOR] request regions by range {0} to {1}",minPosition.ToString(),maxPosition.ToString());
OSDMap response = WebUtil.PostToService(m_ServerURI, requestArgs);
if (response["Success"].AsBoolean())
{
OSDArray array = response["Scenes"] as OSDArray;
@ -386,7 +366,9 @@ namespace OpenSim.Services.Connectors.SimianGrid
{ "SceneID", regionID.ToString() }
};
OSDMap response = WebUtil.PostToService(m_serverUrl, requestArgs);
// m_log.DebugFormat("[SIMIAN GRID CONNECTOR] request region flags for {0}",regionID.ToString());
OSDMap response = WebUtil.PostToService(m_ServerURI, requestArgs);
if (response["Success"].AsBoolean())
{
return response["Enabled"].AsBoolean() ? REGION_ONLINE : 0;
@ -432,7 +414,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
// Make the remote storage request
try
{
HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(m_serverUrl);
HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(m_ServerURI);
HttpWebResponse response = MultipartForm.Post(request, postParameters);
using (Stream responseStream = response.GetResponseStream())
@ -488,7 +470,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
if (onlyEnabled)
requestArgs["Enabled"] = "1";
OSDMap response = WebUtil.PostToService(m_serverUrl, requestArgs);
OSDMap response = WebUtil.PostToService(m_ServerURI, requestArgs);
if (response["Success"].AsBoolean())
{
return ResponseToGridRegion(response);

View File

@ -330,10 +330,12 @@ namespace OpenSim.Services.HypergridService
if (parts.Length < 2)
return false;
string addressee = parts[0];
m_log.DebugFormat("[GATEKEEPER SERVICE]: Verifying {0} against {1}", addressee, m_ExternalName);
char[] trailing_slash = new char[] { '/' };
string addressee = parts[0].TrimEnd(trailing_slash);
string externalname = m_ExternalName.TrimEnd(trailing_slash);
m_log.DebugFormat("[GATEKEEPER SERVICE]: Verifying {0} against {1}", addressee, externalname);
return string.Equals(addressee, m_ExternalName, StringComparison.OrdinalIgnoreCase);
return string.Equals(addressee, externalname, StringComparison.OrdinalIgnoreCase);
}
#endregion

View File

@ -38,6 +38,8 @@
; for the LocalGridServicesConnector which is used by the Remote one
StorageProvider = "OpenSim.Data.Null.dll:NullRegionData"
NetworkConnector = "OpenSim.Services.Connectors.dll:GridServicesConnector"
[LibraryService]
LocalServiceModule = "OpenSim.Services.InventoryService.dll:LibraryService"
LibraryName = "OpenSim Library"

View File

@ -49,6 +49,8 @@
LocalServiceModule = "OpenSim.Services.GridService.dll:GridService"
StorageProvider = "OpenSim.Data.Null.dll:NullRegionData"
NetworkConnector = "OpenSim.Services.Connectors.dll:GridServicesConnector"
; Needed to display non-default map tile images for linked regions
AssetService = "OpenSim.Services.Connectors.dll:AssetServicesConnector"

View File

@ -21,7 +21,7 @@
Include-Common = "config-include/GridCommon.ini"
[Modules]
GridServices = "SimianGridServiceConnector"
GridServices = "RemoteGridServicesConnector"
PresenceServices = "SimianPresenceServiceConnector"
UserAccountServices = "SimianUserAccountServiceConnector"
AuthenticationServices = "SimianAuthenticationServiceConnector"
@ -53,6 +53,7 @@
[GridService]
LocalServiceModule = "OpenSim.Services.GridService.dll:GridService"
StorageProvider = "OpenSim.Data.Null.dll:NullRegionData"
NetworkConnector = "OpenSim.Services.Connectors.dll:SimianGridServiceConnector"
AllowHypergridMapSearch = true

View File

@ -21,7 +21,7 @@
Include-Common = "config-include/GridCommon.ini"
[Modules]
GridServices = "SimianGridServiceConnector"
GridServices = "RemoteGridServicesConnector"
PresenceServices = "SimianPresenceServiceConnector"
UserAccountServices = "SimianUserAccountServiceConnector"
AuthenticationServices = "SimianAuthenticationServiceConnector"
@ -53,6 +53,7 @@
[GridService]
LocalServiceModule = "OpenSim.Services.GridService.dll:GridService"
StorageProvider = "OpenSim.Data.Null.dll:NullRegionData"
NetworkConnector = "OpenSim.Services.Connectors.dll:SimianGridServiceConnector"
[LibraryService]
LocalServiceModule = "OpenSim.Services.InventoryService.dll:LibraryService"