Merge branch 'master' of ssh://3dhosting.de/var/git/careminster

avinationmerge
Melanie 2012-02-19 14:20:53 +01:00
commit 185bf55804
33 changed files with 688 additions and 90 deletions

View File

@ -542,3 +542,25 @@ CREATE TABLE regionwindlight (
draw_classic_clouds INTEGER NOT NULL DEFAULT '1'); draw_classic_clouds INTEGER NOT NULL DEFAULT '1');
COMMIT; COMMIT;
:VERSION 24
BEGIN;
CREATE TABLE IF NOT EXISTS `spawn_points` (
`RegionID` varchar(36) NOT NULL DEFAULT '000000-0000-0000-0000-000000000000',
`Yaw` float NOT NULL,
`Pitch` float NOT NULL,
`Distance` float NOT NULL
);
ALTER TABLE `regionsettings` ADD COLUMN `TelehubObject` varchar(36) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000';
COMMIT;
:VERSION 25
BEGIN;
ALTER TABLE `regionsettings` ADD COLUMN `parcel_tile_ID` char(36) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000';
COMMIT;

View File

@ -61,6 +61,7 @@ namespace OpenSim.Data.SQLite
private const string regionbanListSelect = "select * from regionban"; private const string regionbanListSelect = "select * from regionban";
private const string regionSettingsSelect = "select * from regionsettings"; private const string regionSettingsSelect = "select * from regionsettings";
private const string regionWindlightSelect = "select * from regionwindlight"; private const string regionWindlightSelect = "select * from regionwindlight";
private const string regionSpawnPointsSelect = "select * from spawn_points";
private DataSet ds; private DataSet ds;
private SqliteDataAdapter primDa; private SqliteDataAdapter primDa;
@ -71,6 +72,7 @@ namespace OpenSim.Data.SQLite
private SqliteDataAdapter landAccessListDa; private SqliteDataAdapter landAccessListDa;
private SqliteDataAdapter regionSettingsDa; private SqliteDataAdapter regionSettingsDa;
private SqliteDataAdapter regionWindlightDa; private SqliteDataAdapter regionWindlightDa;
private SqliteDataAdapter regionSpawnPointsDa;
private SqliteConnection m_conn; private SqliteConnection m_conn;
private String m_connectionString; private String m_connectionString;
@ -140,6 +142,10 @@ namespace OpenSim.Data.SQLite
SqliteCommand regionWindlightSelectCmd = new SqliteCommand(regionWindlightSelect, m_conn); SqliteCommand regionWindlightSelectCmd = new SqliteCommand(regionWindlightSelect, m_conn);
regionWindlightDa = new SqliteDataAdapter(regionWindlightSelectCmd); regionWindlightDa = new SqliteDataAdapter(regionWindlightSelectCmd);
SqliteCommand regionSpawnPointsSelectCmd = new SqliteCommand(regionSpawnPointsSelect, m_conn);
regionSpawnPointsDa = new SqliteDataAdapter(regionSpawnPointsSelectCmd);
// This actually does the roll forward assembly stuff // This actually does the roll forward assembly stuff
Migration m = new Migration(m_conn, Assembly, "RegionStore"); Migration m = new Migration(m_conn, Assembly, "RegionStore");
m.Update(); m.Update();
@ -170,6 +176,9 @@ namespace OpenSim.Data.SQLite
ds.Tables.Add(createRegionWindlightTable()); ds.Tables.Add(createRegionWindlightTable());
setupRegionWindlightCommands(regionWindlightDa, m_conn); setupRegionWindlightCommands(regionWindlightDa, m_conn);
ds.Tables.Add(createRegionSpawnPointsTable());
setupRegionSpawnPointsCommands(regionSpawnPointsDa, m_conn);
// WORKAROUND: This is a work around for sqlite on // WORKAROUND: This is a work around for sqlite on
// windows, which gets really unhappy with blob columns // windows, which gets really unhappy with blob columns
// that have no sample data in them. At some point we // that have no sample data in them. At some point we
@ -246,6 +255,15 @@ namespace OpenSim.Data.SQLite
m_log.ErrorFormat("[SQLITE REGION DB]: Caught fill error on regionwindlight table :{0}", e.Message); m_log.ErrorFormat("[SQLITE REGION DB]: Caught fill error on regionwindlight table :{0}", e.Message);
} }
try
{
regionSpawnPointsDa.Fill(ds.Tables["spawn_points"]);
}
catch (Exception e)
{
m_log.ErrorFormat("[SQLITE REGION DB]: Caught fill error on spawn_points table :{0}", e.Message);
}
// We have to create a data set mapping for every table, otherwise the IDataAdaptor.Update() will not populate rows with values! // We have to create a data set mapping for every table, otherwise the IDataAdaptor.Update() will not populate rows with values!
// Not sure exactly why this is - this kind of thing was not necessary before - justincc 20100409 // Not sure exactly why this is - this kind of thing was not necessary before - justincc 20100409
// Possibly because we manually set up our own DataTables before connecting to the database // Possibly because we manually set up our own DataTables before connecting to the database
@ -257,6 +275,7 @@ namespace OpenSim.Data.SQLite
CreateDataSetMapping(landAccessListDa, "landaccesslist"); CreateDataSetMapping(landAccessListDa, "landaccesslist");
CreateDataSetMapping(regionSettingsDa, "regionsettings"); CreateDataSetMapping(regionSettingsDa, "regionsettings");
CreateDataSetMapping(regionWindlightDa, "regionwindlight"); CreateDataSetMapping(regionWindlightDa, "regionwindlight");
CreateDataSetMapping(regionSpawnPointsDa, "spawn_points");
} }
} }
catch (Exception e) catch (Exception e)
@ -319,6 +338,11 @@ namespace OpenSim.Data.SQLite
regionWindlightDa.Dispose(); regionWindlightDa.Dispose();
regionWindlightDa = null; regionWindlightDa = null;
} }
if (regionSpawnPointsDa != null)
{
regionSpawnPointsDa.Dispose();
regionWindlightDa = null;
}
} }
public void StoreRegionSettings(RegionSettings rs) public void StoreRegionSettings(RegionSettings rs)
@ -339,8 +363,43 @@ namespace OpenSim.Data.SQLite
fillRegionSettingsRow(settingsRow, rs); fillRegionSettingsRow(settingsRow, rs);
} }
StoreSpawnPoints(rs);
Commit(); Commit();
} }
}
public void StoreSpawnPoints(RegionSettings rs)
{
lock (ds)
{
// DataTable spawnpoints = ds.Tables["spawn_points"];
// remove region's spawnpoints
using (
SqliteCommand cmd =
new SqliteCommand("delete from spawn_points where RegionID=:RegionID",
m_conn))
{
cmd.Parameters.Add(new SqliteParameter(":RegionID", rs.RegionUUID.ToString()));
cmd.ExecuteNonQuery();
}
}
foreach (SpawnPoint sp in rs.SpawnPoints())
{
using (SqliteCommand cmd = new SqliteCommand("insert into spawn_points(RegionID, Yaw, Pitch, Distance)" +
"values ( :RegionID, :Yaw, :Pitch, :Distance)", m_conn))
{
cmd.Parameters.Add(new SqliteParameter(":RegionID", rs.RegionUUID.ToString()));
cmd.Parameters.Add(new SqliteParameter(":Yaw", sp.Yaw));
cmd.Parameters.Add(new SqliteParameter(":Pitch", sp.Pitch));
cmd.Parameters.Add(new SqliteParameter(":Distance", sp.Distance));
cmd.ExecuteNonQuery();
}
}
} }
/// <summary> /// <summary>
@ -435,10 +494,31 @@ namespace OpenSim.Data.SQLite
RegionSettings newSettings = buildRegionSettings(row); RegionSettings newSettings = buildRegionSettings(row);
newSettings.OnSave += StoreRegionSettings; newSettings.OnSave += StoreRegionSettings;
LoadSpawnPoints(newSettings);
return newSettings; return newSettings;
} }
} }
private void LoadSpawnPoints(RegionSettings rs)
{
rs.ClearSpawnPoints();
DataTable spawnpoints = ds.Tables["spawn_points"];
string byRegion = "RegionID = '" + rs.RegionUUID + "'";
DataRow[] spForRegion = spawnpoints.Select(byRegion);
foreach (DataRow spRow in spForRegion)
{
SpawnPoint sp = new SpawnPoint();
sp.Pitch = (float)spRow["Pitch"];
sp.Yaw = (float)spRow["Yaw"];
sp.Distance = (float)spRow["Distance"];
rs.AddSpawnPoint(sp);
}
}
/// <summary> /// <summary>
/// Adds an object into region storage /// Adds an object into region storage
/// </summary> /// </summary>
@ -1265,6 +1345,8 @@ namespace OpenSim.Data.SQLite
createCol(regionsettings, "covenant", typeof(String)); createCol(regionsettings, "covenant", typeof(String));
createCol(regionsettings, "covenant_datetime", typeof(Int32)); createCol(regionsettings, "covenant_datetime", typeof(Int32));
createCol(regionsettings, "map_tile_ID", typeof(String)); createCol(regionsettings, "map_tile_ID", typeof(String));
createCol(regionsettings, "TelehubObject", typeof(String));
createCol(regionsettings, "parcel_tile_ID", typeof(String));
regionsettings.PrimaryKey = new DataColumn[] { regionsettings.Columns["regionUUID"] }; regionsettings.PrimaryKey = new DataColumn[] { regionsettings.Columns["regionUUID"] };
return regionsettings; return regionsettings;
} }
@ -1345,6 +1427,17 @@ namespace OpenSim.Data.SQLite
return regionwindlight; return regionwindlight;
} }
private static DataTable createRegionSpawnPointsTable()
{
DataTable spawn_points = new DataTable("spawn_points");
createCol(spawn_points, "regionID", typeof(String));
createCol(spawn_points, "Yaw", typeof(float));
createCol(spawn_points, "Pitch", typeof(float));
createCol(spawn_points, "Distance", typeof(float));
return spawn_points;
}
/*********************************************************************** /***********************************************************************
* *
* Convert between ADO.NET <=> OpenSim Objects * Convert between ADO.NET <=> OpenSim Objects
@ -1666,6 +1759,8 @@ namespace OpenSim.Data.SQLite
newSettings.Covenant = new UUID((String)row["covenant"]); newSettings.Covenant = new UUID((String)row["covenant"]);
newSettings.CovenantChangedDateTime = Convert.ToInt32(row["covenant_datetime"]); newSettings.CovenantChangedDateTime = Convert.ToInt32(row["covenant_datetime"]);
newSettings.TerrainImageID = new UUID((String)row["map_tile_ID"]); newSettings.TerrainImageID = new UUID((String)row["map_tile_ID"]);
newSettings.TelehubObject = new UUID((String)row["TelehubObject"]);
newSettings.ParcelImageID = new UUID((String)row["parcel_tile_ID"]);
return newSettings; return newSettings;
} }
@ -2068,6 +2163,8 @@ namespace OpenSim.Data.SQLite
row["covenant"] = settings.Covenant.ToString(); row["covenant"] = settings.Covenant.ToString();
row["covenant_datetime"] = settings.CovenantChangedDateTime; row["covenant_datetime"] = settings.CovenantChangedDateTime;
row["map_tile_ID"] = settings.TerrainImageID.ToString(); row["map_tile_ID"] = settings.TerrainImageID.ToString();
row["TelehubObject"] = settings.TelehubObject.ToString();
row["parcel_tile_ID"] = settings.ParcelImageID.ToString();
} }
/// <summary> /// <summary>
@ -2591,6 +2688,14 @@ namespace OpenSim.Data.SQLite
da.UpdateCommand.Connection = conn; da.UpdateCommand.Connection = conn;
} }
private void setupRegionSpawnPointsCommands(SqliteDataAdapter da, SqliteConnection conn)
{
da.InsertCommand = createInsertCommand("spawn_points", ds.Tables["spawn_points"]);
da.InsertCommand.Connection = conn;
da.UpdateCommand = createUpdateCommand("spawn_points", "RegionID=:RegionID", ds.Tables["spawn_points"]);
da.UpdateCommand.Connection = conn;
}
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>

View File

@ -308,7 +308,9 @@ namespace OpenSim.Framework.Servers
// clr version potentially is more confusing than helpful, since it doesn't tell us if we're running under Mono/MS .NET and // clr version potentially is more confusing than helpful, since it doesn't tell us if we're running under Mono/MS .NET and
// the clr version number doesn't match the project version number under Mono. // the clr version number doesn't match the project version number under Mono.
//m_log.Info("[STARTUP]: Virtual machine runtime version: " + Environment.Version + Environment.NewLine); //m_log.Info("[STARTUP]: Virtual machine runtime version: " + Environment.Version + Environment.NewLine);
m_log.Info("[STARTUP]: Operating system version: " + Environment.OSVersion + Environment.NewLine); m_log.InfoFormat(
"[STARTUP]: Operating system version: {0}, .NET platform {1}, {2}-bit\n",
Environment.OSVersion, Environment.OSVersion.Platform, Util.Is64BitProcess() ? "64" : "32");
StartupSpecific(); StartupSpecific();

View File

@ -36,6 +36,7 @@ using System.IO.Compression;
using System.Net; using System.Net;
using System.Net.Sockets; using System.Net.Sockets;
using System.Reflection; using System.Reflection;
using System.Runtime.InteropServices;
using System.Runtime.Serialization; using System.Runtime.Serialization;
using System.Runtime.Serialization.Formatters.Binary; using System.Runtime.Serialization.Formatters.Binary;
using System.Security.Cryptography; using System.Security.Cryptography;
@ -377,6 +378,20 @@ namespace OpenSim.Framework
return sb.ToString(); return sb.ToString();
} }
/// <summary>
/// Is the platform Windows?
/// </summary>
/// <returns>true if so, false otherwise</returns>
public static bool IsWindows()
{
PlatformID platformId = Environment.OSVersion.Platform;
return (platformId == PlatformID.Win32NT
|| platformId == PlatformID.Win32S
|| platformId == PlatformID.Win32Windows
|| platformId == PlatformID.WinCE);
}
public static bool IsEnvironmentSupported(ref string reason) public static bool IsEnvironmentSupported(ref string reason)
{ {
// Must have .NET 2.0 (Generics / libsl) // Must have .NET 2.0 (Generics / libsl)
@ -1471,6 +1486,27 @@ namespace OpenSim.Framework
return data; return data;
} }
/// <summary>
/// Used to trigger an early library load on Windows systems.
/// </summary>
/// <remarks>
/// Required to get 32-bit and 64-bit processes to automatically use the
/// appropriate native library.
/// </remarks>
/// <param name="dllToLoad"></param>
/// <returns></returns>
[DllImport("kernel32.dll")]
public static extern IntPtr LoadLibrary(string dllToLoad);
/// <summary>
/// Determine whether the current process is 64 bit
/// </summary>
/// <returns>true if so, false if not</returns>
public static bool Is64BitProcess()
{
return IntPtr.Size == 8;
}
#region FireAndForget Threading Pattern #region FireAndForget Threading Pattern
/// <summary> /// <summary>

View File

@ -903,47 +903,64 @@ namespace OpenSim.Region.ClientStack.LindenUDP
private void HandleUseCircuitCode(object o) private void HandleUseCircuitCode(object o)
{ {
// DateTime startTime = DateTime.Now; IPEndPoint remoteEndPoint = null;
object[] array = (object[])o; IClientAPI client = null;
UDPPacketBuffer buffer = (UDPPacketBuffer)array[0];
UseCircuitCodePacket uccp = (UseCircuitCodePacket)array[1];
m_log.DebugFormat("[LLUDPSERVER]: Handling UseCircuitCode request from {0}", buffer.RemoteEndPoint); try
IPEndPoint remoteEndPoint = (IPEndPoint)buffer.RemoteEndPoint;
AuthenticateResponse sessionInfo;
if (IsClientAuthorized(uccp, out sessionInfo))
{ {
// Begin the process of adding the client to the simulator // DateTime startTime = DateTime.Now;
IClientAPI client object[] array = (object[])o;
= AddClient( UDPPacketBuffer buffer = (UDPPacketBuffer)array[0];
uccp.CircuitCode.Code, UseCircuitCodePacket uccp = (UseCircuitCodePacket)array[1];
uccp.CircuitCode.ID,
uccp.CircuitCode.SessionID,
remoteEndPoint,
sessionInfo);
// Send ack straight away to let the viewer know that the connection is active. m_log.DebugFormat("[LLUDPSERVER]: Handling UseCircuitCode request from {0}", buffer.RemoteEndPoint);
// The client will be null if it already exists (e.g. if on a region crossing the client sends a use
// circuit code to the existing child agent. This is not particularly obvious. remoteEndPoint = (IPEndPoint)buffer.RemoteEndPoint;
SendAckImmediate(remoteEndPoint, uccp.Header.Sequence);
AuthenticateResponse sessionInfo;
if (IsClientAuthorized(uccp, out sessionInfo))
{
// Begin the process of adding the client to the simulator
client
= AddClient(
uccp.CircuitCode.Code,
uccp.CircuitCode.ID,
uccp.CircuitCode.SessionID,
remoteEndPoint,
sessionInfo);
// Send ack straight away to let the viewer know that the connection is active.
// The client will be null if it already exists (e.g. if on a region crossing the client sends a use
// circuit code to the existing child agent. This is not particularly obvious.
SendAckImmediate(remoteEndPoint, uccp.Header.Sequence);
// We only want to send initial data to new clients, not ones which are being converted from child to root.
if (client != null)
client.SceneAgent.SendInitialDataToMe();
}
else
{
// Don't create clients for unauthorized requesters.
m_log.WarnFormat(
"[LLUDPSERVER]: Connection request for client {0} connecting with unnotified circuit code {1} from {2}",
uccp.CircuitCode.ID, uccp.CircuitCode.Code, remoteEndPoint);
}
// m_log.DebugFormat(
// "[LLUDPSERVER]: Handling UseCircuitCode request from {0} took {1}ms",
// buffer.RemoteEndPoint, (DateTime.Now - startTime).Milliseconds);
// We only want to send initial data to new clients, not ones which are being converted from child to root.
if (client != null)
client.SceneAgent.SendInitialDataToMe();
} }
else catch (Exception e)
{ {
// Don't create clients for unauthorized requesters. m_log.ErrorFormat(
m_log.WarnFormat( "[LLUDPSERVER]: UseCircuitCode handling from endpoint {0}, client {1} {2} failed. Exception {3}{4}",
"[LLUDPSERVER]: Connection request for client {0} connecting with unnotified circuit code {1} from {2}", remoteEndPoint != null ? remoteEndPoint.ToString() : "n/a",
uccp.CircuitCode.ID, uccp.CircuitCode.Code, remoteEndPoint); client != null ? client.Name : "unknown",
client != null ? client.AgentId.ToString() : "unknown",
e.Message,
e.StackTrace);
} }
// m_log.DebugFormat(
// "[LLUDPSERVER]: Handling UseCircuitCode request from {0} took {1}ms",
// buffer.RemoteEndPoint, (DateTime.Now - startTime).Milliseconds);
} }
/// <summary> /// <summary>

View File

@ -496,6 +496,10 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
SetAppearanceAssets(sp.UUID, sp.Appearance); SetAppearanceAssets(sp.UUID, sp.Appearance);
m_scene.AvatarService.SetAppearance(agentid, sp.Appearance); m_scene.AvatarService.SetAppearance(agentid, sp.Appearance);
// Trigger this here because it's the final step in the set/queue/save process for appearance setting.
// Everything has been updated and stored. Ensures bakes have been persisted (if option is set to persist bakes).
m_scene.EventManager.TriggerAvatarAppearanceChanged(sp);
} }
private void SetAppearanceAssets(UUID userID, AvatarAppearance appearance) private void SetAppearanceAssets(UUID userID, AvatarAppearance appearance)

View File

@ -565,9 +565,14 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
// "[INVENTORY ACCESS MODULE]: Target of {0} in CreateItemForObject() is {1} {2}", // "[INVENTORY ACCESS MODULE]: Target of {0} in CreateItemForObject() is {1} {2}",
// action, remoteClient.Name, userID); // action, remoteClient.Name, userID);
} }
else if (so.RootPart.OwnerID == so.RootPart.GroupID)
{
// Group owned objects go to the last owner before the object was transferred.
userID = so.RootPart.LastOwnerID;
}
else else
{ {
// All returns / deletes go to the object owner // Other returns / deletes go to the object owner
// //
userID = so.RootPart.OwnerID; userID = so.RootPart.OwnerID;

View File

@ -65,13 +65,26 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
} }
} }
internal struct ScopedRegionPosition
{
public UUID m_scopeID;
public ulong m_regionHandle;
public ScopedRegionPosition(UUID scopeID, ulong handle)
{
m_scopeID = scopeID;
m_regionHandle = handle;
}
}
private ExpiringCache<ScopedRegionUUID, GridRegion> m_UUIDCache; private ExpiringCache<ScopedRegionUUID, GridRegion> m_UUIDCache;
private ExpiringCache<ScopedRegionName, ScopedRegionUUID> m_NameCache; private ExpiringCache<ScopedRegionName, ScopedRegionUUID> m_NameCache;
private ExpiringCache<ScopedRegionPosition, GridRegion> m_PositionCache;
public RegionInfoCache() public RegionInfoCache()
{ {
m_UUIDCache = new ExpiringCache<ScopedRegionUUID, GridRegion>(); m_UUIDCache = new ExpiringCache<ScopedRegionUUID, GridRegion>();
m_NameCache = new ExpiringCache<ScopedRegionName, ScopedRegionUUID>(); m_NameCache = new ExpiringCache<ScopedRegionName, ScopedRegionUUID>();
m_PositionCache = new ExpiringCache<ScopedRegionPosition, GridRegion>();
} }
public void Cache(GridRegion rinfo) public void Cache(GridRegion rinfo)
@ -96,6 +109,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
{ {
ScopedRegionName name = new ScopedRegionName(scopeID,rinfo.RegionName); ScopedRegionName name = new ScopedRegionName(scopeID,rinfo.RegionName);
m_NameCache.AddOrUpdate(name, id, CACHE_EXPIRATION_SECONDS); m_NameCache.AddOrUpdate(name, id, CACHE_EXPIRATION_SECONDS);
ScopedRegionPosition pos = new ScopedRegionPosition(scopeID, rinfo.RegionHandle);
m_PositionCache.AddOrUpdate(pos, rinfo, CACHE_EXPIRATION_SECONDS);
} }
} }
@ -114,6 +130,22 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
return null; return null;
} }
public GridRegion Get(UUID scopeID, ulong handle, out bool inCache)
{
inCache = false;
GridRegion rinfo = null;
ScopedRegionPosition pos = new ScopedRegionPosition(scopeID, handle);
if (m_PositionCache.TryGetValue(pos, out rinfo))
{
inCache = true;
return rinfo;
}
return null;
}
public GridRegion Get(UUID scopeID, string name, out bool inCache) public GridRegion Get(UUID scopeID, string name, out bool inCache)
{ {
inCache = false; inCache = false;

View File

@ -186,10 +186,16 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
public 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); bool inCache = false;
GridRegion rinfo = m_RegionInfoCache.Get(scopeID, Util.UIntsToLong((uint)x, (uint)y), out inCache);
if (inCache)
return rinfo;
rinfo = m_LocalGridService.GetRegionByPosition(scopeID, x, y);
if (rinfo == null) if (rinfo == null)
rinfo = m_RemoteGridService.GetRegionByPosition(scopeID, x, y); rinfo = m_RemoteGridService.GetRegionByPosition(scopeID, x, y);
m_RegionInfoCache.Cache(rinfo);
return rinfo; return rinfo;
} }

View File

@ -290,7 +290,8 @@ namespace OpenSim.Region.CoreModules.World.Land
ParcelFlags.AllowGroupScripts | ParcelFlags.AllowGroupScripts |
ParcelFlags.CreateGroupObjects | ParcelFlags.CreateGroupObjects |
ParcelFlags.AllowAPrimitiveEntry | ParcelFlags.AllowAPrimitiveEntry |
ParcelFlags.AllowGroupObjectEntry); ParcelFlags.AllowGroupObjectEntry |
ParcelFlags.AllowFly);
} }
if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId, this, GroupPowers.LandSetSale)) if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId, this, GroupPowers.LandSetSale))

View File

@ -148,6 +148,113 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests
<OtherParts /> <OtherParts />
</SceneObjectGroup>"; </SceneObjectGroup>";
private string badFloatsXml = @"
<SceneObjectGroup>
<RootPart>
<SceneObjectPart xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"">
<AllowedDrop>false</AllowedDrop>
<CreatorID><Guid>a6dacf01-4636-4bb9-8a97-30609438af9d</Guid></CreatorID>
<FolderID><Guid>e6a5a05e-e8cc-4816-8701-04165e335790</Guid></FolderID>
<InventorySerial>1</InventorySerial>
<TaskInventory />
<ObjectFlags>0</ObjectFlags>
<UUID><Guid>e6a5a05e-e8cc-4816-8701-04165e335790</Guid></UUID>
<LocalId>2698615125</LocalId>
<Name>NaughtyPrim</Name>
<Material>0</Material>
<PassTouches>false</PassTouches>
<RegionHandle>1099511628032000</RegionHandle>
<ScriptAccessPin>0</ScriptAccessPin>
<GroupPosition><X>147.23</X><Y>92.698</Y><Z>22.78084</Z></GroupPosition>
<OffsetPosition><X>0</X><Y>0</Y><Z>0</Z></OffsetPosition>
<RotationOffset><X>-4.371139E-08</X><Y>-1</Y><Z>-4.371139E-08</Z><W>0</W></RotationOffset>
<Velocity><X>0</X><Y>0</Y><Z>0</Z></Velocity>
<RotationalVelocity><X>0</X><Y>0</Y><Z>0</Z></RotationalVelocity>
<AngularVelocity><X>0</X><Y>0</Y><Z>0</Z></AngularVelocity>
<Acceleration><X>0</X><Y>0</Y><Z>0</Z></Acceleration>
<Description />
<Color />
<Text />
<SitName />
<TouchName />
<LinkNum>0</LinkNum>
<ClickAction>0</ClickAction>
<Shape>
<ProfileCurve>1</ProfileCurve>
<TextureEntry>AAAAAAAAERGZmQAAAAAABQCVlZUAAAAAQEAAAABAQAAAAAAAAAAAAAAAAAAAAA==</TextureEntry>
<ExtraParams>AA==</ExtraParams>
<PathBegin>0</PathBegin>
<PathCurve>16</PathCurve>
<PathEnd>0</PathEnd>
<PathRadiusOffset>0</PathRadiusOffset>
<PathRevolutions>0</PathRevolutions>
<PathScaleX>100</PathScaleX>
<PathScaleY>100</PathScaleY>
<PathShearX>0</PathShearX>
<PathShearY>0</PathShearY>
<PathSkew>0</PathSkew>
<PathTaperX>0</PathTaperX>
<PathTaperY>0</PathTaperY>
<PathTwist>0</PathTwist>
<PathTwistBegin>0</PathTwistBegin>
<PCode>9</PCode>
<ProfileBegin>0</ProfileBegin>
<ProfileEnd>0</ProfileEnd>
<ProfileHollow>0</ProfileHollow>
<Scale><X>10</X><Y>10</Y><Z>0.5</Z></Scale>
<State>0</State>
<ProfileShape>Square</ProfileShape>
<HollowShape>Same</HollowShape>
<SculptTexture><Guid>00000000-0000-0000-0000-000000000000</Guid></SculptTexture>
<SculptType>0</SculptType><SculptData />
<FlexiSoftness>0</FlexiSoftness>
<FlexiTension>0,5</FlexiTension>
<FlexiDrag>yo mamma</FlexiDrag>
<FlexiGravity>0</FlexiGravity>
<FlexiWind>0</FlexiWind>
<FlexiForceX>0</FlexiForceX>
<FlexiForceY>0</FlexiForceY>
<FlexiForceZ>0</FlexiForceZ>
<LightColorR>0</LightColorR>
<LightColorG>0</LightColorG>
<LightColorB>0</LightColorB>
<LightColorA>1</LightColorA>
<LightRadius>0</LightRadius>
<LightCutoff>0</LightCutoff>
<LightFalloff>0</LightFalloff>
<LightIntensity>1</LightIntensity>
<FlexiEntry>false</FlexiEntry>
<LightEntry>false</LightEntry>
<SculptEntry>false</SculptEntry>
</Shape>
<Scale><X>10</X><Y>10</Y><Z>0.5</Z></Scale>
<UpdateFlag>0</UpdateFlag>
<SitTargetOrientation><X>0</X><Y>0</Y><Z>0</Z><W>1</W></SitTargetOrientation>
<SitTargetPosition><X>0</X><Y>0</Y><Z>0</Z></SitTargetPosition>
<SitTargetPositionLL><X>0</X><Y>0</Y><Z>0</Z></SitTargetPositionLL>
<SitTargetOrientationLL><X>0</X><Y>0</Y><Z>0</Z><W>1</W></SitTargetOrientationLL>
<ParentID>0</ParentID>
<CreationDate>1211330445</CreationDate>
<Category>0</Category>
<SalePrice>0</SalePrice>
<ObjectSaleType>0</ObjectSaleType>
<OwnershipCost>0</OwnershipCost>
<GroupID><Guid>00000000-0000-0000-0000-000000000000</Guid></GroupID>
<OwnerID><Guid>a6dacf01-4636-4bb9-8a97-30609438af9d</Guid></OwnerID>
<LastOwnerID><Guid>a6dacf01-4636-4bb9-8a97-30609438af9d</Guid></LastOwnerID>
<BaseMask>2147483647</BaseMask>
<OwnerMask>2147483647</OwnerMask>
<GroupMask>0</GroupMask>
<EveryoneMask>0</EveryoneMask>
<NextOwnerMask>2147483647</NextOwnerMask>
<Flags>None</Flags>
<CollisionSound><Guid>00000000-0000-0000-0000-000000000000</Guid></CollisionSound>
<CollisionSoundVolume>0</CollisionSoundVolume>
</SceneObjectPart>
</RootPart>
<OtherParts />
</SceneObjectGroup>";
private string xml2 = @" private string xml2 = @"
<SceneObjectGroup> <SceneObjectGroup>
<SceneObjectPart xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema""> <SceneObjectPart xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"">
@ -256,6 +363,32 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests
// TODO: Check other properties // TODO: Check other properties
} }
[Test]
public void TestDeserializeBadFloatsXml()
{
TestHelpers.InMethod();
// log4net.Config.XmlConfigurator.Configure();
SceneObjectGroup so = SceneObjectSerializer.FromOriginalXmlFormat(badFloatsXml);
SceneObjectPart rootPart = so.RootPart;
Assert.That(rootPart.UUID, Is.EqualTo(new UUID("e6a5a05e-e8cc-4816-8701-04165e335790")));
Assert.That(rootPart.CreatorID, Is.EqualTo(new UUID("a6dacf01-4636-4bb9-8a97-30609438af9d")));
Assert.That(rootPart.Name, Is.EqualTo("NaughtyPrim"));
// This terminates the deserialization earlier if couldn't be parsed.
// TODO: Need to address this
Assert.That(rootPart.GroupPosition.X, Is.EqualTo(147.23f));
Assert.That(rootPart.Shape.PathCurve, Is.EqualTo(16));
// Defaults for bad parses
Assert.That(rootPart.Shape.FlexiTension, Is.EqualTo(0));
Assert.That(rootPart.Shape.FlexiDrag, Is.EqualTo(0));
// TODO: Check other properties
}
[Test] [Test]
public void TestSerializeXml() public void TestSerializeXml()
{ {

View File

@ -177,6 +177,9 @@ namespace OpenSim.Region.Framework.Scenes
public delegate void AvatarEnteringNewParcel(ScenePresence avatar, int localLandID, UUID regionID); public delegate void AvatarEnteringNewParcel(ScenePresence avatar, int localLandID, UUID regionID);
public event AvatarEnteringNewParcel OnAvatarEnteringNewParcel; public event AvatarEnteringNewParcel OnAvatarEnteringNewParcel;
public delegate void AvatarAppearanceChange(ScenePresence avatar);
public event AvatarAppearanceChange OnAvatarAppearanceChange;
public event Action<ScenePresence> OnSignificantClientMovement; public event Action<ScenePresence> OnSignificantClientMovement;
public delegate void IncomingInstantMessage(GridInstantMessage message); public delegate void IncomingInstantMessage(GridInstantMessage message);
@ -188,10 +191,62 @@ namespace OpenSim.Region.Framework.Scenes
public event ClientClosed OnClientClosed; public event ClientClosed OnClientClosed;
// Fired when a script is created
// The indication that a new script exists in this region.
public delegate void NewScript(UUID clientID, SceneObjectPart part, UUID itemID);
public event NewScript OnNewScript;
public virtual void TriggerNewScript(UUID clientID, SceneObjectPart part, UUID itemID)
{
NewScript handlerNewScript = OnNewScript;
if (handlerNewScript != null)
{
foreach (NewScript d in handlerNewScript.GetInvocationList())
{
try
{
d(clientID, part, itemID);
}
catch (Exception e)
{
m_log.ErrorFormat(
"[EVENT MANAGER]: Delegate for TriggerNewScript failed - continuing. {0} {1}",
e.Message, e.StackTrace);
}
}
}
}
//TriggerUpdateScript: triggered after Scene receives client's upload of updated script and stores it as asset
// An indication that the script has changed.
public delegate void UpdateScript(UUID clientID, UUID itemId, UUID primId, bool isScriptRunning, UUID newAssetID);
public event UpdateScript OnUpdateScript;
public virtual void TriggerUpdateScript(UUID clientId, UUID itemId, UUID primId, bool isScriptRunning, UUID newAssetID)
{
UpdateScript handlerUpdateScript = OnUpdateScript;
if (handlerUpdateScript != null)
{
foreach (UpdateScript d in handlerUpdateScript.GetInvocationList())
{
try
{
d(clientId, itemId, primId, isScriptRunning, newAssetID);
}
catch (Exception e)
{
m_log.ErrorFormat(
"[EVENT MANAGER]: Delegate for TriggerUpdateScript failed - continuing. {0} {1}",
e.Message, e.StackTrace);
}
}
}
}
/// <summary> /// <summary>
/// This is fired when a scene object property that a script might be interested in (such as color, scale or /// ScriptChangedEvent is fired when a scene object property that a script might be interested
/// inventory) changes. Only enough information is sent for the LSL changed event /// in (such as color, scale or inventory) changes. Only enough information sent is for the LSL changed event.
/// (see http://lslwiki.net/lslwiki/wakka.php?wakka=changed) /// This is not an indication that the script has changed (see OnUpdateScript for that).
/// This event is sent to a script to tell it that some property changed on
/// the object the script is in. See http://lslwiki.net/lslwiki/wakka.php?wakka=changed .
/// </summary> /// </summary>
public event ScriptChangedEvent OnScriptChangedEvent; public event ScriptChangedEvent OnScriptChangedEvent;
public delegate void ScriptChangedEvent(uint localID, uint change); public delegate void ScriptChangedEvent(uint localID, uint change);
@ -1262,6 +1317,27 @@ namespace OpenSim.Region.Framework.Scenes
} }
} }
public void TriggerAvatarAppearanceChanged(ScenePresence avatar)
{
AvatarAppearanceChange handler = OnAvatarAppearanceChange;
if (handler != null)
{
foreach (AvatarAppearanceChange d in handler.GetInvocationList())
{
try
{
d(avatar);
}
catch (Exception e)
{
m_log.ErrorFormat(
"[EVENT MANAGER]: Delegate for TriggerAvatarAppearanceChanged failed - continuing. {0} {1}",
e.Message, e.StackTrace);
}
}
}
}
public void TriggerIncomingInstantMessage(GridInstantMessage message) public void TriggerIncomingInstantMessage(GridInstantMessage message)
{ {
IncomingInstantMessage handlerIncomingInstantMessage = OnIncomingInstantMessage; IncomingInstantMessage handlerIncomingInstantMessage = OnIncomingInstantMessage;

View File

@ -265,6 +265,10 @@ namespace OpenSim.Region.Framework.Scenes
// //
errors = part.Inventory.CreateScriptInstanceEr(item.ItemID, 0, false, DefaultScriptEngine, 0); errors = part.Inventory.CreateScriptInstanceEr(item.ItemID, 0, false, DefaultScriptEngine, 0);
} }
// Tell anyone managing scripts that a script has been reloaded/changed
EventManager.TriggerUpdateScript(remoteClient.AgentId, itemId, primId, isScriptRunning, item.AssetID);
part.ParentGroup.ResumeScripts(); part.ParentGroup.ResumeScripts();
return errors; return errors;
} }
@ -1643,9 +1647,13 @@ namespace OpenSim.Region.Framework.Scenes
// have state in inventory // have state in inventory
part.Inventory.CreateScriptInstance(copyID, 0, false, DefaultScriptEngine, 0); part.Inventory.CreateScriptInstance(copyID, 0, false, DefaultScriptEngine, 0);
// tell anyone watching that there is a new script in town
EventManager.TriggerNewScript(agentID, part, copyID);
// m_log.InfoFormat("[PRIMINVENTORY]: " + // m_log.InfoFormat("[PRIMINVENTORY]: " +
// "Rezzed script {0} into prim local ID {1} for user {2}", // "Rezzed script {0} into prim local ID {1} for user {2}",
// item.inventoryName, localID, remoteClient.Name); // item.inventoryName, localID, remoteClient.Name);
part.ParentGroup.ResumeScripts(); part.ParentGroup.ResumeScripts();
return part; return part;
@ -1726,6 +1734,10 @@ namespace OpenSim.Region.Framework.Scenes
part.Inventory.AddInventoryItem(taskItem, false); part.Inventory.AddInventoryItem(taskItem, false);
part.Inventory.CreateScriptInstance(taskItem, 0, false, DefaultScriptEngine, 0); part.Inventory.CreateScriptInstance(taskItem, 0, false, DefaultScriptEngine, 0);
// tell anyone managing scripts that a new script exists
EventManager.TriggerNewScript(agentID, part, taskItem.ItemID);
part.ParentGroup.ResumeScripts(); part.ParentGroup.ResumeScripts();
return part; return part;
@ -1954,7 +1966,7 @@ namespace OpenSim.Region.Framework.Scenes
permissionToTake = true; permissionToTake = true;
permissionToDelete = true; permissionToDelete = true;
AddReturn(grp.OwnerID, grp.Name, grp.AbsolutePosition, "parcel owner return"); AddReturn(grp.OwnerID == grp.GroupID ? grp.LastOwnerID : grp.OwnerID, grp.Name, grp.AbsolutePosition, "parcel owner return");
} }
} }
else // Auto return passes through here with null agent else // Auto return passes through here with null agent

View File

@ -3397,6 +3397,9 @@ namespace OpenSim.Region.Framework.Scenes
{ {
bool vialogin = ((teleportFlags & (uint)Constants.TeleportFlags.ViaLogin) != 0 || bool vialogin = ((teleportFlags & (uint)Constants.TeleportFlags.ViaLogin) != 0 ||
(teleportFlags & (uint)Constants.TeleportFlags.ViaHGLogin) != 0); (teleportFlags & (uint)Constants.TeleportFlags.ViaHGLogin) != 0);
bool viahome = ((teleportFlags & (uint)Constants.TeleportFlags.ViaHome) != 0);
bool godlike = ((teleportFlags & (uint)Constants.TeleportFlags.Godlike) != 0);
reason = String.Empty; reason = String.Empty;
//Teleport flags: //Teleport flags:
@ -3571,6 +3574,29 @@ namespace OpenSim.Region.Framework.Scenes
agent.startpos.Z = 720; agent.startpos.Z = 720;
} }
} }
// Honor Estate teleport routing via Telehubs excluding ViaHome and GodLike TeleportFlags
if (RegionInfo.RegionSettings.TelehubObject != UUID.Zero &&
RegionInfo.EstateSettings.AllowDirectTeleport == false &&
!viahome && !godlike)
{
SceneObjectGroup telehub = GetSceneObjectGroup(RegionInfo.RegionSettings.TelehubObject);
// Can have multiple SpawnPoints
List<SpawnPoint> spawnpoints = RegionInfo.RegionSettings.SpawnPoints();
if ( spawnpoints.Count > 1)
{
// We have multiple SpawnPoints, Route the agent to a random one
agent.startpos = spawnpoints[Util.RandomClass.Next(spawnpoints.Count)].GetLocation(telehub.AbsolutePosition, telehub.GroupRotation);
}
else
{
// We have a single SpawnPoint and will route the agent to it
agent.startpos = spawnpoints[0].GetLocation(telehub.AbsolutePosition, telehub.GroupRotation);
}
return true;
}
// Honor parcel landing type and position. // Honor parcel landing type and position.
/* /*
ILandObject land = LandChannel.GetLandObject(agent.startpos.X, agent.startpos.Y); ILandObject land = LandChannel.GetLandObject(agent.startpos.X, agent.startpos.Y);

View File

@ -1678,7 +1678,7 @@ namespace OpenSim.Region.Framework.Scenes
if (group != null) if (group != null)
{ {
if (m_parentScene.Permissions.CanEditObject(group.UUID,agentID)) if (m_parentScene.Permissions.CanEditObject(group.UUID, agentID))
{ {
group.UpdateExtraParam(primLocalID, type, inUse, data); group.UpdateExtraParam(primLocalID, type, inUse, data);
} }
@ -1695,7 +1695,7 @@ namespace OpenSim.Region.Framework.Scenes
SceneObjectGroup group = GetGroupByPrim(primLocalID); SceneObjectGroup group = GetGroupByPrim(primLocalID);
if (group != null) if (group != null)
{ {
if (m_parentScene.Permissions.CanEditObject(group.GetPartsFullID(primLocalID), agentID)) if (m_parentScene.Permissions.CanEditObject(group.UUID, agentID))
{ {
ObjectShapePacket.ObjectDataBlock shapeData = new ObjectShapePacket.ObjectDataBlock(); ObjectShapePacket.ObjectDataBlock shapeData = new ObjectShapePacket.ObjectDataBlock();
shapeData.ObjectLocalID = shapeBlock.ObjectLocalID; shapeData.ObjectLocalID = shapeBlock.ObjectLocalID;

View File

@ -1764,7 +1764,7 @@ namespace OpenSim.Region.Framework.Scenes
m_log.DebugFormat( m_log.DebugFormat(
"[SCENE OBJECT GROUP]: Returning object {0} due to parcel autoreturn", "[SCENE OBJECT GROUP]: Returning object {0} due to parcel autoreturn",
RootPart.UUID); RootPart.UUID);
m_scene.AddReturn(OwnerID, Name, AbsolutePosition, "parcel autoreturn"); m_scene.AddReturn(OwnerID == GroupID ? LastOwnerID : OwnerID, Name, AbsolutePosition, "parcel autoreturn");
m_scene.DeRezObjects(null, new List<uint>() { RootPart.LocalId }, UUID.Zero, m_scene.DeRezObjects(null, new List<uint>() { RootPart.LocalId }, UUID.Zero,
DeRezAction.Return, UUID.Zero); DeRezAction.Return, UUID.Zero);

View File

@ -314,6 +314,9 @@ namespace OpenSim.Region.Framework.Scenes
// ~SceneObjectPart() // ~SceneObjectPart()
// { // {
// Console.WriteLine(
// "[SCENE OBJECT PART]: Destructor called for {0}, local id {1}, parent {2} {3}",
// Name, LocalId, ParentGroup.Name, ParentGroup.LocalId);
// m_log.DebugFormat( // m_log.DebugFormat(
// "[SCENE OBJECT PART]: Destructor called for {0}, local id {1}, parent {2} {3}", // "[SCENE OBJECT PART]: Destructor called for {0}, local id {1}, parent {2} {3}",
// Name, LocalId, ParentGroup.Name, ParentGroup.LocalId); // Name, LocalId, ParentGroup.Name, ParentGroup.LocalId);
@ -1601,9 +1604,9 @@ namespace OpenSim.Region.Framework.Scenes
dupe.GroupPosition = GroupPosition; dupe.GroupPosition = GroupPosition;
dupe.OffsetPosition = OffsetPosition; dupe.OffsetPosition = OffsetPosition;
dupe.RotationOffset = RotationOffset; dupe.RotationOffset = RotationOffset;
dupe.Velocity = new Vector3(0, 0, 0); dupe.Velocity = Velocity;
dupe.Acceleration = new Vector3(0, 0, 0); dupe.Acceleration = Acceleration;
dupe.AngularVelocity = new Vector3(0, 0, 0); dupe.AngularVelocity = AngularVelocity;
dupe.Flags = Flags; dupe.Flags = Flags;
dupe.OwnershipCost = OwnershipCost; dupe.OwnershipCost = OwnershipCost;

View File

@ -29,6 +29,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Drawing; using System.Drawing;
using System.IO; using System.IO;
using System.Linq;
using System.Reflection; using System.Reflection;
using System.Xml; using System.Xml;
using log4net; using log4net;
@ -573,13 +574,15 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
private static void ProcessShape(SceneObjectPart obj, XmlTextReader reader) private static void ProcessShape(SceneObjectPart obj, XmlTextReader reader)
{ {
bool errors = false; List<string> errorNodeNames;
obj.Shape = ReadShape(reader, "Shape", out errors); obj.Shape = ReadShape(reader, "Shape", out errorNodeNames);
if (errors) if (errorNodeNames != null)
{
m_log.DebugFormat( m_log.DebugFormat(
"[SceneObjectSerializer]: Parsing PrimitiveBaseShape for object part {0} {1} encountered errors. Please see earlier log entries.", "[SceneObjectSerializer]: Parsing PrimitiveBaseShape for object part {0} {1} encountered errors in properties {2}.",
obj.Name, obj.UUID); obj.Name, obj.UUID, string.Join(", ", errorNodeNames.ToArray()));
}
} }
private static void ProcessScale(SceneObjectPart obj, XmlTextReader reader) private static void ProcessScale(SceneObjectPart obj, XmlTextReader reader)
@ -1529,31 +1532,44 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
/// </summary> /// </summary>
/// <param name="reader"></param> /// <param name="reader"></param>
/// <param name="name">The name of the xml element containing the shape</param> /// <param name="name">The name of the xml element containing the shape</param>
/// <param name="errors">true if any errors were encountered during parsing, false otherwise</param> /// <param name="errors">a list containing the failing node names. If no failures then null.</param>
/// <returns>The shape parsed</returns> /// <returns>The shape parsed</returns>
public static PrimitiveBaseShape ReadShape(XmlTextReader reader, string name, out bool errors) public static PrimitiveBaseShape ReadShape(XmlTextReader reader, string name, out List<string> errorNodeNames)
{ {
errors = false; List<string> internalErrorNodeNames = null;
PrimitiveBaseShape shape = new PrimitiveBaseShape(); PrimitiveBaseShape shape = new PrimitiveBaseShape();
if (reader.IsEmptyElement)
{
reader.Read();
errorNodeNames = null;
return shape;
}
reader.ReadStartElement(name, String.Empty); // Shape reader.ReadStartElement(name, String.Empty); // Shape
errors = ExternalRepresentationUtils.ExecuteReadProcessors( ExternalRepresentationUtils.ExecuteReadProcessors(
shape, shape,
m_ShapeXmlProcessors, m_ShapeXmlProcessors,
reader, reader,
(o, nodeName, e) (o, nodeName, e)
=> =>
{ {
m_log.DebugFormat( // m_log.DebugFormat(
"[SceneObjectSerializer]: Exception while parsing Shape property {0}: {1}{2}", // "[SceneObjectSerializer]: Exception while parsing Shape property {0}: {1}{2}",
nodeName, e.Message, e.StackTrace); // nodeName, e.Message, e.StackTrace);
if (internalErrorNodeNames == null)
internalErrorNodeNames = new List<string>();
internalErrorNodeNames.Add(nodeName);
} }
); );
reader.ReadEndElement(); // Shape reader.ReadEndElement(); // Shape
errorNodeNames = internalErrorNodeNames;
return shape; return shape;
} }

View File

@ -27,6 +27,7 @@
using System; using System;
using System.Reflection; using System.Reflection;
using System.Threading;
using NUnit.Framework; using NUnit.Framework;
using OpenMetaverse; using OpenMetaverse;
using OpenSim.Framework; using OpenSim.Framework;
@ -43,6 +44,42 @@ namespace OpenSim.Region.Framework.Scenes.Tests
[TestFixture] [TestFixture]
public class SceneObjectBasicTests public class SceneObjectBasicTests
{ {
// [TearDown]
// public void TearDown()
// {
// Console.WriteLine("TearDown");
// GC.Collect();
// Thread.Sleep(3000);
// }
// public class GcNotify
// {
// public static AutoResetEvent gcEvent = new AutoResetEvent(false);
// private static bool _initialized = false;
//
// public static void Initialize()
// {
// if (!_initialized)
// {
// _initialized = true;
// new GcNotify();
// }
// }
//
// private GcNotify(){}
//
// ~GcNotify()
// {
// if (!Environment.HasShutdownStarted &&
// !AppDomain.CurrentDomain.IsFinalizingForUnload())
// {
// Console.WriteLine("GcNotify called");
// gcEvent.Set();
// new GcNotify();
// }
// }
// }
/// <summary> /// <summary>
/// Test adding an object to a scene. /// Test adding an object to a scene.
/// </summary> /// </summary>

View File

@ -230,8 +230,10 @@ namespace OpenSim.Region.OptionalModules.Scripting.RegionReady
m_scene.EventManager.OnEmptyScriptCompileQueue -= OnEmptyScriptCompileQueue; m_scene.EventManager.OnEmptyScriptCompileQueue -= OnEmptyScriptCompileQueue;
m_log.InfoFormat("[RegionReady]: Logins enabled for {0}, Oar {1}", // m_log.InfoFormat("[RegionReady]: Logins enabled for {0}, Oar {1}",
m_scene.RegionInfo.RegionName, m_oarFileLoading.ToString()); // m_scene.RegionInfo.RegionName, m_oarFileLoading.ToString());
m_log.InfoFormat("[RegionReady]: Logins enabled for {0}", m_scene.RegionInfo.RegionName);
if ( m_uri != string.Empty ) if ( m_uri != string.Empty )
{ {

View File

@ -121,8 +121,8 @@ namespace OpenSim.Region.OptionalModules.World.NPC
npcAvatar.CircuitCode = (uint)Util.RandomClass.Next(0, int.MaxValue); npcAvatar.CircuitCode = (uint)Util.RandomClass.Next(0, int.MaxValue);
m_log.DebugFormat( m_log.DebugFormat(
"[NPC MODULE]: Creating NPC {0} {1} {2} at {3} in {4}", "[NPC MODULE]: Creating NPC {0} {1} {2}, owner={3}, senseAsAgent={4} at {5} in {6}",
firstname, lastname, npcAvatar.AgentId, position, scene.RegionInfo.RegionName); firstname, lastname, npcAvatar.AgentId, owner, senseAsAgent, position, scene.RegionInfo.RegionName);
AgentCircuitData acd = new AgentCircuitData(); AgentCircuitData acd = new AgentCircuitData();
acd.AgentID = npcAvatar.AgentId; acd.AgentID = npcAvatar.AgentId;

View File

@ -31,6 +31,7 @@ using System.IO;
using System.Reflection; using System.Reflection;
using Nini.Config; using Nini.Config;
using log4net; using log4net;
using OpenSim.Framework;
namespace OpenSim.Region.Physics.Manager namespace OpenSim.Region.Physics.Manager
{ {

View File

@ -313,7 +313,7 @@ namespace OpenSim.Region.Physics.Meshing
private bool GenerateCoordsAndFacesFromPrimMeshData( private bool GenerateCoordsAndFacesFromPrimMeshData(
string primName, PrimitiveBaseShape primShape, Vector3 size, out List<Coord> coords, out List<Face> faces) string primName, PrimitiveBaseShape primShape, Vector3 size, out List<Coord> coords, out List<Face> faces)
{ {
m_log.DebugFormat("[MESH]: experimental mesh proxy generation for {0}", primName); // m_log.DebugFormat("[MESH]: experimental mesh proxy generation for {0}", primName);
coords = new List<Coord>(); coords = new List<Coord>();
faces = new List<Face>(); faces = new List<Face>();
@ -321,7 +321,7 @@ namespace OpenSim.Region.Physics.Meshing
if (primShape.SculptData.Length <= 0) if (primShape.SculptData.Length <= 0)
{ {
m_log.Error("[MESH]: asset data is zero length"); m_log.ErrorFormat("[MESH]: asset data for {0} is zero length", primName);
return false; return false;
} }

View File

@ -46,7 +46,7 @@ namespace OpenSim.Region.Physics.OdePlugin
/// </summary> /// </summary>
public class OdePlugin : IPhysicsPlugin public class OdePlugin : IPhysicsPlugin
{ {
//private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
private OdeScene m_scene; private OdeScene m_scene;
@ -59,13 +59,36 @@ namespace OpenSim.Region.Physics.OdePlugin
{ {
if (m_scene == null) if (m_scene == null)
{ {
// We do this so that OpenSimulator on Windows loads the correct native ODE library depending on whether
// it's running as a 32-bit process or a 64-bit one. By invoking LoadLibary here, later DLLImports
// will find it already loaded later on.
//
// This isn't necessary for other platforms (e.g. Mac OSX and Linux) since the DLL used can be
// controlled in Ode.NET.dll.config
if (Util.IsWindows())
{
string nativeLibraryPath;
if (Util.Is64BitProcess())
nativeLibraryPath = "lib64/ode.dll";
else
nativeLibraryPath = "lib32/ode.dll";
m_log.DebugFormat("[ODE PLUGIN]: Loading native Windows ODE library at {0}", nativeLibraryPath);
if (Util.LoadLibrary(nativeLibraryPath) == IntPtr.Zero)
m_log.ErrorFormat(
"[ODE PLUGIN]: Couldn't find native Windows ODE library at {0}", nativeLibraryPath);
}
// Initializing ODE only when a scene is created allows alternative ODE plugins to co-habit (according to // Initializing ODE only when a scene is created allows alternative ODE plugins to co-habit (according to
// http://opensimulator.org/mantis/view.php?id=2750). // http://opensimulator.org/mantis/view.php?id=2750).
d.InitODE(); d.InitODE();
m_scene = new OdeScene(sceneIdentifier); m_scene = new OdeScene(sceneIdentifier);
} }
return (m_scene);
return m_scene;
} }
public string GetName() public string GetName()

View File

@ -2254,7 +2254,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
firstname, lastname, position, notecard, firstname, lastname, position, notecard,
(options & ScriptBaseClass.OS_NPC_NOT_OWNED) == 0, (options & ScriptBaseClass.OS_NPC_NOT_OWNED) == 0,
false); false);
// (options & ScriptBaseClass.OS_NPC_SENSE_AS_AGENT) == 0); // (options & ScriptBaseClass.OS_NPC_SENSE_AS_AGENT) != 0);
} }
private LSL_Key NpcCreate( private LSL_Key NpcCreate(
@ -2634,7 +2634,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
UUID npcID = new UUID(npc.m_string); UUID npcID = new UUID(npc.m_string);
if (module.CheckPermissions(npcID, m_host.OwnerID)) if (module.CheckPermissions(npcID, m_host.OwnerID))
AvatarPlayAnimation(npcID.ToString(), animation); AvatarStopAnimation(npcID.ToString(), animation);
} }
} }

View File

@ -31,7 +31,6 @@ using System.Collections.Generic;
using OpenMetaverse; using OpenMetaverse;
using OpenSim.Framework; using OpenSim.Framework;
using log4net; using log4net;
using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Interfaces;
using OpenSim.Region.Framework.Scenes; using OpenSim.Region.Framework.Scenes;
using OpenSim.Region.ScriptEngine.Shared; using OpenSim.Region.ScriptEngine.Shared;
@ -41,6 +40,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
{ {
public class SensorRepeat public class SensorRepeat
{ {
// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
public AsyncCommandManager m_CmdManager; public AsyncCommandManager m_CmdManager;
public SensorRepeat(AsyncCommandManager CmdManager) public SensorRepeat(AsyncCommandManager CmdManager)
@ -452,11 +453,20 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
Action<ScenePresence> senseEntity = new Action<ScenePresence>(presence => Action<ScenePresence> senseEntity = new Action<ScenePresence>(presence =>
{ {
// m_log.DebugFormat(
// "[SENSOR REPEAT]: Inspecting scene presence {0}, type {1} on sensor sweep for {2}, type {3}",
// presence.Name, presence.PresenceType, ts.name, ts.type);
if ((ts.type & NPC) == 0 && presence.PresenceType == PresenceType.Npc) if ((ts.type & NPC) == 0 && presence.PresenceType == PresenceType.Npc)
{ {
INPC npcData = npcModule.GetNPC(presence.UUID, presence.Scene); INPC npcData = npcModule.GetNPC(presence.UUID, presence.Scene);
if (npcData == null || !npcData.SenseAsAgent) if (npcData == null || !npcData.SenseAsAgent)
{
// m_log.DebugFormat(
// "[SENSOR REPEAT]: Discarding NPC {0} from agent sense sweep for script item id {1}",
// presence.Name, ts.itemID);
return; return;
}
} }
if ((ts.type & AGENT) == 0) if ((ts.type & AGENT) == 0)
@ -469,7 +479,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
{ {
INPC npcData = npcModule.GetNPC(presence.UUID, presence.Scene); INPC npcData = npcModule.GetNPC(presence.UUID, presence.Scene);
if (npcData != null && npcData.SenseAsAgent) if (npcData != null && npcData.SenseAsAgent)
{
// m_log.DebugFormat(
// "[SENSOR REPEAT]: Discarding NPC {0} from non-agent sense sweep for script item id {1}",
// presence.Name, ts.itemID);
return; return;
}
} }
} }

View File

@ -220,7 +220,7 @@ namespace OpenSim.Services.Connectors.Friends
public bool Delete(Dictionary<string, object> sendData, string PrincipalID, string Friend) public bool Delete(Dictionary<string, object> sendData, string PrincipalID, string Friend)
{ {
string reply = string.Empty; string reply = string.Empty;
string uri = m_ServerURI = "/friends"; string uri = m_ServerURI + "/friends";
try try
{ {
reply = SynchronousRestFormsRequester.MakeRequest("POST", uri, ServerUtils.BuildQueryString(sendData)); reply = SynchronousRestFormsRequester.MakeRequest("POST", uri, ServerUtils.BuildQueryString(sendData));

View File

@ -188,9 +188,9 @@ namespace OpenSim.Services.HypergridService
string authURL = string.Empty; string authURL = string.Empty;
if (aCircuit.ServiceURLs.ContainsKey("HomeURI")) if (aCircuit.ServiceURLs.ContainsKey("HomeURI"))
authURL = aCircuit.ServiceURLs["HomeURI"].ToString(); authURL = aCircuit.ServiceURLs["HomeURI"].ToString();
m_log.InfoFormat("[GATEKEEPER SERVICE]: Login request for {0} {1} @ {2} ({3}) at {4} using viewer {5}, channel {6}, IP {7}, Mac {8}, Id0 {9}", m_log.InfoFormat("[GATEKEEPER SERVICE]: Login request for {0} {1} @ {2} ({3}) at {4} using viewer {5}, channel {6}, IP {7}, Mac {8}, Id0 {9} Teleport Flags {10}",
aCircuit.firstname, aCircuit.lastname, authURL, aCircuit.AgentID, destination.RegionName, aCircuit.firstname, aCircuit.lastname, authURL, aCircuit.AgentID, destination.RegionName,
aCircuit.Viewer, aCircuit.Channel, aCircuit.IPAddress, aCircuit.Mac, aCircuit.Id0); aCircuit.Viewer, aCircuit.Channel, aCircuit.IPAddress, aCircuit.Mac, aCircuit.Id0, aCircuit.teleportFlags.ToString());
// //
// Check client // Check client
@ -315,6 +315,10 @@ namespace OpenSim.Services.HypergridService
// Finally launch the agent at the destination // Finally launch the agent at the destination
// //
Constants.TeleportFlags loginFlag = isFirstLogin ? Constants.TeleportFlags.ViaLogin : Constants.TeleportFlags.ViaHGLogin; Constants.TeleportFlags loginFlag = isFirstLogin ? Constants.TeleportFlags.ViaLogin : Constants.TeleportFlags.ViaHGLogin;
// Preserve our TeleportFlags we have gathered so-far
loginFlag |= (Constants.TeleportFlags) aCircuit.teleportFlags;
m_log.DebugFormat("[GATEKEEPER SERVICE]: launching agent {0}", loginFlag); m_log.DebugFormat("[GATEKEEPER SERVICE]: launching agent {0}", loginFlag);
return m_SimulationService.CreateAgent(destination, aCircuit, (uint)loginFlag, out reason); return m_SimulationService.CreateAgent(destination, aCircuit, (uint)loginFlag, out reason);
} }

View File

@ -472,6 +472,7 @@ namespace OpenSim.Services.LLLoginService
position = pinfo.HomePosition; position = pinfo.HomePosition;
lookAt = pinfo.HomeLookAt; lookAt = pinfo.HomeLookAt;
flags |= TeleportFlags.ViaHome;
} }
if (tryDefaults) if (tryDefaults)
@ -760,6 +761,7 @@ namespace OpenSim.Services.LLLoginService
{ {
circuitCode = (uint)Util.RandomClass.Next(); ; circuitCode = (uint)Util.RandomClass.Next(); ;
aCircuit = MakeAgent(destination, account, avatar, session, secureSession, circuitCode, position, clientIP.Address.ToString(), viewer, channel, mac, id0); aCircuit = MakeAgent(destination, account, avatar, session, secureSession, circuitCode, position, clientIP.Address.ToString(), viewer, channel, mac, id0);
aCircuit.teleportFlags |= (uint)flags;
success = LaunchAgentIndirectly(gatekeeper, destination, aCircuit, clientIP, out reason); success = LaunchAgentIndirectly(gatekeeper, destination, aCircuit, clientIP, out reason);
if (!success && m_GridService != null) if (!success && m_GridService != null)
{ {

View File

@ -50,7 +50,8 @@ namespace OpenSim.Tests.Common.Mock
~TestScene() ~TestScene()
{ {
Console.WriteLine("TestScene destructor called for {0}", RegionInfo.RegionName); //Console.WriteLine("TestScene destructor called for {0}", RegionInfo.RegionName);
Console.WriteLine("TestScene destructor called");
} }
/// <summary> /// <summary>

View File

@ -49,6 +49,13 @@ namespace OpenSim.Tests.Torture
[TestFixture] [TestFixture]
public class ObjectTortureTests public class ObjectTortureTests
{ {
[TearDown]
public void TearDown()
{
GC.Collect();
GC.WaitForPendingFinalizers();
}
// [Test] // [Test]
// public void Test0000Clean() // public void Test0000Clean()
// { // {
@ -141,8 +148,18 @@ namespace OpenSim.Tests.Torture
string.Format("Object {0} could not be retrieved", i)); string.Format("Object {0} could not be retrieved", i));
} }
// This does not work to fire the SceneObjectGroup destructors - something else is hanging on to them. // When a scene object is added to a scene, it is placed in the update list for sending to viewers
// scene.DeleteAllSceneObjects(); // (though in this case we have none). When it is deleted, it is not removed from the update which is
// fine since it will later be ignored.
//
// However, that means that we need to manually run an update here to clear out that list so that deleted
// objects will be clean up by the garbage collector before the next stress test is run.
scene.Update();
// Currently, we need to do this in order to garbage collect the scene objects ready for the next test run.
// However, what we really need to do is find out why the entire scene is not garbage collected in
// teardown.
scene.DeleteAllSceneObjects();
Console.WriteLine( Console.WriteLine(
"Took {0}ms, {1}MB ({2} - {3}) to create {4} objects each containing {5} prim(s)", "Took {0}ms, {1}MB ({2} - {3}) to create {4} objects each containing {5} prim(s)",

BIN
bin/lib64/ode.dll Executable file

Binary file not shown.