Merge branch 'master' of ssh://opensimulator.org/var/git/opensim

viewer-2-initial-appearance
justincc 2010-12-15 00:35:36 +00:00
commit b643661938
61 changed files with 1565 additions and 736 deletions

View File

@ -128,6 +128,11 @@
</exec>
<fail message="Failures reported in unit tests." unless="${int::parse(testresult.opensim.region.coremodules.tests)==0}" />
<exec program="${nunitcmd}" failonerror="true" resultproperty="testresult.opensim.region.optionalmodules.tests">
<arg value="./bin/OpenSim.Region.OptionalModules.Tests.dll" />
</exec>
<fail message="Failures reported in unit tests." unless="${int::parse(testresult.opensim.region.optionalmodules.tests)==0}" />
<exec program="${nunitcmd}" failonerror="true" resultproperty="testresult.opensim.region.framework.tests">
<arg value="./bin/OpenSim.Region.Framework.Tests.dll" />
</exec>
@ -202,6 +207,17 @@
<arg value="--export-html=./cov/OpenSim.Region.CoreModules ./cov/OpenSim.Region.CoreModules.cov" />
</exec>
<exec program="mono">
<arg value="--debug" />
<arg value="--profile=monocov:outfile=./cov/OpenSim.Region.OptionalModules.cov,+[OpenSim.Region.OptionalModules]" />
<arg value="/usr/lib/nunit/nunit-console.exe" />
<arg value="./bin/OpenSim.Region.OptionalModules.Tests.dll" />
</exec>
<delete dir="./cov/OpenSim.Region.OptionalModules" />
<exec program="monocov">
<arg value="--export-html=./cov/OpenSim.Region.OptionalModules ./cov/OpenSim.Region.OptionalModules.cov" />
</exec>
<exec program="mono">
<arg value="--debug" />
<arg value="--profile=monocov:outfile=./cov/OpenSim.Region.Framework.cov,+[OpenSim.Region.Framework]" />
@ -298,6 +314,11 @@
<arg value="-xml=test-results/OpenSim.Region.CoreModules.Tests.dll-Results.xml" />
</exec>
<exec program="${nunitcmd}" failonerror="false" resultproperty="testresult.opensim.region.optionalmodules.tests">
<arg value="./bin/OpenSim.Region.OptionalModules.Tests.dll" />
<arg value="-xml=test-results/OpenSim.Region.OptionalModules.Tests.dll-Results.xml" />
</exec>
<exec program="${nunitcmd}" failonerror="false" resultproperty="testresult.opensim.region.framework.tests">
<arg value="./bin/OpenSim.Region.Framework.Tests.dll" />
<arg value="-xml=test-results/OpenSim.Region.Framework.Tests.dll-Results.xml" />
@ -314,6 +335,7 @@
<!-- <fail message="Failures reported in unit tests." unless="${int::parse(testresult.opensim.region.clientstack.lindenudp.tests)==0}" /> -->
<fail message="Failures reported in unit tests." unless="${int::parse(testresult.opensim.region.scriptengine.tests)==0}" />
<fail message="Failures reported in unit tests." unless="${int::parse(testresult.opensim.region.coremodules.tests)==0}" />
<fail message="Failures reported in unit tests." unless="${int::parse(testresult.opensim.region.optionalmodules.tests)==0}" />
<fail message="Failures reported in unit tests." unless="${int::parse(testresult.opensim.region.framework.tests)==0}" />
<fail message="Failures reported in unit tests." unless="${int::parse(testresult.opensim.data.tests)==0}" />
@ -338,6 +360,7 @@
<!-- <include name="./bin/OpenSim.Region.ClientStack.LindenUDP.Tests.dll" /> -->
<!-- <include name="./bin/OpenSim.Region.ScriptEngine.Tests.dll" /> -->
<!-- <include name="./bin/OpenSim.Region.CoreModules.Tests.dll" /> -->
<!-- <include name="./bin/OpenSim.Region.OptionalModules.Tests.dll" /> -->
<!-- <include name="./bin/OpenSim.Region.Framework.Tests.dll" /> -->
<!-- <include name="./bin/OpenSim.Data.SQLite.Tests.dll" /> -->
<!-- <include name="./bin/OpenSim.Data.MySQL.Tests.dll" /> -->

View File

@ -174,8 +174,9 @@ namespace OpenSim.Framework
public delegate void ParcelAccessListRequest(
UUID agentID, UUID sessionID, uint flags, int sequenceID, int landLocalID, IClientAPI remote_client);
public delegate void ParcelAccessListUpdateRequest(
UUID agentID, UUID sessionID, uint flags, int landLocalID, List<ParcelManager.ParcelAccessEntry> entries,
public delegate void ParcelAccessListUpdateRequest(UUID agentID, uint flags,
int landLocalID, UUID transactionID, int sequenceID,
int sections, List<ParcelManager.ParcelAccessEntry> entries,
IClientAPI remote_client);
public delegate void ParcelPropertiesRequest(

View File

@ -1845,7 +1845,7 @@ namespace OpenSim.Framework.Servers.HttpServer
/// property in StartHttp() for the HttpListener
public class HttpServerLogWriter : ILogWriter
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
public void Write(object source, LogPrio priority, string message)
{

View File

@ -265,10 +265,11 @@ namespace OpenSim
LoadOar);
m_console.Commands.AddCommand("region", false, "save oar",
"save oar [-v|--version=<N>] [-p|--profile=<url>] [<OAR path>]",
//"save oar [-v|--version=<N>] [-p|--profile=<url>] [<OAR path>]",
"save oar [-p|--profile=<url>] [<OAR path>]",
"Save a region's data to an OAR archive.",
"-v|--version=<N> generates scene objects as per older versions of the serialization (e.g. -v=0)" + Environment.NewLine
+ "-p|--profile=<url> adds the url of the profile service to the saved user information" + Environment.NewLine
// "-v|--version=<N> generates scene objects as per older versions of the serialization (e.g. -v=0)" + Environment.NewLine
"-p|--profile=<url> adds the url of the profile service to the saved user information" + Environment.NewLine
+ "The OAR path must be a filesystem path."
+ " If this is not given then the oar is saved to region.oar in the current directory.",
SaveOar);

View File

@ -3553,15 +3553,18 @@ namespace OpenSim.Region.ClientStack.LindenUDP
OpenSim.Framework.Lazy<List<ObjectUpdatePacket.ObjectDataBlock>> objectUpdateBlocks = new OpenSim.Framework.Lazy<List<ObjectUpdatePacket.ObjectDataBlock>>();
OpenSim.Framework.Lazy<List<ObjectUpdateCompressedPacket.ObjectDataBlock>> compressedUpdateBlocks = new OpenSim.Framework.Lazy<List<ObjectUpdateCompressedPacket.ObjectDataBlock>>();
OpenSim.Framework.Lazy<List<ImprovedTerseObjectUpdatePacket.ObjectDataBlock>> terseUpdateBlocks = new OpenSim.Framework.Lazy<List<ImprovedTerseObjectUpdatePacket.ObjectDataBlock>>();
OpenSim.Framework.Lazy<List<ImprovedTerseObjectUpdatePacket.ObjectDataBlock>> terseAgentUpdateBlocks = new OpenSim.Framework.Lazy<List<ImprovedTerseObjectUpdatePacket.ObjectDataBlock>>();
if (maxUpdates <= 0) maxUpdates = Int32.MaxValue;
int updatesThisCall = 0;
lock (m_entityUpdates.SyncRoot)
{
EntityUpdate update;
while (updatesThisCall < maxUpdates && m_entityUpdates.TryDequeue(out update))
while (updatesThisCall < maxUpdates)
{
lock (m_entityUpdates.SyncRoot)
if (!m_entityUpdates.TryDequeue(out update))
break;
if (update.Entity is SceneObjectPart)
{
SceneObjectPart part = (SceneObjectPart)update.Entity;
@ -3696,6 +3699,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
}
else
{
if (update.Entity is ScenePresence && ((ScenePresence)update.Entity).UUID == AgentId)
// Self updates go into a special list
terseAgentUpdateBlocks.Value.Add(CreateImprovedTerseBlock(update.Entity, updateFlags.HasFlag(PrimUpdateFlags.Textures)));
else
// Everything else goes here
terseUpdateBlocks.Value.Add(CreateImprovedTerseBlock(update.Entity, updateFlags.HasFlag(PrimUpdateFlags.Textures)));
}
@ -3707,6 +3715,21 @@ namespace OpenSim.Region.ClientStack.LindenUDP
const float TIME_DILATION = 1.0f;
ushort timeDilation = Utils.FloatToUInt16(TIME_DILATION, 0.0f, 1.0f);
if (terseAgentUpdateBlocks.IsValueCreated)
{
List<ImprovedTerseObjectUpdatePacket.ObjectDataBlock> blocks = terseAgentUpdateBlocks.Value;
ImprovedTerseObjectUpdatePacket packet = new ImprovedTerseObjectUpdatePacket();
packet.RegionData.RegionHandle = m_scene.RegionInfo.RegionHandle;
packet.RegionData.TimeDilation = timeDilation;
packet.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[blocks.Count];
for (int i = 0; i < blocks.Count; i++)
packet.ObjectData[i] = blocks[i];
OutPacket(packet, ThrottleOutPacketType.Unknown, true);
}
if (objectUpdateBlocks.IsValueCreated)
{
List<ObjectUpdatePacket.ObjectDataBlock> blocks = objectUpdateBlocks.Value;
@ -3751,7 +3774,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
OutPacket(packet, ThrottleOutPacketType.Task, true);
}
}
#endregion Packet Sending
}
@ -8239,7 +8261,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry();
entry.AgentID = block.ID;
entry.Flags = (AccessList)block.Flags;
entry.Time = new DateTime();
entry.Time = Util.ToDateTime(block.Time);
entries.Add(entry);
}
@ -8247,8 +8269,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP
if (handlerParcelAccessListUpdateRequest != null)
{
handlerParcelAccessListUpdateRequest(updatePacket.AgentData.AgentID,
updatePacket.AgentData.SessionID, updatePacket.Data.Flags,
updatePacket.Data.LocalID, entries, this);
updatePacket.Data.Flags,
updatePacket.Data.LocalID,
updatePacket.Data.TransactionID,
updatePacket.Data.SequenceID,
updatePacket.Data.Sections,
entries, this);
}
return true;
}

View File

@ -226,7 +226,7 @@ namespace OpenSim.Region.CoreModules.Avatar.ObjectCaps
}
else
{
AssetBase newTexture = new AssetBase(texture.ID + "-" + format, texture.Name, (sbyte)AssetType.Texture, texture.CreatorID);
AssetBase newTexture = new AssetBase(texture.ID + "-" + format, texture.Name, (sbyte)AssetType.Texture, texture.Metadata.CreatorID);
newTexture.Data = ConvertTextureData(texture, format);
if (newTexture.Data.Length == 0)
return false; // !!! Caller try another codec, please!
@ -336,7 +336,7 @@ namespace OpenSim.Region.CoreModules.Avatar.ObjectCaps
try
{
// Taking our jpeg2000 data, decoding it, then saving it to a byte array with regular jpeg data
// Taking our jpeg2000 data, decoding it, then saving it to a byte array with regular data
imgstream = new MemoryStream();

View File

@ -484,6 +484,22 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
}
}
public void UpdateAttachmentPosition(SceneObjectGroup sog, Vector3 pos)
{
// First we save the
// attachment point information, then we update the relative
// positioning. Then we have to mark the object as NOT an
// attachment. This is necessary in order to correctly save
// and retrieve GroupPosition information for the attachment.
// Finally, we restore the object's attachment status.
byte attachmentPoint = sog.GetAttachmentPoint();
sog.UpdateGroupPosition(pos);
sog.RootPart.IsAttachment = false;
sog.AbsolutePosition = sog.RootPart.AttachedPos;
sog.SetAttachmentPoint(attachmentPoint);
sog.HasGroupChanged = true;
}
/// <summary>
/// Update the attachment asset for the new sog details if they have changed.
/// </summary>

View File

@ -156,7 +156,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
/// <param name="inventoryFolder">The inventory folder to save</param>
/// <param name="path">The path to which the folder should be saved</param>
/// <param name="saveThisFolderItself">If true, save this folder itself. If false, only saves contents</param>
protected void SaveInvFolder(InventoryFolderBase inventoryFolder, string path, bool saveThisFolderItself, Dictionary<string, object> options, IUserAccountService userAccountService)
/// <param name="options"></param>
/// <param name="userAccountService"></param>
protected void SaveInvFolder(
InventoryFolderBase inventoryFolder, string path, bool saveThisFolderItself,
Dictionary<string, object> options, IUserAccountService userAccountService)
{
if (saveThisFolderItself)
{
@ -249,7 +253,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
// Write out control file. This has to be done first so that subsequent loaders will see this file first
// XXX: I know this is a weak way of doing it since external non-OAR aware tar executables will not do this
m_archiveWriter.WriteFile(ArchiveConstants.CONTROL_FILE_PATH, Create0p1ControlFile());
// not sure how to fix this though, short of going with a completely different file format.
m_archiveWriter.WriteFile(ArchiveConstants.CONTROL_FILE_PATH, CreateControlFile(options));
m_log.InfoFormat("[INVENTORY ARCHIVER]: Added control file to archive.");
if (inventoryFolder != null)
@ -372,12 +377,24 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
}
/// <summary>
/// Create the control file for a 0.1 version archive
/// Create the control file for the archive
/// </summary>
/// <param name="options"></param>
/// <returns></returns>
public static string Create0p1ControlFile()
public static string CreateControlFile(Dictionary<string, object> options)
{
int majorVersion = 0, minorVersion = 1;
int majorVersion, minorVersion;
if (options.ContainsKey("profile"))
{
majorVersion = 1;
minorVersion = 0;
}
else
{
majorVersion = 0;
minorVersion = 1;
}
m_log.InfoFormat("[INVENTORY ARCHIVER]: Creating version {0}.{1} IAR", majorVersion, minorVersion);

View File

@ -55,7 +55,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
/// <value>
/// Enable or disable checking whether the iar user is actually logged in
/// </value>
public bool DisablePresenceChecks { get; set; }
// public bool DisablePresenceChecks { get; set; }
public event InventoryArchiveSaved OnInventoryArchiveSaved;
@ -95,10 +95,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
public InventoryArchiverModule() {}
public InventoryArchiverModule(bool disablePresenceChecks)
{
DisablePresenceChecks = disablePresenceChecks;
}
// public InventoryArchiverModule(bool disablePresenceChecks)
// {
// DisablePresenceChecks = disablePresenceChecks;
// }
public void Initialise(Scene scene, IConfigSource source)
{
@ -172,8 +172,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
if (userInfo != null)
{
if (CheckPresence(userInfo.PrincipalID))
{
// if (CheckPresence(userInfo.PrincipalID))
// {
try
{
new InventoryArchiveWriteRequest(id, this, m_aScene, userInfo, invPath, saveStream).Execute(options, UserAccountService);
@ -189,13 +189,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
}
return true;
}
else
{
m_log.ErrorFormat(
"[INVENTORY ARCHIVER]: User {0} {1} {2} not logged in to this region simulator",
userInfo.FirstName, userInfo.LastName, userInfo.PrincipalID);
}
// }
// else
// {
// m_log.ErrorFormat(
// "[INVENTORY ARCHIVER]: User {0} {1} {2} not logged in to this region simulator",
// userInfo.FirstName, userInfo.LastName, userInfo.PrincipalID);
// }
}
}
@ -212,8 +212,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
if (userInfo != null)
{
if (CheckPresence(userInfo.PrincipalID))
{
// if (CheckPresence(userInfo.PrincipalID))
// {
try
{
new InventoryArchiveWriteRequest(id, this, m_aScene, userInfo, invPath, savePath).Execute(options, UserAccountService);
@ -229,13 +229,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
}
return true;
}
else
{
m_log.ErrorFormat(
"[INVENTORY ARCHIVER]: User {0} {1} {2} not logged in to this region simulator",
userInfo.FirstName, userInfo.LastName, userInfo.PrincipalID);
}
// }
// else
// {
// m_log.ErrorFormat(
// "[INVENTORY ARCHIVER]: User {0} {1} {2} not logged in to this region simulator",
// userInfo.FirstName, userInfo.LastName, userInfo.PrincipalID);
// }
}
}
@ -257,9 +257,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
if (userInfo != null)
{
if (CheckPresence(userInfo.PrincipalID))
{
// if (CheckPresence(userInfo.PrincipalID))
// {
InventoryArchiveReadRequest request;
bool merge = (options.ContainsKey("merge") ? (bool)options["merge"] : false);
@ -280,13 +279,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
UpdateClientWithLoadedNodes(userInfo, request.Execute());
return true;
}
else
{
m_log.ErrorFormat(
"[INVENTORY ARCHIVER]: User {0} {1} {2} not logged in to this region simulator",
userInfo.FirstName, userInfo.LastName, userInfo.PrincipalID);
}
// }
// else
// {
// m_log.ErrorFormat(
// "[INVENTORY ARCHIVER]: User {0} {1} {2} not logged in to this region simulator",
// userInfo.FirstName, userInfo.LastName, userInfo.PrincipalID);
// }
}
else
m_log.ErrorFormat("[INVENTORY ARCHIVER]: User {0} {1} not found",
@ -306,8 +305,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
if (userInfo != null)
{
if (CheckPresence(userInfo.PrincipalID))
{
// if (CheckPresence(userInfo.PrincipalID))
// {
InventoryArchiveReadRequest request;
bool merge = (options.ContainsKey("merge") ? (bool)options["merge"] : false);
@ -328,13 +327,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
UpdateClientWithLoadedNodes(userInfo, request.Execute());
return true;
}
else
{
m_log.ErrorFormat(
"[INVENTORY ARCHIVER]: User {0} {1} {2} not logged in to this region simulator",
userInfo.FirstName, userInfo.LastName, userInfo.PrincipalID);
}
// }
// else
// {
// m_log.ErrorFormat(
// "[INVENTORY ARCHIVER]: User {0} {1} {2} not logged in to this region simulator",
// userInfo.FirstName, userInfo.LastName, userInfo.PrincipalID);
// }
}
}
@ -529,28 +528,27 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
}
}
/// <summary>
/// Check if the given user is present in any of the scenes.
/// </summary>
/// <param name="userId">The user to check</param>
/// <returns>true if the user is in any of the scenes, false otherwise</returns>
protected bool CheckPresence(UUID userId)
{
if (DisablePresenceChecks)
return true;
foreach (Scene scene in m_scenes.Values)
{
ScenePresence p;
if ((p = scene.GetScenePresence(userId)) != null)
{
p.ControllingClient.SendAgentAlertMessage("Inventory operation has been started", false);
return true;
}
}
return false;
}
// /// <summary>
// /// Check if the given user is present in any of the scenes.
// /// </summary>
// /// <param name="userId">The user to check</param>
// /// <returns>true if the user is in any of the scenes, false otherwise</returns>
// protected bool CheckPresence(UUID userId)
// {
// if (DisablePresenceChecks)
// return true;
//
// foreach (Scene scene in m_scenes.Values)
// {
// ScenePresence p;
// if ((p = scene.GetScenePresence(userId)) != null)
// {
// p.ControllingClient.SendAgentAlertMessage("Inventory operation has been started", false);
// return true;
// }
// }
//
// return false;
// }
}
}

View File

@ -120,7 +120,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
TestHelper.InMethod();
// log4net.Config.XmlConfigurator.Configure();
InventoryArchiverModule archiverModule = new InventoryArchiverModule(true);
InventoryArchiverModule archiverModule = new InventoryArchiverModule();
Scene scene = SceneSetupHelpers.SetupScene("Inventory");
SceneSetupHelpers.SetupSceneModules(scene, archiverModule);
@ -238,7 +238,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
TestHelper.InMethod();
// log4net.Config.XmlConfigurator.Configure();
InventoryArchiverModule archiverModule = new InventoryArchiverModule(true);
InventoryArchiverModule archiverModule = new InventoryArchiverModule();
Scene scene = SceneSetupHelpers.SetupScene("Inventory");
SceneSetupHelpers.SetupSceneModules(scene, archiverModule);
@ -355,7 +355,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
// log4net.Config.XmlConfigurator.Configure();
SerialiserModule serialiserModule = new SerialiserModule();
InventoryArchiverModule archiverModule = new InventoryArchiverModule(true);
InventoryArchiverModule archiverModule = new InventoryArchiverModule();
Scene scene = SceneSetupHelpers.SetupScene("inventory");
SceneSetupHelpers.SetupSceneModules(scene, serialiserModule, archiverModule);
@ -382,7 +382,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
//log4net.Config.XmlConfigurator.Configure();
SerialiserModule serialiserModule = new SerialiserModule();
InventoryArchiverModule archiverModule = new InventoryArchiverModule(true);
InventoryArchiverModule archiverModule = new InventoryArchiverModule();
// Annoyingly, we have to set up a scene even though inventory loading has nothing to do with a scene
Scene scene = SceneSetupHelpers.SetupScene("inventory");
@ -443,7 +443,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
string humanEscapedItemName = @"You & you are a mean\/man\/";
string userPassword = "meowfood";
InventoryArchiverModule archiverModule = new InventoryArchiverModule(true);
InventoryArchiverModule archiverModule = new InventoryArchiverModule();
Scene scene = SceneSetupHelpers.SetupScene("Inventory");
SceneSetupHelpers.SetupSceneModules(scene, archiverModule);
@ -558,7 +558,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
MemoryStream archiveReadStream = new MemoryStream(archiveWriteStream.ToArray());
SerialiserModule serialiserModule = new SerialiserModule();
InventoryArchiverModule archiverModule = new InventoryArchiverModule(true);
InventoryArchiverModule archiverModule = new InventoryArchiverModule();
// Annoyingly, we have to set up a scene even though inventory loading has nothing to do with a scene
Scene scene = SceneSetupHelpers.SetupScene("inventory");
@ -619,7 +619,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
// MemoryStream archiveReadStream = new MemoryStream(archiveWriteStream.ToArray());
// SerialiserModule serialiserModule = new SerialiserModule();
// InventoryArchiverModule archiverModule = new InventoryArchiverModule(true);
// InventoryArchiverModule archiverModule = new InventoryArchiverModule();
// // Annoyingly, we have to set up a scene even though inventory loading has nothing to do with a scene
// Scene scene = SceneSetupHelpers.SetupScene();

View File

@ -1299,7 +1299,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
#region Agent Arrived
public void AgentArrivedAtDestination(UUID id)
{
//m_log.Debug(" >>> ReleaseAgent called <<< ");
m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Agent {0} released", id);
ResetFromTransit(id);
}

View File

@ -165,7 +165,7 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender
int width = 256;
int height = 256;
int alpha = 255; // 0 is transparent
Color bgColour = Color.White; // Default background color
Color bgColor = Color.White; // Default background color
char altDataDelim = ';';
char[] paramDelimiter = { ',' };
@ -253,15 +253,16 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender
alpha = 256;
}
break;
case "bgcolor":
case "bgcolour":
int hex = 0;
if (Int32.TryParse(value, NumberStyles.HexNumber, CultureInfo.InvariantCulture, out hex))
{
bgColour = Color.FromArgb(hex);
bgColor = Color.FromArgb(hex);
}
else
{
bgColour = Color.FromName(value);
bgColor = Color.FromName(value);
}
break;
case "altdatadelim":
@ -315,7 +316,7 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender
// background color in their scripts, only do when fully opaque
if (alpha >= 255)
{
graph.FillRectangle(new SolidBrush(bgColour), 0, 0, width, height);
graph.FillRectangle(new SolidBrush(bgColor), 0, 0, width, height);
}
for (int w = 0; w < bitmap.Width; w++)
@ -616,25 +617,25 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender
}
}
}
else if (nextLine.StartsWith("PenColour"))
else if (nextLine.StartsWith("PenColour") || nextLine.StartsWith("PenColor"))
{
nextLine = nextLine.Remove(0, 9);
nextLine = nextLine.Trim();
int hex = 0;
Color newColour;
Color newColor;
if (Int32.TryParse(nextLine, NumberStyles.HexNumber, CultureInfo.InvariantCulture, out hex))
{
newColour = Color.FromArgb(hex);
newColor = Color.FromArgb(hex);
}
else
{
// this doesn't fail, it just returns black if nothing is found
newColour = Color.FromName(nextLine);
newColor = Color.FromName(nextLine);
}
myBrush.Color = newColour;
drawPen.Color = newColour;
myBrush.Color = newColor;
drawPen.Color = newColor;
}
}
}

View File

@ -41,8 +41,7 @@ using GridRegion = OpenSim.Services.Interfaces.GridRegion;
namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
{
public class RemoteGridServicesConnector :
GridServicesConnector, ISharedRegionModule, IGridService
public class RemoteGridServicesConnector : ISharedRegionModule, IGridService
{
private static readonly ILog m_log =
LogManager.GetLogger(
@ -51,6 +50,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
private bool m_Enabled = false;
private IGridService m_LocalGridService;
private IGridService m_RemoteGridService;
public RemoteGridServicesConnector()
{
@ -73,7 +73,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
get { return "RemoteGridServicesConnector"; }
}
public override void Initialise(IConfigSource source)
public void Initialise(IConfigSource source)
{
IConfig moduleConfig = source.Configs["Modules"];
if (moduleConfig != null)
@ -97,9 +97,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
return;
}
base.Initialise(source);
m_LocalGridService = new LocalGridServicesConnector(source);
m_RemoteGridService = new GridServicesConnector(source);
}
public void PostInitialise()
@ -135,61 +134,61 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
#region IGridService
public override string RegisterRegion(UUID scopeID, GridRegion regionInfo)
public string RegisterRegion(UUID scopeID, GridRegion regionInfo)
{
string msg = m_LocalGridService.RegisterRegion(scopeID, regionInfo);
if (msg == String.Empty)
return base.RegisterRegion(scopeID, regionInfo);
return m_RemoteGridService.RegisterRegion(scopeID, regionInfo);
return msg;
}
public override bool DeregisterRegion(UUID regionID)
public bool DeregisterRegion(UUID regionID)
{
if (m_LocalGridService.DeregisterRegion(regionID))
return base.DeregisterRegion(regionID);
return m_RemoteGridService.DeregisterRegion(regionID);
return false;
}
public override List<GridRegion> GetNeighbours(UUID scopeID, UUID regionID)
public List<GridRegion> GetNeighbours(UUID scopeID, UUID regionID)
{
return base.GetNeighbours(scopeID, regionID);
return m_RemoteGridService.GetNeighbours(scopeID, regionID);
}
public override GridRegion GetRegionByUUID(UUID scopeID, UUID regionID)
public GridRegion GetRegionByUUID(UUID scopeID, UUID regionID)
{
GridRegion rinfo = m_LocalGridService.GetRegionByUUID(scopeID, regionID);
if (rinfo == null)
rinfo = base.GetRegionByUUID(scopeID, regionID);
rinfo = m_RemoteGridService.GetRegionByUUID(scopeID, regionID);
return rinfo;
}
public override GridRegion GetRegionByPosition(UUID scopeID, int x, int y)
public GridRegion GetRegionByPosition(UUID scopeID, int x, int y)
{
GridRegion rinfo = m_LocalGridService.GetRegionByPosition(scopeID, x, y);
if (rinfo == null)
rinfo = base.GetRegionByPosition(scopeID, x, y);
rinfo = m_RemoteGridService.GetRegionByPosition(scopeID, x, y);
return rinfo;
}
public override GridRegion GetRegionByName(UUID scopeID, string regionName)
public GridRegion GetRegionByName(UUID scopeID, string regionName)
{
GridRegion rinfo = m_LocalGridService.GetRegionByName(scopeID, regionName);
if (rinfo == null)
rinfo = base.GetRegionByName(scopeID, regionName);
rinfo = m_RemoteGridService.GetRegionByName(scopeID, regionName);
return rinfo;
}
public override List<GridRegion> GetRegionsByName(UUID scopeID, string name, int maxNumber)
public List<GridRegion> GetRegionsByName(UUID scopeID, string name, int maxNumber)
{
List<GridRegion> rinfo = m_LocalGridService.GetRegionsByName(scopeID, name, maxNumber);
//m_log.DebugFormat("[REMOTE GRID CONNECTOR]: Local GetRegionsByName {0} found {1} regions", name, rinfo.Count);
List<GridRegion> grinfo = base.GetRegionsByName(scopeID, name, maxNumber);
List<GridRegion> grinfo = m_RemoteGridService.GetRegionsByName(scopeID, name, maxNumber);
if (grinfo != null)
{
@ -202,13 +201,79 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
return rinfo;
}
// Let's not override GetRegionRange -- let's get them all from the grid server
public virtual List<GridRegion> GetRegionRange(UUID scopeID, int xmin, int xmax, int ymin, int ymax)
{
List<GridRegion> rinfo = m_LocalGridService.GetRegionRange(scopeID, xmin, xmax, ymin, ymax);
//m_log.DebugFormat("[REMOTE GRID CONNECTOR]: Local GetRegionRange {0} found {1} regions", name, rinfo.Count);
List<GridRegion> grinfo = m_RemoteGridService.GetRegionRange(scopeID, xmin, xmax, ymin, ymax);
public override int GetRegionFlags(UUID scopeID, UUID regionID)
if (grinfo != null)
{
//m_log.DebugFormat("[REMOTE GRID CONNECTOR]: Remote GetRegionRange {0} found {1} regions", name, grinfo.Count);
foreach (GridRegion r in grinfo)
if (rinfo.Find(delegate(GridRegion gr) { return gr.RegionID == r.RegionID; }) == null)
rinfo.Add(r);
}
return rinfo;
}
public List<GridRegion> GetDefaultRegions(UUID scopeID)
{
List<GridRegion> rinfo = m_LocalGridService.GetDefaultRegions(scopeID);
//m_log.DebugFormat("[REMOTE GRID CONNECTOR]: Local GetDefaultRegions {0} found {1} regions", name, rinfo.Count);
List<GridRegion> grinfo = m_RemoteGridService.GetDefaultRegions(scopeID);
if (grinfo != null)
{
//m_log.DebugFormat("[REMOTE GRID CONNECTOR]: Remote GetDefaultRegions {0} found {1} regions", name, grinfo.Count);
foreach (GridRegion r in grinfo)
if (rinfo.Find(delegate(GridRegion gr) { return gr.RegionID == r.RegionID; }) == null)
rinfo.Add(r);
}
return rinfo;
}
public List<GridRegion> GetFallbackRegions(UUID scopeID, int x, int y)
{
List<GridRegion> rinfo = m_LocalGridService.GetFallbackRegions(scopeID, x, y);
//m_log.DebugFormat("[REMOTE GRID CONNECTOR]: Local GetFallbackRegions {0} found {1} regions", name, rinfo.Count);
List<GridRegion> grinfo = m_RemoteGridService.GetFallbackRegions(scopeID, x, y);
if (grinfo != null)
{
//m_log.DebugFormat("[REMOTE GRID CONNECTOR]: Remote GetFallbackRegions {0} found {1} regions", name, grinfo.Count);
foreach (GridRegion r in grinfo)
if (rinfo.Find(delegate(GridRegion gr) { return gr.RegionID == r.RegionID; }) == null)
rinfo.Add(r);
}
return rinfo;
}
public List<GridRegion> GetHyperlinks(UUID scopeID)
{
List<GridRegion> rinfo = m_LocalGridService.GetHyperlinks(scopeID);
//m_log.DebugFormat("[REMOTE GRID CONNECTOR]: Local GetHyperlinks {0} found {1} regions", name, rinfo.Count);
List<GridRegion> grinfo = m_RemoteGridService.GetHyperlinks(scopeID);
if (grinfo != null)
{
//m_log.DebugFormat("[REMOTE GRID CONNECTOR]: Remote GetHyperlinks {0} found {1} regions", name, grinfo.Count);
foreach (GridRegion r in grinfo)
if (rinfo.Find(delegate(GridRegion gr) { return gr.RegionID == r.RegionID; }) == null)
rinfo.Add(r);
}
return rinfo;
}
public int GetRegionFlags(UUID scopeID, UUID regionID)
{
int flags = m_LocalGridService.GetRegionFlags(scopeID, regionID);
if (flags == -1)
flags = base.GetRegionFlags(scopeID, regionID);
flags = m_RemoteGridService.GetRegionFlags(scopeID, regionID);
return flags;
}

View File

@ -137,7 +137,6 @@ namespace OpenSim.Region.CoreModules.World.Archiver
m_log.InfoFormat("[ARCHIVER]: Added terrain information to archive.");
// Write out scene object metadata
foreach (SceneObjectGroup sceneObject in m_sceneObjects)
{

View File

@ -58,7 +58,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
/// <summary>
/// The maximum major version of OAR that we can write.
/// </summary>
public static int MAX_MAJOR_VERSION = 1;
public static int MAX_MAJOR_VERSION = 0;
protected Scene m_scene;
protected Stream m_saveStream;
@ -206,37 +206,37 @@ namespace OpenSim.Region.CoreModules.World.Archiver
/// <returns></returns>
public static string CreateControlFile(Dictionary<string, object> options)
{
int majorVersion = MAX_MAJOR_VERSION, minorVersion = 0;
if (options.ContainsKey("version"))
{
string[] parts = options["version"].ToString().Split('.');
if (parts.Length >= 1)
{
majorVersion = Int32.Parse(parts[0]);
if (parts.Length >= 2)
minorVersion = Int32.Parse(parts[1]);
}
}
if (majorVersion < MIN_MAJOR_VERSION || majorVersion > MAX_MAJOR_VERSION)
{
throw new Exception(
string.Format(
"OAR version number for save must be between {0} and {1}",
MIN_MAJOR_VERSION, MAX_MAJOR_VERSION));
}
else if (majorVersion == MAX_MAJOR_VERSION)
{
// Force 1.0
minorVersion = 0;
}
else if (majorVersion == MIN_MAJOR_VERSION)
{
// Force 0.4
minorVersion = 4;
}
int majorVersion = MAX_MAJOR_VERSION, minorVersion = 5;
//
// if (options.ContainsKey("version"))
// {
// string[] parts = options["version"].ToString().Split('.');
// if (parts.Length >= 1)
// {
// majorVersion = Int32.Parse(parts[0]);
//
// if (parts.Length >= 2)
// minorVersion = Int32.Parse(parts[1]);
// }
// }
//
// if (majorVersion < MIN_MAJOR_VERSION || majorVersion > MAX_MAJOR_VERSION)
// {
// throw new Exception(
// string.Format(
// "OAR version number for save must be between {0} and {1}",
// MIN_MAJOR_VERSION, MAX_MAJOR_VERSION));
// }
// else if (majorVersion == MAX_MAJOR_VERSION)
// {
// // Force 1.0
// minorVersion = 0;
// }
// else if (majorVersion == MIN_MAJOR_VERSION)
// {
// // Force 0.4
// minorVersion = 4;
// }
m_log.InfoFormat("[ARCHIVER]: Creating version {0}.{1} OAR", majorVersion, minorVersion);
//if (majorVersion == 1)

View File

@ -125,7 +125,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
Dictionary<string, object> options = new Dictionary<string, object>();
OptionSet ops = new OptionSet();
ops.Add("v|version=", delegate(string v) { options["version"] = v; });
// ops.Add("v|version=", delegate(string v) { options["version"] = v; });
ops.Add("p|profile=", delegate(string v) { options["profile"] = v; });
List<string> mainParams = ops.Parse(cmdparams);

View File

@ -159,7 +159,7 @@ namespace OpenSim.Region.CoreModules.World.Land
client.OnParcelSelectObjects += ClientOnParcelSelectObjects;
client.OnParcelObjectOwnerRequest += ClientOnParcelObjectOwnerRequest;
client.OnParcelAccessListRequest += ClientOnParcelAccessListRequest;
client.OnParcelAccessListUpdateRequest += ClientOnParcelAccessUpdateListRequest;
client.OnParcelAccessListUpdateRequest += ClientOnParcelAccessListUpdateRequest;
client.OnParcelAbandonRequest += ClientOnParcelAbandonRequest;
client.OnParcelGodForceOwner += ClientOnParcelGodForceOwner;
client.OnParcelReclaim += ClientOnParcelReclaim;
@ -508,14 +508,22 @@ namespace OpenSim.Region.CoreModules.World.Land
if (land != null)
{
m_landList[landLocalID].SendAccessList(agentID, sessionID, flags, sequenceID, remote_client);
land.SendAccessList(agentID, sessionID, flags, sequenceID, remote_client);
}
}
public void ClientOnParcelAccessUpdateListRequest(UUID agentID, UUID sessionID, uint flags, int landLocalID,
List<ParcelManager.ParcelAccessEntry> entries,
public void ClientOnParcelAccessListUpdateRequest(UUID agentID,
uint flags, int landLocalID, UUID transactionID, int sequenceID,
int sections, List<ParcelManager.ParcelAccessEntry> entries,
IClientAPI remote_client)
{
// Flags is the list to update, it can mean either the ban or
// the access list (WTH is a pass list? Mentioned in ParcelFlags)
//
// There may be multiple packets, because these can get LONG.
// Use transactionID to determine a new chain of packets since
// packets may have come in out of sequence and that would be
// a big mess if using the sequenceID
ILandObject land;
lock (m_landList)
{
@ -524,9 +532,15 @@ namespace OpenSim.Region.CoreModules.World.Land
if (land != null)
{
if (agentID == land.LandData.OwnerID)
GroupPowers requiredPowers = GroupPowers.LandManageAllowed;
if (flags == (uint)AccessList.Ban)
requiredPowers = GroupPowers.LandManageBanned;
if (m_scene.Permissions.CanEditParcelProperties(agentID,
land, requiredPowers))
{
land.UpdateAccessList(flags, entries, remote_client);
land.UpdateAccessList(flags, transactionID, sequenceID,
sections, entries, remote_client);
}
}
else
@ -854,7 +868,7 @@ namespace OpenSim.Region.CoreModules.World.Land
//If we are still here, then they are subdividing within one piece of land
//Check owner
if (!m_scene.Permissions.CanEditParcel(attempting_user_id, startLandObject))
if (!m_scene.Permissions.CanEditParcelProperties(attempting_user_id, startLandObject, GroupPowers.LandDivideJoin))
{
return;
}
@ -922,7 +936,7 @@ namespace OpenSim.Region.CoreModules.World.Land
{
return;
}
if (!m_scene.Permissions.CanEditParcel(attempting_user_id, masterLandObject))
if (!m_scene.Permissions.CanEditParcelProperties(attempting_user_id, masterLandObject, GroupPowers.LandDivideJoin))
{
return;
}
@ -1570,7 +1584,7 @@ namespace OpenSim.Region.CoreModules.World.Land
if (land == null) return;
if (!m_scene.Permissions.CanEditParcel(remoteClient.AgentId, land))
if (!m_scene.Permissions.CanEditParcelProperties(remoteClient.AgentId, land, GroupPowers.LandOptions))
return;
land.LandData.OtherCleanTime = otherCleanTime;

View File

@ -54,6 +54,7 @@ namespace OpenSim.Region.CoreModules.World.Land
protected LandData m_landData = new LandData();
protected Scene m_scene;
protected List<SceneObjectGroup> primsOverMe = new List<SceneObjectGroup>();
protected Dictionary<uint, UUID> m_listTransactions = new Dictionary<uint, UUID>();
public bool[,] LandBitmap
{
@ -198,37 +199,82 @@ namespace OpenSim.Region.CoreModules.World.Land
}
public void UpdateLandProperties(LandUpdateArgs args, IClientAPI remote_client)
{
if (m_scene.Permissions.CanEditParcel(remote_client.AgentId,this))
{
//Needs later group support
bool snap_selection = false;
LandData newData = LandData.Copy();
if (args.AuthBuyerID != newData.AuthBuyerID || args.SalePrice != newData.SalePrice)
uint allowedDelta = 0;
// These two are always blocked as no client can set them anyway
// ParcelFlags.ForSaleObjects
// ParcelFlags.LindenHome
if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId, this, GroupPowers.LandOptions))
{
if (m_scene.Permissions.CanSellParcel(remote_client.AgentId, this))
allowedDelta |= (uint)(ParcelFlags.AllowLandmark |
ParcelFlags.AllowTerraform |
ParcelFlags.AllowDamage |
ParcelFlags.CreateObjects |
ParcelFlags.RestrictPushObject |
ParcelFlags.AllowGroupScripts |
ParcelFlags.CreateGroupObjects |
ParcelFlags.AllowAPrimitiveEntry |
ParcelFlags.AllowGroupObjectEntry);
}
if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId, this, GroupPowers.LandSetSale))
{
if (args.AuthBuyerID != newData.AuthBuyerID ||
args.SalePrice != newData.SalePrice)
{
newData.AuthBuyerID = args.AuthBuyerID;
newData.SalePrice = args.SalePrice;
snap_selection = true;
}
}
newData.Category = args.Category;
newData.Description = args.Desc;
newData.AuthBuyerID = args.AuthBuyerID;
newData.SalePrice = args.SalePrice;
if (!LandData.IsGroupOwned)
{
newData.GroupID = args.GroupID;
allowedDelta |= (uint)(ParcelFlags.AllowDeedToGroup |
ParcelFlags.ContributeWithDeed |
ParcelFlags.SellParcelObjects);
}
allowedDelta |= (uint)ParcelFlags.ForSale;
}
if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId,this, GroupPowers.FindPlaces))
{
newData.Category = args.Category;
allowedDelta |= (uint)(ParcelFlags.ShowDirectory |
ParcelFlags.AllowPublish |
ParcelFlags.MaturePublish);
}
if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId,this, GroupPowers.LandChangeIdentity))
{
newData.Description = args.Desc;
newData.Name = args.Name;
newData.SnapshotID = args.SnapshotID;
}
if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId,this, GroupPowers.SetLandingPoint))
{
newData.LandingType = args.LandingType;
newData.UserLocation = args.UserLocation;
newData.UserLookAt = args.UserLookAt;
}
if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId,this, GroupPowers.ChangeMedia))
{
newData.MediaAutoScale = args.MediaAutoScale;
newData.MediaID = args.MediaID;
newData.MediaURL = args.MediaURL;
newData.MusicURL = args.MusicURL;
newData.Name = args.Name;
newData.Flags = args.ParcelFlags;
newData.PassHours = args.PassHours;
newData.PassPrice = args.PassPrice;
newData.SnapshotID = args.SnapshotID;
newData.UserLocation = args.UserLocation;
newData.UserLookAt = args.UserLookAt;
newData.MediaType = args.MediaType;
newData.MediaDescription = args.MediaDescription;
newData.MediaWidth = args.MediaWidth;
@ -237,11 +283,41 @@ namespace OpenSim.Region.CoreModules.World.Land
newData.ObscureMusic = args.ObscureMusic;
newData.ObscureMedia = args.ObscureMedia;
allowedDelta |= (uint)(ParcelFlags.SoundLocal |
ParcelFlags.UrlWebPage |
ParcelFlags.UrlRawHtml |
ParcelFlags.AllowVoiceChat |
ParcelFlags.UseEstateVoiceChan);
}
if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId,this, GroupPowers.LandManagePasses))
{
newData.PassHours = args.PassHours;
newData.PassPrice = args.PassPrice;
allowedDelta |= (uint)ParcelFlags.UsePassList;
}
if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId, this, GroupPowers.LandManageAllowed))
{
allowedDelta |= (uint)(ParcelFlags.UseAccessGroup |
ParcelFlags.UseAccessList);
}
if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId, this, GroupPowers.LandManageBanned))
{
allowedDelta |= (uint)(ParcelFlags.UseBanList |
ParcelFlags.DenyAnonymous |
ParcelFlags.DenyAgeUnverified);
}
uint preserve = LandData.Flags & ~allowedDelta;
newData.Flags = preserve | (args.ParcelFlags & allowedDelta);
m_scene.LandChannel.UpdateLandObject(LandData.LocalID, newData);
SendLandUpdateToAvatarsOverMe(snap_selection);
}
}
public void UpdateLandSold(UUID avatarID, UUID groupID, bool groupOwned, uint AuctionID, int claimprice, int area)
{
@ -295,14 +371,14 @@ namespace OpenSim.Region.CoreModules.World.Land
if ((LandData.Flags & (uint) ParcelFlags.UseBanList) > 0)
{
ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry();
entry.AgentID = avatar;
entry.Flags = AccessList.Ban;
entry.Time = new DateTime();
//See if they are on the list, but make sure the owner isn't banned
if (LandData.ParcelAccessList.Contains(entry) && LandData.OwnerID != avatar)
if (LandData.ParcelAccessList.FindIndex(
delegate(ParcelManager.ParcelAccessEntry e)
{
if (e.AgentID == avatar && e.Flags == AccessList.Ban)
return true;
return false;
}) != -1 && LandData.OwnerID != avatar)
{
//They are banned, so lets send them a notice about this parcel
return true;
}
}
@ -316,15 +392,14 @@ namespace OpenSim.Region.CoreModules.World.Land
if ((LandData.Flags & (uint) ParcelFlags.UseAccessList) > 0)
{
ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry();
entry.AgentID = avatar;
entry.Flags = AccessList.Access;
entry.Time = new DateTime();
//If they are not on the access list and are not the owner
if (!LandData.ParcelAccessList.Contains(entry) && LandData.OwnerID != avatar)
if (LandData.ParcelAccessList.FindIndex(
delegate(ParcelManager.ParcelAccessEntry e)
{
if (e.AgentID == avatar && e.Flags == AccessList.Access)
return true;
return false;
}) == -1 && LandData.OwnerID != avatar)
{
//They are not allowed in this parcel, but not banned, so lets send them a notice about this parcel
return true;
}
}
@ -421,40 +496,53 @@ namespace OpenSim.Region.CoreModules.World.Land
}
}
public void UpdateAccessList(uint flags, List<ParcelManager.ParcelAccessEntry> entries, IClientAPI remote_client)
public void UpdateAccessList(uint flags, UUID transactionID,
int sequenceID, int sections,
List<ParcelManager.ParcelAccessEntry> entries,
IClientAPI remote_client)
{
LandData newData = LandData.Copy();
if (entries.Count == 1 && entries[0].AgentID == UUID.Zero)
if ((!m_listTransactions.ContainsKey(flags)) ||
m_listTransactions[flags] != transactionID)
{
entries.Clear();
}
m_listTransactions[flags] = transactionID;
List<ParcelManager.ParcelAccessEntry> toRemove =
new List<ParcelManager.ParcelAccessEntry>();
List<ParcelManager.ParcelAccessEntry> toRemove = new List<ParcelManager.ParcelAccessEntry>();
foreach (ParcelManager.ParcelAccessEntry entry in newData.ParcelAccessList)
{
if (entry.Flags == (AccessList)flags)
{
toRemove.Add(entry);
}
}
foreach (ParcelManager.ParcelAccessEntry entry in toRemove)
{
newData.ParcelAccessList.Remove(entry);
}
// Checked here because this will always be the first
// and only packet in a transaction
if (entries.Count == 1 && entries[0].AgentID == UUID.Zero)
{
m_scene.LandChannel.UpdateLandObject(LandData.LocalID, newData);
return;
}
}
foreach (ParcelManager.ParcelAccessEntry entry in entries)
{
ParcelManager.ParcelAccessEntry temp = new ParcelManager.ParcelAccessEntry();
ParcelManager.ParcelAccessEntry temp =
new ParcelManager.ParcelAccessEntry();
temp.AgentID = entry.AgentID;
temp.Time = new DateTime(); //Pointless? Yes.
temp.Time = entry.Time;
temp.Flags = (AccessList)flags;
if (!newData.ParcelAccessList.Contains(temp))
{
newData.ParcelAccessList.Add(temp);
}
}
m_scene.LandChannel.UpdateLandObject(LandData.LocalID, newData);
}
@ -711,7 +799,7 @@ namespace OpenSim.Region.CoreModules.World.Land
public void SendForceObjectSelect(int local_id, int request_type, List<UUID> returnIDs, IClientAPI remote_client)
{
if (m_scene.Permissions.CanEditParcel(remote_client.AgentId, this))
if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId, this, GroupPowers.LandOptions))
{
List<uint> resultLocalIDs = new List<uint>();
try
@ -761,7 +849,7 @@ namespace OpenSim.Region.CoreModules.World.Land
/// </param>
public void SendLandObjectOwners(IClientAPI remote_client)
{
if (m_scene.Permissions.CanEditParcel(remote_client.AgentId, this))
if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId, this, GroupPowers.LandOptions))
{
Dictionary<UUID, int> primCount = new Dictionary<UUID, int>();
List<UUID> groups = new List<UUID>();

View File

@ -37,56 +37,6 @@ using OpenSim.Region.Framework.Interfaces;
using OpenSim.Region.Framework.Scenes;
using OpenSim.Services.Interfaces;
// Temporary fix of wrong GroupPowers constants in OpenMetaverse library
enum GroupPowers : long
{
None = 0,
LandEjectAndFreeze = 1,
Invite = 2,
ReturnGroupSet = 2,
Eject = 4,
ReturnNonGroup = 4,
ChangeOptions = 8,
LandGardening = 8,
CreateRole = 16,
DeedObject = 16,
ModerateChat = 32,
DeleteRole = 32,
RoleProperties = 64,
ObjectManipulate = 64,
ObjectSetForSale = 128,
AssignMemberLimited = 128,
AssignMember = 256,
Accountable = 256,
RemoveMember = 512,
SendNotices = 1024,
ChangeActions = 1024,
ChangeIdentity = 2048,
ReceiveNotices = 2048,
StartProposal = 4096,
LandDeed = 4096,
VoteOnProposal = 8192,
LandRelease = 8192,
LandSetSale = 16384,
LandDivideJoin = 32768,
ReturnGroupOwned = 65536,
JoinChat = 65536,
FindPlaces = 131072,
LandChangeIdentity = 262144,
SetLandingPoint = 524288,
ChangeMedia = 1048576,
LandEdit = 2097152,
LandOptions = 4194304,
AllowEditLand = 8388608,
AllowFly = 16777216,
AllowRez = 33554432,
AllowLandmark = 67108864,
AllowVoiceChat = 134217728,
AllowSetHome = 268435456,
LandManageAllowed = 536870912,
LandManageBanned = 1073741824
}
namespace OpenSim.Region.CoreModules.World.Permissions
{
public class PermissionsModule : IRegionModule
@ -214,7 +164,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
m_scene.Permissions.OnDuplicateObject += CanDuplicateObject;
m_scene.Permissions.OnDeleteObject += CanDeleteObject; //MAYBE FULLY IMPLEMENTED
m_scene.Permissions.OnEditObject += CanEditObject; //MAYBE FULLY IMPLEMENTED
m_scene.Permissions.OnEditParcel += CanEditParcel; //MAYBE FULLY IMPLEMENTED
m_scene.Permissions.OnEditParcelProperties += CanEditParcelProperties; //MAYBE FULLY IMPLEMENTED
m_scene.Permissions.OnInstantMessage += CanInstantMessage;
m_scene.Permissions.OnInventoryTransfer += CanInventoryTransfer; //NOT YET IMPLEMENTED
m_scene.Permissions.OnIssueEstateCommand += CanIssueEstateCommand; //FULLY IMPLEMENTED
@ -1005,12 +955,12 @@ namespace OpenSim.Region.CoreModules.World.Permissions
return GenericObjectPermission(editorID, objectID, false);
}
private bool CanEditParcel(UUID user, ILandObject parcel, Scene scene)
private bool CanEditParcelProperties(UUID user, ILandObject parcel, GroupPowers p, Scene scene)
{
DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name);
if (m_bypassPermissions) return m_bypassPermissionsValue;
return GenericParcelOwnerPermission(user, parcel, (ulong)GroupPowers.LandDivideJoin);
return GenericParcelOwnerPermission(user, parcel, (ulong)p);
}
/// <summary>

View File

@ -93,13 +93,13 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
}
// try to fetch from GridServer
List<GridRegion> regionInfos = m_scene.GridService.GetRegionsByName(UUID.Zero, mapName, 20);
List<GridRegion> regionInfos = m_scene.GridService.GetRegionsByName(m_scene.RegionInfo.ScopeID, mapName, 20);
if (regionInfos == null)
{
m_log.Warn("[MAPSEARCHMODULE]: RequestNamedRegions returned null. Old gridserver?");
// service wasn't available; maybe still an old GridServer. Try the old API, though it will return only one region
regionInfos = new List<GridRegion>();
GridRegion info = m_scene.GridService.GetRegionByName(UUID.Zero, mapName);
GridRegion info = m_scene.GridService.GetRegionByName(m_scene.RegionInfo.ScopeID, mapName);
if (info != null) regionInfos.Add(info);
}

View File

@ -33,6 +33,7 @@ using System.Drawing.Imaging;
using System.IO;
using System.Net;
using System.Reflection;
using System.Runtime.Remoting.Messaging;
using System.Threading;
using log4net;
using Nini.Config;
@ -413,11 +414,13 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
}
}
private int nAsyncRequests = 0;
/// <summary>
/// Processing thread main() loop for doing remote mapitem requests
/// </summary>
public void process()
{
const int MAX_ASYNC_REQUESTS = 20;
try
{
while (true)
@ -437,10 +440,16 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
dorequest = false;
}
if (dorequest)
if (dorequest && !m_blacklistedregions.ContainsKey(st.regionhandle))
{
OSDMap response = RequestMapItemsAsync("", st.agentID, st.flags, st.EstateID, st.godlike, st.itemtype, st.regionhandle);
RequestMapItemsCompleted(response);
while (nAsyncRequests >= MAX_ASYNC_REQUESTS) // hit the break
Thread.Sleep(80);
RequestMapItemsDelegate d = RequestMapItemsAsync;
d.BeginInvoke(st.agentID, st.flags, st.EstateID, st.godlike, st.itemtype, st.regionhandle, RequestMapItemsCompleted, null);
//OSDMap response = RequestMapItemsAsync(st.agentID, st.flags, st.EstateID, st.godlike, st.itemtype, st.regionhandle);
//RequestMapItemsCompleted(response);
Interlocked.Increment(ref nAsyncRequests);
}
}
@ -469,8 +478,18 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
/// Sends the mapitem response to the IClientAPI
/// </summary>
/// <param name="response">The OSDMap Response for the mapitem</param>
private void RequestMapItemsCompleted(OSDMap response)
private void RequestMapItemsCompleted(IAsyncResult iar)
{
AsyncResult result = (AsyncResult)iar;
RequestMapItemsDelegate icon = (RequestMapItemsDelegate)result.AsyncDelegate;
OSDMap response = (OSDMap)icon.EndInvoke(iar);
Interlocked.Decrement(ref nAsyncRequests);
if (!response.ContainsKey("requestID"))
return;
UUID requestID = response["requestID"].AsUUID();
if (requestID != UUID.Zero)
@ -538,6 +557,8 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
EnqueueMapItemRequest(st);
}
private delegate OSDMap RequestMapItemsDelegate(UUID id, uint flags,
uint EstateID, bool godlike, uint itemtype, ulong regionhandle);
/// <summary>
/// Does the actual remote mapitem request
/// This should be called from an asynchronous thread
@ -552,9 +573,10 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
/// <param name="itemtype">passed in from packet</param>
/// <param name="regionhandle">Region we're looking up</param>
/// <returns></returns>
private OSDMap RequestMapItemsAsync(string httpserver, UUID id, uint flags,
private OSDMap RequestMapItemsAsync(UUID id, uint flags,
uint EstateID, bool godlike, uint itemtype, ulong regionhandle)
{
string httpserver = "";
bool blacklisted = false;
lock (m_blacklistedregions)
{
@ -593,7 +615,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
if (!m_blacklistedregions.ContainsKey(regionhandle))
m_blacklistedregions.Add(regionhandle, Environment.TickCount);
}
m_log.InfoFormat("[WORLD MAP]: Blacklisted region {0}", regionhandle.ToString());
//m_log.InfoFormat("[WORLD MAP]: Blacklisted region {0}", regionhandle.ToString());
}
}
@ -638,7 +660,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
os = mapitemsrequest.GetRequestStream();
os.Write(buffer, 0, buffer.Length); //Send it
os.Close();
//m_log.DebugFormat("[WORLD MAP]: Getting MapItems from Sim {0}", httpserver);
//m_log.DebugFormat("[WORLD MAP]: Getting MapItems from {0}", httpserver);
}
catch (WebException ex)
{
@ -654,15 +676,22 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
return responseMap;
}
catch
{
m_log.DebugFormat("[WORLD MAP]: RequestMapItems failed for {0}", httpserver);
responseMap["connect"] = OSD.FromBoolean(false);
return responseMap;
}
string response_mapItems_reply = null;
{ // get the response
StreamReader sr = null;
try
{
WebResponse webResponse = mapitemsrequest.GetResponse();
if (webResponse != null)
{
StreamReader sr = new StreamReader(webResponse.GetResponseStream());
sr = new StreamReader(webResponse.GetResponseStream());
response_mapItems_reply = sr.ReadToEnd().Trim();
}
else
@ -683,6 +712,24 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
return responseMap;
}
catch
{
m_log.DebugFormat("[WORLD MAP]: RequestMapItems failed for {0}", httpserver);
responseMap["connect"] = OSD.FromBoolean(false);
lock (m_blacklistedregions)
{
if (!m_blacklistedregions.ContainsKey(regionhandle))
m_blacklistedregions.Add(regionhandle, Environment.TickCount);
}
return responseMap;
}
finally
{
if (sr != null)
sr.Close();
}
OSD rezResponse = null;
try
{
@ -691,14 +738,29 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
responseMap = (OSDMap)rezResponse;
responseMap["requestID"] = OSD.FromUUID(requestID);
}
catch (Exception)
catch (Exception ex)
{
//m_log.InfoFormat("[OGP]: exception on parse of rez reply {0}", ex.Message);
m_log.InfoFormat("[WORLD MAP]: exception on parse of RequestMapItems reply from {0}: {1}", httpserver, ex.Message);
responseMap["connect"] = OSD.FromBoolean(false);
lock (m_blacklistedregions)
{
if (!m_blacklistedregions.ContainsKey(regionhandle))
m_blacklistedregions.Add(regionhandle, Environment.TickCount);
}
return responseMap;
}
}
if (!responseMap.ContainsKey(itemtype.ToString())) // remote sim doesnt have the stated region handle
{
if (!m_blacklistedregions.ContainsKey(regionhandle))
{
m_log.DebugFormat("[WORLD MAP]: Remote sim does not have the stated region. Blacklisting.");
m_blacklistedregions.Add(regionhandle, Environment.TickCount);
}
}
return responseMap;
}

View File

@ -113,14 +113,17 @@ namespace OpenSim.Region.Framework.Interfaces
/// <summary>
/// Update the user inventory to show a detach.
/// </summary>
/// <param name="itemID">
/// A <see cref="UUID"/>
/// </param>
/// <param name="remoteClient">
/// A <see cref="IClientAPI"/>
/// </param>
/// <param name="itemID">/param>
/// <param name="remoteClient"></param>
void ShowDetachInUserInventory(UUID itemID, IClientAPI remoteClient);
/// <summary>
/// Update the position of an attachment.
/// </summary>
/// <param name="sog"></param>
/// <param name="pos"></param>
void UpdateAttachmentPosition(SceneObjectGroup sog, Vector3 pos);
/// <summary>
/// Update the user inventory with a changed attachment
/// </summary>

View File

@ -57,7 +57,7 @@ namespace OpenSim.Region.Framework.Interfaces
void SendLandUpdateToClient(bool snap_selection, IClientAPI remote_client);
List<UUID> CreateAccessListArrayByFlag(AccessList flag);
void SendAccessList(UUID agentID, UUID sessionID, uint flags, int sequenceID, IClientAPI remote_client);
void UpdateAccessList(uint flags, List<ParcelManager.ParcelAccessEntry> entries, IClientAPI remote_client);
void UpdateAccessList(uint flags, UUID transactionID, int sequenceID, int sections, List<ParcelManager.ParcelAccessEntry> entries, IClientAPI remote_client);
void UpdateLandBitmapByteArray();
void SetLandBitmapFromByteArray();
bool[,] GetLandBitmap();

View File

@ -233,6 +233,11 @@ namespace OpenSim.Region.Framework.Scenes.Animation
// Falling long enough to trigger the animation
return "FALLDOWN";
}
else if (m_animTickJump == -1)
{
m_animTickJump = 0;
return "STAND";
}
return m_movementAnimation;
}
@ -279,6 +284,8 @@ namespace OpenSim.Region.Framework.Scenes.Animation
m_animTickJump = -1;
return "JUMP";
}
else
return "JUMP";
}
else
{
@ -307,7 +314,7 @@ namespace OpenSim.Region.Framework.Scenes.Animation
#endregion Ground Movement
return m_movementAnimation;
//return m_movementAnimation;
}
/// <summary>
@ -316,17 +323,8 @@ namespace OpenSim.Region.Framework.Scenes.Animation
public void UpdateMovementAnimations()
{
m_movementAnimation = GetMovementAnimation();
if (m_movementAnimation == "PREJUMP" && !m_scenePresence.Scene.m_usePreJump)
{
// This was the previous behavior before PREJUMP
TrySetMovementAnimation("JUMP");
}
else
{
TrySetMovementAnimation(m_movementAnimation);
}
}
public UUID[] GetAnimationArray()
{

View File

@ -217,21 +217,29 @@ namespace OpenSim.Region.Framework.Scenes
}
private double GetPriorityByBestAvatarResponsiveness(IClientAPI client, ISceneEntity entity)
{
ScenePresence presence = m_scene.GetScenePresence(client.AgentId);
if (presence != null)
{
// If this is an update for our own avatar give it the highest priority
if (presence == entity)
if (client.AgentId == entity.UUID)
return 0.0;
if (entity == null)
return double.NaN;
// Use group position for child prims
Vector3 entityPos = entity.AbsolutePosition;
if (entity is SceneObjectPart)
entityPos = m_scene.GetGroupByPrim(entity.LocalId).AbsolutePosition;
{
SceneObjectGroup group = (entity as SceneObjectPart).ParentGroup;
if (group != null)
entityPos = group.AbsolutePosition;
else
entityPos = entity.AbsolutePosition;
}
else
entityPos = entity.AbsolutePosition;
ScenePresence presence = m_scene.GetScenePresence(client.AgentId);
if (presence != null)
{
if (!presence.IsChildAgent)
{
if (entity is ScenePresence)

View File

@ -68,6 +68,7 @@ namespace OpenSim.Region.Framework.Scenes
public delegate bool IsGodHandler(UUID user, Scene requestFromScene);
public delegate bool IsAdministratorHandler(UUID user);
public delegate bool EditParcelHandler(UUID user, ILandObject parcel, Scene scene);
public delegate bool EditParcelPropertiesHandler(UUID user, ILandObject parcel, GroupPowers p, Scene scene);
public delegate bool SellParcelHandler(UUID user, ILandObject parcel, Scene scene);
public delegate bool AbandonParcelHandler(UUID user, ILandObject parcel, Scene scene);
public delegate bool ReclaimParcelHandler(UUID user, ILandObject parcel, Scene scene);
@ -131,6 +132,7 @@ namespace OpenSim.Region.Framework.Scenes
public event IsGodHandler OnIsGod;
public event IsAdministratorHandler OnIsAdministrator;
public event EditParcelHandler OnEditParcel;
public event EditParcelPropertiesHandler OnEditParcelProperties;
public event SellParcelHandler OnSellParcel;
public event AbandonParcelHandler OnAbandonParcel;
public event ReclaimParcelHandler OnReclaimParcel;
@ -720,15 +722,16 @@ namespace OpenSim.Region.Framework.Scenes
#endregion
#region EDIT PARCEL
public bool CanEditParcel(UUID user, ILandObject parcel)
public bool CanEditParcelProperties(UUID user, ILandObject parcel, GroupPowers p)
{
EditParcelHandler handler = OnEditParcel;
EditParcelPropertiesHandler handler = OnEditParcelProperties;
if (handler != null)
{
Delegate[] list = handler.GetInvocationList();
foreach (EditParcelHandler h in list)
foreach (EditParcelPropertiesHandler h in list)
{
if (h(user, parcel, m_scene) == false)
if (h(user, parcel, p, m_scene) == false)
return false;
}
}

View File

@ -215,7 +215,7 @@ namespace OpenSim.Region.Framework.Scenes
SceneObjectPart sop = m_parentScene.GetSceneObjectPart(sp.ParentID);
if (sop != null)
{
coarseLocations.Add(sop.AbsolutePosition + sp.AbsolutePosition);
coarseLocations.Add(sop.AbsolutePosition + sp.OffsetPosition);
avatarUUIDs.Add(sp.UUID);
}
else
@ -1281,13 +1281,8 @@ namespace OpenSim.Region.Framework.Scenes
{
if (group.IsAttachment || (group.RootPart.Shape.PCode == 9 && group.RootPart.Shape.State != 0))
{
// Set the new attachment point data in the object
byte attachmentPoint = group.GetAttachmentPoint();
group.UpdateGroupPosition(pos);
group.RootPart.IsAttachment = false;
group.AbsolutePosition = group.RootPart.AttachedPos;
group.SetAttachmentPoint(attachmentPoint);
group.HasGroupChanged = true;
if (m_parentScene.AttachmentsModule != null)
m_parentScene.AttachmentsModule.UpdateAttachmentPosition(group, pos);
}
else
{

View File

@ -3251,13 +3251,6 @@ namespace OpenSim.Region.Framework.Scenes
//}
}
public void SetAvatarOnSitTarget(UUID avatarID)
{
m_sitTargetAvatar = avatarID;
if (ParentGroup != null)
ParentGroup.TriggerScriptChangedEvent(Changed.LINK);
}
public void SetAxisRotation(int axis, int rotate)
{
if (m_parentGroup != null)

View File

@ -1703,7 +1703,8 @@ namespace OpenSim.Region.Framework.Scenes
}
// Reset sit target.
if (part.GetAvatarOnSitTarget() == UUID)
part.SetAvatarOnSitTarget(UUID.Zero);
part.SitTargetAvatar = UUID.Zero;
part.ParentGroup.TriggerScriptChangedEvent(Changed.LINK);
m_parentPosition = part.GetWorldPosition();
ControllingClient.SendClearFollowCamProperties(part.ParentUUID);
@ -1807,11 +1808,12 @@ namespace OpenSim.Region.Framework.Scenes
if (SitTargetisSet && SitTargetUnOccupied)
{
part.SetAvatarOnSitTarget(UUID);
part.SitTargetAvatar = UUID;
offset = new Vector3(avSitOffSet.X, avSitOffSet.Y, avSitOffSet.Z);
sitOrientation = avSitOrientation;
autopilot = false;
}
part.ParentGroup.TriggerScriptChangedEvent(Changed.LINK);
pos = part.AbsolutePosition + offset;
//if (Math.Abs(part.AbsolutePosition.Z - AbsolutePosition.Z) > 1)
@ -2225,33 +2227,6 @@ namespace OpenSim.Region.Framework.Scenes
{
// WHAT???
m_log.Debug("[SCENEPRESENCE]: AddNewMovement() called on child agent, making root agent!");
// we have to reset the user's child agent connections.
// Likely, here they've lost the eventqueue for other regions so border
// crossings will fail at this point unless we reset them.
List<ulong> regions = new List<ulong>(KnownChildRegionHandles);
regions.Remove(m_scene.RegionInfo.RegionHandle);
MakeRootAgent(new Vector3(127f, 127f, 127f), true);
// Async command
if (m_scene.SceneGridService != null)
{
m_scene.SceneGridService.SendCloseChildAgentConnections(UUID, regions);
// Give the above command some time to try and close the connections.
// this is really an emergency.. so sleep, or we'll get all discombobulated.
System.Threading.Thread.Sleep(500);
}
if (m_scene.SceneGridService != null)
{
IEntityTransferModule m_agentTransfer = m_scene.RequestModuleInterface<IEntityTransferModule>();
if (m_agentTransfer != null)
m_agentTransfer.EnableChildAgents(this);
}
return;
}
@ -3226,8 +3201,11 @@ namespace OpenSim.Region.Framework.Scenes
Vector3 force = m_forceToApply.Value;
m_updateflag = true;
// movementvector = force;
Velocity = force;
// The magic constant 0.855f seems to make walking feel less jerky,
// probably because it hackishly accounts for the overall latency of
// these Velocity updates -- Diva
Velocity = force * .855F;
m_forceToApply = null;
}

View File

@ -43,13 +43,14 @@ using OpenSim.Tests.Common.Setup;
namespace OpenSim.Region.Framework.Scenes.Tests
{
/// <summary>
/// Tests manipulation of scene objects by users.
/// Tests derez of scene objects by users.
/// </summary>
///
/// <remarks>
/// This is at a level above the SceneObjectBasicTests, which act on the scene directly.
/// FIXME: These tests are very incomplete - they only test for a few conditions.
/// TODO: These tests are very incomplete - they only test for a few conditions.
/// </remarks>
[TestFixture]
public class SceneObjectUserTests
public class SceneObjectDeRezTests
{
/// <summary>
/// Test deleting an object from a scene.
@ -122,6 +123,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
scene.DeRezObjects(client, localIds, UUID.Zero, DeRezAction.Delete, UUID.Zero);
sogd.InventoryDeQueueAndDelete();
// Object should still be in the scene.
SceneObjectPart retrievedPart = scene.GetSceneObjectPart(part.LocalId);
Assert.That(retrievedPart.UUID, Is.EqualTo(part.UUID));
}

View File

@ -0,0 +1,87 @@
/*
* 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 System.Collections.Generic;
using System.Reflection;
using Nini.Config;
using NUnit.Framework;
using NUnit.Framework.SyntaxHelpers;
using OpenMetaverse;
using OpenSim.Framework;
using OpenSim.Framework.Communications;
using OpenSim.Region.CoreModules.Avatar.InstantMessage;
using OpenSim.Region.CoreModules.World.Permissions;
using OpenSim.Region.Framework.Interfaces;
using OpenSim.Region.Framework.Scenes;
using OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups;
using OpenSim.Tests.Common;
using OpenSim.Tests.Common.Mock;
using OpenSim.Tests.Common.Setup;
namespace OpenSim.Region.Framework.Scenes.Tests
{
[TestFixture]
public class SceneObjectUserGroupTests
{
/// <summary>
/// Test share with group object functionality
/// </summary>
/// <remarks>This test is not yet fully implemented</remarks>
[Test]
public void TestShareWithGroup()
{
TestHelper.InMethod();
// log4net.Config.XmlConfigurator.Configure();
UUID userId = UUID.Parse("10000000-0000-0000-0000-000000000001");
TestScene scene = SceneSetupHelpers.SetupScene();
IConfigSource configSource = new IniConfigSource();
IConfig startupConfig = configSource.AddConfig("Startup");
startupConfig.Set("serverside_object_permissions", true);
IConfig groupsConfig = configSource.AddConfig("Groups");
groupsConfig.Set("Enabled", true);
groupsConfig.Set("Module", "GroupsModule");
groupsConfig.Set("DebugEnabled", true);
SceneSetupHelpers.SetupSceneModules(
scene, configSource, new object[]
{ new PermissionsModule(),
new GroupsModule(),
new MockGroupsServicesConnector() });
TestClient client = SceneSetupHelpers.AddRootAgent(scene, userId);
IGroupsModule groupsModule = scene.RequestModuleInterface<IGroupsModule>();
groupsModule.CreateGroup(client, "group1", "To boldly go", true, UUID.Zero, 5, true, true, true);
}
}
}

View File

@ -163,9 +163,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
if (m_msgTransferModule == null)
{
m_groupsEnabled = false;
m_log.Error("[GROUPS]: Could not get MessageTransferModule");
Close();
return;
m_log.Warn("[GROUPS]: Could not get MessageTransferModule");
}
}
@ -1299,7 +1297,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
if (m_debugEnabled) m_log.InfoFormat("[GROUPS]: MsgTo ({0}) is local, delivering directly", localClient.Name);
localClient.SendInstantMessage(msg);
}
else
else if (m_msgTransferModule != null)
{
if (m_debugEnabled) m_log.InfoFormat("[GROUPS]: MsgTo ({0}) is not local, delivering via TransferModule", msgTo);
m_msgTransferModule.SendInstantMessage(msg, delegate(bool success) { if (m_debugEnabled) m_log.DebugFormat("[GROUPS]: Message Sent: {0}", success?"Succeeded":"Failed"); });

View File

@ -27,14 +27,12 @@
using System;
using System.Collections.Generic;
using OpenMetaverse;
using OpenSim.Framework;
namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
{
interface IGroupsServicesConnector
public interface IGroupsServicesConnector
{
UUID CreateGroup(UUID RequestingAgentID, string name, string charter, bool showInList, UUID insigniaID, int membershipFee, bool openEnrollment, bool allowPublish, bool maturePublish, UUID founderID);
void UpdateGroup(UUID RequestingAgentID, UUID groupID, string charter, bool showInList, UUID insigniaID, int membershipFee, bool openEnrollment, bool allowPublish, bool maturePublish);

View File

@ -0,0 +1,65 @@
/*
* 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 System.Reflection;
using Nini.Config;
using NUnit.Framework;
using NUnit.Framework.SyntaxHelpers;
using OpenMetaverse;
using OpenSim.Framework;
using OpenSim.Framework.Communications;
using OpenSim.Region.Framework.Scenes;
using OpenSim.Tests.Common;
using OpenSim.Tests.Common.Mock;
using OpenSim.Tests.Common.Setup;
namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups.Tests
{
/// <summary>
/// Basic groups module tests
/// </summary>
[TestFixture]
public class GroupsModuleTests
{
[Test]
public void TestBasic()
{
TestHelper.InMethod();
// log4net.Config.XmlConfigurator.Configure();
TestScene scene = SceneSetupHelpers.SetupScene();
IConfigSource configSource = new IniConfigSource();
IConfig config = configSource.AddConfig("Groups");
config.Set("Enabled", true);
config.Set("Module", "GroupsModule");
config.Set("DebugEnabled", true);
SceneSetupHelpers.SetupSceneModules(
scene, configSource, new object[] { new MockGroupsServicesConnector() });
}
}
}

View File

@ -311,7 +311,7 @@ namespace OpenSim.Region.Physics.Meshing
OSD decodedMeshOsd = new OSD();
byte[] meshBytes = new byte[physSize];
System.Buffer.BlockCopy(primShape.SculptData, physOffset, meshBytes, 0, physSize);
byte[] decompressed = new byte[physSize * 5];
// byte[] decompressed = new byte[physSize * 5];
try
{
using (MemoryStream inMs = new MemoryStream(meshBytes))

View File

@ -375,7 +375,7 @@ namespace PrimMesher
int coordsDown = rows.Count;
int coordsAcross = rows[0].Count;
int lastColumn = coordsAcross - 1;
// int lastColumn = coordsAcross - 1;
float widthUnit = 1.0f / (coordsAcross - 1);
float heightUnit = 1.0f / (coordsDown - 1);

View File

@ -1001,7 +1001,7 @@ namespace OpenSim.Region.RegionCombinerModule
VirtualRegion.Permissions.OnDuplicateObject += BigRegion.PermissionModule.CanDuplicateObject;
VirtualRegion.Permissions.OnDeleteObject += BigRegion.PermissionModule.CanDeleteObject; //MAYBE FULLY IMPLEMENTED
VirtualRegion.Permissions.OnEditObject += BigRegion.PermissionModule.CanEditObject; //MAYBE FULLY IMPLEMENTED
VirtualRegion.Permissions.OnEditParcel += BigRegion.PermissionModule.CanEditParcel; //MAYBE FULLY IMPLEMENTED
VirtualRegion.Permissions.OnEditParcelProperties += BigRegion.PermissionModule.CanEditParcelProperties; //MAYBE FULLY IMPLEMENTED
VirtualRegion.Permissions.OnInstantMessage += BigRegion.PermissionModule.CanInstantMessage;
VirtualRegion.Permissions.OnInventoryTransfer += BigRegion.PermissionModule.CanInventoryTransfer; //NOT YET IMPLEMENTED
VirtualRegion.Permissions.OnIssueEstateCommand += BigRegion.PermissionModule.CanIssueEstateCommand; //FULLY IMPLEMENTED

View File

@ -105,9 +105,9 @@ namespace OpenSim.Region.RegionCombinerModule
return m_rootScene.Permissions.CanEditObject(objectid, editorid);
}
public bool CanEditParcel(UUID user, ILandObject parcel, Scene scene)
public bool CanEditParcelProperties(UUID user, ILandObject parcel, GroupPowers g, Scene scene)
{
return m_rootScene.Permissions.CanEditParcel(user, parcel);
return m_rootScene.Permissions.CanEditParcelProperties(user, parcel, g);
}
public bool CanInstantMessage(UUID user, UUID target, Scene startscene)

View File

@ -6287,16 +6287,25 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
{
m_host.AddScriptLPS(1);
UUID key;
LandData land = World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).LandData;
if (land.OwnerID == m_host.OwnerID)
ILandObject land = World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y);
if (World.Permissions.CanEditParcelProperties(m_host.OwnerID, land, GroupPowers.LandManageAllowed))
{
ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry();
if (UUID.TryParse(avatar, out key))
{
if (land.LandData.ParcelAccessList.FindIndex(
delegate(ParcelManager.ParcelAccessEntry e)
{
if (e.AgentID == key && e.Flags == AccessList.Access)
return true;
return false;
}) == -1)
{
entry.AgentID = key;
entry.Flags = AccessList.Access;
entry.Time = DateTime.Now.AddHours(hours);
land.ParcelAccessList.Add(entry);
land.LandData.ParcelAccessList.Add(entry);
}
}
}
ScriptSleep(100);
@ -9023,7 +9032,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
// according to the docs, this command only works if script owner and land owner are the same
// lets add estate owners and gods, too, and use the generic permission check.
ILandObject landObject = World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y);
if (!World.Permissions.CanEditParcel(m_host.OwnerID, landObject)) return;
if (!World.Permissions.CanEditParcelProperties(m_host.OwnerID, landObject, GroupPowers.ChangeMedia)) return;
bool update = false; // send a ParcelMediaUpdate (and possibly change the land's media URL)?
byte loop = 0;
@ -9466,16 +9475,25 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
{
m_host.AddScriptLPS(1);
UUID key;
LandData land = World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).LandData;
if (land.OwnerID == m_host.OwnerID)
ILandObject land = World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y);
if (World.Permissions.CanEditParcelProperties(m_host.OwnerID, land, GroupPowers.LandManageBanned))
{
ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry();
if (UUID.TryParse(avatar, out key))
{
if (land.LandData.ParcelAccessList.FindIndex(
delegate(ParcelManager.ParcelAccessEntry e)
{
if (e.AgentID == key && e.Flags == AccessList.Ban)
return true;
return false;
}) == -1)
{
entry.AgentID = key;
entry.Flags = AccessList.Ban;
entry.Time = DateTime.Now.AddHours(hours);
land.ParcelAccessList.Add(entry);
land.LandData.ParcelAccessList.Add(entry);
}
}
}
ScriptSleep(100);
@ -9485,19 +9503,21 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
{
m_host.AddScriptLPS(1);
UUID key;
LandData land = World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).LandData;
if (land.OwnerID == m_host.OwnerID)
ILandObject land = World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y);
if (World.Permissions.CanEditParcelProperties(m_host.OwnerID, land, GroupPowers.LandManageAllowed))
{
if (UUID.TryParse(avatar, out key))
{
foreach (ParcelManager.ParcelAccessEntry entry in land.ParcelAccessList)
int idx = land.LandData.ParcelAccessList.FindIndex(
delegate(ParcelManager.ParcelAccessEntry e)
{
if (entry.AgentID == key && entry.Flags == AccessList.Access)
{
land.ParcelAccessList.Remove(entry);
break;
}
}
if (e.AgentID == key && e.Flags == AccessList.Access)
return true;
return false;
});
if (idx != -1)
land.LandData.ParcelAccessList.RemoveAt(idx);
}
}
ScriptSleep(100);
@ -9507,19 +9527,21 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
{
m_host.AddScriptLPS(1);
UUID key;
LandData land = World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).LandData;
if (land.OwnerID == m_host.OwnerID)
ILandObject land = World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y);
if (World.Permissions.CanEditParcelProperties(m_host.OwnerID, land, GroupPowers.LandManageBanned))
{
if (UUID.TryParse(avatar, out key))
{
foreach (ParcelManager.ParcelAccessEntry entry in land.ParcelAccessList)
int idx = land.LandData.ParcelAccessList.FindIndex(
delegate(ParcelManager.ParcelAccessEntry e)
{
if (entry.AgentID == key && entry.Flags == AccessList.Ban)
{
land.ParcelAccessList.Remove(entry);
break;
}
}
if (e.AgentID == key && e.Flags == AccessList.Ban)
return true;
return false;
});
if (idx != -1)
land.LandData.ParcelAccessList.RemoveAt(idx);
}
}
ScriptSleep(100);

View File

@ -336,6 +336,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
}
}
internal void OSSLDeprecated(string function, string replacement)
{
OSSLShoutError(string.Format("Use of function {0} is deprecated. Use {1} instead.", function, replacement));
}
protected void ScriptSleep(int delay)
{
delay = (int)((float)delay * m_ScriptDelayFactor);
@ -347,13 +352,22 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
//
// OpenSim functions
//
public LSL_Integer osSetTerrainHeight(int x, int y, double val)
{
CheckThreatLevel(ThreatLevel.High, "osSetTerrainHeight");
return SetTerrainHeight(x, y, val);
}
public LSL_Integer osTerrainSetHeight(int x, int y, double val)
{
CheckThreatLevel(ThreatLevel.High, "osTerrainSetHeight");
OSSLDeprecated("osTerrainSetHeight", "osSetTerrainHeight");
return SetTerrainHeight(x, y, val);
}
private LSL_Integer SetTerrainHeight(int x, int y, double val)
{
m_host.AddScriptLPS(1);
if (x > ((int)Constants.RegionSize - 1) || x < 0 || y > ((int)Constants.RegionSize - 1) || y < 0)
OSSLError("osTerrainSetHeight: Coordinate out of bounds");
OSSLError("osSetTerrainHeight: Coordinate out of bounds");
if (World.Permissions.CanTerraformLand(m_host.OwnerID, new Vector3(x, y, 0)))
{
@ -366,13 +380,22 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
}
}
public LSL_Float osGetTerrainHeight(int x, int y)
{
CheckThreatLevel(ThreatLevel.None, "osGetTerrainHeight");
return GetTerrainHeight(x, y);
}
public LSL_Float osTerrainGetHeight(int x, int y)
{
CheckThreatLevel(ThreatLevel.None, "osTerrainGetHeight");
OSSLDeprecated("osTerrainGetHeight", "osGetTerrainHeight");
return GetTerrainHeight(x, y);
}
private LSL_Float GetTerrainHeight(int x, int y)
{
m_host.AddScriptLPS(1);
if (x > ((int)Constants.RegionSize - 1) || x < 0 || y > ((int)Constants.RegionSize - 1) || y < 0)
OSSLError("osTerrainGetHeight: Coordinate out of bounds");
OSSLError("osGetTerrainHeight: Coordinate out of bounds");
return World.Heightmap[x, y];
}
@ -1001,9 +1024,19 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
return drawList;
}
public string osSetPenColor(string drawList, string color)
{
CheckThreatLevel(ThreatLevel.None, "osSetPenColor");
m_host.AddScriptLPS(1);
drawList += "PenColor " + color + "; ";
return drawList;
}
// Deprecated
public string osSetPenColour(string drawList, string colour)
{
CheckThreatLevel(ThreatLevel.None, "osSetPenColour");
OSSLDeprecated("osSetPenColour", "osSetPenColor");
m_host.AddScriptLPS(1);
drawList += "PenColour " + colour + "; ";
@ -1012,7 +1045,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public string osSetPenCap(string drawList, string direction, string type)
{
CheckThreatLevel(ThreatLevel.None, "osSetPenColour");
CheckThreatLevel(ThreatLevel.None, "osSetPenCap");
m_host.AddScriptLPS(1);
drawList += "PenCap " + direction + "," + type + "; ";
@ -1157,6 +1190,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public double osSunGetParam(string param)
{
CheckThreatLevel(ThreatLevel.None, "osSunGetParam");
OSSLDeprecated("osSunGetParam", "osGetSunParam");
return GetSunParam(param);
}
public double osGetSunParam(string param)
{
CheckThreatLevel(ThreatLevel.None, "osGetSunParam");
return GetSunParam(param);
}
private double GetSunParam(string param)
{
m_host.AddScriptLPS(1);
double value = 0.0;
@ -1173,6 +1216,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public void osSunSetParam(string param, double value)
{
CheckThreatLevel(ThreatLevel.None, "osSunSetParam");
OSSLDeprecated("osSunSetParam", "osSetSunParam");
SetSunParam(param, value);
}
public void osSetSunParam(string param, double value)
{
CheckThreatLevel(ThreatLevel.None, "osSetSunParam");
SetSunParam(param, value);
}
private void SetSunParam(string param, double value)
{
m_host.AddScriptLPS(1);
ISunModule module = World.RequestModuleInterface<ISunModule>();
@ -1198,9 +1251,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
return String.Empty;
}
public void osWindParamSet(string plugin, string param, float value)
public void osSetWindParam(string plugin, string param, float value)
{
CheckThreatLevel(ThreatLevel.VeryLow, "osWindParamSet");
CheckThreatLevel(ThreatLevel.VeryLow, "osSetWindParam");
m_host.AddScriptLPS(1);
IWindModule module = World.RequestModuleInterface<IWindModule>();
@ -1214,9 +1267,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
}
}
public float osWindParamGet(string plugin, string param)
public float osGetWindParam(string plugin, string param)
{
CheckThreatLevel(ThreatLevel.VeryLow, "osWindParamGet");
CheckThreatLevel(ThreatLevel.VeryLow, "osGetWindParam");
m_host.AddScriptLPS(1);
IWindModule module = World.RequestModuleInterface<IWindModule>();
@ -1257,7 +1310,19 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public void osParcelSetDetails(LSL_Vector pos, LSL_List rules)
{
CheckThreatLevel(ThreatLevel.High, "osParcelSetDetails");
const string functionName = "osParcelSetDetails";
CheckThreatLevel(ThreatLevel.High, functionName);
OSSLDeprecated(functionName, "osSetParcelDetails");
SetParcelDetails(pos, rules, functionName);
}
public void osSetParcelDetails(LSL_Vector pos, LSL_List rules)
{
const string functionName = "osSetParcelDetails";
CheckThreatLevel(ThreatLevel.High, functionName);
SetParcelDetails(pos, rules, functionName);
}
private void SetParcelDetails(LSL_Vector pos, LSL_List rules, string functionName)
{
m_host.AddScriptLPS(1);
// Get a reference to the land data and make sure the owner of the script
@ -1270,7 +1335,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
return;
}
if (! World.Permissions.CanEditParcel(m_host.OwnerID, startLandObject))
if (!World.Permissions.CanEditParcelProperties(m_host.OwnerID, startLandObject, GroupPowers.LandOptions))
{
OSSLShoutError("You do not have permission to modify the parcel");
return;
@ -1296,13 +1361,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
break;
case 2:
CheckThreatLevel(ThreatLevel.VeryHigh, "osParcelSetDetails");
CheckThreatLevel(ThreatLevel.VeryHigh, functionName);
if (UUID.TryParse(arg , out uuid))
newLand.OwnerID = uuid;
break;
case 3:
CheckThreatLevel(ThreatLevel.VeryHigh, "osParcelSetDetails");
CheckThreatLevel(ThreatLevel.VeryHigh, functionName);
if (UUID.TryParse(arg , out uuid))
newLand.GroupID = uuid;
break;

View File

@ -67,8 +67,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
string osSetDynamicTextureDataBlendFace(string dynamicID, string contentType, string data, string extraParams,
bool blend, int disp, int timer, int alpha, int face);
LSL_Float osTerrainGetHeight(int x, int y);
LSL_Integer osTerrainSetHeight(int x, int y, double val);
LSL_Float osGetTerrainHeight(int x, int y);
LSL_Float osTerrainGetHeight(int x, int y); // Deprecated
LSL_Integer osSetTerrainHeight(int x, int y, double val);
LSL_Integer osTerrainSetHeight(int x, int y, double val); //Deprecated
void osTerrainFlush();
int osRegionRestart(double seconds);
@ -107,7 +109,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
string osSetFontName(string drawList, string fontName);
string osSetFontSize(string drawList, int fontSize);
string osSetPenSize(string drawList, int penSize);
string osSetPenColour(string drawList, string colour);
string osSetPenColor(string drawList, string color);
string osSetPenColour(string drawList, string colour); // Deprecated
string osSetPenCap(string drawList, string direction, string type);
string osDrawImage(string drawList, int width, int height, string imageUrl);
vector osGetDrawStringSize(string contentType, string text, string fontName, int fontSize);
@ -119,18 +122,21 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
void osSetRegionSunSettings(bool useEstateSun, bool sunFixed, double sunHour);
void osSetEstateSunSettings(bool sunFixed, double sunHour);
double osGetCurrentSunHour();
double osSunGetParam(string param);
void osSunSetParam(string param, double value);
double osGetSunParam(string param);
double osSunGetParam(string param); // Deprecated
void osSetSunParam(string param, double value);
void osSunSetParam(string param, double value); // Deprecated
// Wind Module Functions
string osWindActiveModelPluginName();
void osWindParamSet(string plugin, string param, float value);
float osWindParamGet(string plugin, string param);
void osSetWindParam(string plugin, string param, float value);
float osGetWindParam(string plugin, string param);
// Parcel commands
void osParcelJoin(vector pos1, vector pos2);
void osParcelSubdivide(vector pos1, vector pos2);
void osParcelSetDetails(vector pos, LSL_List rules);
void osSetParcelDetails(vector pos, LSL_List rules);
void osParcelSetDetails(vector pos, LSL_List rules); // Deprecated
string osGetScriptEngineName();
string osGetSimulatorVersion();

View File

@ -81,11 +81,21 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
return m_OSSL_Functions.osGetCurrentSunHour();
}
public double osGetSunParam(string param)
{
return m_OSSL_Functions.osGetSunParam(param);
}
// Deprecated
public double osSunGetParam(string param)
{
return m_OSSL_Functions.osSunGetParam(param);
}
public void osSetSunParam(string param, double value)
{
m_OSSL_Functions.osSetSunParam(param, value);
}
// Deprecated
public void osSunSetParam(string param, double value)
{
m_OSSL_Functions.osSunSetParam(param, value);
@ -97,14 +107,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
}
// Not yet plugged in as available OSSL functions, so commented out
// void osWindParamSet(string plugin, string param, float value)
// void osSetWindParam(string plugin, string param, float value)
// {
// m_OSSL_Functions.osWindParamSet(plugin, param, value);
// m_OSSL_Functions.osSetWindParam(plugin, param, value);
// }
//
// float osWindParamGet(string plugin, string param)
// float osGetWindParam(string plugin, string param)
// {
// return m_OSSL_Functions.osWindParamGet(plugin, param);
// return m_OSSL_Functions.osGetWindParam(plugin, param);
// }
public void osParcelJoin(vector pos1, vector pos2)
@ -117,6 +127,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
m_OSSL_Functions.osParcelSubdivide(pos1, pos2);
}
public void osSetParcelDetails(vector pos, LSL_List rules)
{
m_OSSL_Functions.osSetParcelDetails(pos, rules);
}
// Deprecated
public void osParcelSetDetails(vector pos, LSL_List rules)
{
m_OSSL_Functions.osParcelSetDetails(pos,rules);
@ -165,11 +180,21 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
blend, disp, timer, alpha, face);
}
public LSL_Float osGetTerrainHeight(int x, int y)
{
return m_OSSL_Functions.osGetTerrainHeight(x, y);
}
// Deprecated
public LSL_Float osTerrainGetHeight(int x, int y)
{
return m_OSSL_Functions.osTerrainGetHeight(x, y);
}
public LSL_Integer osSetTerrainHeight(int x, int y, double val)
{
return m_OSSL_Functions.osSetTerrainHeight(x, y, val);
}
// Deprecated
public LSL_Integer osTerrainSetHeight(int x, int y, double val)
{
return m_OSSL_Functions.osTerrainSetHeight(x, y, val);
@ -333,6 +358,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
return m_OSSL_Functions.osSetPenCap(drawList, direction, type);
}
public string osSetPenColor(string drawList, string color)
{
return m_OSSL_Functions.osSetPenColor(drawList, color);
}
// Deprecated
public string osSetPenColour(string drawList, string colour)
{
return m_OSSL_Functions.osSetPenColour(drawList, colour);

View File

@ -29,6 +29,7 @@ using System;
using System.Collections;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using System.Net;
using System.Reflection;
using OpenSim.Framework;
@ -48,7 +49,7 @@ namespace OpenSim.Services.Connectors.Hypergrid
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
// private static UUID m_HGMapImage = new UUID("00000000-0000-1111-9999-000000000013");
private static UUID m_HGMapImage = new UUID("00000000-0000-1111-9999-000000000013");
private IAssetService m_AssetService;
@ -143,43 +144,44 @@ namespace OpenSim.Services.Connectors.Hypergrid
return true;
}
UUID m_MissingTexture = new UUID("5748decc-f629-461c-9a36-a35a221fe21f");
public UUID GetMapImage(UUID regionID, string imageURL)
public UUID GetMapImage(UUID regionID, string imageURL, string storagePath)
{
if (m_AssetService == null)
return m_MissingTexture;
{
m_log.DebugFormat("[GATEKEEPER SERVICE CONNECTOR]: No AssetService defined. Map tile not retrieved.");
return m_HGMapImage;
}
UUID mapTile = m_HGMapImage;
string filename = string.Empty;
Bitmap bitmap = null;
try
{
WebClient c = new WebClient();
//m_log.Debug("JPEG: " + imageURL);
string filename = regionID.ToString();
c.DownloadFile(imageURL, filename + ".jpg");
Bitmap m = new Bitmap(filename + ".jpg");
string name = regionID.ToString();
filename = Path.Combine(storagePath, name + ".jpg");
c.DownloadFile(imageURL, filename);
bitmap = new Bitmap(filename);
//m_log.Debug("Size: " + m.PhysicalDimension.Height + "-" + m.PhysicalDimension.Width);
byte[] imageData = OpenJPEG.EncodeFromImage(m, true);
AssetBase ass = new AssetBase(UUID.Random(), "region " + filename, (sbyte)AssetType.Texture, regionID.ToString());
byte[] imageData = OpenJPEG.EncodeFromImage(bitmap, true);
AssetBase ass = new AssetBase(UUID.Random(), "region " + name, (sbyte)AssetType.Texture, regionID.ToString());
// !!! for now
//info.RegionSettings.TerrainImageID = ass.FullID;
ass.Temporary = true;
ass.Local = true;
ass.Data = imageData;
m_AssetService.Store(ass);
// finally
return ass.FullID;
mapTile = ass.FullID;
}
catch // LEGIT: Catching problems caused by OpenJPEG p/invoke
{
m_log.Warn("[GATEKEEPER SERVICE CONNECTOR]: Failed getting/storing map image, because it is probably already in the cache");
m_log.Info("[GATEKEEPER SERVICE CONNECTOR]: Failed getting/storing map image, because it is probably already in the cache");
}
return UUID.Zero;
return mapTile;
}
public GridRegion GetHyperlinkRegion(GridRegion gatekeeper, UUID regionID)

View File

@ -104,7 +104,7 @@ namespace OpenSim.Services.Connectors.Hypergrid
return false;
}
string uri = m_ServerURL + "/homeagent/" + aCircuit.AgentID + "/";
string uri = m_ServerURL + "homeagent/" + aCircuit.AgentID + "/";
Console.WriteLine(" >>> LoginAgentToGrid <<< " + uri);

View File

@ -235,6 +235,7 @@ namespace OpenSim.Services.Connectors.Simulation
m_log.Warn("[REMOTE SIMULATION CONNECTOR]: PackAgentCircuitData failed with exception: " + e.Message);
return null;
}
// Add the input arguments
args["destination_x"] = OSD.FromString(destination.RegionLocX.ToString());
args["destination_y"] = OSD.FromString(destination.RegionLocY.ToString());

View File

@ -26,7 +26,9 @@
*/
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Reflection;
@ -51,8 +53,6 @@ namespace OpenSim.Services.GridService
LogManager.GetLogger(
MethodBase.GetCurrentMethod().DeclaringType);
private static UUID m_HGMapImage = new UUID("00000000-0000-1111-9999-000000000013");
private static uint m_autoMappingX = 0;
private static uint m_autoMappingY = 0;
private static bool m_enableAutoMapping = false;
@ -64,6 +64,7 @@ namespace OpenSim.Services.GridService
protected UUID m_ScopeID = UUID.Zero;
protected bool m_Check4096 = true;
protected string m_MapTileDirectory = string.Empty;
// Hyperlink regions are hyperlinks on the map
public readonly Dictionary<UUID, GridRegion> m_HyperlinkRegions = new Dictionary<UUID, GridRegion>();
@ -120,9 +121,24 @@ namespace OpenSim.Services.GridService
m_Check4096 = gridConfig.GetBoolean("Check4096", true);
m_MapTileDirectory = gridConfig.GetString("MapTileDirectory", string.Empty);
m_GatekeeperConnector = new GatekeeperServiceConnector(m_AssetService);
m_log.DebugFormat("[HYPERGRID LINKER]: Loaded all services...");
m_log.Debug("[HYPERGRID LINKER]: Loaded all services...");
}
if (!string.IsNullOrEmpty(m_MapTileDirectory))
{
try
{
Directory.CreateDirectory(m_MapTileDirectory);
}
catch (Exception e)
{
m_log.WarnFormat("[HYPERGRID LINKER]: Could not create map tile storage directory {0}: {1}", m_MapTileDirectory, e);
m_MapTileDirectory = string.Empty;
}
}
if (MainConsole.Instance != null)
@ -215,7 +231,9 @@ namespace OpenSim.Services.GridService
public bool TryCreateLink(UUID scopeID, int xloc, int yloc, string remoteRegionName, uint externalPort, string externalHostName, string serverURI, UUID ownerID, out GridRegion regInfo, out string reason)
{
m_log.DebugFormat("[HYPERGRID LINKER]: Link to {0}:{1}:{2}, in {3}-{4}", externalHostName, externalPort, remoteRegionName, xloc, yloc);
m_log.DebugFormat("[HYPERGRID LINKER]: Link to {0}:{1}, in {2}-{3}",
((serverURI == null) ? (externalHostName + ":" + externalPort) : serverURI),
remoteRegionName, xloc / Constants.RegionSize, yloc / Constants.RegionSize);
reason = string.Empty;
regInfo = new GridRegion();
@ -242,7 +260,9 @@ namespace OpenSim.Services.GridService
GridRegion region = m_GridService.GetRegionByPosition(regInfo.ScopeID, regInfo.RegionLocX, regInfo.RegionLocY);
if (region != null)
{
m_log.WarnFormat("[HYPERGRID LINKER]: Coordinates {0}-{1} are already occupied by region {2} with uuid {3}", regInfo.RegionLocX, regInfo.RegionLocY, region.RegionName, region.RegionID);
m_log.WarnFormat("[HYPERGRID LINKER]: Coordinates {0}-{1} are already occupied by region {2} with uuid {3}",
regInfo.RegionLocX / Constants.RegionSize, regInfo.RegionLocY / Constants.RegionSize,
region.RegionName, region.RegionID);
reason = "Coordinates are already in use";
return false;
}
@ -266,41 +286,22 @@ namespace OpenSim.Services.GridService
if (!m_GatekeeperConnector.LinkRegion(regInfo, out regionID, out handle, out externalName, out imageURL, out reason))
return false;
if (regionID != UUID.Zero)
{
region = m_GridService.GetRegionByUUID(scopeID, regionID);
if (region != null)
{
m_log.DebugFormat("[HYPERGRID LINKER]: Region already exists in coordinates {0} {1}", region.RegionLocX / Constants.RegionSize, region.RegionLocY / Constants.RegionSize);
regInfo = region;
return true;
}
regInfo.RegionID = regionID;
if ( externalName == string.Empty )
regInfo.RegionName = regInfo.ServerURI;
else
regInfo.RegionName = externalName;
m_log.Debug("[HYPERGRID LINKER]: naming linked region " + regInfo.RegionName);
// Try get the map image
//regInfo.TerrainImage = m_GatekeeperConnector.GetMapImage(regionID, imageURL);
// I need a texture that works for this... the one I tried doesn't seem to be working
regInfo.TerrainImage = m_HGMapImage;
AddHyperlinkRegion(regInfo, handle);
m_log.Info("[HYPERGRID LINKER]: Successfully linked to region_uuid " + regInfo.RegionID);
}
else
if (regionID == UUID.Zero)
{
m_log.Warn("[HYPERGRID LINKER]: Unable to link region");
reason = "Remote region could not be found";
return false;
}
region = m_GridService.GetRegionByUUID(scopeID, regionID);
if (region != null)
{
m_log.DebugFormat("[HYPERGRID LINKER]: Region already exists in coordinates {0} {1}",
region.RegionLocX / Constants.RegionSize, region.RegionLocY / Constants.RegionSize);
regInfo = region;
return true;
}
uint x, y;
if (m_Check4096 && !Check4096(handle, out x, out y))
{
@ -310,7 +311,20 @@ namespace OpenSim.Services.GridService
return false;
}
m_log.Debug("[HYPERGRID LINKER]: link region succeeded");
regInfo.RegionID = regionID;
if ( externalName == string.Empty )
regInfo.RegionName = regInfo.ServerURI;
else
regInfo.RegionName = externalName;
m_log.Debug("[HYPERGRID LINKER]: naming linked region " + regInfo.RegionName);
// Get the map image
regInfo.TerrainImage = m_GatekeeperConnector.GetMapImage(regionID, imageURL, m_MapTileDirectory);
AddHyperlinkRegion(regInfo, handle);
m_log.Info("[HYPERGRID LINKER]: Successfully linked to region_uuid " + regInfo.RegionID);
return true;
}
@ -423,15 +437,14 @@ namespace OpenSim.Services.GridService
return;
}
MainConsole.Instance.Output("Region Name Region UUID");
MainConsole.Instance.Output("Location URI");
MainConsole.Instance.Output("-------------------------------------------------------------------------------");
MainConsole.Instance.Output("Region Name");
MainConsole.Instance.Output("Location Region UUID");
MainConsole.Instance.Output(new string('-', 72));
foreach (RegionData r in regions)
{
MainConsole.Instance.Output(String.Format("{0,-39} {1}\n{2,-39} {3}\n",
r.RegionName, r.RegionID,
String.Format("{0},{1} ({2},{3})", r.posX, r.posY, r.posX / 256, r.posY / 256),
"http://" + r.Data["serverIP"].ToString() + ":" + r.Data["serverHttpPort"].ToString()));
MainConsole.Instance.Output(String.Format("{0}\n{2,-32} {1}\n",
r.RegionName, r.RegionID, String.Format("{0},{1} ({2},{3})", r.posX, r.posY,
r.posX / Constants.RegionSize, r.posY / Constants.RegionSize)));
}
return;
}
@ -459,11 +472,14 @@ namespace OpenSim.Services.GridService
xloc = Convert.ToInt32(cmdparams[0]) * (int)Constants.RegionSize;
yloc = Convert.ToInt32(cmdparams[1]) * (int)Constants.RegionSize;
serverURI = cmdparams[2];
if (cmdparams.Length == 4)
remoteName = cmdparams[3];
if (cmdparams.Length > 3)
remoteName = string.Join(" ", cmdparams, 3, cmdparams.Length - 3);
string reason = string.Empty;
GridRegion regInfo;
TryCreateLink(UUID.Zero, xloc, yloc, remoteName, 0, null, serverURI, UUID.Zero, out regInfo, out reason);
if (TryCreateLink(UUID.Zero, xloc, yloc, remoteName, 0, null, serverURI, UUID.Zero, out regInfo, out reason))
MainConsole.Instance.Output("Hyperlink established");
else
MainConsole.Instance.Output("Failed to link region: " + reason);
}
private void RunHGCommand(string command, string[] cmdparams)
@ -487,18 +503,6 @@ namespace OpenSim.Services.GridService
}
}
else if (command.Equals("link-region"))
{
if (cmdparams.Length > 0 && cmdparams.Length < 5)
{
RunLinkRegionCommand(cmdparams);
}
else
{
LinkRegionCmdUsage();
}
return;
}
else if (command.Equals("link-region"))
{
if (cmdparams.Length < 3)
{
@ -514,40 +518,24 @@ namespace OpenSim.Services.GridService
}
//this should be the prefererred way of setting up hg links now
if ( cmdparams[2].StartsWith("http") && ( cmdparams.Length >= 3 && cmdparams.Length <= 5 )) {
if (cmdparams[2].StartsWith("http"))
{
RunLinkRegionCommand(cmdparams);
}
else if (cmdparams[2].Contains(":"))
{
// New format
int xloc, yloc;
string mapName;
try
string[] parts = cmdparams[2].Split(':');
if (parts.Length > 2)
{
xloc = Convert.ToInt32(cmdparams[0]);
yloc = Convert.ToInt32(cmdparams[1]);
mapName = cmdparams[2];
if (cmdparams.Length > 3)
for (int i = 3; i < cmdparams.Length; i++)
mapName += " " + cmdparams[i];
//m_log.Info(">> MapName: " + mapName);
}
catch (Exception e)
{
MainConsole.Instance.Output("[HGrid] Wrong format for link-region command: " + e.Message);
LinkRegionCmdUsage();
return;
// Insert remote region name
ArrayList parameters = new ArrayList(cmdparams);
parameters.Insert(3, parts[2]);
cmdparams = (string[])parameters.ToArray(typeof(string));
}
cmdparams[2] = "http://" + parts[0] + ':' + parts[1];
// Convert cell coordinates given by the user to meters
xloc = xloc * (int)Constants.RegionSize;
yloc = yloc * (int)Constants.RegionSize;
string reason = string.Empty;
if (TryLinkRegionToCoords(UUID.Zero, mapName, xloc, yloc, out reason) == null)
MainConsole.Instance.Output("Failed to link region: " + reason);
else
MainConsole.Instance.Output("Hyperlink established");
RunLinkRegionCommand(cmdparams);
}
else
{
@ -556,16 +544,12 @@ namespace OpenSim.Services.GridService
int xloc, yloc;
uint externalPort;
string externalHostName;
string serverURI;
try
{
xloc = Convert.ToInt32(cmdparams[0]);
yloc = Convert.ToInt32(cmdparams[1]);
externalPort = Convert.ToUInt32(cmdparams[3]);
externalHostName = cmdparams[2];
if ( cmdparams.Length == 4 ) {
}
//internalPort = Convert.ToUInt32(cmdparams[4]);
//remotingPort = Convert.ToUInt32(cmdparams[5]);
}
@ -582,27 +566,30 @@ namespace OpenSim.Services.GridService
string reason = string.Empty;
if (TryCreateLink(UUID.Zero, xloc, yloc, string.Empty, externalPort, externalHostName, UUID.Zero, out regInfo, out reason))
{
if (cmdparams.Length >= 5)
{
regInfo.RegionName = "";
for (int i = 4; i < cmdparams.Length; i++)
regInfo.RegionName += cmdparams[i] + " ";
}
// What is this? The GridRegion instance will be discarded anyway,
// which effectively ignores any local name given with the command.
//if (cmdparams.Length >= 5)
//{
// regInfo.RegionName = "";
// for (int i = 4; i < cmdparams.Length; i++)
// regInfo.RegionName += cmdparams[i] + " ";
//}
}
}
return;
}
else if (command.Equals("unlink-region"))
{
if (cmdparams.Length < 1 || cmdparams.Length > 1)
if (cmdparams.Length < 1)
{
UnlinkRegionCmdUsage();
return;
}
if (TryUnlinkRegion(cmdparams[0]))
MainConsole.Instance.Output("Successfully unlinked " + cmdparams[0]);
string region = string.Join(" ", cmdparams);
if (TryUnlinkRegion(region))
MainConsole.Instance.Output("Successfully unlinked " + region);
else
MainConsole.Instance.Output("Unable to unlink " + cmdparams[0] + ", region not found.");
MainConsole.Instance.Output("Unable to unlink " + region + ", region not found.");
}
}

View File

@ -123,42 +123,39 @@ namespace OpenSim.Services.HypergridService
externalName = m_ExternalName + ((regionName != string.Empty) ? " " + regionName : "");
imageURL = string.Empty;
reason = string.Empty;
GridRegion region = null;
m_log.DebugFormat("[GATEKEEPER SERVICE]: Request to link to {0}", (regionName == string.Empty)? "default region" : regionName);
if (!m_AllowTeleportsToAnyRegion || regionName == string.Empty)
{
List<GridRegion> defs = m_GridService.GetDefaultRegions(m_ScopeID);
if (defs != null && defs.Count > 0)
m_DefaultGatewayRegion = defs[0];
try
{
regionID = m_DefaultGatewayRegion.RegionID;
regionHandle = m_DefaultGatewayRegion.RegionHandle;
region = defs[0];
m_DefaultGatewayRegion = region;
}
catch
else
{
reason = "Grid setup problem. Try specifying a particular region here.";
m_log.DebugFormat("[GATEKEEPER SERVICE]: Unable to send information. Please specify a default region for this grid!");
return false;
}
return true;
}
GridRegion region = m_GridService.GetRegionByName(m_ScopeID, regionName);
else
{
region = m_GridService.GetRegionByName(m_ScopeID, regionName);
if (region == null)
{
reason = "Region not found";
return false;
}
}
regionID = region.RegionID;
regionHandle = region.RegionHandle;
string regionimage = "regionImage" + region.RegionID.ToString();
regionimage = regionimage.Replace("-", "");
string regionimage = "regionImage" + regionID.ToString();
regionimage = regionimage.Replace("-", "");
imageURL = region.ServerURI + "index.php?method=" + regionimage;
return true;

View File

@ -101,7 +101,7 @@ namespace OpenSim.Services.HypergridService
serverConfig = config.Configs["GatekeeperService"];
m_GridName = serverConfig.GetString("ExternalName", string.Empty);
}
else if (!m_GridName.EndsWith("/"))
if (!m_GridName.EndsWith("/"))
m_GridName = m_GridName + "/";
}
}

View File

@ -101,7 +101,7 @@ namespace OpenSim.Services.Interfaces
if (str != string.Empty)
{
string[] parts = str.Split(new char[] { ';' });
Dictionary<string, object> dic = new Dictionary<string, object>();
// Dictionary<string, object> dic = new Dictionary<string, object>();
foreach (string s in parts)
{
string[] parts2 = s.Split(new char[] { '*' });

View File

@ -772,6 +772,8 @@ namespace OpenSim.Services.LLLoginService
{
aCircuit.ServiceURLs[kvp.Key] = kvp.Value;
}
if (!aCircuit.ServiceURLs[kvp.Key].ToString().EndsWith("/"))
aCircuit.ServiceURLs[kvp.Key] = aCircuit.ServiceURLs[kvp.Key] + "/";
}
// New style: service keys start with SRV_; override the previous
@ -784,6 +786,9 @@ namespace OpenSim.Services.LLLoginService
{
string keyName = serviceKey.Replace("SRV_", "");
aCircuit.ServiceURLs[keyName] = m_LoginServerConfig.GetString(serviceKey, string.Empty);
if (!aCircuit.ServiceURLs[keyName].ToString().EndsWith("/"))
aCircuit.ServiceURLs[keyName] = aCircuit.ServiceURLs[keyName] + "/";
m_log.DebugFormat("[LLLOGIN SERVICE]: found new key {0} {1}", keyName, aCircuit.ServiceURLs[keyName]);
}
}

View File

@ -0,0 +1,237 @@
/*
* 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 System.Collections.Generic;
using System.Reflection;
using log4net;
using Mono.Addins;
using Nini.Config;
using OpenMetaverse;
using OpenSim.Framework;
using OpenSim.Region.Framework.Interfaces;
using OpenSim.Region.Framework.Scenes;
using OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups;
namespace OpenSim.Tests.Common.Mock
{
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
public class MockGroupsServicesConnector : ISharedRegionModule, IGroupsServicesConnector
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
public string Name
{
get { return "MockGroupsServicesConnector"; }
}
public Type ReplaceableInterface
{
get { return null; }
}
public void Initialise(IConfigSource config)
{
}
public void Close()
{
}
public void AddRegion(Scene scene)
{
m_log.DebugFormat("[MOCK GROUPS SERVICES CONNECTOR]: Adding to region {0}", scene.RegionInfo.RegionName);
scene.RegisterModuleInterface<IGroupsServicesConnector>(this);
}
public void RemoveRegion(Scene scene)
{
}
public void RegionLoaded(Scene scene)
{
}
public void PostInitialise()
{
}
public UUID CreateGroup(UUID requestingAgentID, string name, string charter, bool showInList, UUID insigniaID,
int membershipFee, bool openEnrollment, bool allowPublish,
bool maturePublish, UUID founderID)
{
return UUID.Zero;
}
public void UpdateGroup(UUID requestingAgentID, UUID groupID, string charter, bool showInList,
UUID insigniaID, int membershipFee, bool openEnrollment,
bool allowPublish, bool maturePublish)
{
}
public void AddGroupRole(UUID requestingAgentID, UUID groupID, UUID roleID, string name, string description,
string title, ulong powers)
{
}
public void RemoveGroupRole(UUID requestingAgentID, UUID groupID, UUID roleID)
{
}
public void UpdateGroupRole(UUID requestingAgentID, UUID groupID, UUID roleID, string name, string description,
string title, ulong powers)
{
}
public GroupRecord GetGroupRecord(UUID requestingAgentID, UUID GroupID, string GroupName)
{
return null;
}
public GroupProfileData GetMemberGroupProfile(UUID requestingAgentID, UUID GroupID, UUID AgentID)
{
return default(GroupProfileData);
}
public void SetAgentActiveGroup(UUID requestingAgentID, UUID AgentID, UUID GroupID)
{
}
public void SetAgentActiveGroupRole(UUID requestingAgentID, UUID AgentID, UUID GroupID, UUID RoleID)
{
}
public void SetAgentGroupInfo(UUID requestingAgentID, UUID AgentID, UUID GroupID, bool AcceptNotices, bool ListInProfile)
{
}
public void AddAgentToGroupInvite(UUID requestingAgentID, UUID inviteID, UUID groupID, UUID roleID, UUID agentID)
{
}
public GroupInviteInfo GetAgentToGroupInvite(UUID requestingAgentID, UUID inviteID)
{
return null;
}
public void RemoveAgentToGroupInvite(UUID requestingAgentID, UUID inviteID)
{
}
public void AddAgentToGroup(UUID requestingAgentID, UUID AgentID, UUID GroupID, UUID RoleID)
{
}
public void RemoveAgentFromGroup(UUID requestingAgentID, UUID AgentID, UUID GroupID)
{
}
public void AddAgentToGroupRole(UUID requestingAgentID, UUID AgentID, UUID GroupID, UUID RoleID)
{
}
public void RemoveAgentFromGroupRole(UUID requestingAgentID, UUID AgentID, UUID GroupID, UUID RoleID)
{
}
public List<DirGroupsReplyData> FindGroups(UUID requestingAgentID, string search)
{
return null;
}
public GroupMembershipData GetAgentGroupMembership(UUID requestingAgentID, UUID AgentID, UUID GroupID)
{
return null;
}
public GroupMembershipData GetAgentActiveMembership(UUID requestingAgentID, UUID AgentID)
{
return null;
}
public List<GroupMembershipData> GetAgentGroupMemberships(UUID requestingAgentID, UUID AgentID)
{
return new List<GroupMembershipData>();
}
public List<GroupRolesData> GetAgentGroupRoles(UUID requestingAgentID, UUID AgentID, UUID GroupID)
{
return null;
}
public List<GroupRolesData> GetGroupRoles(UUID requestingAgentID, UUID GroupID)
{
return null;
}
public List<GroupMembersData> GetGroupMembers(UUID requestingAgentID, UUID GroupID)
{
return null;
}
public List<GroupRoleMembersData> GetGroupRoleMembers(UUID requestingAgentID, UUID GroupID)
{
return null;
}
public List<GroupNoticeData> GetGroupNotices(UUID requestingAgentID, UUID GroupID)
{
return null;
}
public GroupNoticeInfo GetGroupNotice(UUID requestingAgentID, UUID noticeID)
{
return null;
}
public void AddGroupNotice(UUID requestingAgentID, UUID groupID, UUID noticeID, string fromName, string subject, string message, byte[] binaryBucket)
{
}
public void ResetAgentGroupChatSessions(UUID agentID)
{
}
public bool hasAgentBeenInvitedToGroupChatSession(UUID agentID, UUID groupID)
{
return false;
}
public bool hasAgentDroppedGroupChatSession(UUID agentID, UUID groupID)
{
return false;
}
public void AgentDroppedFromGroupChatSession(UUID agentID, UUID groupID)
{
}
public void AgentInvitedToGroupChatSession(UUID agentID, UUID groupID)
{
}
}
}

View File

@ -424,10 +424,13 @@ namespace OpenSim.Tests.Common.Setup
foreach (IRegionModuleBase module in newModules)
{
module.AddRegion(scene);
module.RegionLoaded(scene);
scene.AddRegionModule(module.Name, module);
}
// RegionLoaded is fired after all modules have been appropriately added to all scenes
foreach (IRegionModuleBase module in newModules)
module.RegionLoaded(scene);
scene.SetModuleInterfaces();
}

View File

@ -397,9 +397,7 @@
; sized packets and faster sending of data, but more delay in
; updating interest lists
;
;PrimTerseUpdatesPerPacket = 25
;AvatarTerseUpdatesPerPacket = 10
;PrimFullUpdatesPerPacket = 100
;PrimUpdatesPerCallback = 100
; TextureSendLimit determines how many packets will be put on
; the outgoing queue each cycle. Like the settings above, this

View File

@ -24,7 +24,7 @@
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,HGAssetService@8002/OpenSim.Server.Handlers.dll:AssetServiceConnector,8002/OpenSim.Server.Handlers.dll:HeloServiceInConnector"
; * This is common for all services, it's the network setup for the entire
; * server instance, if none if specified above
; * server instance, if none is specified above
; *
[Network]
port = 8003
@ -48,7 +48,7 @@ ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003
[AssetService]
LocalServiceModule = "OpenSim.Services.AssetService.dll:AssetService"
DefaultAssetLoader = "OpenSim.Framework.AssetLoader.Filesystem.dll"
AssetLoaderArgs = "assets/AssetSets.xml"
AssetLoaderArgs = "./assets/AssetSets.xml"
; * This configuration loads the inventory server modules. It duplicates
; * the function of the legacy inventory server
@ -68,6 +68,12 @@ ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003
;; Perform distance check for the creation of a linked region
; Check4096 = "True"
;; Needed to display non-default map tile images for linked regions
AssetService = "OpenSim.Services.AssetService.dll:AssetService"
;; Directory for map tile images of linked regions
; MapTileDirectory = "./"
;; Next, we can specify properties of regions, including default and fallback regions
;; The syntax is: Region_<RegionName> = "<flags>"
;; or: Region_<RegionID> = "<flags>"
@ -79,11 +85,22 @@ ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003
; * This is the configuration for the freeswitch server in grid mode
[FreeswitchService]
LocalServiceModule = "OpenSim.Services.FreeswitchService.dll:FreeswitchService"
;; IP of your FS server
; ServerAddress = 127.0.0.1
;; All other options are - well - optional
; Realm = "127.0.0.1"
; SIPProxy = "127.0.0.1:5060"
; EchoServer = "127.0.0.1"
; EchoPort = 50505
; AttemptSTUN = "false"
; DefaultTimeout = 5000
; Context = "default"
; UserName = "freeswitch"
; Password = "password"
; * This is the new style authentication service. Currently, only MySQL
; * is implemented. "Realm" is the table that is used for user lookup.
; * It defaults to "useraccounts", which uses the new style.
; * Realm = "users" will use the legacy tables as an authentication source
; * is implemented.
; *
[AuthenticationService]
; for the server connector
@ -97,7 +114,8 @@ ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003
; * This is the new style user service.
; * "Realm" is the table that is used for user lookup.
; * It defaults to "users", which uses the legacy tables
; * It defaults to "useraccounts", which uses the new style.
; * Realm = "users" will use the legacy tables as an authentication source
; *
[UserAccountService]
; for the server connector
@ -150,7 +168,7 @@ ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003
AllowRemoteSetLoginLevel = "false"
; If you run this login server behind a proxy, set this to true
; HasProxy = true
; HasProxy = false
; Defaults for the users, if none is specified in the useraccounts table entry (ServiceURLs)
; CHANGE THIS
@ -159,7 +177,7 @@ ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003
SRV_HomeURI = "http://127.0.0.1:8002"
SRV_InventoryServerURI = "http://127.0.0.1:8002"
SRV_AssetServerURI = "http://127.0.0.1:8002"
SRV_ProfileServerURI = "http://127.0.0.1:8002"
SRV_ProfileServerURI = "http://127.0.0.1:8002/user"
[GridInfoService]
; These settings are used to return information on a get_grid_info call.
@ -218,7 +236,7 @@ ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003
AllowTeleportsToAnyRegion = true
; If you run this gatekeeper server behind a proxy, set this to true
; HasProxy = true
; HasProxy = false
[UserAgentService]
@ -229,7 +247,7 @@ ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003
GatekeeperService = "OpenSim.Services.HypergridService.dll:GatekeeperService"
; If you run this user agent server behind a proxy, set this to true
; HasProxy = true
; HasProxy = false
;; If you separate the UserAgentService from the LoginService, set this to
;; the IP address of the machine where your LoginService is

View File

@ -16,7 +16,7 @@
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"
; * This is common for all services, it's the network setup for the entire
; * server instance, if none if specified above
; * server instance, if none is specified above
; *
[Network]
port = 8003
@ -40,7 +40,7 @@ ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003
[AssetService]
LocalServiceModule = "OpenSim.Services.AssetService.dll:AssetService"
DefaultAssetLoader = "OpenSim.Framework.AssetLoader.Filesystem.dll"
AssetLoaderArgs = "assets/AssetSets.xml"
AssetLoaderArgs = "./assets/AssetSets.xml"
AllowRemoteDelete = "false"
; * This configuration loads the inventory server modules. It duplicates
@ -84,9 +84,7 @@ ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003
; Password = "password"
; * This is the new style authentication service. Currently, only MySQL
; * is implemented. "Realm" is the table that is used for user lookup.
; * It defaults to "users", which uses the legacy tables as an
; * authentication source.
; * is implemented.
; *
[AuthenticationService]
; for the server connector
@ -158,7 +156,7 @@ ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003
; MapTileURL = "";
; If you run this login server behind a proxy, set this to true
; HasProxy = true
; HasProxy = false
[GridInfoService]
; These settings are used to return information on a get_grid_info call.

View File

@ -42,6 +42,9 @@
GridServerURI = "http://mygridserver.com:8003"
;AllowHypergridMapSearch = true
;; Directory for map tile images of linked regions
; MapTileDirectory = "./"
[AvatarService]
;
; change this to your grid-wide grid server
@ -84,7 +87,7 @@
; Change this to your profile server
; accessible from other grids
;
ProfileServerURI = "http://mygridserver.com:8002/profiles"
ProfileServerURI = "http://mygridserver.com:8002/user"
[Modules]
;; Choose 0 or 1 cache modules, and the corresponding config file, if it exists.

View File

@ -49,6 +49,9 @@
LocalServiceModule = "OpenSim.Services.GridService.dll:GridService"
StorageProvider = "OpenSim.Data.Null.dll:NullRegionData"
; Needed to display non-default map tile images for linked regions
AssetService = "OpenSim.Services.Connectors.dll:AssetServicesConnector"
AllowHypergridMapSearch = true
[LibraryService]

View File

@ -65,6 +65,9 @@
;; With hypergrid, perform distance check for the creation of a linked region
; Check4096 = true
;; Directory for map tile images of remote regions
; MapTileDirectory = "./"
;; Next, we can specify properties of regions, including default and fallback regions
;; The syntax is: Region_<RegioName> = "<flags>"
;; where <flags> can be DefaultRegion, FallbackRegion, NoDirectLogin, Persistent, LockedOut

View File

@ -70,6 +70,9 @@
Realm = "regions"
StorageProvider = "OpenSim.Data.Null.dll"
; Needed to display non-default map tile images for remote regions
AssetService = "OpenSim.Services.AssetService.dll:AssetService"
AllowHypergridMapSearch = true
[PresenceService]

Binary file not shown.

View File

@ -2733,6 +2733,7 @@
<Reference name="System.Xml"/>
<Reference name="System.Data"/>
<Reference name="log4net" path="../../../bin/"/>
<Reference name="Mono.Addins" path="../../../bin/"/>
<Reference name="Nini" path="../../../bin/"/>
<Reference name="nunit.framework" path="../../../bin/"/>
<Reference name="OpenMetaverse" path="../../../bin/"/>
@ -2747,6 +2748,7 @@
<Reference name="OpenSim.Server.Base"/>
<Reference name="OpenSim.Region.Framework"/>
<Reference name="OpenSim.Region.CoreModules"/>
<Reference name="OpenSim.Region.OptionalModules"/>
<Reference name="OpenSim.Region.Physics.Manager"/>
<Files>
@ -2974,6 +2976,62 @@
</Files>
</Project>
<Project frameworkVersion="v3_5" name="OpenSim.Region.OptionalModules.Tests" path="OpenSim/Region/OptionalModules" type="Library">
<Configuration name="Debug">
<Options>
<OutputPath>../../../bin/</OutputPath>
</Options>
</Configuration>
<Configuration name="Release">
<Options>
<OutputPath>../../../bin/</OutputPath>
</Options>
</Configuration>
<ReferencePath>../../../bin/</ReferencePath>
<Reference name="System"/>
<Reference name="System.Core"/>
<Reference name="System.Xml"/>
<Reference name="System.Drawing"/>
<Reference name="OpenMetaverseTypes" path="../../../bin/"/>
<Reference name="OpenMetaverse" path="../../../bin/"/>
<Reference name="OpenSim.Data"/>
<Reference name="OpenSim.Framework"/>
<Reference name="OpenSim.Framework.Serialization"/>
<Reference name="OpenSim.Framework.Communications"/>
<Reference name="OpenSim.Framework.Console"/>
<Reference name="OpenSim.Framework.Servers"/>
<Reference name="OpenSim.Framework.Servers.HttpServer"/>
<Reference name="OpenSim.Framework.Statistics"/>
<Reference name="OpenSim.Region.Framework"/>
<Reference name="OpenSim.Region.CoreModules"/>
<Reference name="OpenSim.Region.Physics.Manager"/>
<Reference name="OpenSim.Services.Interfaces"/>
<!-- Unit tests -->
<Reference name="OpenSim.Tests.Common"/>
<Reference name="Nini" path="../../../bin/"/>
<Reference name="nunit.framework" path="../../../bin/"/>
<!-- For scripting in funny languages by default -->
<Reference name="XMLRPC" path="../../../bin/"/>
<Reference name="OpenSim.Framework.Communications"/>
<Reference name="Nini" path="../../../bin/"/>
<Reference name="log4net" path="../../../bin/"/>
<Reference name="DotNetOpenMail" path="../../../bin/"/>
<!--
TODO: this is kind of lame, we basically build a duplicate
assembly but with tests added in, just so that we don't
need to hard code in a bunch of Test directories here. If
pattern="Tests/*.cs" worked, we wouldn't need this.
-->
<Files>
<!-- SADLY the way this works means you need to keep adding these paths -->
<Match path="Avatar/XmlRpcGroups/Tests" pattern="*.cs" recurse="true"/>
</Files>
</Project>
<Project frameworkVersion="v3_5" name="OpenSim.Region.Framework.Tests" path="OpenSim/Region/Framework" type="Library">
<Configuration name="Debug">
<Options>
@ -3002,6 +3060,7 @@
<Reference name="OpenSim.Framework.Servers.HttpServer"/>
<Reference name="OpenSim.Region.Framework"/>
<Reference name="OpenSim.Region.CoreModules"/>
<Reference name="OpenSim.Region.OptionalModules"/>
<Reference name="OpenSim.Region.Physics.Manager"/>
<Reference name="OpenSim.Services.Interfaces"/>