Merge branch 'master' into careminster-presence-refactor

avinationmerge
Melanie 2010-04-19 07:00:40 +01:00
commit 98cb4f74b2
63 changed files with 1534 additions and 611 deletions

View File

@ -88,6 +88,7 @@ what it is today.
* Kitto Flora
* KittyLiu
* Kurt Taylor (IBM)
* lkalif
* lulurun
* M.Igarashi
* maimedleech

View File

@ -1130,7 +1130,6 @@ namespace OpenSim.ApplicationPlugins.RemoteController
throw new Exception(String.Format("Account {0} {1} already exists", firstname, lastname));
account = new UserAccount(scopeID, firstname, lastname, email);
// REFACTORING PROBLEM: no method to set the password!
bool success = m_app.SceneManager.CurrentOrFirstScene.UserAccountService.StoreUserAccount(account);
@ -1138,6 +1137,9 @@ namespace OpenSim.ApplicationPlugins.RemoteController
throw new Exception(String.Format("failed to create new user {0} {1}",
firstname, lastname));
// Store the password
m_app.SceneManager.CurrentOrFirstScene.AuthenticationService.SetPassword(account.PrincipalID, passwd);
GridRegion home = m_app.SceneManager.CurrentOrFirstScene.GridService.GetRegionByPosition(scopeID,
(int)(regX * Constants.RegionSize), (int)(regY * Constants.RegionSize));
if (home == null)

View File

@ -642,6 +642,7 @@ namespace OpenSim.Client.MXP.ClientStack
public event Action<UUID> OnRemoveAvatar;
public event ObjectPermissions OnObjectPermissions;
public event CreateNewInventoryItem OnCreateNewInventoryItem;
public event LinkInventoryItem OnLinkInventoryItem;
public event CreateInventoryFolder OnCreateNewInventoryFolder;
public event UpdateInventoryFolder OnUpdateInventoryFolder;
public event MoveInventoryFolder OnMoveInventoryFolder;

View File

@ -288,6 +288,7 @@ namespace OpenSim.Client.Sirikata.ClientStack
public event Action<UUID> OnRemoveAvatar;
public event ObjectPermissions OnObjectPermissions;
public event CreateNewInventoryItem OnCreateNewInventoryItem;
public event LinkInventoryItem OnLinkInventoryItem;
public event CreateInventoryFolder OnCreateNewInventoryFolder;
public event UpdateInventoryFolder OnUpdateInventoryFolder;
public event MoveInventoryFolder OnMoveInventoryFolder;

View File

@ -291,6 +291,7 @@ namespace OpenSim.Client.VWoHTTP.ClientStack
public event Action<UUID> OnRemoveAvatar = delegate { };
public event ObjectPermissions OnObjectPermissions = delegate { };
public event CreateNewInventoryItem OnCreateNewInventoryItem = delegate { };
public event LinkInventoryItem OnLinkInventoryItem = delegate { };
public event CreateInventoryFolder OnCreateNewInventoryFolder = delegate { };
public event UpdateInventoryFolder OnUpdateInventoryFolder = delegate { };
public event MoveInventoryFolder OnMoveInventoryFolder = delegate { };

View File

@ -48,6 +48,7 @@ namespace OpenSim.Data
{
UserAccountData[] Get(string[] fields, string[] values);
bool Store(UserAccountData data);
bool Delete(string field, string val);
UserAccountData[] GetUsers(UUID scopeID, string query);
}
}

View File

@ -0,0 +1,193 @@
using System;
using System.Collections.Generic;
using OpenMetaverse;
using OpenSim.Framework;
namespace OpenSim.Data.Null
{
/// <summary>
/// This class is completely null.
/// </summary>
public class NullInventoryData : IInventoryDataPlugin
{
public string Version { get { return "1.0.0.0"; } }
public void Initialise()
{
}
public void Dispose()
{
// Do nothing.
}
public string Name
{
get { return "Null Inventory Data Interface"; }
}
public void Initialise(string connect)
{
}
/// <summary>
/// Returns all descendent folders of this folder. Does not return the parent folder itself.
/// </summary>
/// <param name="parentID">The folder to get subfolders for</param>
/// <returns>A list of inventory folders</returns>
public List<InventoryFolderBase> getFolderHierarchy(UUID parentID)
{
return new List<InventoryFolderBase>();
}
/// <summary>
/// Returns a list of inventory items contained within the specified folder
/// </summary>
/// <param name="folderID">The UUID of the target folder</param>
/// <returns>A List of InventoryItemBase items</returns>
public List<InventoryItemBase> getInventoryInFolder(UUID folderID)
{
return new List<InventoryItemBase>();
}
/// <summary>
/// Returns a list of the root folders within a users inventory
/// </summary>
/// <param name="user">The user whos inventory is to be searched</param>
/// <returns>A list of folder objects</returns>
public List<InventoryFolderBase> getUserRootFolders(UUID user)
{
return new List<InventoryFolderBase>();
}
/// <summary>
/// Returns the users inventory root folder.
/// </summary>
/// <param name="user">The UUID of the user who is having inventory being returned</param>
/// <returns>Root inventory folder, null if no root inventory folder was found</returns>
public InventoryFolderBase getUserRootFolder(UUID user)
{
return null;
}
/// <summary>
/// Returns a list of inventory folders contained in the folder 'parentID'
/// </summary>
/// <param name="parentID">The folder to get subfolders for</param>
/// <returns>A list of inventory folders</returns>
public List<InventoryFolderBase> getInventoryFolders(UUID parentID)
{
return new List<InventoryFolderBase>();
}
/// <summary>
/// Returns an inventory item by its UUID
/// </summary>
/// <param name="item">The UUID of the item to be returned</param>
/// <returns>A class containing item information</returns>
public InventoryItemBase getInventoryItem(UUID item)
{
return null;
}
/// <summary>
/// Returns a specified inventory folder by its UUID
/// </summary>
/// <param name="folder">The UUID of the folder to be returned</param>
/// <returns>A class containing folder information</returns>
public InventoryFolderBase getInventoryFolder(UUID folder)
{
return null;
}
/// <summary>
/// Creates a new inventory item based on item
/// </summary>
/// <param name="item">The item to be created</param>
public void addInventoryItem(InventoryItemBase item)
{
}
/// <summary>
/// Updates an inventory item with item (updates based on ID)
/// </summary>
/// <param name="item">The updated item</param>
public void updateInventoryItem(InventoryItemBase item)
{
}
/// <summary>
///
/// </summary>
/// <param name="item"></param>
public void deleteInventoryItem(UUID item)
{
}
/// <summary>
///
/// </summary>
/// <param name="item"></param>
public InventoryItemBase queryInventoryItem(UUID item)
{
return null;
}
/// <summary>
///
/// </summary>
/// <param name="item"></param>
public InventoryFolderBase queryInventoryFolder(UUID folder)
{
return null;
}
/// <summary>
/// Adds a new folder specified by folder
/// </summary>
/// <param name="folder">The inventory folder</param>
public void addInventoryFolder(InventoryFolderBase folder)
{
}
/// <summary>
/// Updates a folder based on its ID with folder
/// </summary>
/// <param name="folder">The inventory folder</param>
public void updateInventoryFolder(InventoryFolderBase folder)
{
}
/// <summary>
/// Updates a folder based on its ID with folder
/// </summary>
/// <param name="folder">The inventory folder</param>
public void moveInventoryFolder(InventoryFolderBase folder)
{
}
/// <summary>
/// Deletes a folder. Thie will delete both the folder itself and its contents (items and descendent folders)
/// </summary>
/// <param name="folder">The id of the folder</param>
public void deleteInventoryFolder(UUID folder)
{
}
/// <summary>
/// Returns all activated gesture-items in the inventory of the specified avatar.
/// </summary>
/// <param name="avatarID">
/// The <see cref="UUID"/> of the avatar
/// </param>
/// <returns>
/// The list of gestures (<see cref="InventoryItemBase"/>s)
/// </returns>
public List<InventoryItemBase> fetchActiveGestures(UUID avatarID)
{
return new List<InventoryItemBase>();
}
}
}

View File

@ -135,5 +135,26 @@ namespace OpenSim.Data.Null
return result;
}
public bool Delete(string field, string val)
{
// Only delete by PrincipalID
if (field.Equals("PrincipalID"))
{
UUID uuid = UUID.Zero;
if (UUID.TryParse(val, out uuid) && m_DataByUUID.ContainsKey(uuid))
{
UserAccountData account = m_DataByUUID[uuid];
m_DataByUUID.Remove(uuid);
if (m_DataByName.ContainsKey(account.FirstName + " " + account.LastName))
m_DataByName.Remove(account.FirstName + " " + account.LastName);
if (account.Data.ContainsKey("Email") && account.Data["Email"] != string.Empty && m_DataByEmail.ContainsKey(account.Data["Email"]))
m_DataByEmail.Remove(account.Data["Email"]);
return true;
}
}
return false;
}
}
}

View File

@ -2,7 +2,7 @@
-- useraccounts table
CREATE TABLE UserAccounts (
PrincipalID CHAR(36) NOT NULL,
PrincipalID CHAR(36) primary key,
ScopeID CHAR(36) NOT NULL,
FirstName VARCHAR(64) NOT NULL,
LastName VARCHAR(64) NOT NULL,

View File

@ -235,7 +235,7 @@ namespace OpenSim.Data.SQLite
if (System.Environment.TickCount - m_LastExpire > 30000)
DoExpire();
SqliteCommand cmd = new SqliteCommand("update tokens set validity = datetime('now, 'localtime', '+" + lifetime.ToString() +
SqliteCommand cmd = new SqliteCommand("update tokens set validity = datetime('now', 'localtime', '+" + lifetime.ToString() +
" minutes') where UUID = '" + principalID.ToString() + "' and token = '" + token + "' and validity > datetime('now', 'localtime')");
if (ExecuteNonQuery(cmd, m_Connection) > 0)

View File

@ -66,7 +66,7 @@ namespace OpenSim.Data.SQLite
if (words.Length == 1)
{
cmd.CommandText = String.Format("select * from {0} where ScopeID='{1}' or ScopeID='00000000-0000-0000-0000-000000000000') and (FirstName like '{2}%' or LastName like '{2}%')",
cmd.CommandText = String.Format("select * from {0} where (ScopeID='{1}' or ScopeID='00000000-0000-0000-0000-000000000000') and (FirstName like '{2}%' or LastName like '{2}%')",
m_Realm, scopeID.ToString(), words[0]);
}
else

View File

@ -105,14 +105,30 @@ namespace OpenSim.Framework.Console
int left = System.Console.CursorLeft;
if (left < 0)
{
System.Console.CursorLeft = 0;
else if (left >= System.Console.BufferWidth)
System.Console.CursorLeft = System.Console.BufferWidth - 1;
}
else
{
int bw = System.Console.BufferWidth;
// On Mono 2.4.2.3 (and possibly above), the buffer value is sometimes erroneously zero (Mantis 4657)
if (bw > 0 && left >= bw)
System.Console.CursorLeft = bw - 1;
}
if (top < 0)
{
top = 0;
if (top >= System.Console.BufferHeight)
top = System.Console.BufferHeight - 1;
}
else
{
int bh = System.Console.BufferHeight;
// On Mono 2.4.2.3 (and possibly above), the buffer value is sometimes erroneously zero (Mantis 4657)
if (bh > 0 && top >= bh)
top = bh - 1;
}
System.Console.CursorTop = top;
@ -138,14 +154,29 @@ namespace OpenSim.Framework.Console
int top = System.Console.CursorTop;
if (top < 0)
{
System.Console.CursorTop = 0;
else if (top >= System.Console.BufferHeight)
System.Console.CursorTop = System.Console.BufferHeight - 1;
}
else
{
int bh = System.Console.BufferHeight;
// On Mono 2.4.2.3 (and possibly above), the buffer value is sometimes erroneously zero (Mantis 4657)
if (bh > 0 && top >= bh)
System.Console.CursorTop = bh - 1;
}
if (left < 0)
{
left = 0;
if (left >= System.Console.BufferWidth)
left = System.Console.BufferWidth - 1;
}
else
{
int bw = System.Console.BufferWidth;
// On Mono 2.4.2.3 (and possibly above), the buffer value is sometimes erroneously zero (Mantis 4657)
if (bw > 0 && left >= bw)
left = bw - 1;
}
System.Console.CursorLeft = left;

View File

@ -236,6 +236,10 @@ namespace OpenSim.Framework
IClientAPI remoteClient, UUID transActionID, UUID folderID, uint callbackID, string description, string name,
sbyte invType, sbyte type, byte wearableType, uint nextOwnerMask, int creationDate);
public delegate void LinkInventoryItem(
IClientAPI remoteClient, UUID transActionID, UUID folderID, uint callbackID, string description, string name,
sbyte invType, sbyte type, UUID olditemID);
public delegate void FetchInventoryDescendents(
IClientAPI remoteClient, UUID folderID, UUID ownerID, bool fetchFolders, bool fetchItems, int sortOrder);
@ -930,6 +934,7 @@ namespace OpenSim.Framework
event ObjectPermissions OnObjectPermissions;
event CreateNewInventoryItem OnCreateNewInventoryItem;
event LinkInventoryItem OnLinkInventoryItem;
event CreateInventoryFolder OnCreateNewInventoryFolder;
event UpdateInventoryFolder OnUpdateInventoryFolder;
event MoveInventoryFolder OnMoveInventoryFolder;

View File

@ -188,6 +188,10 @@ namespace OpenSim.Framework
m_textureEntry = DEFAULT_TEXTURE;
}
/// <summary>
/// Construct a PrimitiveBaseShape object from a OpenMetaverse.Primitive object
/// </summary>
/// <param name="prim"></param>
public PrimitiveBaseShape(Primitive prim)
{
PCode = (byte)prim.PrimData.PCode;

View File

@ -106,6 +106,39 @@ namespace OpenSim.Framework
}
}
public static string SLInvTypeToContentType(int invType)
{
switch ((InventoryType)invType)
{
case InventoryType.Animation:
return "application/vnd.ll.animation";
case InventoryType.CallingCard:
return "application/vnd.ll.callingcard";
case InventoryType.Folder:
return "application/vnd.ll.folder";
case InventoryType.Gesture:
return "application/vnd.ll.gesture";
case InventoryType.Landmark:
return "application/vnd.ll.landmark";
case InventoryType.LSL:
return "application/vnd.ll.lsltext";
case InventoryType.Notecard:
return "application/vnd.ll.notecard";
case InventoryType.Attachment:
case InventoryType.Object:
return "application/vnd.ll.primitive";
case InventoryType.Sound:
return "application/ogg";
case InventoryType.Snapshot:
case InventoryType.Texture:
return "image/x-j2c";
case InventoryType.Wearable:
return "application/vnd.ll.clothing";
default:
return "application/octet-stream";
}
}
public static sbyte ContentTypeToSLAssetType(string contentType)
{
switch (contentType)

5
OpenSim/Region/Application/OpenSim.cs Executable file → Normal file
View File

@ -251,8 +251,9 @@ namespace OpenSim
"Save named prim to XML2", SavePrimsXml2);
m_console.Commands.AddCommand("region", false, "load oar",
"load oar [--merge] <oar name>",
"Load a region's data from OAR archive", LoadOar);
"load oar [--merge] [--skip-assets] <oar name>",
"Load a region's data from OAR archive. --merge will merge the oar with the existing scene. --skip-assets will load the oar but ignore the assets it contains",
LoadOar);
m_console.Commands.AddCommand("region", false, "save oar",
"save oar <oar name>",

View File

@ -182,6 +182,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
public event TeleportLocationRequest OnSetStartLocationRequest;
public event UpdateAvatarProperties OnUpdateAvatarProperties;
public event CreateNewInventoryItem OnCreateNewInventoryItem;
public event LinkInventoryItem OnLinkInventoryItem;
public event CreateInventoryFolder OnCreateNewInventoryFolder;
public event UpdateInventoryFolder OnUpdateInventoryFolder;
public event MoveInventoryFolder OnMoveInventoryFolder;
@ -669,8 +670,17 @@ namespace OpenSim.Region.ClientStack.LindenUDP
public void ProcessSpecificPacketAsync(object state)
{
AsyncPacketProcess packetObject = (AsyncPacketProcess)state;
packetObject.result = packetObject.Method(packetObject.ClientView, packetObject.Pack);
try
{
packetObject.result = packetObject.Method(packetObject.ClientView, packetObject.Pack);
}
catch (Exception e)
{
// Make sure that we see any exception caused by the asynchronous operation.
m_log.Error(
string.Format("[LLCLIENTVIEW]: Caught exception while processing {0}", packetObject.Pack), e);
}
}
#endregion Packet Handling
@ -4726,6 +4736,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
AddLocalPacketHandler(PacketType.UpdateInventoryFolder, HandleUpdateInventoryFolder);
AddLocalPacketHandler(PacketType.MoveInventoryFolder, HandleMoveInventoryFolder);
AddLocalPacketHandler(PacketType.CreateInventoryItem, HandleCreateInventoryItem);
AddLocalPacketHandler(PacketType.LinkInventoryItem, HandleLinkInventoryItem);
AddLocalPacketHandler(PacketType.FetchInventory, HandleFetchInventory);
AddLocalPacketHandler(PacketType.FetchInventoryDescendents, HandleFetchInventoryDescendents);
AddLocalPacketHandler(PacketType.PurgeInventoryDescendents, HandlePurgeInventoryDescendents);
@ -7045,6 +7056,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP
return true;
}
/// <summary>
/// This is the entry point for the UDP route by which the client can retrieve asset data. If the request
/// is successful then a TransferInfo packet will be sent back, followed by one or more TransferPackets
/// </summary>
/// <param name="sender"></param>
/// <param name="Pack"></param>
/// <returns>This parameter may be ignored since we appear to return true whatever happens</returns>
private bool HandleTransferRequest(IClientAPI sender, Packet Pack)
{
//m_log.Debug("ClientView.ProcessPackets.cs:ProcessInPacket() - Got transfer request");
@ -7055,7 +7073,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
// Has to be done here, because AssetCache can't do it
//
UUID taskID = UUID.Zero;
if (transfer.TransferInfo.SourceType == 3)
if (transfer.TransferInfo.SourceType == (int)SourceType.SimInventoryItem)
{
taskID = new UUID(transfer.TransferInfo.Params, 48);
UUID itemID = new UUID(transfer.TransferInfo.Params, 64);
@ -7326,6 +7344,38 @@ namespace OpenSim.Region.ClientStack.LindenUDP
return true;
}
private bool HandleLinkInventoryItem(IClientAPI sender, Packet Pack)
{
LinkInventoryItemPacket createLink = (LinkInventoryItemPacket)Pack;
#region Packet Session and User Check
if (m_checkPackets)
{
if (createLink.AgentData.SessionID != SessionId ||
createLink.AgentData.AgentID != AgentId)
return true;
}
#endregion
LinkInventoryItem linkInventoryItem = OnLinkInventoryItem;
if (linkInventoryItem != null)
{
linkInventoryItem(
this,
createLink.InventoryBlock.TransactionID,
createLink.InventoryBlock.FolderID,
createLink.InventoryBlock.CallbackID,
Util.FieldToString(createLink.InventoryBlock.Description),
Util.FieldToString(createLink.InventoryBlock.Name),
createLink.InventoryBlock.InvType,
createLink.InventoryBlock.Type,
createLink.InventoryBlock.OldItemID);
}
return true;
}
private bool HandleFetchInventory(IClientAPI sender, Packet Pack)
{
if (OnFetchInventory != null)
@ -7670,12 +7720,15 @@ namespace OpenSim.Region.ClientStack.LindenUDP
newTaskItem.GroupPermissions = updatetask.InventoryData.GroupMask;
newTaskItem.EveryonePermissions = updatetask.InventoryData.EveryoneMask;
newTaskItem.NextPermissions = updatetask.InventoryData.NextOwnerMask;
// Unused? Clicking share with group sets GroupPermissions instead, so perhaps this is something
// different
//newTaskItem.GroupOwned=updatetask.InventoryData.GroupOwned;
newTaskItem.Type = updatetask.InventoryData.Type;
newTaskItem.InvType = updatetask.InventoryData.InvType;
newTaskItem.Flags = updatetask.InventoryData.Flags;
//newTaskItem.SaleType=updatetask.InventoryData.SaleType;
//newTaskItem.SalePrice=updatetask.InventoryData.SalePrice;;
//newTaskItem.SalePrice=updatetask.InventoryData.SalePrice;
newTaskItem.Name = Util.FieldToString(updatetask.InventoryData.Name);
newTaskItem.Description = Util.FieldToString(updatetask.InventoryData.Description);
newTaskItem.CreationDate = (uint)updatetask.InventoryData.CreationDate;
@ -11297,17 +11350,20 @@ namespace OpenSim.Region.ClientStack.LindenUDP
return String.Empty;
}
public void MakeAssetRequest(TransferRequestPacket transferRequest, UUID taskID)
/// <summary>
/// Make an asset request to the asset service in response to a client request.
/// </summary>
/// <param name="transferRequest"></param>
/// <param name="taskID"></param>
protected void MakeAssetRequest(TransferRequestPacket transferRequest, UUID taskID)
{
UUID requestID = UUID.Zero;
if (transferRequest.TransferInfo.SourceType == 2)
if (transferRequest.TransferInfo.SourceType == (int)SourceType.Asset)
{
//direct asset request
requestID = new UUID(transferRequest.TransferInfo.Params, 0);
}
else if (transferRequest.TransferInfo.SourceType == 3)
else if (transferRequest.TransferInfo.SourceType == (int)SourceType.SimInventoryItem)
{
//inventory asset request
requestID = new UUID(transferRequest.TransferInfo.Params, 80);
//m_log.Debug("[XXX] inventory asset request " + requestID);
//if (taskID == UUID.Zero) // Agent
@ -11320,29 +11376,34 @@ namespace OpenSim.Region.ClientStack.LindenUDP
// }
}
//check to see if asset is in local cache, if not we need to request it from asset server.
//m_log.Debug("asset request " + requestID);
//m_log.DebugFormat("[LLCLIENTVIEW]: {0} requesting asset {1}", Name, requestID);
m_assetService.Get(requestID.ToString(), transferRequest, AssetReceived);
}
/// <summary>
/// When we get a reply back from the asset service in response to a client request, send back the data.
/// </summary>
/// <param name="id"></param>
/// <param name="sender"></param>
/// <param name="asset"></param>
protected void AssetReceived(string id, Object sender, AssetBase asset)
{
TransferRequestPacket transferRequest = (TransferRequestPacket)sender;
UUID requestID = UUID.Zero;
byte source = 2;
if ((transferRequest.TransferInfo.SourceType == 2) || (transferRequest.TransferInfo.SourceType == 2222))
byte source = (byte)SourceType.Asset;
if ((transferRequest.TransferInfo.SourceType == (int)SourceType.Asset)
|| (transferRequest.TransferInfo.SourceType == 2222))
{
//direct asset request
requestID = new UUID(transferRequest.TransferInfo.Params, 0);
}
else if ((transferRequest.TransferInfo.SourceType == 3) || (transferRequest.TransferInfo.SourceType == 3333))
else if ((transferRequest.TransferInfo.SourceType == (int)SourceType.SimInventoryItem)
|| (transferRequest.TransferInfo.SourceType == 3333))
{
//inventory asset request
requestID = new UUID(transferRequest.TransferInfo.Params, 80);
source = 3;
source = (byte)SourceType.SimInventoryItem;
//m_log.Debug("asset request " + requestID);
}
@ -11355,9 +11416,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
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 == 2)
if (transferRequest.TransferInfo.SourceType == (int)SourceType.Asset)
transferRequest.TransferInfo.SourceType = 2222; // marker
else if (transferRequest.TransferInfo.SourceType == 3)
else if (transferRequest.TransferInfo.SourceType == (int)SourceType.SimInventoryItem)
transferRequest.TransferInfo.SourceType = 3333; // marker
m_assetService.Get(userAssets + "/" + id, transferRequest, AssetReceived);
@ -11372,7 +11433,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
}
// Scripts cannot be retrieved by direct request
if (transferRequest.TransferInfo.SourceType == 2 && asset.Type == 10)
if (transferRequest.TransferInfo.SourceType == (int)SourceType.Asset && asset.Type == 10)
return;
// The asset is known to exist and is in our cache, so add it to the AssetRequests list
@ -11605,6 +11666,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
public PacketMethod method;
public bool Async;
}
public class AsyncPacketProcess
{
public bool result = false;

View File

@ -109,7 +109,7 @@ namespace OpenSim.Region.CoreModules.Avatar.ObjectCaps
// Try to parse the texture ID from the request URL
NameValueCollection query = HttpUtility.ParseQueryString(httpRequest.Url.Query);
string textureStr = GetOne(query, "texture_id");
string textureStr = query.GetOne("texture_id");
if (m_assetService == null)
{
@ -166,7 +166,7 @@ namespace OpenSim.Region.CoreModules.Avatar.ObjectCaps
private void SendTexture(OSHttpRequest request, OSHttpResponse response, AssetBase texture)
{
string range = GetOne(request.Headers, "Range");
string range = request.Headers.GetOne("Range");
if (!String.IsNullOrEmpty(range))
{
// Range request
@ -216,14 +216,5 @@ namespace OpenSim.Region.CoreModules.Avatar.ObjectCaps
start = end = 0;
return false;
}
private static string GetOne(NameValueCollection collection, string key)
{
string[] values = collection.GetValues(key);
if (values != null && values.Length > 0)
return values[0];
return null;
}
}
}

View File

@ -30,6 +30,7 @@ using System.Reflection;
using log4net;
using Nini.Config;
using OpenMetaverse;
using OpenMetaverse.Packets;
using OpenSim.Framework;
using OpenSim.Region.Framework;
using OpenSim.Region.Framework.Interfaces;
@ -169,6 +170,17 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
return true;
}
public void RezMultipleAttachmentsFromInventory(
IClientAPI remoteClient,
RezMultipleAttachmentsFromInvPacket.HeaderDataBlock header,
RezMultipleAttachmentsFromInvPacket.ObjectDataBlock[] objects)
{
foreach (RezMultipleAttachmentsFromInvPacket.ObjectDataBlock obj in objects)
{
RezSingleAttachmentFromInventory(remoteClient, obj.ItemID, obj.AttachmentPt);
}
}
public UUID RezSingleAttachmentFromInventory(IClientAPI remoteClient, UUID itemID, uint AttachmentPt)
{
m_log.DebugFormat("[ATTACHMENTS MODULE]: Rezzing single attachment from item {0} for {1}", itemID, remoteClient.Name);
@ -238,6 +250,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
itemID, remoteClient.Name, AttachmentPt);
}
objatt.ResumeScripts();
return objatt;
}
@ -311,6 +324,16 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
}
}
public void DetachObject(uint objectLocalID, IClientAPI remoteClient)
{
SceneObjectGroup group = m_scene.GetGroupByPrim(objectLocalID);
if (group != null)
{
//group.DetachToGround();
ShowDetachInUserInventory(group.GetFromItemID(), remoteClient);
}
}
public void ShowDetachInUserInventory(UUID itemID, IClientAPI remoteClient)
{
ScenePresence presence;
@ -329,6 +352,38 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
DetachSingleAttachmentToInv(itemID, remoteClient);
}
public void DetachSingleAttachmentToGround(UUID itemID, IClientAPI remoteClient)
{
SceneObjectPart part = m_scene.GetSceneObjectPart(itemID);
if (part == null || part.ParentGroup == null)
return;
UUID inventoryID = part.ParentGroup.GetFromItemID();
ScenePresence presence;
if (m_scene.TryGetScenePresence(remoteClient.AgentId, out presence))
{
if (!m_scene.Permissions.CanRezObject(
part.ParentGroup.Children.Count, remoteClient.AgentId, presence.AbsolutePosition))
return;
presence.Appearance.DetachAttachment(itemID);
if (m_scene.AvatarFactory != null)
{
m_scene.AvatarFactory.UpdateDatabase(remoteClient.AgentId, presence.Appearance);
}
part.ParentGroup.DetachToGround();
List<UUID> uuids = new List<UUID>();
uuids.Add(inventoryID);
m_scene.InventoryService.DeleteItems(remoteClient.AgentId, uuids);
remoteClient.SendRemoveInventoryItem(inventoryID);
}
m_scene.EventManager.TriggerOnAttach(part.ParentGroup.LocalId, itemID, UUID.Zero);
}
// What makes this method odd and unique is it tries to detach using an UUID.... Yay for standards.
// To LocalId or UUID, *THAT* is the question. How now Brown UUID??
protected void DetachSingleAttachmentToInv(UUID itemID, IClientAPI remoteClient)

View File

@ -621,6 +621,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
}
}
rootPart.ParentGroup.ResumeScripts();
return rootPart.ParentGroup;
}
}

View File

@ -311,10 +311,13 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
{
// m_log.DebugFormat("[LOCAL INVENTORY SERVICES CONNECTOR]: Requesting inventory item {0}", item.ID);
UUID requestedItemId = item.ID;
item = m_InventoryService.GetItem(item);
if (null == item)
m_log.ErrorFormat("[LOCAL INVENTORY SERVICES CONNECTOR]: Could not find item with id {0}", item.ID);
m_log.ErrorFormat(
"[LOCAL INVENTORY SERVICES CONNECTOR]: Could not find item with id {0}", requestedItemId);
return item;
}

View File

@ -53,25 +53,27 @@ namespace OpenSim.Region.CoreModules.World.Archiver
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private static ASCIIEncoding m_asciiEncoding = new ASCIIEncoding();
private static UTF8Encoding m_utf8Encoding = new UTF8Encoding();
private Scene m_scene;
private Stream m_loadStream;
private Guid m_requestId;
private string m_errorMessage;
protected Scene m_scene;
protected Stream m_loadStream;
protected Guid m_requestId;
protected string m_errorMessage;
/// <value>
/// Should the archive being loaded be merged with what is already on the region?
/// </value>
private bool m_merge;
protected bool m_merge;
/// <value>
/// Should we ignore any assets when reloading the archive?
/// </value>
protected bool m_skipAssets;
/// <summary>
/// Used to cache lookups for valid uuids.
/// </summary>
private IDictionary<UUID, bool> m_validUserUuids = new Dictionary<UUID, bool>();
public ArchiveReadRequest(Scene scene, string loadPath, bool merge, Guid requestId)
public ArchiveReadRequest(Scene scene, string loadPath, bool merge, bool skipAssets, Guid requestId)
{
m_scene = scene;
@ -89,14 +91,16 @@ namespace OpenSim.Region.CoreModules.World.Archiver
m_errorMessage = String.Empty;
m_merge = merge;
m_skipAssets = skipAssets;
m_requestId = requestId;
}
public ArchiveReadRequest(Scene scene, Stream loadStream, bool merge, Guid requestId)
public ArchiveReadRequest(Scene scene, Stream loadStream, bool merge, bool skipAssets, Guid requestId)
{
m_scene = scene;
m_loadStream = loadStream;
m_merge = merge;
m_skipAssets = skipAssets;
m_requestId = requestId;
}
@ -133,9 +137,9 @@ namespace OpenSim.Region.CoreModules.World.Archiver
if (filePath.StartsWith(ArchiveConstants.OBJECTS_PATH))
{
serialisedSceneObjects.Add(m_utf8Encoding.GetString(data));
serialisedSceneObjects.Add(Encoding.UTF8.GetString(data));
}
else if (filePath.StartsWith(ArchiveConstants.ASSETS_PATH))
else if (filePath.StartsWith(ArchiveConstants.ASSETS_PATH) && !m_skipAssets)
{
if (LoadAsset(filePath, data))
successfulAssetRestores++;
@ -155,7 +159,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
}
else if (!m_merge && filePath.StartsWith(ArchiveConstants.LANDDATA_PATH))
{
serialisedParcels.Add(m_utf8Encoding.GetString(data));
serialisedParcels.Add(Encoding.UTF8.GetString(data));
}
else if (filePath == ArchiveConstants.CONTROL_FILE_PATH)
{
@ -178,6 +182,8 @@ namespace OpenSim.Region.CoreModules.World.Archiver
archive.Close();
}
if (!m_skipAssets)
{
m_log.InfoFormat("[ARCHIVER]: Restored {0} assets", successfulAssetRestores);
if (failedAssetRestores > 0)
@ -185,6 +191,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
m_log.ErrorFormat("[ARCHIVER]: Failed to load {0} assets", failedAssetRestores);
m_errorMessage += String.Format("Failed to load {0} assets", failedAssetRestores);
}
}
if (!m_merge)
{
@ -279,6 +286,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
{
sceneObjectsLoadedCount++;
sceneObject.CreateScriptInstances(0, false, m_scene.DefaultScriptEngine, 0);
sceneObject.ResumeScripts();
}
}
@ -543,7 +551,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
XmlParserContext context = new XmlParserContext(null, nsmgr, null, XmlSpace.None);
XmlTextReader xtr
= new XmlTextReader(m_asciiEncoding.GetString(data), XmlNodeType.Document, context);
= new XmlTextReader(Encoding.ASCII.GetString(data), XmlNodeType.Document, context);
RegionSettings currentRegionSettings = m_scene.RegionInfo.RegionSettings;

View File

@ -94,8 +94,11 @@ namespace OpenSim.Region.CoreModules.World.Archiver
public void HandleLoadOarConsoleCommand(string module, string[] cmdparams)
{
bool mergeOar = false;
bool skipAssets = false;
OptionSet options = new OptionSet().Add("m|merge", delegate (string v) { mergeOar = v != null; });
options.Add("s|skip-assets", delegate (string v) { skipAssets = v != null; });
List<string> mainParams = options.Parse(cmdparams);
// m_log.DebugFormat("MERGE OAR IS [{0}]", mergeOar);
@ -105,11 +108,11 @@ namespace OpenSim.Region.CoreModules.World.Archiver
if (mainParams.Count > 2)
{
DearchiveRegion(mainParams[2], mergeOar, Guid.Empty);
DearchiveRegion(mainParams[2], mergeOar, skipAssets, Guid.Empty);
}
else
{
DearchiveRegion(DEFAULT_OAR_BACKUP_FILENAME, mergeOar, Guid.Empty);
DearchiveRegion(DEFAULT_OAR_BACKUP_FILENAME, mergeOar, skipAssets, Guid.Empty);
}
}
@ -154,25 +157,25 @@ namespace OpenSim.Region.CoreModules.World.Archiver
public void DearchiveRegion(string loadPath)
{
DearchiveRegion(loadPath, false, Guid.Empty);
DearchiveRegion(loadPath, false, false, Guid.Empty);
}
public void DearchiveRegion(string loadPath, bool merge, Guid requestId)
public void DearchiveRegion(string loadPath, bool merge, bool skipAssets, Guid requestId)
{
m_log.InfoFormat(
"[ARCHIVER]: Loading archive to region {0} from {1}", m_scene.RegionInfo.RegionName, loadPath);
new ArchiveReadRequest(m_scene, loadPath, merge, requestId).DearchiveRegion();
new ArchiveReadRequest(m_scene, loadPath, merge, skipAssets, requestId).DearchiveRegion();
}
public void DearchiveRegion(Stream loadStream)
{
DearchiveRegion(loadStream, false, Guid.Empty);
DearchiveRegion(loadStream, false, false, Guid.Empty);
}
public void DearchiveRegion(Stream loadStream, bool merge, Guid requestId)
public void DearchiveRegion(Stream loadStream, bool merge, bool skipAssets, Guid requestId)
{
new ArchiveReadRequest(m_scene, loadStream, merge, requestId).DearchiveRegion();
new ArchiveReadRequest(m_scene, loadStream, merge, skipAssets, requestId).DearchiveRegion();
}
}
}

View File

@ -442,7 +442,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests
byte[] archive = archiveWriteStream.ToArray();
MemoryStream archiveReadStream = new MemoryStream(archive);
m_archiverModule.DearchiveRegion(archiveReadStream, true, Guid.Empty);
m_archiverModule.DearchiveRegion(archiveReadStream, true, false, Guid.Empty);
SceneObjectPart object1Existing = m_scene.GetSceneObjectPart(part1.Name);
Assert.That(object1Existing, Is.Not.Null, "object1 was not present after merge");

View File

@ -162,7 +162,8 @@ namespace OpenSim.Region.CoreModules.World.Permissions
private Dictionary<string, bool> GrantVB = new Dictionary<string, bool>();
private Dictionary<string, bool> GrantJS = new Dictionary<string, bool>();
private Dictionary<string, bool> GrantYP = new Dictionary<string, bool>();
private IFriendsModule m_friendsModule = null;
private IFriendsModule m_friendsModule;
private IGroupsModule m_groupsModule;
#endregion
@ -386,9 +387,12 @@ namespace OpenSim.Region.CoreModules.World.Permissions
m_friendsModule = m_scene.RequestModuleInterface<IFriendsModule>();
if (m_friendsModule == null)
m_log.Error("[PERMISSIONS]: Friends module not found, friend permissions will not work");
else
m_log.Info("[PERMISSIONS]: Friends module found, friend permissions enabled");
m_log.Warn("[PERMISSIONS]: Friends module not found, friend permissions will not work");
m_groupsModule = m_scene.RequestModuleInterface<IGroupsModule>();
if (m_groupsModule == null)
m_log.Warn("[PERMISSIONS]: Groups module not found, group permissions will not work");
}
public void Close()
@ -423,14 +427,17 @@ namespace OpenSim.Region.CoreModules.World.Permissions
// with the powers requested (powers = 0 for no powers check)
protected bool IsGroupMember(UUID groupID, UUID userID, ulong powers)
{
ScenePresence sp = m_scene.GetScenePresence(userID);
if (sp != null)
{
IClientAPI client = sp.ControllingClient;
if (null == m_groupsModule)
return false;
return ((groupID == client.ActiveGroupId) && (client.ActiveGroupPowers != 0) &&
((powers == 0) || ((client.ActiveGroupPowers & powers) == powers)));
GroupMembershipData gmd = m_groupsModule.GetMembershipData(groupID, userID);
if (gmd != null)
{
if (((gmd.GroupPowers != 0) && powers == 0) || (gmd.GroupPowers & powers) == powers)
return true;
}
return false;
}
@ -721,8 +728,17 @@ namespace OpenSim.Region.CoreModules.World.Permissions
permission = false;
}
// m_log.DebugFormat(
// "[PERMISSIONS]: group.GroupID = {0}, part.GroupMask = {1}, isGroupMember = {2} for {3}",
// group.GroupID,
// m_scene.GetSceneObjectPart(objId).GroupMask,
// IsGroupMember(group.GroupID, currentUser, 0),
// currentUser);
// Group members should be able to edit group objects
if ((group.GroupID != UUID.Zero) && ((m_scene.GetSceneObjectPart(objId).GroupMask & (uint)PermissionMask.Modify) != 0) && IsGroupMember(group.GroupID, currentUser, 0))
if ((group.GroupID != UUID.Zero)
&& ((m_scene.GetSceneObjectPart(objId).GroupMask & (uint)PermissionMask.Modify) != 0)
&& IsGroupMember(group.GroupID, currentUser, 0))
{
// Return immediately, so that the administrator can shares group objects
return true;
@ -957,7 +973,6 @@ namespace OpenSim.Region.CoreModules.World.Permissions
DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name);
if (m_bypassPermissions) return m_bypassPermissionsValue;
return GenericObjectPermission(editorID, objectID, false);
}

View File

@ -94,7 +94,7 @@ namespace OpenSim.Region.DataSnapshot
if (!m_configLoaded)
{
m_configLoaded = true;
m_log.Info("[DATASNAPSHOT]: Loading configuration");
//m_log.Debug("[DATASNAPSHOT]: Loading configuration");
//Read from the config for options
lock (m_syncInit)
{
@ -123,7 +123,7 @@ namespace OpenSim.Region.DataSnapshot
}
catch (Exception)
{
m_log.Info("[DATASNAPSHOT]: Could not load configuration. DataSnapshot will be disabled.");
m_log.Warn("[DATASNAPSHOT]: Could not load configuration. DataSnapshot will be disabled.");
m_enabled = false;
return;
}
@ -179,7 +179,7 @@ namespace OpenSim.Region.DataSnapshot
}
else
{
m_log.Warn("[DATASNAPSHOT]: Data snapshot disabled, not adding scene to module (or anything else).");
//m_log.Debug("[DATASNAPSHOT]: Data snapshot disabled, not adding scene to module (or anything else).");
}
}

View File

@ -129,6 +129,7 @@ namespace OpenSim.Region.Examples.SimpleModule
public event Action<UUID> OnRemoveAvatar;
public event CreateNewInventoryItem OnCreateNewInventoryItem;
public event LinkInventoryItem OnLinkInventoryItem;
public event CreateInventoryFolder OnCreateNewInventoryFolder;
public event UpdateInventoryFolder OnUpdateInventoryFolder;
public event MoveInventoryFolder OnMoveInventoryFolder;

View File

@ -27,6 +27,7 @@
using System;
using OpenMetaverse;
using OpenMetaverse.Packets;
using OpenSim.Framework;
using OpenSim.Region.Framework.Scenes;
@ -81,6 +82,34 @@ namespace OpenSim.Region.Framework.Interfaces
UUID RezSingleAttachmentFromInventory(
IClientAPI remoteClient, UUID itemID, uint AttachmentPt, bool updateInventoryStatus);
/// <summary>
/// Rez multiple attachments from a user's inventory
/// </summary>
/// <param name="remoteClient"></param>
/// <param name="header"></param>
/// <param name="objects"></param>
void RezMultipleAttachmentsFromInventory(
IClientAPI remoteClient,
RezMultipleAttachmentsFromInvPacket.HeaderDataBlock header,
RezMultipleAttachmentsFromInvPacket.ObjectDataBlock[] objects);
/// <summary>
/// Detach an object from the avatar.
/// </summary>
///
/// This method is called in response to a client's detach request, so we only update the information in
/// inventory
/// <param name="objectLocalID"></param>
/// <param name="remoteClient"></param>
void DetachObject(uint objectLocalID, IClientAPI remoteClient);
/// <summary>
/// Detach the given item to the ground.
/// </summary>
/// <param name="itemID"></param>
/// <param name="remoteClient"></param>
void DetachSingleAttachmentToGround(UUID itemID, IClientAPI remoteClient);
/// <summary>
/// Update the user inventory to the attachment of an item
/// </summary>

View File

@ -73,6 +73,9 @@ namespace OpenSim.Region.Framework.Interfaces
/// </summary>
void CreateScriptInstances(int startParam, bool postOnRez, string engine, int stateSource);
ArrayList GetScriptErrors(UUID itemID);
void ResumeScripts();
/// <summary>
/// Stop all the scripts in this entity.
/// </summary>

View File

@ -90,8 +90,12 @@ namespace OpenSim.Region.Framework.Interfaces
/// If true, the loaded region merges with the existing one rather than replacing it. Any terrain or region
/// settings in the archive will be ignored.
/// </param>
/// <param name="skipAssets">
/// If true, the archive is loaded without loading any assets contained within it. This is useful if the
/// assets are already known to be present in the grid's asset service.
/// </param>
/// <param name="requestId">If supplied, this request Id is later returned in the saved event</param>
void DearchiveRegion(string loadPath, bool merge, Guid requestId);
void DearchiveRegion(string loadPath, bool merge, bool skipAssets, Guid requestId);
/// <summary>
/// Dearchive a region from a stream. This replaces the existing scene.
@ -113,7 +117,11 @@ namespace OpenSim.Region.Framework.Interfaces
/// If true, the loaded region merges with the existing one rather than replacing it. Any terrain or region
/// settings in the archive will be ignored.
/// </param>
/// <param name="skipAssets">
/// If true, the archive is loaded without loading any assets contained within it. This is useful if the
/// assets are already known to be present in the grid's asset service.
/// </param
/// <param name="requestId">If supplied, this request Id is later returned in the saved event</param>
void DearchiveRegion(Stream loadStream, bool merge, Guid requestId);
void DearchiveRegion(Stream loadStream, bool merge, bool skipAssets, Guid requestId);
}
}

View File

@ -41,6 +41,14 @@ namespace OpenSim.Region.Framework.Interfaces
bool PostScriptEvent(UUID itemID, string name, Object[] args);
bool PostObjectEvent(UUID itemID, string name, Object[] args);
// Suspend ALL scripts in a given scene object. The item ID
// is the UUID of a SOG, and the method acts on all contained
// scripts. This is different from the suspend/resume that
// can be issued by a client.
//
void SuspendScript(UUID itemID);
void ResumeScript(UUID itemID);
ArrayList GetScriptErrors(UUID itemID);
}
}

View File

@ -420,11 +420,12 @@ namespace OpenSim.Region.Framework.Scenes.Animation
if (m_scenePresence.IsChildAgent)
return;
m_scenePresence.Scene.ForEachScenePresence(
delegate(ScenePresence SP)
{
SP.Animator.SendAnimPack();
});
UUID[] animIDs;
int[] sequenceNums;
UUID[] objectIDs;
m_animations.GetArrays(out animIDs, out sequenceNums, out objectIDs);
client.SendAnimations(animIDs, sequenceNums, m_scenePresence.ControllingClient.AgentId, objectIDs);
}
/// <summary>

View File

@ -35,7 +35,6 @@ using OpenMetaverse;
using OpenMetaverse.Packets;
using log4net;
using OpenSim.Framework;
using OpenSim.Region.Framework;
using OpenSim.Region.Framework.Interfaces;
using OpenSim.Region.Framework.Scenes.Serialization;
@ -64,6 +63,7 @@ namespace OpenSim.Region.Framework.Scenes
if (group is SceneObjectGroup)
{
((SceneObjectGroup) group).CreateScriptInstances(0, false, DefaultScriptEngine, 0);
((SceneObjectGroup) group).ResumeScripts();
}
}
}
@ -218,6 +218,7 @@ namespace OpenSim.Region.Framework.Scenes
{
remoteClient.SendAgentAlertMessage("Script saved", false);
}
part.ParentGroup.ResumeScripts();
return errors;
}
@ -471,7 +472,6 @@ namespace OpenSim.Region.Framework.Scenes
return null;
}
if (recipientParentFolderId == UUID.Zero)
{
InventoryFolderBase recipientRootFolder = InventoryService.GetRootFolder(recipientId);
@ -721,6 +721,37 @@ namespace OpenSim.Region.Framework.Scenes
}
}
private void HandleLinkInventoryItem(IClientAPI remoteClient, UUID transActionID, UUID folderID,
uint callbackID, string description, string name,
sbyte invType, sbyte type, UUID olditemID)
{
m_log.DebugFormat("[AGENT INVENTORY]: Received request to create inventory item link {0} in folder {1} pointing to {2}", name, folderID, olditemID);
if (!Permissions.CanCreateUserInventory(invType, remoteClient.AgentId))
return;
ScenePresence presence;
if (TryGetScenePresence(remoteClient.AgentId, out presence))
{
byte[] data = null;
AssetBase asset = new AssetBase();
asset.FullID = olditemID;
asset.Type = type;
asset.Name = name;
asset.Description = description;
CreateNewInventoryItem(remoteClient, remoteClient.AgentId.ToString(), folderID, name, 0, callbackID, asset, invType, (uint)PermissionMask.All, (uint)PermissionMask.All, (uint)PermissionMask.All, (uint)PermissionMask.All, (uint)PermissionMask.All, Util.UnixTimeSinceEpoch());
}
else
{
m_log.ErrorFormat(
"ScenePresence for agent uuid {0} unexpectedly not found in HandleLinkInventoryItem",
remoteClient.AgentId);
}
}
/// <summary>
/// Remove an inventory item for the client's inventory
/// </summary>
@ -1163,6 +1194,7 @@ namespace OpenSim.Region.Framework.Scenes
item = LibraryService.LibraryRootFolder.FindItem(itemID);
}
// If we've found the item in the user's inventory or in the library
if (item != null)
{
part.ParentGroup.AddInventoryItem(remoteClient, primLocalID, item, copyID);
@ -1841,50 +1873,6 @@ namespace OpenSim.Region.Framework.Scenes
EventManager.TriggerStopScript(part.LocalId, itemID);
}
internal void SendAttachEvent(uint localID, UUID itemID, UUID avatarID)
{
EventManager.TriggerOnAttach(localID, itemID, avatarID);
}
public void RezMultipleAttachments(IClientAPI remoteClient, RezMultipleAttachmentsFromInvPacket.HeaderDataBlock header,
RezMultipleAttachmentsFromInvPacket.ObjectDataBlock[] objects)
{
foreach (RezMultipleAttachmentsFromInvPacket.ObjectDataBlock obj in objects)
{
AttachmentsModule.RezSingleAttachmentFromInventory(remoteClient, obj.ItemID, obj.AttachmentPt);
}
}
public void DetachSingleAttachmentToGround(UUID itemID, IClientAPI remoteClient)
{
SceneObjectPart part = GetSceneObjectPart(itemID);
if (part == null || part.ParentGroup == null)
return;
UUID inventoryID = part.ParentGroup.GetFromItemID();
ScenePresence presence;
if (TryGetScenePresence(remoteClient.AgentId, out presence))
{
if (!Permissions.CanRezObject(part.ParentGroup.Children.Count, remoteClient.AgentId, presence.AbsolutePosition))
return;
presence.Appearance.DetachAttachment(itemID);
IAvatarFactory ava = RequestModuleInterface<IAvatarFactory>();
if (ava != null)
{
ava.UpdateDatabase(remoteClient.AgentId, presence.Appearance);
}
part.ParentGroup.DetachToGround();
List<UUID> uuids = new List<UUID>();
uuids.Add(inventoryID);
InventoryService.DeleteItems(remoteClient.AgentId, uuids);
remoteClient.SendRemoveInventoryItem(inventoryID);
}
SendAttachEvent(part.ParentGroup.LocalId, itemID, UUID.Zero);
}
public void GetScriptRunning(IClientAPI controllingClient, UUID objectID, UUID itemID)
{
EventManager.TriggerGetScriptRunning(controllingClient, objectID, itemID);

View File

@ -1159,7 +1159,6 @@ namespace OpenSim.Region.Framework.Scenes
{
if (m_scripts_enabled != !ScriptEngine)
{
// Tedd! Here's the method to disable the scripting engine!
if (ScriptEngine)
{
m_log.Info("Stopping all Scripts in Scene");
@ -1181,6 +1180,7 @@ namespace OpenSim.Region.Framework.Scenes
if (ent is SceneObjectGroup)
{
((SceneObjectGroup)ent).CreateScriptInstances(0, false, DefaultScriptEngine, 0);
((SceneObjectGroup)ent).ResumeScripts();
}
}
}
@ -2777,6 +2777,7 @@ namespace OpenSim.Region.Framework.Scenes
public virtual void SubscribeToClientInventoryEvents(IClientAPI client)
{
client.OnCreateNewInventoryItem += CreateNewInventoryItem;
client.OnLinkInventoryItem += HandleLinkInventoryItem;
client.OnCreateNewInventoryFolder += HandleCreateInventoryFolder;
client.OnUpdateInventoryFolder += HandleUpdateInventoryFolder;
client.OnMoveInventoryFolder += HandleMoveInventoryFolder; // 2; //!!
@ -2797,13 +2798,12 @@ namespace OpenSim.Region.Framework.Scenes
public virtual void SubscribeToClientAttachmentEvents(IClientAPI client)
{
client.OnRezMultipleAttachmentsFromInv += RezMultipleAttachments;
client.OnObjectDetach += m_sceneGraph.DetachObject;
if (AttachmentsModule != null)
{
client.OnRezSingleAttachmentFromInv += AttachmentsModule.RezSingleAttachmentFromInventory;
client.OnRezMultipleAttachmentsFromInv += AttachmentsModule.RezMultipleAttachmentsFromInventory;
client.OnObjectAttach += AttachmentsModule.AttachObject;
client.OnObjectDetach += AttachmentsModule.DetachObject;
client.OnDetachAttachmentIntoInv += AttachmentsModule.ShowDetachInUserInventory;
}
}
@ -2953,13 +2953,12 @@ namespace OpenSim.Region.Framework.Scenes
public virtual void UnSubscribeToClientAttachmentEvents(IClientAPI client)
{
client.OnRezMultipleAttachmentsFromInv -= RezMultipleAttachments;
client.OnObjectDetach -= m_sceneGraph.DetachObject;
if (AttachmentsModule != null)
{
client.OnRezSingleAttachmentFromInv -= AttachmentsModule.RezSingleAttachmentFromInventory;
client.OnRezMultipleAttachmentsFromInv -= AttachmentsModule.RezMultipleAttachmentsFromInventory;
client.OnObjectAttach -= AttachmentsModule.AttachObject;
client.OnObjectDetach -= AttachmentsModule.DetachObject;
client.OnDetachAttachmentIntoInv -= AttachmentsModule.ShowDetachInUserInventory;
}
}

View File

@ -467,9 +467,7 @@ namespace OpenSim.Region.Framework.Scenes
{
SceneObjectGroup group = GetGroupByPrim(objectLocalID);
if (group != null)
{
m_parentScene.DetachSingleAttachmentToGround(group.UUID, remoteClient);
}
m_parentScene.AttachmentsModule.DetachSingleAttachmentToGround(group.UUID, remoteClient);
}
protected internal void DetachObject(uint objectLocalID, IClientAPI remoteClient)
@ -1781,6 +1779,7 @@ namespace OpenSim.Region.Framework.Scenes
copy.CreateScriptInstances(0, false, m_parentScene.DefaultScriptEngine, 0);
copy.HasGroupChanged = true;
copy.ScheduleGroupForFullUpdate();
copy.ResumeScripts();
// required for physics to update it's position
copy.AbsolutePosition = copy.AbsolutePosition;

View File

@ -171,7 +171,9 @@ namespace OpenSim.Region.Framework.Scenes
item.NextPermissions;
taskItem.NextPermissions = item.NextPermissions;
taskItem.CurrentPermissions |= 8;
} else {
}
else
{
taskItem.BasePermissions = item.BasePermissions;
taskItem.CurrentPermissions = item.CurrentPermissions;
taskItem.CurrentPermissions |= 8;
@ -412,5 +414,13 @@ namespace OpenSim.Region.Framework.Scenes
scriptModule.SetXMLState(itemID, n.OuterXml);
}
}
public void ResumeScripts()
{
foreach (SceneObjectPart part in m_parts.Values)
{
part.Inventory.ResumeScripts();
}
}
}
}

View File

@ -212,7 +212,7 @@ namespace OpenSim.Region.Framework.Scenes
}
}
private ArrayList GetScriptErrors(UUID itemID)
public ArrayList GetScriptErrors(UUID itemID)
{
ArrayList ret = new ArrayList();
@ -653,6 +653,7 @@ namespace OpenSim.Region.Framework.Scenes
item.ParentID = m_part.UUID;
item.ParentPartID = m_part.UUID;
item.Name = name;
item.GroupID = m_part.GroupID;
m_items.LockItemsForWrite(true);
m_items.Add(item.ItemID, item);
@ -742,6 +743,12 @@ namespace OpenSim.Region.Framework.Scenes
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;
@ -894,6 +901,7 @@ namespace OpenSim.Region.Framework.Scenes
uint everyoneMask = 0;
uint baseMask = item.BasePermissions;
uint ownerMask = item.CurrentPermissions;
uint groupMask = item.GroupPermissions;
invString.AddItemStart();
invString.AddNameValueLine("item_id", item.ItemID.ToString());
@ -903,7 +911,7 @@ namespace OpenSim.Region.Framework.Scenes
invString.AddNameValueLine("base_mask", Utils.UIntToHexString(baseMask));
invString.AddNameValueLine("owner_mask", Utils.UIntToHexString(ownerMask));
invString.AddNameValueLine("group_mask", Utils.UIntToHexString(0));
invString.AddNameValueLine("group_mask", Utils.UIntToHexString(groupMask));
invString.AddNameValueLine("everyone_mask", Utils.UIntToHexString(everyoneMask));
invString.AddNameValueLine("next_owner_mask", Utils.UIntToHexString(item.NextPermissions));
@ -1137,5 +1145,29 @@ namespace OpenSim.Region.Framework.Scenes
}
return ret;
}
public void ResumeScripts()
{
IScriptModule[] engines = m_part.ParentGroup.Scene.RequestModuleInterfaces<IScriptModule>();
if (engines == null)
return;
Items.LockItemsForRead(true);
foreach (TaskInventoryItem item in m_items.Values)
{
if (item.InvType == (int)InventoryType.LSL)
{
foreach (IScriptModule engine in engines)
{
if (engine != null)
engine.ResumeScript(item.ItemID);
}
}
}
Items.LockItemsForRead(false);
}
}
}

View File

@ -959,6 +959,7 @@ namespace OpenSim.Region.Framework.Scenes
m_isChildAgent = false;
// send the animations of the other presences to me
m_scene.ForEachScenePresence(delegate(ScenePresence presence)
{
if (presence != this)

View File

@ -182,6 +182,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
foreach (SceneObjectGroup sceneObject in sceneObjects)
{
sceneObject.CreateScriptInstances(0, true, scene.DefaultScriptEngine, 0);
sceneObject.ResumeScripts();
}
}

View File

@ -724,6 +724,7 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server
public event Action<UUID> OnRemoveAvatar;
public event ObjectPermissions OnObjectPermissions;
public event CreateNewInventoryItem OnCreateNewInventoryItem;
public event LinkInventoryItem OnLinkInventoryItem;
public event CreateInventoryFolder OnCreateNewInventoryFolder;
public event UpdateInventoryFolder OnUpdateInventoryFolder;
public event MoveInventoryFolder OnMoveInventoryFolder;

View File

@ -109,7 +109,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Chat
}
else
{
m_log.WarnFormat("[IRC-Bridge] Not enabled. Connect for region {0} ignored", scene.RegionInfo.RegionName);
//m_log.DebugFormat("[IRC-Bridge] Not enabled. Connect for region {0} ignored", scene.RegionInfo.RegionName);
}
}

View File

@ -167,6 +167,9 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
private bool m_debugEnabled = false;
private ExpiringCache<string, OSDMap> m_memoryCache;
private int m_cacheTimeout = 30;
// private IUserAccountService m_accountService = null;
@ -203,7 +206,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
return;
}
m_log.InfoFormat("[GROUPS-CONNECTOR]: Initializing {0}", this.Name);
m_log.InfoFormat("[SIMIAN-GROUPS-CONNECTOR]: Initializing {0}", this.Name);
m_groupsServerURI = groupsConfig.GetString("GroupsServerURI", string.Empty);
if ((m_groupsServerURI == null) ||
@ -214,6 +217,22 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
return;
}
m_cacheTimeout = groupsConfig.GetInt("GroupsCacheTimeout", 30);
if (m_cacheTimeout == 0)
{
m_log.WarnFormat("[SIMIAN-GROUPS-CONNECTOR] Groups Cache Disabled.");
}
else
{
m_log.InfoFormat("[SIMIAN-GROUPS-CONNECTOR] Groups Cache Timeout set to {0}.", m_cacheTimeout);
}
m_memoryCache = new ExpiringCache<string,OSDMap>();
// If we got all the config options we need, lets start'er'up
m_connectorEnabled = true;
@ -224,7 +243,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
public void Close()
{
m_log.InfoFormat("[GROUPS-CONNECTOR]: Closing {0}", this.Name);
m_log.InfoFormat("[SIMIAN-GROUPS-CONNECTOR]: Closing {0}", this.Name);
}
public void AddRegion(OpenSim.Region.Framework.Scenes.Scene scene)
@ -657,7 +676,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
};
OSDMap response = WebUtil.PostToService(m_groupsServerURI, requestArgs);
OSDMap response = CachedPostRequest(requestArgs);
if (response["Success"].AsBoolean() && response["Entries"] is OSDArray)
{
OSDArray entryArray = (OSDArray)response["Entries"];
@ -1086,7 +1105,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
};
OSDMap Response = WebUtil.PostToService(m_groupsServerURI, RequestArgs);
OSDMap Response = CachedPostRequest(RequestArgs);
if (Response["Success"].AsBoolean())
{
return true;
@ -1113,7 +1132,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
};
OSDMap Response = WebUtil.PostToService(m_groupsServerURI, RequestArgs);
OSDMap Response = CachedPostRequest(RequestArgs);
if (Response["Success"].AsBoolean() && Response["Entries"] is OSDArray)
{
OSDArray entryArray = (OSDArray)Response["Entries"];
@ -1153,7 +1172,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
};
OSDMap Response = WebUtil.PostToService(m_groupsServerURI, RequestArgs);
OSDMap Response = CachedPostRequest(RequestArgs);
if (Response["Success"].AsBoolean() && Response["Entries"] is OSDArray)
{
OSDArray entryArray = (OSDArray)Response["Entries"];
@ -1194,7 +1213,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
};
OSDMap Response = WebUtil.PostToService(m_groupsServerURI, RequestArgs);
OSDMap Response = CachedPostRequest(RequestArgs);
if (Response["Success"].AsBoolean() && Response["Entries"] is OSDArray)
{
OSDArray entryArray = (OSDArray)Response["Entries"];
@ -1234,7 +1253,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
OSDMap response = WebUtil.PostToService(m_groupsServerURI, requestArgs);
OSDMap response = CachedPostRequest(requestArgs);
if (response["Success"].AsBoolean() && response["Entries"] is OSDArray)
{
maps = new Dictionary<string, OSDMap>();
@ -1272,7 +1291,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
OSDMap response = WebUtil.PostToService(m_groupsServerURI, requestArgs);
OSDMap response = CachedPostRequest(requestArgs);
if (response["Success"].AsBoolean() && response["Entries"] is OSDArray)
{
maps = new Dictionary<UUID, OSDMap>();
@ -1310,7 +1329,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
};
OSDMap response = WebUtil.PostToService(m_groupsServerURI, requestArgs);
OSDMap response = CachedPostRequest(requestArgs);
if (response["Success"].AsBoolean())
{
return true;
@ -1323,6 +1342,48 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
}
#endregion
#region CheesyCache
OSDMap CachedPostRequest(NameValueCollection requestArgs)
{
// Immediately forward the request if the cache is disabled.
if (m_cacheTimeout == 0)
{
return WebUtil.PostToService(m_groupsServerURI, requestArgs);
}
// Check if this is an update or a request
if ( requestArgs["RequestMethod"] == "RemoveGeneric"
|| requestArgs["RequestMethod"] == "AddGeneric"
)
{
// Any and all updates cause the cache to clear
m_memoryCache.Clear();
// Send update to server, return the response without caching it
return WebUtil.PostToService(m_groupsServerURI, requestArgs);
}
// If we're not doing an update, we must be requesting data
// Create the cache key for the request and see if we have it cached
string CacheKey = WebUtil.BuildQueryString(requestArgs);
OSDMap response = null;
if (!m_memoryCache.TryGetValue(CacheKey, out response))
{
// if it wasn't in the cache, pass the request to the Simian Grid Services
response = WebUtil.PostToService(m_groupsServerURI, requestArgs);
// and cache the response
m_memoryCache.AddOrUpdate(CacheKey, response, TimeSpan.FromSeconds(m_cacheTimeout));
}
// return cached response
return response;
}
#endregion
}
}

View File

@ -29,6 +29,7 @@ using System;
using System.Collections;
using System.Collections.Generic;
using System.Reflection;
using System.Text;
using Nwc.XmlRpc;
@ -70,6 +71,9 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
private IUserAccountService m_accountService = null;
private ExpiringCache<string, XmlRpcResponse> m_memoryCache;
private int m_cacheTimeout = 30;
// Used to track which agents are have dropped from a group chat session
// Should be reset per agent, on logon
// TODO: move this to Flotsam XmlRpc Service
@ -111,7 +115,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
return;
}
m_log.InfoFormat("[GROUPS-CONNECTOR]: Initializing {0}", this.Name);
m_log.InfoFormat("[XMLRPC-GROUPS-CONNECTOR]: Initializing {0}", this.Name);
m_groupsServerURI = groupsConfig.GetString("GroupsServerURI", string.Empty);
if ((m_groupsServerURI == null) ||
@ -128,16 +132,25 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
m_groupWriteKey = groupsConfig.GetString("XmlRpcServiceWriteKey", string.Empty);
m_cacheTimeout = groupsConfig.GetInt("GroupsCacheTimeout", 30);
if (m_cacheTimeout == 0)
{
m_log.WarnFormat("[XMLRPC-GROUPS-CONNECTOR]: Groups Cache Disabled.");
}
else
{
m_log.InfoFormat("[XMLRPC-GROUPS-CONNECTOR]: Groups Cache Timeout set to {0}.", m_cacheTimeout);
}
// If we got all the config options we need, lets start'er'up
m_memoryCache = new ExpiringCache<string, XmlRpcResponse>();
m_connectorEnabled = true;
}
}
public void Close()
{
m_log.InfoFormat("[GROUPS-CONNECTOR]: Closing {0}", this.Name);
m_log.InfoFormat("[XMLRPC-GROUPS-CONNECTOR]: Closing {0}", this.Name);
}
public void AddRegion(OpenSim.Region.Framework.Scenes.Scene scene)
@ -918,6 +931,36 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
/// Encapsulate the XmlRpc call to standardize security and error handling.
/// </summary>
private Hashtable XmlRpcCall(UUID requestingAgentID, string function, Hashtable param)
{
XmlRpcResponse resp = null;
string CacheKey = null;
// Only bother with the cache if it isn't disabled.
if (m_cacheTimeout > 0)
{
if (!function.StartsWith("groups.get"))
{
// Any and all updates cause the cache to clear
m_memoryCache.Clear();
}
else
{
StringBuilder sb = new StringBuilder(requestingAgentID + function);
foreach (object key in param.Keys)
{
if (param[key] != null)
{
sb.AppendFormat(",{0}:{1}", key.ToString(), param[key].ToString());
}
}
CacheKey = sb.ToString();
m_memoryCache.TryGetValue(CacheKey, out resp);
}
}
if( resp == null )
{
string UserService;
UUID SessionID;
@ -937,33 +980,37 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
ConfigurableKeepAliveXmlRpcRequest req;
req = new ConfigurableKeepAliveXmlRpcRequest(function, parameters, m_disableKeepAlive);
XmlRpcResponse resp = null;
try
{
resp = req.Send(m_groupsServerURI, 10000);
if ((m_cacheTimeout > 0) && (CacheKey != null))
{
m_memoryCache.AddOrUpdate(CacheKey, resp, TimeSpan.FromSeconds(m_cacheTimeout));
}
}
catch (Exception e)
{
m_log.ErrorFormat("[XMLRPCGROUPDATA]: An error has occured while attempting to access the XmlRpcGroups server method: {0}", function);
m_log.ErrorFormat("[XMLRPCGROUPDATA]: {0} ", e.ToString());
m_log.ErrorFormat("[XMLRPC-GROUPS-CONNECTOR]: An error has occured while attempting to access the XmlRpcGroups server method: {0}", function);
m_log.ErrorFormat("[XMLRPC-GROUPS-CONNECTOR]: {0} ", e.ToString());
foreach (string ResponseLine in req.RequestResponse.Split(new string[] { Environment.NewLine }, StringSplitOptions.None))
{
m_log.ErrorFormat("[XMLRPCGROUPDATA]: {0} ", ResponseLine);
m_log.ErrorFormat("[XMLRPC-GROUPS-CONNECTOR]: {0} ", ResponseLine);
}
foreach (string key in param.Keys)
{
m_log.WarnFormat("[XMLRPCGROUPDATA]: {0} :: {1}", key, param[key].ToString());
m_log.WarnFormat("[XMLRPC-GROUPS-CONNECTOR]: {0} :: {1}", key, param[key].ToString());
}
Hashtable respData = new Hashtable();
respData.Add("error", e.ToString());
return respData;
}
}
if (resp.Value is Hashtable)
{
@ -976,21 +1023,21 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
return respData;
}
m_log.ErrorFormat("[XMLRPCGROUPDATA]: The XmlRpc server returned a {1} instead of a hashtable for {0}", function, resp.Value.GetType().ToString());
m_log.ErrorFormat("[XMLRPC-GROUPS-CONNECTOR]: The XmlRpc server returned a {1} instead of a hashtable for {0}", function, resp.Value.GetType().ToString());
if (resp.Value is ArrayList)
{
ArrayList al = (ArrayList)resp.Value;
m_log.ErrorFormat("[XMLRPCGROUPDATA]: Contains {0} elements", al.Count);
m_log.ErrorFormat("[XMLRPC-GROUPS-CONNECTOR]: Contains {0} elements", al.Count);
foreach (object o in al)
{
m_log.ErrorFormat("[XMLRPCGROUPDATA]: {0} :: {1}", o.GetType().ToString(), o.ToString());
m_log.ErrorFormat("[XMLRPC-GROUPS-CONNECTOR]: {0} :: {1}", o.GetType().ToString(), o.ToString());
}
}
else
{
m_log.ErrorFormat("[XMLRPCGROUPDATA]: Function returned: {0}", resp.Value.ToString());
m_log.ErrorFormat("[XMLRPC-GROUPS-CONNECTOR]: Function returned: {0}", resp.Value.ToString());
}
Hashtable error = new Hashtable();
@ -1000,16 +1047,16 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
private void LogRespDataToConsoleError(Hashtable respData)
{
m_log.Error("[XMLRPCGROUPDATA]: Error:");
m_log.Error("[XMLRPC-GROUPS-CONNECTOR]: Error:");
foreach (string key in respData.Keys)
{
m_log.ErrorFormat("[XMLRPCGROUPDATA]: Key: {0}", key);
m_log.ErrorFormat("[XMLRPC-GROUPS-CONNECTOR]: Key: {0}", key);
string[] lines = respData[key].ToString().Split(new char[] { '\n' });
foreach (string line in lines)
{
m_log.ErrorFormat("[XMLRPCGROUPDATA]: {0}", line);
m_log.ErrorFormat("[XMLRPC-GROUPS-CONNECTOR]: {0}", line);
}
}

View File

@ -235,6 +235,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC
public event Action<UUID> OnRemoveAvatar;
public event CreateNewInventoryItem OnCreateNewInventoryItem;
public event LinkInventoryItem OnLinkInventoryItem;
public event CreateInventoryFolder OnCreateNewInventoryFolder;
public event UpdateInventoryFolder OnUpdateInventoryFolder;
public event MoveInventoryFolder OnMoveInventoryFolder;

View File

@ -81,6 +81,9 @@ namespace OpenSim.Region.ScriptEngine.Interfaces
void PostEvent(EventParams data);
void Suspend();
void Resume();
/// <summary>
/// Process the next event queued for this script
/// </summary>

View File

@ -96,6 +96,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
private bool m_startedFromSavedState;
private UUID m_CurrentStateHash;
private UUID m_RegionID;
private bool m_Suspended = true;
private Dictionary<KeyValuePair<int, int>, KeyValuePair<int, int>>
m_LineMap;
@ -640,11 +641,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
/// <returns></returns>
public object EventProcessor()
{
EventParams data = null;
lock (m_EventQueue)
{
if (m_Suspended)
return 0;
lock (m_Script)
{
data = (EventParams) m_EventQueue.Dequeue();
@ -1018,5 +1021,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
{
get { return m_RegionID; }
}
public void Suspend()
{
m_Suspended = true;
}
public void Resume()
{
m_Suspended = false;
}
}
}

View File

@ -1570,5 +1570,23 @@ namespace OpenSim.Region.ScriptEngine.XEngine
return new ArrayList();
}
}
public void SuspendScript(UUID itemID)
{
IScriptInstance instance = GetInstance(itemID);
if (instance == null)
return;
instance.Suspend();
}
public void ResumeScript(UUID itemID)
{
IScriptInstance instance = GetInstance(itemID);
if (instance == null)
return;
instance.Resume();
}
}
}

View File

@ -47,7 +47,7 @@ namespace OpenSim.Server
protected static List<IServiceConnector> m_ServiceConnectors =
new List<IServiceConnector>();
static int Main(string[] args)
public static int Main(string[] args)
{
m_Server = new HttpServerBase("R.O.B.U.S.T.", args);

View File

@ -112,60 +112,24 @@ namespace OpenSim.Services.Connectors.SimianGrid
public AssetBase Get(string id)
{
AssetBase asset = null;
// Cache fetch
if (m_cache != null)
{
asset = m_cache.Get(id);
AssetBase asset = m_cache.Get(id);
if (asset != null)
return asset;
}
Uri url;
// Determine if id is an absolute URL or a grid-relative UUID
if (!Uri.TryCreate(id, UriKind.Absolute, out url))
url = new Uri(m_serverUrl + id);
try
{
HttpWebRequest request = UntrustedHttpWebRequest.Create(url);
using (WebResponse response = request.GetResponse())
{
using (Stream responseStream = response.GetResponseStream())
{
string creatorID = response.Headers.GetOne("X-Asset-Creator-Id") ?? String.Empty;
// Create the asset object
asset = new AssetBase(id, String.Empty, SLUtil.ContentTypeToSLAssetType(response.ContentType), creatorID);
UUID assetID;
if (UUID.TryParse(id, out assetID))
asset.FullID = assetID;
// Grab the asset data from the response stream
using (MemoryStream stream = new MemoryStream())
{
responseStream.CopyTo(stream, Int32.MaxValue);
asset.Data = stream.ToArray();
}
}
return GetRemote(id);
}
// Cache store
if (m_cache != null && asset != null)
m_cache.Cache(asset);
return asset;
}
catch (Exception ex)
public AssetBase GetCached(string id)
{
m_log.Warn("[SIMIAN ASSET CONNECTOR]: Asset GET from " + url + " failed: " + ex.Message);
if (m_cache != null)
return m_cache.Get(id);
return null;
}
}
/// <summary>
/// Get an asset's metadata
@ -245,10 +209,21 @@ namespace OpenSim.Services.Connectors.SimianGrid
/// <returns>True if the id was parseable, false otherwise</returns>
public bool Get(string id, Object sender, AssetRetrieved handler)
{
// Cache fetch
if (m_cache != null)
{
AssetBase asset = m_cache.Get(id);
if (asset != null)
{
handler(id, sender, asset);
return true;
}
}
Util.FireAndForget(
delegate(object o)
{
AssetBase asset = Get(id);
AssetBase asset = GetRemote(id);
handler(id, sender, asset);
}
);
@ -407,12 +382,52 @@ namespace OpenSim.Services.Connectors.SimianGrid
#endregion IAssetService
public AssetBase GetCached(string id)
private AssetBase GetRemote(string id)
{
if (m_cache != null)
return m_cache.Get(id);
AssetBase asset = null;
Uri url;
// Determine if id is an absolute URL or a grid-relative UUID
if (!Uri.TryCreate(id, UriKind.Absolute, out url))
url = new Uri(m_serverUrl + id);
try
{
HttpWebRequest request = UntrustedHttpWebRequest.Create(url);
using (WebResponse response = request.GetResponse())
{
using (Stream responseStream = response.GetResponseStream())
{
string creatorID = response.Headers.GetOne("X-Asset-Creator-Id") ?? String.Empty;
// Create the asset object
asset = new AssetBase(id, String.Empty, SLUtil.ContentTypeToSLAssetType(response.ContentType), creatorID);
UUID assetID;
if (UUID.TryParse(id, out assetID))
asset.FullID = assetID;
// Grab the asset data from the response stream
using (MemoryStream stream = new MemoryStream())
{
responseStream.CopyTo(stream, Int32.MaxValue);
asset.Data = stream.ToArray();
}
}
}
// Cache store
if (m_cache != null && asset != null)
m_cache.Cache(asset);
return asset;
}
catch (Exception ex)
{
m_log.Warn("[SIMIAN ASSET CONNECTOR]: Asset GET from " + url + " failed: " + ex.Message);
return null;
}
}
}
}

View File

@ -583,6 +583,14 @@ namespace OpenSim.Services.Connectors.SimianGrid
{ "Permissions", permissions }
};
// Add different asset type only if it differs from inventory type
// (needed for links)
string invContentType = SLUtil.SLInvTypeToContentType(item.InvType);
string assetContentType = SLUtil.SLAssetTypeToContentType(item.AssetType);
if (invContentType != assetContentType)
extraData["LinkedItemType"] = OSD.FromString(assetContentType);
NameValueCollection requestArgs = new NameValueCollection
{
{ "RequestMethod", "AddInventoryItem" },
@ -593,6 +601,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
{ "Name", item.Name },
{ "Description", item.Description },
{ "CreatorID", item.CreatorId },
{ "ContentType", invContentType },
{ "ExtraData", OSDParser.SerializeJsonString(extraData) }
};
@ -781,6 +790,9 @@ namespace OpenSim.Services.Connectors.SimianGrid
invItem.GroupPermissions = perms["GroupMask"].AsUInteger();
invItem.NextPermissions = perms["NextOwnerMask"].AsUInteger();
}
if (extraData.ContainsKey("LinkedItemType"))
invItem.AssetType = SLUtil.ContentTypeToSLAssetType(extraData["LinkedItemType"].AsString());
}
if (invItem.BasePermissions == 0)

View File

@ -141,6 +141,7 @@ namespace OpenSim.Tests.Common.Mock
public event Action<UUID> OnRemoveAvatar;
public event CreateNewInventoryItem OnCreateNewInventoryItem;
public event LinkInventoryItem OnLinkInventoryItem;
public event CreateInventoryFolder OnCreateNewInventoryFolder;
public event UpdateInventoryFolder OnUpdateInventoryFolder;
public event MoveInventoryFolder OnMoveInventoryFolder;

View File

@ -0,0 +1,60 @@
/*
* 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 log4net;
namespace Robust._32BitLaunch
{
class Program
{
static void Main(string[] args)
{
log4net.Config.XmlConfigurator.Configure();
System.Console.WriteLine("32-bit OpenSim executor");
System.Console.WriteLine("-----------------------");
System.Console.WriteLine("");
System.Console.WriteLine("This application is compiled for 32-bit CPU and will run under WOW32 or similar.");
System.Console.WriteLine("All 64-bit incompatibilities should be gone.");
System.Console.WriteLine("");
System.Threading.Thread.Sleep(300);
try
{
global::OpenSim.Server.OpenSimServer.Main(args);
}
catch (Exception ex)
{
System.Console.WriteLine("OpenSim threw an exception:");
System.Console.WriteLine(ex.ToString());
System.Console.WriteLine("");
System.Console.WriteLine("Application will now terminate!");
System.Console.WriteLine("");
}
}
}
}

View File

@ -0,0 +1,63 @@
/*
* 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.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Robust.32BitLaunch")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("http://opensimulator.org")]
[assembly: AssemblyProduct("Robust.32BitLaunch")]
[assembly: AssemblyCopyright("Copyright (c) 2008")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("5072e919-46ab-47e6-8a63-08108324ccdf")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("0.6.3.*")]
[assembly: AssemblyVersion("0.6.3.*")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@ -0,0 +1,62 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.30729</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{595D67F3-B413-4A43-8568-5B5930E3B31D}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Robust._32BitLaunch</RootNamespace>
<AssemblyName>Robust.32BitLaunch</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\..\..\bin\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>x86</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\bin\log4net.dll</HintPath>
</Reference>
<Reference Include="OpenSim.Server, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\bin\OpenSim.Server.exe</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View File

@ -0,0 +1,20 @@

Microsoft Visual Studio Solution File, Format Version 10.00
# Visual C# Express 2008
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Robust.32BitLaunch", "Robust.32BitLaunch.csproj", "{595D67F3-B413-4A43-8568-5B5930E3B31D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{595D67F3-B413-4A43-8568-5B5930E3B31D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{595D67F3-B413-4A43-8568-5B5930E3B31D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{595D67F3-B413-4A43-8568-5B5930E3B31D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{595D67F3-B413-4A43-8568-5B5930E3B31D}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

View File

@ -59,7 +59,8 @@ Once you are presented with a prompt that looks like:
You have successfully started OpenSim.
Before you can log in you will need to create a user account. You can do
Before you can log in you will need to create a user account if you didn't already create
your user as the "Master Avatar" during the region configuration stage. You can do
this by running the "create user" command on the OpenSim console. This will
ask you a series of questions such as first name, last name and password.

BIN
bin/Robust.32BitLaunch.exe Normal file

Binary file not shown.

View File

@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net" />
</configSections>
<runtime>
<gcConcurrent enabled="true" />
<gcServer enabled="true" />
</runtime>
<appSettings>
</appSettings>
<log4net>
<appender name="Console" type="OpenSim.Framework.Console.OpenSimAppender, OpenSim.Framework.Console">
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date{HH:mm:ss} - %message%newline" />
</layout>
</appender>
<appender name="LogFileAppender" type="log4net.Appender.FileAppender">
<file value="Robust.32BitLaunch.log" />
<appendToFile value="true" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date %-5level - %logger %message%newline" />
</layout>
</appender>
<root>
<level value="DEBUG" />
<appender-ref ref="Console" />
<appender-ref ref="LogFileAppender" />
</root>
</log4net>
</configuration>