Merge branch 'master' of ssh://MyConnection/var/git/opensim

0.6.8-post-fixes
Teravus Ovares (Dan Olivares) 2009-11-25 14:13:51 -05:00
commit dac9c6fb23
16 changed files with 77 additions and 24 deletions

View File

@ -158,6 +158,7 @@ This software uses components from the following developers:
* Nini (http://nini.sourceforge.net/) * Nini (http://nini.sourceforge.net/)
* log4net (http://logging.apache.org/log4net/) * log4net (http://logging.apache.org/log4net/)
* GlynnTucker.Cache (http://gtcache.sourceforge.net/) * GlynnTucker.Cache (http://gtcache.sourceforge.net/)
* NDesk.Options 0.2.1 (http://www.ndesk.org/Options)
Some plugins are based on Cable Beach Some plugins are based on Cable Beach
Cable Beach is Copyright (c) 2008 Intel Corporation Cable Beach is Copyright (c) 2008 Intel Corporation

View File

@ -79,7 +79,8 @@ namespace OpenSim.Framework.Tests
cachedItem.Store(foo); cachedItem.Store(foo);
cache.Store(cacheItemUUID.ToString(), cachedItem); cache.Store(cacheItemUUID.ToString(), cachedItem);
object citem = cache.Get(cacheItemUUID.ToString()); cache.Get(cacheItemUUID.ToString());
//object citem = cache.Get(cacheItemUUID.ToString());
//Assert.That(citem == null, "Item should not be in Cache because the expiry time was before now"); //Assert.That(citem == null, "Item should not be in Cache because the expiry time was before now");
} }
@ -94,7 +95,8 @@ namespace OpenSim.Framework.Tests
cachedItem.Store(foo); cachedItem.Store(foo);
cache.Store(cacheItemUUID.ToString(), cachedItem); cache.Store(cacheItemUUID.ToString(), cachedItem);
cache.Invalidate(ImmediateExpiryUUID.ToString()); cache.Invalidate(ImmediateExpiryUUID.ToString());
object citem = cache.Get(cacheItemUUID.ToString()); cache.Get(cacheItemUUID.ToString());
//object citem = cache.Get(cacheItemUUID.ToString());
//Assert.That(citem == null, "Item should not be in Cache because we manually invalidated it"); //Assert.That(citem == null, "Item should not be in Cache because we manually invalidated it");
} }

View File

@ -42,7 +42,7 @@ namespace OpenSim
{ {
public class HGCommands public class HGCommands
{ {
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
public static Scene CreateScene(RegionInfo regionInfo, AgentCircuitManager circuitManager, CommunicationsManager m_commsManager, public static Scene CreateScene(RegionInfo regionInfo, AgentCircuitManager circuitManager, CommunicationsManager m_commsManager,
StorageManager storageManager, ModuleLoader m_moduleLoader, ConfigSettings m_configSettings, OpenSimConfigSource m_config, string m_version) StorageManager storageManager, ModuleLoader m_moduleLoader, ConfigSettings m_configSettings, OpenSimConfigSource m_config, string m_version)

View File

@ -232,7 +232,7 @@ namespace OpenSim
"Save named prim to XML2", SavePrimsXml2); "Save named prim to XML2", SavePrimsXml2);
m_console.Commands.AddCommand("region", false, "load oar", m_console.Commands.AddCommand("region", false, "load oar",
"load oar <oar name>", "load oar [--merge] <oar name>",
"Load a region's data from OAR archive", LoadOar); "Load a region's data from OAR archive", LoadOar);
m_console.Commands.AddCommand("region", false, "save oar", m_console.Commands.AddCommand("region", false, "save oar",

View File

@ -57,21 +57,21 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
#region ISharedRegionModule Members #region ISharedRegionModule Members
public virtual void Initialise(IConfigSource config) public virtual void Initialise(IConfigSource config)
{ {
m_config = config.Configs["Chat"]; m_config = config.Configs["Chat"];
if (null == m_config) if (null == m_config)
{ {
m_log.Info("[CHAT]: no config found, plugin disabled"); m_log.Info("[CHAT]: no config found, plugin disabled");
m_enabled = false;
return; return;
} }
if (!m_config.GetBoolean("enabled", false)) if (!m_config.GetBoolean("enabled", true))
{ {
m_log.Info("[CHAT]: plugin disabled by configuration"); m_log.Info("[CHAT]: plugin disabled by configuration");
m_enabled = false;
return; return;
} }
m_enabled = true;
m_whisperdistance = config.Configs["Chat"].GetInt("whisper_distance", m_whisperdistance); m_whisperdistance = config.Configs["Chat"].GetInt("whisper_distance", m_whisperdistance);
m_saydistance = config.Configs["Chat"].GetInt("say_distance", m_saydistance); m_saydistance = config.Configs["Chat"].GetInt("say_distance", m_saydistance);

View File

@ -93,6 +93,16 @@ namespace OpenSim.Region.CoreModules.World.Archiver
List<EntityBase> entities = m_scene.GetEntities(); List<EntityBase> entities = m_scene.GetEntities();
List<SceneObjectGroup> sceneObjects = new List<SceneObjectGroup>(); List<SceneObjectGroup> sceneObjects = new List<SceneObjectGroup>();
/*
foreach (ILandObject lo in m_scene.LandChannel.AllParcels())
{
if (name == lo.LandData.Name)
{
// This is the parcel we want
}
}
*/
// Filter entities so that we only have scene objects. // Filter entities so that we only have scene objects.
// FIXME: Would be nicer to have this as a proper list in SceneGraph, since lots of methods // FIXME: Would be nicer to have this as a proper list in SceneGraph, since lots of methods
// end up having to do this // end up having to do this

View File

@ -26,9 +26,11 @@
*/ */
using System; using System;
using System.Collections.Generic;
using System.IO; using System.IO;
using System.Reflection; using System.Reflection;
using log4net; using log4net;
using NDesk.Options;
using Nini.Config; using Nini.Config;
using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Interfaces;
using OpenSim.Region.Framework.Scenes; using OpenSim.Region.Framework.Scenes;
@ -91,13 +93,23 @@ namespace OpenSim.Region.CoreModules.World.Archiver
/// <param name="cmdparams"></param> /// <param name="cmdparams"></param>
public void HandleLoadOarConsoleCommand(string module, string[] cmdparams) public void HandleLoadOarConsoleCommand(string module, string[] cmdparams)
{ {
if (cmdparams.Length > 2) bool mergeOar = false;
OptionSet options = new OptionSet().Add("m|merge", delegate (string v) { mergeOar = v != null; });
List<string> mainParams = options.Parse(cmdparams);
// m_log.DebugFormat("MERGE OAR IS [{0}]", mergeOar);
//
// foreach (string param in mainParams)
// m_log.DebugFormat("GOT PARAM [{0}]", param);
if (mainParams.Count > 2)
{ {
DearchiveRegion(cmdparams[2]); DearchiveRegion(mainParams[2], mergeOar, Guid.Empty);
} }
else else
{ {
DearchiveRegion(DEFAULT_OAR_BACKUP_FILENAME); DearchiveRegion(DEFAULT_OAR_BACKUP_FILENAME, mergeOar, Guid.Empty);
} }
} }

View File

@ -154,6 +154,7 @@ namespace OpenSim.Region.CoreModules.World.Land
m_landManagementModule.UpdateLandObject(localID, data); m_landManagementModule.UpdateLandObject(localID, data);
} }
} }
public void ReturnObjectsInParcel(int localID, uint returnType, UUID[] agentIDs, UUID[] taskIDs, IClientAPI remoteClient) public void ReturnObjectsInParcel(int localID, uint returnType, UUID[] agentIDs, UUID[] taskIDs, IClientAPI remoteClient)
{ {
if (m_landManagementModule != null) if (m_landManagementModule != null)

View File

@ -67,7 +67,14 @@ namespace OpenSim.Region.CoreModules.World.Land
private const int landArrayMax = ((int)((int)Constants.RegionSize / 4) >= 64) ? (int)((int)Constants.RegionSize / 4) : 64; private const int landArrayMax = ((int)((int)Constants.RegionSize / 4) >= 64) ? (int)((int)Constants.RegionSize / 4) : 64;
#pragma warning restore 0429 #pragma warning restore 0429
/// <value>
/// Local land ids at specified region co-ordinates (region size / 4)
/// </value>
private readonly int[,] m_landIDList = new int[landArrayMax, landArrayMax]; private readonly int[,] m_landIDList = new int[landArrayMax, landArrayMax];
/// <value>
/// Land objects keyed by local id
/// </value>
private readonly Dictionary<int, ILandObject> m_landList = new Dictionary<int, ILandObject>(); private readonly Dictionary<int, ILandObject> m_landList = new Dictionary<int, ILandObject>();
private bool m_landPrimCountTainted; private bool m_landPrimCountTainted;
@ -570,6 +577,7 @@ namespace OpenSim.Region.CoreModules.World.Land
if (x_float > Constants.RegionSize || x_float <= 0 || y_float > Constants.RegionSize || y_float <= 0) if (x_float > Constants.RegionSize || x_float <= 0 || y_float > Constants.RegionSize || y_float <= 0)
return null; return null;
try try
{ {
x = Convert.ToInt32(Math.Floor(Convert.ToDouble(x_float) / 4.0)); x = Convert.ToInt32(Math.Floor(Convert.ToDouble(x_float) / 4.0));
@ -584,6 +592,7 @@ namespace OpenSim.Region.CoreModules.World.Land
{ {
return null; return null;
} }
lock (m_landList) lock (m_landList)
{ {
// Corner case. If an autoreturn happens during sim startup // Corner case. If an autoreturn happens during sim startup
@ -603,6 +612,7 @@ namespace OpenSim.Region.CoreModules.World.Land
// they happen every time at border crossings // they happen every time at border crossings
throw new Exception("Error: Parcel not found at point " + x + ", " + y); throw new Exception("Error: Parcel not found at point " + x + ", " + y);
} }
lock (m_landIDList) lock (m_landIDList)
{ {
try try

View File

@ -33,27 +33,42 @@ namespace OpenSim.Region.Framework.Interfaces
{ {
public interface ILandChannel public interface ILandChannel
{ {
List<ILandObject> ParcelsNearPoint(Vector3 position); /// <summary>
/// Get all parcels
/// </summary>
/// <returns></returns>
List<ILandObject> AllParcels(); List<ILandObject> AllParcels();
/// <summary> /// <summary>
/// Get the land object at the specified point /// Get the parcel at the specified point
/// </summary> /// </summary>
/// <param name="x">Value between 0 - 256 on the x axis of the point</param> /// <param name="x">Value between 0 - 256 on the x axis of the point</param>
/// <param name="y">Value between 0 - 256 on the y axis of the point</param> /// <param name="y">Value between 0 - 256 on the y axis of the point</param>
/// <returns>Land object at the point supplied</returns> /// <returns>Land object at the point supplied</returns>
ILandObject GetLandObject(int x, int y); ILandObject GetLandObject(int x, int y);
ILandObject GetLandObject(int localID);
/// <summary> /// <summary>
/// Get the land object at the specified point /// Get the parcel at the specified point
/// </summary> /// </summary>
/// <param name="x">Value between 0 - 256 on the x axis of the point</param> /// <param name="x">Value between 0 - 256 on the x axis of the point</param>
/// <param name="y">Value between 0 - 256 on the y axis of the point</param> /// <param name="y">Value between 0 - 256 on the y axis of the point</param>
/// <returns>Land object at the point supplied</returns> /// <returns>Land object at the point supplied</returns>
ILandObject GetLandObject(float x, float y); ILandObject GetLandObject(float x, float y);
/// <summary>
/// Get the parcels near the specified point
/// </summary>
/// <param name="position"></param>
/// <returns></returns>
List<ILandObject> ParcelsNearPoint(Vector3 position);
/// <summary>
/// Get the parcel given the land's local id.
/// </summary>
/// <param name="localID"></param>
/// <returns></returns>
ILandObject GetLandObject(int localID);
bool IsLandPrimCountTainted(); bool IsLandPrimCountTainted();
bool IsForcefulBansAllowed(); bool IsForcefulBansAllowed();
void UpdateLandObject(int localID, LandData data); void UpdateLandObject(int localID, LandData data);

View File

@ -118,6 +118,7 @@ public class RegionCombinerLargeLandChannel : ILandChannel
return regionData.RegionScene.LandChannel.GetLandObject(x - offsetX, y - offsetY); return regionData.RegionScene.LandChannel.GetLandObject(x - offsetX, y - offsetY);
} }
} }
ILandObject obj = new LandObject(UUID.Zero, false, RegData.RegionScene); ILandObject obj = new LandObject(UUID.Zero, false, RegData.RegionScene);
obj.LandData.Name = "NO LAND"; obj.LandData.Name = "NO LAND";
return obj; return obj;

View File

@ -636,13 +636,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
} }
// Teleport functions // Teleport functions
public void osTeleportAgent(string agent, uint regionX, uint regionY, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat) public void osTeleportAgent(string agent, int regionX, int regionY, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat)
{ {
// High because there is no security check. High griefer potential // High because there is no security check. High griefer potential
// //
CheckThreatLevel(ThreatLevel.High, "osTeleportAgent"); CheckThreatLevel(ThreatLevel.High, "osTeleportAgent");
ulong regionHandle = Util.UIntsToLong((regionX * (uint)Constants.RegionSize), (regionY * (uint)Constants.RegionSize)); ulong regionHandle = Util.UIntsToLong(((uint)regionX * (uint)Constants.RegionSize), ((uint)regionY * (uint)Constants.RegionSize));
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
UUID agentId = new UUID(); UUID agentId = new UUID();

View File

@ -83,7 +83,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
// Teleport commands // Teleport commands
void osTeleportAgent(string agent, string regionName, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat); void osTeleportAgent(string agent, string regionName, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat);
void osTeleportAgent(string agent, uint regionX, uint regionY, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat); void osTeleportAgent(string agent, int regionX, int regionY, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat);
void osTeleportAgent(string agent, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat); void osTeleportAgent(string agent, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat);
// Animation commands // Animation commands

View File

@ -201,9 +201,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
m_OSSL_Functions.osTeleportAgent(agent, regionName, position, lookat); m_OSSL_Functions.osTeleportAgent(agent, regionName, position, lookat);
} }
public void osTeleportAgent(string agent, long regionX, long regionY, vector position, vector lookat) public void osTeleportAgent(string agent, int regionX, int regionY, vector position, vector lookat)
{ {
m_OSSL_Functions.osTeleportAgent(agent, (uint) regionX, (uint) regionY, position, lookat); m_OSSL_Functions.osTeleportAgent(agent, regionX, regionY, position, lookat);
} }
public void osTeleportAgent(string agent, vector position, vector lookat) public void osTeleportAgent(string agent, vector position, vector lookat)

BIN
bin/NDesk.Options.dll Normal file

Binary file not shown.

View File

@ -1596,6 +1596,7 @@
<Reference name="System.Xml"/> <Reference name="System.Xml"/>
<Reference name="System.Drawing"/> <Reference name="System.Drawing"/>
<Reference name="System.Web"/> <Reference name="System.Web"/>
<Reference name="NDesk.Options"/>
<Reference name="OpenMetaverseTypes.dll"/> <Reference name="OpenMetaverseTypes.dll"/>
<Reference name="OpenMetaverse.StructuredData.dll"/> <Reference name="OpenMetaverse.StructuredData.dll"/>
<Reference name="OpenMetaverse.dll"/> <Reference name="OpenMetaverse.dll"/>
@ -3414,7 +3415,7 @@
</Files> </Files>
</Project> </Project>
<?include file="addon-modules/*/prebuild.xml" ?> <?include file="addon-modules/*/prebuild*.xml" ?>
</Solution> </Solution>