Merge branch 'master' into careminster-presence-refactor
commit
c5878b6610
|
@ -76,6 +76,5 @@ namespace OpenSim.Data.Null
|
|||
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -88,7 +88,7 @@ namespace OpenSim.Data.Null
|
|||
|
||||
m_DataByUUID[data.PrincipalID] = data;
|
||||
m_DataByName[data.FirstName + " " + data.LastName] = data;
|
||||
if (data.Data.ContainsKey("Email") && data.Data["Email"] != string.Empty)
|
||||
if (data.Data.ContainsKey("Email") && data.Data["Email"] != null && data.Data["Email"] != string.Empty)
|
||||
m_DataByEmail[data.Data["Email"]] = data;
|
||||
|
||||
return true;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
:VERSION 1
|
||||
:VERSION 1
|
||||
|
||||
BEGIN TRANSACTION;
|
||||
|
||||
|
@ -219,59 +219,6 @@ COMMIT;
|
|||
|
||||
BEGIN TRANSACTION;
|
||||
|
||||
CREATE TABLE estate_groups (
|
||||
EstateID int(10) NOT NULL,
|
||||
uuid char(36) NOT NULL
|
||||
);
|
||||
|
||||
CREATE TABLE estate_managers (
|
||||
EstateID int(10) NOT NULL,
|
||||
uuid char(36) NOT NULL
|
||||
);
|
||||
|
||||
CREATE TABLE estate_map (
|
||||
RegionID char(36) NOT NULL default '00000000-0000-0000-0000-000000000000',
|
||||
EstateID int(11) NOT NULL
|
||||
);
|
||||
|
||||
CREATE TABLE estate_settings (
|
||||
EstateID INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
|
||||
EstateName varchar(64) default NULL,
|
||||
AbuseEmailToEstateOwner tinyint(4) NOT NULL,
|
||||
DenyAnonymous tinyint(4) NOT NULL,
|
||||
ResetHomeOnTeleport tinyint(4) NOT NULL,
|
||||
FixedSun tinyint(4) NOT NULL,
|
||||
DenyTransacted tinyint(4) NOT NULL,
|
||||
BlockDwell tinyint(4) NOT NULL,
|
||||
DenyIdentified tinyint(4) NOT NULL,
|
||||
AllowVoice tinyint(4) NOT NULL,
|
||||
UseGlobalTime tinyint(4) NOT NULL,
|
||||
PricePerMeter int(11) NOT NULL,
|
||||
TaxFree tinyint(4) NOT NULL,
|
||||
AllowDirectTeleport tinyint(4) NOT NULL,
|
||||
RedirectGridX int(11) NOT NULL,
|
||||
RedirectGridY int(11) NOT NULL,
|
||||
ParentEstateID int(10) NOT NULL,
|
||||
SunPosition double NOT NULL,
|
||||
EstateSkipScripts tinyint(4) NOT NULL,
|
||||
BillableFactor float NOT NULL,
|
||||
PublicAccess tinyint(4) NOT NULL
|
||||
);
|
||||
insert into estate_settings (EstateID,EstateName,AbuseEmailToEstateOwner,DenyAnonymous,ResetHomeOnTeleport,FixedSun,DenyTransacted,BlockDwell,DenyIdentified,AllowVoice,UseGlobalTime,PricePerMeter,TaxFree,AllowDirectTeleport,RedirectGridX,RedirectGridY,ParentEstateID,SunPosition,PublicAccess,EstateSkipScripts,BillableFactor) values ( 99, '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '');
|
||||
delete from estate_settings;
|
||||
CREATE TABLE estate_users (
|
||||
EstateID int(10) NOT NULL,
|
||||
uuid char(36) NOT NULL
|
||||
);
|
||||
|
||||
CREATE TABLE estateban (
|
||||
EstateID int(10) NOT NULL,
|
||||
bannedUUID varchar(36) NOT NULL,
|
||||
bannedIp varchar(16) NOT NULL,
|
||||
bannedIpHostMask varchar(16) NOT NULL,
|
||||
bannedNameMask varchar(64) default NULL
|
||||
);
|
||||
|
||||
drop table regionsettings;
|
||||
CREATE TABLE regionsettings (
|
||||
regionUUID char(36) NOT NULL,
|
||||
|
@ -307,7 +254,7 @@ CREATE TABLE regionsettings (
|
|||
fixed_sun int(11) NOT NULL,
|
||||
sun_position float NOT NULL,
|
||||
covenant char(36) default NULL,
|
||||
Sandbox tinyint(4) NOT NULL,
|
||||
sandbox tinyint(4) NOT NULL,
|
||||
PRIMARY KEY (regionUUID)
|
||||
);
|
||||
|
||||
|
|
|
@ -93,7 +93,7 @@ namespace OpenSim.Data.SQLite
|
|||
|
||||
ds = new DataSet("Region");
|
||||
|
||||
m_log.Info("[REGION DB]: Sqlite - connecting: " + connectionString);
|
||||
m_log.Info("[SQLITE REGION DB]: Sqlite - connecting: " + connectionString);
|
||||
m_conn = new SqliteConnection(m_connectionString);
|
||||
m_conn.Open();
|
||||
|
||||
|
@ -156,7 +156,7 @@ namespace OpenSim.Data.SQLite
|
|||
}
|
||||
catch (Exception)
|
||||
{
|
||||
m_log.Info("[REGION DB]: Caught fill error on prims table");
|
||||
m_log.Info("[SQLITE REGION DB]: Caught fill error on prims table");
|
||||
}
|
||||
|
||||
try
|
||||
|
@ -165,7 +165,16 @@ namespace OpenSim.Data.SQLite
|
|||
}
|
||||
catch (Exception)
|
||||
{
|
||||
m_log.Info("[REGION DB]: Caught fill error on primshapes table");
|
||||
m_log.Info("[SQLITE REGION DB]: Caught fill error on primshapes table");
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
itemsDa.Fill(ds.Tables["primitems"]);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
m_log.Info("[SQLITE REGION DB]: Caught fill error on primitems table");
|
||||
}
|
||||
|
||||
try
|
||||
|
@ -174,7 +183,7 @@ namespace OpenSim.Data.SQLite
|
|||
}
|
||||
catch (Exception)
|
||||
{
|
||||
m_log.Info("[REGION DB]: Caught fill error on terrain table");
|
||||
m_log.Info("[SQLITE REGION DB]: Caught fill error on terrain table");
|
||||
}
|
||||
|
||||
try
|
||||
|
@ -183,7 +192,7 @@ namespace OpenSim.Data.SQLite
|
|||
}
|
||||
catch (Exception)
|
||||
{
|
||||
m_log.Info("[REGION DB]: Caught fill error on land table");
|
||||
m_log.Info("[SQLITE REGION DB]: Caught fill error on land table");
|
||||
}
|
||||
|
||||
try
|
||||
|
@ -192,7 +201,7 @@ namespace OpenSim.Data.SQLite
|
|||
}
|
||||
catch (Exception)
|
||||
{
|
||||
m_log.Info("[REGION DB]: Caught fill error on landaccesslist table");
|
||||
m_log.Info("[SQLITE REGION DB]: Caught fill error on landaccesslist table");
|
||||
}
|
||||
|
||||
try
|
||||
|
@ -201,7 +210,7 @@ namespace OpenSim.Data.SQLite
|
|||
}
|
||||
catch (Exception)
|
||||
{
|
||||
m_log.Info("[REGION DB]: Caught fill error on regionsettings table");
|
||||
m_log.Info("[SQLITE REGION DB]: Caught fill error on regionsettings table");
|
||||
}
|
||||
|
||||
// We have to create a data set mapping for every table, otherwise the IDataAdaptor.Update() will not populate rows with values!
|
||||
|
@ -434,7 +443,7 @@ namespace OpenSim.Data.SQLite
|
|||
lock (ds)
|
||||
{
|
||||
DataRow[] primsForRegion = prims.Select(byRegion);
|
||||
m_log.Info("[REGION DB]: Loaded " + primsForRegion.Length + " prims for region: " + regionUUID);
|
||||
// m_log.Info("[SQLITE REGION DB]: Loaded " + primsForRegion.Length + " prims for region: " + regionUUID);
|
||||
|
||||
// First, create all groups
|
||||
foreach (DataRow primRow in primsForRegion)
|
||||
|
@ -456,8 +465,8 @@ namespace OpenSim.Data.SQLite
|
|||
}
|
||||
else
|
||||
{
|
||||
m_log.Info(
|
||||
"[REGION DB]: No shape found for prim in storage, so setting default box shape");
|
||||
m_log.Warn(
|
||||
"[SQLITE REGION DB]: No shape found for prim in storage, so setting default box shape");
|
||||
prim.Shape = PrimitiveBaseShape.Default;
|
||||
}
|
||||
|
||||
|
@ -469,11 +478,11 @@ namespace OpenSim.Data.SQLite
|
|||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.Error("[REGION DB]: Failed create prim object in new group, exception and data follows");
|
||||
m_log.Info("[REGION DB]: " + e.ToString());
|
||||
m_log.Error("[SQLITE REGION DB]: Failed create prim object in new group, exception and data follows");
|
||||
m_log.Error("[SQLITE REGION DB]: ", e);
|
||||
foreach (DataColumn col in prims.Columns)
|
||||
{
|
||||
m_log.Info("[REGION DB]: Col: " + col.ColumnName + " => " + primRow[col]);
|
||||
m_log.Error("[SQLITE REGION DB]: Col: " + col.ColumnName + " => " + primRow[col]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -498,7 +507,7 @@ namespace OpenSim.Data.SQLite
|
|||
else
|
||||
{
|
||||
m_log.Warn(
|
||||
"[REGION DB]: No shape found for prim in storage, so setting default box shape");
|
||||
"[SQLITE REGION DB]: No shape found for prim in storage, so setting default box shape");
|
||||
prim.Shape = PrimitiveBaseShape.Default;
|
||||
}
|
||||
|
||||
|
@ -508,11 +517,11 @@ namespace OpenSim.Data.SQLite
|
|||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.Error("[REGION DB]: Failed create prim object in group, exception and data follows");
|
||||
m_log.Info("[REGION DB]: " + e.ToString());
|
||||
m_log.Error("[SQLITE REGION DB]: Failed create prim object in group, exception and data follows");
|
||||
m_log.Error("[SQLITE REGION DB]: ", e);
|
||||
foreach (DataColumn col in prims.Columns)
|
||||
{
|
||||
m_log.Info("[REGION DB]: Col: " + col.ColumnName + " => " + primRow[col]);
|
||||
m_log.Error("[SQLITE REGION DB]: Col: " + col.ColumnName + " => " + primRow[col]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -526,19 +535,22 @@ namespace OpenSim.Data.SQLite
|
|||
/// <param name="prim">the prim</param>
|
||||
private void LoadItems(SceneObjectPart prim)
|
||||
{
|
||||
//m_log.DebugFormat("[DATASTORE]: Loading inventory for {0}, {1}", prim.Name, prim.UUID);
|
||||
// m_log.DebugFormat("[SQLITE REGION DB]: Loading inventory for {0} {1}", prim.Name, prim.UUID);
|
||||
|
||||
DataTable dbItems = ds.Tables["primitems"];
|
||||
String sql = String.Format("primID = '{0}'", prim.UUID.ToString());
|
||||
DataRow[] dbItemRows = dbItems.Select(sql);
|
||||
IList<TaskInventoryItem> inventory = new List<TaskInventoryItem>();
|
||||
|
||||
// m_log.DebugFormat(
|
||||
// "[SQLITE REGION DB]: Found {0} items for {1} {2}", dbItemRows.Length, prim.Name, prim.UUID);
|
||||
|
||||
foreach (DataRow row in dbItemRows)
|
||||
{
|
||||
TaskInventoryItem item = buildItem(row);
|
||||
inventory.Add(item);
|
||||
|
||||
//m_log.DebugFormat("[DATASTORE]: Restored item {0}, {1}", item.Name, item.ItemID);
|
||||
// m_log.DebugFormat("[SQLITE REGION DB]: Restored item {0} {1}", item.Name, item.ItemID);
|
||||
}
|
||||
|
||||
prim.Inventory.RestoreInventoryItems(inventory);
|
||||
|
@ -574,7 +586,7 @@ namespace OpenSim.Data.SQLite
|
|||
|
||||
// the following is an work around for .NET. The perf
|
||||
// issues associated with it aren't as bad as you think.
|
||||
m_log.Info("[REGION DB]: Storing terrain revision r" + revision.ToString());
|
||||
m_log.Debug("[SQLITE REGION DB]: Storing terrain revision r" + revision.ToString());
|
||||
String sql = "insert into terrain(RegionUUID, Revision, Heightfield)" +
|
||||
" values(:RegionUUID, :Revision, :Heightfield)";
|
||||
|
||||
|
@ -630,11 +642,11 @@ namespace OpenSim.Data.SQLite
|
|||
}
|
||||
else
|
||||
{
|
||||
m_log.Info("[REGION DB]: No terrain found for region");
|
||||
m_log.Warn("[SQLITE REGION DB]: No terrain found for region");
|
||||
return null;
|
||||
}
|
||||
|
||||
m_log.Info("[REGION DB]: Loaded terrain revision r" + rev.ToString());
|
||||
m_log.Debug("[SQLITE REGION DB]: Loaded terrain revision r" + rev.ToString());
|
||||
}
|
||||
}
|
||||
return terret;
|
||||
|
@ -1417,7 +1429,7 @@ namespace OpenSim.Data.SQLite
|
|||
}
|
||||
catch (InvalidCastException)
|
||||
{
|
||||
m_log.ErrorFormat("[PARCEL]: unable to get parcel telehub settings for {1}", newData.Name);
|
||||
m_log.ErrorFormat("[SQLITE REGION DB]: unable to get parcel telehub settings for {1}", newData.Name);
|
||||
newData.UserLocation = Vector3.Zero;
|
||||
newData.UserLookAt = Vector3.Zero;
|
||||
}
|
||||
|
@ -1926,7 +1938,7 @@ namespace OpenSim.Data.SQLite
|
|||
/// <param name="items"></param>
|
||||
public void StorePrimInventory(UUID primID, ICollection<TaskInventoryItem> items)
|
||||
{
|
||||
//m_log.InfoFormat("[REGION DB]: Entered StorePrimInventory with prim ID {0}", primID);
|
||||
// m_log.DebugFormat("[SQLITE REGION DB]: Entered StorePrimInventory with prim ID {0}", primID);
|
||||
|
||||
DataTable dbItems = ds.Tables["primitems"];
|
||||
|
||||
|
|
|
@ -21,4 +21,4 @@
|
|||
[TestConnections]
|
||||
MySqlConnection="Server=localhost;Port=3306;Database=opensim-nunit;User ID=opensim-nunit;Password=opensim-nunit;"
|
||||
SqlConnection="Server=.\SQL2008;Database=opensim-nunit;Trusted_Connection=True;"
|
||||
SqliteConnection=""
|
||||
SqliteConnection="URI=file:opensim-nunit.db,version=3"
|
|
@ -111,10 +111,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
|
|||
|
||||
protected IGridService GridService
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_Scenes[0].GridService;
|
||||
get { return m_Scenes[0].GridService; }
|
||||
}
|
||||
|
||||
public IUserAccountService UserAccountService
|
||||
{
|
||||
get { return m_Scenes[0].UserAccountService; }
|
||||
}
|
||||
|
||||
public IScene Scene
|
||||
|
@ -221,6 +223,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
|
|||
|
||||
client.OnLogout += OnLogout;
|
||||
|
||||
lock (m_Friends)
|
||||
{
|
||||
if (m_Friends.ContainsKey(client.AgentId))
|
||||
{
|
||||
m_Friends[client.AgentId].Refcount++;
|
||||
|
@ -235,12 +239,14 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
|
|||
newFriends.RegionID = UUID.Zero;
|
||||
|
||||
m_Friends.Add(client.AgentId, newFriends);
|
||||
}
|
||||
|
||||
//StatusChange(client.AgentId, true);
|
||||
}
|
||||
|
||||
private void OnClientClosed(UUID agentID, Scene scene)
|
||||
{
|
||||
lock (m_Friends)
|
||||
if (m_Friends.ContainsKey(agentID))
|
||||
{
|
||||
if (m_Friends[agentID].Refcount == 1)
|
||||
|
@ -555,12 +561,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
|
|||
|
||||
private void OnApproveFriendRequest(IClientAPI client, UUID agentID, UUID friendID, List<UUID> callingCardFolders)
|
||||
{
|
||||
m_log.DebugFormat("[FRIENDS]: {0} accepted friendship from {1}", agentID, friendID);
|
||||
|
||||
FriendsService.StoreFriend(agentID, friendID.ToString(), 1);
|
||||
FriendsService.StoreFriend(friendID, agentID.ToString(), 1);
|
||||
// update the local cache
|
||||
m_Friends[agentID].Friends = FriendsService.GetFriends(agentID);
|
||||
|
||||
m_log.DebugFormat("[FRIENDS]: {0} accepted friendship from {1}", agentID, friendID);
|
||||
|
||||
//
|
||||
// Notify the friend
|
||||
|
@ -609,7 +616,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
|
|||
if (friendSession != null)
|
||||
{
|
||||
GridRegion region = GridService.GetRegionByUUID(m_Scenes[0].RegionInfo.ScopeID, friendSession.RegionID);
|
||||
if (region != null)
|
||||
m_FriendsSimConnector.FriendshipDenied(region, agentID, client.Name, friendID);
|
||||
else
|
||||
m_log.WarnFormat("[FRIENDS]: Could not find region {0} in locating {1}", friendSession.RegionID, friendID);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -35,6 +35,7 @@ using OpenSim.Framework;
|
|||
using OpenSim.Server.Base;
|
||||
using OpenSim.Framework.Servers.HttpServer;
|
||||
using FriendInfo = OpenSim.Services.Interfaces.FriendInfo;
|
||||
using OpenSim.Services.Interfaces;
|
||||
|
||||
using OpenMetaverse;
|
||||
using log4net;
|
||||
|
@ -61,7 +62,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
|
|||
sr.Close();
|
||||
body = body.Trim();
|
||||
|
||||
m_log.DebugFormat("[XXX]: query String: {0}", body);
|
||||
//m_log.DebugFormat("[XXX]: query String: {0}", body);
|
||||
|
||||
try
|
||||
{
|
||||
|
@ -115,9 +116,15 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
|
|||
if (!UUID.TryParse(request["ToID"].ToString(), out toID))
|
||||
return FailureResult();
|
||||
|
||||
GridInstantMessage im = new GridInstantMessage(m_FriendsModule.Scene, fromID, "", toID,
|
||||
UserAccount account = m_FriendsModule.UserAccountService.GetUserAccount(m_FriendsModule.Scene.RegionInfo.ScopeID, fromID);
|
||||
string name = (account == null) ? "Unknown" : account.FirstName + " " + account.LastName;
|
||||
|
||||
GridInstantMessage im = new GridInstantMessage(m_FriendsModule.Scene, fromID, name, toID,
|
||||
(byte)InstantMessageDialog.FriendshipOffered, message, false, Vector3.Zero);
|
||||
|
||||
// !! HACK
|
||||
im.imSessionID = im.fromAgentID;
|
||||
|
||||
if (m_FriendsModule.LocalFriendshipOffered(toID, im))
|
||||
return SuccessResult();
|
||||
|
||||
|
|
|
@ -390,7 +390,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
|||
/// <returns></returns>
|
||||
protected UserAccount GetUserInfo(string firstName, string lastName, string pass)
|
||||
{
|
||||
UserAccount account = m_aScene.UserAccountService.GetUserAccount(m_aScene.RegionInfo.ScopeID, firstName, lastName);
|
||||
UserAccount account
|
||||
= m_aScene.UserAccountService.GetUserAccount(m_aScene.RegionInfo.ScopeID, firstName, lastName);
|
||||
|
||||
if (null == account)
|
||||
{
|
||||
m_log.ErrorFormat(
|
||||
|
|
|
@ -55,14 +55,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
|
|||
{
|
||||
protected ManualResetEvent mre = new ManualResetEvent(false);
|
||||
|
||||
private void InventoryReceived(UUID userId)
|
||||
{
|
||||
lock (this)
|
||||
{
|
||||
Monitor.PulseAll(this);
|
||||
}
|
||||
}
|
||||
|
||||
private void SaveCompleted(
|
||||
Guid id, bool succeeded, UserAccount userInfo, string invPath, Stream saveStream,
|
||||
Exception reportedException)
|
||||
|
@ -76,11 +68,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
|
|||
// Commenting for now! The mock inventory service needs more beef, at least for
|
||||
// GetFolderForType
|
||||
// REFACTORING PROBLEM. This needs to be rewritten.
|
||||
//[Test]
|
||||
[Test]
|
||||
public void TestSaveIarV0_1()
|
||||
{
|
||||
TestHelper.InMethod();
|
||||
log4net.Config.XmlConfigurator.Configure();
|
||||
// log4net.Config.XmlConfigurator.Configure();
|
||||
|
||||
InventoryArchiverModule archiverModule = new InventoryArchiverModule(true);
|
||||
|
||||
|
@ -195,189 +187,175 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
|
|||
/// </summary>
|
||||
///
|
||||
/// This test also does some deeper probing of loading into nested inventory structures
|
||||
/// REFACTORING PROBLEM. This needs to be rewritten.
|
||||
// [Test]
|
||||
// public void TestLoadIarV0_1ExistingUsers()
|
||||
// {
|
||||
// TestHelper.InMethod();
|
||||
[Test]
|
||||
public void TestLoadIarV0_1ExistingUsers()
|
||||
{
|
||||
TestHelper.InMethod();
|
||||
//log4net.Config.XmlConfigurator.Configure();
|
||||
|
||||
// //log4net.Config.XmlConfigurator.Configure();
|
||||
string userFirstName = "Mr";
|
||||
string userLastName = "Tiddles";
|
||||
UUID userUuid = UUID.Parse("00000000-0000-0000-0000-000000000555");
|
||||
string userItemCreatorFirstName = "Lord";
|
||||
string userItemCreatorLastName = "Lucan";
|
||||
UUID userItemCreatorUuid = UUID.Parse("00000000-0000-0000-0000-000000000666");
|
||||
|
||||
// string userFirstName = "Mr";
|
||||
// string userLastName = "Tiddles";
|
||||
// UUID userUuid = UUID.Parse("00000000-0000-0000-0000-000000000555");
|
||||
// string userItemCreatorFirstName = "Lord";
|
||||
// string userItemCreatorLastName = "Lucan";
|
||||
// UUID userItemCreatorUuid = UUID.Parse("00000000-0000-0000-0000-000000000666");
|
||||
string item1Name = "b.lsl";
|
||||
string archiveItemName = InventoryArchiveWriteRequest.CreateArchiveItemName(item1Name, UUID.Random());
|
||||
|
||||
// string item1Name = "b.lsl";
|
||||
// string archiveItemName = InventoryArchiveWriteRequest.CreateArchiveItemName(item1Name, UUID.Random());
|
||||
MemoryStream archiveWriteStream = new MemoryStream();
|
||||
TarArchiveWriter tar = new TarArchiveWriter(archiveWriteStream);
|
||||
|
||||
// MemoryStream archiveWriteStream = new MemoryStream();
|
||||
// TarArchiveWriter tar = new TarArchiveWriter(archiveWriteStream);
|
||||
InventoryItemBase item1 = new InventoryItemBase();
|
||||
item1.Name = item1Name;
|
||||
item1.AssetID = UUID.Random();
|
||||
item1.GroupID = UUID.Random();
|
||||
item1.CreatorId = OspResolver.MakeOspa(userItemCreatorFirstName, userItemCreatorLastName);
|
||||
//item1.CreatorId = userUuid.ToString();
|
||||
//item1.CreatorId = "00000000-0000-0000-0000-000000000444";
|
||||
item1.Owner = UUID.Zero;
|
||||
|
||||
// InventoryItemBase item1 = new InventoryItemBase();
|
||||
// item1.Name = item1Name;
|
||||
// item1.AssetID = UUID.Random();
|
||||
// item1.GroupID = UUID.Random();
|
||||
// item1.CreatorId = OspResolver.MakeOspa(userItemCreatorFirstName, userItemCreatorLastName);
|
||||
// //item1.CreatorId = userUuid.ToString();
|
||||
// //item1.CreatorId = "00000000-0000-0000-0000-000000000444";
|
||||
// item1.Owner = UUID.Zero;
|
||||
string item1FileName
|
||||
= string.Format("{0}{1}", ArchiveConstants.INVENTORY_PATH, archiveItemName);
|
||||
tar.WriteFile(item1FileName, UserInventoryItemSerializer.Serialize(item1));
|
||||
tar.Close();
|
||||
|
||||
// string item1FileName
|
||||
// = string.Format("{0}{1}", ArchiveConstants.INVENTORY_PATH, archiveItemName);
|
||||
// tar.WriteFile(item1FileName, UserInventoryItemSerializer.Serialize(item1));
|
||||
// tar.Close();
|
||||
MemoryStream archiveReadStream = new MemoryStream(archiveWriteStream.ToArray());
|
||||
SerialiserModule serialiserModule = new SerialiserModule();
|
||||
InventoryArchiverModule archiverModule = new InventoryArchiverModule(true);
|
||||
|
||||
// MemoryStream archiveReadStream = new MemoryStream(archiveWriteStream.ToArray());
|
||||
// SerialiserModule serialiserModule = new SerialiserModule();
|
||||
// InventoryArchiverModule archiverModule = new InventoryArchiverModule(true);
|
||||
// Annoyingly, we have to set up a scene even though inventory loading has nothing to do with a scene
|
||||
Scene scene = SceneSetupHelpers.SetupScene("inventory");
|
||||
|
||||
// // Annoyingly, we have to set up a scene even though inventory loading has nothing to do with a scene
|
||||
// Scene scene = SceneSetupHelpers.SetupScene("inventory");
|
||||
// IUserAdminService userAdminService = scene.CommsManager.UserAdminService;
|
||||
SceneSetupHelpers.SetupSceneModules(scene, serialiserModule, archiverModule);
|
||||
|
||||
// SceneSetupHelpers.SetupSceneModules(scene, serialiserModule, archiverModule);
|
||||
// userAdminService.AddUser(
|
||||
// userFirstName, userLastName, "meowfood", String.Empty, 1000, 1000, userUuid);
|
||||
// userAdminService.AddUser(
|
||||
// userItemCreatorFirstName, userItemCreatorLastName, "hampshire",
|
||||
// String.Empty, 1000, 1000, userItemCreatorUuid);
|
||||
UserProfileTestUtils.CreateUserWithInventory(
|
||||
scene, userFirstName, userLastName, userUuid, "meowfood");
|
||||
UserProfileTestUtils.CreateUserWithInventory(
|
||||
scene, userItemCreatorFirstName, userItemCreatorLastName, userItemCreatorUuid, "hampshire");
|
||||
|
||||
// archiverModule.DearchiveInventory(userFirstName, userLastName, "/", "meowfood", archiveReadStream);
|
||||
archiverModule.DearchiveInventory(userFirstName, userLastName, "/", "meowfood", archiveReadStream);
|
||||
|
||||
// CachedUserInfo userInfo
|
||||
// = scene.CommsManager.UserProfileCacheService.GetUserDetails(userFirstName, userLastName);
|
||||
InventoryItemBase foundItem1
|
||||
= InventoryArchiveUtils.FindItemByPath(scene.InventoryService, userUuid, item1Name);
|
||||
|
||||
// InventoryItemBase foundItem1
|
||||
// = InventoryArchiveUtils.FindItemByPath(scene.InventoryService, userInfo.UserProfile.ID, item1Name);
|
||||
Assert.That(foundItem1, Is.Not.Null, "Didn't find loaded item 1");
|
||||
|
||||
// Assert.That(foundItem1, Is.Not.Null, "Didn't find loaded item 1");
|
||||
|
||||
//// We have to disable this check since loaded items that did find users via OSPA resolution are now only storing the
|
||||
//// UUID, not the OSPA itself.
|
||||
//// Assert.That(
|
||||
//// foundItem1.CreatorId, Is.EqualTo(item1.CreatorId),
|
||||
//// "Loaded item non-uuid creator doesn't match original");
|
||||
// We have to disable this check since loaded items that did find users via OSPA resolution are now only storing the
|
||||
// UUID, not the OSPA itself.
|
||||
// Assert.That(
|
||||
// foundItem1.CreatorId, Is.EqualTo(userItemCreatorUuid.ToString()),
|
||||
// foundItem1.CreatorId, Is.EqualTo(item1.CreatorId),
|
||||
// "Loaded item non-uuid creator doesn't match original");
|
||||
Assert.That(
|
||||
foundItem1.CreatorId, Is.EqualTo(userItemCreatorUuid.ToString()),
|
||||
"Loaded item non-uuid creator doesn't match original");
|
||||
|
||||
Assert.That(
|
||||
foundItem1.CreatorIdAsUuid, Is.EqualTo(userItemCreatorUuid),
|
||||
"Loaded item uuid creator doesn't match original");
|
||||
Assert.That(foundItem1.Owner, Is.EqualTo(userUuid),
|
||||
"Loaded item owner doesn't match inventory reciever");
|
||||
|
||||
// Now try loading to a root child folder
|
||||
UserInventoryTestUtils.CreateInventoryFolder(scene.InventoryService, userUuid, "xA");
|
||||
archiveReadStream = new MemoryStream(archiveReadStream.ToArray());
|
||||
archiverModule.DearchiveInventory(userFirstName, userLastName, "xA", "meowfood", archiveReadStream);
|
||||
|
||||
InventoryItemBase foundItem2
|
||||
= InventoryArchiveUtils.FindItemByPath(scene.InventoryService, userUuid, "xA/" + item1Name);
|
||||
Assert.That(foundItem2, Is.Not.Null, "Didn't find loaded item 2");
|
||||
|
||||
// Now try loading to a more deeply nested folder
|
||||
UserInventoryTestUtils.CreateInventoryFolder(scene.InventoryService, userUuid, "xB/xC");
|
||||
archiveReadStream = new MemoryStream(archiveReadStream.ToArray());
|
||||
archiverModule.DearchiveInventory(userFirstName, userLastName, "xB/xC", "meowfood", archiveReadStream);
|
||||
|
||||
InventoryItemBase foundItem3
|
||||
= InventoryArchiveUtils.FindItemByPath(scene.InventoryService, userUuid, "xB/xC/" + item1Name);
|
||||
Assert.That(foundItem3, Is.Not.Null, "Didn't find loaded item 3");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestIarV0_1WithEscapedChars()
|
||||
{
|
||||
TestHelper.InMethod();
|
||||
// log4net.Config.XmlConfigurator.Configure();
|
||||
|
||||
string itemName = "You & you are a mean/man/";
|
||||
string humanEscapedItemName = @"You & you are a mean\/man\/";
|
||||
string userPassword = "meowfood";
|
||||
|
||||
InventoryArchiverModule archiverModule = new InventoryArchiverModule(true);
|
||||
|
||||
Scene scene = SceneSetupHelpers.SetupScene("Inventory");
|
||||
SceneSetupHelpers.SetupSceneModules(scene, archiverModule);
|
||||
|
||||
// Create user
|
||||
string userFirstName = "Jock";
|
||||
string userLastName = "Stirrup";
|
||||
UUID userId = UUID.Parse("00000000-0000-0000-0000-000000000020");
|
||||
UserProfileTestUtils.CreateUserWithInventory(scene, userFirstName, userLastName, userId, "meowfood");
|
||||
|
||||
// Create asset
|
||||
SceneObjectGroup object1;
|
||||
SceneObjectPart part1;
|
||||
{
|
||||
string partName = "part name";
|
||||
UUID ownerId = UUID.Parse("00000000-0000-0000-0000-000000000040");
|
||||
PrimitiveBaseShape shape = PrimitiveBaseShape.CreateSphere();
|
||||
Vector3 groupPosition = new Vector3(10, 20, 30);
|
||||
Quaternion rotationOffset = new Quaternion(20, 30, 40, 50);
|
||||
Vector3 offsetPosition = new Vector3(5, 10, 15);
|
||||
|
||||
part1
|
||||
= new SceneObjectPart(
|
||||
ownerId, shape, groupPosition, rotationOffset, offsetPosition);
|
||||
part1.Name = partName;
|
||||
|
||||
object1 = new SceneObjectGroup(part1);
|
||||
scene.AddNewSceneObject(object1, false);
|
||||
}
|
||||
|
||||
UUID asset1Id = UUID.Parse("00000000-0000-0000-0000-000000000060");
|
||||
AssetBase asset1 = AssetHelpers.CreateAsset(asset1Id, object1);
|
||||
scene.AssetService.Store(asset1);
|
||||
|
||||
// Create item
|
||||
UUID item1Id = UUID.Parse("00000000-0000-0000-0000-000000000080");
|
||||
InventoryItemBase item1 = new InventoryItemBase();
|
||||
item1.Name = itemName;
|
||||
item1.AssetID = asset1.FullID;
|
||||
item1.ID = item1Id;
|
||||
InventoryFolderBase objsFolder
|
||||
= InventoryArchiveUtils.FindFolderByPath(scene.InventoryService, userId, "Objects");
|
||||
item1.Folder = objsFolder.ID;
|
||||
scene.AddInventoryItem(userId, item1);
|
||||
|
||||
MemoryStream archiveWriteStream = new MemoryStream();
|
||||
archiverModule.OnInventoryArchiveSaved += SaveCompleted;
|
||||
|
||||
mre.Reset();
|
||||
archiverModule.ArchiveInventory(
|
||||
Guid.NewGuid(), userFirstName, userLastName, "Objects", userPassword, archiveWriteStream);
|
||||
mre.WaitOne(60000, false);
|
||||
|
||||
// LOAD ITEM
|
||||
MemoryStream archiveReadStream = new MemoryStream(archiveWriteStream.ToArray());
|
||||
|
||||
archiverModule.DearchiveInventory(userFirstName, userLastName, "Scripts", userPassword, archiveReadStream);
|
||||
|
||||
InventoryItemBase foundItem1
|
||||
= InventoryArchiveUtils.FindItemByPath(
|
||||
scene.InventoryService, userId, "Scripts/Objects/" + humanEscapedItemName);
|
||||
|
||||
Assert.That(foundItem1, Is.Not.Null, "Didn't find loaded item 1");
|
||||
// Assert.That(
|
||||
// foundItem1.CreatorIdAsUuid, Is.EqualTo(userItemCreatorUuid),
|
||||
// "Loaded item uuid creator doesn't match original");
|
||||
// Assert.That(foundItem1.Owner, Is.EqualTo(userUuid),
|
||||
// "Loaded item owner doesn't match inventory reciever");
|
||||
|
||||
// // Now try loading to a root child folder
|
||||
// UserInventoryTestUtils.CreateInventoryFolder(scene.InventoryService, userInfo.UserProfile.ID, "xA");
|
||||
// archiveReadStream = new MemoryStream(archiveReadStream.ToArray());
|
||||
// archiverModule.DearchiveInventory(userFirstName, userLastName, "xA", "meowfood", archiveReadStream);
|
||||
|
||||
// InventoryItemBase foundItem2
|
||||
// = InventoryArchiveUtils.FindItemByPath(scene.InventoryService, userInfo.UserProfile.ID, "xA/" + item1Name);
|
||||
// Assert.That(foundItem2, Is.Not.Null, "Didn't find loaded item 2");
|
||||
|
||||
// // Now try loading to a more deeply nested folder
|
||||
// UserInventoryTestUtils.CreateInventoryFolder(scene.InventoryService, userInfo.UserProfile.ID, "xB/xC");
|
||||
// archiveReadStream = new MemoryStream(archiveReadStream.ToArray());
|
||||
// archiverModule.DearchiveInventory(userFirstName, userLastName, "xB/xC", "meowfood", archiveReadStream);
|
||||
|
||||
// InventoryItemBase foundItem3
|
||||
// = InventoryArchiveUtils.FindItemByPath(scene.InventoryService, userInfo.UserProfile.ID, "xB/xC/" + item1Name);
|
||||
// Assert.That(foundItem3, Is.Not.Null, "Didn't find loaded item 3");
|
||||
//}
|
||||
|
||||
// REFACTORING PROBLEM. Needs rewrite.
|
||||
// [Test]
|
||||
// public void TestIarV0_1WithEscapedChars()
|
||||
// {
|
||||
// TestHelper.InMethod();
|
||||
//// log4net.Config.XmlConfigurator.Configure();
|
||||
|
||||
// string itemName = "You & you are a mean/man/";
|
||||
// string humanEscapedItemName = @"You & you are a mean\/man\/";
|
||||
// string userPassword = "meowfood";
|
||||
|
||||
// InventoryArchiverModule archiverModule = new InventoryArchiverModule(true);
|
||||
|
||||
// Scene scene = SceneSetupHelpers.SetupScene("Inventory");
|
||||
// SceneSetupHelpers.SetupSceneModules(scene, archiverModule);
|
||||
// CommunicationsManager cm = scene.CommsManager;
|
||||
|
||||
// // Create user
|
||||
// string userFirstName = "Jock";
|
||||
// string userLastName = "Stirrup";
|
||||
// UUID userId = UUID.Parse("00000000-0000-0000-0000-000000000020");
|
||||
|
||||
// lock (this)
|
||||
// {
|
||||
// UserProfileTestUtils.CreateUserWithInventory(
|
||||
// cm, userFirstName, userLastName, userPassword, userId, InventoryReceived);
|
||||
// Monitor.Wait(this, 60000);
|
||||
// }
|
||||
|
||||
// // Create asset
|
||||
// SceneObjectGroup object1;
|
||||
// SceneObjectPart part1;
|
||||
// {
|
||||
// string partName = "part name";
|
||||
// UUID ownerId = UUID.Parse("00000000-0000-0000-0000-000000000040");
|
||||
// PrimitiveBaseShape shape = PrimitiveBaseShape.CreateSphere();
|
||||
// Vector3 groupPosition = new Vector3(10, 20, 30);
|
||||
// Quaternion rotationOffset = new Quaternion(20, 30, 40, 50);
|
||||
// Vector3 offsetPosition = new Vector3(5, 10, 15);
|
||||
|
||||
// part1
|
||||
// = new SceneObjectPart(
|
||||
// ownerId, shape, groupPosition, rotationOffset, offsetPosition);
|
||||
// part1.Name = partName;
|
||||
|
||||
// object1 = new SceneObjectGroup(part1);
|
||||
// scene.AddNewSceneObject(object1, false);
|
||||
// }
|
||||
|
||||
// UUID asset1Id = UUID.Parse("00000000-0000-0000-0000-000000000060");
|
||||
// AssetBase asset1 = AssetHelpers.CreateAsset(asset1Id, object1);
|
||||
// scene.AssetService.Store(asset1);
|
||||
|
||||
// // Create item
|
||||
// UUID item1Id = UUID.Parse("00000000-0000-0000-0000-000000000080");
|
||||
// InventoryItemBase item1 = new InventoryItemBase();
|
||||
// item1.Name = itemName;
|
||||
// item1.AssetID = asset1.FullID;
|
||||
// item1.ID = item1Id;
|
||||
// InventoryFolderBase objsFolder
|
||||
// = InventoryArchiveUtils.FindFolderByPath(scene.InventoryService, userId, "Objects");
|
||||
// item1.Folder = objsFolder.ID;
|
||||
// scene.AddInventoryItem(userId, item1);
|
||||
|
||||
// MemoryStream archiveWriteStream = new MemoryStream();
|
||||
// archiverModule.OnInventoryArchiveSaved += SaveCompleted;
|
||||
|
||||
// mre.Reset();
|
||||
// archiverModule.ArchiveInventory(
|
||||
// Guid.NewGuid(), userFirstName, userLastName, "Objects", userPassword, archiveWriteStream);
|
||||
// mre.WaitOne(60000, false);
|
||||
|
||||
// // LOAD ITEM
|
||||
// MemoryStream archiveReadStream = new MemoryStream(archiveWriteStream.ToArray());
|
||||
|
||||
// archiverModule.DearchiveInventory(userFirstName, userLastName, "Scripts", userPassword, archiveReadStream);
|
||||
|
||||
// InventoryItemBase foundItem1
|
||||
// = InventoryArchiveUtils.FindItemByPath(
|
||||
// scene.InventoryService, userId, "Scripts/Objects/" + humanEscapedItemName);
|
||||
|
||||
// Assert.That(foundItem1, Is.Not.Null, "Didn't find loaded item 1");
|
||||
//// Assert.That(
|
||||
//// foundItem1.CreatorId, Is.EqualTo(userUuid),
|
||||
//// "Loaded item non-uuid creator doesn't match that of the loading user");
|
||||
// Assert.That(
|
||||
// foundItem1.Name, Is.EqualTo(itemName),
|
||||
// "Loaded item name doesn't match saved name");
|
||||
// }
|
||||
// foundItem1.CreatorId, Is.EqualTo(userUuid),
|
||||
// "Loaded item non-uuid creator doesn't match that of the loading user");
|
||||
Assert.That(
|
||||
foundItem1.Name, Is.EqualTo(itemName),
|
||||
"Loaded item name doesn't match saved name");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test loading a V0.1 OpenSim Inventory Archive (subject to change since there is no fixed format yet) where
|
||||
|
@ -386,76 +364,69 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
|
|||
///
|
||||
/// This may possibly one day get overtaken by the as yet incomplete temporary profiles feature
|
||||
/// (as tested in the a later commented out test)
|
||||
/// REFACTORING PROBLEM. Needs rewrite.
|
||||
// [Test]
|
||||
// public void TestLoadIarV0_1AbsentUsers()
|
||||
// {
|
||||
// TestHelper.InMethod();
|
||||
/// This test is currently disabled
|
||||
[Test]
|
||||
public void TestLoadIarV0_1AbsentUsers()
|
||||
{
|
||||
TestHelper.InMethod();
|
||||
//log4net.Config.XmlConfigurator.Configure();
|
||||
|
||||
// //log4net.Config.XmlConfigurator.Configure();
|
||||
string userFirstName = "Charlie";
|
||||
string userLastName = "Chan";
|
||||
UUID userUuid = UUID.Parse("00000000-0000-0000-0000-000000000999");
|
||||
string userItemCreatorFirstName = "Bat";
|
||||
string userItemCreatorLastName = "Man";
|
||||
//UUID userItemCreatorUuid = UUID.Parse("00000000-0000-0000-0000-000000008888");
|
||||
|
||||
// string userFirstName = "Charlie";
|
||||
// string userLastName = "Chan";
|
||||
// UUID userUuid = UUID.Parse("00000000-0000-0000-0000-000000000999");
|
||||
// string userItemCreatorFirstName = "Bat";
|
||||
// string userItemCreatorLastName = "Man";
|
||||
// //UUID userItemCreatorUuid = UUID.Parse("00000000-0000-0000-0000-000000008888");
|
||||
string itemName = "b.lsl";
|
||||
string archiveItemName = InventoryArchiveWriteRequest.CreateArchiveItemName(itemName, UUID.Random());
|
||||
|
||||
// string itemName = "b.lsl";
|
||||
// string archiveItemName = InventoryArchiveWriteRequest.CreateArchiveItemName(itemName, UUID.Random());
|
||||
MemoryStream archiveWriteStream = new MemoryStream();
|
||||
TarArchiveWriter tar = new TarArchiveWriter(archiveWriteStream);
|
||||
|
||||
// MemoryStream archiveWriteStream = new MemoryStream();
|
||||
// TarArchiveWriter tar = new TarArchiveWriter(archiveWriteStream);
|
||||
InventoryItemBase item1 = new InventoryItemBase();
|
||||
item1.Name = itemName;
|
||||
item1.AssetID = UUID.Random();
|
||||
item1.GroupID = UUID.Random();
|
||||
item1.CreatorId = OspResolver.MakeOspa(userItemCreatorFirstName, userItemCreatorLastName);
|
||||
//item1.CreatorId = userUuid.ToString();
|
||||
//item1.CreatorId = "00000000-0000-0000-0000-000000000444";
|
||||
item1.Owner = UUID.Zero;
|
||||
|
||||
// InventoryItemBase item1 = new InventoryItemBase();
|
||||
// item1.Name = itemName;
|
||||
// item1.AssetID = UUID.Random();
|
||||
// item1.GroupID = UUID.Random();
|
||||
// item1.CreatorId = OspResolver.MakeOspa(userItemCreatorFirstName, userItemCreatorLastName);
|
||||
// //item1.CreatorId = userUuid.ToString();
|
||||
// //item1.CreatorId = "00000000-0000-0000-0000-000000000444";
|
||||
// item1.Owner = UUID.Zero;
|
||||
string item1FileName
|
||||
= string.Format("{0}{1}", ArchiveConstants.INVENTORY_PATH, archiveItemName);
|
||||
tar.WriteFile(item1FileName, UserInventoryItemSerializer.Serialize(item1));
|
||||
tar.Close();
|
||||
|
||||
// string item1FileName
|
||||
// = string.Format("{0}{1}", ArchiveConstants.INVENTORY_PATH, archiveItemName);
|
||||
// tar.WriteFile(item1FileName, UserInventoryItemSerializer.Serialize(item1));
|
||||
// tar.Close();
|
||||
MemoryStream archiveReadStream = new MemoryStream(archiveWriteStream.ToArray());
|
||||
SerialiserModule serialiserModule = new SerialiserModule();
|
||||
InventoryArchiverModule archiverModule = new InventoryArchiverModule(true);
|
||||
|
||||
// MemoryStream archiveReadStream = new MemoryStream(archiveWriteStream.ToArray());
|
||||
// SerialiserModule serialiserModule = new SerialiserModule();
|
||||
// InventoryArchiverModule archiverModule = new InventoryArchiverModule(true);
|
||||
// Annoyingly, we have to set up a scene even though inventory loading has nothing to do with a scene
|
||||
Scene scene = SceneSetupHelpers.SetupScene("inventory");
|
||||
|
||||
// // Annoyingly, we have to set up a scene even though inventory loading has nothing to do with a scene
|
||||
// Scene scene = SceneSetupHelpers.SetupScene("inventory");
|
||||
// IUserAdminService userAdminService = scene.CommsManager.UserAdminService;
|
||||
SceneSetupHelpers.SetupSceneModules(scene, serialiserModule, archiverModule);
|
||||
UserProfileTestUtils.CreateUserWithInventory(scene, userFirstName, userLastName, userUuid, "meowfood");
|
||||
|
||||
// SceneSetupHelpers.SetupSceneModules(scene, serialiserModule, archiverModule);
|
||||
// userAdminService.AddUser(
|
||||
// userFirstName, userLastName, "meowfood", String.Empty, 1000, 1000, userUuid);
|
||||
archiverModule.DearchiveInventory(userFirstName, userLastName, "/", "meowfood", archiveReadStream);
|
||||
|
||||
// archiverModule.DearchiveInventory(userFirstName, userLastName, "/", "meowfood", archiveReadStream);
|
||||
InventoryItemBase foundItem1
|
||||
= InventoryArchiveUtils.FindItemByPath(scene.InventoryService, userUuid, itemName);
|
||||
|
||||
// CachedUserInfo userInfo
|
||||
// = scene.CommsManager.UserProfileCacheService.GetUserDetails(userFirstName, userLastName);
|
||||
|
||||
// InventoryItemBase foundItem1
|
||||
// = InventoryArchiveUtils.FindItemByPath(scene.InventoryService, userInfo.UserProfile.ID, itemName);
|
||||
|
||||
// Assert.That(foundItem1, Is.Not.Null, "Didn't find loaded item 1");
|
||||
//// Assert.That(
|
||||
//// foundItem1.CreatorId, Is.EqualTo(userUuid),
|
||||
//// "Loaded item non-uuid creator doesn't match that of the loading user");
|
||||
Assert.That(foundItem1, Is.Not.Null, "Didn't find loaded item 1");
|
||||
// Assert.That(
|
||||
// foundItem1.CreatorIdAsUuid, Is.EqualTo(userUuid),
|
||||
// "Loaded item uuid creator doesn't match that of the loading user");
|
||||
// }
|
||||
// foundItem1.CreatorId, Is.EqualTo(userUuid),
|
||||
// "Loaded item non-uuid creator doesn't match that of the loading user");
|
||||
Assert.That(
|
||||
foundItem1.CreatorIdAsUuid, Is.EqualTo(userUuid),
|
||||
"Loaded item uuid creator doesn't match that of the loading user");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 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
|
||||
/// </summary>
|
||||
/// Disabled since temporary profiles have not yet been implemented.
|
||||
/// REFACTORING PROBLEM. Needs rewrite.
|
||||
///
|
||||
//[Test]
|
||||
//public void TestLoadIarV0_1TempProfiles()
|
||||
|
|
|
@ -44,10 +44,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts
|
|||
|
||||
public UserAccountCache()
|
||||
{
|
||||
// Warning: the size values are a bit fuzzy. What matters
|
||||
// most for this cache is the count value (128 entries).
|
||||
m_UUIDCache = new ExpiringCache<UUID, UserAccount>();
|
||||
m_NameCache = new ExpiringCache<string, UUID>(); // this one is unbound
|
||||
m_NameCache = new ExpiringCache<string, UUID>();
|
||||
}
|
||||
|
||||
public void Cache(UUID userID, UserAccount account)
|
||||
|
|
|
@ -69,7 +69,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests
|
|||
SerialiserModule serialiserModule = new SerialiserModule();
|
||||
TerrainModule terrainModule = new TerrainModule();
|
||||
|
||||
m_scene = SceneSetupHelpers.SetupScene("useraccounts");
|
||||
m_scene = SceneSetupHelpers.SetupScene();
|
||||
SceneSetupHelpers.SetupSceneModules(m_scene, m_archiverModule, serialiserModule, terrainModule);
|
||||
}
|
||||
|
||||
|
|
|
@ -267,7 +267,7 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.Error("[SCENE]: SceneBase.cs: Close() - Failed with exception " + e.ToString());
|
||||
m_log.Error(string.Format("[SCENE]: SceneBase.cs: Close() - Failed with exception ", e));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -376,7 +376,7 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
/// <param name="mod"></param>
|
||||
public void RegisterModuleInterface<M>(M mod)
|
||||
{
|
||||
m_log.DebugFormat("[SCENE BASE]: Registering interface {0}", typeof(M));
|
||||
// m_log.DebugFormat("[SCENE BASE]: Registering interface {0}", typeof(M));
|
||||
|
||||
List<Object> l = null;
|
||||
if (!ModuleInterfaces.TryGetValue(typeof(M), out l))
|
||||
|
|
|
@ -32,7 +32,7 @@ using System.Globalization;
|
|||
using System.Reflection;
|
||||
using System.IO;
|
||||
using Microsoft.CSharp;
|
||||
using Microsoft.JScript;
|
||||
//using Microsoft.JScript;
|
||||
using Microsoft.VisualBasic;
|
||||
using log4net;
|
||||
using OpenSim.Region.Framework.Interfaces;
|
||||
|
@ -82,7 +82,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools
|
|||
|
||||
private static CSharpCodeProvider CScodeProvider = new CSharpCodeProvider();
|
||||
private static VBCodeProvider VBcodeProvider = new VBCodeProvider();
|
||||
private static JScriptCodeProvider JScodeProvider = new JScriptCodeProvider();
|
||||
// private static JScriptCodeProvider JScodeProvider = new JScriptCodeProvider();
|
||||
private static CSharpCodeProvider YPcodeProvider = new CSharpCodeProvider(); // YP is translated into CSharp
|
||||
private static YP2CSConverter YP_Converter = new YP2CSConverter();
|
||||
|
||||
|
@ -398,9 +398,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools
|
|||
case enumCompileType.vb:
|
||||
compileScript = CreateVBCompilerScript(compileScript);
|
||||
break;
|
||||
case enumCompileType.js:
|
||||
compileScript = CreateJSCompilerScript(compileScript);
|
||||
break;
|
||||
// case enumCompileType.js:
|
||||
// compileScript = CreateJSCompilerScript(compileScript);
|
||||
// break;
|
||||
case enumCompileType.yp:
|
||||
compileScript = CreateYPCompilerScript(compileScript);
|
||||
break;
|
||||
|
@ -423,16 +423,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools
|
|||
}
|
||||
}
|
||||
|
||||
private static string CreateJSCompilerScript(string compileScript)
|
||||
{
|
||||
compileScript = String.Empty +
|
||||
"import OpenSim.Region.ScriptEngine.Shared; import System.Collections.Generic;\r\n" +
|
||||
"package SecondLife {\r\n" +
|
||||
"class Script extends OpenSim.Region.ScriptEngine.Shared.ScriptBase.ScriptBaseClass { \r\n" +
|
||||
compileScript +
|
||||
"} }\r\n";
|
||||
return compileScript;
|
||||
}
|
||||
// private static string CreateJSCompilerScript(string compileScript)
|
||||
// {
|
||||
// compileScript = String.Empty +
|
||||
// "import OpenSim.Region.ScriptEngine.Shared; import System.Collections.Generic;\r\n" +
|
||||
// "package SecondLife {\r\n" +
|
||||
// "class Script extends OpenSim.Region.ScriptEngine.Shared.ScriptBase.ScriptBaseClass { \r\n" +
|
||||
// compileScript +
|
||||
// "} }\r\n";
|
||||
// return compileScript;
|
||||
// }
|
||||
|
||||
private static string CreateCSCompilerScript(string compileScript)
|
||||
{
|
||||
|
@ -583,10 +583,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools
|
|||
}
|
||||
} while (!complete);
|
||||
break;
|
||||
case enumCompileType.js:
|
||||
results = JScodeProvider.CompileAssemblyFromSource(
|
||||
parameters, Script);
|
||||
break;
|
||||
// case enumCompileType.js:
|
||||
// results = JScodeProvider.CompileAssemblyFromSource(
|
||||
// parameters, Script);
|
||||
// break;
|
||||
case enumCompileType.yp:
|
||||
results = YPcodeProvider.CompileAssemblyFromSource(
|
||||
parameters, Script);
|
||||
|
|
|
@ -149,7 +149,7 @@ namespace OpenSim.Server.Handlers.Asset
|
|||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.Debug("[XINVENTORY HANDLER]: Exception {0}" + e);
|
||||
m_log.Debug("[XINVENTORY HANDLER]: Exception {0}", e);
|
||||
}
|
||||
|
||||
return FailureResult();
|
||||
|
|
|
@ -83,7 +83,7 @@ namespace OpenSim.Server.Handlers.Login
|
|||
clientVersion = requestData["version"].ToString();
|
||||
// We should do something interesting with the client version...
|
||||
|
||||
m_log.InfoFormat("[LOGIN]: XMLRPC Login Requested for {0} {1}, starting in {2}, using {3}", first, last, startLocation, clientVersion);
|
||||
//m_log.InfoFormat("[LOGIN]: XMLRPC Login Requested for {0} {1}, starting in {2}, using {3}", first, last, startLocation, clientVersion);
|
||||
|
||||
LoginResponse reply = null;
|
||||
reply = m_LocalService.Login(first, last, passwd, startLocation, scopeID, clientVersion, remoteClient);
|
||||
|
|
|
@ -88,7 +88,7 @@ namespace OpenSim.Services.AuthenticationService
|
|||
m_Database = LoadPlugin<IAuthenticationData>(dllName,
|
||||
new Object[] {connString, realm});
|
||||
if (m_Database == null)
|
||||
throw new Exception("Could not find a storage interface in the given module");
|
||||
throw new Exception(string.Format("Could not find a storage interface in module {0}", dllName));
|
||||
}
|
||||
|
||||
public bool Verify(UUID principalID, string token, int lifetime)
|
||||
|
|
|
@ -71,7 +71,7 @@ namespace OpenSim.Services.AuthenticationService
|
|||
string hashed = Util.Md5Hash(password + ":" +
|
||||
data.Data["passwordSalt"].ToString());
|
||||
|
||||
//m_log.DebugFormat("[PASS AUTH]: got {0}; hashed = {1}; stored = {2}", password, hashed, data.Data["passwordHash"].ToString());
|
||||
m_log.DebugFormat("[PASS AUTH]: got {0}; hashed = {1}; stored = {2}", password, hashed, data.Data["passwordHash"].ToString());
|
||||
|
||||
if (data.Data["passwordHash"].ToString() == hashed)
|
||||
{
|
||||
|
|
|
@ -196,7 +196,7 @@ namespace OpenSim.Services.Connectors
|
|||
{
|
||||
Dictionary<string, object> sendData = new Dictionary<string, object>();
|
||||
sendData["PRINCIPALID"] = PrincipalID.ToString();
|
||||
sendData["FRIENDS"] = Friend;
|
||||
sendData["FRIEND"] = Friend;
|
||||
sendData["METHOD"] = "deletefriend";
|
||||
|
||||
string reqString = ServerUtils.BuildQueryString(sendData);
|
||||
|
|
|
@ -74,6 +74,9 @@ namespace OpenSim.Services.Connectors.Friends
|
|||
|
||||
public bool FriendshipDenied(GridRegion region, UUID userID, string userName, UUID friendID)
|
||||
{
|
||||
if (region == null)
|
||||
return false;
|
||||
|
||||
Dictionary<string, object> sendData = new Dictionary<string, object>();
|
||||
//sendData["VERSIONMIN"] = ProtocolVersions.ClientProtocolVersionMin.ToString();
|
||||
//sendData["VERSIONMAX"] = ProtocolVersions.ClientProtocolVersionMax.ToString();
|
||||
|
@ -132,6 +135,10 @@ namespace OpenSim.Services.Connectors.Friends
|
|||
{
|
||||
string reqString = ServerUtils.BuildQueryString(sendData);
|
||||
//m_log.DebugFormat("[FRIENDS CONNECTOR]: queryString = {0}", reqString);
|
||||
if (region == null)
|
||||
return false;
|
||||
|
||||
m_log.DebugFormat("[FRIENDS CONNECTOR]: region: {0}", region.ExternalHostName + ":" + region.HttpPort);
|
||||
try
|
||||
{
|
||||
string url = "http://" + region.ExternalHostName + ":" + region.HttpPort;
|
||||
|
|
|
@ -116,7 +116,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
|
|||
{
|
||||
string credential = identity["Credential"].AsString();
|
||||
|
||||
if (password == credential || "$1$" + Utils.MD5String(password) == credential || Utils.MD5String(password) == credential)
|
||||
if (password == credential || "$1$" + password == credential || "$1$" + Utils.MD5String(password) == credential || Utils.MD5String(password) == credential)
|
||||
return Authorize(principalID);
|
||||
|
||||
md5hashFound = true;
|
||||
|
|
|
@ -209,6 +209,8 @@ namespace OpenSim.Services.LLLoginService
|
|||
bool success = false;
|
||||
UUID session = UUID.Random();
|
||||
|
||||
m_log.InfoFormat("[LLOGIN SERVICE]: Login request for {0} {1} from {2} with user agent {3} starting in {4}",
|
||||
firstName, lastName, clientIP.Address.ToString(), clientVersion, startLocation);
|
||||
try
|
||||
{
|
||||
//
|
||||
|
|
|
@ -55,7 +55,7 @@ namespace OpenSim.Services.PresenceService
|
|||
UUID secureSessionID)
|
||||
{
|
||||
//PresenceData[] d = m_Database.Get("UserID", userID);
|
||||
m_Database.Get("UserID", userID);
|
||||
//m_Database.Get("UserID", userID);
|
||||
|
||||
PresenceData data = new PresenceData();
|
||||
|
||||
|
|
|
@ -97,6 +97,10 @@ namespace OpenSim.Services.UserAccountService
|
|||
public UserAccount GetUserAccount(UUID scopeID, string firstName,
|
||||
string lastName)
|
||||
{
|
||||
// m_log.DebugFormat(
|
||||
// "[USER ACCOUNT SERVICE]: Retrieving account by username for {0} {1}, scope {2}",
|
||||
// firstName, lastName, scopeID);
|
||||
|
||||
UserAccountData[] d;
|
||||
|
||||
if (scopeID != UUID.Zero)
|
||||
|
@ -231,6 +235,10 @@ namespace OpenSim.Services.UserAccountService
|
|||
|
||||
public bool StoreUserAccount(UserAccount data)
|
||||
{
|
||||
// m_log.DebugFormat(
|
||||
// "[USER ACCOUNT SERVICE]: Storing user account for {0} {1} {2}, scope {3}",
|
||||
// data.FirstName, data.LastName, data.PrincipalID, data.ScopeID);
|
||||
|
||||
UserAccountData d = new UserAccountData();
|
||||
|
||||
d.FirstName = data.FirstName;
|
||||
|
|
|
@ -1,46 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) Contributors, http://opensimulator.org/
|
||||
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of the OpenSimulator Project nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
using System.Collections.Generic;
|
||||
using Nini.Config;
|
||||
using OpenMetaverse;
|
||||
using OpenSim.Services.Interfaces;
|
||||
|
||||
namespace OpenSim.Tests.Common.Mock
|
||||
{
|
||||
public class MockUserAccountService : IUserAccountService
|
||||
{
|
||||
|
||||
public MockUserAccountService(IConfigSource config) {}
|
||||
|
||||
public UserAccount GetUserAccount(UUID scopeID, UUID userID) { return new UserAccount(); }
|
||||
public UserAccount GetUserAccount(UUID scopeID, string FirstName, string LastName) { return new UserAccount(); }
|
||||
public UserAccount GetUserAccount(UUID scopeID, string Email) { return new UserAccount(); }
|
||||
public List<UserAccount> GetUserAccounts(UUID scopeID, string query) { return new List<UserAccount>(); }
|
||||
public bool StoreUserAccount(UserAccount data) { return true; }
|
||||
}
|
||||
}
|
|
@ -191,7 +191,7 @@ namespace OpenSim.Tests.Common.Setup
|
|||
if (realServices.Contains("grid"))
|
||||
StartGridService(testScene, true);
|
||||
|
||||
StartUserAccountService(testScene, realServices.Contains("useraccounts"));
|
||||
StartUserAccountService(testScene);
|
||||
}
|
||||
// If not, make sure the shared module gets references to this new scene
|
||||
else
|
||||
|
@ -260,7 +260,7 @@ namespace OpenSim.Tests.Common.Setup
|
|||
"LocalServiceModule", "OpenSim.Services.AuthenticationService.dll:PasswordAuthenticationService");
|
||||
else
|
||||
config.Configs["AuthenticationService"].Set(
|
||||
"LocalServiceModule", "OpenSim.Tests.Common.dll:MockuthenticationService");
|
||||
"LocalServiceModule", "OpenSim.Tests.Common.dll:MockAuthenticationService");
|
||||
config.Configs["AuthenticationService"].Set("StorageProvider", "OpenSim.Data.Null.dll");
|
||||
service.Initialise(config);
|
||||
service.AddRegion(testScene);
|
||||
|
@ -311,24 +311,18 @@ namespace OpenSim.Tests.Common.Setup
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Start a user account service, whether real or mock
|
||||
/// Start a user account service
|
||||
/// </summary>
|
||||
/// <param name="testScene"></param>
|
||||
/// <param name="real">Starts a real service if true, a mock service if not</param>
|
||||
private static void StartUserAccountService(Scene testScene, bool real)
|
||||
private static void StartUserAccountService(Scene testScene)
|
||||
{
|
||||
IConfigSource config = new IniConfigSource();
|
||||
config.AddConfig("Modules");
|
||||
config.AddConfig("UserAccountService");
|
||||
config.Configs["Modules"].Set("UserAccountServices", "LocalUserAccountServicesConnector");
|
||||
config.Configs["UserAccountService"].Set("StorageProvider", "OpenSim.Data.Null.dll");
|
||||
|
||||
if (real)
|
||||
config.Configs["UserAccountService"].Set(
|
||||
"LocalServiceModule", "OpenSim.Services.UserAccountService.dll:UserAccountService");
|
||||
else
|
||||
config.Configs["UserAccountService"].Set(
|
||||
"LocalServiceModule", "OpenSim.Tests.Common.dll:MockUserAccountService");
|
||||
|
||||
if (m_userAccountService == null)
|
||||
{
|
||||
|
@ -336,8 +330,7 @@ namespace OpenSim.Tests.Common.Setup
|
|||
userAccountService.Initialise(config);
|
||||
m_userAccountService = userAccountService;
|
||||
}
|
||||
//else
|
||||
// config.Configs["GridService"].Set("LocalServiceModule", "OpenSim.Tests.Common.dll:TestGridService");
|
||||
|
||||
m_userAccountService.AddRegion(testScene);
|
||||
m_userAccountService.RegionLoaded(testScene);
|
||||
testScene.AddRegionModule(m_userAccountService.Name, m_userAccountService);
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
using System.Collections.Generic;
|
||||
using OpenMetaverse;
|
||||
using OpenSim.Framework.Communications;
|
||||
using OpenSim.Region.Framework.Scenes;
|
||||
|
@ -124,7 +125,9 @@ namespace OpenSim.Tests.Common.Setup
|
|||
public static UserAccount CreateUserWithInventory(
|
||||
Scene scene, string firstName, string lastName, UUID userId, string pw)
|
||||
{
|
||||
UserAccount ua = new UserAccount(userId) { FirstName = firstName, LastName = lastName };
|
||||
UserAccount ua
|
||||
= new UserAccount(userId)
|
||||
{ FirstName = firstName, LastName = lastName, ServiceURLs = new Dictionary<string, object>() };
|
||||
scene.UserAccountService.StoreUserAccount(ua);
|
||||
scene.InventoryService.CreateUserInventory(ua.PrincipalID);
|
||||
scene.AuthenticationService.SetPassword(ua.PrincipalID, pw);
|
||||
|
|
|
@ -797,7 +797,6 @@
|
|||
<Reference name="OpenSim.Region.Physics.Manager"/>
|
||||
|
||||
<!-- For scripting in funny languages by default -->
|
||||
<Reference name="Microsoft.JScript"/>
|
||||
<Reference name="XMLRPC.dll"/>
|
||||
<Reference name="OpenSim.Framework.Communications"/>
|
||||
<Reference name="Nini.dll" />
|
||||
|
@ -1436,7 +1435,6 @@
|
|||
<Reference name="GlynnTucker.Cache.dll"/>
|
||||
|
||||
<!-- For scripting in funny languages by default -->
|
||||
<Reference name="Microsoft.JScript"/>
|
||||
<Reference name="XMLRPC.dll"/>
|
||||
<Reference name="OpenSim.Framework.Communications"/>
|
||||
<Reference name="Nini.dll" />
|
||||
|
@ -1519,7 +1517,6 @@
|
|||
<Reference name="Mono.Addins.dll" />
|
||||
|
||||
<!-- For scripting in funny languages by default -->
|
||||
<Reference name="Microsoft.JScript"/>
|
||||
<Reference name="XMLRPC.dll"/>
|
||||
<Reference name="OpenSim.Framework.Communications"/>
|
||||
<Reference name="Nini.dll" />
|
||||
|
@ -2447,7 +2444,6 @@
|
|||
|
||||
<ReferencePath>../../../../../bin/</ReferencePath>
|
||||
<Reference name="System"/>
|
||||
<Reference name="Microsoft.JScript"/>
|
||||
<Reference name="OpenSim.Framework" />
|
||||
<Reference name="OpenSim.Region.Framework" />
|
||||
<Reference name="OpenSim.Region.ScriptEngine.Shared"/>
|
||||
|
@ -2584,7 +2580,6 @@
|
|||
<Reference name="Mono.Addins"/>
|
||||
|
||||
<!-- For scripting in funny languages by default -->
|
||||
<Reference name="Microsoft.JScript"/>
|
||||
<Reference name="XMLRPC.dll"/>
|
||||
<Reference name="OpenSim.Framework.Communications"/>
|
||||
<Reference name="Nini.dll" />
|
||||
|
@ -2999,7 +2994,6 @@
|
|||
<Reference name="nunit.framework.dll"/>
|
||||
|
||||
<!-- For scripting in funny languages by default -->
|
||||
<Reference name="Microsoft.JScript"/>
|
||||
<Reference name="XMLRPC.dll"/>
|
||||
<Reference name="OpenSim.Framework.Communications"/>
|
||||
<Reference name="Nini.dll" />
|
||||
|
@ -3063,7 +3057,6 @@
|
|||
<Reference name="nunit.framework.dll"/>
|
||||
|
||||
<!-- For scripting in funny languages by default -->
|
||||
<Reference name="Microsoft.JScript"/>
|
||||
<Reference name="XMLRPC.dll"/>
|
||||
<Reference name="OpenSim.Framework.Communications"/>
|
||||
<Reference name="Nini.dll" />
|
||||
|
|
Loading…
Reference in New Issue