Merge branch 'master' into groups-core-contrib

arthursv
Michael Cortez 2009-08-06 09:38:51 -07:00
commit 2ac04cb624
21 changed files with 337 additions and 84 deletions

View File

@ -149,21 +149,68 @@ namespace OpenSim.ApplicationPlugins.RegionModulesController
public void AddRegionToModules (Scene scene) public void AddRegionToModules (Scene scene)
{ {
Dictionary<Type, ISharedRegionModule> deferredSharedModules =
new Dictionary<Type, ISharedRegionModule>();
Dictionary<Type, INonSharedRegionModule> deferredNonSharedModules =
new Dictionary<Type, INonSharedRegionModule>();
Type s = scene.GetType();
MethodInfo mi = s.GetMethod("RequestModuleInterface");
List<ISharedRegionModule> sharedlist = new List<ISharedRegionModule>();
foreach (ISharedRegionModule module in m_sharedInstances) foreach (ISharedRegionModule module in m_sharedInstances)
{ {
Type replaceableInterface = module.ReplacableInterface;
if (replaceableInterface != null)
{
MethodInfo mii = mi.MakeGenericMethod(replaceableInterface);
if (mii.Invoke(scene, new object[0]) != null)
{
m_log.DebugFormat("[REGIONMODULE]: Not loading {0} because another module has registered {1}", module.Name, replaceableInterface.ToString());
continue;
}
deferredSharedModules[replaceableInterface] = module;
m_log.DebugFormat("[REGIONMODULE]: Deferred load of {0}", module.Name);
continue;
}
m_log.DebugFormat("[REGIONMODULE]: Adding scene {0} to shared module {1}", m_log.DebugFormat("[REGIONMODULE]: Adding scene {0} to shared module {1}",
scene.RegionInfo.RegionName, module.Name); scene.RegionInfo.RegionName, module.Name);
module.AddRegion(scene); module.AddRegion(scene);
scene.AddRegionModule(module.Name, module); scene.AddRegionModule(module.Name, module);
sharedlist.Add(module);
} }
List<INonSharedRegionModule> list = new List<INonSharedRegionModule>(); List<INonSharedRegionModule> list = new List<INonSharedRegionModule>();
foreach (Type type in m_nonSharedModules) foreach (Type type in m_nonSharedModules)
{ {
INonSharedRegionModule module = (INonSharedRegionModule)Activator.CreateInstance(type); INonSharedRegionModule module = (INonSharedRegionModule)Activator.CreateInstance(type);
Type replaceableInterface = module.ReplacableInterface;
if (replaceableInterface != null)
{
MethodInfo mii = mi.MakeGenericMethod(replaceableInterface);
if (mii.Invoke(scene, new object[0]) != null)
{
m_log.DebugFormat("[REGIONMODULE]: Not loading {0} because another module has registered {1}", module.Name, replaceableInterface.ToString());
continue;
}
deferredNonSharedModules[replaceableInterface] = module;
m_log.DebugFormat("[REGIONMODULE]: Deferred load of {0}", module.Name);
continue;
}
m_log.DebugFormat("[REGIONMODULE]: Adding scene {0} to non-shared module {1}", m_log.DebugFormat("[REGIONMODULE]: Adding scene {0} to non-shared module {1}",
scene.RegionInfo.RegionName, module.Name); scene.RegionInfo.RegionName, module.Name);
module.Initialise(m_openSim.ConfigSource.Source); module.Initialise(m_openSim.ConfigSource.Source);
list.Add(module); list.Add(module);
} }
@ -173,6 +220,60 @@ namespace OpenSim.ApplicationPlugins.RegionModulesController
scene.AddRegionModule(module.Name, module); scene.AddRegionModule(module.Name, module);
} }
// Now all modules without a replaceable base interface are loaded
// Replaceable modules have either been skipped, or omitted.
// Now scan the deferred modules here
foreach (ISharedRegionModule module in deferredSharedModules.Values)
{
Type replaceableInterface = module.ReplacableInterface;
MethodInfo mii = mi.MakeGenericMethod(replaceableInterface);
if (mii.Invoke(scene, new object[0]) != null)
{
m_log.DebugFormat("[REGIONMODULE]: Not loading {0} because another module has registered {1}", module.Name, replaceableInterface.ToString());
continue;
}
m_log.DebugFormat("[REGIONMODULE]: Adding scene {0} to shared module {1} (deferred)",
scene.RegionInfo.RegionName, module.Name);
module.AddRegion(scene);
scene.AddRegionModule(module.Name, module);
sharedlist.Add(module);
}
List<INonSharedRegionModule> deferredlist = new List<INonSharedRegionModule>();
foreach (INonSharedRegionModule module in deferredNonSharedModules.Values)
{
Type replaceableInterface = module.ReplacableInterface;
if (replaceableInterface != null)
{
MethodInfo mii = mi.MakeGenericMethod(replaceableInterface);
if (mii.Invoke(scene, new object[0]) != null)
{
m_log.DebugFormat("[REGIONMODULE]: Not loading {0} because another module has registered {1}", module.Name, replaceableInterface.ToString());
continue;
}
}
m_log.DebugFormat("[REGIONMODULE]: Adding scene {0} to non-shared module {1} (deferred)",
scene.RegionInfo.RegionName, module.Name);
module.Initialise(m_openSim.ConfigSource.Source);
list.Add(module);
deferredlist.Add(module);
}
foreach (INonSharedRegionModule module in deferredlist)
{
module.AddRegion(scene);
scene.AddRegionModule(module.Name, module);
}
// This is needed for all module types. Modules will register // This is needed for all module types. Modules will register
// Interfaces with scene in AddScene, and will also need a means // Interfaces with scene in AddScene, and will also need a means
// to access interfaces registered by other modules. Without // to access interfaces registered by other modules. Without
@ -183,7 +284,7 @@ namespace OpenSim.ApplicationPlugins.RegionModulesController
// and unneccessary caching logic repeated in all modules. // and unneccessary caching logic repeated in all modules.
// The extra function stub is just that much cleaner // The extra function stub is just that much cleaner
// //
foreach (ISharedRegionModule module in m_sharedInstances) foreach (ISharedRegionModule module in sharedlist)
{ {
module.RegionLoaded(scene); module.RegionLoaded(scene);
} }

View File

@ -38,8 +38,7 @@ namespace OpenSim.Framework
{ {
public class AvatarAppearance public class AvatarAppearance
{ {
private static readonly ILog m_log //private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
= LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
// these are guessed at by the list here - // these are guessed at by the list here -
// http://wiki.secondlife.com/wiki/Avatar_Appearance. We'll // http://wiki.secondlife.com/wiki/Avatar_Appearance. We'll

View File

@ -90,8 +90,8 @@ namespace OpenSim.Framework.Communications.Tests
TestHelper.InMethod(); TestHelper.InMethod();
// We want to use our own LoginService for this test, one that // We want to use our own LoginService for this test, one that
// doesn't require authentication. // doesn't require authentication.
LoginService loginService = new LLStandaloneLoginService((UserManagerBase)m_commsManager.UserService, "Hello folks", new TestInventoryService(), new LLStandaloneLoginService((UserManagerBase)m_commsManager.UserService, "Hello folks", new TestInventoryService(),
m_commsManager.NetworkServersInfo, false, new LibraryRootFolder(String.Empty), m_regionConnector); m_commsManager.NetworkServersInfo, false, new LibraryRootFolder(String.Empty), m_regionConnector);
Hashtable loginParams = new Hashtable(); Hashtable loginParams = new Hashtable();
loginParams["first"] = m_firstName; loginParams["first"] = m_firstName;

View File

@ -457,6 +457,10 @@ namespace OpenSim.Framework.Servers.HttpServer
// This has to be here to prevent a Linux/Mono crash // This has to be here to prevent a Linux/Mono crash
m_log.WarnFormat("[BASE HTTP SERVER] XmlRpcRequest issue {0}.\nNOTE: this may be spurious on Linux.", e); m_log.WarnFormat("[BASE HTTP SERVER] XmlRpcRequest issue {0}.\nNOTE: this may be spurious on Linux.", e);
} }
catch (IOException e)
{
m_log.Warn("[BASE HTTP SERVER] XmlRpcRequest issue: " + e.Message);
}
return; return;
} }
@ -464,7 +468,8 @@ namespace OpenSim.Framework.Servers.HttpServer
{ {
foreach (string strAccept in request.AcceptTypes) foreach (string strAccept in request.AcceptTypes)
{ {
if (strAccept.Contains("application/llsd+xml")) if (strAccept.Contains("application/llsd+xml") ||
strAccept.Contains("application/llsd+json"))
{ {
//m_log.Info("[Debug BASE HTTP SERVER]: Found an application/llsd+xml accept header"); //m_log.Info("[Debug BASE HTTP SERVER]: Found an application/llsd+xml accept header");
HandleLLSDRequests(request, response); HandleLLSDRequests(request, response);
@ -483,12 +488,14 @@ namespace OpenSim.Framework.Servers.HttpServer
case "application/llsd+xml": case "application/llsd+xml":
case "application/xml+llsd": case "application/xml+llsd":
case "application/llsd+json":
//m_log.Info("[Debug BASE HTTP SERVER]: found a application/llsd+xml content type"); //m_log.Info("[Debug BASE HTTP SERVER]: found a application/llsd+xml content type");
HandleLLSDRequests(request, response); HandleLLSDRequests(request, response);
return; return;
case "text/xml": case "text/xml":
case "application/xml": case "application/xml":
case "application/json":
default: default:
//m_log.Info("[Debug BASE HTTP SERVER]: in default handler"); //m_log.Info("[Debug BASE HTTP SERVER]: in default handler");
// Point of note.. the DoWeHaveA methods check for an EXACT path // Point of note.. the DoWeHaveA methods check for an EXACT path
@ -529,9 +536,9 @@ namespace OpenSim.Framework.Servers.HttpServer
// with the minimum first // with the minimum first
m_log.WarnFormat("[BASE HTTP SERVER]: HandleRequest threw {0}.\nNOTE: this may be spurious on Linux", e); m_log.WarnFormat("[BASE HTTP SERVER]: HandleRequest threw {0}.\nNOTE: this may be spurious on Linux", e);
} }
catch (EndOfStreamException e) catch (IOException e)
{ {
m_log.ErrorFormat("[BASE HTTP SERVER]: HandleRequest() threw {0}", e); m_log.ErrorFormat("[BASE HTTP SERVER] HandleRequest() threw ", e);
} }
catch (InvalidOperationException e) catch (InvalidOperationException e)
{ {
@ -760,6 +767,10 @@ namespace OpenSim.Framework.Servers.HttpServer
// This has to be here to prevent a Linux/Mono crash // This has to be here to prevent a Linux/Mono crash
m_log.WarnFormat("[BASE HTTP SERVER] XmlRpcRequest issue {0}.\nNOTE: this may be spurious on Linux.", e); m_log.WarnFormat("[BASE HTTP SERVER] XmlRpcRequest issue {0}.\nNOTE: this may be spurious on Linux.", e);
} }
catch (IOException e)
{
m_log.Warn("[BASE HTTP SERVER] XmlRpcRequest issue: " + e.Message);
}
} }
return; return;
//responseString = "Error"; //responseString = "Error";
@ -793,6 +804,10 @@ namespace OpenSim.Framework.Servers.HttpServer
// This has to be here to prevent a Linux/Mono crash // This has to be here to prevent a Linux/Mono crash
m_log.WarnFormat("[BASE HTTP SERVER] XmlRpcRequest issue {0}.\nNOTE: this may be spurious on Linux.", e); m_log.WarnFormat("[BASE HTTP SERVER] XmlRpcRequest issue {0}.\nNOTE: this may be spurious on Linux.", e);
} }
catch (IOException e)
{
m_log.Warn("[BASE HTTP SERVER] XmlRpcRequest issue: " + e.Message);
}
} }
} }
@ -823,7 +838,7 @@ namespace OpenSim.Framework.Servers.HttpServer
} }
try try
{ {
llsdRequest = OSDParser.DeserializeLLSDXml(requestBody); llsdRequest = OSDParser.Deserialize(requestBody);
} }
catch (Exception ex) catch (Exception ex)
{ {
@ -873,10 +888,10 @@ namespace OpenSim.Framework.Servers.HttpServer
} }
else else
{ {
response.ContentType = "application/llsd+xml"; // Select an appropriate response format
//m_log.Info("[Debug BASE HTTP SERVER]: Response: " + llsdResponse.ToString()); buffer = BuildLLSDResponse(request, response, llsdResponse);
buffer = OSDParser.SerializeLLSDXmlBytes(llsdResponse);
} }
response.SendChunked = false; response.SendChunked = false;
response.ContentLength64 = buffer.Length; response.ContentLength64 = buffer.Length;
response.ContentEncoding = Encoding.UTF8; response.ContentEncoding = Encoding.UTF8;
@ -912,6 +927,47 @@ namespace OpenSim.Framework.Servers.HttpServer
} }
} }
private byte[] BuildLLSDResponse(OSHttpRequest request, OSHttpResponse response, OSD llsdResponse)
{
if (request.AcceptTypes != null && request.AcceptTypes.Length > 0)
{
foreach (string strAccept in request.AcceptTypes)
{
switch (strAccept)
{
case "application/llsd+xml":
case "application/xml":
case "text/xml":
response.ContentType = strAccept;
return OSDParser.SerializeLLSDXmlBytes(llsdResponse);
case "application/llsd+json":
case "application/json":
response.ContentType = strAccept;
return Encoding.UTF8.GetBytes(OSDParser.SerializeJsonString(llsdResponse));
}
}
}
if (!String.IsNullOrEmpty(request.ContentType))
{
switch (request.ContentType)
{
case "application/llsd+xml":
case "application/xml":
case "text/xml":
response.ContentType = request.ContentType;
return OSDParser.SerializeLLSDXmlBytes(llsdResponse);
case "application/llsd+json":
case "application/json":
response.ContentType = request.ContentType;
return Encoding.UTF8.GetBytes(OSDParser.SerializeJsonString(llsdResponse));
}
}
response.ContentType = "application/llsd+json";
return Encoding.UTF8.GetBytes(OSDParser.SerializeJsonString(llsdResponse));
}
/// <summary> /// <summary>
/// Checks if we have an Exact path in the LLSD handlers for the path provided /// Checks if we have an Exact path in the LLSD handlers for the path provided
/// </summary> /// </summary>
@ -1404,6 +1460,10 @@ namespace OpenSim.Framework.Servers.HttpServer
// This has to be here to prevent a Linux/Mono crash // This has to be here to prevent a Linux/Mono crash
m_log.WarnFormat("[BASE HTTP SERVER] XmlRpcRequest issue {0}.\nNOTE: this may be spurious on Linux.", e); m_log.WarnFormat("[BASE HTTP SERVER] XmlRpcRequest issue {0}.\nNOTE: this may be spurious on Linux.", e);
} }
catch (IOException e)
{
m_log.Warn("[BASE HTTP SERVER] XmlRpcRequest issue: " + e.Message);
}
} }
} }

View File

@ -1111,5 +1111,56 @@ namespace OpenSim.Framework
return null; return null;
} }
public static string[] Glob(string path)
{
string vol=String.Empty;
if (Path.VolumeSeparatorChar != Path.DirectorySeparatorChar)
{
string[] vcomps = path.Split(new char[] {Path.VolumeSeparatorChar}, 2, StringSplitOptions.RemoveEmptyEntries);
if (vcomps.Length > 1)
{
path = vcomps[1];
vol = vcomps[0];
}
}
string[] comps = path.Split(new char[] {Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar}, StringSplitOptions.RemoveEmptyEntries);
// Glob
path = vol;
if (vol != String.Empty)
path += new String(new char[] {Path.VolumeSeparatorChar, Path.DirectorySeparatorChar});
else
path = new String(new char[] {Path.DirectorySeparatorChar});
List<string> paths = new List<string>();
List<string> found = new List<string>();
paths.Add(path);
foreach (string c in comps)
{
List<string> addpaths = new List<string>();
foreach (string p in paths)
{
string[] dirs = Directory.GetDirectories(p, c);
if (dirs.Length != 0)
{
foreach (string dir in dirs)
addpaths.Add(Path.Combine(path, dir));
}
string[] files = Directory.GetFiles(p, c);
foreach (string f in files)
found.Add(f);
}
paths = addpaths;
}
return found.ToArray();
}
} }
} }

View File

@ -188,10 +188,11 @@ namespace OpenSim
{ {
string path = Path.GetFullPath( string path = Path.GetFullPath(
Path.Combine(Util.configDir(), file)); Path.Combine(Util.configDir(), file));
if (File.Exists(path)) string[] paths = Util.Glob(path);
foreach (string p in paths)
{ {
if (!sources.Contains(path)) if (!sources.Contains(p))
sources.Add(path); sources.Add(p);
} }
} }
} }

View File

@ -827,9 +827,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
sendbuffer.Length, SocketFlags.None, m_Client.CircuitCode); sendbuffer.Length, SocketFlags.None, m_Client.CircuitCode);
} }
} }
catch (NullReferenceException n) catch (NullReferenceException)
{ {
m_log.Debug("[PACKET] Detected reuse of a returned packet"); m_log.Error("[PACKET]: Detected reuse of a returned packet");
m_PacketQueue.Cancel(item.Sequence); m_PacketQueue.Cancel(item.Sequence);
return; return;
} }

View File

@ -45,8 +45,7 @@ namespace OpenSim.Region.CoreModules.Agent.TextureDownload
/// </summary> /// </summary>
public class UserTextureDownloadService public class UserTextureDownloadService
{ {
private static readonly ILog m_log // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
= LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
/// <summary> /// <summary>
/// True if the service has been closed, probably because a user with texture requests still queued /// True if the service has been closed, probably because a user with texture requests still queued
@ -61,22 +60,22 @@ namespace OpenSim.Region.CoreModules.Agent.TextureDownload
/// currently handle properly as far as I know). However, this situation should be handled in a more /// currently handle properly as far as I know). However, this situation should be handled in a more
/// sophisticated way. /// sophisticated way.
/// </summary> /// </summary>
private static readonly int MAX_ALLOWED_TEXTURE_REQUESTS = 5; // private static readonly int MAX_ALLOWED_TEXTURE_REQUESTS = 5;
/// <summary> /// <summary>
/// XXX Also going to limit requests for found textures. /// XXX Also going to limit requests for found textures.
/// </summary> /// </summary>
private readonly IRequestLimitStrategy<UUID> foundTextureLimitStrategy // private readonly IRequestLimitStrategy<UUID> foundTextureLimitStrategy
= new RepeatLimitStrategy<UUID>(MAX_ALLOWED_TEXTURE_REQUESTS); // = new RepeatLimitStrategy<UUID>(MAX_ALLOWED_TEXTURE_REQUESTS);
private readonly IClientAPI m_client; // private readonly IClientAPI m_client;
private readonly Scene m_scene; private readonly Scene m_scene;
/// <summary> /// <summary>
/// Texture Senders are placed in this queue once they have received their texture from the asset /// Texture Senders are placed in this queue once they have received their texture from the asset
/// cache. Another module actually invokes the send. /// cache. Another module actually invokes the send.
/// </summary> /// </summary>
private readonly OpenSim.Framework.BlockingQueue<ITextureSender> m_sharedSendersQueue; // private readonly OpenSim.Framework.BlockingQueue<ITextureSender> m_sharedSendersQueue;
/// <summary> /// <summary>
/// Holds texture senders before they have received the appropriate texture from the asset cache. /// Holds texture senders before they have received the appropriate texture from the asset cache.
@ -88,15 +87,15 @@ namespace OpenSim.Region.CoreModules.Agent.TextureDownload
/// XXX This is really a temporary solution to deal with the situation where a client continually requests /// XXX This is really a temporary solution to deal with the situation where a client continually requests
/// the same missing textures /// the same missing textures
/// </summary> /// </summary>
private readonly IRequestLimitStrategy<UUID> missingTextureLimitStrategy // private readonly IRequestLimitStrategy<UUID> missingTextureLimitStrategy
= new RepeatLimitStrategy<UUID>(MAX_ALLOWED_TEXTURE_REQUESTS); // = new RepeatLimitStrategy<UUID>(MAX_ALLOWED_TEXTURE_REQUESTS);
public UserTextureDownloadService( public UserTextureDownloadService(
IClientAPI client, Scene scene, OpenSim.Framework.BlockingQueue<ITextureSender> sharedQueue) IClientAPI client, Scene scene, OpenSim.Framework.BlockingQueue<ITextureSender> sharedQueue)
{ {
m_client = client; // m_client = client;
m_scene = scene; m_scene = scene;
m_sharedSendersQueue = sharedQueue; // m_sharedSendersQueue = sharedQueue;
} }
/// <summary> /// <summary>
@ -231,16 +230,16 @@ namespace OpenSim.Region.CoreModules.Agent.TextureDownload
/// Place a ready texture sender on the processing queue. /// Place a ready texture sender on the processing queue.
/// </summary> /// </summary>
/// <param name="textureSender"></param> /// <param name="textureSender"></param>
private void EnqueueTextureSender(ITextureSender textureSender) // private void EnqueueTextureSender(ITextureSender textureSender)
{ // {
textureSender.Cancel = false; // textureSender.Cancel = false;
textureSender.Sending = true; // textureSender.Sending = true;
//
if (!m_sharedSendersQueue.Contains(textureSender)) // if (!m_sharedSendersQueue.Contains(textureSender))
{ // {
m_sharedSendersQueue.Enqueue(textureSender); // m_sharedSendersQueue.Enqueue(textureSender);
} // }
} // }
/// <summary> /// <summary>
/// Close this module. /// Close this module.

View File

@ -66,7 +66,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
/// <summary> /// <summary>
/// Test saving a V0.1 OpenSim Inventory Archive (subject to change since there is no fixed format yet). /// Test saving a V0.1 OpenSim Inventory Archive (subject to change since there is no fixed format yet).
/// </summary> /// </summary>
//[Test] [Test]
public void TestSaveIarV0_1() public void TestSaveIarV0_1()
{ {
TestHelper.InMethod(); TestHelper.InMethod();
@ -202,19 +202,19 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
/// Test loading a V0.1 OpenSim Inventory Archive (subject to change since there is no fixed format yet) where /// Test loading a V0.1 OpenSim Inventory Archive (subject to change since there is no fixed format yet) where
/// an account exists with the creator name. /// an account exists with the creator name.
/// </summary> /// </summary>
//[Test] [Test]
public void TestLoadIarV0_1ExistingUsers() public void TestLoadIarV0_1ExistingUsers()
{ {
TestHelper.InMethod(); TestHelper.InMethod();
//log4net.Config.XmlConfigurator.Configure(); log4net.Config.XmlConfigurator.Configure();
string userFirstName = "Mr"; string userFirstName = "Mr";
string userLastName = "Tiddles"; string userLastName = "Tiddles";
UUID userUuid = UUID.Parse("00000000-0000-0000-0000-000000000555"); UUID userUuid = UUID.Parse("00000000-0000-0000-0000-000000000555");
string user2FirstName = "Lord"; string userItemCreatorFirstName = "Lord";
string user2LastName = "Lucan"; string userItemCreatorLastName = "Lucan";
UUID user2Uuid = UUID.Parse("00000000-0000-0000-0000-000000000666"); UUID userItemCreatorUuid = UUID.Parse("00000000-0000-0000-0000-000000000666");
string itemName = "b.lsl"; string itemName = "b.lsl";
string archiveItemName string archiveItemName
@ -227,7 +227,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
item1.Name = itemName; item1.Name = itemName;
item1.AssetID = UUID.Random(); item1.AssetID = UUID.Random();
item1.GroupID = UUID.Random(); item1.GroupID = UUID.Random();
item1.CreatorId = OspResolver.MakeOspa(user2FirstName, user2LastName); item1.CreatorId = OspResolver.MakeOspa(userItemCreatorFirstName, userItemCreatorLastName);
//item1.CreatorId = userUuid.ToString(); //item1.CreatorId = userUuid.ToString();
//item1.CreatorId = "00000000-0000-0000-0000-000000000444"; //item1.CreatorId = "00000000-0000-0000-0000-000000000444";
item1.Owner = UUID.Zero; item1.Owner = UUID.Zero;
@ -249,13 +249,15 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
userAdminService.AddUser( userAdminService.AddUser(
userFirstName, userLastName, "meowfood", String.Empty, 1000, 1000, userUuid); userFirstName, userLastName, "meowfood", String.Empty, 1000, 1000, userUuid);
userAdminService.AddUser( userAdminService.AddUser(
user2FirstName, user2LastName, "hampshire", String.Empty, 1000, 1000, user2Uuid); userItemCreatorFirstName, userItemCreatorLastName, "hampshire",
String.Empty, 1000, 1000, userItemCreatorUuid);
archiverModule.DearchiveInventory(userFirstName, userLastName, "/", archiveReadStream); archiverModule.DearchiveInventory(userFirstName, userLastName, "/", archiveReadStream);
CachedUserInfo userInfo CachedUserInfo userInfo
= scene.CommsManager.UserProfileCacheService.GetUserDetails(userFirstName, userLastName); = scene.CommsManager.UserProfileCacheService.GetUserDetails(userFirstName, userLastName);
userInfo.FetchInventory(); //userInfo.FetchInventory();
/*
for (int i = 0 ; i < 50 ; i++) for (int i = 0 ; i < 50 ; i++)
{ {
if (userInfo.HasReceivedInventory == true) if (userInfo.HasReceivedInventory == true)
@ -263,18 +265,22 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
Thread.Sleep(200); Thread.Sleep(200);
} }
Assert.That(userInfo.HasReceivedInventory, Is.True, "FetchInventory timed out (10 seconds)"); Assert.That(userInfo.HasReceivedInventory, Is.True, "FetchInventory timed out (10 seconds)");
*/
InventoryItemBase foundItem = userInfo.RootFolder.FindItemByPath(itemName); InventoryItemBase foundItem = userInfo.RootFolder.FindItemByPath(itemName);
Assert.That(foundItem, Is.Not.Null); Assert.That(foundItem, Is.Not.Null, "Didn't find loaded item");
Assert.That(foundItem.CreatorId, Is.EqualTo(item1.CreatorId)); Assert.That(
Assert.That(foundItem.CreatorIdAsUuid, Is.EqualTo(user2Uuid)); foundItem.CreatorId, Is.EqualTo(item1.CreatorId),
Assert.That(foundItem.Owner, Is.EqualTo(userUuid)); "Loaded item non-uuid creator doesn't match original");
Assert.That(
Console.WriteLine("Successfully completed {0}", MethodBase.GetCurrentMethod()); foundItem.CreatorIdAsUuid, Is.EqualTo(userItemCreatorUuid),
"Loaded item uuid creator doesn't match original");
Assert.That(foundItem.Owner, Is.EqualTo(userUuid),
"Loaded item owner doesn't match inventory reciever");
} }
/// <summary> /// <summary>
/// Test loading a V0.1 OpenSim Inventory Archive (subject to change since there is no fixed format yet) where /// Test loading a V0.1 OpenSim Inventory Archive (subject to change since there is no fixed format yet) where
/// no account exists with the creator name /// no account exists with the creator name
/// </summary> /// </summary>
//[Test] //[Test]
public void TestLoadIarV0_1TempProfiles() public void TestLoadIarV0_1TempProfiles()
@ -362,6 +368,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
CachedUserInfo userInfo = UserProfileTestUtils.CreateUserWithInventory(commsManager); CachedUserInfo userInfo = UserProfileTestUtils.CreateUserWithInventory(commsManager);
userInfo.FetchInventory(); userInfo.FetchInventory();
/*
for (int i = 0 ; i < 50 ; i++) for (int i = 0 ; i < 50 ; i++)
{ {
if (userInfo.HasReceivedInventory == true) if (userInfo.HasReceivedInventory == true)
@ -369,6 +376,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
Thread.Sleep(200); Thread.Sleep(200);
} }
Assert.That(userInfo.HasReceivedInventory, Is.True, "FetchInventory timed out (10 seconds)"); Assert.That(userInfo.HasReceivedInventory, Is.True, "FetchInventory timed out (10 seconds)");
*/
Console.WriteLine("userInfo.RootFolder 1: {0}", userInfo.RootFolder);
Dictionary <string, InventoryFolderImpl> foldersCreated = new Dictionary<string, InventoryFolderImpl>(); Dictionary <string, InventoryFolderImpl> foldersCreated = new Dictionary<string, InventoryFolderImpl>();
List<InventoryNodeBase> nodesLoaded = new List<InventoryNodeBase>(); List<InventoryNodeBase> nodesLoaded = new List<InventoryNodeBase>();
@ -386,10 +397,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
= string.Format( = string.Format(
"{0}{1}/{2}/{3}", "{0}{1}/{2}/{3}",
ArchiveConstants.INVENTORY_PATH, folder1ArchiveName, folder2ArchiveName, itemName); ArchiveConstants.INVENTORY_PATH, folder1ArchiveName, folder2ArchiveName, itemName);
Console.WriteLine("userInfo.RootFolder 2: {0}", userInfo.RootFolder);
new InventoryArchiveReadRequest(userInfo, null, (Stream)null, null, null) new InventoryArchiveReadRequest(userInfo, null, (Stream)null, null, null)
.ReplicateArchivePathToUserInventory(itemArchivePath, false, userInfo.RootFolder, foldersCreated, nodesLoaded); .ReplicateArchivePathToUserInventory(itemArchivePath, false, userInfo.RootFolder, foldersCreated, nodesLoaded);
Console.WriteLine("userInfo.RootFolder 3: {0}", userInfo.RootFolder);
InventoryFolderImpl folder1 = userInfo.RootFolder.FindFolderByPath("a"); InventoryFolderImpl folder1 = userInfo.RootFolder.FindFolderByPath("a");
Assert.That(folder1, Is.Not.Null, "Could not find folder a"); Assert.That(folder1, Is.Not.Null, "Could not find folder a");
InventoryFolderImpl folder2 = folder1.FindFolderByPath("b"); InventoryFolderImpl folder2 = folder1.FindFolderByPath("b");

View File

@ -60,9 +60,9 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
public class UrlModule : ISharedRegionModule, IUrlModule public class UrlModule : ISharedRegionModule, IUrlModule
{ {
private static readonly ILog m_log = // private static readonly ILog m_log =
LogManager.GetLogger( // LogManager.GetLogger(
MethodBase.GetCurrentMethod().DeclaringType); // MethodBase.GetCurrentMethod().DeclaringType);
private Dictionary<UUID, UrlData> m_RequestMap = private Dictionary<UUID, UrlData> m_RequestMap =
new Dictionary<UUID, UrlData>(); new Dictionary<UUID, UrlData>();

View File

@ -39,7 +39,6 @@ using OpenSim.Region.Framework.Scenes;
using OpenSim.Services.Interfaces; using OpenSim.Services.Interfaces;
using OpenMetaverse; using OpenMetaverse;
namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
{ {
public class LocalInventoryServicesConnector : ISharedRegionModule, IInventoryService public class LocalInventoryServicesConnector : ISharedRegionModule, IInventoryService

View File

@ -2863,7 +2863,8 @@ namespace OpenSim.Region.Physics.OdePlugin
//if ((framecount % m_randomizeWater) == 0) //if ((framecount % m_randomizeWater) == 0)
// randomizeWater(waterlevel); // randomizeWater(waterlevel);
int RayCastTimeMS = m_rayCastManager.ProcessQueuedRequests(); //int RayCastTimeMS = m_rayCastManager.ProcessQueuedRequests();
m_rayCastManager.ProcessQueuedRequests();
collision_optimized(timeStep); collision_optimized(timeStep);

View File

@ -9032,8 +9032,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
Match m = r.Match(url); Match m = r.Match(url);
if (m.Success) { if (m.Success) {
for (int i = 1; i < gnums.Length; i++) { for (int i = 1; i < gnums.Length; i++) {
System.Text.RegularExpressions.Group g = m.Groups[gnums[i]]; //System.Text.RegularExpressions.Group g = m.Groups[gnums[i]];
CaptureCollection cc = g.Captures; //CaptureCollection cc = g.Captures;
} }
if (m.Groups.Count == 5) { if (m.Groups.Count == 5) {
httpHeaders["Authorization"] = String.Format("Basic {0}", Convert.ToBase64String(System.Text.ASCIIEncoding.ASCII.GetBytes(m.Groups[2].ToString() + ":" + m.Groups[3].ToString()))); httpHeaders["Authorization"] = String.Format("Basic {0}", Convert.ToBase64String(System.Text.ASCIIEncoding.ASCII.GetBytes(m.Groups[2].ToString() + ":" + m.Groups[3].ToString())));

View File

@ -46,12 +46,12 @@ namespace OpenSim.Server.Handlers.Freeswitch
{ {
// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private IFreeswitchService m_FreeswitchService; //private IFreeswitchService m_FreeswitchService;
public FreeswitchServerGetHandler(IFreeswitchService service) : public FreeswitchServerGetHandler(IFreeswitchService service) :
base("GET", "/api") base("GET", "/api")
{ {
m_FreeswitchService = service; //m_FreeswitchService = service;
} }
public override byte[] Handle(string path, Stream request, public override byte[] Handle(string path, Stream request,

View File

@ -38,9 +38,7 @@ namespace OpenSim.Services.FreeswitchService
{ {
public class FreeswitchService : FreeswitchServiceBase, IFreeswitchService public class FreeswitchService : FreeswitchServiceBase, IFreeswitchService
{ {
private static readonly ILog m_log = //private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
LogManager.GetLogger(
MethodBase.GetCurrentMethod().DeclaringType);
public FreeswitchService(IConfigSource config) : base(config) public FreeswitchService(IConfigSource config) : base(config)
{ {

View File

@ -39,12 +39,17 @@ namespace OpenSim.Tests.Common.Mock
/// tests are single threaded. /// tests are single threaded.
/// </summary> /// </summary>
public class TestInventoryDataPlugin : IInventoryDataPlugin public class TestInventoryDataPlugin : IInventoryDataPlugin
{ {
/// <value> /// <value>
/// Known inventory folders /// Inventory folders
/// </value> /// </value>
private Dictionary<UUID, InventoryFolderBase> m_folders = new Dictionary<UUID, InventoryFolderBase>(); private Dictionary<UUID, InventoryFolderBase> m_folders = new Dictionary<UUID, InventoryFolderBase>();
//// <value>
/// Inventory items
/// </value>
private Dictionary<UUID, InventoryItemBase> m_items = new Dictionary<UUID, InventoryItemBase>();
/// <value> /// <value>
/// User root folders /// User root folders
/// </value> /// </value>
@ -99,9 +104,7 @@ namespace OpenSim.Tests.Common.Mock
} }
return folders; return folders;
} }
public InventoryItemBase getInventoryItem(UUID item) { return null; }
public InventoryFolderBase getInventoryFolder(UUID folderId) public InventoryFolderBase getInventoryFolder(UUID folderId)
{ {
@ -111,15 +114,6 @@ namespace OpenSim.Tests.Common.Mock
return folder; return folder;
} }
public void addInventoryItem(InventoryItemBase item) {}
public void updateInventoryItem(InventoryItemBase item) {}
public void deleteInventoryItem(UUID item) {}
public InventoryItemBase queryInventoryItem(UUID item)
{
return null;
}
public InventoryFolderBase queryInventoryFolder(UUID folderID) public InventoryFolderBase queryInventoryFolder(UUID folderID)
{ {
return getInventoryFolder(folderID); return getInventoryFolder(folderID);
@ -150,6 +144,29 @@ namespace OpenSim.Tests.Common.Mock
m_folders.Remove(folderId); m_folders.Remove(folderId);
} }
public void addInventoryItem(InventoryItemBase item) { m_items[item.ID] = item; }
public void updateInventoryItem(InventoryItemBase item) { addInventoryItem(item); }
public void deleteInventoryItem(UUID itemId)
{
if (m_items.ContainsKey(itemId))
m_items.Remove(itemId);
}
public InventoryItemBase getInventoryItem(UUID itemId)
{
if (m_items.ContainsKey(itemId))
return m_items[itemId];
else
return null;
}
public InventoryItemBase queryInventoryItem(UUID item)
{
return null;
}
public List<InventoryItemBase> fetchActiveGestures(UUID avatarID) { return null; } public List<InventoryItemBase> fetchActiveGestures(UUID avatarID) { return null; }
} }
} }

View File

@ -54,7 +54,7 @@ namespace OpenSim.Tests.Common
public static void InMethod() public static void InMethod()
{ {
StackTrace stackTrace = new StackTrace(); StackTrace stackTrace = new StackTrace();
Console.WriteLine("==> In Test Method : {0}", stackTrace.GetFrame(1).GetMethod().Name); Console.WriteLine("===> In Test Method : {0} <===", stackTrace.GetFrame(1).GetMethod().Name);
} }
} }
} }

View File

@ -89,5 +89,3 @@ OpenSim, as well as how to report bugs, and participate in the OpenSim
project can always be found at http://opensimulator.org. project can always be found at http://opensimulator.org.
Thanks for trying OpenSim, we hope it is a pleasant experience. Thanks for trying OpenSim, we hope it is a pleasant experience.

5
addon-modules/README Normal file
View File

@ -0,0 +1,5 @@
In this directory you can place addon modules for OpenSim
Each module should be in it's own tree and the root of the tree
should contain a file named "prebuild.xml", which will be included in the
main prebuild file.

View File

@ -1369,3 +1369,11 @@
; config-include/GridCommon.ini.example (if you're connected to a grid) ; config-include/GridCommon.ini.example (if you're connected to a grid)
; Copy to your own .ini there (without .example extension) and edit it ; Copy to your own .ini there (without .example extension) and edit it
; to customize your data ; to customize your data
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; The below pulls in optional module config files
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[Modules]
Include-modules = "addon-modules/*/config/*.ini"

View File

@ -3877,6 +3877,8 @@
<!-- /////////////////// END OF INSERTION ///////////////////////////// --> <!-- /////////////////// END OF INSERTION ///////////////////////////// -->
<?include file="addon-modules/*/prebuild.xml" ?>
</Solution> </Solution>
<!-- Prebuild tool --> <!-- Prebuild tool -->