* Adds Websocket support to baseHttpServer and IHttpServer.cs . This allows modules to set up a websocket server that websocket clients can connect to. An example module is in OptionalModules/Example/WebSocketEchoTest/WebSocketEchoModule.cs

user_profiles
teravus 2013-02-07 10:28:26 -05:00
commit 94a5232d3a
128 changed files with 1474 additions and 1213 deletions

View File

@ -60,7 +60,7 @@ using System.Runtime.InteropServices;
// //
// You can specify all the values or you can default the Build and Revision Numbers // You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below: // by using the '*' as shown below:
// [assembly: AssemblyVersion("0.7.5.*")] // [assembly: AssemblyVersion("0.7.6.*")]
[assembly : AssemblyVersion("0.7.5.*")] [assembly : AssemblyVersion("0.7.6.*")]
[assembly : AssemblyFileVersion("0.6.5.0")] [assembly : AssemblyFileVersion("0.6.5.0")]

View File

@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// Build Number // Build Number
// Revision // Revision
// //
[assembly: AssemblyVersion("0.7.5.*")] [assembly: AssemblyVersion("0.7.6.*")]
[assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]

View File

@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// Build Number // Build Number
// Revision // Revision
// //
[assembly: AssemblyVersion("0.7.5.*")] [assembly: AssemblyVersion("0.7.6.*")]
[assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]

View File

@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// Build Number // Build Number
// Revision // Revision
// //
[assembly: AssemblyVersion("0.7.5.*")] [assembly: AssemblyVersion("0.7.6.*")]
[assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]

View File

@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// Build Number // Build Number
// Revision // Revision
// //
[assembly: AssemblyVersion("0.7.5.*")] [assembly: AssemblyVersion("0.7.6.*")]
[assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]

View File

@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// Build Number // Build Number
// Revision // Revision
// //
[assembly: AssemblyVersion("0.7.5.*")] [assembly: AssemblyVersion("0.7.6.*")]
[assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]

View File

@ -351,7 +351,7 @@ IF EXISTS (SELECT UUID FROM prims WHERE UUID = @UUID)
ScriptAccessPin = @ScriptAccessPin, AllowedDrop = @AllowedDrop, DieAtEdge = @DieAtEdge, SalePrice = @SalePrice, ScriptAccessPin = @ScriptAccessPin, AllowedDrop = @AllowedDrop, DieAtEdge = @DieAtEdge, SalePrice = @SalePrice,
SaleType = @SaleType, ColorR = @ColorR, ColorG = @ColorG, ColorB = @ColorB, ColorA = @ColorA, ParticleSystem = @ParticleSystem, SaleType = @SaleType, ColorR = @ColorR, ColorG = @ColorG, ColorB = @ColorB, ColorA = @ColorA, ParticleSystem = @ParticleSystem,
ClickAction = @ClickAction, Material = @Material, CollisionSound = @CollisionSound, CollisionSoundVolume = @CollisionSoundVolume, PassTouches = @PassTouches, ClickAction = @ClickAction, Material = @Material, CollisionSound = @CollisionSound, CollisionSoundVolume = @CollisionSoundVolume, PassTouches = @PassTouches,
LinkNumber = @LinkNumber, MediaURL = @MediaURL LinkNumber = @LinkNumber, MediaURL = @MediaURL, DynAttrs = @DynAttrs
WHERE UUID = @UUID WHERE UUID = @UUID
END END
ELSE ELSE
@ -366,7 +366,7 @@ ELSE
PayPrice, PayButton1, PayButton2, PayButton3, PayButton4, LoopedSound, LoopedSoundGain, TextureAnimation, OmegaX, PayPrice, PayButton1, PayButton2, PayButton3, PayButton4, LoopedSound, LoopedSoundGain, TextureAnimation, OmegaX,
OmegaY, OmegaZ, CameraEyeOffsetX, CameraEyeOffsetY, CameraEyeOffsetZ, CameraAtOffsetX, CameraAtOffsetY, CameraAtOffsetZ, OmegaY, OmegaZ, CameraEyeOffsetX, CameraEyeOffsetY, CameraEyeOffsetZ, CameraAtOffsetX, CameraAtOffsetY, CameraAtOffsetZ,
ForceMouselook, ScriptAccessPin, AllowedDrop, DieAtEdge, SalePrice, SaleType, ColorR, ColorG, ColorB, ColorA, ForceMouselook, ScriptAccessPin, AllowedDrop, DieAtEdge, SalePrice, SaleType, ColorR, ColorG, ColorB, ColorA,
ParticleSystem, ClickAction, Material, CollisionSound, CollisionSoundVolume, PassTouches, LinkNumber, MediaURL ParticleSystem, ClickAction, Material, CollisionSound, CollisionSoundVolume, PassTouches, LinkNumber, MediaURL, DynAttrs
) VALUES ( ) VALUES (
@UUID, @CreationDate, @Name, @Text, @Description, @SitName, @TouchName, @ObjectFlags, @OwnerMask, @NextOwnerMask, @GroupMask, @UUID, @CreationDate, @Name, @Text, @Description, @SitName, @TouchName, @ObjectFlags, @OwnerMask, @NextOwnerMask, @GroupMask,
@EveryoneMask, @BaseMask, @PositionX, @PositionY, @PositionZ, @GroupPositionX, @GroupPositionY, @GroupPositionZ, @VelocityX, @EveryoneMask, @BaseMask, @PositionX, @PositionY, @PositionZ, @GroupPositionX, @GroupPositionY, @GroupPositionZ, @VelocityX,
@ -376,7 +376,7 @@ ELSE
@PayPrice, @PayButton1, @PayButton2, @PayButton3, @PayButton4, @LoopedSound, @LoopedSoundGain, @TextureAnimation, @OmegaX, @PayPrice, @PayButton1, @PayButton2, @PayButton3, @PayButton4, @LoopedSound, @LoopedSoundGain, @TextureAnimation, @OmegaX,
@OmegaY, @OmegaZ, @CameraEyeOffsetX, @CameraEyeOffsetY, @CameraEyeOffsetZ, @CameraAtOffsetX, @CameraAtOffsetY, @CameraAtOffsetZ, @OmegaY, @OmegaZ, @CameraEyeOffsetX, @CameraEyeOffsetY, @CameraEyeOffsetZ, @CameraAtOffsetX, @CameraAtOffsetY, @CameraAtOffsetZ,
@ForceMouselook, @ScriptAccessPin, @AllowedDrop, @DieAtEdge, @SalePrice, @SaleType, @ColorR, @ColorG, @ColorB, @ColorA, @ForceMouselook, @ScriptAccessPin, @AllowedDrop, @DieAtEdge, @SalePrice, @SaleType, @ColorR, @ColorG, @ColorB, @ColorA,
@ParticleSystem, @ClickAction, @Material, @CollisionSound, @CollisionSoundVolume, @PassTouches, @LinkNumber, @MediaURL @ParticleSystem, @ClickAction, @Material, @CollisionSound, @CollisionSoundVolume, @PassTouches, @LinkNumber, @MediaURL, @DynAttrs
) )
END"; END";
@ -1692,6 +1692,11 @@ VALUES
if (!(primRow["MediaURL"] is System.DBNull)) if (!(primRow["MediaURL"] is System.DBNull))
prim.MediaUrl = (string)primRow["MediaURL"]; prim.MediaUrl = (string)primRow["MediaURL"];
if (!(primRow["DynAttrs"] is System.DBNull))
prim.DynAttrs = DAMap.FromXml((string)primRow["DynAttrs"]);
else
prim.DynAttrs = new DAMap();
return prim; return prim;
} }
@ -1749,7 +1754,6 @@ VALUES
baseShape.Media = PrimitiveBaseShape.MediaList.FromXml((string)shapeRow["Media"]); baseShape.Media = PrimitiveBaseShape.MediaList.FromXml((string)shapeRow["Media"]);
} }
return baseShape; return baseShape;
} }
@ -2087,6 +2091,11 @@ VALUES
parameters.Add(_Database.CreateParameter("LinkNumber", prim.LinkNum)); parameters.Add(_Database.CreateParameter("LinkNumber", prim.LinkNum));
parameters.Add(_Database.CreateParameter("MediaURL", prim.MediaUrl)); parameters.Add(_Database.CreateParameter("MediaURL", prim.MediaUrl));
if (prim.DynAttrs.Count > 0)
parameters.Add(_Database.CreateParameter("DynAttrs", prim.DynAttrs.ToXml()));
else
parameters.Add(_Database.CreateParameter("DynAttrs", null));
return parameters.ToArray(); return parameters.ToArray();
} }
@ -2143,7 +2152,6 @@ VALUES
parameters.Add(_Database.CreateParameter("Media", s.Media.ToXml())); parameters.Add(_Database.CreateParameter("Media", s.Media.ToXml()));
} }
return parameters.ToArray(); return parameters.ToArray();
} }

View File

@ -61,5 +61,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Revision and Build Numbers // You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below: // by using the '*' as shown below:
[assembly : AssemblyVersion("0.7.5.*")] [assembly : AssemblyVersion("0.7.6.*")]
[assembly : AssemblyFileVersion("0.6.5.0")] [assembly : AssemblyFileVersion("0.6.5.0")]

View File

@ -1148,3 +1148,11 @@ CREATE TABLE [dbo].[regionenvironment](
) ON [PRIMARY] ) ON [PRIMARY]
COMMIT COMMIT
:VERSION 38 #---------------- Dynamic attributes
BEGIN TRANSACTION
ALTER TABLE prims ADD COLUMN DynAttrs TEXT;
COMMIT

View File

@ -52,7 +52,7 @@ namespace OpenSim.Data.MySQL
private string m_connectionString; private string m_connectionString;
private object m_dbLock = new object(); private object m_dbLock = new object();
protected virtual Assembly Assembly protected Assembly Assembly
{ {
get { return GetType().Assembly; } get { return GetType().Assembly; }
} }
@ -119,8 +119,10 @@ namespace OpenSim.Data.MySQL
// Eligibility check // Eligibility check
// //
if ((flags & (uint)PrimFlags.Temporary) != 0) // PrimFlags.Temporary is not used in OpenSim code and cannot
return; // be guaranteed to always be clear. Don't check it.
// if ((flags & (uint)PrimFlags.Temporary) != 0)
// return;
if ((flags & (uint)PrimFlags.TemporaryOnRez) != 0) if ((flags & (uint)PrimFlags.TemporaryOnRez) != 0)
return; return;
@ -171,7 +173,10 @@ namespace OpenSim.Data.MySQL
"ParticleSystem, ClickAction, Material, " + "ParticleSystem, ClickAction, Material, " +
"CollisionSound, CollisionSoundVolume, " + "CollisionSound, CollisionSoundVolume, " +
"PassTouches, " + "PassTouches, " +
"LinkNumber, MediaURL) values (" + "?UUID, " + "LinkNumber, MediaURL, " +
"PhysicsShapeType, Density, GravityModifier, " +
"Friction, Restitution, DynAttrs " +
") values (" + "?UUID, " +
"?CreationDate, ?Name, ?Text, " + "?CreationDate, ?Name, ?Text, " +
"?Description, ?SitName, ?TouchName, " + "?Description, ?SitName, ?TouchName, " +
"?ObjectFlags, ?OwnerMask, ?NextOwnerMask, " + "?ObjectFlags, ?OwnerMask, ?NextOwnerMask, " +
@ -202,7 +207,10 @@ namespace OpenSim.Data.MySQL
"?SaleType, ?ColorR, ?ColorG, " + "?SaleType, ?ColorR, ?ColorG, " +
"?ColorB, ?ColorA, ?ParticleSystem, " + "?ColorB, ?ColorA, ?ParticleSystem, " +
"?ClickAction, ?Material, ?CollisionSound, " + "?ClickAction, ?Material, ?CollisionSound, " +
"?CollisionSoundVolume, ?PassTouches, ?LinkNumber, ?MediaURL)"; "?CollisionSoundVolume, ?PassTouches, " +
"?LinkNumber, ?MediaURL, " +
"?PhysicsShapeType, ?Density, ?GravityModifier, " +
"?Friction, ?Restitution, ?DynAttrs)";
FillPrimCommand(cmd, prim, obj.UUID, regionUUID); FillPrimCommand(cmd, prim, obj.UUID, regionUUID);
@ -219,7 +227,8 @@ namespace OpenSim.Data.MySQL
"PathTaperX, PathTaperY, PathTwist, " + "PathTaperX, PathTaperY, PathTwist, " +
"PathTwistBegin, ProfileBegin, ProfileEnd, " + "PathTwistBegin, ProfileBegin, ProfileEnd, " +
"ProfileCurve, ProfileHollow, Texture, " + "ProfileCurve, ProfileHollow, Texture, " +
"ExtraParams, State, Media) values (?UUID, " + "ExtraParams, State, Media) " +
"values (?UUID, " +
"?Shape, ?ScaleX, ?ScaleY, ?ScaleZ, " + "?Shape, ?ScaleX, ?ScaleY, ?ScaleZ, " +
"?PCode, ?PathBegin, ?PathEnd, " + "?PCode, ?PathBegin, ?PathEnd, " +
"?PathScaleX, ?PathScaleY, " + "?PathScaleX, ?PathScaleY, " +
@ -738,7 +747,7 @@ namespace OpenSim.Data.MySQL
{ {
//No result, so store our default windlight profile and return it //No result, so store our default windlight profile and return it
nWP.regionID = regionUUID; nWP.regionID = regionUUID;
StoreRegionWindlightSettings(nWP); // StoreRegionWindlightSettings(nWP);
return nWP; return nWP;
} }
else else
@ -1094,7 +1103,8 @@ namespace OpenSim.Data.MySQL
"?SunPosition, ?Covenant, ?CovenantChangedDateTime, ?Sandbox, " + "?SunPosition, ?Covenant, ?CovenantChangedDateTime, ?Sandbox, " +
"?SunVectorX, ?SunVectorY, ?SunVectorZ, " + "?SunVectorX, ?SunVectorY, ?SunVectorZ, " +
"?LoadedCreationDateTime, ?LoadedCreationID, " + "?LoadedCreationDateTime, ?LoadedCreationID, " +
"?TerrainImageID, ?TelehubObject, ?ParcelImageID) "; "?TerrainImageID, " +
"?TelehubObject, ?ParcelImageID)";
FillRegionSettingsCommand(cmd, rs); FillRegionSettingsCommand(cmd, rs);
@ -1292,6 +1302,17 @@ namespace OpenSim.Data.MySQL
if (!(row["MediaURL"] is System.DBNull)) if (!(row["MediaURL"] is System.DBNull))
prim.MediaUrl = (string)row["MediaURL"]; prim.MediaUrl = (string)row["MediaURL"];
if (!(row["DynAttrs"] is System.DBNull))
prim.DynAttrs = DAMap.FromXml((string)row["DynAttrs"]);
else
prim.DynAttrs = new DAMap();
prim.PhysicsShapeType = (byte)Convert.ToInt32(row["PhysicsShapeType"].ToString());
prim.Density = (float)(double)row["Density"];
prim.GravityModifier = (float)(double)row["GravityModifier"];
prim.Friction = (float)(double)row["Friction"];
prim.Restitution = (float)(double)row["Restitution"];
return prim; return prim;
} }
@ -1637,6 +1658,17 @@ namespace OpenSim.Data.MySQL
cmd.Parameters.AddWithValue("LinkNumber", prim.LinkNum); cmd.Parameters.AddWithValue("LinkNumber", prim.LinkNum);
cmd.Parameters.AddWithValue("MediaURL", prim.MediaUrl); cmd.Parameters.AddWithValue("MediaURL", prim.MediaUrl);
cmd.Parameters.AddWithValue("PhysicsShapeType", prim.PhysicsShapeType);
cmd.Parameters.AddWithValue("Density", (double)prim.Density);
cmd.Parameters.AddWithValue("GravityModifier", (double)prim.GravityModifier);
cmd.Parameters.AddWithValue("Friction", (double)prim.Friction);
cmd.Parameters.AddWithValue("Restitution", (double)prim.Restitution);
if (prim.DynAttrs.Count > 0)
cmd.Parameters.AddWithValue("DynAttrs", prim.DynAttrs.ToXml());
else
cmd.Parameters.AddWithValue("DynAttrs", null);
} }
/// <summary> /// <summary>
@ -1715,6 +1747,7 @@ namespace OpenSim.Data.MySQL
cmd.Parameters.AddWithValue("LoadedCreationDateTime", settings.LoadedCreationDateTime); cmd.Parameters.AddWithValue("LoadedCreationDateTime", settings.LoadedCreationDateTime);
cmd.Parameters.AddWithValue("LoadedCreationID", settings.LoadedCreationID); cmd.Parameters.AddWithValue("LoadedCreationID", settings.LoadedCreationID);
cmd.Parameters.AddWithValue("TerrainImageID", settings.TerrainImageID); cmd.Parameters.AddWithValue("TerrainImageID", settings.TerrainImageID);
cmd.Parameters.AddWithValue("ParcelImageID", settings.ParcelImageID); cmd.Parameters.AddWithValue("ParcelImageID", settings.ParcelImageID);
cmd.Parameters.AddWithValue("TelehubObject", settings.TelehubObject); cmd.Parameters.AddWithValue("TelehubObject", settings.TelehubObject);
} }

View File

@ -61,5 +61,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Revision and Build Numbers // You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below: // by using the '*' as shown below:
[assembly : AssemblyVersion("0.7.5.*")] [assembly : AssemblyVersion("0.7.6.*")]
[assembly : AssemblyFileVersion("0.6.5.0")] [assembly : AssemblyFileVersion("0.6.5.0")]

View File

@ -902,3 +902,24 @@ BEGIN;
CREATE TABLE `regionextra` (`RegionID` char(36) not null, `Name` varchar(32) not null, `value` text, primary key(`RegionID`, `Name`)); CREATE TABLE `regionextra` (`RegionID` char(36) not null, `Name` varchar(32) not null, `value` text, primary key(`RegionID`, `Name`));
COMMIT; COMMIT;
:VERSION 46 #---------------- Dynamic attributes
BEGIN;
ALTER TABLE prims ADD COLUMN DynAttrs TEXT;
COMMIT;
:VERSION 47 #---------------- Extra prim params
BEGIN;
ALTER TABLE prims ADD COLUMN `PhysicsShapeType` tinyint(4) NOT NULL default '0';
ALTER TABLE prims ADD COLUMN `Density` double NOT NULL default '1000';
ALTER TABLE prims ADD COLUMN `GravityModifier` double NOT NULL default '1';
ALTER TABLE prims ADD COLUMN `Friction` double NOT NULL default '0.6';
ALTER TABLE prims ADD COLUMN `Restitution` double NOT NULL default '0.5';
COMMIT;

View File

@ -61,5 +61,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Revision and Build Numbers // You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below: // by using the '*' as shown below:
[assembly : AssemblyVersion("0.7.5.*")] [assembly : AssemblyVersion("0.7.6.*")]
[assembly : AssemblyFileVersion("0.6.5.0")] [assembly : AssemblyFileVersion("0.6.5.0")]

View File

@ -61,5 +61,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Revision and Build Numbers // You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below: // by using the '*' as shown below:
[assembly : AssemblyVersion("0.7.5.*")] [assembly : AssemblyVersion("0.7.6.*")]
[assembly : AssemblyFileVersion("0.6.5.0")] [assembly : AssemblyFileVersion("0.6.5.0")]

View File

@ -61,5 +61,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Revision and Build Numbers // You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below: // by using the '*' as shown below:
[assembly : AssemblyVersion("0.7.5.*")] [assembly : AssemblyVersion("0.7.6.*")]
[assembly : AssemblyFileVersion("0.6.5.0")] [assembly : AssemblyFileVersion("0.6.5.0")]

View File

@ -575,3 +575,8 @@ CREATE TABLE `regionenvironment` (
); );
COMMIT; COMMIT;
:VERSION 27
BEGIN;
ALTER TABLE prims ADD COLUMN DynAttrs TEXT;
COMMIT;

View File

@ -1233,6 +1233,8 @@ namespace OpenSim.Data.SQLite
createCol(prims, "MediaURL", typeof(String)); createCol(prims, "MediaURL", typeof(String));
createCol(prims, "DynAttrs", typeof(String));
// Add in contraints // Add in contraints
prims.PrimaryKey = new DataColumn[] { prims.Columns["UUID"] }; prims.PrimaryKey = new DataColumn[] { prims.Columns["UUID"] };
@ -1712,6 +1714,16 @@ namespace OpenSim.Data.SQLite
prim.MediaUrl = (string)row["MediaURL"]; prim.MediaUrl = (string)row["MediaURL"];
} }
if (!(row["DynAttrs"] is System.DBNull))
{
//m_log.DebugFormat("[SQLITE]: DynAttrs type [{0}]", row["DynAttrs"].GetType());
prim.DynAttrs = DAMap.FromXml((string)row["DynAttrs"]);
}
else
{
prim.DynAttrs = new DAMap();
}
return prim; return prim;
} }
@ -2133,6 +2145,11 @@ namespace OpenSim.Data.SQLite
row["VolumeDetect"] = 0; row["VolumeDetect"] = 0;
row["MediaURL"] = prim.MediaUrl; row["MediaURL"] = prim.MediaUrl;
if (prim.DynAttrs.Count > 0)
row["DynAttrs"] = prim.DynAttrs.ToXml();
else
row["DynAttrs"] = null;
} }
/// <summary> /// <summary>

View File

@ -59,5 +59,5 @@ using System.Runtime.InteropServices;
// Revision // Revision
// //
[assembly : AssemblyVersion("0.7.5.*")] [assembly : AssemblyVersion("0.7.6.*")]
[assembly : AssemblyFileVersion("0.6.5.0")] [assembly : AssemblyFileVersion("0.6.5.0")]

View File

@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// Build Number // Build Number
// Revision // Revision
// //
[assembly: AssemblyVersion("0.7.5.*")] [assembly: AssemblyVersion("0.7.6.*")]
[assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]

View File

@ -61,5 +61,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Revision and Build Numbers // You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below: // by using the '*' as shown below:
[assembly : AssemblyVersion("0.7.5.*")] [assembly : AssemblyVersion("0.7.6.*")]
[assembly : AssemblyFileVersion("0.6.5.0")] [assembly : AssemblyFileVersion("0.6.5.0")]

View File

@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// Build Number // Build Number
// Revision // Revision
// //
[assembly: AssemblyVersion("0.7.5.*")] [assembly: AssemblyVersion("0.7.6.*")]
[assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]

View File

@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// Build Number // Build Number
// Revision // Revision
// //
[assembly: AssemblyVersion("0.7.5.*")] [assembly: AssemblyVersion("0.7.6.*")]
[assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]

View File

@ -55,4 +55,4 @@ using System.Runtime.InteropServices;
// You can specify all values by your own or you can build default build and revision // You can specify all values by your own or you can build default build and revision
// numbers with the '*' character (the default): // numbers with the '*' character (the default):
[assembly : AssemblyVersion("0.7.5.*")] [assembly : AssemblyVersion("0.7.6.*")]

273
OpenSim/Framework/DAMap.cs Normal file
View File

@ -0,0 +1,273 @@
/*
* 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;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Xml;
using System.Xml.Schema;
using System.Xml.Serialization;
using OpenMetaverse;
using OpenMetaverse.StructuredData;
namespace OpenSim.Framework
{
/// <summary>
/// This class stores and retrieves dynamic attributes.
/// </summary>
/// <remarks>
/// Modules that want to use dynamic attributes need to do so in a private data store
/// which is accessed using a unique name. DAMap provides access to the data stores,
/// each of which is an OSDMap. Modules are free to store any type of data they want
/// within their data store. However, avoid storing large amounts of data because that
/// would slow down database access.
/// </remarks>
public class DAMap : IDictionary<string, OSDMap>, IXmlSerializable
{
private static readonly int MIN_STORE_NAME_LENGTH = 4;
protected OSDMap m_map;
public DAMap() { m_map = new OSDMap(); }
public XmlSchema GetSchema() { return null; }
public static DAMap FromXml(string rawXml)
{
DAMap map = new DAMap();
map.ReadXml(rawXml);
return map;
}
public void ReadXml(string rawXml)
{
// System.Console.WriteLine("Trying to deserialize [{0}]", rawXml);
lock (this)
m_map = (OSDMap)OSDParser.DeserializeLLSDXml(rawXml);
}
// WARNING: this is temporary for experimentation only, it will be removed!!!!
public OSDMap TopLevelMap
{
get { return m_map; }
set { m_map = value; }
}
public void ReadXml(XmlReader reader)
{
ReadXml(reader.ReadInnerXml());
}
public string ToXml()
{
lock (this)
return OSDParser.SerializeLLSDXmlString(m_map);
}
public void WriteXml(XmlWriter writer)
{
writer.WriteRaw(ToXml());
}
public void CopyFrom(DAMap other)
{
// Deep copy
string data = null;
lock (other)
{
if (other.Count > 0)
{
data = OSDParser.SerializeLLSDXmlString(other.m_map);
}
}
lock (this)
{
if (data == null)
Clear();
else
m_map = (OSDMap)OSDParser.DeserializeLLSDXml(data);
}
}
/// <summary>
/// Returns the number of data stores.
/// </summary>
public int Count { get { lock (this) { return m_map.Count; } } }
public bool IsReadOnly { get { return false; } }
/// <summary>
/// Returns the names of the data stores.
/// </summary>
public ICollection<string> Keys { get { lock (this) { return m_map.Keys; } } }
/// <summary>
/// Returns all the data stores.
/// </summary>
public ICollection<OSDMap> Values
{
get
{
lock (this)
{
List<OSDMap> stores = new List<OSDMap>(m_map.Count);
foreach (OSD llsd in m_map.Values)
stores.Add((OSDMap)llsd);
return stores;
}
}
}
/// <summary>
/// Gets or sets one data store.
/// </summary>
/// <param name="key">Store name</param>
/// <returns></returns>
public OSDMap this[string key]
{
get
{
OSD llsd;
lock (this)
{
if (m_map.TryGetValue(key, out llsd))
return (OSDMap)llsd;
else
return null;
}
}
set
{
ValidateKey(key);
lock (this)
m_map[key] = value;
}
}
/// <summary>
/// Validate the key used for storing separate data stores.
/// </summary>
/// <param name='key'></param>
private static void ValidateKey(string key)
{
if (key.Length < MIN_STORE_NAME_LENGTH)
throw new Exception("Minimum store name length is " + MIN_STORE_NAME_LENGTH);
}
public bool ContainsKey(string key)
{
lock (this)
return m_map.ContainsKey(key);
}
public void Add(string key, OSDMap store)
{
ValidateKey(key);
lock (this)
m_map.Add(key, store);
}
public void Add(KeyValuePair<string, OSDMap> kvp)
{
ValidateKey(kvp.Key);
lock (this)
m_map.Add(kvp.Key, kvp.Value);
}
public bool Remove(string key)
{
lock (this)
return m_map.Remove(key);
}
public bool TryGetValue(string key, out OSDMap store)
{
lock (this)
{
OSD llsd;
if (m_map.TryGetValue(key, out llsd))
{
store = (OSDMap)llsd;
return true;
}
else
{
store = null;
return false;
}
}
}
public void Clear()
{
lock (this)
m_map.Clear();
}
public bool Contains(KeyValuePair<string, OSDMap> kvp)
{
lock (this)
return m_map.ContainsKey(kvp.Key);
}
public void CopyTo(KeyValuePair<string, OSDMap>[] array, int index)
{
throw new NotImplementedException();
}
public bool Remove(KeyValuePair<string, OSDMap> kvp)
{
lock (this)
return m_map.Remove(kvp.Key);
}
public System.Collections.IDictionaryEnumerator GetEnumerator()
{
lock (this)
return m_map.GetEnumerator();
}
IEnumerator<KeyValuePair<string, OSDMap>> IEnumerable<KeyValuePair<string, OSDMap>>.GetEnumerator()
{
return null;
}
IEnumerator IEnumerable.GetEnumerator()
{
lock (this)
return m_map.GetEnumerator();
}
}
}

View File

@ -27,20 +27,24 @@
using OpenMetaverse; using OpenMetaverse;
namespace OpenSim.Region.Framework.Scenes.Scripting namespace OpenSim.Framework
{ {
public interface IScriptHost public enum PhysShapeType : byte
{ {
string Name { get; set; } prim = 0,
string Description { get; set; } none = 1,
convex = 2,
UUID UUID { get; } invalid = 255 // use to mark invalid data in ExtraPhysicsData
UUID OwnerID { get; } }
UUID CreatorID { get; }
Vector3 AbsolutePosition { get; } public struct ExtraPhysicsData
{
public float Density;
public float GravitationModifier;
public float Friction;
public float Bounce;
public PhysShapeType PhysShapeType;
string SitName { get; set; }
string TouchName { get; set; }
void SetText(string text, Vector3 color, double alpha);
} }
} }

View File

@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// Build Number // Build Number
// Revision // Revision
// //
[assembly: AssemblyVersion("0.7.5.*")] [assembly: AssemblyVersion("0.7.6.*")]
[assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]

View File

@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// Build Number // Build Number
// Revision // Revision
// //
[assembly: AssemblyVersion("0.7.5.*")] [assembly: AssemblyVersion("0.7.6.*")]
[assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]

View File

@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// Build Number // Build Number
// Revision // Revision
// //
[assembly: AssemblyVersion("0.7.5.*")] [assembly: AssemblyVersion("0.7.6.*")]
[assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]

View File

@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// Build Number // Build Number
// Revision // Revision
// //
[assembly: AssemblyVersion("0.7.5.*")] [assembly: AssemblyVersion("0.7.6.*")]
[assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]

View File

@ -99,6 +99,16 @@ namespace OpenSim.Framework.Servers.HttpServer
bool AddJsonRPCHandler(string method, JsonRPCMethod handler); bool AddJsonRPCHandler(string method, JsonRPCMethod handler);
/// <summary>
/// Websocket HTTP server handlers.
/// </summary>
/// <param name="servicepath"></param>
/// <param name="handler"></param>
void AddWebSocketHandler(string servicepath, BaseHttpServer.WebSocketRequestDelegate handler);
void RemoveWebSocketHandler(string servicepath);
/// <summary> /// <summary>
/// Gets the XML RPC handler for given method name /// Gets the XML RPC handler for given method name
/// </summary> /// </summary>

View File

@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// Build Number // Build Number
// Revision // Revision
// //
[assembly: AssemblyVersion("0.7.5.*")] [assembly: AssemblyVersion("0.7.6.*")]
[assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]

View File

@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// Build Number // Build Number
// Revision // Revision
// //
[assembly: AssemblyVersion("0.7.5.*")] [assembly: AssemblyVersion("0.7.6.*")]
[assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]

View File

@ -29,7 +29,7 @@ namespace OpenSim
{ {
public class VersionInfo public class VersionInfo
{ {
private const string VERSION_NUMBER = "0.7.5"; private const string VERSION_NUMBER = "0.7.6";
private const Flavour VERSION_FLAVOUR = Flavour.Dev; private const Flavour VERSION_FLAVOUR = Flavour.Dev;
public enum Flavour public enum Flavour

View File

@ -45,6 +45,7 @@ using System.Text.RegularExpressions;
using System.Xml; using System.Xml;
using System.Threading; using System.Threading;
using log4net; using log4net;
using log4net.Appender;
using Nini.Config; using Nini.Config;
using Nwc.XmlRpc; using Nwc.XmlRpc;
using OpenMetaverse; using OpenMetaverse;
@ -816,9 +817,22 @@ namespace OpenSim.Framework
return "."; return ".";
} }
public static string logFile()
{
foreach (IAppender appender in LogManager.GetRepository().GetAppenders())
{
if (appender is FileAppender)
{
return ((FileAppender)appender).File;
}
}
return "./OpenSim.log";
}
public static string logDir() public static string logDir()
{ {
return "."; return Path.GetDirectoryName(logFile());
} }
// From: http://coercedcode.blogspot.com/2008/03/c-generate-unique-filenames-within.html // From: http://coercedcode.blogspot.com/2008/03/c-generate-unique-filenames-within.html

View File

@ -714,7 +714,7 @@ namespace OpenSim
return new Scene( return new Scene(
regionInfo, circuitManager, sceneGridService, regionInfo, circuitManager, sceneGridService,
simDataService, estateDataService, false, simDataService, estateDataService,
Config, m_version); Config, m_version);
} }

View File

@ -617,7 +617,7 @@ namespace OpenSim.Region.ClientStack.Linden
= new SceneObjectPart(owner_id, pbs, position, Quaternion.Identity, Vector3.Zero); = new SceneObjectPart(owner_id, pbs, position, Quaternion.Identity, Vector3.Zero);
prim.Scale = scale; prim.Scale = scale;
prim.OffsetPosition = position; //prim.OffsetPosition = position;
rotations.Add(rotation); rotations.Add(rotation);
positions.Add(position); positions.Add(position);
prim.UUID = UUID.Random(); prim.UUID = UUID.Random();
@ -641,25 +641,40 @@ namespace OpenSim.Region.ClientStack.Linden
grp.AddPart(prim); grp.AddPart(prim);
} }
// Fix first link number Vector3 rootPos = positions[0];
if (grp.Parts.Length > 1) if (grp.Parts.Length > 1)
{
// Fix first link number
grp.RootPart.LinkNum++; grp.RootPart.LinkNum++;
Vector3 rootPos = positions[0]; Quaternion rootRotConj = Quaternion.Conjugate(rotations[0]);
grp.AbsolutePosition = rootPos; Quaternion tmprot;
for (int i = 0; i < positions.Count; i++) Vector3 offset;
// fix children rotations and positions
for (int i = 1; i < rotations.Count; i++)
{
tmprot = rotations[i];
tmprot = rootRotConj * tmprot;
grp.Parts[i].RotationOffset = tmprot;
offset = positions[i] - rootPos;
offset *= rootRotConj;
grp.Parts[i].OffsetPosition = offset;
}
grp.AbsolutePosition = rootPos;
grp.UpdateGroupRotationR(rotations[0]);
}
else
{ {
Vector3 offset = positions[i] - rootPos; grp.AbsolutePosition = rootPos;
grp.Parts[i].OffsetPosition = offset; grp.UpdateGroupRotationR(rotations[0]);
} }
for (int i = 0; i < rotations.Count; i++)
{
if (i != 0)
grp.Parts[i].RotationOffset = rotations[i];
}
grp.UpdateGroupRotationR(rotations[0]);
data = ASCIIEncoding.ASCII.GetBytes(SceneObjectSerializer.ToOriginalXmlFormat(grp)); data = ASCIIEncoding.ASCII.GetBytes(SceneObjectSerializer.ToOriginalXmlFormat(grp));
} }

View File

@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// Build Number // Build Number
// Revision // Revision
// //
[assembly: AssemblyVersion("0.7.5.*")] [assembly: AssemblyVersion("0.7.6.*")]
[assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]

View File

@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// Build Number // Build Number
// Revision // Revision
// //
[assembly: AssemblyVersion("0.7.5.*")] [assembly: AssemblyVersion("0.7.6.*")]
[assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]

View File

@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// Build Number // Build Number
// Revision // Revision
// //
[assembly: AssemblyVersion("0.7.5.*")] [assembly: AssemblyVersion("0.7.6.*")]
[assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]

View File

@ -1,50 +0,0 @@
using System;
using System.Net.Sockets;
namespace OpenSim.Region.ClientStack.TCPJSONStream
{
/// <summary>
/// Invoked when a client have been accepted by the <see cref="HttpListener"/>
/// </summary>
/// <remarks>
/// Can be used to revoke incoming connections
/// </remarks>
public class ClientAcceptedEventArgs : EventArgs
{
private readonly Socket _socket;
private bool _revoke;
/// <summary>
/// Initializes a new instance of the <see cref="ClientAcceptedEventArgs"/> class.
/// </summary>
/// <param name="socket">The socket.</param>
public ClientAcceptedEventArgs(Socket socket)
{
_socket = socket;
}
/// <summary>
/// Accepted socket.
/// </summary>
public Socket Socket
{
get { return _socket; }
}
/// <summary>
/// Client should be revoked.
/// </summary>
public bool Revoked
{
get { return _revoke; }
}
/// <summary>
/// Client may not be handled.
/// </summary>
public void Revoke()
{
_revoke = true;
}
}
}

View File

@ -1,146 +0,0 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Net;
using System.Net.Sockets;
using System.Text;
namespace OpenSim.Region.ClientStack.TCPJSONStream
{
public class ClientNetworkContext
{
private Socket _socket;
private string _remoteAddress;
private string _remotePort;
private WebSocketConnectionStage _wsConnectionStatus = WebSocketConnectionStage.Accept;
private int _bytesLeft;
private NetworkStream _stream;
private byte[] _buffer;
public event EventHandler<DisconnectedEventArgs> Disconnected = delegate { };
public ClientNetworkContext(IPEndPoint endPoint, int port, Stream stream, int buffersize, Socket sock)
{
_socket = sock;
_remoteAddress = endPoint.Address.ToString();
_remotePort = port.ToString();
_stream = stream as NetworkStream;
_buffer = new byte[buffersize];
}
public void BeginRead()
{
_wsConnectionStatus = WebSocketConnectionStage.Http;
try
{
_stream.BeginRead(_buffer, 0, _buffer.Length, OnReceive, _wsConnectionStatus);
}
catch (IOException err)
{
//m_log.Debug(err.ToString());
}
}
private void OnReceive(IAsyncResult ar)
{
try
{
int bytesRead = _stream.EndRead(ar);
if (bytesRead == 0)
{
Disconnected(this, new DisconnectedEventArgs(SocketError.ConnectionReset));
return;
}
}
catch (Exception)
{
}
}
/// <summary>
/// send a whole buffer
/// </summary>
/// <param name="buffer">buffer to send</param>
/// <exception cref="ArgumentNullException"></exception>
public void Send(byte[] buffer)
{
if (buffer == null)
throw new ArgumentNullException("buffer");
Send(buffer, 0, buffer.Length);
}
/// <summary>
/// Send data using the stream
/// </summary>
/// <param name="buffer">Contains data to send</param>
/// <param name="offset">Start position in buffer</param>
/// <param name="size">number of bytes to send</param>
/// <exception cref="ArgumentNullException"></exception>
/// <exception cref="ArgumentOutOfRangeException"></exception>
public void Send(byte[] buffer, int offset, int size)
{
if (offset + size > buffer.Length)
throw new ArgumentOutOfRangeException("offset", offset, "offset + size is beyond end of buffer.");
if (_stream != null && _stream.CanWrite)
{
try
{
_stream.Write(buffer, offset, size);
}
catch (IOException)
{
}
}
}
private void Reset()
{
if (_stream == null)
return;
_stream.Dispose();
_stream = null;
if (_socket == null)
return;
if (_socket.Connected)
_socket.Disconnect(true);
_socket = null;
}
}
public enum WebSocketConnectionStage
{
Reuse,
Accept,
Http,
WebSocket,
Closed
}
public enum FrameOpCodesRFC6455
{
Continue = 0x0,
Text = 0x1,
Binary = 0x2,
Close = 0x8,
Ping = 0x9,
Pong = 0xA
}
public enum DataState
{
Empty = 0,
Waiting = 1,
Receiving = 2,
Complete = 3,
Closed = 4,
Ping = 5,
Pong = 6
}
}

View File

@ -1,17 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Sockets;
using System.Text;
namespace OpenSim.Region.ClientStack.TCPJSONStream
{
public class DisconnectedEventArgs:EventArgs
{
public SocketError Error { get; private set; }
public DisconnectedEventArgs(SocketError err)
{
Error = err;
}
}
}

View File

@ -1,73 +0,0 @@
/*
* Copyright (c) Contributors, http://opensimulator.org/
* See CONTRIBUTORS.TXT for a full list of copyright holders.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the OpenSimulator Project nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
using System;
using System.Net;
using Nini.Config;
using OpenSim.Framework;
namespace OpenSim.Region.ClientStack.TCPJSONStream
{
public sealed class TCPJsonWebSocketBase : IClientNetworkServer
{
private TCPJsonWebSocketServer m_tcpServer;
public TCPJsonWebSocketBase()
{
}
public void Initialise(IPAddress _listenIP, ref uint port, int proxyPortOffsetParm, bool allow_alternate_port, IConfigSource configSource, AgentCircuitManager authenticateClass)
{
m_tcpServer = new TCPJsonWebSocketServer(_listenIP,ref port, proxyPortOffsetParm, allow_alternate_port,configSource,authenticateClass);
}
public void NetworkStop()
{
// m_tcpServer.Stop();
}
public bool HandlesRegion(Location x)
{
return m_tcpServer.HandlesRegion(x);
}
public void AddScene(IScene x)
{
m_tcpServer.AddScene(x);
}
public void Start()
{
//m_tcpServer.Start();
}
public void Stop()
{
// m_tcpServer.Stop();
}
}
}

View File

@ -1,163 +0,0 @@
using System;
using System.Collections.Generic;
using System.Net;
using System.Net.Sockets;
using System.Reflection;
using System.Text;
using System.Threading;
using Nini.Config;
using OpenSim.Framework;
using OpenSim.Region.Framework.Scenes;
using log4net;
namespace OpenSim.Region.ClientStack.TCPJSONStream
{
public delegate void ExceptionHandler(object source, Exception exception);
public class TCPJsonWebSocketServer
{
private readonly IPAddress _address;
private readonly int _port;
private readonly ManualResetEvent _shutdownEvent = new ManualResetEvent(false);
private TcpListener _listener;
private int _pendingAccepts;
private bool _shutdown;
private int _backlogAcceptQueueLength = 5;
private Scene m_scene;
private Location m_location;
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
public event EventHandler<ClientAcceptedEventArgs> Accepted = delegate { };
public TCPJsonWebSocketServer(IPAddress _listenIP, ref uint port, int proxyPortOffsetParm,
bool allow_alternate_port, IConfigSource configSource,
AgentCircuitManager authenticateClass)
{
_address = _listenIP;
_port = (int)port; //Why is a uint passed in?
}
public void Stop()
{
_shutdown = true;
_listener.Stop();
if (!_shutdownEvent.WaitOne())
m_log.Error("[WEBSOCKETSERVER]: Failed to shutdown listener properly.");
_listener = null;
}
public bool HandlesRegion(Location x)
{
return x == m_location;
}
public void AddScene(IScene scene)
{
if (m_scene != null)
{
m_log.Debug("[WEBSOCKETSERVER]: AddScene() called but I already have a scene.");
return;
}
if (!(scene is Scene))
{
m_log.Error("[WEBSOCKETSERVER]: AddScene() called with an unrecognized scene type " + scene.GetType());
return;
}
m_scene = (Scene)scene;
m_location = new Location(m_scene.RegionInfo.RegionHandle);
}
public void Start()
{
_listener = new TcpListener(_address, _port);
_listener.Start(_backlogAcceptQueueLength);
Interlocked.Increment(ref _pendingAccepts);
_listener.BeginAcceptSocket(OnAccept, null);
}
private void OnAccept(IAsyncResult ar)
{
bool beginAcceptCalled = false;
try
{
int count = Interlocked.Decrement(ref _pendingAccepts);
if (_shutdown)
{
if (count == 0)
_shutdownEvent.Set();
return;
}
Interlocked.Increment(ref _pendingAccepts);
_listener.BeginAcceptSocket(OnAccept, null);
beginAcceptCalled = true;
Socket socket = _listener.EndAcceptSocket(ar);
if (!OnAcceptingSocket(socket))
{
socket.Disconnect(true);
return;
}
ClientNetworkContext context = new ClientNetworkContext((IPEndPoint) socket.RemoteEndPoint, _port,
new NetworkStream(socket), 16384, socket);
//HttpRequestParser parser;
context.BeginRead();
}
catch (Exception err)
{
if (ExceptionThrown == null)
#if DEBUG
throw;
#else
_logWriter.Write(this, LogPrio.Fatal, err.Message);
// we can't really do anything but close the connection
#endif
if (ExceptionThrown != null)
ExceptionThrown(this, err);
if (!beginAcceptCalled)
RetryBeginAccept();
}
}
private void RetryBeginAccept()
{
try
{
_listener.BeginAcceptSocket(OnAccept, null);
}
catch (Exception err)
{
if (ExceptionThrown == null)
#if DEBUG
throw;
#else
// we can't really do anything but close the connection
#endif
if (ExceptionThrown != null)
ExceptionThrown(this, err);
}
}
private bool OnAcceptingSocket(Socket sock)
{
ClientAcceptedEventArgs args = new ClientAcceptedEventArgs(sock);
Accepted(this, args);
return !args.Revoked;
}
/// <summary>
/// Catch exceptions not handled by the listener.
/// </summary>
/// <remarks>
/// Exceptions will be thrown during debug mode if this event is not used,
/// exceptions will be printed to console and suppressed during release mode.
/// </remarks>
public event ExceptionHandler ExceptionThrown = delegate { };
}
}

View File

@ -0,0 +1,107 @@
/*
* 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 OpenMetaverse.Packets;
using OpenMetaverse.StructuredData;
using OpenSim.Framework;
using OpenSim.Region.Framework;
using OpenSim.Region.Framework.Interfaces;
using OpenSim.Region.Framework.Scenes;
namespace OpenSim.Region.Framework.DynamicAttributes.DAExampleModule
{
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "DAExampleModule")]
public class DAExampleModule : INonSharedRegionModule
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private static readonly bool ENABLED = false; // enable for testing
protected Scene m_scene;
protected IDialogModule m_dialogMod;
public string Name { get { return "DAExample Module"; } }
public Type ReplaceableInterface { get { return null; } }
public void Initialise(IConfigSource source) {}
public void AddRegion(Scene scene)
{
if (ENABLED)
{
m_scene = scene;
m_scene.EventManager.OnSceneGroupMove += OnSceneGroupMove;
m_dialogMod = m_scene.RequestModuleInterface<IDialogModule>();
}
}
public void RemoveRegion(Scene scene)
{
if (ENABLED)
{
m_scene.EventManager.OnSceneGroupMove -= OnSceneGroupMove;
}
}
public void RegionLoaded(Scene scene) {}
public void Close()
{
RemoveRegion(m_scene);
}
protected bool OnSceneGroupMove(UUID groupId, Vector3 delta)
{
OSDMap attrs = null;
SceneObjectPart sop = m_scene.GetSceneObjectPart(groupId);
if (!sop.DynAttrs.TryGetValue(Name, out attrs))
attrs = new OSDMap();
OSDInteger newValue;
if (!attrs.ContainsKey("moves"))
newValue = new OSDInteger(1);
else
newValue = new OSDInteger(((OSDInteger)attrs["moves"]).AsInteger() + 1);
attrs["moves"] = newValue;
sop.DynAttrs[Name] = attrs;
m_dialogMod.SendGeneralAlert(string.Format("{0} {1} moved {2} times", sop.Name, sop.UUID, newValue));
return true;
}
}
}

View File

@ -30,7 +30,7 @@ using Mono.Addins;
// Build Number // Build Number
// Revision // Revision
// //
[assembly: AssemblyVersion("0.7.5.*")] [assembly: AssemblyVersion("0.7.6.*")]
[assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: Addin("OpenSim.Region.CoreModules", "0.1")] [assembly: Addin("OpenSim.Region.CoreModules", "0.1")]

View File

@ -35,6 +35,7 @@ using OpenSim.Framework;
using OpenSim.Region.Framework.Scenes; using OpenSim.Region.Framework.Scenes;
using OpenSim.Region.Framework.Scenes.Serialization; using OpenSim.Region.Framework.Scenes.Serialization;
using OpenSim.Tests.Common; using OpenSim.Tests.Common;
using OpenMetaverse.StructuredData;
namespace OpenSim.Region.CoreModules.World.Serialiser.Tests namespace OpenSim.Region.CoreModules.World.Serialiser.Tests
{ {
@ -143,6 +144,7 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests
<Flags>None</Flags> <Flags>None</Flags>
<CollisionSound><Guid>00000000-0000-0000-0000-000000000000</Guid></CollisionSound> <CollisionSound><Guid>00000000-0000-0000-0000-000000000000</Guid></CollisionSound>
<CollisionSoundVolume>0</CollisionSoundVolume> <CollisionSoundVolume>0</CollisionSoundVolume>
<DynAttrs><llsd><map><key>MyStore</key><map><key>the answer</key><integer>42</integer></map></map></llsd></DynAttrs>
</SceneObjectPart> </SceneObjectPart>
</RootPart> </RootPart>
<OtherParts /> <OtherParts />
@ -331,6 +333,7 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests
<EveryoneMask>0</EveryoneMask> <EveryoneMask>0</EveryoneMask>
<NextOwnerMask>2147483647</NextOwnerMask> <NextOwnerMask>2147483647</NextOwnerMask>
<Flags>None</Flags> <Flags>None</Flags>
<DynAttrs><llsd><map><key>MyStore</key><map><key>last words</key><string>Rosebud</string></map></map></llsd></DynAttrs>
<SitTargetAvatar><UUID>00000000-0000-0000-0000-000000000000</UUID></SitTargetAvatar> <SitTargetAvatar><UUID>00000000-0000-0000-0000-000000000000</UUID></SitTargetAvatar>
</SceneObjectPart> </SceneObjectPart>
<OtherParts /> <OtherParts />
@ -359,6 +362,8 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests
Assert.That(rootPart.UUID, Is.EqualTo(new UUID("e6a5a05e-e8cc-4816-8701-04165e335790"))); 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.CreatorID, Is.EqualTo(new UUID("a6dacf01-4636-4bb9-8a97-30609438af9d")));
Assert.That(rootPart.Name, Is.EqualTo("PrimMyRide")); Assert.That(rootPart.Name, Is.EqualTo("PrimMyRide"));
OSDMap store = rootPart.DynAttrs["MyStore"];
Assert.AreEqual(42, store["the answer"].AsInteger());
// TODO: Check other properties // TODO: Check other properties
} }
@ -409,6 +414,14 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests
rp.CreatorID = rpCreatorId; rp.CreatorID = rpCreatorId;
rp.Shape = shape; rp.Shape = shape;
string daStoreName = "MyStore";
string daKey = "foo";
string daValue = "bar";
OSDMap myStore = new OSDMap();
myStore.Add(daKey, daValue);
rp.DynAttrs = new DAMap();
rp.DynAttrs[daStoreName] = myStore;
SceneObjectGroup so = new SceneObjectGroup(rp); SceneObjectGroup so = new SceneObjectGroup(rp);
// Need to add the object to the scene so that the request to get script state succeeds // Need to add the object to the scene so that the request to get script state succeeds
@ -424,6 +437,7 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests
UUID uuid = UUID.Zero; UUID uuid = UUID.Zero;
string name = null; string name = null;
UUID creatorId = UUID.Zero; UUID creatorId = UUID.Zero;
DAMap daMap = null;
while (xtr.Read() && xtr.Name != "SceneObjectPart") while (xtr.Read() && xtr.Name != "SceneObjectPart")
{ {
@ -449,6 +463,10 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests
creatorId = UUID.Parse(xtr.ReadElementString("UUID")); creatorId = UUID.Parse(xtr.ReadElementString("UUID"));
xtr.ReadEndElement(); xtr.ReadEndElement();
break; break;
case "DynAttrs":
daMap = new DAMap();
daMap.ReadXml(xtr);
break;
} }
} }
@ -462,6 +480,8 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests
Assert.That(uuid, Is.EqualTo(rpUuid)); Assert.That(uuid, Is.EqualTo(rpUuid));
Assert.That(name, Is.EqualTo(rpName)); Assert.That(name, Is.EqualTo(rpName));
Assert.That(creatorId, Is.EqualTo(rpCreatorId)); Assert.That(creatorId, Is.EqualTo(rpCreatorId));
Assert.NotNull(daMap);
Assert.AreEqual(daValue, daMap[daStoreName][daKey].AsString());
} }
[Test] [Test]
@ -476,6 +496,8 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests
Assert.That(rootPart.UUID, Is.EqualTo(new UUID("9be68fdd-f740-4a0f-9675-dfbbb536b946"))); Assert.That(rootPart.UUID, Is.EqualTo(new UUID("9be68fdd-f740-4a0f-9675-dfbbb536b946")));
Assert.That(rootPart.CreatorID, Is.EqualTo(new UUID("b46ef588-411e-4a8b-a284-d7dcfe8e74ef"))); Assert.That(rootPart.CreatorID, Is.EqualTo(new UUID("b46ef588-411e-4a8b-a284-d7dcfe8e74ef")));
Assert.That(rootPart.Name, Is.EqualTo("PrimFun")); Assert.That(rootPart.Name, Is.EqualTo("PrimFun"));
OSDMap store = rootPart.DynAttrs["MyStore"];
Assert.AreEqual("Rosebud", store["last words"].AsString());
// TODO: Check other properties // TODO: Check other properties
} }
@ -500,6 +522,14 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests
rp.CreatorID = rpCreatorId; rp.CreatorID = rpCreatorId;
rp.Shape = shape; rp.Shape = shape;
string daStoreName = "MyStore";
string daKey = "foo";
string daValue = "bar";
OSDMap myStore = new OSDMap();
myStore.Add(daKey, daValue);
rp.DynAttrs = new DAMap();
rp.DynAttrs[daStoreName] = myStore;
SceneObjectGroup so = new SceneObjectGroup(rp); SceneObjectGroup so = new SceneObjectGroup(rp);
// Need to add the object to the scene so that the request to get script state succeeds // Need to add the object to the scene so that the request to get script state succeeds
@ -516,6 +546,7 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests
UUID uuid = UUID.Zero; UUID uuid = UUID.Zero;
string name = null; string name = null;
UUID creatorId = UUID.Zero; UUID creatorId = UUID.Zero;
DAMap daMap = null;
while (xtr.Read() && xtr.Name != "SceneObjectPart") while (xtr.Read() && xtr.Name != "SceneObjectPart")
{ {
@ -537,6 +568,10 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests
creatorId = UUID.Parse(xtr.ReadElementString("Guid")); creatorId = UUID.Parse(xtr.ReadElementString("Guid"));
xtr.ReadEndElement(); xtr.ReadEndElement();
break; break;
case "DynAttrs":
daMap = new DAMap();
daMap.ReadXml(xtr);
break;
} }
} }
@ -549,6 +584,8 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests
Assert.That(uuid, Is.EqualTo(rpUuid)); Assert.That(uuid, Is.EqualTo(rpUuid));
Assert.That(name, Is.EqualTo(rpName)); Assert.That(name, Is.EqualTo(rpName));
Assert.That(creatorId, Is.EqualTo(rpCreatorId)); Assert.That(creatorId, Is.EqualTo(rpCreatorId));
Assert.NotNull(daMap);
Assert.AreEqual(daValue, daMap[daStoreName][daKey].AsString());
} }
} }
} }

View File

@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// Build Number // Build Number
// Revision // Revision
// //
[assembly: AssemblyVersion("0.7.5.*")] [assembly: AssemblyVersion("0.7.6.*")]
[assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]

View File

@ -35,6 +35,7 @@ namespace OpenSim.Region.Framework.Interfaces
public interface IJsonStoreModule public interface IJsonStoreModule
{ {
bool AttachObjectStore(UUID objectID);
bool CreateStore(string value, ref UUID result); bool CreateStore(string value, ref UUID result);
bool DestroyStore(UUID storeID); bool DestroyStore(UUID storeID);
bool TestStore(UUID storeID); bool TestStore(UUID storeID);

View File

@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// Build Number // Build Number
// Revision // Revision
// //
[assembly: AssemblyVersion("0.7.5.*")] [assembly: AssemblyVersion("0.7.6.*")]
[assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]

View File

@ -720,7 +720,6 @@ namespace OpenSim.Region.Framework.Scenes
public Scene(RegionInfo regInfo, AgentCircuitManager authen, public Scene(RegionInfo regInfo, AgentCircuitManager authen,
SceneCommunicationService sceneGridService, SceneCommunicationService sceneGridService,
ISimulationDataService simDataService, IEstateDataService estateDataService, ISimulationDataService simDataService, IEstateDataService estateDataService,
bool dumpAssetsToFile,
IConfigSource config, string simulatorVersion) IConfigSource config, string simulatorVersion)
: this(regInfo) : this(regInfo)
{ {
@ -811,8 +810,6 @@ namespace OpenSim.Region.Framework.Scenes
RegisterDefaultSceneEvents(); RegisterDefaultSceneEvents();
DumpAssetsToFile = dumpAssetsToFile;
// XXX: Don't set the public property since we don't want to activate here. This needs to be handled // XXX: Don't set the public property since we don't want to activate here. This needs to be handled
// better in the future. // better in the future.
m_scripts_enabled = !RegionInfo.RegionSettings.DisableScripts; m_scripts_enabled = !RegionInfo.RegionSettings.DisableScripts;
@ -4482,19 +4479,6 @@ namespace OpenSim.Region.Framework.Scenes
#region Script Engine #region Script Engine
private List<ScriptEngineInterface> ScriptEngines = new List<ScriptEngineInterface>();
public bool DumpAssetsToFile;
/// <summary>
///
/// </summary>
/// <param name="scriptEngine"></param>
public void AddScriptEngine(ScriptEngineInterface scriptEngine)
{
ScriptEngines.Add(scriptEngine);
scriptEngine.InitializeEngine(this);
}
private bool ScriptDanger(SceneObjectPart part,Vector3 pos) private bool ScriptDanger(SceneObjectPart part,Vector3 pos)
{ {
ILandObject parcel = LandChannel.GetLandObject(pos.X, pos.Y); ILandObject parcel = LandChannel.GetLandObject(pos.X, pos.Y);

View File

@ -37,6 +37,7 @@ using System.Xml.Serialization;
using log4net; using log4net;
using OpenMetaverse; using OpenMetaverse;
using OpenMetaverse.Packets; using OpenMetaverse.Packets;
using OpenMetaverse.StructuredData;
using OpenSim.Framework; using OpenSim.Framework;
using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Interfaces;
using OpenSim.Region.Framework.Scenes.Scripting; using OpenSim.Region.Framework.Scenes.Scripting;
@ -115,7 +116,7 @@ namespace OpenSim.Region.Framework.Scenes
#endregion Enumerations #endregion Enumerations
public class SceneObjectPart : IScriptHost, ISceneEntity public class SceneObjectPart : ISceneEntity
{ {
/// <value> /// <value>
/// Denote all sides of the prim /// Denote all sides of the prim
@ -124,6 +125,11 @@ namespace OpenSim.Region.Framework.Scenes
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
/// <summary>
/// Dynamic attributes can be created and deleted as required.
/// </summary>
public DAMap DynAttrs { get; set; }
/// <value> /// <value>
/// Is this a root part? /// Is this a root part?
/// </value> /// </value>
@ -297,6 +303,13 @@ namespace OpenSim.Region.Framework.Scenes
protected Vector3 m_lastAngularVelocity; protected Vector3 m_lastAngularVelocity;
protected int m_lastTerseSent; protected int m_lastTerseSent;
protected byte m_physicsShapeType = (byte)PhysShapeType.prim;
// TODO: Implement these
//protected float m_density = 1000.0f; // in kg/m^3
//protected float m_gravitymod = 1.0f;
//protected float m_friction = 0.6f; // wood
//protected float m_bounce = 0.5f; // wood
/// <summary> /// <summary>
/// Stores media texture data /// Stores media texture data
/// </summary> /// </summary>
@ -335,6 +348,7 @@ namespace OpenSim.Region.Framework.Scenes
m_particleSystem = Utils.EmptyBytes; m_particleSystem = Utils.EmptyBytes;
Rezzed = DateTime.UtcNow; Rezzed = DateTime.UtcNow;
Description = String.Empty; Description = String.Empty;
DynAttrs = new DAMap();
// Prims currently only contain a single folder (Contents). From looking at the Second Life protocol, // Prims currently only contain a single folder (Contents). From looking at the Second Life protocol,
// this appears to have the same UUID (!) as the prim. If this isn't the case, one can't drag items from // this appears to have the same UUID (!) as the prim. If this isn't the case, one can't drag items from
@ -1315,6 +1329,69 @@ namespace OpenSim.Region.Framework.Scenes
set { m_collisionSoundVolume = value; } set { m_collisionSoundVolume = value; }
} }
public byte DefaultPhysicsShapeType()
{
byte type;
if (Shape != null && (Shape.SculptType == (byte)SculptType.Mesh))
type = (byte)PhysShapeType.convex;
else
type = (byte)PhysShapeType.prim;
return type;
}
public byte PhysicsShapeType
{
get { return m_physicsShapeType; }
set
{
byte oldv = m_physicsShapeType;
if (value >= 0 && value <= (byte)PhysShapeType.convex)
{
if (value == (byte)PhysShapeType.none && ParentGroup != null && ParentGroup.RootPart == this)
m_physicsShapeType = DefaultPhysicsShapeType();
else
m_physicsShapeType = value;
}
else
m_physicsShapeType = DefaultPhysicsShapeType();
if (m_physicsShapeType != oldv && ParentGroup != null)
{
if (m_physicsShapeType == (byte)PhysShapeType.none)
{
if (PhysActor != null)
{
Velocity = new Vector3(0, 0, 0);
Acceleration = new Vector3(0, 0, 0);
if (ParentGroup.RootPart == this)
AngularVelocity = new Vector3(0, 0, 0);
ParentGroup.Scene.RemovePhysicalPrim(1);
RemoveFromPhysics();
}
}
else if (PhysActor == null)
{
ApplyPhysics((uint)Flags, VolumeDetectActive);
}
else
{
// TODO: Update physics actor
}
if (ParentGroup != null)
ParentGroup.HasGroupChanged = true;
}
}
}
public float Density { get; set; }
public float GravityModifier { get; set; }
public float Friction { get; set; }
public float Restitution { get; set; }
#endregion Public Properties with only Get #endregion Public Properties with only Get
private uint ApplyMask(uint val, bool set, uint mask) private uint ApplyMask(uint val, bool set, uint mask)
@ -1516,9 +1593,8 @@ namespace OpenSim.Region.Framework.Scenes
if (!ParentGroup.Scene.CollidablePrims) if (!ParentGroup.Scene.CollidablePrims)
return; return;
// m_log.DebugFormat( if (PhysicsShapeType == (byte)PhysShapeType.none)
// "[SCENE OBJECT PART]: Applying physics to {0} {1}, m_physicalPrim {2}", return;
// Name, LocalId, UUID, m_physicalPrim);
bool isPhysical = (rootObjectFlags & (uint) PrimFlags.Physics) != 0; bool isPhysical = (rootObjectFlags & (uint) PrimFlags.Physics) != 0;
bool isPhantom = (rootObjectFlags & (uint) PrimFlags.Phantom) != 0; bool isPhantom = (rootObjectFlags & (uint) PrimFlags.Phantom) != 0;
@ -1618,6 +1694,8 @@ namespace OpenSim.Region.Framework.Scenes
Array.Copy(Shape.ExtraParams, extraP, extraP.Length); Array.Copy(Shape.ExtraParams, extraP, extraP.Length);
dupe.Shape.ExtraParams = extraP; dupe.Shape.ExtraParams = extraP;
dupe.DynAttrs.CopyFrom(DynAttrs);
if (userExposed) if (userExposed)
{ {
/* /*
@ -3869,6 +3947,26 @@ namespace OpenSim.Region.Framework.Scenes
} }
} }
public void UpdateExtraPhysics(ExtraPhysicsData physdata)
{
if (physdata.PhysShapeType == PhysShapeType.invalid || ParentGroup == null)
return;
if (PhysicsShapeType != (byte)physdata.PhysShapeType)
{
PhysicsShapeType = (byte)physdata.PhysShapeType;
}
if(Density != physdata.Density)
Density = physdata.Density;
if(GravityModifier != physdata.GravitationModifier)
GravityModifier = physdata.GravitationModifier;
if(Friction != physdata.Friction)
Friction = physdata.Friction;
if(Restitution != physdata.Bounce)
Restitution = physdata.Bounce;
}
/// <summary> /// <summary>
/// Update the flags on this prim. This covers properties such as phantom, physics and temporary. /// Update the flags on this prim. This covers properties such as phantom, physics and temporary.
/// </summary> /// </summary>
@ -3940,6 +4038,7 @@ namespace OpenSim.Region.Framework.Scenes
if (SetPhantom if (SetPhantom
|| ParentGroup.IsAttachment || ParentGroup.IsAttachment
|| PhysicsShapeType == (byte)PhysShapeType.none
|| (Shape.PathCurve == (byte)Extrusion.Flexible)) // note: this may have been changed above in the case of joints || (Shape.PathCurve == (byte)Extrusion.Flexible)) // note: this may have been changed above in the case of joints
{ {
AddFlag(PrimFlags.Phantom); AddFlag(PrimFlags.Phantom);

View File

@ -1,91 +0,0 @@
/*
* Copyright (c) Contributors, http://opensimulator.org/
* See CONTRIBUTORS.TXT for a full list of copyright holders.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the OpenSimulator Project nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
using System;
using OpenMetaverse;
using log4net;
using System.Reflection;
using OpenSim.Framework;
namespace OpenSim.Region.Framework.Scenes.Scripting
{
public class NullScriptHost : IScriptHost
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private Vector3 m_pos = new Vector3(((int)Constants.RegionSize * 0.5f), ((int)Constants.RegionSize * 0.5f), 30);
public string Name
{
get { return "Object"; }
set { }
}
public string SitName
{
get { return String.Empty; }
set { }
}
public string TouchName
{
get { return String.Empty; }
set { }
}
public string Description
{
get { return String.Empty; }
set { }
}
public UUID UUID
{
get { return UUID.Zero; }
}
public UUID OwnerID
{
get { return UUID.Zero; }
}
public UUID CreatorID
{
get { return UUID.Zero; }
}
public Vector3 AbsolutePosition
{
get { return m_pos; }
}
public void SetText(string text, Vector3 color, double alpha)
{
m_log.Warn("Tried to SetText "+text+" on NullScriptHost");
}
}
}

View File

@ -1,38 +0,0 @@
/*
* Copyright (c) Contributors, http://opensimulator.org/
* See CONTRIBUTORS.TXT for a full list of copyright holders.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the OpenSimulator Project nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
//TODO: WHERE TO PLACE THIS?
namespace OpenSim.Region.Framework.Scenes.Scripting
{
public interface ScriptEngineInterface
{
void InitializeEngine(Scene Sceneworld);
void Shutdown();
// void StartScript(string ScriptID, IScriptHost ObjectID);
}
}

View File

@ -1,119 +0,0 @@
/*
* Copyright (c) Contributors, http://opensimulator.org/
* See CONTRIBUTORS.TXT for a full list of copyright holders.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the OpenSimulator Project nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/* Original code: Tedd Hansen */
using System;
using System.IO;
using System.Reflection;
using log4net;
namespace OpenSim.Region.Framework.Scenes.Scripting
{
public class ScriptEngineLoader
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
public ScriptEngineInterface LoadScriptEngine(string EngineName)
{
ScriptEngineInterface ret = null;
try
{
ret =
LoadAndInitAssembly(
Path.Combine("ScriptEngines", "OpenSim.Region.ScriptEngine." + EngineName + ".dll"),
"OpenSim.Region.ScriptEngine." + EngineName + ".ScriptEngine");
}
catch (Exception e)
{
m_log.Error("[ScriptEngine]: " +
"Error loading assembly \"" + EngineName + "\": " + e.Message + ", " +
e.StackTrace.ToString());
}
return ret;
}
/// <summary>
/// Does actual loading and initialization of script Assembly
/// </summary>
/// <param name="FreeAppDomain">AppDomain to load script into</param>
/// <param name="FileName">FileName of script assembly (.dll)</param>
/// <returns></returns>
private ScriptEngineInterface LoadAndInitAssembly(string FileName, string NameSpace)
{
//Common.SendToDebug("Loading ScriptEngine Assembly " + FileName);
// Load .Net Assembly (.dll)
// Initialize and return it
// TODO: Add error handling
Assembly a;
//try
//{
// Load to default appdomain (temporary)
a = Assembly.LoadFrom(FileName);
// Load to specified appdomain
// TODO: Insert security
//a = FreeAppDomain.Load(FileName);
//}
//catch (Exception e)
//{
// m_log.Error("[ScriptEngine]: Error loading assembly \String.Empty + FileName + "\": " + e.ToString());
//}
//m_log.Debug("Loading: " + FileName);
//foreach (Type _t in a.GetTypes())
//{
// m_log.Debug("Type: " + _t.ToString());
//}
Type t;
//try
//{
t = a.GetType(NameSpace, true);
//}
//catch (Exception e)
//{
// m_log.Error("[ScriptEngine]: Error initializing type \String.Empty + NameSpace + "\" from \String.Empty + FileName + "\": " + e.ToString());
//}
ScriptEngineInterface ret;
//try
//{
ret = (ScriptEngineInterface) Activator.CreateInstance(t);
//}
//catch (Exception e)
//{
// m_log.Error("[ScriptEngine]: Error initializing type \String.Empty + NameSpace + "\" from \String.Empty + FileName + "\": " + e.ToString());
//}
return ret;
}
}
}

View File

@ -0,0 +1,107 @@
/*
* 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 OpenMetaverse;
using OpenSim.Framework;
namespace OpenSim.Region.Framework.Scenes.Scripting
{
/// <summary>
/// Utility functions for use by scripts manipulating the scene.
/// </summary>
public static class ScriptUtils
{
/// <summary>
/// Get an asset id given an item name and an item type.
/// </summary>
/// <returns>UUID.Zero if the name and type did not match any item.</returns>
/// <param name='part'></param>
/// <param name='name'></param>
/// <param name='type'></param>
public static UUID GetAssetIdFromItemName(SceneObjectPart part, string name, int type)
{
TaskInventoryItem item = part.Inventory.GetInventoryItem(name);
if (item != null && item.Type == type)
return item.AssetID;
else
return UUID.Zero;
}
/// <summary>
/// accepts a valid UUID, -or- a name of an inventory item.
/// Returns a valid UUID or UUID.Zero if key invalid and item not found
/// in prim inventory.
/// </summary>
/// <param name="part">Scene object part to search for inventory item</param>
/// <param name="key"></param>
/// <returns></returns>
public static UUID GetAssetIdFromKeyOrItemName(SceneObjectPart part, string identifier)
{
UUID key;
// if we can parse the string as a key, use it.
// else try to locate the name in inventory of object. found returns key,
// not found returns UUID.Zero
if (!UUID.TryParse(identifier, out key))
{
TaskInventoryItem item = part.Inventory.GetInventoryItem(identifier);
if (item != null)
key = item.AssetID;
else
key = UUID.Zero;
}
return key;
}
/// <summary>
/// Return the UUID of the asset matching the specified key or name
/// and asset type.
/// </summary>
/// <param name="part">Scene object part to search for inventory item</param>
/// <param name="identifier"></param>
/// <param name="type"></param>
/// <returns></returns>
public static UUID GetAssetIdFromKeyOrItemName(SceneObjectPart part, string identifier, AssetType type)
{
UUID key;
if (!UUID.TryParse(identifier, out key))
{
TaskInventoryItem item = part.Inventory.GetInventoryItem(identifier);
if (item != null && item.Type == (int)type)
key = item.AssetID;
}
return key;
}
}
}

View File

@ -359,6 +359,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
m_SOPXmlProcessors.Add("CollisionSound", ProcessCollisionSound); m_SOPXmlProcessors.Add("CollisionSound", ProcessCollisionSound);
m_SOPXmlProcessors.Add("CollisionSoundVolume", ProcessCollisionSoundVolume); m_SOPXmlProcessors.Add("CollisionSoundVolume", ProcessCollisionSoundVolume);
m_SOPXmlProcessors.Add("MediaUrl", ProcessMediaUrl); m_SOPXmlProcessors.Add("MediaUrl", ProcessMediaUrl);
m_SOPXmlProcessors.Add("DynAttrs", ProcessDynAttrs);
m_SOPXmlProcessors.Add("TextureAnimation", ProcessTextureAnimation); m_SOPXmlProcessors.Add("TextureAnimation", ProcessTextureAnimation);
m_SOPXmlProcessors.Add("ParticleSystem", ProcessParticleSystem); m_SOPXmlProcessors.Add("ParticleSystem", ProcessParticleSystem);
m_SOPXmlProcessors.Add("PayPrice0", ProcessPayPrice0); m_SOPXmlProcessors.Add("PayPrice0", ProcessPayPrice0);
@ -366,6 +367,13 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
m_SOPXmlProcessors.Add("PayPrice2", ProcessPayPrice2); m_SOPXmlProcessors.Add("PayPrice2", ProcessPayPrice2);
m_SOPXmlProcessors.Add("PayPrice3", ProcessPayPrice3); m_SOPXmlProcessors.Add("PayPrice3", ProcessPayPrice3);
m_SOPXmlProcessors.Add("PayPrice4", ProcessPayPrice4); m_SOPXmlProcessors.Add("PayPrice4", ProcessPayPrice4);
m_SOPXmlProcessors.Add("PhysicsShapeType", ProcessPhysicsShapeType);
m_SOPXmlProcessors.Add("Density", ProcessDensity);
m_SOPXmlProcessors.Add("Friction", ProcessFriction);
m_SOPXmlProcessors.Add("Bounce", ProcessBounce);
m_SOPXmlProcessors.Add("GravityModifier", ProcessGravityModifier);
#endregion #endregion
#region TaskInventoryXmlProcessors initialization #region TaskInventoryXmlProcessors initialization
@ -593,6 +601,31 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
obj.ClickAction = (byte)reader.ReadElementContentAsInt("ClickAction", String.Empty); obj.ClickAction = (byte)reader.ReadElementContentAsInt("ClickAction", String.Empty);
} }
private static void ProcessPhysicsShapeType(SceneObjectPart obj, XmlTextReader reader)
{
obj.PhysicsShapeType = (byte)reader.ReadElementContentAsInt("PhysicsShapeType", String.Empty);
}
private static void ProcessDensity(SceneObjectPart obj, XmlTextReader reader)
{
obj.Density = reader.ReadElementContentAsFloat("Density", String.Empty);
}
private static void ProcessFriction(SceneObjectPart obj, XmlTextReader reader)
{
obj.Friction = reader.ReadElementContentAsFloat("Friction", String.Empty);
}
private static void ProcessBounce(SceneObjectPart obj, XmlTextReader reader)
{
obj.Restitution = reader.ReadElementContentAsFloat("Bounce", String.Empty);
}
private static void ProcessGravityModifier(SceneObjectPart obj, XmlTextReader reader)
{
obj.GravityModifier = reader.ReadElementContentAsFloat("GravityModifier", String.Empty);
}
private static void ProcessShape(SceneObjectPart obj, XmlTextReader reader) private static void ProcessShape(SceneObjectPart obj, XmlTextReader reader)
{ {
List<string> errorNodeNames; List<string> errorNodeNames;
@ -722,6 +755,11 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
obj.MediaUrl = reader.ReadElementContentAsString("MediaUrl", String.Empty); obj.MediaUrl = reader.ReadElementContentAsString("MediaUrl", String.Empty);
} }
private static void ProcessDynAttrs(SceneObjectPart obj, XmlTextReader reader)
{
obj.DynAttrs.ReadXml(reader);
}
private static void ProcessTextureAnimation(SceneObjectPart obj, XmlTextReader reader) private static void ProcessTextureAnimation(SceneObjectPart obj, XmlTextReader reader)
{ {
obj.TextureAnimation = Convert.FromBase64String(reader.ReadElementContentAsString("TextureAnimation", String.Empty)); obj.TextureAnimation = Convert.FromBase64String(reader.ReadElementContentAsString("TextureAnimation", String.Empty));
@ -1235,6 +1273,14 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
writer.WriteElementString("CollisionSoundVolume", sop.CollisionSoundVolume.ToString()); writer.WriteElementString("CollisionSoundVolume", sop.CollisionSoundVolume.ToString());
if (sop.MediaUrl != null) if (sop.MediaUrl != null)
writer.WriteElementString("MediaUrl", sop.MediaUrl.ToString()); writer.WriteElementString("MediaUrl", sop.MediaUrl.ToString());
if (sop.DynAttrs.Count > 0)
{
writer.WriteStartElement("DynAttrs");
sop.DynAttrs.WriteXml(writer);
writer.WriteEndElement();
}
WriteBytes(writer, "TextureAnimation", sop.TextureAnimation); WriteBytes(writer, "TextureAnimation", sop.TextureAnimation);
WriteBytes(writer, "ParticleSystem", sop.ParticleSystem); WriteBytes(writer, "ParticleSystem", sop.ParticleSystem);
writer.WriteElementString("PayPrice0", sop.PayPrice[0].ToString()); writer.WriteElementString("PayPrice0", sop.PayPrice[0].ToString());
@ -1243,6 +1289,17 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
writer.WriteElementString("PayPrice3", sop.PayPrice[3].ToString()); writer.WriteElementString("PayPrice3", sop.PayPrice[3].ToString());
writer.WriteElementString("PayPrice4", sop.PayPrice[4].ToString()); writer.WriteElementString("PayPrice4", sop.PayPrice[4].ToString());
if(sop.PhysicsShapeType != sop.DefaultPhysicsShapeType())
writer.WriteElementString("PhysicsShapeType", sop.PhysicsShapeType.ToString().ToLower());
if (sop.Density != 1000.0f)
writer.WriteElementString("Density", sop.Density.ToString().ToLower());
if (sop.Friction != 0.6f)
writer.WriteElementString("Friction", sop.Friction.ToString().ToLower());
if (sop.Restitution != 0.5f)
writer.WriteElementString("Bounce", sop.Restitution.ToString().ToLower());
if (sop.GravityModifier != 1.0f)
writer.WriteElementString("GravityModifier", sop.GravityModifier.ToString().ToLower());
writer.WriteEndElement(); writer.WriteEndElement();
} }

View File

@ -30,7 +30,7 @@ using Mono.Addins;
// Build Number // Build Number
// Revision // Revision
// //
[assembly: AssemblyVersion("0.7.5.*")] [assembly: AssemblyVersion("0.7.6.*")]
[assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: Addin("OpenSim.Region.OptionalModules", "0.1")] [assembly: Addin("OpenSim.Region.OptionalModules", "0.1")]

View File

@ -49,7 +49,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
private static readonly ILog m_log = private static readonly ILog m_log =
LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private OSD m_ValueStore; protected virtual OSD ValueStore { get; set; }
protected class TakeValueCallbackClass protected class TakeValueCallbackClass
{ {
@ -108,17 +108,18 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
/// ///
/// </summary> /// </summary>
// ----------------------------------------------------------------- // -----------------------------------------------------------------
public JsonStore() : this("") {} public JsonStore()
public JsonStore(string value)
{ {
m_TakeStore = new List<TakeValueCallbackClass>(); m_TakeStore = new List<TakeValueCallbackClass>();
m_ReadStore = new List<TakeValueCallbackClass>(); m_ReadStore = new List<TakeValueCallbackClass>();
}
public JsonStore(string value)
{
if (String.IsNullOrEmpty(value)) if (String.IsNullOrEmpty(value))
m_ValueStore = new OSDMap(); ValueStore = new OSDMap();
else else
m_ValueStore = OSDParser.DeserializeJson(value); ValueStore = OSDParser.DeserializeJson(value);
} }
// ----------------------------------------------------------------- // -----------------------------------------------------------------
@ -129,7 +130,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
public bool TestPath(string expr, bool useJson) public bool TestPath(string expr, bool useJson)
{ {
Stack<string> path = ParsePathExpression(expr); Stack<string> path = ParsePathExpression(expr);
OSD result = ProcessPathExpression(m_ValueStore,path); OSD result = ProcessPathExpression(ValueStore,path);
if (result == null) if (result == null)
return false; return false;
@ -148,7 +149,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
public bool GetValue(string expr, out string value, bool useJson) public bool GetValue(string expr, out string value, bool useJson)
{ {
Stack<string> path = ParsePathExpression(expr); Stack<string> path = ParsePathExpression(expr);
OSD result = ProcessPathExpression(m_ValueStore,path); OSD result = ProcessPathExpression(ValueStore,path);
return ConvertOutputValue(result,out value,useJson); return ConvertOutputValue(result,out value,useJson);
} }
@ -184,7 +185,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
Stack<string> path = ParsePathExpression(expr); Stack<string> path = ParsePathExpression(expr);
string pexpr = PathExpressionToKey(path); string pexpr = PathExpressionToKey(path);
OSD result = ProcessPathExpression(m_ValueStore,path); OSD result = ProcessPathExpression(ValueStore,path);
if (result == null) if (result == null)
{ {
m_TakeStore.Add(new TakeValueCallbackClass(pexpr,useJson,cback)); m_TakeStore.Add(new TakeValueCallbackClass(pexpr,useJson,cback));
@ -215,7 +216,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
Stack<string> path = ParsePathExpression(expr); Stack<string> path = ParsePathExpression(expr);
string pexpr = PathExpressionToKey(path); string pexpr = PathExpressionToKey(path);
OSD result = ProcessPathExpression(m_ValueStore,path); OSD result = ProcessPathExpression(ValueStore,path);
if (result == null) if (result == null)
{ {
m_ReadStore.Add(new TakeValueCallbackClass(pexpr,useJson,cback)); m_ReadStore.Add(new TakeValueCallbackClass(pexpr,useJson,cback));
@ -245,7 +246,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
Stack<string> path = ParsePathExpression(expr); Stack<string> path = ParsePathExpression(expr);
if (path.Count == 0) if (path.Count == 0)
{ {
m_ValueStore = ovalue; ValueStore = ovalue;
return true; return true;
} }
@ -254,7 +255,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
if (pexpr != "") if (pexpr != "")
pexpr += "."; pexpr += ".";
OSD result = ProcessPathExpression(m_ValueStore,path); OSD result = ProcessPathExpression(ValueStore,path);
if (result == null) if (result == null)
return false; return false;
@ -522,4 +523,41 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
return pkey; return pkey;
} }
} }
public class JsonObjectStore : JsonStore
{
private static readonly ILog m_log =
LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private Scene m_scene;
private UUID m_objectID;
protected override OSD ValueStore
{
get
{
SceneObjectPart sop = m_scene.GetSceneObjectPart(m_objectID);
if (sop == null)
{
// This is bad
return null;
}
return sop.DynAttrs.TopLevelMap;
}
// cannot set the top level
set
{
m_log.InfoFormat("[JsonStore] cannot set top level value in object store");
}
}
public JsonObjectStore(Scene scene, UUID oid) : base()
{
m_scene = scene;
m_objectID = oid;
}
}
} }

View File

@ -170,6 +170,34 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
#region ScriptInvocationInteface #region ScriptInvocationInteface
// -----------------------------------------------------------------
/// <summary>
///
/// </summary>
// -----------------------------------------------------------------
public bool AttachObjectStore(UUID objectID)
{
if (! m_enabled) return false;
SceneObjectPart sop = m_scene.GetSceneObjectPart(objectID);
if (sop == null)
{
m_log.InfoFormat("[JsonStore] unable to attach to unknown object; {0}",objectID);
return false;
}
lock (m_JsonValueStore)
{
if (m_JsonValueStore.ContainsKey(objectID))
return true;
JsonStore map = new JsonObjectStore(m_scene,objectID);
m_JsonValueStore.Add(objectID,map);
}
return true;
}
// ----------------------------------------------------------------- // -----------------------------------------------------------------
/// <summary> /// <summary>
/// ///

View File

@ -39,6 +39,7 @@ using OpenMetaverse.StructuredData;
using OpenSim.Framework; using OpenSim.Framework;
using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Interfaces;
using OpenSim.Region.Framework.Scenes; using OpenSim.Region.Framework.Scenes;
using OpenSim.Region.Framework.Scenes.Scripting;
using System.Collections.Generic; using System.Collections.Generic;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
@ -168,6 +169,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
m_comms.RegisterScriptInvocations(this); m_comms.RegisterScriptInvocations(this);
// m_comms.RegisterScriptInvocation(this, "JsonCreateStore"); // m_comms.RegisterScriptInvocation(this, "JsonCreateStore");
// m_comms.RegisterScriptInvocation(this, "JsonAttachObjectStore");
// m_comms.RegisterScriptInvocation(this, "JsonDestroyStore"); // m_comms.RegisterScriptInvocation(this, "JsonDestroyStore");
// m_comms.RegisterScriptInvocation(this, "JsonTestStore"); // m_comms.RegisterScriptInvocation(this, "JsonTestStore");
@ -213,6 +215,21 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
#endregion #endregion
#region ScriptInvocationInteface #region ScriptInvocationInteface
// -----------------------------------------------------------------
/// <summary>
///
/// </summary>
// -----------------------------------------------------------------
[ScriptInvocation]
public UUID JsonAttachObjectStore(UUID hostID, UUID scriptID)
{
UUID uuid = UUID.Zero;
if (! m_store.AttachObjectStore(hostID))
GenerateRuntimeError("Failed to create Json store");
return hostID;
}
// ----------------------------------------------------------------- // -----------------------------------------------------------------
/// <summary> /// <summary>
/// ///
@ -256,10 +273,10 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
/// </summary> /// </summary>
// ----------------------------------------------------------------- // -----------------------------------------------------------------
[ScriptInvocation] [ScriptInvocation]
public UUID JsonReadNotecard(UUID hostID, UUID scriptID, UUID storeID, string path, UUID assetID) public UUID JsonReadNotecard(UUID hostID, UUID scriptID, UUID storeID, string path, string notecardIdentifier)
{ {
UUID reqID = UUID.Random(); UUID reqID = UUID.Random();
Util.FireAndForget(delegate(object o) { DoJsonReadNotecard(reqID,hostID,scriptID,storeID,path,assetID); }); Util.FireAndForget(o => DoJsonReadNotecard(reqID, hostID, scriptID, storeID, path, notecardIdentifier));
return reqID; return reqID;
} }
@ -463,14 +480,23 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
/// ///
/// </summary> /// </summary>
// ----------------------------------------------------------------- // -----------------------------------------------------------------
private void DoJsonReadNotecard(UUID reqID, UUID hostID, UUID scriptID, UUID storeID, string path, UUID assetID) private void DoJsonReadNotecard(
UUID reqID, UUID hostID, UUID scriptID, UUID storeID, string path, string notecardIdentifier)
{ {
UUID assetID;
if (!UUID.TryParse(notecardIdentifier, out assetID))
{
SceneObjectPart part = m_scene.GetSceneObjectPart(hostID);
assetID = ScriptUtils.GetAssetIdFromItemName(part, notecardIdentifier, (int)AssetType.Notecard);
}
AssetBase a = m_scene.AssetService.Get(assetID.ToString()); AssetBase a = m_scene.AssetService.Get(assetID.ToString());
if (a == null) if (a == null)
GenerateRuntimeError(String.Format("Unable to find notecard asset {0}",assetID)); GenerateRuntimeError(String.Format("Unable to find notecard asset {0}", assetID));
if (a.Type != (sbyte)AssetType.Notecard) if (a.Type != (sbyte)AssetType.Notecard)
GenerateRuntimeError(String.Format("Invalid notecard asset {0}",assetID)); GenerateRuntimeError(String.Format("Invalid notecard asset {0}", assetID));
m_log.DebugFormat("[JsonStoreScripts]: read notecard in context {0}",storeID); m_log.DebugFormat("[JsonStoreScripts]: read notecard in context {0}",storeID);
@ -483,11 +509,11 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
} }
catch (Exception e) catch (Exception e)
{ {
m_log.WarnFormat("[JsonStoreScripts]: Json parsing failed; {0}",e.Message); m_log.WarnFormat("[JsonStoreScripts]: Json parsing failed; {0}", e.Message);
} }
GenerateRuntimeError(String.Format("Json parsing failed for {0}",assetID.ToString())); GenerateRuntimeError(String.Format("Json parsing failed for {0}", assetID));
m_comms.DispatchReply(scriptID,0,"",reqID.ToString()); m_comms.DispatchReply(scriptID, 0, "", reqID.ToString());
} }
// ----------------------------------------------------------------- // -----------------------------------------------------------------

View File

@ -54,6 +54,22 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore.Tests
private MockScriptEngine m_engine; private MockScriptEngine m_engine;
private ScriptModuleCommsModule m_smcm; private ScriptModuleCommsModule m_smcm;
[TestFixtureSetUp]
public void FixtureInit()
{
// Don't allow tests to be bamboozled by asynchronous events. Execute everything on the same thread.
Util.FireAndForgetMethod = FireAndForgetMethod.RegressionTest;
}
[TestFixtureTearDown]
public void TearDown()
{
// We must set this back afterwards, otherwise later tests will fail since they're expecting multiple
// threads. Possibly, later tests should be rewritten so none of them require async stuff (which regression
// tests really shouldn't).
Util.FireAndForgetMethod = Util.DefaultFireAndForgetMethod;
}
[SetUp] [SetUp]
public override void SetUp() public override void SetUp()
{ {
@ -85,7 +101,12 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore.Tests
private object InvokeOp(string name, params object[] args) private object InvokeOp(string name, params object[] args)
{ {
return m_smcm.InvokeOperation(UUID.Zero, UUID.Zero, name, args); return InvokeOpOnHost(name, UUID.Zero, args);
}
private object InvokeOpOnHost(string name, UUID hostId, params object[] args)
{
return m_smcm.InvokeOperation(hostId, UUID.Zero, name, args);
} }
[Test] [Test]
@ -193,6 +214,44 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore.Tests
Assert.That(value, Is.EqualTo("World")); Assert.That(value, Is.EqualTo("World"));
} }
/// <summary>
/// Test for reading and writing json to a notecard
/// </summary>
/// <remarks>
/// TODO: Really needs to test correct receipt of the link_message event. Could do this by directly fetching
/// it via the MockScriptEngine or perhaps by a dummy script instance.
/// </remarks>
[Test]
public void TestJsonWriteReadNotecard()
{
TestHelpers.InMethod();
TestHelpers.EnableLogging();
string notecardName = "nc1";
SceneObjectGroup so = SceneHelpers.CreateSceneObject(1, TestHelpers.ParseTail(0x1));
m_scene.AddSceneObject(so);
UUID storeId = (UUID)InvokeOp("JsonCreateStore", "{ 'Hello':'World' }");
// Write notecard
UUID writeNotecardRequestId = (UUID)InvokeOpOnHost("JsonWriteNotecard", so.UUID, storeId, "/", notecardName);
Assert.That(writeNotecardRequestId, Is.Not.EqualTo(UUID.Zero));
TaskInventoryItem nc1Item = so.RootPart.Inventory.GetInventoryItem(notecardName);
Assert.That(nc1Item, Is.Not.Null);
// TODO: Should probably independently check the contents.
// Read notecard
UUID receivingStoreId = (UUID)InvokeOp("JsonCreateStore", "{ 'Hello':'World' }");
UUID readNotecardRequestId = (UUID)InvokeOpOnHost("JsonReadNotecard", so.UUID, receivingStoreId, "/", notecardName);
Assert.That(readNotecardRequestId, Is.Not.EqualTo(UUID.Zero));
string value = (string)InvokeOp("JsonGetValue", storeId, "Hello");
Assert.That(value, Is.EqualTo("World"));
}
public object DummyTestMethod(object o1, object o2, object o3, object o4, object o5) { return null; } public object DummyTestMethod(object o1, object o2, object o3, object o4, object o5) { return null; }
} }
} }

View File

@ -55,4 +55,4 @@ using System.Runtime.InteropServices;
// You can specify all values by your own or you can build default build and revision // You can specify all values by your own or you can build default build and revision
// numbers with the '*' character (the default): // numbers with the '*' character (the default):
[assembly : AssemblyVersion("0.7.5.*")] [assembly : AssemblyVersion("0.7.6.*")]

View File

@ -1088,7 +1088,7 @@ private sealed class BulletConstraintXNA : BulletConstraint
{ {
CollisionWorld.WorldData.ParamData p = new CollisionWorld.WorldData.ParamData(); CollisionWorld.WorldData.ParamData p = new CollisionWorld.WorldData.ParamData();
p.angularDamping = o[0].XangularDamping; p.angularDamping = BSParam.AngularDamping;
p.defaultFriction = o[0].defaultFriction; p.defaultFriction = o[0].defaultFriction;
p.defaultFriction = o[0].defaultFriction; p.defaultFriction = o[0].defaultFriction;
p.defaultDensity = o[0].defaultDensity; p.defaultDensity = o[0].defaultDensity;
@ -1096,32 +1096,32 @@ private sealed class BulletConstraintXNA : BulletConstraint
p.collisionMargin = o[0].collisionMargin; p.collisionMargin = o[0].collisionMargin;
p.gravity = o[0].gravity; p.gravity = o[0].gravity;
p.linearDamping = o[0].XlinearDamping; p.linearDamping = BSParam.LinearDamping;
p.angularDamping = o[0].XangularDamping; p.angularDamping = BSParam.AngularDamping;
p.deactivationTime = o[0].XdeactivationTime; p.deactivationTime = BSParam.DeactivationTime;
p.linearSleepingThreshold = o[0].XlinearSleepingThreshold; p.linearSleepingThreshold = BSParam.LinearSleepingThreshold;
p.angularSleepingThreshold = o[0].XangularSleepingThreshold; p.angularSleepingThreshold = BSParam.AngularSleepingThreshold;
p.ccdMotionThreshold = o[0].XccdMotionThreshold; p.ccdMotionThreshold = BSParam.CcdMotionThreshold;
p.ccdSweptSphereRadius = o[0].XccdSweptSphereRadius; p.ccdSweptSphereRadius = BSParam.CcdSweptSphereRadius;
p.contactProcessingThreshold = o[0].XcontactProcessingThreshold; p.contactProcessingThreshold = BSParam.ContactProcessingThreshold;
p.terrainImplementation = o[0].XterrainImplementation; p.terrainImplementation = BSParam.TerrainImplementation;
p.terrainFriction = o[0].XterrainFriction; p.terrainFriction = BSParam.TerrainFriction;
p.terrainHitFraction = o[0].XterrainHitFraction; p.terrainHitFraction = BSParam.TerrainHitFraction;
p.terrainRestitution = o[0].XterrainRestitution; p.terrainRestitution = BSParam.TerrainRestitution;
p.terrainCollisionMargin = o[0].XterrainCollisionMargin; p.terrainCollisionMargin = BSParam.TerrainCollisionMargin;
p.avatarFriction = o[0].XavatarFriction; p.avatarFriction = BSParam.AvatarFriction;
p.avatarStandingFriction = o[0].XavatarStandingFriction; p.avatarStandingFriction = BSParam.AvatarStandingFriction;
p.avatarDensity = o[0].XavatarDensity; p.avatarDensity = BSParam.AvatarDensity;
p.avatarRestitution = o[0].XavatarRestitution; p.avatarRestitution = BSParam.AvatarRestitution;
p.avatarCapsuleWidth = o[0].XavatarCapsuleWidth; p.avatarCapsuleWidth = BSParam.AvatarCapsuleWidth;
p.avatarCapsuleDepth = o[0].XavatarCapsuleDepth; p.avatarCapsuleDepth = BSParam.AvatarCapsuleDepth;
p.avatarCapsuleHeight = o[0].XavatarCapsuleHeight; p.avatarCapsuleHeight = BSParam.AvatarCapsuleHeight;
p.avatarContactProcessingThreshold = o[0].XavatarContactProcessingThreshold; p.avatarContactProcessingThreshold = BSParam.AvatarContactProcessingThreshold;
p.vehicleAngularDamping = o[0].XvehicleAngularDamping; p.vehicleAngularDamping = BSParam.VehicleAngularDamping;
p.maxPersistantManifoldPoolSize = o[0].maxPersistantManifoldPoolSize; p.maxPersistantManifoldPoolSize = o[0].maxPersistantManifoldPoolSize;
p.maxCollisionAlgorithmPoolSize = o[0].maxCollisionAlgorithmPoolSize; p.maxCollisionAlgorithmPoolSize = o[0].maxCollisionAlgorithmPoolSize;
@ -1132,15 +1132,15 @@ private sealed class BulletConstraintXNA : BulletConstraint
p.shouldEnableFrictionCaching = o[0].shouldEnableFrictionCaching; p.shouldEnableFrictionCaching = o[0].shouldEnableFrictionCaching;
p.numberOfSolverIterations = o[0].numberOfSolverIterations; p.numberOfSolverIterations = o[0].numberOfSolverIterations;
p.linksetImplementation = o[0].XlinksetImplementation; p.linksetImplementation = BSParam.LinksetImplementation;
p.linkConstraintUseFrameOffset = o[0].XlinkConstraintUseFrameOffset; p.linkConstraintUseFrameOffset = BSParam.LinkConstraintUseFrameOffset;
p.linkConstraintEnableTransMotor = o[0].XlinkConstraintEnableTransMotor; p.linkConstraintEnableTransMotor = BSParam.LinkConstraintEnableTransMotor;
p.linkConstraintTransMotorMaxVel = o[0].XlinkConstraintTransMotorMaxVel; p.linkConstraintTransMotorMaxVel = BSParam.LinkConstraintTransMotorMaxVel;
p.linkConstraintTransMotorMaxForce = o[0].XlinkConstraintTransMotorMaxForce; p.linkConstraintTransMotorMaxForce = BSParam.LinkConstraintTransMotorMaxForce;
p.linkConstraintERP = o[0].XlinkConstraintERP; p.linkConstraintERP = BSParam.LinkConstraintERP;
p.linkConstraintCFM = o[0].XlinkConstraintCFM; p.linkConstraintCFM = BSParam.LinkConstraintCFM;
p.linkConstraintSolverIterations = o[0].XlinkConstraintSolverIterations; p.linkConstraintSolverIterations = BSParam.LinkConstraintSolverIterations;
p.physicsLoggingFrames = o[0].XphysicsLoggingFrames; p.physicsLoggingFrames = o[0].physicsLoggingFrames;
DefaultCollisionConstructionInfo ccci = new DefaultCollisionConstructionInfo(); DefaultCollisionConstructionInfo ccci = new DefaultCollisionConstructionInfo();
DefaultCollisionConfiguration cci = new DefaultCollisionConfiguration(); DefaultCollisionConfiguration cci = new DefaultCollisionConfiguration();

View File

@ -174,32 +174,6 @@ public struct ConfigurationParameters
public float collisionMargin; public float collisionMargin;
public float gravity; public float gravity;
public float XlinearDamping;
public float XangularDamping;
public float XdeactivationTime;
public float XlinearSleepingThreshold;
public float XangularSleepingThreshold;
public float XccdMotionThreshold;
public float XccdSweptSphereRadius;
public float XcontactProcessingThreshold;
public float XterrainImplementation;
public float XterrainFriction;
public float XterrainHitFraction;
public float XterrainRestitution;
public float XterrainCollisionMargin;
public float XavatarFriction;
public float XavatarStandingFriction;
public float XavatarDensity;
public float XavatarRestitution;
public float XavatarCapsuleWidth;
public float XavatarCapsuleDepth;
public float XavatarCapsuleHeight;
public float XavatarContactProcessingThreshold;
public float XvehicleAngularDamping;
public float maxPersistantManifoldPoolSize; public float maxPersistantManifoldPoolSize;
public float maxCollisionAlgorithmPoolSize; public float maxCollisionAlgorithmPoolSize;
public float shouldDisableContactPoolDynamicAllocation; public float shouldDisableContactPoolDynamicAllocation;
@ -208,17 +182,9 @@ public struct ConfigurationParameters
public float shouldSplitSimulationIslands; public float shouldSplitSimulationIslands;
public float shouldEnableFrictionCaching; public float shouldEnableFrictionCaching;
public float numberOfSolverIterations; public float numberOfSolverIterations;
public float useSingleSidedMeshes;
public float XlinksetImplementation; public float physicsLoggingFrames;
public float XlinkConstraintUseFrameOffset;
public float XlinkConstraintEnableTransMotor;
public float XlinkConstraintTransMotorMaxVel;
public float XlinkConstraintTransMotorMaxForce;
public float XlinkConstraintERP;
public float XlinkConstraintCFM;
public float XlinkConstraintSolverIterations;
public float XphysicsLoggingFrames;
public const float numericTrue = 1f; public const float numericTrue = 1f;
public const float numericFalse = 0f; public const float numericFalse = 0f;

View File

@ -1326,7 +1326,7 @@ namespace OpenSim.Region.Physics.BulletSPlugin
// If verticalError.Z is negative, the vehicle is upside down. Add additional push. // If verticalError.Z is negative, the vehicle is upside down. Add additional push.
if (verticalError.Z < 0f) if (verticalError.Z < 0f)
{ {
vertContributionV.X += PIOverFour; vertContributionV.X += Math.Sign(vertContributionV.X) * PIOverFour;
// vertContribution.Y -= PIOverFour; // vertContribution.Y -= PIOverFour;
} }

View File

@ -39,6 +39,7 @@ public static class BSParam
{ {
// Level of Detail values kept as float because that's what the Meshmerizer wants // Level of Detail values kept as float because that's what the Meshmerizer wants
public static float MeshLOD { get; private set; } public static float MeshLOD { get; private set; }
public static float MeshCircularLOD { get; private set; }
public static float MeshMegaPrimLOD { get; private set; } public static float MeshMegaPrimLOD { get; private set; }
public static float MeshMegaPrimThreshold { get; private set; } public static float MeshMegaPrimThreshold { get; private set; }
public static float SculptLOD { get; private set; } public static float SculptLOD { get; private set; }
@ -61,6 +62,7 @@ public static class BSParam
public static bool ShouldMeshSculptedPrim { get; private set; } // cause scuplted prims to get meshed public static bool ShouldMeshSculptedPrim { get; private set; } // cause scuplted prims to get meshed
public static bool ShouldForceSimplePrimMeshing { get; private set; } // if a cube or sphere, let Bullet do internal shapes public static bool ShouldForceSimplePrimMeshing { get; private set; } // if a cube or sphere, let Bullet do internal shapes
public static bool ShouldUseHullsForPhysicalObjects { get; private set; } // 'true' if should create hulls for physical objects public static bool ShouldUseHullsForPhysicalObjects { get; private set; } // 'true' if should create hulls for physical objects
public static bool ShouldRemoveZeroWidthTriangles { get; private set; }
public static float TerrainImplementation { get; private set; } public static float TerrainImplementation { get; private set; }
public static float TerrainFriction { get; private set; } public static float TerrainFriction { get; private set; }
@ -68,6 +70,24 @@ public static class BSParam
public static float TerrainRestitution { get; private set; } public static float TerrainRestitution { get; private set; }
public static float TerrainCollisionMargin { get; private set; } public static float TerrainCollisionMargin { get; private set; }
public static float DefaultFriction;
public static float DefaultDensity;
public static float DefaultRestitution;
public static float CollisionMargin;
public static float Gravity;
// Physics Engine operation
public static float MaxPersistantManifoldPoolSize;
public static float MaxCollisionAlgorithmPoolSize;
public static float ShouldDisableContactPoolDynamicAllocation;
public static float ShouldForceUpdateAllAabbs;
public static float ShouldRandomizeSolverOrder;
public static float ShouldSplitSimulationIslands;
public static float ShouldEnableFrictionCaching;
public static float NumberOfSolverIterations;
public static bool UseSingleSidedMeshes { get { return UseSingleSidedMeshesF != ConfigurationParameters.numericFalse; } }
public static float UseSingleSidedMeshesF;
// Avatar parameters // Avatar parameters
public static float AvatarFriction { get; private set; } public static float AvatarFriction { get; private set; }
public static float AvatarStandingFriction { get; private set; } public static float AvatarStandingFriction { get; private set; }
@ -199,22 +219,32 @@ public static class BSParam
(s,cf,p,v) => { ShouldUseHullsForPhysicalObjects = cf.GetBoolean(p, BSParam.BoolNumeric(v)); }, (s,cf,p,v) => { ShouldUseHullsForPhysicalObjects = cf.GetBoolean(p, BSParam.BoolNumeric(v)); },
(s) => { return BSParam.NumericBool(ShouldUseHullsForPhysicalObjects); }, (s) => { return BSParam.NumericBool(ShouldUseHullsForPhysicalObjects); },
(s,p,l,v) => { ShouldUseHullsForPhysicalObjects = BSParam.BoolNumeric(v); } ), (s,p,l,v) => { ShouldUseHullsForPhysicalObjects = BSParam.BoolNumeric(v); } ),
new ParameterDefn("ShouldRemoveZeroWidthTriangles", "If true, remove degenerate triangles from meshes",
ConfigurationParameters.numericTrue,
(s,cf,p,v) => { ShouldRemoveZeroWidthTriangles = cf.GetBoolean(p, BSParam.BoolNumeric(v)); },
(s) => { return BSParam.NumericBool(ShouldRemoveZeroWidthTriangles); },
(s,p,l,v) => { ShouldRemoveZeroWidthTriangles = BSParam.BoolNumeric(v); } ),
new ParameterDefn("MeshLevelOfDetail", "Level of detail to render meshes (32, 16, 8 or 4. 32=most detailed)", new ParameterDefn("MeshLevelOfDetail", "Level of detail to render meshes (32, 16, 8 or 4. 32=most detailed)",
8f, 32f,
(s,cf,p,v) => { MeshLOD = (float)cf.GetInt(p, (int)v); }, (s,cf,p,v) => { MeshLOD = (float)cf.GetInt(p, (int)v); },
(s) => { return MeshLOD; }, (s) => { return MeshLOD; },
(s,p,l,v) => { MeshLOD = v; } ), (s,p,l,v) => { MeshLOD = v; } ),
new ParameterDefn("MeshLevelOfDetailMegaPrim", "Level of detail to render meshes larger than threshold meters", new ParameterDefn("MeshLevelOfDetailCircular", "Level of detail for prims with circular cuts or shapes",
16f, 32f,
(s,cf,p,v) => { MeshMegaPrimLOD = (float)cf.GetInt(p, (int)v); }, (s,cf,p,v) => { MeshCircularLOD = (float)cf.GetInt(p, (int)v); },
(s) => { return MeshMegaPrimLOD; }, (s) => { return MeshCircularLOD; },
(s,p,l,v) => { MeshMegaPrimLOD = v; } ), (s,p,l,v) => { MeshCircularLOD = v; } ),
new ParameterDefn("MeshLevelOfDetailMegaPrimThreshold", "Size (in meters) of a mesh before using MeshMegaPrimLOD", new ParameterDefn("MeshLevelOfDetailMegaPrimThreshold", "Size (in meters) of a mesh before using MeshMegaPrimLOD",
10f, 10f,
(s,cf,p,v) => { MeshMegaPrimThreshold = (float)cf.GetInt(p, (int)v); }, (s,cf,p,v) => { MeshMegaPrimThreshold = (float)cf.GetInt(p, (int)v); },
(s) => { return MeshMegaPrimThreshold; }, (s) => { return MeshMegaPrimThreshold; },
(s,p,l,v) => { MeshMegaPrimThreshold = v; } ), (s,p,l,v) => { MeshMegaPrimThreshold = v; } ),
new ParameterDefn("MeshLevelOfDetailMegaPrim", "Level of detail to render meshes larger than threshold meters",
32f,
(s,cf,p,v) => { MeshMegaPrimLOD = (float)cf.GetInt(p, (int)v); },
(s) => { return MeshMegaPrimLOD; },
(s,p,l,v) => { MeshMegaPrimLOD = v; } ),
new ParameterDefn("SculptLevelOfDetail", "Level of detail to render sculpties (32, 16, 8 or 4. 32=most detailed)", new ParameterDefn("SculptLevelOfDetail", "Level of detail to render sculpties (32, 16, 8 or 4. 32=most detailed)",
32f, 32f,
(s,cf,p,v) => { SculptLOD = (float)cf.GetInt(p, (int)v); }, (s,cf,p,v) => { SculptLOD = (float)cf.GetInt(p, (int)v); },
@ -287,29 +317,29 @@ public static class BSParam
new ParameterDefn("DefaultFriction", "Friction factor used on new objects", new ParameterDefn("DefaultFriction", "Friction factor used on new objects",
0.2f, 0.2f,
(s,cf,p,v) => { s.UnmanagedParams[0].defaultFriction = cf.GetFloat(p, v); }, (s,cf,p,v) => { DefaultFriction = cf.GetFloat(p, v); },
(s) => { return s.UnmanagedParams[0].defaultFriction; }, (s) => { return DefaultFriction; },
(s,p,l,v) => { s.UnmanagedParams[0].defaultFriction = v; } ), (s,p,l,v) => { DefaultFriction = v; s.UnmanagedParams[0].defaultFriction = v; } ),
new ParameterDefn("DefaultDensity", "Density for new objects" , new ParameterDefn("DefaultDensity", "Density for new objects" ,
10.000006836f, // Aluminum g/cm3 10.000006836f, // Aluminum g/cm3
(s,cf,p,v) => { s.UnmanagedParams[0].defaultDensity = cf.GetFloat(p, v); }, (s,cf,p,v) => { DefaultDensity = cf.GetFloat(p, v); },
(s) => { return s.UnmanagedParams[0].defaultDensity; }, (s) => { return DefaultDensity; },
(s,p,l,v) => { s.UnmanagedParams[0].defaultDensity = v; } ), (s,p,l,v) => { DefaultDensity = v; s.UnmanagedParams[0].defaultDensity = v; } ),
new ParameterDefn("DefaultRestitution", "Bouncyness of an object" , new ParameterDefn("DefaultRestitution", "Bouncyness of an object" ,
0f, 0f,
(s,cf,p,v) => { s.UnmanagedParams[0].defaultRestitution = cf.GetFloat(p, v); }, (s,cf,p,v) => { DefaultRestitution = cf.GetFloat(p, v); },
(s) => { return s.UnmanagedParams[0].defaultRestitution; }, (s) => { return DefaultRestitution; },
(s,p,l,v) => { s.UnmanagedParams[0].defaultRestitution = v; } ), (s,p,l,v) => { DefaultRestitution = v; s.UnmanagedParams[0].defaultRestitution = v; } ),
new ParameterDefn("CollisionMargin", "Margin around objects before collisions are calculated (must be zero!)", new ParameterDefn("CollisionMargin", "Margin around objects before collisions are calculated (must be zero!)",
0.04f, 0.04f,
(s,cf,p,v) => { s.UnmanagedParams[0].collisionMargin = cf.GetFloat(p, v); }, (s,cf,p,v) => { CollisionMargin = cf.GetFloat(p, v); },
(s) => { return s.UnmanagedParams[0].collisionMargin; }, (s) => { return CollisionMargin; },
(s,p,l,v) => { s.UnmanagedParams[0].collisionMargin = v; } ), (s,p,l,v) => { CollisionMargin = v; s.UnmanagedParams[0].collisionMargin = v; } ),
new ParameterDefn("Gravity", "Vertical force of gravity (negative means down)", new ParameterDefn("Gravity", "Vertical force of gravity (negative means down)",
-9.80665f, -9.80665f,
(s,cf,p,v) => { s.UnmanagedParams[0].gravity = cf.GetFloat(p, v); }, (s,cf,p,v) => { Gravity = cf.GetFloat(p, v); },
(s) => { return s.UnmanagedParams[0].gravity; }, (s) => { return Gravity; },
(s,p,l,v) => { s.UpdateParameterObject((x)=>{s.UnmanagedParams[0].gravity=x;}, p, PhysParameterEntry.APPLY_TO_NONE, v); }, (s,p,l,v) => { Gravity = v; s.UnmanagedParams[0].gravity = v; },
(s,o,v) => { s.PE.SetGravity(o.PhysBody, new Vector3(0f,0f,v)); } ), (s,o,v) => { s.PE.SetGravity(o.PhysBody, new Vector3(0f,0f,v)); } ),
@ -317,49 +347,49 @@ public static class BSParam
0f, 0f,
(s,cf,p,v) => { LinearDamping = cf.GetFloat(p, v); }, (s,cf,p,v) => { LinearDamping = cf.GetFloat(p, v); },
(s) => { return LinearDamping; }, (s) => { return LinearDamping; },
(s,p,l,v) => { s.UpdateParameterObject((x)=>{LinearDamping=x;}, p, l, v); }, (s,p,l,v) => { LinearDamping = v; },
(s,o,v) => { s.PE.SetDamping(o.PhysBody, v, AngularDamping); } ), (s,o,v) => { s.PE.SetDamping(o.PhysBody, v, AngularDamping); } ),
new ParameterDefn("AngularDamping", "Factor to damp angular movement per second (0.0 - 1.0)", new ParameterDefn("AngularDamping", "Factor to damp angular movement per second (0.0 - 1.0)",
0f, 0f,
(s,cf,p,v) => { AngularDamping = cf.GetFloat(p, v); }, (s,cf,p,v) => { AngularDamping = cf.GetFloat(p, v); },
(s) => { return AngularDamping; }, (s) => { return AngularDamping; },
(s,p,l,v) => { s.UpdateParameterObject((x)=>{AngularDamping=x;}, p, l, v); }, (s,p,l,v) => { AngularDamping = v; },
(s,o,v) => { s.PE.SetDamping(o.PhysBody, LinearDamping, v); } ), (s,o,v) => { s.PE.SetDamping(o.PhysBody, LinearDamping, v); } ),
new ParameterDefn("DeactivationTime", "Seconds before considering an object potentially static", new ParameterDefn("DeactivationTime", "Seconds before considering an object potentially static",
0.2f, 0.2f,
(s,cf,p,v) => { DeactivationTime = cf.GetFloat(p, v); }, (s,cf,p,v) => { DeactivationTime = cf.GetFloat(p, v); },
(s) => { return DeactivationTime; }, (s) => { return DeactivationTime; },
(s,p,l,v) => { s.UpdateParameterObject((x)=>{DeactivationTime=x;}, p, l, v); }, (s,p,l,v) => { DeactivationTime = v; },
(s,o,v) => { s.PE.SetDeactivationTime(o.PhysBody, v); } ), (s,o,v) => { s.PE.SetDeactivationTime(o.PhysBody, v); } ),
new ParameterDefn("LinearSleepingThreshold", "Seconds to measure linear movement before considering static", new ParameterDefn("LinearSleepingThreshold", "Seconds to measure linear movement before considering static",
0.8f, 0.8f,
(s,cf,p,v) => { LinearSleepingThreshold = cf.GetFloat(p, v); }, (s,cf,p,v) => { LinearSleepingThreshold = cf.GetFloat(p, v); },
(s) => { return LinearSleepingThreshold; }, (s) => { return LinearSleepingThreshold; },
(s,p,l,v) => { s.UpdateParameterObject((x)=>{LinearSleepingThreshold=x;}, p, l, v); }, (s,p,l,v) => { LinearSleepingThreshold = v;},
(s,o,v) => { s.PE.SetSleepingThresholds(o.PhysBody, v, v); } ), (s,o,v) => { s.PE.SetSleepingThresholds(o.PhysBody, v, v); } ),
new ParameterDefn("AngularSleepingThreshold", "Seconds to measure angular movement before considering static", new ParameterDefn("AngularSleepingThreshold", "Seconds to measure angular movement before considering static",
1.0f, 1.0f,
(s,cf,p,v) => { AngularSleepingThreshold = cf.GetFloat(p, v); }, (s,cf,p,v) => { AngularSleepingThreshold = cf.GetFloat(p, v); },
(s) => { return AngularSleepingThreshold; }, (s) => { return AngularSleepingThreshold; },
(s,p,l,v) => { s.UpdateParameterObject((x)=>{AngularSleepingThreshold=x;}, p, l, v); }, (s,p,l,v) => { AngularSleepingThreshold = v;},
(s,o,v) => { s.PE.SetSleepingThresholds(o.PhysBody, v, v); } ), (s,o,v) => { s.PE.SetSleepingThresholds(o.PhysBody, v, v); } ),
new ParameterDefn("CcdMotionThreshold", "Continuious collision detection threshold (0 means no CCD)" , new ParameterDefn("CcdMotionThreshold", "Continuious collision detection threshold (0 means no CCD)" ,
0.0f, // set to zero to disable 0.0f, // set to zero to disable
(s,cf,p,v) => { CcdMotionThreshold = cf.GetFloat(p, v); }, (s,cf,p,v) => { CcdMotionThreshold = cf.GetFloat(p, v); },
(s) => { return CcdMotionThreshold; }, (s) => { return CcdMotionThreshold; },
(s,p,l,v) => { s.UpdateParameterObject((x)=>{CcdMotionThreshold=x;}, p, l, v); }, (s,p,l,v) => { CcdMotionThreshold = v;},
(s,o,v) => { s.PE.SetCcdMotionThreshold(o.PhysBody, v); } ), (s,o,v) => { s.PE.SetCcdMotionThreshold(o.PhysBody, v); } ),
new ParameterDefn("CcdSweptSphereRadius", "Continuious collision detection test radius" , new ParameterDefn("CcdSweptSphereRadius", "Continuious collision detection test radius" ,
0.2f, 0.2f,
(s,cf,p,v) => { CcdSweptSphereRadius = cf.GetFloat(p, v); }, (s,cf,p,v) => { CcdSweptSphereRadius = cf.GetFloat(p, v); },
(s) => { return CcdSweptSphereRadius; }, (s) => { return CcdSweptSphereRadius; },
(s,p,l,v) => { s.UpdateParameterObject((x)=>{CcdSweptSphereRadius=x;}, p, l, v); }, (s,p,l,v) => { CcdSweptSphereRadius = v;},
(s,o,v) => { s.PE.SetCcdSweptSphereRadius(o.PhysBody, v); } ), (s,o,v) => { s.PE.SetCcdSweptSphereRadius(o.PhysBody, v); } ),
new ParameterDefn("ContactProcessingThreshold", "Distance above which contacts can be discarded (0 means no discard)" , new ParameterDefn("ContactProcessingThreshold", "Distance above which contacts can be discarded (0 means no discard)" ,
0.0f, 0.0f,
(s,cf,p,v) => { ContactProcessingThreshold = cf.GetFloat(p, v); }, (s,cf,p,v) => { ContactProcessingThreshold = cf.GetFloat(p, v); },
(s) => { return ContactProcessingThreshold; }, (s) => { return ContactProcessingThreshold; },
(s,p,l,v) => { s.UpdateParameterObject((x)=>{ContactProcessingThreshold=x;}, p, l, v); }, (s,p,l,v) => { ContactProcessingThreshold = v;},
(s,o,v) => { s.PE.SetContactProcessingThreshold(o.PhysBody, v); } ), (s,o,v) => { s.PE.SetContactProcessingThreshold(o.PhysBody, v); } ),
new ParameterDefn("TerrainImplementation", "Type of shape to use for terrain (0=heightmap, 1=mesh)", new ParameterDefn("TerrainImplementation", "Type of shape to use for terrain (0=heightmap, 1=mesh)",
@ -392,7 +422,7 @@ public static class BSParam
0.2f, 0.2f,
(s,cf,p,v) => { AvatarFriction = cf.GetFloat(p, v); }, (s,cf,p,v) => { AvatarFriction = cf.GetFloat(p, v); },
(s) => { return AvatarFriction; }, (s) => { return AvatarFriction; },
(s,p,l,v) => { s.UpdateParameterObject((x)=>{AvatarFriction=x;}, p, l, v); } ), (s,p,l,v) => { AvatarFriction = v; } ),
new ParameterDefn("AvatarStandingFriction", "Avatar friction when standing. Changed on avatar recreation.", new ParameterDefn("AvatarStandingFriction", "Avatar friction when standing. Changed on avatar recreation.",
10.0f, 10.0f,
(s,cf,p,v) => { AvatarStandingFriction = cf.GetFloat(p, v); }, (s,cf,p,v) => { AvatarStandingFriction = cf.GetFloat(p, v); },
@ -407,32 +437,32 @@ public static class BSParam
3.5f, 3.5f,
(s,cf,p,v) => { AvatarDensity = cf.GetFloat(p, v); }, (s,cf,p,v) => { AvatarDensity = cf.GetFloat(p, v); },
(s) => { return AvatarDensity; }, (s) => { return AvatarDensity; },
(s,p,l,v) => { s.UpdateParameterObject((x)=>{AvatarDensity=x;}, p, l, v); } ), (s,p,l,v) => { AvatarDensity = v; } ),
new ParameterDefn("AvatarRestitution", "Bouncyness. Changed on avatar recreation.", new ParameterDefn("AvatarRestitution", "Bouncyness. Changed on avatar recreation.",
0f, 0f,
(s,cf,p,v) => { AvatarRestitution = cf.GetFloat(p, v); }, (s,cf,p,v) => { AvatarRestitution = cf.GetFloat(p, v); },
(s) => { return AvatarRestitution; }, (s) => { return AvatarRestitution; },
(s,p,l,v) => { s.UpdateParameterObject((x)=>{AvatarRestitution=x;}, p, l, v); } ), (s,p,l,v) => { AvatarRestitution = v; } ),
new ParameterDefn("AvatarCapsuleWidth", "The distance between the sides of the avatar capsule", new ParameterDefn("AvatarCapsuleWidth", "The distance between the sides of the avatar capsule",
0.6f, 0.6f,
(s,cf,p,v) => { AvatarCapsuleWidth = cf.GetFloat(p, v); }, (s,cf,p,v) => { AvatarCapsuleWidth = cf.GetFloat(p, v); },
(s) => { return AvatarCapsuleWidth; }, (s) => { return AvatarCapsuleWidth; },
(s,p,l,v) => { s.UpdateParameterObject((x)=>{AvatarCapsuleWidth=x;}, p, l, v); } ), (s,p,l,v) => { AvatarCapsuleWidth = v; } ),
new ParameterDefn("AvatarCapsuleDepth", "The distance between the front and back of the avatar capsule", new ParameterDefn("AvatarCapsuleDepth", "The distance between the front and back of the avatar capsule",
0.45f, 0.45f,
(s,cf,p,v) => { AvatarCapsuleDepth = cf.GetFloat(p, v); }, (s,cf,p,v) => { AvatarCapsuleDepth = cf.GetFloat(p, v); },
(s) => { return AvatarCapsuleDepth; }, (s) => { return AvatarCapsuleDepth; },
(s,p,l,v) => { s.UpdateParameterObject((x)=>{AvatarCapsuleDepth=x;}, p, l, v); } ), (s,p,l,v) => { AvatarCapsuleDepth = v; } ),
new ParameterDefn("AvatarCapsuleHeight", "Default height of space around avatar", new ParameterDefn("AvatarCapsuleHeight", "Default height of space around avatar",
1.5f, 1.5f,
(s,cf,p,v) => { AvatarCapsuleHeight = cf.GetFloat(p, v); }, (s,cf,p,v) => { AvatarCapsuleHeight = cf.GetFloat(p, v); },
(s) => { return AvatarCapsuleHeight; }, (s) => { return AvatarCapsuleHeight; },
(s,p,l,v) => { s.UpdateParameterObject((x)=>{AvatarCapsuleHeight=x;}, p, l, v); } ), (s,p,l,v) => { AvatarCapsuleHeight = v; } ),
new ParameterDefn("AvatarContactProcessingThreshold", "Distance from capsule to check for collisions", new ParameterDefn("AvatarContactProcessingThreshold", "Distance from capsule to check for collisions",
0.1f, 0.1f,
(s,cf,p,v) => { AvatarContactProcessingThreshold = cf.GetFloat(p, v); }, (s,cf,p,v) => { AvatarContactProcessingThreshold = cf.GetFloat(p, v); },
(s) => { return AvatarContactProcessingThreshold; }, (s) => { return AvatarContactProcessingThreshold; },
(s,p,l,v) => { s.UpdateParameterObject((x)=>{AvatarContactProcessingThreshold=x;}, p, l, v); } ), (s,p,l,v) => { AvatarContactProcessingThreshold = v; } ),
new ParameterDefn("AvatarStepHeight", "Height of a step obstacle to consider step correction", new ParameterDefn("AvatarStepHeight", "Height of a step obstacle to consider step correction",
0.3f, 0.3f,
(s,cf,p,v) => { AvatarStepHeight = cf.GetFloat(p, v); }, (s,cf,p,v) => { AvatarStepHeight = cf.GetFloat(p, v); },
@ -497,44 +527,49 @@ public static class BSParam
new ParameterDefn("MaxPersistantManifoldPoolSize", "Number of manifolds pooled (0 means default of 4096)", new ParameterDefn("MaxPersistantManifoldPoolSize", "Number of manifolds pooled (0 means default of 4096)",
0f, 0f,
(s,cf,p,v) => { s.UnmanagedParams[0].maxPersistantManifoldPoolSize = cf.GetFloat(p, v); }, (s,cf,p,v) => { MaxPersistantManifoldPoolSize = cf.GetFloat(p, v); },
(s) => { return s.UnmanagedParams[0].maxPersistantManifoldPoolSize; }, (s) => { return MaxPersistantManifoldPoolSize; },
(s,p,l,v) => { s.UnmanagedParams[0].maxPersistantManifoldPoolSize = v; } ), (s,p,l,v) => { MaxPersistantManifoldPoolSize = v; s.UnmanagedParams[0].maxPersistantManifoldPoolSize = v; } ),
new ParameterDefn("MaxCollisionAlgorithmPoolSize", "Number of collisions pooled (0 means default of 4096)", new ParameterDefn("MaxCollisionAlgorithmPoolSize", "Number of collisions pooled (0 means default of 4096)",
0f, 0f,
(s,cf,p,v) => { s.UnmanagedParams[0].maxCollisionAlgorithmPoolSize = cf.GetFloat(p, v); }, (s,cf,p,v) => { MaxCollisionAlgorithmPoolSize = cf.GetFloat(p, v); },
(s) => { return s.UnmanagedParams[0].maxCollisionAlgorithmPoolSize; }, (s) => { return MaxCollisionAlgorithmPoolSize; },
(s,p,l,v) => { s.UnmanagedParams[0].maxCollisionAlgorithmPoolSize = v; } ), (s,p,l,v) => { MaxCollisionAlgorithmPoolSize = v; s.UnmanagedParams[0].maxCollisionAlgorithmPoolSize = v; } ),
new ParameterDefn("ShouldDisableContactPoolDynamicAllocation", "Enable to allow large changes in object count", new ParameterDefn("ShouldDisableContactPoolDynamicAllocation", "Enable to allow large changes in object count",
ConfigurationParameters.numericFalse, ConfigurationParameters.numericFalse,
(s,cf,p,v) => { s.UnmanagedParams[0].shouldDisableContactPoolDynamicAllocation = BSParam.NumericBool(cf.GetBoolean(p, BSParam.BoolNumeric(v))); }, (s,cf,p,v) => { ShouldDisableContactPoolDynamicAllocation = BSParam.NumericBool(cf.GetBoolean(p, BSParam.BoolNumeric(v))); },
(s) => { return s.UnmanagedParams[0].shouldDisableContactPoolDynamicAllocation; }, (s) => { return ShouldDisableContactPoolDynamicAllocation; },
(s,p,l,v) => { s.UnmanagedParams[0].shouldDisableContactPoolDynamicAllocation = v; } ), (s,p,l,v) => { ShouldDisableContactPoolDynamicAllocation = v; s.UnmanagedParams[0].shouldDisableContactPoolDynamicAllocation = v; } ),
new ParameterDefn("ShouldForceUpdateAllAabbs", "Enable to recomputer AABBs every simulator step", new ParameterDefn("ShouldForceUpdateAllAabbs", "Enable to recomputer AABBs every simulator step",
ConfigurationParameters.numericFalse, ConfigurationParameters.numericFalse,
(s,cf,p,v) => { s.UnmanagedParams[0].shouldForceUpdateAllAabbs = BSParam.NumericBool(cf.GetBoolean(p, BSParam.BoolNumeric(v))); }, (s,cf,p,v) => { ShouldForceUpdateAllAabbs = BSParam.NumericBool(cf.GetBoolean(p, BSParam.BoolNumeric(v))); },
(s) => { return s.UnmanagedParams[0].shouldForceUpdateAllAabbs; }, (s) => { return ShouldForceUpdateAllAabbs; },
(s,p,l,v) => { s.UnmanagedParams[0].shouldForceUpdateAllAabbs = v; } ), (s,p,l,v) => { ShouldForceUpdateAllAabbs = v; s.UnmanagedParams[0].shouldForceUpdateAllAabbs = v; } ),
new ParameterDefn("ShouldRandomizeSolverOrder", "Enable for slightly better stacking interaction", new ParameterDefn("ShouldRandomizeSolverOrder", "Enable for slightly better stacking interaction",
ConfigurationParameters.numericTrue, ConfigurationParameters.numericTrue,
(s,cf,p,v) => { s.UnmanagedParams[0].shouldRandomizeSolverOrder = BSParam.NumericBool(cf.GetBoolean(p, BSParam.BoolNumeric(v))); }, (s,cf,p,v) => { ShouldRandomizeSolverOrder = BSParam.NumericBool(cf.GetBoolean(p, BSParam.BoolNumeric(v))); },
(s) => { return s.UnmanagedParams[0].shouldRandomizeSolverOrder; }, (s) => { return ShouldRandomizeSolverOrder; },
(s,p,l,v) => { s.UnmanagedParams[0].shouldRandomizeSolverOrder = v; } ), (s,p,l,v) => { ShouldRandomizeSolverOrder = v; s.UnmanagedParams[0].shouldRandomizeSolverOrder = v; } ),
new ParameterDefn("ShouldSplitSimulationIslands", "Enable splitting active object scanning islands", new ParameterDefn("ShouldSplitSimulationIslands", "Enable splitting active object scanning islands",
ConfigurationParameters.numericTrue, ConfigurationParameters.numericTrue,
(s,cf,p,v) => { s.UnmanagedParams[0].shouldSplitSimulationIslands = BSParam.NumericBool(cf.GetBoolean(p, BSParam.BoolNumeric(v))); }, (s,cf,p,v) => { ShouldSplitSimulationIslands = BSParam.NumericBool(cf.GetBoolean(p, BSParam.BoolNumeric(v))); },
(s) => { return s.UnmanagedParams[0].shouldSplitSimulationIslands; }, (s) => { return ShouldSplitSimulationIslands; },
(s,p,l,v) => { s.UnmanagedParams[0].shouldSplitSimulationIslands = v; } ), (s,p,l,v) => { ShouldSplitSimulationIslands = v; s.UnmanagedParams[0].shouldSplitSimulationIslands = v; } ),
new ParameterDefn("ShouldEnableFrictionCaching", "Enable friction computation caching", new ParameterDefn("ShouldEnableFrictionCaching", "Enable friction computation caching",
ConfigurationParameters.numericTrue, ConfigurationParameters.numericTrue,
(s,cf,p,v) => { s.UnmanagedParams[0].shouldEnableFrictionCaching = BSParam.NumericBool(cf.GetBoolean(p, BSParam.BoolNumeric(v))); }, (s,cf,p,v) => { ShouldEnableFrictionCaching = BSParam.NumericBool(cf.GetBoolean(p, BSParam.BoolNumeric(v))); },
(s) => { return s.UnmanagedParams[0].shouldEnableFrictionCaching; }, (s) => { return ShouldEnableFrictionCaching; },
(s,p,l,v) => { s.UnmanagedParams[0].shouldEnableFrictionCaching = v; } ), (s,p,l,v) => { ShouldEnableFrictionCaching = v; s.UnmanagedParams[0].shouldEnableFrictionCaching = v; } ),
new ParameterDefn("NumberOfSolverIterations", "Number of internal iterations (0 means default)", new ParameterDefn("NumberOfSolverIterations", "Number of internal iterations (0 means default)",
0f, // zero says use Bullet default 0f, // zero says use Bullet default
(s,cf,p,v) => { s.UnmanagedParams[0].numberOfSolverIterations = cf.GetFloat(p, v); }, (s,cf,p,v) => { NumberOfSolverIterations = cf.GetFloat(p, v); },
(s) => { return s.UnmanagedParams[0].numberOfSolverIterations; }, (s) => { return NumberOfSolverIterations; },
(s,p,l,v) => { s.UnmanagedParams[0].numberOfSolverIterations = v; } ), (s,p,l,v) => { NumberOfSolverIterations = v; s.UnmanagedParams[0].numberOfSolverIterations = v; } ),
new ParameterDefn("UseSingleSidedMeshes", "Whether to compute collisions based on single sided meshes.",
ConfigurationParameters.numericTrue,
(s,cf,p,v) => { UseSingleSidedMeshesF = BSParam.NumericBool(cf.GetBoolean(p, BSParam.BoolNumeric(v))); },
(s) => { return UseSingleSidedMeshesF; },
(s,p,l,v) => { UseSingleSidedMeshesF = v; s.UnmanagedParams[0].useSingleSidedMeshes = v; } ),
new ParameterDefn("LinksetImplementation", "Type of linkset implementation (0=Constraint, 1=Compound, 2=Manual)", new ParameterDefn("LinksetImplementation", "Type of linkset implementation (0=Constraint, 1=Compound, 2=Manual)",
(float)BSLinkset.LinksetImplementation.Compound, (float)BSLinkset.LinksetImplementation.Compound,

View File

@ -75,6 +75,7 @@ public abstract class BSPhysObject : PhysicsActor
PhysicsScene = parentScene; PhysicsScene = parentScene;
LocalID = localID; LocalID = localID;
PhysObjectName = name; PhysObjectName = name;
Name = name; // PhysicsActor also has the name of the object. Someday consolidate.
TypeName = typeName; TypeName = typeName;
// We don't have any physical representation yet. // We don't have any physical representation yet.

View File

@ -882,41 +882,41 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters
BSParam.ParameterDefn theParam; BSParam.ParameterDefn theParam;
if (BSParam.TryGetParameter(parm, out theParam)) if (BSParam.TryGetParameter(parm, out theParam))
{ {
// Set the value in the C# code
theParam.setter(this, parm, localID, val); theParam.setter(this, parm, localID, val);
// Optionally set the parameter in the unmanaged code
if (theParam.onObject != null)
{
// update all the localIDs specified
// If the local ID is APPLY_TO_NONE, just change the default value
// If the localID is APPLY_TO_ALL change the default value and apply the new value to all the lIDs
// If the localID is a specific object, apply the parameter change to only that object
List<uint> objectIDs = new List<uint>();
switch (localID)
{
case PhysParameterEntry.APPLY_TO_NONE:
// This will cause a call into the physical world if some operation is specified (SetOnObject).
objectIDs.Add(TERRAIN_ID);
TaintedUpdateParameter(parm, objectIDs, val);
break;
case PhysParameterEntry.APPLY_TO_ALL:
lock (PhysObjects) objectIDs = new List<uint>(PhysObjects.Keys);
TaintedUpdateParameter(parm, objectIDs, val);
break;
default:
// setting only one localID
objectIDs.Add(localID);
TaintedUpdateParameter(parm, objectIDs, val);
break;
}
}
ret = true; ret = true;
} }
return ret; return ret;
} }
// update all the localIDs specified
// If the local ID is APPLY_TO_NONE, just change the default value
// If the localID is APPLY_TO_ALL change the default value and apply the new value to all the lIDs
// If the localID is a specific object, apply the parameter change to only that object
internal delegate void AssignVal(float x);
internal void UpdateParameterObject(AssignVal setDefault, string parm, uint localID, float val)
{
List<uint> objectIDs = new List<uint>();
switch (localID)
{
case PhysParameterEntry.APPLY_TO_NONE:
setDefault(val); // setting only the default value
// This will cause a call into the physical world if some operation is specified (SetOnObject).
objectIDs.Add(TERRAIN_ID);
TaintedUpdateParameter(parm, objectIDs, val);
break;
case PhysParameterEntry.APPLY_TO_ALL:
setDefault(val); // setting ALL also sets the default value
lock (PhysObjects) objectIDs = new List<uint>(PhysObjects.Keys);
TaintedUpdateParameter(parm, objectIDs, val);
break;
default:
// setting only one localID
objectIDs.Add(localID);
TaintedUpdateParameter(parm, objectIDs, val);
break;
}
}
// schedule the actual updating of the paramter to when the phys engine is not busy // schedule the actual updating of the paramter to when the phys engine is not busy
private void TaintedUpdateParameter(string parm, List<uint> lIDs, float val) private void TaintedUpdateParameter(string parm, List<uint> lIDs, float val)
{ {

View File

@ -602,13 +602,13 @@ public sealed class BSShapeCollection : IDisposable
if (newMeshKey == prim.PhysShape.shapeKey && prim.PhysShape.type == BSPhysicsShapeType.SHAPE_MESH) if (newMeshKey == prim.PhysShape.shapeKey && prim.PhysShape.type == BSPhysicsShapeType.SHAPE_MESH)
return false; return false;
if (DDetail) DetailLog("{0},BSShapeCollection.GetReferenceToMesh,create,oldKey={1},newKey={2}", if (DDetail) DetailLog("{0},BSShapeCollection.GetReferenceToMesh,create,oldKey={1},newKey={2},size={3},lod={4}",
prim.LocalID, prim.PhysShape.shapeKey.ToString("X"), newMeshKey.ToString("X")); prim.LocalID, prim.PhysShape.shapeKey.ToString("X"), newMeshKey.ToString("X"), prim.Size, lod);
// Since we're recreating new, get rid of the reference to the previous shape // Since we're recreating new, get rid of the reference to the previous shape
DereferenceShape(prim.PhysShape, shapeCallback); DereferenceShape(prim.PhysShape, shapeCallback);
newShape = CreatePhysicalMesh(prim.PhysObjectName, newMeshKey, prim.BaseShape, prim.Size, lod); newShape = CreatePhysicalMesh(prim, newMeshKey, prim.BaseShape, prim.Size, lod);
// Take evasive action if the mesh was not constructed. // Take evasive action if the mesh was not constructed.
newShape = VerifyMeshCreated(newShape, prim); newShape = VerifyMeshCreated(newShape, prim);
@ -619,10 +619,9 @@ public sealed class BSShapeCollection : IDisposable
return true; // 'true' means a new shape has been added to this prim return true; // 'true' means a new shape has been added to this prim
} }
private BulletShape CreatePhysicalMesh(string objName, System.UInt64 newMeshKey, PrimitiveBaseShape pbs, OMV.Vector3 size, float lod) private BulletShape CreatePhysicalMesh(BSPhysObject prim, System.UInt64 newMeshKey, PrimitiveBaseShape pbs, OMV.Vector3 size, float lod)
{ {
BulletShape newShape = new BulletShape(); BulletShape newShape = new BulletShape();
IMesh meshData = null;
MeshDesc meshDesc; MeshDesc meshDesc;
if (Meshes.TryGetValue(newMeshKey, out meshDesc)) if (Meshes.TryGetValue(newMeshKey, out meshDesc))
@ -632,27 +631,63 @@ public sealed class BSShapeCollection : IDisposable
} }
else else
{ {
meshData = PhysicsScene.mesher.CreateMesh(objName, pbs, size, lod, true, false); IMesh meshData = PhysicsScene.mesher.CreateMesh(prim.PhysObjectName, pbs, size, lod,
false, // say it is not physical so a bounding box is not built
false // do not cache the mesh and do not use previously built versions
);
if (meshData != null) if (meshData != null)
{ {
int[] indices = meshData.getIndexListAsInt(); int[] indices = meshData.getIndexListAsInt();
List<OMV.Vector3> vertices = meshData.getVertexList(); int realIndicesIndex = indices.Length;
float[] verticesAsFloats = meshData.getVertexListAsFloat();
float[] verticesAsFloats = new float[vertices.Count * 3]; if (BSParam.ShouldRemoveZeroWidthTriangles)
int vi = 0;
foreach (OMV.Vector3 vv in vertices)
{ {
verticesAsFloats[vi++] = vv.X; // Remove degenerate triangles. These are triangles with two of the vertices
verticesAsFloats[vi++] = vv.Y; // are the same. This is complicated by the problem that vertices are not
verticesAsFloats[vi++] = vv.Z; // made unique in sculpties so we have to compare the values in the vertex.
realIndicesIndex = 0;
for (int tri = 0; tri < indices.Length; tri += 3)
{
// Compute displacements into vertex array for each vertex of the triangle
int v1 = indices[tri + 0] * 3;
int v2 = indices[tri + 1] * 3;
int v3 = indices[tri + 2] * 3;
// Check to see if any two of the vertices are the same
if (!( ( verticesAsFloats[v1 + 0] == verticesAsFloats[v2 + 0]
&& verticesAsFloats[v1 + 1] == verticesAsFloats[v2 + 1]
&& verticesAsFloats[v1 + 2] == verticesAsFloats[v2 + 2])
|| ( verticesAsFloats[v2 + 0] == verticesAsFloats[v3 + 0]
&& verticesAsFloats[v2 + 1] == verticesAsFloats[v3 + 1]
&& verticesAsFloats[v2 + 2] == verticesAsFloats[v3 + 2])
|| ( verticesAsFloats[v1 + 0] == verticesAsFloats[v3 + 0]
&& verticesAsFloats[v1 + 1] == verticesAsFloats[v3 + 1]
&& verticesAsFloats[v1 + 2] == verticesAsFloats[v3 + 2]) )
)
{
// None of the vertices of the triangles are the same. This is a good triangle;
indices[realIndicesIndex + 0] = indices[tri + 0];
indices[realIndicesIndex + 1] = indices[tri + 1];
indices[realIndicesIndex + 2] = indices[tri + 2];
realIndicesIndex += 3;
}
}
} }
DetailLog("{0},BSShapeCollection.CreatePhysicalMesh,origTri={1},realTri={2},numVerts={3}",
BSScene.DetailLogZero, indices.Length / 3, realIndicesIndex / 3, verticesAsFloats.Length / 3);
// m_log.DebugFormat("{0}: BSShapeCollection.CreatePhysicalMesh: calling CreateMesh. lid={1}, key={2}, indices={3}, vertices={4}", if (realIndicesIndex != 0)
// LogHeader, prim.LocalID, newMeshKey, indices.Length, vertices.Count); {
newShape = PhysicsScene.PE.CreateMeshShape(PhysicsScene.World,
newShape = PhysicsScene.PE.CreateMeshShape(PhysicsScene.World, realIndicesIndex, indices, verticesAsFloats.Length / 3, verticesAsFloats);
indices.GetLength(0), indices, vertices.Count, verticesAsFloats); }
else
{
PhysicsScene.Logger.ErrorFormat("{0} All mesh triangles degenerate. Prim {1} at {2} in {3}",
LogHeader, prim.PhysObjectName, prim.RawPosition, PhysicsScene.Name);
}
} }
} }
newShape.shapeKey = newMeshKey; newShape.shapeKey = newMeshKey;
@ -831,6 +866,11 @@ public sealed class BSShapeCollection : IDisposable
{ {
// level of detail based on size and type of the object // level of detail based on size and type of the object
float lod = BSParam.MeshLOD; float lod = BSParam.MeshLOD;
// prims with curvy internal cuts need higher lod
if (pbs.HollowShape == HollowShape.Circle)
lod = BSParam.MeshCircularLOD;
if (pbs.SculptEntry) if (pbs.SculptEntry)
lod = BSParam.SculptLOD; lod = BSParam.SculptLOD;
@ -865,9 +905,11 @@ public sealed class BSShapeCollection : IDisposable
// If this mesh has an underlying asset and we have not failed getting it before, fetch the asset // If this mesh has an underlying asset and we have not failed getting it before, fetch the asset
if (prim.BaseShape.SculptEntry && !prim.LastAssetBuildFailed && prim.BaseShape.SculptTexture != OMV.UUID.Zero) if (prim.BaseShape.SculptEntry && !prim.LastAssetBuildFailed && prim.BaseShape.SculptTexture != OMV.UUID.Zero)
{ {
prim.LastAssetBuildFailed = true;
BSPhysObject xprim = prim;
DetailLog("{0},BSShapeCollection.VerifyMeshCreated,fetchAsset,lastFailed={1}", prim.LocalID, prim.LastAssetBuildFailed); DetailLog("{0},BSShapeCollection.VerifyMeshCreated,fetchAsset,lastFailed={1}", prim.LocalID, prim.LastAssetBuildFailed);
// This will prevent looping through this code as we keep trying to get the failed shape
prim.LastAssetBuildFailed = true;
BSPhysObject xprim = prim;
Util.FireAndForget(delegate Util.FireAndForget(delegate
{ {
RequestAssetDelegate assetProvider = PhysicsScene.RequestAssetMethod; RequestAssetDelegate assetProvider = PhysicsScene.RequestAssetMethod;
@ -878,7 +920,7 @@ public sealed class BSShapeCollection : IDisposable
{ {
bool assetFound = false; // DEBUG DEBUG bool assetFound = false; // DEBUG DEBUG
string mismatchIDs = String.Empty; // DEBUG DEBUG string mismatchIDs = String.Empty; // DEBUG DEBUG
if (yprim.BaseShape.SculptEntry) if (asset != null && yprim.BaseShape.SculptEntry)
{ {
if (yprim.BaseShape.SculptTexture.ToString() == asset.ID) if (yprim.BaseShape.SculptTexture.ToString() == asset.ID)
{ {

View File

@ -96,7 +96,7 @@ public sealed class BSTerrainMesh : BSTerrainPhys
{ {
// DISASTER!! // DISASTER!!
PhysicsScene.DetailLog("{0},BSTerrainMesh.create,failedCreationOfShape", ID); PhysicsScene.DetailLog("{0},BSTerrainMesh.create,failedCreationOfShape", ID);
physicsScene.Logger.ErrorFormat("{0} Failed creation of terrain mesh! base={1}", LogHeader, TerrainBase); PhysicsScene.Logger.ErrorFormat("{0} Failed creation of terrain mesh! base={1}", LogHeader, TerrainBase);
// Something is very messed up and a crash is in our future. // Something is very messed up and a crash is in our future.
return; return;
} }
@ -108,7 +108,7 @@ public sealed class BSTerrainMesh : BSTerrainPhys
if (!m_terrainBody.HasPhysicalBody) if (!m_terrainBody.HasPhysicalBody)
{ {
// DISASTER!! // DISASTER!!
physicsScene.Logger.ErrorFormat("{0} Failed creation of terrain body! base={1}", LogHeader, TerrainBase); PhysicsScene.Logger.ErrorFormat("{0} Failed creation of terrain body! base={1}", LogHeader, TerrainBase);
// Something is very messed up and a crash is in our future. // Something is very messed up and a crash is in our future.
return; return;
} }
@ -131,6 +131,12 @@ public sealed class BSTerrainMesh : BSTerrainPhys
m_terrainBody.collisionType = CollisionType.Terrain; m_terrainBody.collisionType = CollisionType.Terrain;
m_terrainBody.ApplyCollisionMask(PhysicsScene); m_terrainBody.ApplyCollisionMask(PhysicsScene);
if (BSParam.UseSingleSidedMeshes)
{
PhysicsScene.DetailLog("{0},BSTerrainMesh.settingCustomMaterial", id);
PhysicsScene.PE.AddToCollisionFlags(m_terrainBody, CollisionFlags.CF_CUSTOM_MATERIAL_CALLBACK);
}
// Make it so the terrain will not move or be considered for movement. // Make it so the terrain will not move or be considered for movement.
PhysicsScene.PE.ForceActivationState(m_terrainBody, ActivationState.DISABLE_SIMULATION); PhysicsScene.PE.ForceActivationState(m_terrainBody, ActivationState.DISABLE_SIMULATION);
} }
@ -176,8 +182,7 @@ public sealed class BSTerrainMesh : BSTerrainPhys
// Convert the passed heightmap to mesh information suitable for CreateMeshShape2(). // Convert the passed heightmap to mesh information suitable for CreateMeshShape2().
// Return 'true' if successfully created. // Return 'true' if successfully created.
public static bool ConvertHeightmapToMesh( public static bool ConvertHeightmapToMesh( BSScene physicsScene,
BSScene physicsScene,
float[] heightMap, int sizeX, int sizeY, // parameters of incoming heightmap float[] heightMap, int sizeX, int sizeY, // parameters of incoming heightmap
float extentX, float extentY, // zero based range for output vertices float extentX, float extentY, // zero based range for output vertices
Vector3 extentBase, // base to be added to all vertices Vector3 extentBase, // base to be added to all vertices

View File

@ -217,6 +217,10 @@ public static class BulletSimData
{ {
// Map of collisionTypes to flags for collision groups and masks. // Map of collisionTypes to flags for collision groups and masks.
// An object's 'group' is the collison groups this object belongs to
// An object's 'filter' is the groups another object has to belong to in order to collide with me
// A collision happens if ((obj1.group & obj2.filter) != 0) || ((obj2.group & obj1.filter) != 0)
//
// As mentioned above, don't use the CollisionFilterGroups definitions directly in the code // As mentioned above, don't use the CollisionFilterGroups definitions directly in the code
// but, instead, use references to this dictionary. Finding and debugging // but, instead, use references to this dictionary. Finding and debugging
// collision flag problems will be made easier. // collision flag problems will be made easier.

View File

@ -65,6 +65,8 @@ Vehicle attributes are not restored when a vehicle is rezzed on region creation
GENERAL TODO LIST: GENERAL TODO LIST:
================================================= =================================================
Level-of-detail for mesh creation. Prims with circular interiors require lod of 32.
Is much saved with lower LODs? At the moment, all set to 32.
Collisions are inconsistant: arrows are supposed to hit and report collision. Often don't. Collisions are inconsistant: arrows are supposed to hit and report collision. Often don't.
If arrow show at prim, collision reported about 1/3 of time. If collision reported, If arrow show at prim, collision reported about 1/3 of time. If collision reported,
both arrow and prim report it. The arrow bounces off the prim 9 out of 10 times. both arrow and prim report it. The arrow bounces off the prim 9 out of 10 times.
@ -128,6 +130,9 @@ Physical and phantom will drop through the terrain
LINKSETS LINKSETS
====================================================== ======================================================
Child prims do not report collisions Child prims do not report collisions
Allow children of a linkset to be phantom:
http://opensim-dev.2196679.n2.nabble.com/Setting-a-single-child-prim-to-Phantom-tp7578513.html
Add OS_STATUS_PHANTOM_PRIM to llSetLinkPrimitaveParamsFast.
Editing a child of a linkset causes the child to go phantom Editing a child of a linkset causes the child to go phantom
Move a child prim once when it is physical and can never move it again without it going phantom Move a child prim once when it is physical and can never move it again without it going phantom
Offset the center of the linkset to be the geometric center of all the prims Offset the center of the linkset to be the geometric center of all the prims

View File

@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// Build Number // Build Number
// Revision // Revision
// //
[assembly: AssemblyVersion("0.7.5.*")] [assembly: AssemblyVersion("0.7.6.*")]
[assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]

View File

@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers // You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below: // by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.7.5.*")] [assembly: AssemblyVersion("0.7.6.*")]
[assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]

View File

@ -55,4 +55,4 @@ using System.Runtime.InteropServices;
// You can specify all values by your own or you can build default build and revision // You can specify all values by your own or you can build default build and revision
// numbers with the '*' character (the default): // numbers with the '*' character (the default):
[assembly : AssemblyVersion("0.7.5.*")] [assembly : AssemblyVersion("0.7.6.*")]

View File

@ -59,6 +59,7 @@ namespace OpenSim.Region.Physics.Manager
List<Vector3> getVertexList(); List<Vector3> getVertexList();
int[] getIndexListAsInt(); int[] getIndexListAsInt();
int[] getIndexListAsIntLocked(); int[] getIndexListAsIntLocked();
float[] getVertexListAsFloat();
float[] getVertexListAsFloatLocked(); float[] getVertexListAsFloatLocked();
void getIndexListAsPtrToIntArray(out IntPtr indices, out int triStride, out int indexCount); void getIndexListAsPtrToIntArray(out IntPtr indices, out int triStride, out int indexCount);
void getVertexListAsPtrToFloatArray(out IntPtr vertexList, out int vertexStride, out int vertexCount); void getVertexListAsPtrToFloatArray(out IntPtr vertexList, out int vertexStride, out int vertexCount);

View File

@ -152,7 +152,7 @@ namespace OpenSim.Region.Physics.Meshing
return result; return result;
} }
private float[] getVertexListAsFloat() public float[] getVertexListAsFloat()
{ {
if (m_vertices == null) if (m_vertices == null)
throw new NotSupportedException(); throw new NotSupportedException();

View File

@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// Build Number // Build Number
// Revision // Revision
// //
[assembly: AssemblyVersion("0.7.5.*")] [assembly: AssemblyVersion("0.7.6.*")]
[assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]

View File

@ -55,4 +55,4 @@ using System.Runtime.InteropServices;
// You can specify all values by your own or you can build default build and revision // You can specify all values by your own or you can build default build and revision
// numbers with the '*' character (the default): // numbers with the '*' character (the default):
[assembly : AssemblyVersion("0.7.5.*")] [assembly : AssemblyVersion("0.7.6.*")]

View File

@ -55,4 +55,4 @@ using System.Runtime.InteropServices;
// You can specify all values by your own or you can build default build and revision // You can specify all values by your own or you can build default build and revision
// numbers with the '*' character (the default): // numbers with the '*' character (the default):
[assembly : AssemblyVersion("0.7.5.*")] [assembly : AssemblyVersion("0.7.6.*")]

View File

@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// Build Number // Build Number
// Revision // Revision
// //
[assembly: AssemblyVersion("0.7.5.*")] [assembly: AssemblyVersion("0.7.6.*")]
[assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]

View File

@ -45,6 +45,7 @@ using OpenSim.Region.CoreModules.World.Terrain;
using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Interfaces;
using OpenSim.Region.Framework.Scenes; using OpenSim.Region.Framework.Scenes;
using OpenSim.Region.Framework.Scenes.Animation; using OpenSim.Region.Framework.Scenes.Animation;
using OpenSim.Region.Framework.Scenes.Scripting;
using OpenSim.Region.Physics.Manager; using OpenSim.Region.Physics.Manager;
using OpenSim.Region.ScriptEngine.Shared; using OpenSim.Region.ScriptEngine.Shared;
using OpenSim.Region.ScriptEngine.Shared.Api.Plugins; using OpenSim.Region.ScriptEngine.Shared.Api.Plugins;
@ -333,79 +334,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
} }
} }
protected UUID InventoryKey(string name, int type)
{
TaskInventoryItem item = m_host.Inventory.GetInventoryItem(name);
if (item != null && item.Type == type)
return item.AssetID;
else
return UUID.Zero;
}
/// <summary>
/// accepts a valid UUID, -or- a name of an inventory item.
/// Returns a valid UUID or UUID.Zero if key invalid and item not found
/// in prim inventory.
/// </summary>
/// <param name="k"></param>
/// <returns></returns>
protected UUID KeyOrName(string k)
{
UUID key;
// if we can parse the string as a key, use it.
// else try to locate the name in inventory of object. found returns key,
// not found returns UUID.Zero
if (!UUID.TryParse(k, out key))
{
TaskInventoryItem item = m_host.Inventory.GetInventoryItem(k);
if (item != null)
key = item.AssetID;
else
key = UUID.Zero;
}
return key;
}
/// <summary>
/// Return the UUID of the asset matching the specified key or name
/// and asset type.
/// </summary>
/// <param name="k"></param>
/// <param name="type"></param>
/// <returns></returns>
protected UUID KeyOrName(string k, AssetType type)
{
UUID key;
if (!UUID.TryParse(k, out key))
{
TaskInventoryItem item = m_host.Inventory.GetInventoryItem(k);
if (item != null && item.Type == (int)type)
key = item.AssetID;
}
else
{
lock (m_host.TaskInventory)
{
foreach (KeyValuePair<UUID, TaskInventoryItem> item in m_host.TaskInventory)
{
if (item.Value.Type == (int)type && item.Value.Name == k)
{
key = item.Value.ItemID;
break;
}
}
}
}
return key;
}
//These are the implementations of the various ll-functions used by the LSL scripts. //These are the implementations of the various ll-functions used by the LSL scripts.
public LSL_Float llSin(double f) public LSL_Float llSin(double f)
{ {
@ -1816,7 +1744,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
{ {
UUID textureID = new UUID(); UUID textureID = new UUID();
textureID = InventoryKey(texture, (int)AssetType.Texture); textureID = ScriptUtils.GetAssetIdFromItemName(m_host, texture, (int)AssetType.Texture);
if (textureID == UUID.Zero) if (textureID == UUID.Zero)
{ {
if (!UUID.TryParse(texture, out textureID)) if (!UUID.TryParse(texture, out textureID))
@ -2450,7 +2378,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
if (m_SoundModule != null) if (m_SoundModule != null)
{ {
m_SoundModule.SendSound(m_host.UUID, m_SoundModule.SendSound(m_host.UUID,
KeyOrName(sound, AssetType.Sound), volume, false, 0, ScriptUtils.GetAssetIdFromKeyOrItemName(m_host, sound, AssetType.Sound), volume, false, 0,
0, false, false); 0, false, false);
} }
} }
@ -2460,7 +2388,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
if (m_SoundModule != null) if (m_SoundModule != null)
{ {
m_SoundModule.LoopSound(m_host.UUID, KeyOrName(sound), m_SoundModule.LoopSound(m_host.UUID, ScriptUtils.GetAssetIdFromKeyOrItemName(m_host, sound),
volume, 20, false); volume, 20, false);
} }
} }
@ -2470,7 +2398,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
if (m_SoundModule != null) if (m_SoundModule != null)
{ {
m_SoundModule.LoopSound(m_host.UUID, KeyOrName(sound), m_SoundModule.LoopSound(m_host.UUID, ScriptUtils.GetAssetIdFromKeyOrItemName(m_host, sound),
volume, 20, true); volume, 20, true);
} }
} }
@ -2492,7 +2420,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
if (m_SoundModule != null) if (m_SoundModule != null)
{ {
m_SoundModule.SendSound(m_host.UUID, m_SoundModule.SendSound(m_host.UUID,
KeyOrName(sound, AssetType.Sound), volume, false, 0, ScriptUtils.GetAssetIdFromKeyOrItemName(m_host, sound, AssetType.Sound), volume, false, 0,
0, true, false); 0, true, false);
} }
} }
@ -2504,7 +2432,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
if (m_SoundModule != null) if (m_SoundModule != null)
{ {
m_SoundModule.SendSound(m_host.UUID, m_SoundModule.SendSound(m_host.UUID,
KeyOrName(sound, AssetType.Sound), volume, true, 0, 0, ScriptUtils.GetAssetIdFromKeyOrItemName(m_host, sound, AssetType.Sound), volume, true, 0, 0,
false, false); false, false);
} }
} }
@ -2521,7 +2449,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
{ {
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
if (m_SoundModule != null) if (m_SoundModule != null)
m_SoundModule.PreloadSound(m_host.UUID, KeyOrName(sound), 0); m_SoundModule.PreloadSound(m_host.UUID, ScriptUtils.GetAssetIdFromKeyOrItemName(m_host, sound), 0);
ScriptSleep(1000); ScriptSleep(1000);
} }
@ -3352,7 +3280,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
if (presence != null) if (presence != null)
{ {
// Do NOT try to parse UUID, animations cannot be triggered by ID // Do NOT try to parse UUID, animations cannot be triggered by ID
UUID animID = InventoryKey(anim, (int)AssetType.Animation); UUID animID = ScriptUtils.GetAssetIdFromItemName(m_host, anim, (int)AssetType.Animation);
if (animID == UUID.Zero) if (animID == UUID.Zero)
presence.Animator.AddAnimation(anim, m_host.UUID); presence.Animator.AddAnimation(anim, m_host.UUID);
else else
@ -3374,7 +3302,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
if (presence != null) if (presence != null)
{ {
UUID animID = KeyOrName(anim); UUID animID = ScriptUtils.GetAssetIdFromKeyOrItemName(m_host, anim);
if (animID == UUID.Zero) if (animID == UUID.Zero)
presence.Animator.RemoveAnimation(anim); presence.Animator.RemoveAnimation(anim);
@ -4319,7 +4247,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
private void DoLLTeleport(ScenePresence sp, string destination, Vector3 targetPos, Vector3 targetLookAt) private void DoLLTeleport(ScenePresence sp, string destination, Vector3 targetPos, Vector3 targetLookAt)
{ {
UUID assetID = KeyOrName(destination); UUID assetID = ScriptUtils.GetAssetIdFromKeyOrItemName(m_host, destination);
// The destinaion is not an asset ID and also doesn't name a landmark. // The destinaion is not an asset ID and also doesn't name a landmark.
// Use it as a sim name // Use it as a sim name
@ -4386,7 +4314,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
// TODO: Parameter check logic required. // TODO: Parameter check logic required.
m_host.CollisionSound = KeyOrName(impact_sound, AssetType.Sound); m_host.CollisionSound = ScriptUtils.GetAssetIdFromKeyOrItemName(m_host, impact_sound, AssetType.Sound);
m_host.CollisionSoundVolume = (float)impact_volume; m_host.CollisionSoundVolume = (float)impact_volume;
} }
@ -5912,7 +5840,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
if (m_SoundModule != null) if (m_SoundModule != null)
{ {
m_SoundModule.TriggerSoundLimited(m_host.UUID, m_SoundModule.TriggerSoundLimited(m_host.UUID,
KeyOrName(sound, AssetType.Sound), volume, ScriptUtils.GetAssetIdFromKeyOrItemName(m_host, sound, AssetType.Sound), volume,
bottom_south_west, top_north_east); bottom_south_west, top_north_east);
} }
} }
@ -6346,7 +6274,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
break; break;
case (int)ScriptBaseClass.PSYS_SRC_TEXTURE: case (int)ScriptBaseClass.PSYS_SRC_TEXTURE:
prules.Texture = KeyOrName(rules.GetLSLStringItem(i + 1)); prules.Texture = ScriptUtils.GetAssetIdFromKeyOrItemName(m_host, rules.GetLSLStringItem(i + 1));
break; break;
case (int)ScriptBaseClass.PSYS_SRC_BURST_RATE: case (int)ScriptBaseClass.PSYS_SRC_BURST_RATE:
@ -7269,9 +7197,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
UUID sculptId; UUID sculptId;
if (!UUID.TryParse(map, out sculptId)) if (!UUID.TryParse(map, out sculptId))
{ sculptId = ScriptUtils.GetAssetIdFromItemName(m_host, map, (int)AssetType.Texture);
sculptId = InventoryKey(map, (int)AssetType.Texture);
}
if (sculptId == UUID.Zero) if (sculptId == UUID.Zero)
return; return;
@ -7668,6 +7594,22 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
part.ScriptSetPhysicsStatus(physics); part.ScriptSetPhysicsStatus(physics);
break; break;
case (int)ScriptBaseClass.PRIM_PHYSICS_SHAPE_TYPE:
if (remain < 1)
return null;
int shape_type = rules.GetLSLIntegerItem(idx++);
ExtraPhysicsData physdata = new ExtraPhysicsData();
physdata.Density = part.Density;
physdata.Bounce = part.Restitution;
physdata.GravitationModifier = part.GravityModifier;
physdata.PhysShapeType = (PhysShapeType)shape_type;
part.UpdateExtraPhysics(physdata);
break;
case (int)ScriptBaseClass.PRIM_TEMP_ON_REZ: case (int)ScriptBaseClass.PRIM_TEMP_ON_REZ:
if (remain < 1) if (remain < 1)
return null; return null;

View File

@ -29,8 +29,10 @@ using System;
using System.Reflection; using System.Reflection;
using System.Collections; using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using System.Reflection;
using System.Runtime.Remoting.Lifetime; using System.Runtime.Remoting.Lifetime;
using System.Threading; using System.Threading;
using log4net;
using OpenMetaverse; using OpenMetaverse;
using Nini.Config; using Nini.Config;
using OpenSim; using OpenSim;
@ -56,6 +58,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
[Serializable] [Serializable]
public class MOD_Api : MarshalByRefObject, IMOD_Api, IScriptApi public class MOD_Api : MarshalByRefObject, IMOD_Api, IScriptApi
{ {
// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
internal IScriptEngine m_ScriptEngine; internal IScriptEngine m_ScriptEngine;
internal SceneObjectPart m_host; internal SceneObjectPart m_host;
internal TaskInventoryItem m_item; internal TaskInventoryItem m_item;
@ -109,8 +113,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
if (message.Length > 1023) if (message.Length > 1023)
message = message.Substring(0, 1023); message = message.Substring(0, 1023);
World.SimChat(Utils.StringToBytes(message), World.SimChat(
ChatTypeEnum.Shout, ScriptBaseClass.DEBUG_CHANNEL, m_host.ParentGroup.RootPart.AbsolutePosition, m_host.Name, m_host.UUID, true); Utils.StringToBytes(message),
ChatTypeEnum.Shout, ScriptBaseClass.DEBUG_CHANNEL,
m_host.ParentGroup.RootPart.AbsolutePosition, m_host.Name, m_host.UUID, false);
IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>(); IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>();
wComm.DeliverMessage(ChatTypeEnum.Shout, ScriptBaseClass.DEBUG_CHANNEL, m_host.Name, m_host.UUID, message); wComm.DeliverMessage(ChatTypeEnum.Shout, ScriptBaseClass.DEBUG_CHANNEL, m_host.Name, m_host.UUID, message);
@ -124,6 +130,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
/// <returns>string result of the invocation</returns> /// <returns>string result of the invocation</returns>
public void modInvokeN(string fname, params object[] parms) public void modInvokeN(string fname, params object[] parms)
{ {
// m_log.DebugFormat(
// "[MOD API]: Invoking dynamic function {0}, args '{1}' with {2} return type",
// fname,
// string.Join(",", Array.ConvertAll<object, string>(parms, o => o.ToString())),
// ((MethodInfo)MethodBase.GetCurrentMethod()).ReturnType);
Type returntype = m_comms.LookupReturnType(fname); Type returntype = m_comms.LookupReturnType(fname);
if (returntype != typeof(string)) if (returntype != typeof(string))
MODError(String.Format("return type mismatch for {0}",fname)); MODError(String.Format("return type mismatch for {0}",fname));
@ -133,6 +145,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public LSL_String modInvokeS(string fname, params object[] parms) public LSL_String modInvokeS(string fname, params object[] parms)
{ {
// m_log.DebugFormat(
// "[MOD API]: Invoking dynamic function {0}, args '{1}' with {2} return type",
// fname,
// string.Join(",", Array.ConvertAll<object, string>(parms, o => o.ToString())),
// ((MethodInfo)MethodBase.GetCurrentMethod()).ReturnType);
Type returntype = m_comms.LookupReturnType(fname); Type returntype = m_comms.LookupReturnType(fname);
if (returntype != typeof(string)) if (returntype != typeof(string))
MODError(String.Format("return type mismatch for {0}",fname)); MODError(String.Format("return type mismatch for {0}",fname));
@ -143,6 +161,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public LSL_Integer modInvokeI(string fname, params object[] parms) public LSL_Integer modInvokeI(string fname, params object[] parms)
{ {
// m_log.DebugFormat(
// "[MOD API]: Invoking dynamic function {0}, args '{1}' with {2} return type",
// fname,
// string.Join(",", Array.ConvertAll<object, string>(parms, o => o.ToString())),
// ((MethodInfo)MethodBase.GetCurrentMethod()).ReturnType);
Type returntype = m_comms.LookupReturnType(fname); Type returntype = m_comms.LookupReturnType(fname);
if (returntype != typeof(int)) if (returntype != typeof(int))
MODError(String.Format("return type mismatch for {0}",fname)); MODError(String.Format("return type mismatch for {0}",fname));
@ -153,6 +177,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public LSL_Float modInvokeF(string fname, params object[] parms) public LSL_Float modInvokeF(string fname, params object[] parms)
{ {
// m_log.DebugFormat(
// "[MOD API]: Invoking dynamic function {0}, args '{1}' with {2} return type",
// fname,
// string.Join(",", Array.ConvertAll<object, string>(parms, o => o.ToString())),
// ((MethodInfo)MethodBase.GetCurrentMethod()).ReturnType);
Type returntype = m_comms.LookupReturnType(fname); Type returntype = m_comms.LookupReturnType(fname);
if (returntype != typeof(float)) if (returntype != typeof(float))
MODError(String.Format("return type mismatch for {0}",fname)); MODError(String.Format("return type mismatch for {0}",fname));
@ -163,6 +193,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public LSL_Key modInvokeK(string fname, params object[] parms) public LSL_Key modInvokeK(string fname, params object[] parms)
{ {
// m_log.DebugFormat(
// "[MOD API]: Invoking dynamic function {0}, args '{1}' with {2} return type",
// fname,
// string.Join(",", Array.ConvertAll<object, string>(parms, o => o.ToString())),
// ((MethodInfo)MethodBase.GetCurrentMethod()).ReturnType);
Type returntype = m_comms.LookupReturnType(fname); Type returntype = m_comms.LookupReturnType(fname);
if (returntype != typeof(UUID)) if (returntype != typeof(UUID))
MODError(String.Format("return type mismatch for {0}",fname)); MODError(String.Format("return type mismatch for {0}",fname));
@ -173,6 +209,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public LSL_Vector modInvokeV(string fname, params object[] parms) public LSL_Vector modInvokeV(string fname, params object[] parms)
{ {
// m_log.DebugFormat(
// "[MOD API]: Invoking dynamic function {0}, args '{1}' with {2} return type",
// fname,
// string.Join(",", Array.ConvertAll<object, string>(parms, o => o.ToString())),
// ((MethodInfo)MethodBase.GetCurrentMethod()).ReturnType);
Type returntype = m_comms.LookupReturnType(fname); Type returntype = m_comms.LookupReturnType(fname);
if (returntype != typeof(OpenMetaverse.Vector3)) if (returntype != typeof(OpenMetaverse.Vector3))
MODError(String.Format("return type mismatch for {0}",fname)); MODError(String.Format("return type mismatch for {0}",fname));
@ -183,6 +225,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public LSL_Rotation modInvokeR(string fname, params object[] parms) public LSL_Rotation modInvokeR(string fname, params object[] parms)
{ {
// m_log.DebugFormat(
// "[MOD API]: Invoking dynamic function {0}, args '{1}' with {2} return type",
// fname,
// string.Join(",", Array.ConvertAll<object, string>(parms, o => o.ToString())),
// ((MethodInfo)MethodBase.GetCurrentMethod()).ReturnType);
Type returntype = m_comms.LookupReturnType(fname); Type returntype = m_comms.LookupReturnType(fname);
if (returntype != typeof(OpenMetaverse.Quaternion)) if (returntype != typeof(OpenMetaverse.Quaternion))
MODError(String.Format("return type mismatch for {0}",fname)); MODError(String.Format("return type mismatch for {0}",fname));
@ -193,6 +241,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public LSL_List modInvokeL(string fname, params object[] parms) public LSL_List modInvokeL(string fname, params object[] parms)
{ {
// m_log.DebugFormat(
// "[MOD API]: Invoking dynamic function {0}, args '{1}' with {2} return type",
// fname,
// string.Join(",", Array.ConvertAll<object, string>(parms, o => o.ToString())),
// ((MethodInfo)MethodBase.GetCurrentMethod()).ReturnType);
Type returntype = m_comms.LookupReturnType(fname); Type returntype = m_comms.LookupReturnType(fname);
if (returntype != typeof(object[])) if (returntype != typeof(object[]))
MODError(String.Format("return type mismatch for {0}",fname)); MODError(String.Format("return type mismatch for {0}",fname));
@ -250,6 +304,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
return ""; return "";
} }
// m_log.DebugFormat(
// "[MOD API]: Invoking dynamic function {0}, args '{1}' with {2} return type",
// fname,
// string.Join(",", Array.ConvertAll<object, string>(parms, o => o.ToString())),
// ((MethodInfo)MethodBase.GetCurrentMethod()).ReturnType);
Type[] signature = m_comms.LookupTypeSignature(fname); Type[] signature = m_comms.LookupTypeSignature(fname);
if (signature.Length != parms.Length) if (signature.Length != parms.Length)
MODError(String.Format("wrong number of parameters to function {0}",fname)); MODError(String.Format("wrong number of parameters to function {0}",fname));

View File

@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// Build Number // Build Number
// Revision // Revision
// //
[assembly: AssemblyVersion("0.7.5.*")] [assembly: AssemblyVersion("0.7.6.*")]
[assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]

View File

@ -661,6 +661,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
public const int PRIM_MEDIA_PERM_GROUP = 2; public const int PRIM_MEDIA_PERM_GROUP = 2;
public const int PRIM_MEDIA_PERM_ANYONE = 4; public const int PRIM_MEDIA_PERM_ANYONE = 4;
public const int PRIM_PHYSICS_SHAPE_TYPE = 30;
public const int PRIM_PHYSICS_SHAPE_PRIM = 0;
public const int PRIM_PHYSICS_SHAPE_CONVEX = 2;
public const int PRIM_PHYSICS_SHAPE_NONE = 1;
public const int PRIM_PHYSICS_MATERIAL = 31;
public const int DENSITY = 1;
public const int FRICTION = 2;
public const int RESTITUTION = 4;
public const int GRAVITY_MULTIPLIER = 8;
// extra constants for llSetPrimMediaParams // extra constants for llSetPrimMediaParams
public static readonly LSLInteger LSL_STATUS_OK = new LSLInteger(0); public static readonly LSLInteger LSL_STATUS_OK = new LSLInteger(0);
public static readonly LSLInteger LSL_STATUS_MALFORMED_PARAMS = new LSLInteger(1000); public static readonly LSLInteger LSL_STATUS_MALFORMED_PARAMS = new LSLInteger(1000);

View File

@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// Build Number // Build Number
// Revision // Revision
// //
[assembly: AssemblyVersion("0.7.5.*")] [assembly: AssemblyVersion("0.7.6.*")]
[assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]

View File

@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// Build Number // Build Number
// Revision // Revision
// //
[assembly: AssemblyVersion("0.7.5.*")] [assembly: AssemblyVersion("0.7.6.*")]
[assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]

View File

@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// Build Number // Build Number
// Revision // Revision
// //
[assembly: AssemblyVersion("0.7.5.*")] [assembly: AssemblyVersion("0.7.6.*")]
[assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]

View File

@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// Build Number // Build Number
// Revision // Revision
// //
[assembly: AssemblyVersion("0.7.5.*")] [assembly: AssemblyVersion("0.7.6.*")]
[assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]

View File

@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// Build Number // Build Number
// Revision // Revision
// //
[assembly: AssemblyVersion("0.7.5.*")] [assembly: AssemblyVersion("0.7.6.*")]
[assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]

View File

@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// Build Number // Build Number
// Revision // Revision
// //
[assembly: AssemblyVersion("0.7.5.*")] [assembly: AssemblyVersion("0.7.6.*")]
[assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]

View File

@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// Build Number // Build Number
// Revision // Revision
// //
[assembly: AssemblyVersion("0.7.5.*")] [assembly: AssemblyVersion("0.7.6.*")]
[assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]

View File

@ -420,7 +420,7 @@ namespace OpenSim.Region.UserStatistics
Encoding encoding = Encoding.ASCII; Encoding encoding = Encoding.ASCII;
int sizeOfChar = encoding.GetByteCount("\n"); int sizeOfChar = encoding.GetByteCount("\n");
byte[] buffer = encoding.GetBytes("\n"); byte[] buffer = encoding.GetBytes("\n");
string logfile = Util.logDir() + "/" + "OpenSim.log"; string logfile = Util.logFile();
FileStream fs = new FileStream(logfile, FileMode.Open, FileAccess.Read, FileShare.ReadWrite); FileStream fs = new FileStream(logfile, FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
Int64 tokenCount = 0; Int64 tokenCount = 0;
Int64 endPosition = fs.Length / sizeOfChar; Int64 endPosition = fs.Length / sizeOfChar;

View File

@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// Build Number // Build Number
// Revision // Revision
// //
[assembly: AssemblyVersion("0.7.5.*")] [assembly: AssemblyVersion("0.7.6.*")]
[assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]

View File

@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// Build Number // Build Number
// Revision // Revision
// //
[assembly: AssemblyVersion("0.7.5.*")] [assembly: AssemblyVersion("0.7.6.*")]
[assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]

View File

@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// Build Number // Build Number
// Revision // Revision
// //
[assembly: AssemblyVersion("0.7.5.*")] [assembly: AssemblyVersion("0.7.6.*")]
[assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]

View File

@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// Build Number // Build Number
// Revision // Revision
// //
[assembly: AssemblyVersion("0.7.5.*")] [assembly: AssemblyVersion("0.7.6.*")]
[assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]

View File

@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// Build Number // Build Number
// Revision // Revision
// //
[assembly: AssemblyVersion("0.7.5.*")] [assembly: AssemblyVersion("0.7.6.*")]
[assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]

View File

@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// Build Number // Build Number
// Revision // Revision
// //
[assembly: AssemblyVersion("0.7.5.*")] [assembly: AssemblyVersion("0.7.6.*")]
[assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]

Some files were not shown because too many files have changed in this diff Show More