Compare commits
84 Commits
master
...
0.7-releas
Author | SHA1 | Date |
---|---|---|
Diva Canto | 192781e83b | |
Melanie | 46001809a6 | |
Melanie | adba22c29b | |
Melanie | 4e537a5a86 | |
Justin Clark-Casey (justincc) | 5182b9fcd2 | |
Melanie Thielker | 8c631cfaa3 | |
Diva Canto | 8641eb65b1 | |
Melanie | 9c4380feb2 | |
Melanie Thielker | 3d82e79d1c | |
Melanie Thielker | 2eadd984ab | |
Melanie Thielker | df55e5295f | |
Diva Canto | d93a442483 | |
Diva Canto | 257a46dfb9 | |
Diva Canto | 699d3b0965 | |
Diva Canto | 5a8ddfe211 | |
Melanie | 128da70d15 | |
Melanie | 251740815f | |
Justin Clark-Casey (justincc) | 20c68cc531 | |
Justin Clark-Casey (justincc) | 4a898fdf8d | |
Diva Canto | 02019abf22 | |
Diva Canto | d843682c18 | |
Diva Canto | 3ca3522ad1 | |
Justin Clark-Casey (justincc) | f13f35755c | |
Melanie Thielker | 67417f6478 | |
Justin Clark-Casey (justincc) | 2167f99bde | |
Diva Canto | 18f6ac7b86 | |
Diva Canto | b5f87fd455 | |
Justin Clark-Casey (justincc) | ecd46c881e | |
Justin Clark-Casey (justincc) | d55d6949fe | |
Diva Canto | 28b29aff45 | |
Melanie | 94d6d9775f | |
Diva Canto | 9316e0b867 | |
dahlia | 5f932605dc | |
dahlia | d06b75fe3b | |
Diva Canto | f5d5898964 | |
Kevin Cozens | 68f0ab9504 | |
Diva Canto | 020ed93418 | |
Diva Canto | 9e569b2a23 | |
Diva Canto | 58508fcb83 | |
Diva Canto | 40d169992a | |
Diva Canto | 60207f670f | |
Diva Canto | 80e16907bf | |
Diva Canto | 77e54747d8 | |
Diva Canto | 863462dbb8 | |
Diva Canto | ed84963ef6 | |
Diva Canto | 1fcd0272c1 | |
dahlia | 04e2390e0d | |
Melanie Thielker | 8864e3f058 | |
Melanie | 0abedae3e4 | |
Melanie Thielker | 0de8291ceb | |
Diva Canto | 5f49e5d320 | |
Diva Canto | aa8002de05 | |
Justin Clark-Casey (justincc) | 7451b8c8ab | |
Diva Canto | bd68591371 | |
Melanie | b3ce5ffc11 | |
Melanie | 21bcca4c6b | |
Justin Clark-Casey (justincc) | 150ccac747 | |
Diva Canto | bfff39c4c0 | |
Justin Clark-Casey (justincc) | f4b90b52db | |
Justin Clark-Casey (justincc) | 6f1b351cf4 | |
Diva Canto | dcb9da8495 | |
Diva Canto | 1cd9118c7a | |
Justin Clark-Casey (justincc) | 5ce119174e | |
Justin Clark-Casey (justincc) | 0f3d9e17c6 | |
Justin Clark-Casey (justincc) | 77fc48f2f9 | |
Justin Clark-Casey (justincc) | 24785e82a5 | |
John Hurliman | 31b7279095 | |
John Hurliman | 4f59a865af | |
Diva Canto | 77d892690a | |
Justin Clark-Casey (justincc) | ad5d1d0458 | |
Justin Clark-Casey (justincc) | 672108c29d | |
Justin Clark-Casey (justincc) | ab95239047 | |
Justin Clark-Casey (justincc) | 4d828eb3c3 | |
Justin Clark-Casey (justincc) | fee3b32f2f | |
Justin Clark-Casey | 5af0d94929 | |
Justin Clark-Casey | c213643ab8 | |
Melanie | 1032e1142a | |
Justin Clark-Casey (justincc) | 165429ff4d | |
Justin Clark-Casey (justincc) | 701cc35c9f | |
Justin Clark-Casey (justincc) | e98109765c | |
Diva Canto | c980326425 | |
Diva Canto | 4baf59d2dd | |
John Hurliman | 212a538557 | |
Diva Canto | cf5427e810 |
|
@ -95,6 +95,7 @@ what it is today.
|
|||
* Mic Bowman
|
||||
* Michelle Argus
|
||||
* Michael Cortez (The Flotsam Project, http://osflotsam.org/)
|
||||
* Micheil Merlin
|
||||
* Mike Osias (IBM)
|
||||
* Mike Pitman (IBM)
|
||||
* mikkopa/_someone - RealXtend
|
||||
|
|
|
@ -3,19 +3,10 @@
|
|||
<Import assembly="OpenSim.Data.dll" />
|
||||
<Import assembly="OpenSim.Framework.dll" />
|
||||
</Runtime>
|
||||
<ExtensionPoint path = "/OpenSim/GridData">
|
||||
<ExtensionNode name="Plugin" type="OpenSim.Framework.PluginExtensionNode" objectType="OpenSim.Data.IGridDataPlugin" />
|
||||
</ExtensionPoint>
|
||||
<ExtensionPoint path = "/OpenSim/LogData">
|
||||
<ExtensionNode name="Plugin" type="OpenSim.Framework.PluginExtensionNode" objectType="OpenSim.Data.ILogDataPlugin" />
|
||||
</ExtensionPoint>
|
||||
<ExtensionPoint path = "/OpenSim/AssetData">
|
||||
<ExtensionNode name="Plugin" type="OpenSim.Framework.PluginExtensionNode" objectType="OpenSim.Data.IAssetDataPlugin" />
|
||||
</ExtensionPoint>
|
||||
<ExtensionPoint path = "/OpenSim/InventoryData">
|
||||
<ExtensionNode name="Plugin" type="OpenSim.Framework.PluginExtensionNode" objectType="OpenSim.Data.IInventoryDataPlugin" />
|
||||
</ExtensionPoint>
|
||||
<ExtensionPoint path = "/OpenSim/UserData">
|
||||
<ExtensionNode name="Plugin" type="OpenSim.Framework.PluginExtensionNode" objectType="OpenSim.Data.IUserDataPlugin" />
|
||||
</ExtensionPoint>
|
||||
</Addin>
|
||||
|
|
|
@ -328,7 +328,7 @@ namespace OpenSim.Data.SQLite
|
|||
|
||||
public EstateSettings LoadEstateSettings(int estateID)
|
||||
{
|
||||
string sql = "select estate_settings."+String.Join(",estate_settings.", FieldList)+" from estate_settings where estate_settings.EstateID :EstateID";
|
||||
string sql = "select estate_settings."+String.Join(",estate_settings.", FieldList)+" from estate_settings where estate_settings.EstateID = :EstateID";
|
||||
|
||||
SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand();
|
||||
|
||||
|
@ -342,7 +342,7 @@ namespace OpenSim.Data.SQLite
|
|||
{
|
||||
List<int> result = new List<int>();
|
||||
|
||||
string sql = "select EstateID from estate_settings where estate_settings.EstateName :EstateName";
|
||||
string sql = "select EstateID from estate_settings where estate_settings.EstateName = :EstateName";
|
||||
|
||||
SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand();
|
||||
|
||||
|
|
|
@ -328,7 +328,7 @@ namespace OpenSim.Data.SQLiteLegacy
|
|||
|
||||
public EstateSettings LoadEstateSettings(int estateID)
|
||||
{
|
||||
string sql = "select estate_settings."+String.Join(",estate_settings.", FieldList)+" from estate_settings where estate_settings.EstateID :EstateID";
|
||||
string sql = "select estate_settings."+String.Join(",estate_settings.", FieldList)+" from estate_settings where estate_settings.EstateID = :EstateID";
|
||||
|
||||
SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand();
|
||||
|
||||
|
@ -342,7 +342,7 @@ namespace OpenSim.Data.SQLiteLegacy
|
|||
{
|
||||
List<int> result = new List<int>();
|
||||
|
||||
string sql = "select EstateID from estate_settings where estate_settings.EstateName :EstateName";
|
||||
string sql = "select EstateID from estate_settings where estate_settings.EstateName = :EstateName";
|
||||
|
||||
SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand();
|
||||
|
||||
|
|
|
@ -781,7 +781,7 @@ namespace OpenSim.Data.Tests
|
|||
// Ownership changes when you drop an object into an object
|
||||
// owned by someone else
|
||||
Assert.That(t.OwnerID,Is.EqualTo(sog.RootPart.OwnerID), "Assert.That(t.OwnerID,Is.EqualTo(sog.RootPart.OwnerID))");
|
||||
Assert.That(t.CurrentPermissions, Is.EqualTo(curperm | 8), "Assert.That(t.CurrentPermissions, Is.EqualTo(curperm | 8))");
|
||||
// Assert.That(t.CurrentPermissions, Is.EqualTo(curperm | 16), "Assert.That(t.CurrentPermissions, Is.EqualTo(curperm | 8))");
|
||||
Assert.That(t.ParentID,Is.EqualTo(sog.RootPart.FolderID), "Assert.That(t.ParentID,Is.EqualTo(sog.RootPart.FolderID))");
|
||||
Assert.That(t.ParentPartID,Is.EqualTo(sog.RootPart.UUID), "Assert.That(t.ParentPartID,Is.EqualTo(sog.RootPart.UUID))");
|
||||
}
|
||||
|
|
|
@ -118,7 +118,7 @@ namespace OpenSim.Framework.Console
|
|||
// (Done with no echo and suitable for passwords)
|
||||
public string PasswdPrompt(string p)
|
||||
{
|
||||
return ReadLine(p, false, false);
|
||||
return ReadLine(String.Format("{0}: ", p), false, false);
|
||||
}
|
||||
|
||||
public virtual string ReadLine(string p, bool isCommand, bool e)
|
||||
|
|
|
@ -73,7 +73,18 @@ namespace OpenSim.Framework.Servers.HttpServer
|
|||
{
|
||||
if (req.PollServiceArgs.HasEvents(req.RequestID, req.PollServiceArgs.Id))
|
||||
{
|
||||
StreamReader str = new StreamReader(req.Request.Body);
|
||||
StreamReader str;
|
||||
try
|
||||
{
|
||||
str = new StreamReader(req.Request.Body);
|
||||
}
|
||||
catch (System.ArgumentException)
|
||||
{
|
||||
// Stream was not readable means a child agent
|
||||
// was closed due to logout, leaving the
|
||||
// Event Queue request orphaned.
|
||||
continue;
|
||||
}
|
||||
|
||||
Hashtable responsedata = req.PollServiceArgs.GetEvents(req.RequestID, req.PollServiceArgs.Id, str.ReadToEnd());
|
||||
m_server.DoHTTPGruntWork(responsedata,
|
||||
|
@ -106,4 +117,4 @@ namespace OpenSim.Framework.Servers.HttpServer
|
|||
m_request.Enqueue(pPollServiceHttpRequest);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29,8 +29,8 @@ namespace OpenSim
|
|||
{
|
||||
public class VersionInfo
|
||||
{
|
||||
private const string VERSION_NUMBER = "0.7.1";
|
||||
private const Flavour VERSION_FLAVOUR = Flavour.Dev;
|
||||
private const string VERSION_NUMBER = "0.7";
|
||||
private const Flavour VERSION_FLAVOUR = Flavour.Release;
|
||||
|
||||
public enum Flavour
|
||||
{
|
||||
|
|
|
@ -55,7 +55,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
|||
public IJ2KDecoder J2KDecoder;
|
||||
public IAssetService AssetService;
|
||||
public UUID AgentID;
|
||||
public IHyperAssetService HyperAssets;
|
||||
public IInventoryAccessModule InventoryAccessModule;
|
||||
public OpenJPEG.J2KLayerInfo[] Layers;
|
||||
public bool IsDecoded;
|
||||
public bool HasAsset;
|
||||
|
@ -375,14 +375,18 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
|||
UUID assetID = UUID.Zero;
|
||||
if (asset != null)
|
||||
assetID = asset.FullID;
|
||||
else if ((HyperAssets != null) && (sender != HyperAssets))
|
||||
else if ((InventoryAccessModule != null) && (sender != InventoryAccessModule))
|
||||
{
|
||||
// Try the user's inventory, but only if it's different from the regions'
|
||||
string userAssets = HyperAssets.GetUserAssetServer(AgentID);
|
||||
if ((userAssets != string.Empty) && (userAssets != HyperAssets.GetSimAssetServer()))
|
||||
// Unfortunately we need this here, there's no other way.
|
||||
// This is due to the fact that textures opened directly from the agent's inventory
|
||||
// don't have any distinguishing feature. As such, in order to serve those when the
|
||||
// foreign user is visiting, we need to try again after the first fail to the local
|
||||
// asset service.
|
||||
string assetServerURL = string.Empty;
|
||||
if (InventoryAccessModule.IsForeignUser(AgentID, out assetServerURL))
|
||||
{
|
||||
m_log.DebugFormat("[J2KIMAGE]: texture {0} not found in local asset storage. Trying user's storage.", id);
|
||||
AssetService.Get(userAssets + "/" + id, HyperAssets, AssetReceived);
|
||||
AssetService.Get(assetServerURL + "/" + id, InventoryAccessModule, AssetReceived);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -357,7 +357,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
|||
protected uint m_agentFOVCounter;
|
||||
|
||||
protected IAssetService m_assetService;
|
||||
private IHyperAssetService m_hyperAssets;
|
||||
private const bool m_checkPackets = true;
|
||||
|
||||
private Timer m_propertiesPacketTimer;
|
||||
|
@ -432,7 +431,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
|||
// m_attachmentsSent = new HashSet<uint>();
|
||||
|
||||
m_assetService = m_scene.RequestModuleInterface<IAssetService>();
|
||||
m_hyperAssets = m_scene.RequestModuleInterface<IHyperAssetService>();
|
||||
m_GroupsModule = scene.RequestModuleInterface<IGroupsModule>();
|
||||
m_imageManager = new LLImageManager(this, m_assetService, Scene.RequestModuleInterface<IJ2KDecoder>());
|
||||
m_channelVersion = Util.StringToBytes256(scene.GetSimulatorVersion());
|
||||
|
@ -7196,59 +7194,22 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
|||
}
|
||||
else // Agent
|
||||
{
|
||||
IInventoryService invService = m_scene.RequestModuleInterface<IInventoryService>();
|
||||
InventoryItemBase assetRequestItem = new InventoryItemBase(itemID, AgentId);
|
||||
assetRequestItem = invService.GetItem(assetRequestItem);
|
||||
if (assetRequestItem == null)
|
||||
IInventoryAccessModule invAccess = m_scene.RequestModuleInterface<IInventoryAccessModule>();
|
||||
if (invAccess != null)
|
||||
{
|
||||
ILibraryService lib = m_scene.RequestModuleInterface<ILibraryService>();
|
||||
if (lib != null)
|
||||
assetRequestItem = lib.LibraryRootFolder.FindItem(itemID);
|
||||
if (assetRequestItem == null)
|
||||
return true;
|
||||
}
|
||||
if (!invAccess.GetAgentInventoryItem(this, itemID, requestID))
|
||||
return false;
|
||||
|
||||
// At this point, we need to apply perms
|
||||
// only to notecards and scripts. All
|
||||
// other asset types are always available
|
||||
//
|
||||
if (assetRequestItem.AssetType == (int)AssetType.LSLText)
|
||||
{
|
||||
if (!((Scene)m_scene).Permissions.CanViewScript(itemID, UUID.Zero, AgentId))
|
||||
{
|
||||
SendAgentAlertMessage("Insufficient permissions to view script", false);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else if (assetRequestItem.AssetType == (int)AssetType.Notecard)
|
||||
{
|
||||
if (!((Scene)m_scene).Permissions.CanViewNotecard(itemID, UUID.Zero, AgentId))
|
||||
{
|
||||
SendAgentAlertMessage("Insufficient permissions to view notecard", false);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else
|
||||
return false;
|
||||
|
||||
if (assetRequestItem.AssetID != requestID)
|
||||
{
|
||||
m_log.WarnFormat(
|
||||
"[CLIENT]: {0} requested asset {1} from item {2} but this does not match item's asset {3}",
|
||||
Name, requestID, itemID, assetRequestItem.AssetID);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//m_assetCache.AddAssetRequest(this, transfer);
|
||||
|
||||
MakeAssetRequest(transfer, taskID);
|
||||
|
||||
/* RequestAsset = OnRequestAsset;
|
||||
if (RequestAsset != null)
|
||||
{
|
||||
RequestAsset(this, transfer);
|
||||
}*/
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -11459,15 +11420,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
|||
else if (transferRequest.TransferInfo.SourceType == (int)SourceType.SimInventoryItem)
|
||||
{
|
||||
requestID = new UUID(transferRequest.TransferInfo.Params, 80);
|
||||
//m_log.Debug("[XXX] inventory asset request " + requestID);
|
||||
//if (taskID == UUID.Zero) // Agent
|
||||
// if (m_scene is HGScene)
|
||||
// {
|
||||
// m_log.Debug("[XXX] hg asset request " + requestID);
|
||||
// // We may need to fetch the asset from the user's asset server into the local asset server
|
||||
// HGAssetMapper mapper = ((HGScene)m_scene).AssetMapper;
|
||||
// mapper.Get(requestID, AgentId);
|
||||
// }
|
||||
}
|
||||
|
||||
// m_log.DebugFormat("[CLIENT]: {0} requesting asset {1}", Name, requestID);
|
||||
|
@ -11483,49 +11435,25 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
|||
/// <param name="asset"></param>
|
||||
protected void AssetReceived(string id, Object sender, AssetBase asset)
|
||||
{
|
||||
if (asset == null)
|
||||
return;
|
||||
|
||||
TransferRequestPacket transferRequest = (TransferRequestPacket)sender;
|
||||
|
||||
UUID requestID = UUID.Zero;
|
||||
byte source = (byte)SourceType.Asset;
|
||||
|
||||
if ((transferRequest.TransferInfo.SourceType == (int)SourceType.Asset)
|
||||
|| (transferRequest.TransferInfo.SourceType == 2222))
|
||||
if (transferRequest.TransferInfo.SourceType == (int)SourceType.Asset)
|
||||
{
|
||||
requestID = new UUID(transferRequest.TransferInfo.Params, 0);
|
||||
}
|
||||
else if ((transferRequest.TransferInfo.SourceType == (int)SourceType.SimInventoryItem)
|
||||
|| (transferRequest.TransferInfo.SourceType == 3333))
|
||||
else if (transferRequest.TransferInfo.SourceType == (int)SourceType.SimInventoryItem)
|
||||
{
|
||||
requestID = new UUID(transferRequest.TransferInfo.Params, 80);
|
||||
source = (byte)SourceType.SimInventoryItem;
|
||||
//m_log.Debug("asset request " + requestID);
|
||||
}
|
||||
|
||||
if (null == asset)
|
||||
{
|
||||
if ((m_hyperAssets != null) && (transferRequest.TransferInfo.SourceType < 2000))
|
||||
{
|
||||
// Try the user's inventory, but only if it's different from the regions'
|
||||
string userAssets = m_hyperAssets.GetUserAssetServer(AgentId);
|
||||
if ((userAssets != string.Empty) && (userAssets != m_hyperAssets.GetSimAssetServer()))
|
||||
{
|
||||
m_log.DebugFormat("[CLIENT]: asset {0} not found in local asset storage. Trying user's storage.", id);
|
||||
if (transferRequest.TransferInfo.SourceType == (int)SourceType.Asset)
|
||||
transferRequest.TransferInfo.SourceType = 2222; // marker
|
||||
else if (transferRequest.TransferInfo.SourceType == (int)SourceType.SimInventoryItem)
|
||||
transferRequest.TransferInfo.SourceType = 3333; // marker
|
||||
|
||||
m_assetService.Get(userAssets + "/" + id, transferRequest, AssetReceived);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
//m_log.DebugFormat("[ASSET CACHE]: Asset transfer request for asset which is {0} already known to be missing. Dropping", requestID);
|
||||
|
||||
// FIXME: We never tell the client about assets which do not exist when requested by this transfer mechanism, which can't be right.
|
||||
return;
|
||||
}
|
||||
|
||||
// Scripts cannot be retrieved by direct request
|
||||
if (transferRequest.TransferInfo.SourceType == (int)SourceType.Asset && asset.Type == 10)
|
||||
return;
|
||||
|
|
|
@ -58,8 +58,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
|||
private C5.IntervalHeap<J2KImage> m_priorityQueue = new C5.IntervalHeap<J2KImage>(10, new J2KImageComparer());
|
||||
private object m_syncRoot = new object();
|
||||
|
||||
private IHyperAssetService m_hyperAssets;
|
||||
|
||||
public LLClientView Client { get { return m_client; } }
|
||||
public AssetBase MissingImage { get { return m_missingImage; } }
|
||||
|
||||
|
@ -75,7 +73,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
|||
m_log.Error("[ClientView] - Couldn't set missing image asset, falling back to missing image packet. This is known to crash the client");
|
||||
|
||||
m_j2kDecodeModule = pJ2kDecodeModule;
|
||||
m_hyperAssets = client.Scene.RequestModuleInterface<IHyperAssetService>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -149,7 +146,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
|||
imgrequest.J2KDecoder = m_j2kDecodeModule;
|
||||
imgrequest.AssetService = m_assetCache;
|
||||
imgrequest.AgentID = m_client.AgentId;
|
||||
imgrequest.HyperAssets = m_hyperAssets;
|
||||
imgrequest.InventoryAccessModule = m_client.Scene.RequestModuleInterface<IInventoryAccessModule>();
|
||||
imgrequest.DiscardLevel = newRequest.DiscardLevel;
|
||||
imgrequest.StartPacket = Math.Max(1, newRequest.PacketNumber);
|
||||
imgrequest.Priority = newRequest.Priority;
|
||||
|
|
|
@ -182,7 +182,13 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction
|
|||
|
||||
if (part.Inventory.UpdateInventoryItem(item))
|
||||
{
|
||||
remoteClient.SendAgentAlertMessage("Notecard saved", false);
|
||||
if ((InventoryType)item.InvType == InventoryType.Notecard)
|
||||
remoteClient.SendAgentAlertMessage("Notecard saved", false);
|
||||
else if ((InventoryType)item.InvType == InventoryType.LSL)
|
||||
remoteClient.SendAgentAlertMessage("Script saved", false);
|
||||
else
|
||||
remoteClient.SendAgentAlertMessage("Item saved", false);
|
||||
|
||||
part.GetProperties(remoteClient);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/*
|
||||
/*
|
||||
* Copyright (c) Contributors, http://opensimulator.org/
|
||||
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||
*
|
||||
|
@ -190,7 +190,7 @@ namespace OpenSim.Region.CoreModules.Avatar.ObjectCaps
|
|||
end = Utils.Clamp(end, 1, texture.Data.Length);
|
||||
start = Utils.Clamp(start, 0, end - 1);
|
||||
|
||||
m_log.Debug("Serving " + start + " to " + end + " of " + texture.Data.Length + " bytes for texture " + texture.ID);
|
||||
//m_log.Debug("Serving " + start + " to " + end + " of " + texture.Data.Length + " bytes for texture " + texture.ID);
|
||||
|
||||
if (end - start < texture.Data.Length)
|
||||
response.StatusCode = (int)System.Net.HttpStatusCode.PartialContent;
|
||||
|
|
|
@ -81,14 +81,14 @@ namespace OpenSim.Region.CoreModules.Avatar.Dialog
|
|||
{
|
||||
ScenePresence sp = m_scene.GetScenePresence(agentID);
|
||||
|
||||
if (sp != null && !sp.IsChildAgent)
|
||||
if (sp != null)
|
||||
sp.ControllingClient.SendAgentAlertMessage(message, modal);
|
||||
}
|
||||
|
||||
public void SendAlertToUser(string firstName, string lastName, string message, bool modal)
|
||||
{
|
||||
ScenePresence presence = m_scene.GetScenePresence(firstName, lastName);
|
||||
if (presence != null && !presence.IsChildAgent)
|
||||
if (presence != null)
|
||||
presence.ControllingClient.SendAgentAlertMessage(message, modal);
|
||||
}
|
||||
|
||||
|
@ -119,7 +119,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Dialog
|
|||
}
|
||||
|
||||
ScenePresence sp = m_scene.GetScenePresence(avatarID);
|
||||
if (sp != null && !sp.IsChildAgent)
|
||||
if (sp != null)
|
||||
sp.ControllingClient.SendDialog(objectName, objectID, ownerFirstName, ownerLastName, message, textureID, ch, buttonlabels);
|
||||
}
|
||||
|
||||
|
@ -128,7 +128,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Dialog
|
|||
{
|
||||
ScenePresence sp = m_scene.GetScenePresence(avatarID);
|
||||
|
||||
if (sp != null && !sp.IsChildAgent)
|
||||
if (sp != null)
|
||||
sp.ControllingClient.SendLoadURL(objectName, objectID, ownerID, groupOwned, message, url);
|
||||
}
|
||||
|
||||
|
@ -149,7 +149,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Dialog
|
|||
|
||||
ScenePresence sp = m_scene.GetScenePresence(avatarid);
|
||||
|
||||
if (sp != null && !sp.IsChildAgent)
|
||||
if (sp != null)
|
||||
sp.ControllingClient.SendTextBoxRequest(message, chatChannel, name, ownerFirstName, ownerLastName, objectid);
|
||||
}
|
||||
|
||||
|
|
|
@ -212,9 +212,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
|||
|
||||
InventoryFolderBase destFolder = ResolveDestinationFolder(rootDestFolder, ref iarPathExisting, resolvedFolders);
|
||||
|
||||
m_log.DebugFormat(
|
||||
"[INVENTORY ARCHIVER]: originalArchivePath [{0}], section already loaded [{1}]",
|
||||
iarPath, iarPathExisting);
|
||||
// m_log.DebugFormat(
|
||||
// "[INVENTORY ARCHIVER]: originalArchivePath [{0}], section already loaded [{1}]",
|
||||
// iarPath, iarPathExisting);
|
||||
|
||||
string iarPathToCreate = iarPath.Substring(iarPathExisting.Length);
|
||||
CreateFoldersForPath(destFolder, iarPathExisting, iarPathToCreate, resolvedFolders, loadedNodes);
|
||||
|
@ -255,12 +255,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
|||
{
|
||||
while (null == destFolder && archivePath.Length > 0)
|
||||
{
|
||||
m_log.DebugFormat("[INVENTORY ARCHIVER]: Trying to resolve destination folder {0}", archivePath);
|
||||
// m_log.DebugFormat("[INVENTORY ARCHIVER]: Trying to resolve destination folder {0}", archivePath);
|
||||
|
||||
if (resolvedFolders.ContainsKey(archivePath))
|
||||
{
|
||||
m_log.DebugFormat(
|
||||
"[INVENTORY ARCHIVER]: Found previously created folder from archive path {0}", archivePath);
|
||||
// m_log.DebugFormat(
|
||||
// "[INVENTORY ARCHIVER]: Found previously created folder from archive path {0}", archivePath);
|
||||
destFolder = resolvedFolders[archivePath];
|
||||
}
|
||||
else
|
||||
|
@ -275,9 +275,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
|||
}
|
||||
else
|
||||
{
|
||||
m_log.DebugFormat(
|
||||
"[INVENTORY ARCHIVER]: Found no previously created folder for archive path {0}",
|
||||
originalArchivePath);
|
||||
// m_log.DebugFormat(
|
||||
// "[INVENTORY ARCHIVER]: Found no previously created folder for archive path {0}",
|
||||
// originalArchivePath);
|
||||
archivePath = string.Empty;
|
||||
destFolder = rootDestFolder;
|
||||
}
|
||||
|
|
|
@ -206,11 +206,18 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
|||
|
||||
if (components.Length == 1)
|
||||
{
|
||||
// m_log.DebugFormat("FOUND SINGLE COMPONENT [{0}]", components[0]);
|
||||
// m_log.DebugFormat(
|
||||
// "FOUND SINGLE COMPONENT [{0}]. Looking for this in [{1}] {2}",
|
||||
// components[0], startFolder.Name, startFolder.ID);
|
||||
|
||||
List<InventoryItemBase> items = inventoryService.GetFolderItems(startFolder.Owner, startFolder.ID);
|
||||
|
||||
// m_log.DebugFormat("[INVENTORY ARCHIVE UTILS]: Found {0} items in FindItemByPath()", items.Count);
|
||||
|
||||
foreach (InventoryItemBase item in items)
|
||||
{
|
||||
// m_log.DebugFormat("[INVENTORY ARCHIVE UTILS]: Inspecting item {0} {1}", item.Name, item.ID);
|
||||
|
||||
if (item.Name == components[0])
|
||||
return item;
|
||||
}
|
||||
|
|
|
@ -63,13 +63,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test saving a V0.1 OpenSim Inventory Archive (subject to change since there is no fixed format yet).
|
||||
/// Test saving an inventory path to a V0.1 OpenSim Inventory Archive
|
||||
/// (subject to change since there is no fixed format yet).
|
||||
/// </summary>
|
||||
// Commenting for now! The mock inventory service needs more beef, at least for
|
||||
// GetFolderForType
|
||||
// REFACTORING PROBLEM. This needs to be rewritten.
|
||||
[Test]
|
||||
public void TestSaveIarV0_1()
|
||||
public void TestSavePathToIarV0_1()
|
||||
{
|
||||
TestHelper.InMethod();
|
||||
// log4net.Config.XmlConfigurator.Configure();
|
||||
|
@ -181,6 +179,123 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
|
|||
// TODO: Test presence of more files and contents of files.
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test saving a single inventory item to a V0.1 OpenSim Inventory Archive
|
||||
/// (subject to change since there is no fixed format yet).
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void TestSaveItemToIarV0_1()
|
||||
{
|
||||
TestHelper.InMethod();
|
||||
// log4net.Config.XmlConfigurator.Configure();
|
||||
|
||||
InventoryArchiverModule archiverModule = new InventoryArchiverModule(true);
|
||||
|
||||
Scene scene = SceneSetupHelpers.SetupScene("Inventory");
|
||||
SceneSetupHelpers.SetupSceneModules(scene, archiverModule);
|
||||
|
||||
// Create user
|
||||
string userFirstName = "Jock";
|
||||
string userLastName = "Stirrup";
|
||||
string userPassword = "troll";
|
||||
UUID userId = UUID.Parse("00000000-0000-0000-0000-000000000020");
|
||||
UserProfileTestUtils.CreateUserWithInventory(scene, userFirstName, userLastName, userId, userPassword);
|
||||
|
||||
// Create asset
|
||||
SceneObjectGroup object1;
|
||||
SceneObjectPart part1;
|
||||
{
|
||||
string partName = "My Little Dog Object";
|
||||
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");
|
||||
string item1Name = "My Little Dog";
|
||||
InventoryItemBase item1 = new InventoryItemBase();
|
||||
item1.Name = item1Name;
|
||||
item1.AssetID = asset1.FullID;
|
||||
item1.ID = item1Id;
|
||||
InventoryFolderBase objsFolder
|
||||
= InventoryArchiveUtils.FindFolderByPath(scene.InventoryService, userId, "Objects")[0];
|
||||
item1.Folder = objsFolder.ID;
|
||||
scene.AddInventoryItem(userId, item1);
|
||||
|
||||
MemoryStream archiveWriteStream = new MemoryStream();
|
||||
archiverModule.OnInventoryArchiveSaved += SaveCompleted;
|
||||
|
||||
mre.Reset();
|
||||
archiverModule.ArchiveInventory(
|
||||
Guid.NewGuid(), userFirstName, userLastName, "Objects/" + item1Name, userPassword, archiveWriteStream);
|
||||
mre.WaitOne(60000, false);
|
||||
|
||||
byte[] archive = archiveWriteStream.ToArray();
|
||||
MemoryStream archiveReadStream = new MemoryStream(archive);
|
||||
TarArchiveReader tar = new TarArchiveReader(archiveReadStream);
|
||||
|
||||
//bool gotControlFile = false;
|
||||
bool gotObject1File = false;
|
||||
//bool gotObject2File = false;
|
||||
string expectedObject1FileName = InventoryArchiveWriteRequest.CreateArchiveItemName(item1);
|
||||
string expectedObject1FilePath = string.Format(
|
||||
"{0}{1}",
|
||||
ArchiveConstants.INVENTORY_PATH,
|
||||
expectedObject1FileName);
|
||||
|
||||
string filePath;
|
||||
TarArchiveReader.TarEntryType tarEntryType;
|
||||
|
||||
// Console.WriteLine("Reading archive");
|
||||
|
||||
while (tar.ReadEntry(out filePath, out tarEntryType) != null)
|
||||
{
|
||||
Console.WriteLine("Got {0}", filePath);
|
||||
|
||||
// if (ArchiveConstants.CONTROL_FILE_PATH == filePath)
|
||||
// {
|
||||
// gotControlFile = true;
|
||||
// }
|
||||
|
||||
if (filePath.StartsWith(ArchiveConstants.INVENTORY_PATH) && filePath.EndsWith(".xml"))
|
||||
{
|
||||
// string fileName = filePath.Remove(0, "Objects/".Length);
|
||||
//
|
||||
// if (fileName.StartsWith(part1.Name))
|
||||
// {
|
||||
Assert.That(expectedObject1FilePath, Is.EqualTo(filePath));
|
||||
gotObject1File = true;
|
||||
// }
|
||||
// else if (fileName.StartsWith(part2.Name))
|
||||
// {
|
||||
// Assert.That(fileName, Is.EqualTo(expectedObject2FileName));
|
||||
// gotObject2File = true;
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
// Assert.That(gotControlFile, Is.True, "No control file in archive");
|
||||
Assert.That(gotObject1File, Is.True, "No item1 file in archive");
|
||||
// Assert.That(gotObject2File, Is.True, "No object2 file in archive");
|
||||
|
||||
// TODO: Test presence of more files and contents of files.
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 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.
|
||||
|
|
|
@ -157,6 +157,8 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
|
|||
Dictionary<UUID, AssetType> ids = new Dictionary<UUID, AssetType>();
|
||||
HGUuidGatherer uuidGatherer = new HGUuidGatherer(this, m_scene.AssetService, userAssetURL);
|
||||
uuidGatherer.GatherAssetUuids(asset.FullID, (AssetType)asset.Type, ids);
|
||||
if (ids.ContainsKey(assetID))
|
||||
ids.Remove(assetID);
|
||||
foreach (UUID uuid in ids.Keys)
|
||||
FetchAsset(userAssetURL, uuid);
|
||||
|
||||
|
|
|
@ -131,7 +131,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
|
|||
return ret;
|
||||
}
|
||||
|
||||
// DO NOT OVERRIDE THIS METHOD
|
||||
// DO NOT OVERRIDE THE BASE METHOD
|
||||
public virtual UUID DeleteToInventory(DeRezAction action, UUID folderID,
|
||||
SceneObjectGroup objectGroup, IClientAPI remoteClient)
|
||||
{
|
||||
|
@ -139,7 +139,8 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
|
|||
|
||||
if (!assetID.Equals(UUID.Zero))
|
||||
{
|
||||
UploadInventoryItem(remoteClient.AgentId, assetID, "", 0);
|
||||
if (remoteClient != null)
|
||||
UploadInventoryItem(remoteClient.AgentId, assetID, "", 0);
|
||||
}
|
||||
else
|
||||
m_log.Debug("[HGScene]: Scene.Inventory did not create asset");
|
||||
|
@ -192,9 +193,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
|
|||
m_assMapper.Post(item.AssetID, receiver, userAssetServer);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
public bool IsForeignUser(UUID userID, out string assetServerURL)
|
||||
public override bool IsForeignUser(UUID userID, out string assetServerURL)
|
||||
{
|
||||
assetServerURL = string.Empty;
|
||||
UserAccount account = null;
|
||||
|
@ -217,5 +216,18 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
|
|||
|
||||
return false;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
protected override InventoryItemBase GetItem(UUID agentID, UUID itemID)
|
||||
{
|
||||
InventoryItemBase item = base.GetItem(agentID, itemID);
|
||||
|
||||
string userAssetServer = string.Empty;
|
||||
if (IsForeignUser(agentID, out userAssetServer))
|
||||
m_assMapper.Get(item.AssetID, agentID, userAssetServer);
|
||||
|
||||
return item;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -639,6 +639,57 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
|
|||
{
|
||||
}
|
||||
|
||||
public virtual bool GetAgentInventoryItem(IClientAPI remoteClient, UUID itemID, UUID requestID)
|
||||
{
|
||||
InventoryItemBase assetRequestItem = GetItem(remoteClient.AgentId, itemID);
|
||||
if (assetRequestItem == null)
|
||||
{
|
||||
ILibraryService lib = m_Scene.RequestModuleInterface<ILibraryService>();
|
||||
if (lib != null)
|
||||
assetRequestItem = lib.LibraryRootFolder.FindItem(itemID);
|
||||
if (assetRequestItem == null)
|
||||
return false;
|
||||
}
|
||||
|
||||
// At this point, we need to apply perms
|
||||
// only to notecards and scripts. All
|
||||
// other asset types are always available
|
||||
//
|
||||
if (assetRequestItem.AssetType == (int)AssetType.LSLText)
|
||||
{
|
||||
if (!m_Scene.Permissions.CanViewScript(itemID, UUID.Zero, remoteClient.AgentId))
|
||||
{
|
||||
remoteClient.SendAgentAlertMessage("Insufficient permissions to view script", false);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else if (assetRequestItem.AssetType == (int)AssetType.Notecard)
|
||||
{
|
||||
if (!m_Scene.Permissions.CanViewNotecard(itemID, UUID.Zero, remoteClient.AgentId))
|
||||
{
|
||||
remoteClient.SendAgentAlertMessage("Insufficient permissions to view notecard", false);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (assetRequestItem.AssetID != requestID)
|
||||
{
|
||||
m_log.WarnFormat(
|
||||
"[CLIENT]: {0} requested asset {1} from item {2} but this does not match item's asset {3}",
|
||||
Name, requestID, itemID, assetRequestItem.AssetID);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
public virtual bool IsForeignUser(UUID userID, out string assetServerURL)
|
||||
{
|
||||
assetServerURL = string.Empty;
|
||||
return false;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Misc
|
||||
|
@ -661,6 +712,14 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
|
|||
return asset;
|
||||
}
|
||||
|
||||
protected virtual InventoryItemBase GetItem(UUID agentID, UUID itemID)
|
||||
{
|
||||
IInventoryService invService = m_Scene.RequestModuleInterface<IInventoryService>();
|
||||
InventoryItemBase assetRequestItem = new InventoryItemBase(itemID, agentID);
|
||||
assetRequestItem = invService.GetItem(assetRequestItem);
|
||||
return assetRequestItem;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
|
|
@ -41,7 +41,7 @@ using OpenMetaverse;
|
|||
namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset
|
||||
{
|
||||
public class HGAssetBroker :
|
||||
ISharedRegionModule, IAssetService, IHyperAssetService
|
||||
ISharedRegionModule, IAssetService
|
||||
{
|
||||
private static readonly ILog m_log =
|
||||
LogManager.GetLogger(
|
||||
|
@ -150,7 +150,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset
|
|||
m_aScene = scene;
|
||||
|
||||
scene.RegisterModuleInterface<IAssetService>(this);
|
||||
scene.RegisterModuleInterface<IHyperAssetService>(this);
|
||||
}
|
||||
|
||||
public void RemoveRegion(Scene scene)
|
||||
|
|
|
@ -202,9 +202,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
// else put a null; it means that the methods should forward to local grid's inventory
|
||||
m_InventoryURLs.Add(userID, null);
|
||||
}
|
||||
|
||||
private void DropInventoryServiceURL(UUID userID)
|
||||
|
@ -223,10 +220,13 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
|
|||
if (m_InventoryURLs.ContainsKey(userID))
|
||||
return m_InventoryURLs[userID];
|
||||
|
||||
else
|
||||
CacheInventoryServiceURL(userID);
|
||||
CacheInventoryServiceURL(userID);
|
||||
|
||||
return m_InventoryURLs[userID];
|
||||
if (m_InventoryURLs.ContainsKey(userID))
|
||||
return m_InventoryURLs[userID];
|
||||
|
||||
return null; //it means that the methods should forward to local grid's inventory
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
@ -253,7 +253,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
|
|||
|
||||
public InventoryFolderBase GetRootFolder(UUID userID)
|
||||
{
|
||||
m_log.DebugFormat("[HG INVENTORY CONNECTOR]: GetRootFolder for {0}", userID);
|
||||
//m_log.DebugFormat("[HG INVENTORY CONNECTOR]: GetRootFolder for {0}", userID);
|
||||
|
||||
string invURL = GetInventoryServiceURL(userID);
|
||||
|
||||
|
@ -267,7 +267,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
|
|||
|
||||
public InventoryFolderBase GetFolderForType(UUID userID, AssetType type)
|
||||
{
|
||||
m_log.DebugFormat("[HG INVENTORY CONNECTOR]: GetFolderForType {0} type {1}", userID, type);
|
||||
//m_log.DebugFormat("[HG INVENTORY CONNECTOR]: GetFolderForType {0} type {1}", userID, type);
|
||||
|
||||
string invURL = GetInventoryServiceURL(userID);
|
||||
|
||||
|
@ -281,7 +281,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
|
|||
|
||||
public InventoryCollection GetFolderContent(UUID userID, UUID folderID)
|
||||
{
|
||||
m_log.Debug("[HG INVENTORY CONNECTOR]: GetFolderContent " + folderID);
|
||||
//m_log.Debug("[HG INVENTORY CONNECTOR]: GetFolderContent " + folderID);
|
||||
|
||||
string invURL = GetInventoryServiceURL(userID);
|
||||
|
||||
|
@ -296,7 +296,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
|
|||
|
||||
public List<InventoryItemBase> GetFolderItems(UUID userID, UUID folderID)
|
||||
{
|
||||
m_log.Debug("[HG INVENTORY CONNECTOR]: GetFolderItems " + folderID);
|
||||
//m_log.Debug("[HG INVENTORY CONNECTOR]: GetFolderItems " + folderID);
|
||||
|
||||
string invURL = GetInventoryServiceURL(userID);
|
||||
|
||||
|
@ -314,7 +314,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
|
|||
if (folder == null)
|
||||
return false;
|
||||
|
||||
m_log.Debug("[HG INVENTORY CONNECTOR]: AddFolder " + folder.ID);
|
||||
//m_log.Debug("[HG INVENTORY CONNECTOR]: AddFolder " + folder.ID);
|
||||
|
||||
string invURL = GetInventoryServiceURL(folder.Owner);
|
||||
|
||||
|
@ -331,7 +331,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
|
|||
if (folder == null)
|
||||
return false;
|
||||
|
||||
m_log.Debug("[HG INVENTORY CONNECTOR]: UpdateFolder " + folder.ID);
|
||||
//m_log.Debug("[HG INVENTORY CONNECTOR]: UpdateFolder " + folder.ID);
|
||||
|
||||
string invURL = GetInventoryServiceURL(folder.Owner);
|
||||
|
||||
|
@ -350,7 +350,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
|
|||
if (folderIDs.Count == 0)
|
||||
return false;
|
||||
|
||||
m_log.Debug("[HG INVENTORY CONNECTOR]: DeleteFolders for " + ownerID);
|
||||
//m_log.Debug("[HG INVENTORY CONNECTOR]: DeleteFolders for " + ownerID);
|
||||
|
||||
string invURL = GetInventoryServiceURL(ownerID);
|
||||
|
||||
|
@ -367,7 +367,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
|
|||
if (folder == null)
|
||||
return false;
|
||||
|
||||
m_log.Debug("[HG INVENTORY CONNECTOR]: MoveFolder for " + folder.Owner);
|
||||
//m_log.Debug("[HG INVENTORY CONNECTOR]: MoveFolder for " + folder.Owner);
|
||||
|
||||
string invURL = GetInventoryServiceURL(folder.Owner);
|
||||
|
||||
|
@ -384,7 +384,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
|
|||
if (folder == null)
|
||||
return false;
|
||||
|
||||
m_log.Debug("[HG INVENTORY CONNECTOR]: PurgeFolder for " + folder.Owner);
|
||||
//m_log.Debug("[HG INVENTORY CONNECTOR]: PurgeFolder for " + folder.Owner);
|
||||
|
||||
string invURL = GetInventoryServiceURL(folder.Owner);
|
||||
|
||||
|
@ -401,7 +401,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
|
|||
if (item == null)
|
||||
return false;
|
||||
|
||||
m_log.Debug("[HG INVENTORY CONNECTOR]: AddItem " + item.ID);
|
||||
//m_log.Debug("[HG INVENTORY CONNECTOR]: AddItem " + item.ID);
|
||||
|
||||
string invURL = GetInventoryServiceURL(item.Owner);
|
||||
|
||||
|
@ -418,7 +418,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
|
|||
if (item == null)
|
||||
return false;
|
||||
|
||||
m_log.Debug("[HG INVENTORY CONNECTOR]: UpdateItem " + item.ID);
|
||||
//m_log.Debug("[HG INVENTORY CONNECTOR]: UpdateItem " + item.ID);
|
||||
|
||||
string invURL = GetInventoryServiceURL(item.Owner);
|
||||
|
||||
|
@ -437,7 +437,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
|
|||
if (items.Count == 0)
|
||||
return true;
|
||||
|
||||
m_log.Debug("[HG INVENTORY CONNECTOR]: MoveItems for " + ownerID);
|
||||
//m_log.Debug("[HG INVENTORY CONNECTOR]: MoveItems for " + ownerID);
|
||||
|
||||
string invURL = GetInventoryServiceURL(ownerID);
|
||||
|
||||
|
@ -451,15 +451,13 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
|
|||
|
||||
public bool DeleteItems(UUID ownerID, List<UUID> itemIDs)
|
||||
{
|
||||
m_log.DebugFormat("[HG INVENTORY CONNECTOR]: Delete {0} items for user {1}", itemIDs.Count, ownerID);
|
||||
//m_log.DebugFormat("[HG INVENTORY CONNECTOR]: Delete {0} items for user {1}", itemIDs.Count, ownerID);
|
||||
|
||||
if (itemIDs == null)
|
||||
return false;
|
||||
if (itemIDs.Count == 0)
|
||||
return true;
|
||||
|
||||
m_log.Debug("[HG INVENTORY CONNECTOR]: DeleteItems for " + ownerID);
|
||||
|
||||
string invURL = GetInventoryServiceURL(ownerID);
|
||||
|
||||
if (invURL == null) // not there, forward to local inventory connector to resolve
|
||||
|
@ -474,7 +472,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
|
|||
{
|
||||
if (item == null)
|
||||
return null;
|
||||
m_log.Debug("[HG INVENTORY CONNECTOR]: GetItem " + item.ID);
|
||||
//m_log.Debug("[HG INVENTORY CONNECTOR]: GetItem " + item.ID);
|
||||
|
||||
string invURL = GetInventoryServiceURL(item.Owner);
|
||||
|
||||
|
@ -491,7 +489,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
|
|||
if (folder == null)
|
||||
return null;
|
||||
|
||||
m_log.Debug("[HG INVENTORY CONNECTOR]: GetFolder " + folder.ID);
|
||||
//m_log.Debug("[HG INVENTORY CONNECTOR]: GetFolder " + folder.ID);
|
||||
|
||||
string invURL = GetInventoryServiceURL(folder.Owner);
|
||||
|
||||
|
@ -515,7 +513,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
|
|||
|
||||
public int GetAssetPermissions(UUID userID, UUID assetID)
|
||||
{
|
||||
m_log.Debug("[HG INVENTORY CONNECTOR]: GetAssetPermissions " + assetID);
|
||||
//m_log.Debug("[HG INVENTORY CONNECTOR]: GetAssetPermissions " + assetID);
|
||||
|
||||
string invURL = GetInventoryServiceURL(userID);
|
||||
|
||||
|
|
|
@ -805,7 +805,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
|
|||
imgstream = new MemoryStream();
|
||||
|
||||
// non-async because we know we have the asset immediately.
|
||||
AssetBase mapasset = m_scene.AssetService.Get(m_scene.RegionInfo.lastMapUUID.ToString());
|
||||
AssetBase mapasset = m_scene.AssetService.Get(m_scene.RegionInfo.RegionSettings.TerrainImageID.ToString());
|
||||
|
||||
// Decode image to System.Drawing.Image
|
||||
if (OpenJPEG.DecodeToImage(mapasset.Data, out managedImage, out image))
|
||||
|
|
|
@ -258,21 +258,16 @@ namespace OpenSim.Region.DataSnapshot
|
|||
|
||||
private String GetRegionCategory(Scene scene)
|
||||
{
|
||||
//Boolean choice between:
|
||||
// "PG" - Mormontown
|
||||
// "Mature" - Sodom and Gomorrah
|
||||
if (scene.RegionInfo.RegionSettings.Maturity == 1)
|
||||
{
|
||||
return "Mature";
|
||||
}
|
||||
else if (scene.RegionInfo.RegionSettings.Maturity == 0)
|
||||
{
|
||||
if (scene.RegionInfo.RegionSettings.Maturity == 0)
|
||||
return "PG";
|
||||
}
|
||||
else
|
||||
{
|
||||
return "Unknown";
|
||||
}
|
||||
|
||||
if (scene.RegionInfo.RegionSettings.Maturity == 1)
|
||||
return "Mature";
|
||||
|
||||
if (scene.RegionInfo.RegionSettings.Maturity == 2)
|
||||
return "Adult";
|
||||
|
||||
return "Unknown";
|
||||
}
|
||||
|
||||
private XmlNode GetGridSnapshotData(XmlDocument factory)
|
||||
|
|
|
@ -1,37 +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;
|
||||
using OpenMetaverse;
|
||||
|
||||
namespace OpenSim.Region.Framework.Interfaces
|
||||
{
|
||||
public interface IHyperAssetService
|
||||
{
|
||||
string GetUserAssetServer(UUID userID);
|
||||
string GetSimAssetServer();
|
||||
}
|
||||
}
|
|
@ -43,5 +43,9 @@ namespace OpenSim.Region.Framework.Interfaces
|
|||
UUID RayTargetID, byte BypassRayCast, bool RayEndIsIntersection,
|
||||
bool RezSelected, bool RemoveItem, UUID fromTaskID, bool attachment);
|
||||
void TransferInventoryAssets(InventoryItemBase item, UUID sender, UUID receiver);
|
||||
bool GetAgentInventoryItem(IClientAPI remoteClient, UUID itemID, UUID requestID);
|
||||
|
||||
// Must be here because of textures in user's inventory
|
||||
bool IsForeignUser(UUID userID, out string assetServerURL);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -384,29 +384,105 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
|
||||
if (Permissions.PropagatePermissions() && recipient != senderId)
|
||||
{
|
||||
// First, make sore base is limited to the next perms
|
||||
itemCopy.BasePermissions = item.BasePermissions & (item.NextPermissions | (uint)PermissionMask.Move);
|
||||
// By default, current equals base
|
||||
itemCopy.CurrentPermissions = itemCopy.BasePermissions & item.CurrentPermissions;
|
||||
// Trying to do this right this time. This is evil. If
|
||||
// you believe in Good, go elsewhere. Vampires and other
|
||||
// evil creatores only beyond this point. You have been
|
||||
// warned.
|
||||
|
||||
// If this is an object, replace current perms
|
||||
// with folded perms
|
||||
// We're going to mask a lot of things by the next perms
|
||||
// Tweak the next perms to be nicer to our data
|
||||
//
|
||||
// In this mask, all the bits we do NOT want to mess
|
||||
// with are set. These are:
|
||||
//
|
||||
// Transfer
|
||||
// Copy
|
||||
// Modufy
|
||||
uint permsMask = ~ ((uint)PermissionMask.Copy |
|
||||
(uint)PermissionMask.Transfer |
|
||||
(uint)PermissionMask.Modify);
|
||||
|
||||
// Now, reduce the next perms to the mask bits
|
||||
// relevant to the operation
|
||||
uint nextPerms = permsMask | (item.NextPermissions &
|
||||
((uint)PermissionMask.Copy |
|
||||
(uint)PermissionMask.Transfer |
|
||||
(uint)PermissionMask.Modify));
|
||||
|
||||
// nextPerms now has all bits set, except for the actual
|
||||
// next permission bits.
|
||||
|
||||
// This checks for no mod, no copy, no trans.
|
||||
// This indicates an error or messed up item. Do it like
|
||||
// SL and assume trans
|
||||
if (nextPerms == permsMask)
|
||||
nextPerms |= (uint)PermissionMask.Transfer;
|
||||
|
||||
// Inventory owner perms are the logical AND of the
|
||||
// folded perms and the root prim perms, however, if
|
||||
// the root prim is mod, the inventory perms will be
|
||||
// mod. This happens on "take" and is of little concern
|
||||
// here, save for preventing escalation
|
||||
|
||||
// This hack ensures that items previously permalocked
|
||||
// get unlocked when they're passed or rezzed
|
||||
uint basePerms = item.BasePermissions |
|
||||
(uint)PermissionMask.Move;
|
||||
uint ownerPerms = item.CurrentPermissions;
|
||||
|
||||
// If this is an object, root prim perms may be more
|
||||
// permissive than folded perms. Use folded perms as
|
||||
// a mask
|
||||
if (item.InvType == (int)InventoryType.Object)
|
||||
{
|
||||
itemCopy.CurrentPermissions &= ~(uint)(PermissionMask.Copy | PermissionMask.Modify | PermissionMask.Transfer);
|
||||
itemCopy.CurrentPermissions |= (item.CurrentPermissions & 7) << 13;
|
||||
// Create a safe mask for the current perms
|
||||
uint foldedPerms = (item.CurrentPermissions & 7) << 13;
|
||||
foldedPerms |= permsMask;
|
||||
|
||||
bool isRootMod = (item.CurrentPermissions &
|
||||
(uint)PermissionMask.Modify) != 0 ?
|
||||
true : false;
|
||||
|
||||
// Mask the owner perms to the folded perms
|
||||
ownerPerms &= foldedPerms;
|
||||
basePerms &= foldedPerms;
|
||||
|
||||
// If the root was mod, let the mask reflect that
|
||||
// We also need to adjust the base here, because
|
||||
// we should be able to edit in-inventory perms
|
||||
// for the root prim, if it's mod.
|
||||
if (isRootMod)
|
||||
{
|
||||
ownerPerms |= (uint)PermissionMask.Modify;
|
||||
basePerms |= (uint)PermissionMask.Modify;
|
||||
}
|
||||
}
|
||||
|
||||
// Ensure there is no escalation
|
||||
itemCopy.CurrentPermissions &= (item.NextPermissions | (uint)PermissionMask.Move);
|
||||
// These will be applied to the root prim at next rez.
|
||||
// The slam bit (bit 3) and folded permission (bits 0-2)
|
||||
// are preserved due to the above mangling
|
||||
ownerPerms &= nextPerms;
|
||||
|
||||
// Need slam bit on xfer
|
||||
itemCopy.CurrentPermissions |= 8;
|
||||
// Mask the base permissions. This is a conservative
|
||||
// approach altering only the three main perms
|
||||
basePerms &= nextPerms;
|
||||
|
||||
// Assign to the actual item. Make sure the slam bit is
|
||||
// set, if it wasn't set before.
|
||||
itemCopy.BasePermissions = basePerms;
|
||||
itemCopy.CurrentPermissions = ownerPerms | 16; // Slam
|
||||
|
||||
itemCopy.NextPermissions = item.NextPermissions;
|
||||
|
||||
itemCopy.EveryOnePermissions = 0;
|
||||
// This preserves "everyone can move"
|
||||
itemCopy.EveryOnePermissions = item.EveryOnePermissions &
|
||||
nextPerms;
|
||||
|
||||
// Intentionally killing "share with group" here, as
|
||||
// the recipient will not have the group this is
|
||||
// set to
|
||||
itemCopy.GroupPermissions = 0;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -839,6 +915,9 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
SceneObjectGroup group = part.ParentGroup;
|
||||
if (group != null)
|
||||
{
|
||||
if (!Permissions.CanEditObjectInventory(part.UUID, remoteClient.AgentId))
|
||||
return;
|
||||
|
||||
TaskInventoryItem item = group.GetInventoryItem(localID, itemID);
|
||||
if (item == null)
|
||||
return;
|
||||
|
@ -978,9 +1057,21 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
return;
|
||||
}
|
||||
|
||||
// Only owner can copy
|
||||
if (remoteClient.AgentId != taskItem.OwnerID)
|
||||
return;
|
||||
TaskInventoryItem item = part.Inventory.GetInventoryItem(itemId);
|
||||
if ((item.CurrentPermissions & (uint)PermissionMask.Copy) == 0)
|
||||
{
|
||||
// If the item to be moved is no copy, we need to be able to
|
||||
// edit the prim.
|
||||
if (!Permissions.CanEditObjectInventory(part.UUID, remoteClient.AgentId))
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
// If the item is copiable, then we just need to have perms
|
||||
// on it. The delete check is a pure rights check
|
||||
if (!Permissions.CanDeleteObject(part.UUID, remoteClient.AgentId))
|
||||
return;
|
||||
}
|
||||
|
||||
MoveTaskInventoryItem(remoteClient, folderId, part, itemId);
|
||||
}
|
||||
|
@ -1263,10 +1354,48 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
{
|
||||
agentTransactions.HandleTaskItemUpdateFromTransaction(
|
||||
remoteClient, part, transactionID, currentItem);
|
||||
|
||||
if ((InventoryType)itemInfo.InvType == InventoryType.Notecard)
|
||||
remoteClient.SendAgentAlertMessage("Notecard saved", false);
|
||||
else if ((InventoryType)itemInfo.InvType == InventoryType.LSL)
|
||||
remoteClient.SendAgentAlertMessage("Script saved", false);
|
||||
else
|
||||
remoteClient.SendAgentAlertMessage("Item saved", false);
|
||||
}
|
||||
|
||||
// Base ALWAYS has move
|
||||
currentItem.BasePermissions |= (uint)PermissionMask.Move;
|
||||
|
||||
// Check if we're allowed to mess with permissions
|
||||
if (!Permissions.IsGod(remoteClient.AgentId)) // Not a god
|
||||
{
|
||||
if (remoteClient.AgentId != part.OwnerID) // Not owner
|
||||
{
|
||||
// Friends and group members can't change any perms
|
||||
itemInfo.BasePermissions = currentItem.BasePermissions;
|
||||
itemInfo.EveryonePermissions = currentItem.EveryonePermissions;
|
||||
itemInfo.GroupPermissions = currentItem.GroupPermissions;
|
||||
itemInfo.NextPermissions = currentItem.NextPermissions;
|
||||
itemInfo.CurrentPermissions = currentItem.CurrentPermissions;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Owner can't change base, and can change other
|
||||
// only up to base
|
||||
itemInfo.BasePermissions = currentItem.BasePermissions;
|
||||
itemInfo.EveryonePermissions &= currentItem.BasePermissions;
|
||||
itemInfo.GroupPermissions &= currentItem.BasePermissions;
|
||||
itemInfo.CurrentPermissions &= currentItem.BasePermissions;
|
||||
itemInfo.NextPermissions &= currentItem.BasePermissions;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Next ALWAYS has move
|
||||
itemInfo.NextPermissions |= (uint)PermissionMask.Move;
|
||||
|
||||
if (part.Inventory.UpdateInventoryItem(itemInfo))
|
||||
{
|
||||
remoteClient.SendAgentAlertMessage("Notecard saved", false);
|
||||
part.GetProperties(remoteClient);
|
||||
}
|
||||
}
|
||||
|
@ -1597,7 +1726,7 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
}
|
||||
|
||||
// Handle god perms
|
||||
if (Permissions.IsGod(remoteClient.AgentId))
|
||||
if ((remoteClient != null) && Permissions.IsGod(remoteClient.AgentId))
|
||||
{
|
||||
permissionToTake = true;
|
||||
permissionToTakeCopy = true;
|
||||
|
@ -1608,7 +1737,7 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
if (action == DeRezAction.SaveToExistingUserInventoryItem)
|
||||
permissionToDelete = false;
|
||||
|
||||
// if we want to take a copy,, we also don't want to delete
|
||||
// if we want to take a copy, we also don't want to delete
|
||||
// Note: after this point, the permissionToTakeCopy flag
|
||||
// becomes irrelevant. It already includes the permissionToTake
|
||||
// permission and after excluding no copy items here, we can
|
||||
|
@ -1619,6 +1748,7 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
if (!permissionToTakeCopy)
|
||||
return;
|
||||
|
||||
permissionToTake = true;
|
||||
// Don't delete
|
||||
permissionToDelete = false;
|
||||
}
|
||||
|
|
|
@ -136,6 +136,7 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
|
||||
protected SceneCommunicationService m_sceneGridService;
|
||||
public bool LoginsDisabled = true;
|
||||
public bool LoadingPrims = false;
|
||||
|
||||
public new float TimeDilation
|
||||
{
|
||||
|
@ -1879,6 +1880,7 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
/// </summary>
|
||||
public virtual void LoadPrimsFromStorage(UUID regionID)
|
||||
{
|
||||
LoadingPrims = true;
|
||||
m_log.Info("[SCENE]: Loading objects from datastore");
|
||||
|
||||
List<SceneObjectGroup> PrimsFromDB = m_storageManager.DataStore.LoadObjects(regionID);
|
||||
|
@ -1902,6 +1904,7 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
}
|
||||
|
||||
m_log.Info("[SCENE]: Loaded " + PrimsFromDB.Count.ToString() + " SceneObject(s)");
|
||||
LoadingPrims = false;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -281,7 +281,7 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
PermissionMask.Move |
|
||||
PermissionMask.Transfer) | 7;
|
||||
|
||||
uint ownerMask = 0x7ffffff;
|
||||
uint ownerMask = 0x7fffffff;
|
||||
foreach (SceneObjectPart part in m_parts.Values)
|
||||
{
|
||||
ownerMask &= part.OwnerMask;
|
||||
|
@ -295,12 +295,16 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
if ((ownerMask & (uint)PermissionMask.Transfer) == 0)
|
||||
perms &= ~(uint)PermissionMask.Transfer;
|
||||
|
||||
if ((ownerMask & RootPart.NextOwnerMask & (uint)PermissionMask.Modify) == 0)
|
||||
perms &= ~((uint)PermissionMask.Modify >> 13);
|
||||
if ((ownerMask & RootPart.NextOwnerMask & (uint)PermissionMask.Copy) == 0)
|
||||
perms &= ~((uint)PermissionMask.Copy >> 13);
|
||||
if ((ownerMask & RootPart.NextOwnerMask & (uint)PermissionMask.Transfer) == 0)
|
||||
perms &= ~((uint)PermissionMask.Transfer >> 13);
|
||||
// If root prim permissions are applied here, this would screw
|
||||
// with in-inventory manipulation of the next owner perms
|
||||
// in a major way. So, let's move this to the give itself.
|
||||
// Yes. I know. Evil.
|
||||
// if ((ownerMask & RootPart.NextOwnerMask & (uint)PermissionMask.Modify) == 0)
|
||||
// perms &= ~((uint)PermissionMask.Modify >> 13);
|
||||
// if ((ownerMask & RootPart.NextOwnerMask & (uint)PermissionMask.Copy) == 0)
|
||||
// perms &= ~((uint)PermissionMask.Copy >> 13);
|
||||
// if ((ownerMask & RootPart.NextOwnerMask & (uint)PermissionMask.Transfer) == 0)
|
||||
// perms &= ~((uint)PermissionMask.Transfer >> 13);
|
||||
|
||||
return perms;
|
||||
}
|
||||
|
|
|
@ -294,7 +294,7 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
|
||||
if ((m_scene.TestBorderCross(val - Vector3.UnitX, Cardinals.E) || m_scene.TestBorderCross(val + Vector3.UnitX, Cardinals.W)
|
||||
|| m_scene.TestBorderCross(val - Vector3.UnitY, Cardinals.N) || m_scene.TestBorderCross(val + Vector3.UnitY, Cardinals.S))
|
||||
&& !IsAttachmentCheckFull())
|
||||
&& !IsAttachmentCheckFull() && (!m_scene.LoadingPrims))
|
||||
{
|
||||
m_scene.CrossPrimGroupIntoNewRegion(val, this, true);
|
||||
}
|
||||
|
|
|
@ -4137,6 +4137,13 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
case 16:
|
||||
_nextOwnerMask = ApplyMask(_nextOwnerMask, set, mask) &
|
||||
baseMask;
|
||||
// Prevent the client from creating no mod, no copy
|
||||
// objects
|
||||
if ((_nextOwnerMask & (uint)PermissionMask.Copy) == 0)
|
||||
_nextOwnerMask |= (uint)PermissionMask.Transfer;
|
||||
|
||||
_nextOwnerMask |= (uint)PermissionMask.Move;
|
||||
|
||||
break;
|
||||
}
|
||||
SendFullUpdateToAllClients();
|
||||
|
|
|
@ -118,20 +118,20 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
/// <param name="linkNum">Link number for the part</param>
|
||||
public void ResetInventoryIDs()
|
||||
{
|
||||
lock (Items)
|
||||
lock (m_items)
|
||||
{
|
||||
if (0 == Items.Count)
|
||||
if (0 == m_items.Count)
|
||||
return;
|
||||
|
||||
HasInventoryChanged = true;
|
||||
m_part.ParentGroup.HasGroupChanged = true;
|
||||
IList<TaskInventoryItem> items = new List<TaskInventoryItem>(Items.Values);
|
||||
Items.Clear();
|
||||
IList<TaskInventoryItem> items = GetInventoryItems();
|
||||
m_items.Clear();
|
||||
|
||||
foreach (TaskInventoryItem item in items)
|
||||
{
|
||||
item.ResetIDs(m_part.UUID);
|
||||
Items.Add(item.ItemID, item);
|
||||
m_items.Add(item.ItemID, item);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -148,17 +148,17 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
HasInventoryChanged = true;
|
||||
m_part.ParentGroup.HasGroupChanged = true;
|
||||
IList<TaskInventoryItem> items = new List<TaskInventoryItem>(Items.Values);
|
||||
foreach (TaskInventoryItem item in items)
|
||||
HasInventoryChanged = true;
|
||||
m_part.ParentGroup.HasGroupChanged = true;
|
||||
List<TaskInventoryItem> items = GetInventoryItems();
|
||||
foreach (TaskInventoryItem item in items)
|
||||
{
|
||||
if (ownerId != item.OwnerID)
|
||||
{
|
||||
if (ownerId != item.OwnerID)
|
||||
{
|
||||
item.LastOwnerID = item.OwnerID;
|
||||
item.OwnerID = ownerId;
|
||||
}
|
||||
item.LastOwnerID = item.OwnerID;
|
||||
item.OwnerID = ownerId;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -175,17 +175,15 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
HasInventoryChanged = true;
|
||||
m_part.ParentGroup.HasGroupChanged = true;
|
||||
IList<TaskInventoryItem> items = new List<TaskInventoryItem>(Items.Values);
|
||||
foreach (TaskInventoryItem item in items)
|
||||
{
|
||||
if (groupID != item.GroupID)
|
||||
{
|
||||
item.GroupID = groupID;
|
||||
}
|
||||
}
|
||||
HasInventoryChanged = true;
|
||||
m_part.ParentGroup.HasGroupChanged = true;
|
||||
List<TaskInventoryItem> items = GetInventoryItems();
|
||||
foreach (TaskInventoryItem item in items)
|
||||
{
|
||||
if (groupID != item.GroupID)
|
||||
item.GroupID = groupID;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -194,17 +192,9 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
/// </summary>
|
||||
public void CreateScriptInstances(int startParam, bool postOnRez, string engine, int stateSource)
|
||||
{
|
||||
lock (m_items)
|
||||
{
|
||||
foreach (TaskInventoryItem item in Items.Values)
|
||||
{
|
||||
if ((int)InventoryType.LSL == item.InvType)
|
||||
{
|
||||
CreateScriptInstance(item, startParam, postOnRez, engine, stateSource);
|
||||
Thread.Sleep(10); // workaround for Mono cpu utilization > 100% bug
|
||||
}
|
||||
}
|
||||
}
|
||||
List<TaskInventoryItem> scripts = GetInventoryScripts();
|
||||
foreach (TaskInventoryItem item in scripts)
|
||||
CreateScriptInstance(item, startParam, postOnRez, engine, stateSource);
|
||||
}
|
||||
|
||||
public ArrayList GetScriptErrors(UUID itemID)
|
||||
|
@ -218,7 +208,7 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
foreach (IScriptModule e in engines)
|
||||
{
|
||||
if (e != null)
|
||||
{
|
||||
{
|
||||
ArrayList errors = e.GetScriptErrors(itemID);
|
||||
foreach (Object line in errors)
|
||||
ret.Add(line);
|
||||
|
@ -237,16 +227,9 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
/// </param>
|
||||
public void RemoveScriptInstances(bool sceneObjectBeingDeleted)
|
||||
{
|
||||
lock (Items)
|
||||
{
|
||||
foreach (TaskInventoryItem item in Items.Values)
|
||||
{
|
||||
if ((int)InventoryType.LSL == item.InvType)
|
||||
{
|
||||
RemoveScriptInstance(item.ItemID, sceneObjectBeingDeleted);
|
||||
}
|
||||
}
|
||||
}
|
||||
List<TaskInventoryItem> scripts = GetInventoryScripts();
|
||||
foreach (TaskInventoryItem item in scripts)
|
||||
RemoveScriptInstance(item.ItemID, sceneObjectBeingDeleted);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -259,7 +242,7 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
// m_log.InfoFormat(
|
||||
// "[PRIM INVENTORY]: " +
|
||||
// "Starting script {0}, {1} in prim {2}, {3}",
|
||||
// item.Name, item.ItemID, m_part.Name, m_part.UUID);
|
||||
// item.Name, item.ItemID, Name, UUID);
|
||||
|
||||
if (!m_part.ParentGroup.Scene.Permissions.CanRunScript(item.ItemID, m_part.UUID, item.OwnerID))
|
||||
return;
|
||||
|
@ -295,20 +278,20 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
}
|
||||
else
|
||||
{
|
||||
if (m_part.ParentGroup.m_savedScriptState != null)
|
||||
RestoreSavedScriptState(item.OldItemID, item.ItemID);
|
||||
|
||||
lock (m_items)
|
||||
{
|
||||
if (m_part.ParentGroup.m_savedScriptState != null)
|
||||
RestoreSavedScriptState(item.OldItemID, item.ItemID);
|
||||
|
||||
m_items[item.ItemID].PermsMask = 0;
|
||||
m_items[item.ItemID].PermsGranter = UUID.Zero;
|
||||
|
||||
string script = Utils.BytesToString(asset.Data);
|
||||
m_part.ParentGroup.Scene.EventManager.TriggerRezScript(
|
||||
m_part.LocalId, item.ItemID, script, startParam, postOnRez, engine, stateSource);
|
||||
m_part.ParentGroup.AddActiveScriptCount(1);
|
||||
m_part.ScheduleFullUpdate();
|
||||
}
|
||||
|
||||
string script = Utils.BytesToString(asset.Data);
|
||||
m_part.ParentGroup.Scene.EventManager.TriggerRezScript(
|
||||
m_part.LocalId, item.ItemID, script, startParam, postOnRez, engine, stateSource);
|
||||
m_part.ParentGroup.AddActiveScriptCount(1);
|
||||
m_part.ScheduleFullUpdate();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -356,26 +339,14 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
|
||||
m_part.ParentGroup.m_savedScriptState[oldID] = newDoc.OuterXml;
|
||||
}
|
||||
|
||||
foreach (IScriptModule e in engines)
|
||||
{
|
||||
if (e != null)
|
||||
{
|
||||
// Stop an exception in setting saved state from propogating since this is not fatal.
|
||||
try
|
||||
{
|
||||
if (e.SetXMLState(newID, m_part.ParentGroup.m_savedScriptState[oldID]))
|
||||
break;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
m_log.WarnFormat(
|
||||
"[PRIM INVENTORY]: Could not set script state for old key {0}, new key {1} in prim {2} {3}. Exception {4}{5}",
|
||||
oldID, newID, m_part.Name, m_part.UUID, ex.Message, ex.StackTrace);
|
||||
}
|
||||
if (e.SetXMLState(newID, m_part.ParentGroup.m_savedScriptState[oldID]))
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
m_part.ParentGroup.m_savedScriptState.Remove(oldID);
|
||||
}
|
||||
}
|
||||
|
@ -388,21 +359,15 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
/// </param>
|
||||
public void CreateScriptInstance(UUID itemId, int startParam, bool postOnRez, string engine, int stateSource)
|
||||
{
|
||||
lock (m_items)
|
||||
{
|
||||
if (m_items.ContainsKey(itemId))
|
||||
{
|
||||
CreateScriptInstance(m_items[itemId], startParam, postOnRez, engine, stateSource);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_log.ErrorFormat(
|
||||
"[PRIM INVENTORY]: " +
|
||||
"Couldn't start script with ID {0} since it couldn't be found for prim {1}, {2} at {3} in {4}",
|
||||
itemId, m_part.Name, m_part.UUID,
|
||||
m_part.AbsolutePosition, m_part.ParentGroup.Scene.RegionInfo.RegionName);
|
||||
}
|
||||
}
|
||||
TaskInventoryItem item = GetInventoryItem(itemId);
|
||||
if (item != null)
|
||||
CreateScriptInstance(item, startParam, postOnRez, engine, stateSource);
|
||||
else
|
||||
m_log.ErrorFormat(
|
||||
"[PRIM INVENTORY]: " +
|
||||
"Couldn't start script with ID {0} since it couldn't be found for prim {1}, {2} at {3} in {4}",
|
||||
itemId, m_part.Name, m_part.UUID,
|
||||
m_part.AbsolutePosition, m_part.ParentGroup.Scene.RegionInfo.RegionName);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -443,16 +408,18 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
|
||||
/// <summary>
|
||||
/// Check if the inventory holds an item with a given name.
|
||||
/// This method assumes that the task inventory is already locked.
|
||||
/// </summary>
|
||||
/// <param name="name"></param>
|
||||
/// <returns></returns>
|
||||
private bool InventoryContainsName(string name)
|
||||
{
|
||||
foreach (TaskInventoryItem item in Items.Values)
|
||||
lock (m_items)
|
||||
{
|
||||
if (item.Name == name)
|
||||
return true;
|
||||
foreach (TaskInventoryItem item in m_items.Values)
|
||||
{
|
||||
if (item.Name == name)
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -495,12 +462,7 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
/// <param name="item"></param>
|
||||
public void AddInventoryItemExclusive(TaskInventoryItem item, bool allowedDrop)
|
||||
{
|
||||
List<TaskInventoryItem> il;
|
||||
|
||||
lock (m_items)
|
||||
{
|
||||
il = new List<TaskInventoryItem>(m_items.Values);
|
||||
}
|
||||
List<TaskInventoryItem> il = GetInventoryItems();
|
||||
|
||||
foreach (TaskInventoryItem i in il)
|
||||
{
|
||||
|
@ -540,14 +502,12 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
item.GroupID = m_part.GroupID;
|
||||
|
||||
lock (m_items)
|
||||
{
|
||||
m_items.Add(item.ItemID, item);
|
||||
|
||||
if (allowedDrop)
|
||||
m_part.TriggerScriptChangedEvent(Changed.ALLOWED_DROP);
|
||||
else
|
||||
m_part.TriggerScriptChangedEvent(Changed.INVENTORY);
|
||||
}
|
||||
if (allowedDrop)
|
||||
m_part.TriggerScriptChangedEvent(Changed.ALLOWED_DROP);
|
||||
else
|
||||
m_part.TriggerScriptChangedEvent(Changed.INVENTORY);
|
||||
|
||||
m_inventorySerial++;
|
||||
//m_inventorySerial += 2;
|
||||
|
@ -571,9 +531,8 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
m_items.Add(item.ItemID, item);
|
||||
// m_part.TriggerScriptChangedEvent(Changed.INVENTORY);
|
||||
}
|
||||
m_inventorySerial++;
|
||||
}
|
||||
|
||||
m_inventorySerial++;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -628,45 +587,44 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
|
||||
public bool UpdateInventoryItem(TaskInventoryItem item, bool fireScriptEvents)
|
||||
{
|
||||
lock(m_items)
|
||||
TaskInventoryItem it = GetInventoryItem(item.ItemID);
|
||||
if (it != null)
|
||||
{
|
||||
if (m_items.ContainsKey(item.ItemID))
|
||||
item.ParentID = m_part.UUID;
|
||||
item.ParentPartID = m_part.UUID;
|
||||
item.Flags = m_items[item.ItemID].Flags;
|
||||
|
||||
// If group permissions have been set on, check that the groupID is up to date in case it has
|
||||
// changed since permissions were last set.
|
||||
if (item.GroupPermissions != (uint)PermissionMask.None)
|
||||
item.GroupID = m_part.GroupID;
|
||||
|
||||
if (item.AssetID == UUID.Zero)
|
||||
item.AssetID = it.AssetID;
|
||||
|
||||
lock (m_items)
|
||||
{
|
||||
if (m_items.ContainsKey(item.ItemID))
|
||||
{
|
||||
item.ParentID = m_part.UUID;
|
||||
item.ParentPartID = m_part.UUID;
|
||||
item.Flags = m_items[item.ItemID].Flags;
|
||||
|
||||
// If group permissions have been set on, check that the groupID is up to date in case it has
|
||||
// changed since permissions were last set.
|
||||
if (item.GroupPermissions != (uint)PermissionMask.None)
|
||||
item.GroupID = m_part.GroupID;
|
||||
|
||||
if (item.AssetID == UUID.Zero)
|
||||
{
|
||||
item.AssetID = m_items[item.ItemID].AssetID;
|
||||
}
|
||||
m_items[item.ItemID] = item;
|
||||
m_inventorySerial++;
|
||||
if (fireScriptEvents)
|
||||
m_part.TriggerScriptChangedEvent(Changed.INVENTORY);
|
||||
HasInventoryChanged = true;
|
||||
m_part.ParentGroup.HasGroupChanged = true;
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_log.ErrorFormat(
|
||||
"[PRIM INVENTORY]: " +
|
||||
"Tried to retrieve item ID {0} from prim {1}, {2} at {3} in {4} but the item does not exist in this inventory",
|
||||
item.ItemID, m_part.Name, m_part.UUID,
|
||||
m_part.AbsolutePosition, m_part.ParentGroup.Scene.RegionInfo.RegionName);
|
||||
}
|
||||
|
||||
m_items[item.ItemID] = item;
|
||||
m_inventorySerial++;
|
||||
}
|
||||
return false;
|
||||
|
||||
if (fireScriptEvents)
|
||||
m_part.TriggerScriptChangedEvent(Changed.INVENTORY);
|
||||
|
||||
HasInventoryChanged = true;
|
||||
m_part.ParentGroup.HasGroupChanged = true;
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_log.ErrorFormat(
|
||||
"[PRIM INVENTORY]: " +
|
||||
"Tried to retrieve item ID {0} from prim {1}, {2} at {3} in {4} but the item does not exist in this inventory",
|
||||
item.ItemID, m_part.Name, m_part.UUID,
|
||||
m_part.AbsolutePosition, m_part.ParentGroup.Scene.RegionInfo.RegionName);
|
||||
}
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -677,52 +635,37 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
/// in this prim's inventory.</returns>
|
||||
public int RemoveInventoryItem(UUID itemID)
|
||||
{
|
||||
lock (m_items)
|
||||
TaskInventoryItem item = GetInventoryItem(itemID);
|
||||
if (item != null)
|
||||
{
|
||||
if (m_items.ContainsKey(itemID))
|
||||
int type = m_items[itemID].InvType;
|
||||
if (type == 10) // Script
|
||||
{
|
||||
int type = m_items[itemID].InvType;
|
||||
if (type == 10) // Script
|
||||
{
|
||||
m_part.RemoveScriptEvents(itemID);
|
||||
m_part.ParentGroup.Scene.EventManager.TriggerRemoveScript(m_part.LocalId, itemID);
|
||||
}
|
||||
m_items.Remove(itemID);
|
||||
m_inventorySerial++;
|
||||
m_part.TriggerScriptChangedEvent(Changed.INVENTORY);
|
||||
|
||||
HasInventoryChanged = true;
|
||||
m_part.ParentGroup.HasGroupChanged = true;
|
||||
|
||||
int scriptcount = 0;
|
||||
lock (m_items)
|
||||
{
|
||||
foreach (TaskInventoryItem item in m_items.Values)
|
||||
{
|
||||
if (item.Type == 10)
|
||||
{
|
||||
scriptcount++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (scriptcount <= 0)
|
||||
{
|
||||
m_part.RemFlag(PrimFlags.Scripted);
|
||||
}
|
||||
|
||||
m_part.ScheduleFullUpdate();
|
||||
|
||||
return type;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_log.ErrorFormat(
|
||||
"[PRIM INVENTORY]: " +
|
||||
"Tried to remove item ID {0} from prim {1}, {2} at {3} in {4} but the item does not exist in this inventory",
|
||||
itemID, m_part.Name, m_part.UUID,
|
||||
m_part.AbsolutePosition, m_part.ParentGroup.Scene.RegionInfo.RegionName);
|
||||
m_part.RemoveScriptEvents(itemID);
|
||||
m_part.ParentGroup.Scene.EventManager.TriggerRemoveScript(m_part.LocalId, itemID);
|
||||
}
|
||||
m_items.Remove(itemID);
|
||||
m_inventorySerial++;
|
||||
m_part.TriggerScriptChangedEvent(Changed.INVENTORY);
|
||||
|
||||
HasInventoryChanged = true;
|
||||
m_part.ParentGroup.HasGroupChanged = true;
|
||||
|
||||
if (!ContainsScripts())
|
||||
m_part.RemFlag(PrimFlags.Scripted);
|
||||
|
||||
m_part.ScheduleFullUpdate();
|
||||
|
||||
return type;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
m_log.ErrorFormat(
|
||||
"[PRIM INVENTORY]: " +
|
||||
"Tried to remove item ID {0} from prim {1}, {2} at {3} in {4} but the item does not exist in this inventory",
|
||||
itemID, m_part.Name, m_part.UUID,
|
||||
m_part.AbsolutePosition, m_part.ParentGroup.Scene.RegionInfo.RegionName);
|
||||
}
|
||||
|
||||
return -1;
|
||||
|
@ -776,52 +719,50 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
// isn't available (such as drag from prim inventory to agent inventory)
|
||||
InventoryStringBuilder invString = new InventoryStringBuilder(m_part.UUID, UUID.Zero);
|
||||
|
||||
lock (m_items)
|
||||
List<TaskInventoryItem> items = GetInventoryItems();
|
||||
foreach (TaskInventoryItem item in items)
|
||||
{
|
||||
foreach (TaskInventoryItem item in m_items.Values)
|
||||
{
|
||||
UUID ownerID = item.OwnerID;
|
||||
uint everyoneMask = 0;
|
||||
uint baseMask = item.BasePermissions;
|
||||
uint ownerMask = item.CurrentPermissions;
|
||||
uint groupMask = item.GroupPermissions;
|
||||
UUID ownerID = item.OwnerID;
|
||||
uint everyoneMask = 0;
|
||||
uint baseMask = item.BasePermissions;
|
||||
uint ownerMask = item.CurrentPermissions;
|
||||
uint groupMask = item.GroupPermissions;
|
||||
|
||||
invString.AddItemStart();
|
||||
invString.AddNameValueLine("item_id", item.ItemID.ToString());
|
||||
invString.AddNameValueLine("parent_id", m_part.UUID.ToString());
|
||||
invString.AddItemStart();
|
||||
invString.AddNameValueLine("item_id", item.ItemID.ToString());
|
||||
invString.AddNameValueLine("parent_id", m_part.UUID.ToString());
|
||||
|
||||
invString.AddPermissionsStart();
|
||||
invString.AddPermissionsStart();
|
||||
|
||||
invString.AddNameValueLine("base_mask", Utils.UIntToHexString(baseMask));
|
||||
invString.AddNameValueLine("owner_mask", Utils.UIntToHexString(ownerMask));
|
||||
invString.AddNameValueLine("group_mask", Utils.UIntToHexString(groupMask));
|
||||
invString.AddNameValueLine("everyone_mask", Utils.UIntToHexString(everyoneMask));
|
||||
invString.AddNameValueLine("next_owner_mask", Utils.UIntToHexString(item.NextPermissions));
|
||||
invString.AddNameValueLine("base_mask", Utils.UIntToHexString(baseMask));
|
||||
invString.AddNameValueLine("owner_mask", Utils.UIntToHexString(ownerMask));
|
||||
invString.AddNameValueLine("group_mask", Utils.UIntToHexString(groupMask));
|
||||
invString.AddNameValueLine("everyone_mask", Utils.UIntToHexString(everyoneMask));
|
||||
invString.AddNameValueLine("next_owner_mask", Utils.UIntToHexString(item.NextPermissions));
|
||||
|
||||
invString.AddNameValueLine("creator_id", item.CreatorID.ToString());
|
||||
invString.AddNameValueLine("owner_id", ownerID.ToString());
|
||||
invString.AddNameValueLine("creator_id", item.CreatorID.ToString());
|
||||
invString.AddNameValueLine("owner_id", ownerID.ToString());
|
||||
|
||||
invString.AddNameValueLine("last_owner_id", item.LastOwnerID.ToString());
|
||||
invString.AddNameValueLine("last_owner_id", item.LastOwnerID.ToString());
|
||||
|
||||
invString.AddNameValueLine("group_id", item.GroupID.ToString());
|
||||
invString.AddSectionEnd();
|
||||
invString.AddNameValueLine("group_id", item.GroupID.ToString());
|
||||
invString.AddSectionEnd();
|
||||
|
||||
invString.AddNameValueLine("asset_id", item.AssetID.ToString());
|
||||
invString.AddNameValueLine("type", TaskInventoryItem.Types[item.Type]);
|
||||
invString.AddNameValueLine("inv_type", TaskInventoryItem.InvTypes[item.InvType]);
|
||||
invString.AddNameValueLine("flags", Utils.UIntToHexString(item.Flags));
|
||||
invString.AddNameValueLine("asset_id", item.AssetID.ToString());
|
||||
invString.AddNameValueLine("type", TaskInventoryItem.Types[item.Type]);
|
||||
invString.AddNameValueLine("inv_type", TaskInventoryItem.InvTypes[item.InvType]);
|
||||
invString.AddNameValueLine("flags", Utils.UIntToHexString(item.Flags));
|
||||
|
||||
invString.AddSaleStart();
|
||||
invString.AddNameValueLine("sale_type", "not");
|
||||
invString.AddNameValueLine("sale_price", "0");
|
||||
invString.AddSectionEnd();
|
||||
invString.AddSaleStart();
|
||||
invString.AddNameValueLine("sale_type", "not");
|
||||
invString.AddNameValueLine("sale_price", "0");
|
||||
invString.AddSectionEnd();
|
||||
|
||||
invString.AddNameValueLine("name", item.Name + "|");
|
||||
invString.AddNameValueLine("desc", item.Description + "|");
|
||||
invString.AddNameValueLine("name", item.Name + "|");
|
||||
invString.AddNameValueLine("desc", item.Description + "|");
|
||||
|
||||
invString.AddNameValueLine("creation_date", item.CreationDate.ToString());
|
||||
invString.AddSectionEnd();
|
||||
}
|
||||
invString.AddNameValueLine("creation_date", item.CreationDate.ToString());
|
||||
invString.AddSectionEnd();
|
||||
}
|
||||
|
||||
fileData = Utils.StringToBytes(invString.BuildString);
|
||||
|
@ -843,12 +784,10 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
{
|
||||
if (HasInventoryChanged)
|
||||
{
|
||||
lock (Items)
|
||||
{
|
||||
datastore.StorePrimInventory(m_part.UUID, Items.Values);
|
||||
}
|
||||
|
||||
HasInventoryChanged = false;
|
||||
List<TaskInventoryItem> items = GetInventoryItems();
|
||||
datastore.StorePrimInventory(m_part.UUID, items);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1014,6 +953,30 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
|
||||
return ret;
|
||||
}
|
||||
|
||||
public List<TaskInventoryItem> GetInventoryItems()
|
||||
{
|
||||
List<TaskInventoryItem> ret = new List<TaskInventoryItem>();
|
||||
|
||||
lock (m_items)
|
||||
ret = new List<TaskInventoryItem>(m_items.Values);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
public List<TaskInventoryItem> GetInventoryScripts()
|
||||
{
|
||||
List<TaskInventoryItem> ret = new List<TaskInventoryItem>();
|
||||
|
||||
lock (m_items)
|
||||
{
|
||||
foreach (TaskInventoryItem item in m_items.Values)
|
||||
if (item.InvType == (int)InventoryType.LSL)
|
||||
ret.Add(item);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
public Dictionary<UUID, string> GetScriptStates()
|
||||
{
|
||||
|
@ -1023,35 +986,20 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
if (engines == null) // No engine at all
|
||||
return ret;
|
||||
|
||||
lock (m_items)
|
||||
List<TaskInventoryItem> scripts = GetInventoryScripts();
|
||||
|
||||
foreach (TaskInventoryItem item in scripts)
|
||||
{
|
||||
foreach (TaskInventoryItem item in m_items.Values)
|
||||
foreach (IScriptModule e in engines)
|
||||
{
|
||||
if (item.InvType == (int)InventoryType.LSL)
|
||||
if (e != null)
|
||||
{
|
||||
foreach (IScriptModule e in engines)
|
||||
string n = e.GetXMLState(item.ItemID);
|
||||
if (n != String.Empty)
|
||||
{
|
||||
if (e != null)
|
||||
{
|
||||
// Stop any exception from the script engine from propogating since setting state
|
||||
// isn't essential.
|
||||
try
|
||||
{
|
||||
string n = e.GetXMLState(item.ItemID);
|
||||
if (n != String.Empty)
|
||||
{
|
||||
if (!ret.ContainsKey(item.ItemID))
|
||||
ret[item.ItemID] = n;
|
||||
break;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
m_log.WarnFormat(
|
||||
"[PRIM INVENTORY]: Could not retrieve script state for item {0} {1} in prim {2} {3}. Exception {4}{5}",
|
||||
item.Name, item.ItemID, m_part.Name, m_part.UUID, ex.Message, ex.StackTrace);
|
||||
}
|
||||
}
|
||||
if (!ret.ContainsKey(item.ItemID))
|
||||
ret[item.ItemID] = n;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1066,25 +1014,22 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
if (engines == null)
|
||||
return;
|
||||
|
||||
lock (m_items)
|
||||
List<TaskInventoryItem> scripts = GetInventoryScripts();
|
||||
|
||||
foreach (TaskInventoryItem item in scripts)
|
||||
{
|
||||
foreach (TaskInventoryItem item in m_items.Values)
|
||||
foreach (IScriptModule engine in engines)
|
||||
{
|
||||
if (item.InvType == (int)InventoryType.LSL)
|
||||
if (engine != null)
|
||||
{
|
||||
foreach (IScriptModule engine in engines)
|
||||
{
|
||||
if (engine != null)
|
||||
{
|
||||
if (item.OwnerChanged)
|
||||
engine.PostScriptEvent(item.ItemID, "changed", new Object[] { (int)Changed.OWNER });
|
||||
item.OwnerChanged = false;
|
||||
engine.ResumeScript(item.ItemID);
|
||||
}
|
||||
}
|
||||
if (item.OwnerChanged)
|
||||
engine.PostScriptEvent(item.ItemID, "changed", new Object[] { (int)Changed.OWNER });
|
||||
item.OwnerChanged = false;
|
||||
engine.ResumeScript(item.ItemID);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -451,12 +451,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
public LSL_Vector llVecNorm(LSL_Vector v)
|
||||
{
|
||||
m_host.AddScriptLPS(1);
|
||||
double mag = LSL_Vector.Mag(v);
|
||||
LSL_Vector nor = new LSL_Vector();
|
||||
nor.x = v.x / mag;
|
||||
nor.y = v.y / mag;
|
||||
nor.z = v.z / mag;
|
||||
return nor;
|
||||
return LSL_Vector.Norm(v);
|
||||
}
|
||||
|
||||
public LSL_Float llVecDist(LSL_Vector a, LSL_Vector b)
|
||||
|
@ -470,22 +465,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
|
||||
//Now we start getting into quaternions which means sin/cos, matrices and vectors. ckrinke
|
||||
|
||||
// Utility function for llRot2Euler
|
||||
|
||||
// normalize an angle between -PI and PI (-180 to +180 degrees)
|
||||
protected double NormalizeAngle(double angle)
|
||||
{
|
||||
if (angle > -Math.PI && angle < Math.PI)
|
||||
return angle;
|
||||
|
||||
int numPis = (int)(Math.PI / angle);
|
||||
double remainder = angle - Math.PI * numPis;
|
||||
if (numPis % 2 == 1)
|
||||
return Math.PI - angle;
|
||||
return remainder;
|
||||
}
|
||||
|
||||
// Old implementation of llRot2Euler, now normalized
|
||||
// Old implementation of llRot2Euler. Normalization not required as Atan2 function will
|
||||
// only return values >= -PI (-180 degrees) and <= PI (180 degrees).
|
||||
|
||||
public LSL_Vector llRot2Euler(LSL_Rotation r)
|
||||
{
|
||||
|
@ -497,13 +478,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
double n = 2 * (r.y * r.s + r.x * r.z);
|
||||
double p = m * m - n * n;
|
||||
if (p > 0)
|
||||
return new LSL_Vector(NormalizeAngle(Math.Atan2(2.0 * (r.x * r.s - r.y * r.z), (-t.x - t.y + t.z + t.s))),
|
||||
NormalizeAngle(Math.Atan2(n, Math.Sqrt(p))),
|
||||
NormalizeAngle(Math.Atan2(2.0 * (r.z * r.s - r.x * r.y), (t.x - t.y - t.z + t.s))));
|
||||
return new LSL_Vector(Math.Atan2(2.0 * (r.x * r.s - r.y * r.z), (-t.x - t.y + t.z + t.s)),
|
||||
Math.Atan2(n, Math.Sqrt(p)),
|
||||
Math.Atan2(2.0 * (r.z * r.s - r.x * r.y), (t.x - t.y - t.z + t.s)));
|
||||
else if (n > 0)
|
||||
return new LSL_Vector(0.0, Math.PI * 0.5, NormalizeAngle(Math.Atan2((r.z * r.s + r.x * r.y), 0.5 - t.x - t.z)));
|
||||
return new LSL_Vector(0.0, Math.PI * 0.5, Math.Atan2((r.z * r.s + r.x * r.y), 0.5 - t.x - t.z));
|
||||
else
|
||||
return new LSL_Vector(0.0, -Math.PI * 0.5, NormalizeAngle(Math.Atan2((r.z * r.s + r.x * r.y), 0.5 - t.x - t.z)));
|
||||
return new LSL_Vector(0.0, -Math.PI * 0.5, Math.Atan2((r.z * r.s + r.x * r.y), 0.5 - t.x - t.z));
|
||||
}
|
||||
|
||||
/* From wiki:
|
||||
|
@ -4950,7 +4931,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
case ',':
|
||||
if (parens == 0)
|
||||
{
|
||||
result.Add(src.Substring(start,length).Trim());
|
||||
result.Add(new LSL_String(src.Substring(start,length).Trim()));
|
||||
start += length+1;
|
||||
length = 0;
|
||||
}
|
||||
|
@ -5879,6 +5860,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
PSYS_PART_MAX_AGE = 7,
|
||||
PSYS_SRC_ACCEL = 8,
|
||||
PSYS_SRC_PATTERN = 9,
|
||||
PSYS_SRC_INNERANGLE = 10,
|
||||
PSYS_SRC_OUTERANGLE = 11,
|
||||
PSYS_SRC_TEXTURE = 12,
|
||||
PSYS_SRC_BURST_RATE = 13,
|
||||
PSYS_SRC_BURST_PART_COUNT = 15,
|
||||
|
@ -6011,6 +5994,22 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
prules.Pattern = (Primitive.ParticleSystem.SourcePattern)tmpi;
|
||||
break;
|
||||
|
||||
// PSYS_SRC_INNERANGLE and PSYS_SRC_ANGLE_BEGIN use the same variables. The
|
||||
// PSYS_SRC_OUTERANGLE and PSYS_SRC_ANGLE_END also use the same variable. The
|
||||
// client tells the difference between the two by looking at the 0x02 bit in
|
||||
// the PartFlags variable.
|
||||
case (int)ScriptBaseClass.PSYS_SRC_INNERANGLE:
|
||||
tempf = (float)rules.GetLSLFloatItem(i + 1);
|
||||
prules.InnerAngle = (float)tempf;
|
||||
prules.PartFlags &= 0xFFFFFFFD; // Make sure new angle format is off.
|
||||
break;
|
||||
|
||||
case (int)ScriptBaseClass.PSYS_SRC_OUTERANGLE:
|
||||
tempf = (float)rules.GetLSLFloatItem(i + 1);
|
||||
prules.OuterAngle = (float)tempf;
|
||||
prules.PartFlags &= 0xFFFFFFFD; // Make sure new angle format is off.
|
||||
break;
|
||||
|
||||
case (int)ScriptBaseClass.PSYS_SRC_TEXTURE:
|
||||
prules.Texture = KeyOrName(rules.GetLSLStringItem(i + 1));
|
||||
break;
|
||||
|
@ -6067,11 +6066,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
case (int)ScriptBaseClass.PSYS_SRC_ANGLE_BEGIN:
|
||||
tempf = (float)rules.GetLSLFloatItem(i + 1);
|
||||
prules.InnerAngle = (float)tempf;
|
||||
prules.PartFlags |= 0x02; // Set new angle format.
|
||||
break;
|
||||
|
||||
case (int)ScriptBaseClass.PSYS_SRC_ANGLE_END:
|
||||
tempf = (float)rules.GetLSLFloatItem(i + 1);
|
||||
prules.OuterAngle = (float)tempf;
|
||||
prules.PartFlags |= 0x02; // Set new angle format.
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -262,7 +262,12 @@ namespace OpenSim.Region.ScriptEngine.Shared
|
|||
public static Vector3 Norm(Vector3 vector)
|
||||
{
|
||||
double mag = Mag(vector);
|
||||
return new Vector3(vector.x / mag, vector.y / mag, vector.z / mag);
|
||||
if (mag > 0.0)
|
||||
{
|
||||
double invMag = 1.0 / mag;
|
||||
return vector * invMag;
|
||||
}
|
||||
return new Vector3(0, 0, 0);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
@ -663,13 +668,13 @@ namespace OpenSim.Region.ScriptEngine.Shared
|
|||
Object[] ret;
|
||||
|
||||
if (start < 0)
|
||||
start=m_data.Length-start;
|
||||
start=m_data.Length+start;
|
||||
|
||||
if (start < 0)
|
||||
start=0;
|
||||
|
||||
if (end < 0)
|
||||
end=m_data.Length-end;
|
||||
end=m_data.Length+end;
|
||||
if (end < 0)
|
||||
end=0;
|
||||
|
||||
|
|
|
@ -488,6 +488,11 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
|||
|
||||
if (stateSource == (int)StateSource.ScriptedRez)
|
||||
{
|
||||
lock (m_CompileDict)
|
||||
{
|
||||
m_CompileDict[itemID] = 0;
|
||||
}
|
||||
|
||||
DoOnRezScript(parms);
|
||||
}
|
||||
else
|
||||
|
@ -696,9 +701,9 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
|||
}
|
||||
}
|
||||
|
||||
ScriptInstance instance = null;
|
||||
lock (m_Scripts)
|
||||
{
|
||||
ScriptInstance instance = null;
|
||||
// Create the object record
|
||||
|
||||
if ((!m_Scripts.ContainsKey(itemID)) ||
|
||||
|
@ -779,28 +784,29 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
|||
|
||||
m_Scripts[itemID] = instance;
|
||||
}
|
||||
|
||||
lock (m_PrimObjects)
|
||||
{
|
||||
if (!m_PrimObjects.ContainsKey(localID))
|
||||
m_PrimObjects[localID] = new List<UUID>();
|
||||
|
||||
if (!m_PrimObjects[localID].Contains(itemID))
|
||||
m_PrimObjects[localID].Add(itemID);
|
||||
|
||||
}
|
||||
|
||||
if (!m_Assemblies.ContainsKey(assetID))
|
||||
m_Assemblies[assetID] = assembly;
|
||||
|
||||
lock (m_AddingAssemblies)
|
||||
{
|
||||
m_AddingAssemblies[assembly]--;
|
||||
}
|
||||
|
||||
if (instance!=null)
|
||||
instance.Init();
|
||||
}
|
||||
|
||||
lock (m_PrimObjects)
|
||||
{
|
||||
if (!m_PrimObjects.ContainsKey(localID))
|
||||
m_PrimObjects[localID] = new List<UUID>();
|
||||
|
||||
if (!m_PrimObjects[localID].Contains(itemID))
|
||||
m_PrimObjects[localID].Add(itemID);
|
||||
|
||||
}
|
||||
|
||||
if (!m_Assemblies.ContainsKey(assetID))
|
||||
m_Assemblies[assetID] = assembly;
|
||||
|
||||
lock (m_AddingAssemblies)
|
||||
{
|
||||
m_AddingAssemblies[assembly]--;
|
||||
}
|
||||
|
||||
if (instance != null)
|
||||
instance.Init();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -813,60 +819,60 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
|||
m_CompileDict.Remove(itemID);
|
||||
}
|
||||
|
||||
IScriptInstance instance = null;
|
||||
|
||||
lock (m_Scripts)
|
||||
{
|
||||
// Do we even have it?
|
||||
if (!m_Scripts.ContainsKey(itemID))
|
||||
return;
|
||||
|
||||
IScriptInstance instance=m_Scripts[itemID];
|
||||
instance=m_Scripts[itemID];
|
||||
m_Scripts.Remove(itemID);
|
||||
}
|
||||
|
||||
instance.ClearQueue();
|
||||
instance.Stop(0);
|
||||
|
||||
instance.ClearQueue();
|
||||
instance.Stop(0);
|
||||
// bool objectRemoved = false;
|
||||
|
||||
lock (m_PrimObjects)
|
||||
lock (m_PrimObjects)
|
||||
{
|
||||
// Remove the script from it's prim
|
||||
if (m_PrimObjects.ContainsKey(localID))
|
||||
{
|
||||
// Remove the script from it's prim
|
||||
if (m_PrimObjects.ContainsKey(localID))
|
||||
{
|
||||
// Remove inventory item record
|
||||
if (m_PrimObjects[localID].Contains(itemID))
|
||||
m_PrimObjects[localID].Remove(itemID);
|
||||
// Remove inventory item record
|
||||
if (m_PrimObjects[localID].Contains(itemID))
|
||||
m_PrimObjects[localID].Remove(itemID);
|
||||
|
||||
// If there are no more scripts, remove prim
|
||||
if (m_PrimObjects[localID].Count == 0)
|
||||
{
|
||||
m_PrimObjects.Remove(localID);
|
||||
// If there are no more scripts, remove prim
|
||||
if (m_PrimObjects[localID].Count == 0)
|
||||
{
|
||||
m_PrimObjects.Remove(localID);
|
||||
// objectRemoved = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
instance.RemoveState();
|
||||
instance.DestroyScriptInstance();
|
||||
|
||||
m_DomainScripts[instance.AppDomain].Remove(instance.ItemID);
|
||||
if (m_DomainScripts[instance.AppDomain].Count == 0)
|
||||
{
|
||||
m_DomainScripts.Remove(instance.AppDomain);
|
||||
UnloadAppDomain(instance.AppDomain);
|
||||
}
|
||||
|
||||
instance = null;
|
||||
|
||||
ObjectRemoved handlerObjectRemoved = OnObjectRemoved;
|
||||
if (handlerObjectRemoved != null)
|
||||
{
|
||||
SceneObjectPart part = m_Scene.GetSceneObjectPart(localID);
|
||||
handlerObjectRemoved(part.UUID);
|
||||
}
|
||||
|
||||
CleanAssemblies();
|
||||
}
|
||||
|
||||
instance.RemoveState();
|
||||
instance.DestroyScriptInstance();
|
||||
|
||||
m_DomainScripts[instance.AppDomain].Remove(instance.ItemID);
|
||||
if (m_DomainScripts[instance.AppDomain].Count == 0)
|
||||
{
|
||||
m_DomainScripts.Remove(instance.AppDomain);
|
||||
UnloadAppDomain(instance.AppDomain);
|
||||
}
|
||||
|
||||
instance = null;
|
||||
|
||||
ObjectRemoved handlerObjectRemoved = OnObjectRemoved;
|
||||
if (handlerObjectRemoved != null)
|
||||
{
|
||||
SceneObjectPart part = m_Scene.GetSceneObjectPart(localID);
|
||||
handlerObjectRemoved(part.UUID);
|
||||
}
|
||||
|
||||
|
||||
ScriptRemoved handlerScriptRemoved = OnScriptRemoved;
|
||||
if (handlerScriptRemoved != null)
|
||||
handlerScriptRemoved(itemID);
|
||||
|
@ -1000,26 +1006,33 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
|||
public bool PostObjectEvent(uint localID, EventParams p)
|
||||
{
|
||||
bool result = false;
|
||||
|
||||
List<UUID> uuids = null;
|
||||
|
||||
lock (m_PrimObjects)
|
||||
{
|
||||
if (!m_PrimObjects.ContainsKey(localID))
|
||||
return false;
|
||||
|
||||
|
||||
foreach (UUID itemID in m_PrimObjects[localID])
|
||||
uuids = m_PrimObjects[localID];
|
||||
}
|
||||
|
||||
foreach (UUID itemID in uuids)
|
||||
{
|
||||
IScriptInstance instance = null;
|
||||
try
|
||||
{
|
||||
if (m_Scripts.ContainsKey(itemID))
|
||||
{
|
||||
IScriptInstance instance = m_Scripts[itemID];
|
||||
if (instance != null)
|
||||
{
|
||||
instance.PostEvent(p);
|
||||
result = true;
|
||||
}
|
||||
}
|
||||
instance = m_Scripts[itemID];
|
||||
}
|
||||
catch { /* ignore race conditions */ }
|
||||
|
||||
if (instance != null)
|
||||
{
|
||||
instance.PostEvent(p);
|
||||
result = true;
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -1274,9 +1287,23 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
|||
string xml = instance.GetXMLState();
|
||||
|
||||
XmlDocument sdoc = new XmlDocument();
|
||||
sdoc.LoadXml(xml);
|
||||
XmlNodeList rootL = sdoc.GetElementsByTagName("ScriptState");
|
||||
XmlNode rootNode = rootL[0];
|
||||
bool loadedState = true;
|
||||
try
|
||||
{
|
||||
sdoc.LoadXml(xml);
|
||||
}
|
||||
catch (System.Xml.XmlException e)
|
||||
{
|
||||
loadedState = false;
|
||||
}
|
||||
|
||||
XmlNodeList rootL = null;
|
||||
XmlNode rootNode = null;
|
||||
if (loadedState)
|
||||
{
|
||||
rootL = sdoc.GetElementsByTagName("ScriptState");
|
||||
rootNode = rootL[0];
|
||||
}
|
||||
|
||||
// Create <State UUID="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx">
|
||||
XmlDocument doc = new XmlDocument();
|
||||
|
@ -1292,8 +1319,18 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
|||
stateData.Attributes.Append(engineName);
|
||||
doc.AppendChild(stateData);
|
||||
|
||||
XmlNode xmlstate = null;
|
||||
|
||||
// Add <ScriptState>...</ScriptState>
|
||||
XmlNode xmlstate = doc.ImportNode(rootNode, true);
|
||||
if (loadedState)
|
||||
{
|
||||
xmlstate = doc.ImportNode(rootNode, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
xmlstate = doc.CreateElement("", "ScriptState", "");
|
||||
}
|
||||
|
||||
stateData.AppendChild(xmlstate);
|
||||
|
||||
string assemName = instance.GetAssemblyName();
|
||||
|
|
|
@ -283,6 +283,10 @@ namespace OpenSim.Server.Handlers.Simulation
|
|||
if (m_SimulationService == null)
|
||||
{
|
||||
m_log.Debug("[AGENT HANDLER]: Agent GET called. Harmless but useless.");
|
||||
responsedata["content_type"] = "application/json";
|
||||
responsedata["int_response_code"] = HttpStatusCode.NotImplemented;
|
||||
responsedata["str_response_string"] = string.Empty;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -88,7 +88,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
|
|||
|
||||
public void Initialise(IConfigSource source)
|
||||
{
|
||||
if (Simian.IsSimianEnabled(source, "UserAccountServices", this.Name))
|
||||
if (Simian.IsSimianEnabled(source, "UserAccountServices", "SimianUserAccountServiceConnector"))
|
||||
{
|
||||
IConfig gridConfig = source.Configs["UserAccountService"];
|
||||
if (gridConfig == null)
|
||||
|
@ -108,6 +108,23 @@ namespace OpenSim.Services.Connectors.SimianGrid
|
|||
serviceUrl = serviceUrl + '/';
|
||||
|
||||
m_serverUrl = serviceUrl;
|
||||
IConfig profilesConfig = source.Configs["Profiles"];
|
||||
if (profilesConfig == null)
|
||||
{
|
||||
// Do not run this module by default.
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
// if profiles aren't enabled, we're not needed.
|
||||
// if we're not specified as the connector to use, then we're not wanted
|
||||
if (profilesConfig.GetString("Module", String.Empty) != Name)
|
||||
{
|
||||
|
||||
return;
|
||||
}
|
||||
m_log.InfoFormat("[SIMIAN ACCOUNT CONNECTOR]: Initializing {0}", this.Name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -135,6 +152,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
|
|||
|
||||
// Profiles
|
||||
client.OnRequestAvatarProperties += RequestAvatarPropertiesHandler;
|
||||
|
||||
client.OnUpdateAvatarProperties += UpdateAvatarPropertiesHandler;
|
||||
client.OnAvatarInterestUpdate += AvatarInterestUpdateHandler;
|
||||
client.OnUserInfoRequest += UserInfoRequestHandler;
|
||||
|
@ -302,12 +320,25 @@ namespace OpenSim.Services.Connectors.SimianGrid
|
|||
System.Globalization.CultureInfo.InvariantCulture), charterMember, about["FLAbout"].AsString(), (uint)flags,
|
||||
about["FLImage"].AsUUID(), about["Image"].AsUUID(), about["URL"].AsString(), user["Partner"].AsUUID());
|
||||
|
||||
OSDMap interests = null;
|
||||
if (user.ContainsKey("LLInterests"))
|
||||
{
|
||||
try
|
||||
{
|
||||
interests = OSDParser.DeserializeJson(user["LLInterests"].AsString()) as OSDMap;
|
||||
client.SendAvatarInterestsReply(avatarID, interests["WantMask"].AsUInteger(), interests["WantText"].AsString(), interests["SkillsMask"].AsUInteger(), interests["SkillsText"].AsString(), interests["languages"].AsString());
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
|
||||
if (about == null)
|
||||
about = new OSDMap(0);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_log.Warn("[SIMIAN PROFILES]: Failed to fetch profile information for " + client.Name + ", returning default values");
|
||||
client.SendAvatarProperties(avatarID, String.Empty, "1/1/1970", Utils.EmptyBytes,
|
||||
String.Empty, (uint)flags, UUID.Zero, UUID.Zero, String.Empty, UUID.Zero);
|
||||
String.Empty, (uint)flags, UUID.Zero, UUID.Zero, String.Empty, UUID.Zero);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -278,7 +278,11 @@ namespace OpenSim.Services.GridService
|
|||
|
||||
foreach (RegionData rdata in rdatas)
|
||||
if (rdata.RegionID != regionID)
|
||||
rinfos.Add(RegionData2RegionInfo(rdata));
|
||||
{
|
||||
int flags = Convert.ToInt32(rdata.Data["flags"]);
|
||||
if ((flags & (int)Data.RegionFlags.Hyperlink) == 0) // no hyperlinks as neighbours
|
||||
rinfos.Add(RegionData2RegionInfo(rdata));
|
||||
}
|
||||
|
||||
}
|
||||
m_log.DebugFormat("[GRID SERVICE]: region {0} has {1} neighours", region.RegionName, rinfos.Count);
|
||||
|
|
|
@ -259,13 +259,15 @@ namespace OpenSim.Services.InventoryService
|
|||
|
||||
public virtual List<InventoryItemBase> GetFolderItems(UUID principalID, UUID folderID)
|
||||
{
|
||||
// m_log.DebugFormat("[XINVENTORY]: Fetch items for folder {0}", folderID);
|
||||
|
||||
// Since we probably don't get a valid principal here, either ...
|
||||
//
|
||||
List<InventoryItemBase> invItems = new List<InventoryItemBase>();
|
||||
|
||||
XInventoryItem[] items = m_Database.GetItems(
|
||||
new string[] { "parentFolderID"},
|
||||
new string[] { UUID.Zero.ToString() });
|
||||
new string[] { "parentFolderID" },
|
||||
new string[] { folderID.ToString() });
|
||||
|
||||
foreach (XInventoryItem i in items)
|
||||
invItems.Add(ConvertToOpenSim(i));
|
||||
|
|
|
@ -170,6 +170,9 @@ namespace OpenSim.Services.LLLoginService
|
|||
private string firstname;
|
||||
private string lastname;
|
||||
|
||||
// Web map
|
||||
private string mapTileURL;
|
||||
|
||||
// Error Flags
|
||||
private string errorReason;
|
||||
private string errorMessage;
|
||||
|
@ -218,7 +221,7 @@ namespace OpenSim.Services.LLLoginService
|
|||
public LLLoginResponse(UserAccount account, AgentCircuitData aCircuit, GridUserInfo pinfo,
|
||||
GridRegion destination, List<InventoryFolderBase> invSkel, FriendInfo[] friendsList, ILibraryService libService,
|
||||
string where, string startlocation, Vector3 position, Vector3 lookAt, List<InventoryItemBase> gestures, string message,
|
||||
GridRegion home, IPEndPoint clientIP)
|
||||
GridRegion home, IPEndPoint clientIP, string mapTileURL)
|
||||
: this()
|
||||
{
|
||||
FillOutInventoryData(invSkel, libService);
|
||||
|
@ -234,6 +237,7 @@ namespace OpenSim.Services.LLLoginService
|
|||
Message = message;
|
||||
BuddList = ConvertFriendListItem(friendsList);
|
||||
StartLocation = where;
|
||||
MapTileURL = mapTileURL;
|
||||
|
||||
FillOutHomeData(pinfo, home);
|
||||
LookAt = String.Format("[r{0},r{1},r{2}]", lookAt.X, lookAt.Y, lookAt.Z);
|
||||
|
@ -405,6 +409,7 @@ namespace OpenSim.Services.LLLoginService
|
|||
InitialOutfitHash["folder_name"] = "Nightclub Female";
|
||||
InitialOutfitHash["gender"] = "female";
|
||||
initialOutfit.Add(InitialOutfitHash);
|
||||
mapTileURL = String.Empty;
|
||||
}
|
||||
|
||||
|
||||
|
@ -468,6 +473,9 @@ namespace OpenSim.Services.LLLoginService
|
|||
responseData["region_x"] = (Int32)(RegionX);
|
||||
responseData["region_y"] = (Int32)(RegionY);
|
||||
|
||||
if (mapTileURL != String.Empty)
|
||||
responseData["map-server-url"] = mapTileURL;
|
||||
|
||||
if (m_buddyList != null)
|
||||
{
|
||||
responseData["buddy-list"] = m_buddyList.ToArray();
|
||||
|
@ -564,6 +572,9 @@ namespace OpenSim.Services.LLLoginService
|
|||
map["region_x"] = OSD.FromInteger(RegionX);
|
||||
map["region_y"] = OSD.FromInteger(RegionY);
|
||||
|
||||
if (mapTileURL != String.Empty)
|
||||
map["map-server-url"] = OSD.FromString(mapTileURL);
|
||||
|
||||
if (m_buddyList != null)
|
||||
{
|
||||
map["buddy-list"] = ArrayListToOSDArray(m_buddyList.ToArray());
|
||||
|
@ -647,7 +658,7 @@ namespace OpenSim.Services.LLLoginService
|
|||
Hashtable TempHash;
|
||||
foreach (InventoryFolderBase InvFolder in folders)
|
||||
{
|
||||
if (InvFolder.ParentID == UUID.Zero)
|
||||
if (InvFolder.ParentID == UUID.Zero && InvFolder.Name == "My Inventory")
|
||||
{
|
||||
rootID = InvFolder.ID;
|
||||
}
|
||||
|
@ -915,6 +926,12 @@ namespace OpenSim.Services.LLLoginService
|
|||
set { home = value; }
|
||||
}
|
||||
|
||||
public string MapTileURL
|
||||
{
|
||||
get { return mapTileURL; }
|
||||
set { mapTileURL = value; }
|
||||
}
|
||||
|
||||
public string Message
|
||||
{
|
||||
get { return welcomeMessage; }
|
||||
|
|
|
@ -73,6 +73,7 @@ namespace OpenSim.Services.LLLoginService
|
|||
protected int m_MinLoginLevel;
|
||||
protected string m_GatekeeperURL;
|
||||
protected bool m_AllowRemoteSetLoginLevel;
|
||||
protected string m_MapTileURL;
|
||||
|
||||
IConfig m_LoginServerConfig;
|
||||
|
||||
|
@ -100,6 +101,7 @@ namespace OpenSim.Services.LLLoginService
|
|||
m_AllowRemoteSetLoginLevel = m_LoginServerConfig.GetBoolean("AllowRemoteSetLoginLevel", false);
|
||||
m_MinLoginLevel = m_LoginServerConfig.GetInt("MinLoginLevel", 0);
|
||||
m_GatekeeperURL = m_LoginServerConfig.GetString("GatekeeperURI", string.Empty);
|
||||
m_MapTileURL = m_LoginServerConfig.GetString("MapTileURL", string.Empty);
|
||||
|
||||
// These are required; the others aren't
|
||||
if (accountService == string.Empty || authService == string.Empty)
|
||||
|
@ -356,7 +358,7 @@ namespace OpenSim.Services.LLLoginService
|
|||
// Finally, fill out the response and return it
|
||||
//
|
||||
LLLoginResponse response = new LLLoginResponse(account, aCircuit, guinfo, destination, inventorySkel, friendsList, m_LibraryService,
|
||||
where, startLocation, position, lookAt, gestures, m_WelcomeMessage, home, clientIP);
|
||||
where, startLocation, position, lookAt, gestures, m_WelcomeMessage, home, clientIP, m_MapTileURL);
|
||||
|
||||
m_log.DebugFormat("[LLOGIN SERVICE]: All clear. Sending login response to client.");
|
||||
return response;
|
||||
|
|
Binary file not shown.
|
@ -128,7 +128,7 @@
|
|||
; -->>> There are multiple connection strings defined in several places. Check it carefully!
|
||||
;
|
||||
; storage_plugin="OpenSim.Data.MySQL.dll"
|
||||
; storage_connection_string="Data Source=localhost;Database=opensim;User ID=opensim;Password=*****;Old Guids=true;";
|
||||
; storage_connection_string="Data Source=localhost;Database=opensim;User ID=opensim;Password=*****;"
|
||||
; If you want to use a different database/server for estate data, then
|
||||
; uncomment and change this connect string. Defaults to the above if not set
|
||||
; estate_connection_string="Data Source=localhost;Database=opensim;User ID=opensim;Password=*****;";
|
||||
|
@ -288,9 +288,6 @@
|
|||
; if not defined - default machine name is being used
|
||||
; (on Windows this mean NETBIOS name - useably only inside local network)
|
||||
; ExternalHostNameForLSL=127.0.0.1
|
||||
; Uncomment below to enable llRemoteData/remote channels
|
||||
; remoteDataPort = 20800
|
||||
|
||||
|
||||
; What is reported as the "X-Secondlife-Shard"
|
||||
; Defaults to the user server url if not set
|
||||
|
@ -1303,12 +1300,3 @@
|
|||
;XmlRpcRouterModule = "XmlRpcRouterModule"
|
||||
;XmlRpcPort = 20800
|
||||
|
||||
[Friends]
|
||||
; The port the friendslist interregion comms will listen on
|
||||
; Defaults to the simulator's TCP port
|
||||
;Port = 0
|
||||
|
||||
; Uncomment one of the lines below. Use FriendsService for local
|
||||
; operation, Connectors for remote operation
|
||||
;Connector = "OpenSim.Services.FriendsService.dll"
|
||||
Connector = "OpenSim.Services.Connectors.dll"
|
||||
|
|
Binary file not shown.
|
@ -11,7 +11,7 @@
|
|||
;;
|
||||
|
||||
[Startup]
|
||||
ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003/OpenSim.Server.Handlers.dll:XInventoryInConnector,8002/OpenSim.Server.Handlers.dll:FreeswitchServerConnector,8003/OpenSim.Server.Handlers.dll:GridServiceConnector,8003/OpenSim.Server.Handlers.dll:GridInfoServerInConnector,8003/OpenSim.Server.Handlers.dll:AuthenticationServiceConnector,8002/OpenSim.Server.Handlers.dll:OpenIdServerConnector,8003/OpenSim.Server.Handlers.dll:AvatarServiceConnector,8002/OpenSim.Server.Handlers.dll:LLLoginServiceInConnector,8003/OpenSim.Server.Handlers.dll:PresenceServiceConnector,8003/OpenSim.Server.Handlers.dll:UserAccountServiceConnector,8003/OpenSim.Server.Handlers.dll:GridUserServiceConnector,8003/OpenSim.Server.Handlers.dll:FriendsServiceConnector,8002/OpenSim.Server.Handlers.dll:GatekeeperServiceInConnector,8002/OpenSim.Server.Handlers.dll:UserAgentServerConnector,HGInventoryService@8002/OpenSim.Server.Handlers.dll:XInventoryInConnector,8002/OpenSim.Server.Handlers.dll:AssetServiceConnector"
|
||||
ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003/OpenSim.Server.Handlers.dll:XInventoryInConnector,8002/OpenSim.Server.Handlers.dll:FreeswitchServerConnector,8003/OpenSim.Server.Handlers.dll:GridServiceConnector,8002/OpenSim.Server.Handlers.dll:GridInfoServerInConnector,8003/OpenSim.Server.Handlers.dll:AuthenticationServiceConnector,8002/OpenSim.Server.Handlers.dll:OpenIdServerConnector,8003/OpenSim.Server.Handlers.dll:AvatarServiceConnector,8002/OpenSim.Server.Handlers.dll:LLLoginServiceInConnector,8003/OpenSim.Server.Handlers.dll:PresenceServiceConnector,8003/OpenSim.Server.Handlers.dll:UserAccountServiceConnector,8003/OpenSim.Server.Handlers.dll:GridUserServiceConnector,8003/OpenSim.Server.Handlers.dll:FriendsServiceConnector,8002/OpenSim.Server.Handlers.dll:GatekeeperServiceInConnector,8002/OpenSim.Server.Handlers.dll:UserAgentServerConnector,HGInventoryService@8002/OpenSim.Server.Handlers.dll:XInventoryInConnector,8002/OpenSim.Server.Handlers.dll:AssetServiceConnector"
|
||||
|
||||
; * This is common for all services, it's the network setup for the entire
|
||||
; * server instance, if none if specified above
|
||||
|
@ -28,7 +28,7 @@ ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003
|
|||
|
||||
[DatabaseService]
|
||||
StorageProvider = "OpenSim.Data.MySQL.dll"
|
||||
ConnectionString = "Data Source=localhost;Database=opensim;User ID=opensim;Password=*****;Old Guids=true;"
|
||||
ConnectionString = "Data Source=localhost;Database=opensim;User ID=opensim;Password=*****;"
|
||||
|
||||
; * As an example, the below configuration precisely mimicks the legacy
|
||||
; * asset server. It is read by the asset IN connector (defined above)
|
||||
|
|
|
@ -28,7 +28,7 @@ ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003
|
|||
|
||||
[DatabaseService]
|
||||
StorageProvider = "OpenSim.Data.MySQL.dll"
|
||||
ConnectionString = "Data Source=localhost;Database=opensim;User ID=opensim;Password=*****;Old Guids=true;"
|
||||
ConnectionString = "Data Source=localhost;Database=opensim;User ID=opensim;Password=*****;"
|
||||
|
||||
|
||||
; * As an example, the below configuration precisely mimicks the legacy
|
||||
|
@ -134,6 +134,9 @@ ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003
|
|||
WelcomeMessage = "Welcome, Avatar!"
|
||||
AllowRemoteSetLoginLevel = "false"
|
||||
|
||||
; For snowglobe's web map
|
||||
; MapTileURL = "";
|
||||
|
||||
|
||||
[GridInfoService]
|
||||
; These settings are used to return information on a get_grid_info call.
|
||||
|
|
|
@ -7,6 +7,9 @@
|
|||
[Includes]
|
||||
Include-Common = "config-include/GridCommon.ini"
|
||||
|
||||
[Startup]
|
||||
WorldMapModule = "HGWorldMap"
|
||||
|
||||
[Modules]
|
||||
AssetServices = "HGAssetBroker"
|
||||
InventoryServices = "HGInventoryBroker"
|
||||
|
|
|
@ -65,3 +65,6 @@
|
|||
MessagingModule = GroupsMessagingModule
|
||||
MessagingEnabled = true
|
||||
ServicesConnectorModule = SimianGroupsServicesConnector
|
||||
|
||||
[Profiles]
|
||||
Module = SimianProfiles
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
; Uncomment these lines if you want to use mysql storage
|
||||
; Change the connection string to your db details
|
||||
;StorageProvider = "OpenSim.Data.MySQL.dll"
|
||||
;ConnectionString = "Data Source=localhost;Database=opensim;User ID=opensim;Password=***;Old Guids=true;"
|
||||
;ConnectionString = "Data Source=localhost;Database=opensim;User ID=opensim;Password=***;"
|
||||
|
||||
[AssetService]
|
||||
DefaultAssetLoader = "OpenSim.Framework.AssetLoader.Filesystem.dll"
|
||||
|
|
|
@ -3,7 +3,10 @@
|
|||
;; All optional settings are in StandaloneCommon.ini.example,
|
||||
;; which you can copy and change.
|
||||
;;
|
||||
|
||||
|
||||
[Startup]
|
||||
WorldMapModule = "HGWorldMap"
|
||||
|
||||
[Modules]
|
||||
AssetServices = "HGAssetBroker"
|
||||
InventoryServices = "HGInventoryBroker"
|
||||
|
|
Loading…
Reference in New Issue