diff --git a/CONTRIBUTORS.txt b/CONTRIBUTORS.txt index 8181483aa1..a4bcb91753 100644 --- a/CONTRIBUTORS.txt +++ b/CONTRIBUTORS.txt @@ -87,6 +87,7 @@ what it is today. * Garmin Kawaguichi * Gerhard * Godfrey +* Greg C. * Grumly57 * GuduleLapointe * Ewe Loon diff --git a/OpenSim/Data/MSSQL/MSSQLSimulationData.cs b/OpenSim/Data/MSSQL/MSSQLSimulationData.cs index bc5beebf2e..0d09be6361 100644 --- a/OpenSim/Data/MSSQL/MSSQLSimulationData.cs +++ b/OpenSim/Data/MSSQL/MSSQLSimulationData.cs @@ -351,7 +351,7 @@ IF EXISTS (SELECT UUID FROM prims WHERE UUID = @UUID) ScriptAccessPin = @ScriptAccessPin, AllowedDrop = @AllowedDrop, DieAtEdge = @DieAtEdge, SalePrice = @SalePrice, SaleType = @SaleType, ColorR = @ColorR, ColorG = @ColorG, ColorB = @ColorB, ColorA = @ColorA, ParticleSystem = @ParticleSystem, ClickAction = @ClickAction, Material = @Material, CollisionSound = @CollisionSound, CollisionSoundVolume = @CollisionSoundVolume, PassTouches = @PassTouches, - LinkNumber = @LinkNumber, MediaURL = @MediaURL, DynAttrs = @DynAttrs, + LinkNumber = @LinkNumber, MediaURL = @MediaURL, AttachedPosX = @AttachedPosX, AttachedPosY = @AttachedPosY, AttachedPosZ = @AttachedPosZ, DynAttrs = @DynAttrs, PhysicsShapeType = @PhysicsShapeType, Density = @Density, GravityModifier = @GravityModifier, Friction = @Friction, Restitution = @Restitution WHERE UUID = @UUID END @@ -367,7 +367,7 @@ ELSE PayPrice, PayButton1, PayButton2, PayButton3, PayButton4, LoopedSound, LoopedSoundGain, TextureAnimation, OmegaX, OmegaY, OmegaZ, CameraEyeOffsetX, CameraEyeOffsetY, CameraEyeOffsetZ, CameraAtOffsetX, CameraAtOffsetY, CameraAtOffsetZ, ForceMouselook, ScriptAccessPin, AllowedDrop, DieAtEdge, SalePrice, SaleType, ColorR, ColorG, ColorB, ColorA, - ParticleSystem, ClickAction, Material, CollisionSound, CollisionSoundVolume, PassTouches, LinkNumber, MediaURL, DynAttrs, + ParticleSystem, ClickAction, Material, CollisionSound, CollisionSoundVolume, PassTouches, LinkNumber, MediaURL, AttachedPosX, AttachedPosY, AttachedPosZ, DynAttrs, PhysicsShapeType, Density, GravityModifier, Friction, Restitution ) VALUES ( @UUID, @CreationDate, @Name, @Text, @Description, @SitName, @TouchName, @ObjectFlags, @OwnerMask, @NextOwnerMask, @GroupMask, @@ -378,7 +378,7 @@ ELSE @PayPrice, @PayButton1, @PayButton2, @PayButton3, @PayButton4, @LoopedSound, @LoopedSoundGain, @TextureAnimation, @OmegaX, @OmegaY, @OmegaZ, @CameraEyeOffsetX, @CameraEyeOffsetY, @CameraEyeOffsetZ, @CameraAtOffsetX, @CameraAtOffsetY, @CameraAtOffsetZ, @ForceMouselook, @ScriptAccessPin, @AllowedDrop, @DieAtEdge, @SalePrice, @SaleType, @ColorR, @ColorG, @ColorB, @ColorA, - @ParticleSystem, @ClickAction, @Material, @CollisionSound, @CollisionSoundVolume, @PassTouches, @LinkNumber, @MediaURL, @DynAttrs, + @ParticleSystem, @ClickAction, @Material, @CollisionSound, @CollisionSoundVolume, @PassTouches, @LinkNumber, @MediaURL, @AttachedPosX, @AttachedPosY, @AttachedPosZ, @DynAttrs, @PhysicsShapeType, @Density, @GravityModifier, @Friction, @Restitution ) END"; @@ -1695,6 +1695,12 @@ VALUES if (!(primRow["MediaURL"] is System.DBNull)) prim.MediaUrl = (string)primRow["MediaURL"]; + if (!(primRow["AttachedPosX"] is System.DBNull)) + prim.AttachedPos = new Vector3( + Convert.ToSingle(primRow["AttachedPosX"]), + Convert.ToSingle(primRow["AttachedPosY"]), + Convert.ToSingle(primRow["AttachedPosZ"])); + if (!(primRow["DynAttrs"] is System.DBNull)) prim.DynAttrs = DAMap.FromXml((string)primRow["DynAttrs"]); else @@ -2099,7 +2105,10 @@ VALUES parameters.Add(_Database.CreateParameter("PassTouches", 0)); parameters.Add(_Database.CreateParameter("LinkNumber", prim.LinkNum)); parameters.Add(_Database.CreateParameter("MediaURL", prim.MediaUrl)); - + parameters.Add(_Database.CreateParameter("AttachedPosX", prim.AttachedPos.X)); + parameters.Add(_Database.CreateParameter("AttachedPosY", prim.AttachedPos.Y)); + parameters.Add(_Database.CreateParameter("AttachedPosZ", prim.AttachedPos.Z)); + if (prim.DynAttrs.CountNamespaces > 0) parameters.Add(_Database.CreateParameter("DynAttrs", prim.DynAttrs.ToXml())); else diff --git a/OpenSim/Data/MSSQL/Resources/RegionStore.migrations b/OpenSim/Data/MSSQL/Resources/RegionStore.migrations index 4549801218..bb898845b4 100644 --- a/OpenSim/Data/MSSQL/Resources/RegionStore.migrations +++ b/OpenSim/Data/MSSQL/Resources/RegionStore.migrations @@ -1168,3 +1168,15 @@ ALTER TABLE prims ADD `Friction` double NOT NULL default '0.6'; ALTER TABLE prims ADD `Restitution` double NOT NULL default '0.5'; COMMIT + +:VERSION 40 #---------------- Save Attachment info + +BEGIN TRANSACTION + +ALTER TABLE prims ADD AttachedPosX float(53) default 0.0; +ALTER TABLE prims ADD AttachedPosY float(53) default 0.0; +ALTER TABLE prims ADD AttachedPosZ float(53) default 0.0; +ALTER TABLE primshapes ADD LastAttachPoint int not null default 0; + +COMMIT + diff --git a/OpenSim/Data/MySQL/MySQLSimulationData.cs b/OpenSim/Data/MySQL/MySQLSimulationData.cs index feacbb2ee3..1b3e81e767 100644 --- a/OpenSim/Data/MySQL/MySQLSimulationData.cs +++ b/OpenSim/Data/MySQL/MySQLSimulationData.cs @@ -174,7 +174,8 @@ namespace OpenSim.Data.MySQL "CollisionSound, CollisionSoundVolume, " + "PassTouches, " + "PassCollisions, " + - "LinkNumber, MediaURL, KeyframeMotion, " + + "LinkNumber, MediaURL, KeyframeMotion, AttachedPosX, " + + "AttachedPosY, AttachedPosZ, " + "PhysicsShapeType, Density, GravityModifier, " + "Friction, Restitution, Vehicle, DynAttrs " + ") values (" + "?UUID, " + @@ -209,7 +210,8 @@ namespace OpenSim.Data.MySQL "?ColorB, ?ColorA, ?ParticleSystem, " + "?ClickAction, ?Material, ?CollisionSound, " + "?CollisionSoundVolume, ?PassTouches, ?PassCollisions, " + - "?LinkNumber, ?MediaURL, ?KeyframeMotion, " + + "?LinkNumber, ?MediaURL, ?KeyframeMotion, ?AttachedPosX, " + + "?AttachedPosY, ?AttachedPosZ, " + "?PhysicsShapeType, ?Density, ?GravityModifier, " + "?Friction, ?Restitution, ?Vehicle, ?DynAttrs)"; @@ -228,7 +230,7 @@ namespace OpenSim.Data.MySQL "PathTaperX, PathTaperY, PathTwist, " + "PathTwistBegin, ProfileBegin, ProfileEnd, " + "ProfileCurve, ProfileHollow, Texture, " + - "ExtraParams, State, Media) " + + "ExtraParams, State, LastAttachPoint, Media) " + "values (?UUID, " + "?Shape, ?ScaleX, ?ScaleY, ?ScaleZ, " + "?PCode, ?PathBegin, ?PathEnd, " + @@ -240,7 +242,7 @@ namespace OpenSim.Data.MySQL "?PathTwistBegin, ?ProfileBegin, " + "?ProfileEnd, ?ProfileCurve, " + "?ProfileHollow, ?Texture, ?ExtraParams, " + - "?State, ?Media)"; + "?State, ?LastAttachPoint, ?Media)"; FillShapeCommand(cmd, prim); @@ -1320,7 +1322,16 @@ namespace OpenSim.Data.MySQL if (!(row["MediaURL"] is System.DBNull)) prim.MediaUrl = (string)row["MediaURL"]; - + + if (!(row["AttachedPosX"] is System.DBNull)) + { + prim.AttachedPos = new Vector3( + (float)(double)row["AttachedPosX"], + (float)(double)row["AttachedPosY"], + (float)(double)row["AttachedPosZ"] + ); + } + if (!(row["DynAttrs"] is System.DBNull)) prim.DynAttrs = DAMap.FromXml((string)row["DynAttrs"]); else @@ -1719,6 +1730,12 @@ namespace OpenSim.Data.MySQL cmd.Parameters.AddWithValue("LinkNumber", prim.LinkNum); cmd.Parameters.AddWithValue("MediaURL", prim.MediaUrl); + if (prim.AttachedPos != null) + { + cmd.Parameters.AddWithValue("AttachedPosX", (double)prim.AttachedPos.X); + cmd.Parameters.AddWithValue("AttachedPosY", (double)prim.AttachedPos.Y); + cmd.Parameters.AddWithValue("AttachedPosZ", (double)prim.AttachedPos.Z); + } if (prim.KeyframeMotion != null) cmd.Parameters.AddWithValue("KeyframeMotion", prim.KeyframeMotion.Serialize()); @@ -1932,6 +1949,7 @@ namespace OpenSim.Data.MySQL s.ExtraParams = (byte[])row["ExtraParams"]; s.State = (byte)(int)row["State"]; + s.LastAttachPoint = (byte)(int)row["LastAttachPoint"]; if (!(row["Media"] is System.DBNull)) s.Media = PrimitiveBaseShape.MediaList.FromXml((string)row["Media"]); @@ -1978,6 +1996,7 @@ namespace OpenSim.Data.MySQL cmd.Parameters.AddWithValue("Texture", s.TextureEntry); cmd.Parameters.AddWithValue("ExtraParams", s.ExtraParams); cmd.Parameters.AddWithValue("State", s.State); + cmd.Parameters.AddWithValue("LastAttachPoint", s.LastAttachPoint); cmd.Parameters.AddWithValue("Media", null == s.Media ? null : s.Media.ToXml()); } diff --git a/OpenSim/Data/MySQL/Resources/RegionStore.migrations b/OpenSim/Data/MySQL/Resources/RegionStore.migrations index bda1b6a60d..c2e3afe7ae 100644 --- a/OpenSim/Data/MySQL/Resources/RegionStore.migrations +++ b/OpenSim/Data/MySQL/Resources/RegionStore.migrations @@ -922,3 +922,20 @@ 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; + +:VERSION 48 #---------------- Keyframes + +BEGIN; + +ALTER TABLE prims ADD COLUMN `KeyframeMotion` blob; + +COMMIT; + +:VERSION 49 #--------------------- Save attachment info + +BEGIN; +ALTER TABLE prims ADD COLUMN AttachedPosX double default 0; +ALTER TABLE prims ADD COLUMN AttachedPosY double default 0; +ALTER TABLE prims ADD COLUMN AttachedPosZ double default 0; +ALTER TABLE primshapes ADD COLUMN LastAttachPoint int(4) not null default '0'; +COMMIT; diff --git a/OpenSim/Data/SQLite/Resources/RegionStore.migrations b/OpenSim/Data/SQLite/Resources/RegionStore.migrations index bff039d75d..901068ff65 100644 --- a/OpenSim/Data/SQLite/Resources/RegionStore.migrations +++ b/OpenSim/Data/SQLite/Resources/RegionStore.migrations @@ -600,3 +600,15 @@ BEGIN; ALTER TABLE prims ADD COLUMN `KeyframeMotion` blob; COMMIT; + +:VERSION 30 #---------------- Save Attachment info + +BEGIN; + +ALTER TABLE prims ADD COLUMN AttachedPosX double default '0'; +ALTER TABLE prims ADD COLUMN AttachedPosY double default '0'; +ALTER TABLE prims ADD COLUMN AttachedPosZ double default '0'; +ALTER TABLE primshapes ADD COLUMN LastAttachPoint int not null default '0'; + +COMMIT; + diff --git a/OpenSim/Data/SQLite/SQLiteSimulationData.cs b/OpenSim/Data/SQLite/SQLiteSimulationData.cs index 52502b359a..4d6a80ad22 100644 --- a/OpenSim/Data/SQLite/SQLiteSimulationData.cs +++ b/OpenSim/Data/SQLite/SQLiteSimulationData.cs @@ -1236,6 +1236,10 @@ namespace OpenSim.Data.SQLite createCol(prims, "MediaURL", typeof(String)); + createCol(prims, "AttachedPosX", typeof(Double)); + createCol(prims, "AttachedPosY", typeof(Double)); + createCol(prims, "AttachedPosZ", typeof(Double)); + createCol(prims, "DynAttrs", typeof(String)); createCol(prims, "PhysicsShapeType", typeof(Byte)); @@ -1724,6 +1728,12 @@ namespace OpenSim.Data.SQLite prim.MediaUrl = (string)row["MediaURL"]; } + prim.AttachedPos = new Vector3( + Convert.ToSingle(row["AttachedPosX"]), + Convert.ToSingle(row["AttachedPosY"]), + Convert.ToSingle(row["AttachedPosZ"]) + ); + if (!(row["DynAttrs"] is System.DBNull)) { //m_log.DebugFormat("[SQLITE]: DynAttrs type [{0}]", row["DynAttrs"].GetType()); @@ -2176,6 +2186,10 @@ namespace OpenSim.Data.SQLite row["MediaURL"] = prim.MediaUrl; + row["AttachedPosX"] = prim.AttachedPos.X; + row["AttachedPosY"] = prim.AttachedPos.Y; + row["AttachedPosZ"] = prim.AttachedPos.Z; + if (prim.DynAttrs.CountNamespaces > 0) row["DynAttrs"] = prim.DynAttrs.ToXml(); else @@ -2444,6 +2458,7 @@ namespace OpenSim.Data.SQLite s.ProfileCurve = Convert.ToByte(row["ProfileCurve"]); s.ProfileHollow = Convert.ToUInt16(row["ProfileHollow"]); s.State = Convert.ToByte(row["State"]); + s.LastAttachPoint = Convert.ToByte(row["LastAttachPoint"]); byte[] textureEntry = (byte[])row["Texture"]; s.TextureEntry = textureEntry; @@ -2493,6 +2508,7 @@ namespace OpenSim.Data.SQLite row["ProfileCurve"] = s.ProfileCurve; row["ProfileHollow"] = s.ProfileHollow; row["State"] = s.State; + row["LastAttachPoint"] = s.LastAttachPoint; row["Texture"] = s.TextureEntry; row["ExtraParams"] = s.ExtraParams; diff --git a/OpenSim/Framework/IScene.cs b/OpenSim/Framework/IScene.cs index 8164f4198c..e1b6d1e1ad 100644 --- a/OpenSim/Framework/IScene.cs +++ b/OpenSim/Framework/IScene.cs @@ -86,24 +86,26 @@ namespace OpenSim.Framework event restart OnRestart; /// - /// Add a new client and create a presence for it. All clients except initial login clients will starts off as a child agent + /// Add a new agent with an attached client. All agents except initial login clients will starts off as a child agent /// - the later agent crossing will promote it to a root agent. /// /// /// The type of agent to add. /// /// The scene agent if the new client was added or if an agent that already existed. - ISceneAgent AddNewClient(IClientAPI client, PresenceType type); + ISceneAgent AddNewAgent(IClientAPI client, PresenceType type); /// - /// Remove the given client from the scene. + /// Tell a single agent to disconnect from the region. /// /// - /// Close the neighbour child agents associated with this client. - void RemoveClient(UUID agentID, bool closeChildAgents); + /// + /// Force the agent to close even if it might be in the middle of some other operation. You do not want to + /// force unless you are absolutely sure that the agent is dead and a normal close is not working. + /// + bool CloseAgent(UUID agentID, bool force); void Restart(); - //RegionInfo OtherRegionUp(RegionInfo thisRegion); string GetSimulatorVersion(); diff --git a/OpenSim/Framework/PrimitiveBaseShape.cs b/OpenSim/Framework/PrimitiveBaseShape.cs index df928dc226..6a12a45307 100644 --- a/OpenSim/Framework/PrimitiveBaseShape.cs +++ b/OpenSim/Framework/PrimitiveBaseShape.cs @@ -105,6 +105,7 @@ namespace OpenSim.Framework private ushort _profileHollow; private Vector3 _scale; private byte _state; + private byte _lastattach; private ProfileShape _profileShape; private HollowShape _hollowShape; @@ -207,6 +208,7 @@ namespace OpenSim.Framework PCode = (byte)prim.PrimData.PCode; State = prim.PrimData.State; + LastAttachPoint = prim.PrimData.State; PathBegin = Primitive.PackBeginCut(prim.PrimData.PathBegin); PathEnd = Primitive.PackEndCut(prim.PrimData.PathEnd); PathScaleX = Primitive.PackPathScale(prim.PrimData.PathScaleX); @@ -583,6 +585,15 @@ namespace OpenSim.Framework } } + public byte LastAttachPoint { + get { + return _lastattach; + } + set { + _lastattach = value; + } + } + public ProfileShape ProfileShape { get { return _profileShape; diff --git a/OpenSim/Framework/RegionSettings.cs b/OpenSim/Framework/RegionSettings.cs index 47a27807b2..2c6529d6b1 100644 --- a/OpenSim/Framework/RegionSettings.cs +++ b/OpenSim/Framework/RegionSettings.cs @@ -200,7 +200,7 @@ namespace OpenSim.Framework set { m_ObjectBonus = value; } } - private int m_Maturity = 1; + private int m_Maturity = 0; public int Maturity { diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs index f4b4156e39..ed733cf1a9 100644 --- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs +++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs @@ -1057,7 +1057,21 @@ namespace OpenSim.Framework.Servers.HttpServer } response.ContentType = "text/xml"; - responseString = XmlRpcResponseSerializer.Singleton.Serialize(xmlRpcResponse); + using (MemoryStream outs = new MemoryStream()) + { + using (XmlTextWriter writer = new XmlTextWriter(outs, Encoding.UTF8)) + { + writer.Formatting = Formatting.None; + XmlRpcResponseSerializer.Singleton.Serialize(writer, xmlRpcResponse); + writer.Flush(); + outs.Flush(); + outs.Position = 0; + using (StreamReader sr = new StreamReader(outs)) + { + responseString = sr.ReadToEnd(); + } + } + } } else { diff --git a/OpenSim/Region/Application/ConfigurationLoader.cs b/OpenSim/Region/Application/ConfigurationLoader.cs index bc7ecb71d1..010ae5aacc 100644 --- a/OpenSim/Region/Application/ConfigurationLoader.cs +++ b/OpenSim/Region/Application/ConfigurationLoader.cs @@ -203,10 +203,10 @@ namespace OpenSim m_config.Source.Merge(envConfigSource); } - ReadConfigSettings(); - m_config.Source.ExpandKeyValues(); + ReadConfigSettings(); + return m_config; } diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs index a18a6fec34..20f6af5f3d 100644 --- a/OpenSim/Region/Application/OpenSim.cs +++ b/OpenSim/Region/Application/OpenSim.cs @@ -237,27 +237,33 @@ namespace OpenSim m_console.Commands.AddCommand("General", false, "change region", "change region ", - "Change current console region", ChangeSelectedRegion); + "Change current console region", + ChangeSelectedRegion); m_console.Commands.AddCommand("Archiving", false, "save xml", "save xml", - "Save a region's data in XML format", SaveXml); + "Save a region's data in XML format", + SaveXml); m_console.Commands.AddCommand("Archiving", false, "save xml2", "save xml2", - "Save a region's data in XML2 format", SaveXml2); + "Save a region's data in XML2 format", + SaveXml2); m_console.Commands.AddCommand("Archiving", false, "load xml", "load xml [-newIDs [ ]]", - "Load a region's data from XML format", LoadXml); + "Load a region's data from XML format", + LoadXml); m_console.Commands.AddCommand("Archiving", false, "load xml2", "load xml2", - "Load a region's data from XML2 format", LoadXml2); + "Load a region's data from XML2 format", + LoadXml2); m_console.Commands.AddCommand("Archiving", false, "save prims xml2", "save prims xml2 [ ]", - "Save named prim to XML2", SavePrimsXml2); + "Save named prim to XML2", + SavePrimsXml2); m_console.Commands.AddCommand("Archiving", false, "load oar", "load oar [--merge] [--skip-assets] []", @@ -287,7 +293,8 @@ namespace OpenSim m_console.Commands.AddCommand("Objects", false, "edit scale", "edit scale ", - "Change the scale of a named prim", HandleEditScale); + "Change the scale of a named prim", + HandleEditScale); m_console.Commands.AddCommand("Users", false, "kick user", "kick user [--force] [message]", @@ -305,31 +312,38 @@ namespace OpenSim m_console.Commands.AddCommand("Comms", false, "show connections", "show connections", - "Show connection data", HandleShow); + "Show connection data", + HandleShow); m_console.Commands.AddCommand("Comms", false, "show circuits", "show circuits", - "Show agent circuit data", HandleShow); + "Show agent circuit data", + HandleShow); m_console.Commands.AddCommand("Comms", false, "show pending-objects", "show pending-objects", - "Show # of objects on the pending queues of all scene viewers", HandleShow); + "Show # of objects on the pending queues of all scene viewers", + HandleShow); m_console.Commands.AddCommand("General", false, "show modules", "show modules", - "Show module data", HandleShow); + "Show module data", + HandleShow); m_console.Commands.AddCommand("Regions", false, "show regions", "show regions", - "Show region data", HandleShow); + "Show region data", + HandleShow); m_console.Commands.AddCommand("Regions", false, "show ratings", "show ratings", - "Show rating data", HandleShow); + "Show rating data", + HandleShow); m_console.Commands.AddCommand("Objects", false, "backup", "backup", - "Persist currently unsaved object changes immediately instead of waiting for the normal persistence call.", RunCommand); + "Persist currently unsaved object changes immediately instead of waiting for the normal persistence call.", + RunCommand); m_console.Commands.AddCommand("Regions", false, "create region", "create region [\"region name\"] ", @@ -342,19 +356,23 @@ namespace OpenSim m_console.Commands.AddCommand("Regions", false, "restart", "restart", - "Restart all sims in this instance", RunCommand); + "Restart all sims in this instance", + RunCommand); m_console.Commands.AddCommand("General", false, "command-script", "command-script