diff --git a/OpenSim/Client/VWoHTTP/ClientStack/VWHClientView.cs b/OpenSim/Client/VWoHTTP/ClientStack/VWHClientView.cs index e3abcf5bac..bd061e7414 100644 --- a/OpenSim/Client/VWoHTTP/ClientStack/VWHClientView.cs +++ b/OpenSim/Client/VWoHTTP/ClientStack/VWHClientView.cs @@ -402,6 +402,7 @@ namespace OpenSim.Client.VWoHTTP.ClientStack public event PickInfoUpdate OnPickInfoUpdate = delegate { }; public event AvatarNotesUpdate OnAvatarNotesUpdate = delegate { }; public event MuteListRequest OnMuteListRequest = delegate { }; + public event AvatarInterestUpdate OnAvatarInterestUpdate = delegate { }; public event PlacesQuery OnPlacesQuery = delegate { }; @@ -1118,6 +1119,11 @@ namespace OpenSim.Client.VWoHTTP.ClientStack throw new System.NotImplementedException(); } + public void SendAvatarInterestUpdate(IClientAPI client, uint wantmask, string wanttext, uint skillsmask, string skillstext, string languages) + { + throw new System.NotImplementedException(); + } + public void SendParcelDwellReply(int localID, UUID parcelID, float dwell) { throw new System.NotImplementedException(); diff --git a/OpenSim/Data/MSSQL/MSSQLAuthenticationData.cs b/OpenSim/Data/MSSQL/MSSQLAuthenticationData.cs index 9a17e47a19..801610acd5 100644 --- a/OpenSim/Data/MSSQL/MSSQLAuthenticationData.cs +++ b/OpenSim/Data/MSSQL/MSSQLAuthenticationData.cs @@ -119,7 +119,7 @@ namespace OpenSim.Data.MSSQL updateBuilder.AppendFormat("{0} = @{0}",field); first = false; - cmd.Parameters.Add(m_database.CreateParameter("@" + field, data.Data[field])); + cmd.Parameters.Add(m_database.CreateParameter("@" + field, data.Data[field])); } updateBuilder.Append(" where UUID = @principalID"); @@ -135,7 +135,7 @@ namespace OpenSim.Data.MSSQL insertBuilder.AppendFormat("insert into {0} (UUID, ", m_Realm); insertBuilder.Append(String.Join(", ", fields)); - insertBuilder.Append(") values ( @principalID, @"); + insertBuilder.Append(") values (@principalID, @"); insertBuilder.Append(String.Join(", @", fields)); insertBuilder.Append(")"); diff --git a/OpenSim/Data/MSSQL/MSSQLLegacyRegionData.cs b/OpenSim/Data/MSSQL/MSSQLLegacyRegionData.cs index e2ae5cb3c5..cff6b00042 100644 --- a/OpenSim/Data/MSSQL/MSSQLLegacyRegionData.cs +++ b/OpenSim/Data/MSSQL/MSSQLLegacyRegionData.cs @@ -146,7 +146,7 @@ namespace OpenSim.Data.MSSQL sceneObjectPart.Name, sceneObjectPart.UUID, sceneObjectPart.GroupPosition, groupID); sceneObjectPart.UUID = groupID; - } + } grp = new SceneObjectGroup(sceneObjectPart); } diff --git a/OpenSim/Data/MSSQL/MSSQLRegionData.cs b/OpenSim/Data/MSSQL/MSSQLRegionData.cs index 78d7fd0ced..a898aabcb9 100644 --- a/OpenSim/Data/MSSQL/MSSQLRegionData.cs +++ b/OpenSim/Data/MSSQL/MSSQLRegionData.cs @@ -62,7 +62,7 @@ namespace OpenSim.Data.MSSQL conn.Open(); Migration m = new Migration(conn, GetType().Assembly, "GridStore"); m.Update(); - } + } } public List Get(string regionName, UUID scopeID) @@ -98,7 +98,7 @@ namespace OpenSim.Data.MSSQL return null; return ret[0]; - } + } } public RegionData Get(UUID regionID, UUID scopeID) @@ -251,7 +251,7 @@ namespace OpenSim.Data.MSSQL { string insert = "insert into [" + m_Realm + "] ([uuid], [ScopeID], [locX], [locY], [sizeX], [sizeY], [regionName], [" + String.Join("], [", fields) + - "]) values ( @regionID, @scopeID, @posX, @posY, @sizeX, @sizeY, @regionName, @" + String.Join(", @", fields) + ")"; + "]) values (@regionID, @scopeID, @posX, @posY, @sizeX, @sizeY, @regionName, @" + String.Join(", @", fields) + ")"; cmd.CommandText = insert; diff --git a/OpenSim/Data/MSSQL/MSSQLUserAccountData.cs b/OpenSim/Data/MSSQL/MSSQLUserAccountData.cs index 7b6e7c8a0c..2d92cb1dab 100644 --- a/OpenSim/Data/MSSQL/MSSQLUserAccountData.cs +++ b/OpenSim/Data/MSSQL/MSSQLUserAccountData.cs @@ -54,7 +54,7 @@ namespace OpenSim.Data.MSSQL conn.Open(); Migration m = new Migration(conn, GetType().Assembly, "UserStore"); m.Update(); - } + } } public List Query(UUID principalID, UUID scopeID, string query) @@ -134,7 +134,7 @@ namespace OpenSim.Data.MSSQL updateBuilder.AppendFormat("{0} = @{0}", field); first = false; - cmd.Parameters.Add(m_database.CreateParameter("@" + field, data.Data[field])); + cmd.Parameters.Add(m_database.CreateParameter("@" + field, data.Data[field])); } updateBuilder.Append(" where UUID = @principalID"); @@ -153,7 +153,7 @@ namespace OpenSim.Data.MSSQL StringBuilder insertBuilder = new StringBuilder(); insertBuilder.AppendFormat("insert into {0} (UUID, ScopeID, ", m_Realm); insertBuilder.Append(String.Join(", ", fields)); - insertBuilder.Append(") values ( @principalID, @scopeID, @"); + insertBuilder.Append(") values (@principalID, @scopeID, @"); insertBuilder.Append(String.Join(", @", fields)); insertBuilder.Append(")"); diff --git a/OpenSim/Framework/BlockingQueue.cs b/OpenSim/Framework/BlockingQueue.cs index 857930aaef..365816109b 100644 --- a/OpenSim/Framework/BlockingQueue.cs +++ b/OpenSim/Framework/BlockingQueue.cs @@ -67,8 +67,8 @@ namespace OpenSim.Framework return m_pqueue.Dequeue(); if (m_queue.Count > 0) - return m_queue.Dequeue(); - return default(T); + return m_queue.Dequeue(); + return default(T); } } @@ -121,7 +121,7 @@ namespace OpenSim.Framework { m_pqueue.Clear(); m_queue.Clear(); - Monitor.Pulse(m_queueSync); + Monitor.Pulse(m_queueSync); } } } diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs index 29846f5f2f..9fd043c62b 100644 --- a/OpenSim/Framework/IClientAPI.cs +++ b/OpenSim/Framework/IClientAPI.cs @@ -792,6 +792,7 @@ namespace OpenSim.Framework event PickGodDelete OnPickGodDelete; event PickInfoUpdate OnPickInfoUpdate; event AvatarNotesUpdate OnAvatarNotesUpdate; + event AvatarInterestUpdate OnAvatarInterestUpdate; event MuteListRequest OnMuteListRequest; diff --git a/OpenSim/Framework/RegionInfo.cs b/OpenSim/Framework/RegionInfo.cs index d3a5357e51..a7315f51fb 100644 --- a/OpenSim/Framework/RegionInfo.cs +++ b/OpenSim/Framework/RegionInfo.cs @@ -303,6 +303,7 @@ namespace OpenSim.Framework private int m_physPrimMax = 0; private bool m_clampPrimSize = false; private int m_objectCapacity = 0; + private string m_regionType = String.Empty; // Apparently, we're applying the same estatesettings regardless of whether it's local or remote. @@ -478,6 +479,11 @@ namespace OpenSim.Framework get { return (byte)Util.ConvertMaturityToAccessLevel((uint)RegionSettings.Maturity); } } + public string RegionType + { + get { return m_regionType; } + } + public void SetEndPoint(string ipaddr, int port) { IPAddress tmpIP = IPAddress.Parse(ipaddr); @@ -654,8 +660,8 @@ namespace OpenSim.Framework MasterAvatarAssignedUUID = new UUID(masterAvatarUUID); + m_regionType = config.GetString("RegionType", String.Empty); - // Prim stuff // m_nonphysPrimMax = config.GetInt("NonphysicalPrimMax", 256); @@ -721,6 +727,9 @@ namespace OpenSim.Framework if (ScopeID != UUID.Zero) config.Set("ScopeID", ScopeID.ToString()); + + if (RegionType != String.Empty) + config.Set("RegionType", RegionType); } public bool ignoreIncomingConfiguration(string configuration_key, object configuration_result) @@ -810,6 +819,9 @@ namespace OpenSim.Framework configMember.addConfigurationOption("scope_id", ConfigurationOption.ConfigurationTypes.TYPE_UUID, "Scope ID for this region", ScopeID.ToString(), true); + + configMember.addConfigurationOption("region_type", ConfigurationOption.ConfigurationTypes.TYPE_STRING, + "Region Type", String.Empty, true); } public void loadConfigurationOptions() @@ -873,6 +885,9 @@ namespace OpenSim.Framework configMember.addConfigurationOption("scope_id", ConfigurationOption.ConfigurationTypes.TYPE_UUID, "Scope ID for this region", UUID.Zero.ToString(), true); + + configMember.addConfigurationOption("region_type", ConfigurationOption.ConfigurationTypes.TYPE_STRING, + "Region Type", String.Empty, true); } public bool shouldMasterAvatarDetailsBeAsked(string configuration_key) @@ -953,6 +968,9 @@ namespace OpenSim.Framework case "scope_id": ScopeID = (UUID)configuration_result; break; + case "region_type": + m_regionType = (string)configuration_result; + break; } return true; @@ -988,6 +1006,8 @@ namespace OpenSim.Framework args["allow_alt_ports"] = OSD.FromBoolean(m_allow_alternate_ports); if ((proxyUrl != null) && !proxyUrl.Equals("")) args["proxy_url"] = OSD.FromString(proxyUrl); + if (RegionType != String.Empty) + args["region_type"] = OSD.FromString(RegionType); return args; } @@ -1035,6 +1055,8 @@ namespace OpenSim.Framework m_allow_alternate_ports = args["allow_alt_ports"].AsBoolean(); if (args["proxy_url"] != null) proxyUrl = args["proxy_url"].AsString(); + if (args["region_type"] != null) + m_regionType = args["region_type"].AsString(); } public static RegionInfo Create(UUID regionID, string regionName, uint regX, uint regY, string externalHostName, uint httpPort, uint simPort, uint remotingPort, string serverURI) diff --git a/OpenSim/Framework/Serialization/External/LandDataSerializer.cs b/OpenSim/Framework/Serialization/External/LandDataSerializer.cs index a3bc5d1153..ff0afc86e8 100644 --- a/OpenSim/Framework/Serialization/External/LandDataSerializer.cs +++ b/OpenSim/Framework/Serialization/External/LandDataSerializer.cs @@ -41,7 +41,7 @@ namespace OpenSim.Framework.Serialization.External public class LandDataSerializer { protected static UTF8Encoding m_utf8Encoding = new UTF8Encoding(); - + /// /// Reify/deserialize landData /// @@ -52,7 +52,7 @@ namespace OpenSim.Framework.Serialization.External { return Deserialize(m_utf8Encoding.GetString(serializedLandData, 0, serializedLandData.Length)); } - + /// /// Reify/deserialize landData /// @@ -62,10 +62,10 @@ namespace OpenSim.Framework.Serialization.External public static LandData Deserialize(string serializedLandData) { LandData landData = new LandData(); - + StringReader sr = new StringReader(serializedLandData); XmlTextReader xtr = new XmlTextReader(sr); - + xtr.ReadStartElement("LandData"); landData.Area = Convert.ToInt32( xtr.ReadElementString("Area")); @@ -106,7 +106,7 @@ namespace OpenSim.Framework.Serialization.External pae.Time = Convert.ToDateTime( xtr.ReadElementString("Time")); pae.Flags = (AccessList)Convert.ToUInt32( xtr.ReadElementString("AccessList")); xtr.ReadEndElement(); - + landData.ParcelAccessList.Add(pae); } } @@ -122,13 +122,13 @@ namespace OpenSim.Framework.Serialization.External landData.OtherCleanTime = Convert.ToInt32( xtr.ReadElementString("OtherCleanTime")); xtr.ReadEndElement(); - + xtr.Close(); sr.Close(); - + return landData; } - + public static string Serialize(LandData landData) { StringWriter sw = new StringWriter(); @@ -137,8 +137,8 @@ namespace OpenSim.Framework.Serialization.External xtw.WriteStartDocument(); xtw.WriteStartElement("LandData"); - - xtw.WriteElementString("Area", Convert.ToString(landData.Area)); + + xtw.WriteElementString("Area", Convert.ToString(landData.Area)); xtw.WriteElementString("AuctionID", Convert.ToString(landData.AuctionID)); xtw.WriteElementString("AuthBuyerID", landData.AuthBuyerID.ToString()); xtw.WriteElementString("Category", Convert.ToString((sbyte)landData.Category)); @@ -170,7 +170,7 @@ namespace OpenSim.Framework.Serialization.External xtw.WriteEndElement(); } xtw.WriteEndElement(); - + xtw.WriteElementString("PassHours", Convert.ToString(landData.PassHours)); xtw.WriteElementString("PassPrice", Convert.ToString(landData.PassPrice)); xtw.WriteElementString("SalePrice", Convert.ToString(landData.SalePrice)); @@ -184,7 +184,7 @@ namespace OpenSim.Framework.Serialization.External xtw.Close(); sw.Close(); - + return sw.ToString(); } } diff --git a/OpenSim/Framework/Servers/BaseOpenSimServer.cs b/OpenSim/Framework/Servers/BaseOpenSimServer.cs index 845a9fe3e2..0d93ff727f 100644 --- a/OpenSim/Framework/Servers/BaseOpenSimServer.cs +++ b/OpenSim/Framework/Servers/BaseOpenSimServer.cs @@ -246,7 +246,7 @@ namespace OpenSim.Framework.Servers foreach (ProcessThread t in threads) { sb.Append("ID: " + t.Id + ", TotalProcessorTime: " + t.TotalProcessorTime + ", TimeRunning: " + - (DateTime.Now - t.StartTime) + ", Pri: " + t.CurrentPriority + ", State: " + t.ThreadState ); + (DateTime.Now - t.StartTime) + ", Pri: " + t.CurrentPriority + ", State: " + t.ThreadState); if (t.ThreadState == System.Diagnostics.ThreadState.Wait) sb.Append(", Reason: " + t.WaitReason + Environment.NewLine); else diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index 4b27fa26bd..05a2a63037 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs @@ -9969,11 +9969,28 @@ namespace OpenSim.Region.ClientStack.LindenUDP Utils.BytesToString(avatarNotesUpdate.Data.Notes)); break; -// case PacketType.AvatarInterestsUpdate: -// AvatarInterestsUpdatePacket avatarInterestUpdate = -// (AvatarInterestsUpdatePacket)Pack; -// -// break; + case PacketType.AvatarInterestsUpdate: + AvatarInterestsUpdatePacket avatarInterestUpdate = + (AvatarInterestsUpdatePacket)Pack; + + #region Packet Session and User Check + if (m_checkPackets) + { + if (avatarInterestUpdate.AgentData.SessionID != SessionId || + avatarInterestUpdate.AgentData.AgentID != AgentId) + break; + } + #endregion + + AvatarInterestUpdate handlerAvatarInterestUpdate = OnAvatarInterestUpdate; + if (handlerAvatarInterestUpdate != null) + handlerAvatarInterestUpdate(this, + avatarInterestUpdate.PropertiesData.WantToMask, + Utils.BytesToString(avatarInterestUpdate.PropertiesData.WantToText), + avatarInterestUpdate.PropertiesData.SkillsMask, + Utils.BytesToString(avatarInterestUpdate.PropertiesData.SkillsText), + Utils.BytesToString(avatarInterestUpdate.PropertiesData.LanguagesText)); + break; case PacketType.PlacesQuery: PlacesQueryPacket placesQueryPacket = diff --git a/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs b/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs index 4041b63482..5ca4178ad9 100644 --- a/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs +++ b/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs @@ -730,7 +730,7 @@ namespace Flotsam.RegionModules.AssetCache int fileCount = GetFileCacheCount(m_CacheDirectory); m_log.InfoFormat("[FLOTSAM ASSET CACHE] File Cache : {0} assets", fileCount); - foreach ( string s in Directory.GetFiles(m_CacheDirectory, "*.fac" ) ) + foreach (string s in Directory.GetFiles(m_CacheDirectory, "*.fac")) { m_log.Info("[FLOTSAM ASSET CACHE] Deep Scans were performed on the following regions:"); @@ -770,7 +770,7 @@ namespace Flotsam.RegionModules.AssetCache int assetsCached = CacheScenes(); m_log.InfoFormat("[FLOTSAM ASSET CACHE] Completed Scene Caching, {0} assets found.", assetsCached); - }); + }); break; diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 4c7850fd21..cc74f26227 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -128,6 +128,7 @@ namespace OpenSim.Region.Framework.Scenes public CommunicationsManager CommsManager; protected SceneCommunicationService m_sceneGridService; + public bool loginsdisabled = true; public SceneCommunicationService SceneGridService { @@ -1062,6 +1063,11 @@ namespace OpenSim.Region.Framework.Scenes StatsReporter.SetActiveScripts(m_sceneGraph.GetActiveScriptsCount()); StatsReporter.addScriptLines(m_sceneGraph.GetScriptLPS()); } + if (loginsdisabled && (m_frame > 20)) + { + m_log.Debug("[REGION]: Enabling Logins"); + loginsdisabled = false; + } } catch (NotImplementedException) { @@ -1110,13 +1116,13 @@ namespace OpenSim.Region.Framework.Scenes public void AddGroupTarget(SceneObjectGroup grp) { - lock(m_groupsWithTargets) + lock (m_groupsWithTargets) m_groupsWithTargets[grp.UUID] = grp; } public void RemoveGroupTarget(SceneObjectGroup grp) { - lock(m_groupsWithTargets) + lock (m_groupsWithTargets) m_groupsWithTargets.Remove(grp.UUID); } @@ -3227,6 +3233,11 @@ namespace OpenSim.Region.Framework.Scenes /// also return a reason. public bool NewUserConnection(AgentCircuitData agent, out string reason) { + if (loginsdisabled) + { + reason = "Logins Disabled"; + return false; + } // Don't disable this log message - it's too helpful m_log.InfoFormat( "[CONNECTION BEGIN]: Region {0} told of incoming {1} agent {2} {3} {4} (circuit code {5})", diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 646a4831ec..c25fa552e8 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -908,6 +908,7 @@ namespace OpenSim.Region.Framework.Scenes if (PhysicsActor != null) { m_physicsActor.OnRequestTerseUpdate -= SendTerseUpdateToAllClients; + m_physicsActor.OnOutOfBounds -= OutOfBoundsCall; m_scene.PhysicsScene.RemoveAvatar(PhysicsActor); m_physicsActor.UnSubscribeEvents(); m_physicsActor.OnCollisionUpdate -= PhysicsCollisionUpdate; @@ -3410,11 +3411,22 @@ namespace OpenSim.Region.Framework.Scenes scene.AddPhysicsActorTaint(m_physicsActor); //m_physicsActor.OnRequestTerseUpdate += SendTerseUpdateToAllClients; m_physicsActor.OnCollisionUpdate += PhysicsCollisionUpdate; + m_physicsActor.OnOutOfBounds += OutOfBoundsCall; // Called for PhysicsActors when there's something wrong m_physicsActor.SubscribeEvents(500); m_physicsActor.LocalID = LocalId; } + private void OutOfBoundsCall(PhysicsVector pos) + { + //bool flying = m_physicsActor.Flying; + //RemoveFromPhysicalScene(); + + //AddToPhysicalScene(flying); + if (ControllingClient != null) + ControllingClient.SendAgentAlertMessage("Physics is having a problem with your avatar. You may not be able to move until you relog.",true); + } + // Event called by the physics plugin to tell the avatar about a collision. private void PhysicsCollisionUpdate(EventArgs e) { diff --git a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs index a8acf0d6c6..434da0a597 100644 --- a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs +++ b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs @@ -831,7 +831,9 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server public event PickInfoUpdate OnPickInfoUpdate; public event AvatarNotesUpdate OnAvatarNotesUpdate; public event MuteListRequest OnMuteListRequest; + public event AvatarInterestUpdate OnAvatarInterestUpdate; public event PlacesQuery OnPlacesQuery; + #pragma warning restore 67 public void SetDebugPacketLevel(int newDebug) @@ -1570,6 +1572,11 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server } + public void SendAvatarInterestUpdate(IClientAPI client, uint wantmask, string wanttext, uint skillsmask, string skillstext, string languages) + { + + } + public void SendParcelDwellReply(int localID, UUID parcelID, float dwell) { diff --git a/OpenSim/Region/Physics/Manager/IMesher.cs b/OpenSim/Region/Physics/Manager/IMesher.cs index ac14292915..1a8c948d8a 100644 --- a/OpenSim/Region/Physics/Manager/IMesher.cs +++ b/OpenSim/Region/Physics/Manager/IMesher.cs @@ -48,7 +48,7 @@ namespace OpenSim.Region.Physics.Manager int[] getIndexListAsIntLocked(); float[] getVertexListAsFloatLocked(); 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); void releaseSourceMeshData(); void releasePinned(); void Append(IMesh newMesh); diff --git a/OpenSim/Region/Physics/Meshing/Mesh.cs b/OpenSim/Region/Physics/Meshing/Mesh.cs index 94d926a88a..4c3cf33feb 100644 --- a/OpenSim/Region/Physics/Meshing/Mesh.cs +++ b/OpenSim/Region/Physics/Meshing/Mesh.cs @@ -70,7 +70,7 @@ namespace OpenSim.Region.Physics.Meshing throw new NotSupportedException("Attempt to Add to a pinned Mesh"); // If a vertex of the triangle is not yet in the vertices list, // add it and set its index to the current index count - if( !m_vertices.ContainsKey(triangle.v1) ) + if (!m_vertices.ContainsKey(triangle.v1)) m_vertices[triangle.v1] = m_vertices.Count; if (!m_vertices.ContainsKey(triangle.v2)) m_vertices[triangle.v2] = m_vertices.Count; @@ -153,7 +153,7 @@ namespace OpenSim.Region.Physics.Meshing private float[] getVertexListAsFloat() { - if(m_vertices == null) + if (m_vertices == null) throw new NotSupportedException(); float[] result = new float[m_vertices.Count * 3]; foreach (KeyValuePair kvp in m_vertices) @@ -169,7 +169,7 @@ namespace OpenSim.Region.Physics.Meshing public float[] getVertexListAsFloatLocked() { - if( m_pinnedVertexes.IsAllocated ) + if (m_pinnedVertexes.IsAllocated) return (float[])(m_pinnedVertexes.Target); float[] result = getVertexListAsFloat(); diff --git a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs index bd81d50f39..1fff8469ac 100644 --- a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs +++ b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs @@ -1105,7 +1105,19 @@ namespace OpenSim.Region.Physics.OdePlugin public void UpdatePositionAndVelocity() { // no lock; called from Simulate() -- if you call this from elsewhere, gotta lock or do Monitor.Enter/Exit! - d.Vector3 vec = d.BodyGetPosition(Body); + d.Vector3 vec; + try + { + vec = d.BodyGetPosition(Body); + } + catch (NullReferenceException) + { + _parent_scene.BadCharacter(this); + vec = new d.Vector3(_position.X, _position.Y, _position.Z); + base.RaiseOutOfBounds(_position); // Tells ScenePresence that there's a problem! + m_log.WarnFormat("[ODEPLUGIN]: Avatar Null reference for Avatar: {0}", m_name); + } + // kluge to keep things in bounds. ODE lets dead avatars drift away (they should be removed!) if (vec.X < 0.0f) vec.X = 0.0f; @@ -1137,7 +1149,16 @@ namespace OpenSim.Region.Physics.OdePlugin else { m_lastUpdateSent = false; - vec = d.BodyGetLinearVel(Body); + try + { + vec = d.BodyGetLinearVel(Body); + } + catch (NullReferenceException) + { + vec.X = _velocity.X; + vec.Y = _velocity.Y; + vec.Z = _velocity.Z; + } _velocity.X = (vec.X); _velocity.Y = (vec.Y); diff --git a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs index 7840ae370b..864ea80f21 100644 --- a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs +++ b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs @@ -827,8 +827,8 @@ namespace OpenSim.Region.Physics.OdePlugin IntPtr vertices, indices; int vertexCount, indexCount; int vertexStride, triStride; - mesh.getVertexListAsPtrToFloatArray( out vertices, out vertexStride, out vertexCount ); // Note, that vertices are fixed in unmanaged heap - mesh.getIndexListAsPtrToIntArray( out indices, out triStride, out indexCount ); // Also fixed, needs release after usage + mesh.getVertexListAsPtrToFloatArray(out vertices, out vertexStride, out vertexCount); // Note, that vertices are fixed in unmanaged heap + mesh.getIndexListAsPtrToIntArray(out indices, out triStride, out indexCount); // Also fixed, needs release after usage mesh.releaseSourceMeshData(); // free up the original mesh data to save memory diff --git a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs index 78831f8835..9429544fb7 100644 --- a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs +++ b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs @@ -243,6 +243,7 @@ namespace OpenSim.Region.Physics.OdePlugin private readonly HashSet _taintedActors = new HashSet(); private readonly List _perloopContact = new List(); private readonly List _collisionEventPrim = new List(); + private readonly HashSet _badCharacter = new HashSet(); public Dictionary geom_name_map = new Dictionary(); public Dictionary actor_name_map = new Dictionary(); private bool m_NINJA_physics_joints_enabled = false; @@ -1678,6 +1679,14 @@ namespace OpenSim.Region.Physics.OdePlugin } } } + public void BadCharacter(OdeCharacter chr) + { + lock (_badCharacter) + { + if (!_badCharacter.Contains(chr)) + _badCharacter.Add(chr); + } + } public override void RemoveAvatar(PhysicsActor actor) { @@ -2987,6 +2996,18 @@ namespace OpenSim.Region.Physics.OdePlugin } } + lock (_badCharacter) + { + if (_badCharacter.Count > 0) + { + foreach (OdeCharacter chr in _badCharacter) + { + RemoveCharacter(chr); + } + _badCharacter.Clear(); + } + } + lock (_activeprims) { //if (timeStep < 0.2f) @@ -3792,7 +3813,7 @@ namespace OpenSim.Region.Physics.OdePlugin } public void start(int unused) - { + { ds.SetViewpoint(ref xyz, ref hpr); } #endif diff --git a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs index 97166cf507..2b858ecd9e 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs @@ -353,15 +353,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance // m_log.ErrorFormat("[Script] Unable to load script state from xml: {0}\n"+e.ToString(), xml); } } - else - { - ScenePresence presence = m_Engine.World.GetScenePresence(part.OwnerID); +// else +// { +// ScenePresence presence = m_Engine.World.GetScenePresence(part.OwnerID); - if (presence != null && (!postOnRez)) - presence.ControllingClient.SendAgentAlertMessage("Compile successful", false); +// if (presence != null && (!postOnRez)) +// presence.ControllingClient.SendAgentAlertMessage("Compile successful", false); -// // m_log.ErrorFormat("[Script] Unable to load script state, file not found"); - } +// } } public void Init() diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs index 847da8c194..7b19ce3463 100644 --- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs @@ -604,9 +604,6 @@ namespace OpenSim.Region.ScriptEngine.XEngine if (warnings != null && warnings.Length != 0) { - if (presence != null && (!postOnRez)) - presence.ControllingClient.SendAgentAlertMessage("Script saved with warnings, check debug window!", false); - foreach (string warning in warnings) { try @@ -615,10 +612,17 @@ namespace OpenSim.Region.ScriptEngine.XEngine string text = "Warning:\n" + warning; if (text.Length > 1000) text = text.Substring(0, 1000); - World.SimChat(Utils.StringToBytes(text), - ChatTypeEnum.DebugChannel, 2147483647, - part.AbsolutePosition, - part.Name, part.UUID, false); + if (!ShowScriptSaveResponse(item.OwnerID, + assetID, text, true)) + { + if (presence != null && (!postOnRez)) + presence.ControllingClient.SendAgentAlertMessage("Script saved with warnings, check debug window!", false); + + World.SimChat(Utils.StringToBytes(text), + ChatTypeEnum.DebugChannel, 2147483647, + part.AbsolutePosition, + part.Name, part.UUID, false); + } } catch (Exception e2) // LEGIT: User Scripting { @@ -634,8 +638,6 @@ namespace OpenSim.Region.ScriptEngine.XEngine } catch (Exception e) { - if (presence != null && (!postOnRez)) - presence.ControllingClient.SendAgentAlertMessage("Script saved with errors, check debug window!", false); try { // DISPLAY ERROR INWORLD @@ -645,10 +647,16 @@ namespace OpenSim.Region.ScriptEngine.XEngine string text = "Error compiling script '" + item.Name + "':\n" + e.Message.ToString(); if (text.Length > 1000) text = text.Substring(0, 1000); - World.SimChat(Utils.StringToBytes(text), - ChatTypeEnum.DebugChannel, 2147483647, - part.AbsolutePosition, - part.Name, part.UUID, false); + if (!ShowScriptSaveResponse(item.OwnerID, + assetID, text, false)) + { + if (presence != null && (!postOnRez)) + presence.ControllingClient.SendAgentAlertMessage("Script saved with errors, check debug window!", false); + World.SimChat(Utils.StringToBytes(text), + ChatTypeEnum.DebugChannel, 2147483647, + part.AbsolutePosition, + part.Name, part.UUID, false); + } } catch (Exception e2) // LEGIT: User Scripting { @@ -732,6 +740,12 @@ namespace OpenSim.Region.ScriptEngine.XEngine m_log.DebugFormat("[XEngine] Loaded script {0}.{1}, script UUID {2}, prim UUID {3} @ {4}", part.ParentGroup.RootPart.Name, item.Name, assetID, part.UUID, part.ParentGroup.RootPart.AbsolutePosition.ToString()); + if (presence != null) + { + ShowScriptSaveResponse(item.OwnerID, + assetID, "Compile successful", true); + } + instance.AppDomain = appDomain; instance.LineMap = linemap; @@ -1250,5 +1264,10 @@ namespace OpenSim.Region.ScriptEngine.XEngine return instance.CanBeDeleted(); } + + private bool ShowScriptSaveResponse(UUID ownerID, UUID assetID, string text, bool compiled) + { + return false; + } } } diff --git a/OpenSim/Tests/Common/Mock/TestLandChannel.cs b/OpenSim/Tests/Common/Mock/TestLandChannel.cs index ed30827d70..be28c270df 100644 --- a/OpenSim/Tests/Common/Mock/TestLandChannel.cs +++ b/OpenSim/Tests/Common/Mock/TestLandChannel.cs @@ -46,14 +46,14 @@ namespace OpenSim.Tests.Common.Mock m_scene = scene; } - public List ParcelsNearPoint(Vector3 position) - { - return new List(); + public List ParcelsNearPoint(Vector3 position) + { + return new List(); } - public List AllParcels() - { - return new List(); + public List AllParcels() + { + return new List(); } protected ILandObject GetNoLand() @@ -63,18 +63,18 @@ namespace OpenSim.Tests.Common.Mock return obj; } - public ILandObject GetLandObject(int x, int y) - { + public ILandObject GetLandObject(int x, int y) + { return GetNoLand(); } - public ILandObject GetLandObject(int localID) - { + public ILandObject GetLandObject(int localID) + { return GetNoLand(); } - public ILandObject GetLandObject(float x, float y) - { + public ILandObject GetLandObject(float x, float y) + { return GetNoLand(); } diff --git a/bin/RegionConfig.ini.example b/bin/RegionConfig.ini.example index 04041680fe..8d833df48e 100644 --- a/bin/RegionConfig.ini.example +++ b/bin/RegionConfig.ini.example @@ -45,3 +45,9 @@ MasterAvatarUUID = "00000000-0000-0000-0000-000000000000" ; * ; ScopeID = "00000000-0000-0000-0000-000000000000" + +; * +; * Product name (used in search from viewer 1.23 +; * + +; RegionType = "Mainland"