Update svn properties, formatting cleanup.

0.6.0-stable
Jeff Ames 2008-09-09 01:26:48 +00:00
parent 3e1441afe1
commit fae34bb10c
41 changed files with 838 additions and 831 deletions

View File

@ -644,7 +644,7 @@ VALUES
using (AutoClosingSqlCommand cmd = _Database.Query(sql)) using (AutoClosingSqlCommand cmd = _Database.Query(sql))
{ {
cmd.Parameters.Add(_Database.CreateParameter("@regionUUID", regionUUID.ToString())); cmd.Parameters.Add(_Database.CreateParameter("@regionUUID", regionUUID.ToString()));
using(SqlDataReader reader = cmd.ExecuteReader()) using (SqlDataReader reader = cmd.ExecuteReader())
{ {
if (reader.Read()) if (reader.Read())
{ {
@ -1519,7 +1519,7 @@ VALUES
dataAdapter.InsertCommand = commandBuilder.GetInsertCommand(true); dataAdapter.InsertCommand = commandBuilder.GetInsertCommand(true);
dataAdapter.UpdateCommand = commandBuilder.GetUpdateCommand(true); dataAdapter.UpdateCommand = commandBuilder.GetUpdateCommand(true);
dataAdapter.DeleteCommand = commandBuilder.GetDeleteCommand(true); dataAdapter.DeleteCommand = commandBuilder.GetDeleteCommand(true);
} }
#endregion #endregion
} }

View File

@ -185,7 +185,7 @@ namespace OpenSim.Data.MySQL
else else
m_FieldMap[name].SetValue(es, false); m_FieldMap[name].SetValue(es, false);
} }
else if(m_FieldMap[name].GetValue(es) is OpenMetaverse.UUID) else if (m_FieldMap[name].GetValue(es) is OpenMetaverse.UUID)
{ {
UUID uuid = UUID.Zero; UUID uuid = UUID.Zero;

View File

@ -79,7 +79,7 @@ namespace OpenSim.Data.MySQL
m_lastConnect++; m_lastConnect++;
// Overflow protection // Overflow protection
if(m_lastConnect == int.MaxValue) if (m_lastConnect == int.MaxValue)
m_lastConnect = 0; m_lastConnect = 0;
MySQLSuperManager x = m_dbconnections[m_lastConnect%m_maxConnections]; MySQLSuperManager x = m_dbconnections[m_lastConnect%m_maxConnections];

View File

@ -109,7 +109,7 @@ namespace OpenSim.Data.SQLite
else else
m_FieldMap[name].SetValue(es, false); m_FieldMap[name].SetValue(es, false);
} }
else if(m_FieldMap[name].GetValue(es) is OpenMetaverse.UUID) else if (m_FieldMap[name].GetValue(es) is OpenMetaverse.UUID)
{ {
UUID uuid = UUID.Zero; UUID uuid = UUID.Zero;

View File

@ -6,11 +6,11 @@ namespace OpenSim.Framework.Communications.Cache
public class FileAssetClient : AssetServerBase public class FileAssetClient : AssetServerBase
{ {
private readonly string m_dir; private readonly string m_dir;
private readonly XmlSerializer m_xs = new XmlSerializer(typeof(AssetBase)); private readonly XmlSerializer m_xs = new XmlSerializer(typeof(AssetBase));
public FileAssetClient(string dir) public FileAssetClient(string dir)
{ {
if(!Directory.Exists(dir)) if (!Directory.Exists(dir))
{ {
Directory.CreateDirectory(dir); Directory.CreateDirectory(dir);
} }

View File

@ -74,7 +74,7 @@ namespace OpenSim.Framework.Communications
} }
/// <summary> /// <summary>
/// Customises the login response and fills in missing values. This method also tells the login region to /// Customises the login response and fills in missing values. This method also tells the login region to
/// expect a client connection. /// expect a client connection.
/// </summary> /// </summary>
/// <param name="response">The existing response</param> /// <param name="response">The existing response</param>
@ -89,7 +89,7 @@ namespace OpenSim.Framework.Communications
public virtual void LogOffUser(UserProfileData theUser, string message) public virtual void LogOffUser(UserProfileData theUser, string message)
{ {
} }
/// <summary> /// <summary>
/// Get the initial login inventory skeleton (in other words, the folder structure) for the given user. /// Get the initial login inventory skeleton (in other words, the folder structure) for the given user.
/// </summary> /// </summary>
@ -298,7 +298,7 @@ namespace OpenSim.Framework.Communications
m_log.DebugFormat( m_log.DebugFormat(
"[LOGIN END]: XMLRPC Authentication of user {0} {1} successful. Sending response to client.", "[LOGIN END]: XMLRPC Authentication of user {0} {1} successful. Sending response to client.",
firstname, lastname); firstname, lastname);
return logResponse.ToXmlRpcResponse(); return logResponse.ToXmlRpcResponse();
} }
else else

View File

@ -325,7 +325,7 @@ namespace OpenSim.Framework
ulong ActiveGroupPowers { get; } ulong ActiveGroupPowers { get; }
ulong GetGroupPowers(UUID groupID); ulong GetGroupPowers(UUID groupID);
string FirstName { get; } string FirstName { get; }

View File

@ -737,11 +737,11 @@ namespace OpenSim.Framework
/// The extracted ulong /// The extracted ulong
/// </returns> /// </returns>
public static ulong BytesToUInt64Big(byte[] bytes) { public static ulong BytesToUInt64Big(byte[] bytes) {
if(bytes.Length < 8) return 0; if (bytes.Length < 8) return 0;
return ((ulong)bytes[0] << 56) | ((ulong)bytes[1] << 48) | ((ulong)bytes[2] << 40) | ((ulong)bytes[3] << 32) | return ((ulong)bytes[0] << 56) | ((ulong)bytes[1] << 48) | ((ulong)bytes[2] << 40) | ((ulong)bytes[3] << 32) |
((ulong)bytes[4] << 24) | ((ulong)bytes[5] << 16) | ((ulong)bytes[6] << 8) | (ulong)bytes[7]; ((ulong)bytes[4] << 24) | ((ulong)bytes[5] << 16) | ((ulong)bytes[6] << 8) | (ulong)bytes[7];
} }
// used for RemoteParcelRequest (for "About Landmark") // used for RemoteParcelRequest (for "About Landmark")
public static UUID BuildFakeParcelID(ulong regionHandle, uint x, uint y) { public static UUID BuildFakeParcelID(ulong regionHandle, uint x, uint y) {
byte[] bytes = { byte[] bytes = {

View File

@ -194,13 +194,13 @@ namespace OpenSim.Grid.UserServer
{ {
start_x = Convert.ToInt32(startLocationRequestParsed[1]); start_x = Convert.ToInt32(startLocationRequestParsed[1]);
start_y = Convert.ToInt32(startLocationRequestParsed[2]); start_y = Convert.ToInt32(startLocationRequestParsed[2]);
start_z = Convert.ToInt32(startLocationRequestParsed[3]); start_z = Convert.ToInt32(startLocationRequestParsed[3]);
if (start_x >= 0 && start_y >= 0 && start_z >= 0) if (start_x >= 0 && start_y >= 0 && start_z >= 0)
{ {
Vector3 tmp_v = new Vector3(start_x, start_y, start_z); Vector3 tmp_v = new Vector3(start_x, start_y, start_z);
theUser.CurrentAgent.Position = tmp_v; theUser.CurrentAgent.Position = tmp_v;
} }
} }
} }
} }
@ -242,7 +242,7 @@ namespace OpenSim.Grid.UserServer
// Load information from the gridserver // Load information from the gridserver
ulong defaultHandle = (((ulong) m_config.DefaultX * Constants.RegionSize) << 32) | ulong defaultHandle = (((ulong) m_config.DefaultX * Constants.RegionSize) << 32) |
((ulong) m_config.DefaultY * Constants.RegionSize); ((ulong) m_config.DefaultY * Constants.RegionSize);
if (defaultHandle == SimInfo.regionHandle) if (defaultHandle == SimInfo.regionHandle)
{ {
m_log.ErrorFormat("[LOGIN]: Not trying the default region since this is the same as the selected region"); m_log.ErrorFormat("[LOGIN]: Not trying the default region since this is the same as the selected region");
@ -250,7 +250,7 @@ namespace OpenSim.Grid.UserServer
} }
m_log.Error("[LOGIN]: Sending user to default region " + defaultHandle + " instead"); m_log.Error("[LOGIN]: Sending user to default region " + defaultHandle + " instead");
SimInfo = RegionProfileData.RequestSimProfileData(defaultHandle, m_config.GridServerURL, m_config.GridSendKey, m_config.GridRecvKey); SimInfo = RegionProfileData.RequestSimProfileData(defaultHandle, m_config.GridServerURL, m_config.GridSendKey, m_config.GridRecvKey);
// Customise the response // Customise the response
@ -260,18 +260,18 @@ namespace OpenSim.Grid.UserServer
(SimInfo.regionLocX * Constants.RegionSize), (SimInfo.regionLocX * Constants.RegionSize),
(SimInfo.regionLocY*Constants.RegionSize), (SimInfo.regionLocY*Constants.RegionSize),
theUser.HomeLocation.X, theUser.HomeLocation.Y, theUser.HomeLocation.Z, theUser.HomeLocation.X, theUser.HomeLocation.Y, theUser.HomeLocation.Z,
theUser.HomeLookAt.X, theUser.HomeLookAt.Y, theUser.HomeLookAt.Z); theUser.HomeLookAt.X, theUser.HomeLookAt.Y, theUser.HomeLookAt.Z);
if (!PrepareLoginToRegion(SimInfo, theUser, response)) if (!PrepareLoginToRegion(SimInfo, theUser, response))
{ {
response.CreateDeadRegionResponse(); response.CreateDeadRegionResponse();
return false; return false;
} }
} }
return true; return true;
} }
/// <summary> /// <summary>
/// Prepare a login to the given region. This involves both telling the region to expect a connection /// Prepare a login to the given region. This involves both telling the region to expect a connection
/// and appropriately customising the response to the user. /// and appropriately customising the response to the user.
@ -283,7 +283,7 @@ namespace OpenSim.Grid.UserServer
private bool PrepareLoginToRegion(RegionProfileData sim, UserProfileData user, LoginResponse response) private bool PrepareLoginToRegion(RegionProfileData sim, UserProfileData user, LoginResponse response)
{ {
try try
{ {
response.SimAddress = Util.GetHostFromURL(sim.serverURI).ToString(); response.SimAddress = Util.GetHostFromURL(sim.serverURI).ToString();
response.SimPort = uint.Parse(sim.serverURI.Split(new char[] {'/', ':'})[4]); response.SimPort = uint.Parse(sim.serverURI.Split(new char[] {'/', ':'})[4]);
response.RegionX = sim.regionLocX; response.RegionX = sim.regionLocX;
@ -300,7 +300,7 @@ namespace OpenSim.Grid.UserServer
// Update agent with target sim // Update agent with target sim
user.CurrentAgent.Region = sim.UUID; user.CurrentAgent.Region = sim.UUID;
user.CurrentAgent.Handle = sim.regionHandle; user.CurrentAgent.Handle = sim.regionHandle;
// Prepare notification // Prepare notification
Hashtable SimParams = new Hashtable(); Hashtable SimParams = new Hashtable();
@ -317,7 +317,7 @@ namespace OpenSim.Grid.UserServer
SimParams["caps_path"] = capsPath; SimParams["caps_path"] = capsPath;
ArrayList SendParams = new ArrayList(); ArrayList SendParams = new ArrayList();
SendParams.Add(SimParams); SendParams.Add(SimParams);
// Send // Send
XmlRpcRequest GridReq = new XmlRpcRequest("expect_user", SendParams); XmlRpcRequest GridReq = new XmlRpcRequest("expect_user", SendParams);
XmlRpcResponse GridResp = GridReq.Send(sim.httpServerURI, 30000); XmlRpcResponse GridResp = GridReq.Send(sim.httpServerURI, 30000);
@ -363,13 +363,13 @@ namespace OpenSim.Grid.UserServer
m_log.ErrorFormat("[LOGIN]: XmlRpc request to region failed with message {0}, code {1} ", GridResp.FaultString, GridResp.FaultCode); m_log.ErrorFormat("[LOGIN]: XmlRpc request to region failed with message {0}, code {1} ", GridResp.FaultString, GridResp.FaultCode);
return false; return false;
} }
} }
catch (Exception e) catch (Exception e)
{ {
m_log.ErrorFormat("[LOGIN]: Region not available for login, {0}", e); m_log.ErrorFormat("[LOGIN]: Region not available for login, {0}", e);
return false; return false;
} }
return true; return true;
} }

View File

@ -115,7 +115,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
protected UUID m_activeGroupID = UUID.Zero; protected UUID m_activeGroupID = UUID.Zero;
protected string m_activeGroupName = String.Empty; protected string m_activeGroupName = String.Empty;
protected ulong m_activeGroupPowers = 0; protected ulong m_activeGroupPowers = 0;
protected Dictionary<UUID,ulong> m_groupPowers = new Dictionary<UUID, ulong>(); protected Dictionary<UUID,ulong> m_groupPowers = new Dictionary<UUID, ulong>();
/* Instantiated Designated Event Delegates */ /* Instantiated Designated Event Delegates */
//- used so we don't create new objects for each incoming packet and then toss it out later */ //- used so we don't create new objects for each incoming packet and then toss it out later */
@ -302,7 +302,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
get { return m_activeGroupPowers; } get { return m_activeGroupPowers; }
} }
public ulong GetGroupPowers(UUID groupID) public ulong GetGroupPowers(UUID groupID)
{ {
if (m_groupPowers.ContainsKey(groupID)) if (m_groupPowers.ContainsKey(groupID))
return m_groupPowers[groupID]; return m_groupPowers[groupID];
@ -645,7 +645,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
protected virtual void ClientLoop() protected virtual void ClientLoop()
{ {
m_log.Info("[CLIENT]: Entered main packet processing loop"); m_log.Info("[CLIENT]: Entered main packet processing loop");
while (true) while (true)
{ {
LLQueItem nextPacket = m_PacketHandler.PacketQueue.Dequeue(); LLQueItem nextPacket = m_PacketHandler.PacketQueue.Dequeue();
@ -683,10 +683,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
if (m_PacketHandler.PacketsReceived == m_inPacketsChecked) if (m_PacketHandler.PacketsReceived == m_inPacketsChecked)
{ {
// no packet came in since the last time we checked... // no packet came in since the last time we checked...
m_probesWithNoIngressPackets++; m_probesWithNoIngressPackets++;
if ((m_probesWithNoIngressPackets > 30 && !m_clientBlocked) // agent active if ((m_probesWithNoIngressPackets > 30 && !m_clientBlocked) // agent active
|| (m_probesWithNoIngressPackets > 90 && m_clientBlocked)) // agent paused || (m_probesWithNoIngressPackets > 90 && m_clientBlocked)) // agent paused
{ {
m_clientPingTimer.Enabled = false; m_clientPingTimer.Enabled = false;
@ -709,7 +709,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
{ {
// Something received in the meantime - we can reset the counters // Something received in the meantime - we can reset the counters
m_probesWithNoIngressPackets = 0; m_probesWithNoIngressPackets = 0;
// ... and store the current number of packets received to find out if another one got in on the next cycle // ... and store the current number of packets received to find out if another one got in on the next cycle
m_inPacketsChecked = m_PacketHandler.PacketsReceived; m_inPacketsChecked = m_PacketHandler.PacketsReceived;
} }
@ -749,7 +749,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
// AuthenticateResponse sessionInfo = m_gridServer.AuthenticateSession(m_cirpack.m_circuitCode.m_sessionId, m_cirpack.m_circuitCode.ID, m_cirpack.m_circuitCode.Code); // AuthenticateResponse sessionInfo = m_gridServer.AuthenticateSession(m_cirpack.m_circuitCode.m_sessionId, m_cirpack.m_circuitCode.ID, m_cirpack.m_circuitCode.Code);
AuthenticateResponse sessionInfo = AuthenticateResponse sessionInfo =
m_authenticateSessionsHandler.AuthenticateSession(m_sessionId, m_agentId, m_circuitCode); m_authenticateSessionsHandler.AuthenticateSession(m_sessionId, m_agentId, m_circuitCode);
if (!sessionInfo.Authorised) if (!sessionInfo.Authorised)
{ {
//session/circuit not authorised //session/circuit not authorised

View File

@ -58,12 +58,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP
protected byte[] RecvBuffer = new byte[4096]; protected byte[] RecvBuffer = new byte[4096];
protected byte[] ZeroBuffer = new byte[8192]; protected byte[] ZeroBuffer = new byte[8192];
protected IPEndPoint ipeSender; protected IPEndPoint ipeSender;
/// <value> /// <value>
/// The endpoint of a sender of a particular packet. The port is continually changed by the various socket receive methods /// The endpoint of a sender of a particular packet. The port is continually changed by the various socket receive methods
/// </value> /// </value>
protected EndPoint epSender; protected EndPoint epSender;
protected EndPoint epProxy; protected EndPoint epProxy;
protected int proxyPortOffset; protected int proxyPortOffset;
protected AsyncCallback ReceivedData; protected AsyncCallback ReceivedData;
@ -75,7 +75,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
protected IPAddress listenIP = IPAddress.Parse("0.0.0.0"); protected IPAddress listenIP = IPAddress.Parse("0.0.0.0");
protected IScene m_localScene; protected IScene m_localScene;
protected AssetCache m_assetCache; protected AssetCache m_assetCache;
/// <value> /// <value>
/// Manages authentication for agent circuits /// Manages authentication for agent circuits
/// </value> /// </value>
@ -260,12 +260,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP
{ {
ret = clientCircuits.TryGetValue(epSender, out circuit); ret = clientCircuits.TryGetValue(epSender, out circuit);
} }
if (ret) if (ret)
{ {
//if so then send packet to the packetserver //if so then send packet to the packetserver
//m_log.DebugFormat("[UDPSERVER]: For endpoint {0} got packet {1}", epSender, packet.Type); //m_log.DebugFormat("[UDPSERVER]: For endpoint {0} got packet {1}", epSender, packet.Type);
m_packetServer.InPacket(circuit, packet); m_packetServer.InPacket(circuit, packet);
} }
else if (packet.Type == PacketType.UseCircuitCode) else if (packet.Type == PacketType.UseCircuitCode)
@ -358,8 +358,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
return; return;
UseCircuitCodePacket useCircuit = (UseCircuitCodePacket) packet; UseCircuitCodePacket useCircuit = (UseCircuitCodePacket) packet;
m_log.DebugFormat("[CLIENT]: Adding new circuit for agent {0}, circuit code {1}", useCircuit.CircuitCode.ID, useCircuit.CircuitCode.Code); m_log.DebugFormat("[CLIENT]: Adding new circuit for agent {0}, circuit code {1}", useCircuit.CircuitCode.ID, useCircuit.CircuitCode.Code);
lock (clientCircuits) lock (clientCircuits)
{ {
@ -386,10 +386,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
if (!PacketServer.AddNewClient(epSender, useCircuit, m_assetCache, m_circuitManager, epProxy)) if (!PacketServer.AddNewClient(epSender, useCircuit, m_assetCache, m_circuitManager, epProxy))
m_log.ErrorFormat( m_log.ErrorFormat(
"[CLIENT]: A circuit already existed for agent {0}, circuit {1}", "[CLIENT]: A circuit already existed for agent {0}, circuit {1}",
useCircuit.CircuitCode.ID, useCircuit.CircuitCode.Code); useCircuit.CircuitCode.ID, useCircuit.CircuitCode.Code);
} }
PacketPool.Instance.ReturnPacket(packet); PacketPool.Instance.ReturnPacket(packet);
} }

View File

@ -265,7 +265,7 @@ namespace OpenSim.Region.Communications.Local
m_log.Warn("[LOGIN]: Not found region " + currentRegion); m_log.Warn("[LOGIN]: Not found region " + currentRegion);
return false; return false;
} }
return true; return true;
} }

View File

@ -89,7 +89,7 @@ namespace OpenSim.Region.Communications.OGS1
{ {
serversInfo = servers_info; serversInfo = servers_info;
httpServer = httpServe; httpServer = httpServe;
//Respond to Grid Services requests //Respond to Grid Services requests
httpServer.AddXmlRPCHandler("expect_user", ExpectUser); httpServer.AddXmlRPCHandler("expect_user", ExpectUser);
httpServer.AddXmlRPCHandler("logoff_user", LogOffUser); httpServer.AddXmlRPCHandler("logoff_user", LogOffUser);
@ -602,7 +602,7 @@ namespace OpenSim.Region.Communications.OGS1
/// <param name="request"></param> /// <param name="request"></param>
/// <returns></returns> /// <returns></returns>
public XmlRpcResponse ExpectUser(XmlRpcRequest request) public XmlRpcResponse ExpectUser(XmlRpcRequest request)
{ {
Hashtable requestData = (Hashtable) request.Params[0]; Hashtable requestData = (Hashtable) request.Params[0];
AgentCircuitData agentData = new AgentCircuitData(); AgentCircuitData agentData = new AgentCircuitData();
agentData.SessionID = new UUID((string) requestData["session_id"]); agentData.SessionID = new UUID((string) requestData["session_id"]);
@ -613,7 +613,7 @@ namespace OpenSim.Region.Communications.OGS1
agentData.circuitcode = Convert.ToUInt32(requestData["circuit_code"]); agentData.circuitcode = Convert.ToUInt32(requestData["circuit_code"]);
agentData.CapsPath = (string) requestData["caps_path"]; agentData.CapsPath = (string) requestData["caps_path"];
ulong regionHandle = Convert.ToUInt64((string) requestData["regionhandle"]); ulong regionHandle = Convert.ToUInt64((string) requestData["regionhandle"]);
m_log.DebugFormat( m_log.DebugFormat(
"[CLIENT]: Told by user service to prepare for a connection from {0} {1} {2}, circuit {3}", "[CLIENT]: Told by user service to prepare for a connection from {0} {1} {2}, circuit {3}",
agentData.firstname, agentData.lastname, agentData.AgentID, agentData.circuitcode); agentData.firstname, agentData.lastname, agentData.AgentID, agentData.circuitcode);
@ -669,7 +669,7 @@ namespace OpenSim.Region.Communications.OGS1
respdata["success"] = "TRUE"; respdata["success"] = "TRUE";
resp.Value = respdata; resp.Value = respdata;
} }
return resp; return resp;
} }
// Grid Request Processing // Grid Request Processing
@ -1679,7 +1679,7 @@ namespace OpenSim.Region.Communications.OGS1
// this might be cached, as we probably requested it just a moment ago... // this might be cached, as we probably requested it just a moment ago...
RegionInfo info = RequestNeighbourInfo(regionHandle); RegionInfo info = RequestNeighbourInfo(regionHandle);
if (info != null) // just to be sure if (info != null) // just to be sure
{ {
XmlRpcRequest request = new XmlRpcRequest("land_data", paramList); XmlRpcRequest request = new XmlRpcRequest("land_data", paramList);
string uri = "http://" + info.ExternalEndPoint.Address + ":" + info.HttpPort + "/"; string uri = "http://" + info.ExternalEndPoint.Address + ":" + info.HttpPort + "/";
XmlRpcResponse response = request.Send(uri, 10000); XmlRpcResponse response = request.Send(uri, 10000);

View File

@ -161,7 +161,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
string message = e.Message; string message = e.Message;
UUID fromID = e.SenderUUID; UUID fromID = e.SenderUUID;
if(message.Length >= 1000) // libomv limit if (message.Length >= 1000) // libomv limit
message = message.Substring(0, 1000); message = message.Substring(0, 1000);
if (e.Sender != null) if (e.Sender != null)

View File

@ -820,33 +820,33 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney
string secret = (string) requestData["secret"]; string secret = (string) requestData["secret"];
Scene userScene = GetSceneByUUID(regionId); Scene userScene = GetSceneByUUID(regionId);
if(userScene != null) if (userScene != null)
{ {
if (userScene.RegionInfo.regionSecret.ToString() == secret) if (userScene.RegionInfo.regionSecret.ToString() == secret)
{ {
IClientAPI client = LocateClientObject(agentId); IClientAPI client = LocateClientObject(agentId);
if (client != null) if (client != null)
{ {
if (soundId != UUID.Zero) if (soundId != UUID.Zero)
client.SendPlayAttachedSound(soundId, UUID.Zero, UUID.Zero, 1.0f, 0); client.SendPlayAttachedSound(soundId, UUID.Zero, UUID.Zero, 1.0f, 0);
client.SendBlueBoxMessage(UUID.Zero, UUID.Zero, "", text); client.SendBlueBoxMessage(UUID.Zero, UUID.Zero, "", text);
retparam.Add("success", true); retparam.Add("success", true);
} }
else else
{ {
retparam.Add("success", false); retparam.Add("success", false);
} }
} }
else else
{ {
retparam.Add("success", false); retparam.Add("success", false);
} }
} }
ret.Value = retparam; ret.Value = retparam;
return ret; return ret;
} }

View File

@ -90,7 +90,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
public void SetAura(Vector3 color, float radius) public void SetAura(Vector3 color, float radius)
{ {
SceneObjectPart From = m_Entity.RootPart; SceneObjectPart From = m_Entity.RootPart;
//m_log.Debug("[META ENTITY] BEFORE: radius = " + radius); //m_log.Debug("[META ENTITY] BEFORE: radius = " + radius);
float burstRadius = 0.1f; float burstRadius = 0.1f;
Primitive.ParticleSystem.SourcePattern patternFlags = Primitive.ParticleSystem.SourcePattern.None; Primitive.ParticleSystem.SourcePattern patternFlags = Primitive.ParticleSystem.SourcePattern.None;
@ -98,12 +98,12 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
float burstRate = 0.4f; float burstRate = 0.4f;
if (radius >= 8.0f) if (radius >= 8.0f)
{ {
//float sizeOfObject = radius / 2.0f; //float sizeOfObject = radius / 2.0f;
burstRadius = (radius - 8.0f)/3f; burstRadius = (radius - 8.0f)/3f;
burstRate = 1.5f; burstRate = 1.5f;
radius = 7.99f; radius = 7.99f;
patternFlags = Primitive.ParticleSystem.SourcePattern.Explode; patternFlags = Primitive.ParticleSystem.SourcePattern.Explode;
age = 4.0f; age = 4.0f;
} }
SetAura(From, color, radius, burstRadius, age, burstRate, patternFlags); SetAura(From, color, radius, burstRadius, age, burstRate, patternFlags);
} }
@ -111,48 +111,48 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
public void SetAura(SceneObjectPart From, Vector3 color, float radius, float burstRadius, float age, float burstRate, Primitive.ParticleSystem.SourcePattern patternFlags) public void SetAura(SceneObjectPart From, Vector3 color, float radius, float burstRadius, float age, float burstRate, Primitive.ParticleSystem.SourcePattern patternFlags)
{ {
Primitive.ParticleSystem prules = new Primitive.ParticleSystem(); Primitive.ParticleSystem prules = new Primitive.ParticleSystem();
//prules.PartDataFlags = Primitive.ParticleSystem.ParticleDataFlags.Emissive | //prules.PartDataFlags = Primitive.ParticleSystem.ParticleDataFlags.Emissive |
// Primitive.ParticleSystem.ParticleDataFlags.FollowSrc; //PSYS_PART_FLAGS // Primitive.ParticleSystem.ParticleDataFlags.FollowSrc; //PSYS_PART_FLAGS
//prules.PartDataFlags = Primitive.ParticleSystem.ParticleDataFlags.Beam | //prules.PartDataFlags = Primitive.ParticleSystem.ParticleDataFlags.Beam |
// Primitive.ParticleSystem.ParticleDataFlags.TargetPos; // Primitive.ParticleSystem.ParticleDataFlags.TargetPos;
prules.PartStartColor.R = color.X; //PSYS_PART_START_COLOR prules.PartStartColor.R = color.X; //PSYS_PART_START_COLOR
prules.PartStartColor.G = color.Y; prules.PartStartColor.G = color.Y;
prules.PartStartColor.B = color.Z; prules.PartStartColor.B = color.Z;
prules.PartStartColor.A = 0.5f; //PSYS_PART_START_ALPHA, transparency prules.PartStartColor.A = 0.5f; //PSYS_PART_START_ALPHA, transparency
prules.PartEndColor.R = color.X; //PSYS_PART_END_COLOR prules.PartEndColor.R = color.X; //PSYS_PART_END_COLOR
prules.PartEndColor.G = color.Y; prules.PartEndColor.G = color.Y;
prules.PartEndColor.B = color.Z; prules.PartEndColor.B = color.Z;
prules.PartEndColor.A = 0.5f; //PSYS_PART_END_ALPHA, transparency prules.PartEndColor.A = 0.5f; //PSYS_PART_END_ALPHA, transparency
/*prules.PartStartScaleX = 0.5f; //PSYS_PART_START_SCALE /*prules.PartStartScaleX = 0.5f; //PSYS_PART_START_SCALE
prules.PartStartScaleY = 0.5f; prules.PartStartScaleY = 0.5f;
prules.PartEndScaleX = 0.5f; //PSYS_PART_END_SCALE prules.PartEndScaleX = 0.5f; //PSYS_PART_END_SCALE
prules.PartEndScaleY = 0.5f; prules.PartEndScaleY = 0.5f;
*/ */
prules.PartStartScaleX = radius; //PSYS_PART_START_SCALE prules.PartStartScaleX = radius; //PSYS_PART_START_SCALE
prules.PartStartScaleY = radius; prules.PartStartScaleY = radius;
prules.PartEndScaleX = radius; //PSYS_PART_END_SCALE prules.PartEndScaleX = radius; //PSYS_PART_END_SCALE
prules.PartEndScaleY = radius; prules.PartEndScaleY = radius;
prules.PartMaxAge = age; //PSYS_PART_MAX_AGE prules.PartMaxAge = age; //PSYS_PART_MAX_AGE
prules.PartAcceleration.X = 0.0f; //PSYS_SRC_ACCEL prules.PartAcceleration.X = 0.0f; //PSYS_SRC_ACCEL
prules.PartAcceleration.Y = 0.0f; prules.PartAcceleration.Y = 0.0f;
prules.PartAcceleration.Z = 0.0f; prules.PartAcceleration.Z = 0.0f;
prules.Pattern = patternFlags; //PSYS_SRC_PATTERN prules.Pattern = patternFlags; //PSYS_SRC_PATTERN
//prules.Texture = UUID.Zero;//= UUID //PSYS_SRC_TEXTURE, default used if blank //prules.Texture = UUID.Zero;//= UUID //PSYS_SRC_TEXTURE, default used if blank
prules.BurstRate = burstRate; //PSYS_SRC_BURST_RATE prules.BurstRate = burstRate; //PSYS_SRC_BURST_RATE
prules.BurstPartCount = 2; //PSYS_SRC_BURST_PART_COUNT prules.BurstPartCount = 2; //PSYS_SRC_BURST_PART_COUNT
//prules.BurstRadius = radius; //PSYS_SRC_BURST_RADIUS //prules.BurstRadius = radius; //PSYS_SRC_BURST_RADIUS
prules.BurstRadius = burstRadius; //PSYS_SRC_BURST_RADIUS prules.BurstRadius = burstRadius; //PSYS_SRC_BURST_RADIUS
prules.BurstSpeedMin = 0.001f; //PSYS_SRC_BURST_SPEED_MIN prules.BurstSpeedMin = 0.001f; //PSYS_SRC_BURST_SPEED_MIN
prules.BurstSpeedMax = 0.001f; //PSYS_SRC_BURST_SPEED_MAX prules.BurstSpeedMax = 0.001f; //PSYS_SRC_BURST_SPEED_MAX
prules.MaxAge = 0.0f; //PSYS_SRC_MAX_AGE prules.MaxAge = 0.0f; //PSYS_SRC_MAX_AGE
//prules.Target = To; //PSYS_SRC_TARGET_KEY //prules.Target = To; //PSYS_SRC_TARGET_KEY
prules.AngularVelocity.X = 0.0f; //PSYS_SRC_OMEGA prules.AngularVelocity.X = 0.0f; //PSYS_SRC_OMEGA
prules.AngularVelocity.Y = 0.0f; prules.AngularVelocity.Y = 0.0f;
prules.AngularVelocity.Z = 0.0f; prules.AngularVelocity.Z = 0.0f;
prules.InnerAngle = 0.0f; //PSYS_SRC_ANGLE_BEGIN prules.InnerAngle = 0.0f; //PSYS_SRC_ANGLE_BEGIN
prules.OuterAngle = 0.0f; //PSYS_SRC_ANGLE_END prules.OuterAngle = 0.0f; //PSYS_SRC_ANGLE_END
prules.CRC = 1; //activates the particle system?? prules.CRC = 1; //activates the particle system??
From.AddNewParticleSystem(prules); From.AddNewParticleSystem(prules);
} }

View File

@ -79,15 +79,15 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
Vector3 FromPos = From.GetWorldPosition(); Vector3 FromPos = From.GetWorldPosition();
Vector3 ToPos = From.GetWorldPosition(); Vector3 ToPos = From.GetWorldPosition();
// UUID toUUID = To.UUID; // UUID toUUID = To.UUID;
float distance = (float) (Math.Sqrt(Math.Pow(FromPos.X-ToPos.X, 2) + float distance = (float) (Math.Sqrt(Math.Pow(FromPos.X-ToPos.X, 2) +
Math.Pow(FromPos.X-ToPos.Y, 2) + Math.Pow(FromPos.X-ToPos.Y, 2) +
Math.Pow(FromPos.X-ToPos.Z, 2) Math.Pow(FromPos.X-ToPos.Z, 2)
) )
); );
//float rate = (float) (distance/4f); //float rate = (float) (distance/4f);
float rate = 0.5f; float rate = 0.5f;
float scale = (float) (distance/128f); float scale = (float) (distance/128f);
float speed = (float) (2.0f - distance/128f); float speed = (float) (2.0f - distance/128f);
SetBeamToUUID(From, To, color, rate, scale, speed); SetBeamToUUID(From, To, color, rate, scale, speed);
} }
@ -95,42 +95,42 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
public void SetBeamToUUID(SceneObjectPart From, SceneObjectPart To, Vector3 color, float rate, float scale, float speed) public void SetBeamToUUID(SceneObjectPart From, SceneObjectPart To, Vector3 color, float rate, float scale, float speed)
{ {
Primitive.ParticleSystem prules = new Primitive.ParticleSystem(); Primitive.ParticleSystem prules = new Primitive.ParticleSystem();
//prules.PartDataFlags = Primitive.ParticleSystem.ParticleDataFlags.Emissive | //prules.PartDataFlags = Primitive.ParticleSystem.ParticleDataFlags.Emissive |
// Primitive.ParticleSystem.ParticleDataFlags.FollowSrc; //PSYS_PART_FLAGS // Primitive.ParticleSystem.ParticleDataFlags.FollowSrc; //PSYS_PART_FLAGS
prules.PartDataFlags = Primitive.ParticleSystem.ParticleDataFlags.Beam | prules.PartDataFlags = Primitive.ParticleSystem.ParticleDataFlags.Beam |
Primitive.ParticleSystem.ParticleDataFlags.TargetPos; Primitive.ParticleSystem.ParticleDataFlags.TargetPos;
prules.PartStartColor.R = color.X; //PSYS_PART_START_COLOR prules.PartStartColor.R = color.X; //PSYS_PART_START_COLOR
prules.PartStartColor.G = color.Y; prules.PartStartColor.G = color.Y;
prules.PartStartColor.B = color.Z; prules.PartStartColor.B = color.Z;
prules.PartStartColor.A = 1.0f; //PSYS_PART_START_ALPHA, transparency prules.PartStartColor.A = 1.0f; //PSYS_PART_START_ALPHA, transparency
prules.PartEndColor.R = color.X; //PSYS_PART_END_COLOR prules.PartEndColor.R = color.X; //PSYS_PART_END_COLOR
prules.PartEndColor.G = color.Y; prules.PartEndColor.G = color.Y;
prules.PartEndColor.B = color.Z; prules.PartEndColor.B = color.Z;
prules.PartEndColor.A = 1.0f; //PSYS_PART_END_ALPHA, transparency prules.PartEndColor.A = 1.0f; //PSYS_PART_END_ALPHA, transparency
prules.PartStartScaleX = scale; //PSYS_PART_START_SCALE prules.PartStartScaleX = scale; //PSYS_PART_START_SCALE
prules.PartStartScaleY = scale; prules.PartStartScaleY = scale;
prules.PartEndScaleX = scale; //PSYS_PART_END_SCALE prules.PartEndScaleX = scale; //PSYS_PART_END_SCALE
prules.PartEndScaleY = scale; prules.PartEndScaleY = scale;
prules.PartMaxAge = 1.0f; //PSYS_PART_MAX_AGE prules.PartMaxAge = 1.0f; //PSYS_PART_MAX_AGE
prules.PartAcceleration.X = 0.0f; //PSYS_SRC_ACCEL prules.PartAcceleration.X = 0.0f; //PSYS_SRC_ACCEL
prules.PartAcceleration.Y = 0.0f; prules.PartAcceleration.Y = 0.0f;
prules.PartAcceleration.Z = 0.0f; prules.PartAcceleration.Z = 0.0f;
//prules.Pattern = Primitive.ParticleSystem.SourcePattern.Explode; //PSYS_SRC_PATTERN //prules.Pattern = Primitive.ParticleSystem.SourcePattern.Explode; //PSYS_SRC_PATTERN
//prules.Texture = UUID.Zero;//= UUID //PSYS_SRC_TEXTURE, default used if blank //prules.Texture = UUID.Zero;//= UUID //PSYS_SRC_TEXTURE, default used if blank
prules.BurstRate = rate; //PSYS_SRC_BURST_RATE prules.BurstRate = rate; //PSYS_SRC_BURST_RATE
prules.BurstPartCount = 1; //PSYS_SRC_BURST_PART_COUNT prules.BurstPartCount = 1; //PSYS_SRC_BURST_PART_COUNT
prules.BurstRadius = 0.5f; //PSYS_SRC_BURST_RADIUS prules.BurstRadius = 0.5f; //PSYS_SRC_BURST_RADIUS
prules.BurstSpeedMin = speed; //PSYS_SRC_BURST_SPEED_MIN prules.BurstSpeedMin = speed; //PSYS_SRC_BURST_SPEED_MIN
prules.BurstSpeedMax = speed; //PSYS_SRC_BURST_SPEED_MAX prules.BurstSpeedMax = speed; //PSYS_SRC_BURST_SPEED_MAX
prules.MaxAge = 0.0f; //PSYS_SRC_MAX_AGE prules.MaxAge = 0.0f; //PSYS_SRC_MAX_AGE
prules.Target = To.UUID; //PSYS_SRC_TARGET_KEY prules.Target = To.UUID; //PSYS_SRC_TARGET_KEY
prules.AngularVelocity.X = 0.0f; //PSYS_SRC_OMEGA prules.AngularVelocity.X = 0.0f; //PSYS_SRC_OMEGA
prules.AngularVelocity.Y = 0.0f; prules.AngularVelocity.Y = 0.0f;
prules.AngularVelocity.Z = 0.0f; prules.AngularVelocity.Z = 0.0f;
prules.InnerAngle = 0.0f; //PSYS_SRC_ANGLE_BEGIN prules.InnerAngle = 0.0f; //PSYS_SRC_ANGLE_BEGIN
prules.OuterAngle = 0.0f; //PSYS_SRC_ANGLE_END prules.OuterAngle = 0.0f; //PSYS_SRC_ANGLE_END
prules.CRC = 1; //activates the particle system?? prules.CRC = 1; //activates the particle system??
From.AddNewParticleSystem(prules); From.AddNewParticleSystem(prules);
} }

View File

@ -82,7 +82,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
CMModel m_model = null; CMModel m_model = null;
/// <value> /// <value>
/// A list of all the scenes that should be revisioned. Controller is the only class that keeps track of all scenes in the region. /// A list of all the scenes that should be revisioned. Controller is the only class that keeps track of all scenes in the region.
/// </value> /// </value>
Hashtable m_sceneList = Hashtable.Synchronized(new Hashtable()); Hashtable m_sceneList = Hashtable.Synchronized(new Hashtable());
State m_state = State.NONE; State m_state = State.NONE;
@ -129,31 +129,31 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
/// </summary> /// </summary>
private SceneObjectGroup GetGroupByPrim(uint localID) private SceneObjectGroup GetGroupByPrim(uint localID)
{ {
foreach(Object currScene in m_sceneList.Values) foreach (Object currScene in m_sceneList.Values)
{ {
foreach (EntityBase ent in ((Scene)currScene).GetEntities()) foreach (EntityBase ent in ((Scene)currScene).GetEntities())
{ {
if (ent is SceneObjectGroup) if (ent is SceneObjectGroup)
{ {
if (((SceneObjectGroup)ent).HasChildPrim(localID)) if (((SceneObjectGroup)ent).HasChildPrim(localID))
return (SceneObjectGroup)ent; return (SceneObjectGroup)ent;
} }
} }
} }
return null; return null;
} }
private void Initialize(CMModel model, CMView view, Scene scene, int channel) private void Initialize(CMModel model, CMView view, Scene scene, int channel)
{ {
lock(this) lock (this)
{ {
m_estateModule = scene.RequestModuleInterface<IEstateModule>(); m_estateModule = scene.RequestModuleInterface<IEstateModule>();
m_thread = new Thread( MainLoop ); m_thread = new Thread(MainLoop);
m_thread.Name = "Content Management"; m_thread.Name = "Content Management";
m_thread.IsBackground = true; m_thread.IsBackground = true;
m_thread.Start(); m_thread.Start();
ThreadTracker.Add(m_thread); ThreadTracker.Add(m_thread);
m_state = State.NONE; m_state = State.NONE;
} }
} }
@ -164,41 +164,41 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
{ {
CMModel model = m_model; CMView view = m_view; int channel = m_channel; CMModel model = m_model; CMView view = m_view; int channel = m_channel;
Work currentJob = new Work(); Work currentJob = new Work();
while(true) while (true)
{ {
currentJob = m_WorkQueue.Dequeue(); currentJob = m_WorkQueue.Dequeue();
m_log.Debug("[CONTENT MANAGEMENT] MAIN LOOP -- DeQueued a request"); m_log.Debug("[CONTENT MANAGEMENT] MAIN LOOP -- DeQueued a request");
m_log.Debug("[CONTENT MANAGEMENT] MAIN LOOP -- Work type: " + currentJob.Type); m_log.Debug("[CONTENT MANAGEMENT] MAIN LOOP -- Work type: " + currentJob.Type);
switch(currentJob.Type) switch (currentJob.Type)
{ {
case WorkType.NONE: case WorkType.NONE:
break; break;
case WorkType.OBJECTATTRIBUTECHANGE: case WorkType.OBJECTATTRIBUTECHANGE:
ObjectAttributeChanged(model, view, currentJob.LocalId); ObjectAttributeChanged(model, view, currentJob.LocalId);
break; break;
case WorkType.PRIMITIVEADDED: case WorkType.PRIMITIVEADDED:
PrimitiveAdded(model, view, currentJob); PrimitiveAdded(model, view, currentJob);
break; break;
case WorkType.OBJECTDUPLICATED: case WorkType.OBJECTDUPLICATED:
ObjectDuplicated(model, view, currentJob.LocalId); ObjectDuplicated(model, view, currentJob.LocalId);
break; break;
case WorkType.OBJECTKILLED: case WorkType.OBJECTKILLED:
ObjectKilled(model, view, (SceneObjectGroup) currentJob.Data1); ObjectKilled(model, view, (SceneObjectGroup) currentJob.Data1);
break; break;
case WorkType.UNDODID: case WorkType.UNDODID:
UndoDid(model, view, currentJob.UUID); UndoDid(model, view, currentJob.UUID);
break; break;
case WorkType.NEWCLIENT: case WorkType.NEWCLIENT:
NewClient(view, (IClientAPI) currentJob.Data1); NewClient(view, (IClientAPI) currentJob.Data1);
break; break;
case WorkType.SIMCHAT: case WorkType.SIMCHAT:
m_log.Debug("[CONTENT MANAGEMENT] MAIN LOOP -- Message received: " + ((OSChatMessage) currentJob.Data1).Message); m_log.Debug("[CONTENT MANAGEMENT] MAIN LOOP -- Message received: " + ((OSChatMessage) currentJob.Data1).Message);
SimChat(model, view, (OSChatMessage) currentJob.Data1, channel); SimChat(model, view, (OSChatMessage) currentJob.Data1, channel);
break; break;
default: default:
m_log.Debug("[CONTENT MANAGEMENT] MAIN LOOP -- uuuuuuuuuh, what?"); m_log.Debug("[CONTENT MANAGEMENT] MAIN LOOP -- uuuuuuuuuh, what?");
break; break;
} }
} }
} }
@ -207,24 +207,24 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
/// </summary> /// </summary>
private void NewClient(CMView view, IClientAPI client) private void NewClient(CMView view, IClientAPI client)
{ {
if ((m_state & State.SHOWING_CHANGES) > 0) if ((m_state & State.SHOWING_CHANGES) > 0)
view.SendMetaEntitiesToNewClient(client); view.SendMetaEntitiesToNewClient(client);
} }
/// <summary> /// <summary>
/// Only called by the MainLoop. /// Only called by the MainLoop.
/// </summary> /// </summary>
private void ObjectAttributeChanged(CMModel model, CMView view, uint LocalId) private void ObjectAttributeChanged(CMModel model, CMView view, uint LocalId)
{ {
SceneObjectGroup group = null; SceneObjectGroup group = null;
if ((m_state & State.SHOWING_CHANGES) > 0) if ((m_state & State.SHOWING_CHANGES) > 0)
{ {
group = GetGroupByPrim(LocalId); group = GetGroupByPrim(LocalId);
if (group != null) if (group != null)
{ {
view.DisplayAuras( model.UpdateNormalEntityEffects(group) ); //Might be a normal entity (green aura) view.DisplayAuras(model.UpdateNormalEntityEffects(group)); //Might be a normal entity (green aura)
m_view.DisplayMetaEntity(group.UUID); //Might be a meta entity (blue aura) m_view.DisplayMetaEntity(group.UUID); //Might be a meta entity (blue aura)
} }
} }
} }
@ -234,43 +234,43 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
private void ObjectDuplicated(CMModel model, CMView view, uint localId) private void ObjectDuplicated(CMModel model, CMView view, uint localId)
{ {
if ((m_state & State.SHOWING_CHANGES) > 0) if ((m_state & State.SHOWING_CHANGES) > 0)
view.DisplayAuras(model.CheckForNewEntitiesMissingAuras( GetGroupByPrim(localId).Scene )); view.DisplayAuras(model.CheckForNewEntitiesMissingAuras(GetGroupByPrim(localId).Scene));
} }
/// <summary> /// <summary>
/// Only called by the MainLoop. /// Only called by the MainLoop.
/// </summary> /// </summary>
private void ObjectKilled(CMModel model, CMView view, SceneObjectGroup group) private void ObjectKilled(CMModel model, CMView view, SceneObjectGroup group)
{ {
if ((m_state & State.SHOWING_CHANGES) > 0) if ((m_state & State.SHOWING_CHANGES) > 0)
{ {
view.RemoveOrUpdateDeletedEntity(group); view.RemoveOrUpdateDeletedEntity(group);
model.RemoveOrUpdateDeletedEntity(group); model.RemoveOrUpdateDeletedEntity(group);
} }
} }
/// <summary> /// <summary>
/// Only called by the MainLoop. /// Only called by the MainLoop.
/// </summary> /// </summary>
private void PrimitiveAdded(CMModel model, CMView view, Work currentJob) private void PrimitiveAdded(CMModel model, CMView view, Work currentJob)
{ {
if ((m_state & State.SHOWING_CHANGES) > 0) if ((m_state & State.SHOWING_CHANGES) > 0)
{ {
foreach(Object scene in m_sceneList.Values) foreach (Object scene in m_sceneList.Values)
m_view.DisplayAuras(model.CheckForNewEntitiesMissingAuras((Scene) scene)); m_view.DisplayAuras(model.CheckForNewEntitiesMissingAuras((Scene) scene));
} }
} }
/// <summary> /// <summary>
/// Only called by the MainLoop. /// Only called by the MainLoop.
/// </summary> /// </summary>
private void UndoDid(CMModel model, CMView view, UUID uuid) private void UndoDid(CMModel model, CMView view, UUID uuid)
{ {
if ((m_state & State.SHOWING_CHANGES) > 0) if ((m_state & State.SHOWING_CHANGES) > 0)
{ {
ContentManagementEntity ent = model.FindMetaEntityAffectedByUndo(uuid); ContentManagementEntity ent = model.FindMetaEntityAffectedByUndo(uuid);
if (ent != null) if (ent != null)
view.DisplayEntity(ent); view.DisplayEntity(ent);
} }
} }
@ -328,38 +328,38 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
/// <summary> /// <summary>
/// Takes a list of scenes and forms a new orderd list according to the proximity of scenes to the second argument. /// Takes a list of scenes and forms a new orderd list according to the proximity of scenes to the second argument.
/// </summary> /// </summary>
protected static System.Collections.Generic.List<Scene> ScenesInOrderOfProximity( Hashtable sceneList, Scene scene) protected static System.Collections.Generic.List<Scene> ScenesInOrderOfProximity(Hashtable sceneList, Scene scene)
{ {
int somethingAddedToList = 1; int somethingAddedToList = 1;
System.Collections.Generic.List<Scene> newList = new List<Scene>(); System.Collections.Generic.List<Scene> newList = new List<Scene>();
newList.Add(scene); newList.Add(scene);
if (! sceneList.ContainsValue(scene)) if (!sceneList.ContainsValue(scene))
{ {
foreach(Object sceneObj in sceneList) foreach (Object sceneObj in sceneList)
newList.Add((Scene) sceneObj); newList.Add((Scene) sceneObj);
return newList; return newList;
} }
while(somethingAddedToList > 0) while (somethingAddedToList > 0)
{ {
somethingAddedToList = 0; somethingAddedToList = 0;
for(int i = 0; i < newList.Count; i++) for (int i = 0; i < newList.Count; i++)
{ {
foreach(Object sceneObj in sceneList.Values) foreach (Object sceneObj in sceneList.Values)
{ {
if (newList[i].CheckNeighborRegion(((Scene)sceneObj).RegionInfo) && (! newList.Contains((Scene)sceneObj)) ) if (newList[i].CheckNeighborRegion(((Scene)sceneObj).RegionInfo) && (!newList.Contains((Scene)sceneObj)))
{ {
newList.Add((Scene)sceneObj); newList.Add((Scene)sceneObj);
somethingAddedToList++; somethingAddedToList++;
} }
} }
} }
} }
foreach(Object sceneObj in sceneList.Values) foreach (Object sceneObj in sceneList.Values)
if (! newList.Contains((Scene)sceneObj)) if (!newList.Contains((Scene)sceneObj))
newList.Add((Scene)sceneObj); newList.Add((Scene)sceneObj);
return newList; return newList;
} }
@ -381,7 +381,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
protected void StartManaging(IClientAPI client) protected void StartManaging(IClientAPI client)
{ {
m_log.Debug("[CONTENT MANAGEMENT] Registering channel with chat services."); m_log.Debug("[CONTENT MANAGEMENT] Registering channel with chat services.");
client.OnChatFromViewer += SimChatSent; client.OnChatFromViewer += SimChatSent;
//init = true; //init = true;
OnNewClient(client); OnNewClient(client);
@ -401,19 +401,19 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
} }
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
protected void StopManaging(UUID clientUUID) protected void StopManaging(UUID clientUUID)
{ {
foreach(Object sceneobj in m_sceneList.Values) foreach (Object sceneobj in m_sceneList.Values)
{ {
ScenePresence presence = ((Scene)sceneobj).GetScenePresence(clientUUID); ScenePresence presence = ((Scene)sceneobj).GetScenePresence(clientUUID);
if (presence != null) if (presence != null)
{ {
IClientAPI client = presence.ControllingClient; IClientAPI client = presence.ControllingClient;
m_log.Debug("[CONTENT MANAGEMENT] Unregistering channel with chat services."); m_log.Debug("[CONTENT MANAGEMENT] Unregistering channel with chat services.");
client.OnChatFromViewer -= SimChatSent; client.OnChatFromViewer -= SimChatSent;
m_log.Debug("[CONTENT MANAGEMENT] Removing handlers to client"); m_log.Debug("[CONTENT MANAGEMENT] Removing handlers to client");
client.OnUpdatePrimScale -= UpdateSingleScale; client.OnUpdatePrimScale -= UpdateSingleScale;
client.OnUpdatePrimGroupScale -= UpdateMultipleScale; client.OnUpdatePrimGroupScale -= UpdateMultipleScale;
@ -427,10 +427,10 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
client.OnUndo -= OnUnDid; client.OnUndo -= OnUnDid;
//client.OnUpdatePrimGroupMouseRotation += m_innerScene.UpdatePrimRotation; //client.OnUpdatePrimGroupMouseRotation += m_innerScene.UpdatePrimRotation;
return; return;
} }
} }
} }
protected void UpdateMultiplePosition(uint localID, Vector3 pos, IClientAPI remoteClient) protected void UpdateMultiplePosition(uint localID, Vector3 pos, IClientAPI remoteClient)
{ {
Work moreWork = new Work(); Work moreWork = new Work();
@ -479,7 +479,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
} }
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
protected void UpdateSingleRotation(uint localID, Quaternion rot, IClientAPI remoteClient) protected void UpdateSingleRotation(uint localID, Quaternion rot, IClientAPI remoteClient)
{ {
@ -504,47 +504,47 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
/// </summary> /// </summary>
protected void commit(string message, Scene scene, CMModel model, CMView view) protected void commit(string message, Scene scene, CMModel model, CMView view)
{ {
System.Collections.Generic.List<Scene> proximitySceneList = ScenesInOrderOfProximity( m_sceneList, scene); System.Collections.Generic.List<Scene> proximitySceneList = ScenesInOrderOfProximity(m_sceneList, scene);
string[] args = message.Split(new char[] {' '}); string[] args = message.Split(new char[] {' '});
char[] logMessage = {' '}; char[] logMessage = {' '};
if (args.Length > 1) if (args.Length > 1)
{ {
logMessage = new char[message.Length - (args[0].Length)]; logMessage = new char[message.Length - (args[0].Length)];
message.CopyTo(args[0].Length, logMessage, 0, message.Length - (args[0].Length)); message.CopyTo(args[0].Length, logMessage, 0, message.Length - (args[0].Length));
} }
m_log.Debug("[CONTENT MANAGEMENT] Saving terrain and objects of region."); m_log.Debug("[CONTENT MANAGEMENT] Saving terrain and objects of region.");
foreach(Scene currScene in proximitySceneList) foreach (Scene currScene in proximitySceneList)
{ {
model.CommitRegion(currScene, new String(logMessage)); model.CommitRegion(currScene, new String(logMessage));
view.SendSimChatMessage(scene, "Region Saved Successfully: " + currScene.RegionInfo.RegionName); view.SendSimChatMessage(scene, "Region Saved Successfully: " + currScene.RegionInfo.RegionName);
} }
view.SendSimChatMessage(scene, "Successfully saved all regions."); view.SendSimChatMessage(scene, "Successfully saved all regions.");
m_state |= State.DIRTY; m_state |= State.DIRTY;
if ((m_state & State.SHOWING_CHANGES) > 0) //DISPLAY NEW CHANGES INSTEAD OF OLD CHANGES if ((m_state & State.SHOWING_CHANGES) > 0) //DISPLAY NEW CHANGES INSTEAD OF OLD CHANGES
{ {
view.SendSimChatMessage(scene, "Updating differences between new revision and current environment."); view.SendSimChatMessage(scene, "Updating differences between new revision and current environment.");
//Hide objects from users and Forget about them //Hide objects from users and Forget about them
view.HideAllMetaEntities(); view.HideAllMetaEntities();
view.HideAllAuras(); view.HideAllAuras();
model.DeleteAllMetaObjects(); model.DeleteAllMetaObjects();
//Recreate them from backend files //Recreate them from backend files
foreach(Scene currScene in proximitySceneList) foreach (Scene currScene in proximitySceneList)
{ {
model.UpdateCMEntities(currScene); model.UpdateCMEntities(currScene);
view.SendSimChatMessage(scene, "Finished updating differences between current scene and last revision: " + currScene.RegionInfo.RegionName); view.SendSimChatMessage(scene, "Finished updating differences between current scene and last revision: " + currScene.RegionInfo.RegionName);
} }
//Display new objects to users1 //Display new objects to users1
view.DisplayRecentChanges(); view.DisplayRecentChanges();
view.SendSimChatMessage(scene, "Finished updating for DIFF-MODE."); view.SendSimChatMessage(scene, "Finished updating for DIFF-MODE.");
m_state &= ~(State.DIRTY); m_state &= ~(State.DIRTY);
m_state |= State.SHOWING_CHANGES; m_state |= State.SHOWING_CHANGES;
} }
} }
@ -553,74 +553,74 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
/// </summary> /// </summary>
protected void diffmode(Scene scene, CMModel model, CMView view) protected void diffmode(Scene scene, CMModel model, CMView view)
{ {
System.Collections.Generic.List<Scene> proximitySceneList = ScenesInOrderOfProximity( m_sceneList, scene); System.Collections.Generic.List<Scene> proximitySceneList = ScenesInOrderOfProximity(m_sceneList, scene);
if ((m_state & State.SHOWING_CHANGES) > 0) // TURN OFF if ((m_state & State.SHOWING_CHANGES) > 0) // TURN OFF
{ {
view.SendSimChatMessage(scene, "Hiding all meta objects."); view.SendSimChatMessage(scene, "Hiding all meta objects.");
view.HideAllMetaEntities(); view.HideAllMetaEntities();
view.HideAllAuras(); view.HideAllAuras();
view.SendSimChatMessage(scene, "Diff-mode = OFF"); view.SendSimChatMessage(scene, "Diff-mode = OFF");
m_state &= ~State.SHOWING_CHANGES; m_state &= ~State.SHOWING_CHANGES;
return; return;
} }
else // TURN ON else // TURN ON
{ {
if ((m_state & State.DIRTY) != 0 || m_state == State.NONE) if ((m_state & State.DIRTY) != 0 || m_state == State.NONE)
{ {
view.SendSimChatMessage(scene, "Hiding meta objects and replacing with latest revision"); view.SendSimChatMessage(scene, "Hiding meta objects and replacing with latest revision");
//Hide objects from users and Forget about them //Hide objects from users and Forget about them
view.HideAllMetaEntities(); view.HideAllMetaEntities();
view.HideAllAuras(); view.HideAllAuras();
model.DeleteAllMetaObjects(); model.DeleteAllMetaObjects();
//Recreate them from backend files //Recreate them from backend files
foreach(Object currScene in m_sceneList.Values) foreach (Object currScene in m_sceneList.Values)
model.UpdateCMEntities((Scene) currScene); model.UpdateCMEntities((Scene) currScene);
} }
else if ((m_state & State.DIRTY) != 0) { else if ((m_state & State.DIRTY) != 0) {
view.SendSimChatMessage(scene, "Forming list of meta entities with latest revision"); view.SendSimChatMessage(scene, "Forming list of meta entities with latest revision");
foreach(Scene currScene in proximitySceneList) foreach (Scene currScene in proximitySceneList)
model.UpdateCMEntities(currScene); model.UpdateCMEntities(currScene);
} }
view.SendSimChatMessage(scene, "Displaying differences between last revision and current environment"); view.SendSimChatMessage(scene, "Displaying differences between last revision and current environment");
foreach(Scene currScene in proximitySceneList) foreach (Scene currScene in proximitySceneList)
model.CheckForNewEntitiesMissingAuras(currScene); model.CheckForNewEntitiesMissingAuras(currScene);
view.DisplayRecentChanges(); view.DisplayRecentChanges();
view.SendSimChatMessage(scene, "Diff-mode = ON"); view.SendSimChatMessage(scene, "Diff-mode = ON");
m_state |= State.SHOWING_CHANGES; m_state |= State.SHOWING_CHANGES;
m_state &= ~State.DIRTY; m_state &= ~State.DIRTY;
} }
} }
/// <summary> /// <summary>
/// Only called from within the SimChat method. Hides all auras and meta entities, /// Only called from within the SimChat method. Hides all auras and meta entities,
/// retrieves the current scene object list with the most recent revision retrieved from the model for each scene, /// retrieves the current scene object list with the most recent revision retrieved from the model for each scene,
/// then lets the view update the clients of the new objects. /// then lets the view update the clients of the new objects.
/// </summary> /// </summary>
protected void rollback(Scene scene, CMModel model, CMView view) protected void rollback(Scene scene, CMModel model, CMView view)
{ {
if ((m_state & State.SHOWING_CHANGES) > 0) if ((m_state & State.SHOWING_CHANGES) > 0)
{ {
view.HideAllAuras(); view.HideAllAuras();
view.HideAllMetaEntities(); view.HideAllMetaEntities();
} }
System.Collections.Generic.List<Scene> proximitySceneList = ScenesInOrderOfProximity( m_sceneList, scene); System.Collections.Generic.List<Scene> proximitySceneList = ScenesInOrderOfProximity(m_sceneList, scene);
foreach(Scene currScene in proximitySceneList) foreach (Scene currScene in proximitySceneList)
model.RollbackRegion(currScene); model.RollbackRegion(currScene);
if ((m_state & State.DIRTY) != 0 ) if ((m_state & State.DIRTY) != 0)
{ {
model.DeleteAllMetaObjects(); model.DeleteAllMetaObjects();
foreach(Scene currScene in proximitySceneList) foreach (Scene currScene in proximitySceneList)
model.UpdateCMEntities(currScene); model.UpdateCMEntities(currScene);
} }
if ((m_state & State.SHOWING_CHANGES) > 0) if ((m_state & State.SHOWING_CHANGES) > 0)
view.DisplayRecentChanges(); view.DisplayRecentChanges();
} }
#endregion Protected Methods #endregion Protected Methods
@ -642,7 +642,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
scene.EventManager.OnNewClient += StartManaging; scene.EventManager.OnNewClient += StartManaging;
scene.EventManager.OnRemovePresence += StopManaging; scene.EventManager.OnRemovePresence += StopManaging;
// scene.EventManager.OnAvatarEnteringNewParcel += AvatarEnteringParcel; // scene.EventManager.OnAvatarEnteringNewParcel += AvatarEnteringParcel;
scene.EventManager.OnObjectBeingRemovedFromScene += GroupBeingDeleted; scene.EventManager.OnObjectBeingRemovedFromScene += GroupBeingDeleted;
} }
@ -652,9 +652,9 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
public void SimChat(CMModel model, CMView view, OSChatMessage e, int channel) public void SimChat(CMModel model, CMView view, OSChatMessage e, int channel)
{ {
if (e.Channel != channel) if (e.Channel != channel)
return; return;
if (e.Sender == null) if (e.Sender == null)
return; return;
m_log.Debug("[CONTENT MANAGEMENT] Message received: " + e.Message); m_log.Debug("[CONTENT MANAGEMENT] Message received: " + e.Message);
@ -667,31 +667,31 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
if (!(m_estateModule.IsManager(avatar.UUID))) if (!(m_estateModule.IsManager(avatar.UUID)))
{ {
m_log.Debug("[CONTENT MANAGEMENT] Message sent from non Estate Manager ... ignoring."); m_log.Debug("[CONTENT MANAGEMENT] Message sent from non Estate Manager ... ignoring.");
view.SendSimChatMessage(scene, "You must be an estate manager to perform that action."); view.SendSimChatMessage(scene, "You must be an estate manager to perform that action.");
return; return;
} }
switch(args[0]) switch (args[0])
{ {
case "ci": case "ci":
case "commit": case "commit":
commit(message, scene, model, view); commit(message, scene, model, view);
break; break;
case "dm": case "dm":
case "diff-mode": case "diff-mode":
diffmode(scene, model, view); diffmode(scene, model, view);
break; break;
case "rb": case "rb":
case "rollback": case "rollback":
rollback(scene, model, view); rollback(scene, model, view);
break; break;
case "help": case "help":
m_view.DisplayHelpMenu(scene); m_view.DisplayHelpMenu(scene);
break; break;
default: default:
view.SendSimChatMessage(scene, "Command not found: " + args[0]); view.SendSimChatMessage(scene, "Command not found: " + args[0]);
break; break;
} }
} }
@ -705,7 +705,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
[Flags] [Flags]
private enum State private enum State
{ {
NONE = 0, NONE = 0,
DIRTY = 1, // The meta entities may not correctly represent the last revision. DIRTY = 1, // The meta entities may not correctly represent the last revision.
SHOWING_CHANGES = 1<<1 // The meta entities are being shown to user. SHOWING_CHANGES = 1<<1 // The meta entities are being shown to user.
} }

View File

@ -58,8 +58,8 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
{ {
#region Fields #region Fields
// private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); // private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
// Any ContentManagementEntities that represent old versions of current SceneObjectGroups or // Any ContentManagementEntities that represent old versions of current SceneObjectGroups or
// old versions of deleted SceneObjectGroups will be stored in this hash table. // old versions of deleted SceneObjectGroups will be stored in this hash table.
// The UUID keys are from the SceneObjectGroup RootPart UUIDs // The UUID keys are from the SceneObjectGroup RootPart UUIDs
protected Hashtable m_CMEntityHash = Hashtable.Synchronized(new Hashtable()); //UUID to ContentManagementEntity protected Hashtable m_CMEntityHash = Hashtable.Synchronized(new Hashtable()); //UUID to ContentManagementEntity
@ -97,7 +97,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
public bool AddAura(ContentManagementEntity aura) public bool AddAura(ContentManagementEntity aura)
{ {
if (m_NewlyCreatedEntityAura.ContainsKey(aura.UUID)) if (m_NewlyCreatedEntityAura.ContainsKey(aura.UUID))
return false; return false;
m_NewlyCreatedEntityAura.Add(aura.UUID, aura); m_NewlyCreatedEntityAura.Add(aura.UUID, aura);
return true; return true;
} }
@ -105,7 +105,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
public bool AddEntity(ContentManagementEntity ent) public bool AddEntity(ContentManagementEntity ent)
{ {
if (m_CMEntityHash.ContainsKey(ent.UUID)) if (m_CMEntityHash.ContainsKey(ent.UUID))
return false; return false;
m_CMEntityHash.Add(ent.UUID, ent); m_CMEntityHash.Add(ent.UUID, ent);
return true; return true;
} }
@ -115,23 +115,23 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
{ {
System.Collections.ArrayList missingList = new System.Collections.ArrayList(); System.Collections.ArrayList missingList = new System.Collections.ArrayList();
SceneObjectGroup temp = null; SceneObjectGroup temp = null;
foreach( EntityBase currObj in currList ) foreach (EntityBase currObj in currList)
{ {
if (! (currObj is SceneObjectGroup)) if (!(currObj is SceneObjectGroup))
continue; continue;
temp = (SceneObjectGroup) currObj; temp = (SceneObjectGroup) currObj;
if (m_CMEntityHash.ContainsKey(temp.UUID)) if (m_CMEntityHash.ContainsKey(temp.UUID))
{ {
foreach(SceneObjectPart part in temp.Children.Values) foreach (SceneObjectPart part in temp.Children.Values)
if (!((ContentManagementEntity)m_CMEntityHash[temp.UUID]).HasChildPrim(part.UUID)) if (!((ContentManagementEntity)m_CMEntityHash[temp.UUID]).HasChildPrim(part.UUID))
missingList.Add(part); missingList.Add(part);
} }
else //Entire group is missing from revision. (and is a new part in region) else //Entire group is missing from revision. (and is a new part in region)
{ {
foreach(SceneObjectPart part in temp.Children.Values) foreach (SceneObjectPart part in temp.Children.Values)
missingList.Add(part); missingList.Add(part);
} }
} }
return missingList; return missingList;
} }
@ -146,9 +146,9 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
public AuraMetaEntity CreateAuraForNewlyCreatedEntity(SceneObjectPart part) public AuraMetaEntity CreateAuraForNewlyCreatedEntity(SceneObjectPart part)
{ {
AuraMetaEntity ent = new AuraMetaEntity(part.ParentGroup.Scene, AuraMetaEntity ent = new AuraMetaEntity(part.ParentGroup.Scene,
part.ParentGroup.Scene.PrimIDAllocate(), part.ParentGroup.Scene.PrimIDAllocate(),
part.GetWorldPosition(), part.GetWorldPosition(),
MetaEntity.TRANSLUCENT, MetaEntity.TRANSLUCENT,
new Vector3(0,254,0), new Vector3(0,254,0),
part.Scale part.Scale
); );
@ -168,7 +168,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
{ {
ContentManagementEntity ent = new ContentManagementEntity(xml, scene, false); ContentManagementEntity ent = new ContentManagementEntity(xml, scene, false);
if (ent == null) if (ent == null)
return null; return null;
m_CMEntityHash.Add(ent.UnchangedEntity.UUID, ent); m_CMEntityHash.Add(ent.UnchangedEntity.UUID, ent);
return ent; return ent;
} }
@ -176,7 +176,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
public bool RemoveEntity(UUID uuid) public bool RemoveEntity(UUID uuid)
{ {
if (!m_CMEntityHash.ContainsKey(uuid)) if (!m_CMEntityHash.ContainsKey(uuid))
return false; return false;
m_CMEntityHash.Remove(uuid); m_CMEntityHash.Remove(uuid);
return true; return true;
} }
@ -184,7 +184,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
public bool RemoveNewlyCreatedEntityAura(UUID uuid) public bool RemoveNewlyCreatedEntityAura(UUID uuid)
{ {
if (!m_NewlyCreatedEntityAura.ContainsKey(uuid)) if (!m_NewlyCreatedEntityAura.ContainsKey(uuid))
return false; return false;
m_NewlyCreatedEntityAura.Remove(uuid); m_NewlyCreatedEntityAura.Remove(uuid);
return true; return true;
} }

View File

@ -27,8 +27,8 @@
#region Header #region Header
// CMModel.cs // CMModel.cs
// User: bongiojp // User: bongiojp
// //
// //
@ -100,13 +100,13 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
ArrayList missingList = null; ArrayList missingList = null;
ArrayList newList = new ArrayList(); ArrayList newList = new ArrayList();
m_log.Debug("[CONTENT MANAGEMENT] Checking for new scene object parts in scene: " + scene.RegionInfo.RegionName); m_log.Debug("[CONTENT MANAGEMENT] Checking for new scene object parts in scene: " + scene.RegionInfo.RegionName);
//Check if the current scene has groups not included in the current list of MetaEntities //Check if the current scene has groups not included in the current list of MetaEntities
//If so, then the current scene's parts that are new should be marked green. //If so, then the current scene's parts that are new should be marked green.
missingList = m_MetaEntityCollection.CheckForMissingEntities(scene.GetEntities()); missingList = m_MetaEntityCollection.CheckForMissingEntities(scene.GetEntities());
foreach(Object missingPart in missingList) foreach (Object missingPart in missingList)
{ {
if (m_MetaEntityCollection.Auras.ContainsKey(((SceneObjectPart)missingPart).UUID)) if (m_MetaEntityCollection.Auras.ContainsKey(((SceneObjectPart)missingPart).UUID))
continue; continue;
@ -175,16 +175,16 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
public void RemoveOrUpdateDeletedEntity(SceneObjectGroup group) public void RemoveOrUpdateDeletedEntity(SceneObjectGroup group)
{ {
// Deal with new parts not revisioned that have been deleted. // Deal with new parts not revisioned that have been deleted.
foreach(SceneObjectPart part in group.Children.Values) foreach (SceneObjectPart part in group.Children.Values)
if (m_MetaEntityCollection.Auras.ContainsKey(part.UUID)) if (m_MetaEntityCollection.Auras.ContainsKey(part.UUID))
m_MetaEntityCollection.RemoveNewlyCreatedEntityAura(part.UUID); m_MetaEntityCollection.RemoveNewlyCreatedEntityAura(part.UUID);
} }
/// <summary> /// <summary>
/// Retrieves the latest revision of a region in xml form, /// Retrieves the latest revision of a region in xml form,
/// converts it to scene object groups and scene presences, /// converts it to scene object groups and scene presences,
/// swaps the current scene's entity list with the revision's list. /// swaps the current scene's entity list with the revision's list.
/// Note: Since deleted objects while /// Note: Since deleted objects while
/// </summary> /// </summary>
public void RollbackRegion(Scene scene) public void RollbackRegion(Scene scene)
{ {
@ -214,26 +214,26 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
try{ try{
temp = new SceneObjectGroup(xml); temp = new SceneObjectGroup(xml);
temp.SetScene(scene); temp.SetScene(scene);
foreach(SceneObjectPart part in temp.Children.Values) foreach (SceneObjectPart part in temp.Children.Values)
part.RegionHandle = scene.RegionInfo.RegionHandle; part.RegionHandle = scene.RegionInfo.RegionHandle;
ReplacementList.Add(temp.UUID, (EntityBase)temp); ReplacementList.Add(temp.UUID, (EntityBase)temp);
} }
catch(Exception e) catch(Exception e)
{ {
m_log.Info("[CMMODEL]: Error while creating replacement list for rollback: " + e); m_log.Info("[CMMODEL]: Error while creating replacement list for rollback: " + e);
} }
} }
//If in scene but not in revision and not a client, remove them //If in scene but not in revision and not a client, remove them
while (true) while (true)
{ {
try try
{ {
foreach(EntityBase entity in scene.GetEntities()) foreach (EntityBase entity in scene.GetEntities())
{ {
if (entity == null) if (entity == null)
continue; continue;
if (entity is ScenePresence) if (entity is ScenePresence)
{ {
ReplacementList.Add(entity.UUID, entity); ReplacementList.Add(entity.UUID, entity);
@ -253,9 +253,9 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
break; break;
} }
foreach(UUID uuid in deleteListUUIDs.Keys) foreach (UUID uuid in deleteListUUIDs.Keys)
{ {
try try
{ {
// I thought that the DeleteGroup() function would handle all of this, but it doesn't. I'm not sure WHAT it handles. // I thought that the DeleteGroup() function would handle all of this, but it doesn't. I'm not sure WHAT it handles.
((SceneObjectGroup)scene.Entities[uuid]).DetachFromBackup((SceneObjectGroup)scene.Entities[uuid]); ((SceneObjectGroup)scene.Entities[uuid]).DetachFromBackup((SceneObjectGroup)scene.Entities[uuid]);
@ -275,13 +275,13 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
scene.Entities = ReplacementList; scene.Entities = ReplacementList;
} }
foreach(EntityBase ent in ReplacementList.Values) foreach (EntityBase ent in ReplacementList.Values)
{ {
try try
{ {
if (!(ent is SceneObjectGroup)) if (!(ent is SceneObjectGroup))
continue; continue;
if ((((SceneObjectGroup)ent).RootPart.GetEffectiveObjectFlags() & (uint) PrimFlags.Phantom) == 0) if ((((SceneObjectGroup)ent).RootPart.GetEffectiveObjectFlags() & (uint) PrimFlags.Phantom) == 0)
((SceneObjectGroup)ent).ApplyPhysics(true); ((SceneObjectGroup)ent).ApplyPhysics(true);
((SceneObjectGroup)ent).AttachToBackup(); ((SceneObjectGroup)ent).AttachToBackup();
@ -319,15 +319,15 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
m_MetaEntityCollection.CreateNewEntity(xml, scene); m_MetaEntityCollection.CreateNewEntity(xml, scene);
y.Stop(); y.Stop();
TimeToConvertXml += y.ElapsedMilliseconds; TimeToConvertXml += y.ElapsedMilliseconds;
m_log.Info("[FileSystemDatabase] Time spent converting xml to metaentities for " + scene.RegionInfo.RegionName + ": " + y.ElapsedMilliseconds); m_log.Info("[FileSystemDatabase] Time spent converting xml to metaentities for " + scene.RegionInfo.RegionName + ": " + y.ElapsedMilliseconds);
m_log.Info("[FileSystemDatabase] Time spent converting xml to metaentities so far: " + TimeToConvertXml); m_log.Info("[FileSystemDatabase] Time spent converting xml to metaentities so far: " + TimeToConvertXml);
m_log.Info("[FSDB]: checking for new scene object parts missing green auras and create the auras"); m_log.Info("[FSDB]: checking for new scene object parts missing green auras and create the auras");
CheckForNewEntitiesMissingAuras(scene); CheckForNewEntitiesMissingAuras(scene);
x.Stop(); x.Stop();
TimeToUpdate += x.ElapsedMilliseconds; TimeToUpdate += x.ElapsedMilliseconds;
m_log.Info("[FileSystemDatabase] Time spent Updating entity list for " + scene.RegionInfo.RegionName + ": " + x.ElapsedMilliseconds); m_log.Info("[FileSystemDatabase] Time spent Updating entity list for " + scene.RegionInfo.RegionName + ": " + x.ElapsedMilliseconds);
m_log.Info("[FileSystemDatabase] Time spent Updating so far: " + TimeToUpdate); m_log.Info("[FileSystemDatabase] Time spent Updating so far: " + TimeToUpdate);
} }
@ -340,7 +340,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
System.Collections.ArrayList auraList = new System.Collections.ArrayList(); System.Collections.ArrayList auraList = new System.Collections.ArrayList();
if (group == null) if (group == null)
return null; return null;
foreach(SceneObjectPart part in group.Children.Values) foreach (SceneObjectPart part in group.Children.Values)
{ {
if (m_MetaEntityCollection.Auras.ContainsKey(part.UUID)) if (m_MetaEntityCollection.Auras.ContainsKey(part.UUID))
{ {

View File

@ -78,46 +78,46 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
// Auras To // Auras To
public void DisplayAuras(CMEntityCollection auraCollection) public void DisplayAuras(CMEntityCollection auraCollection)
{ {
foreach( Object ent in auraCollection.Auras.Values) foreach (Object ent in auraCollection.Auras.Values)
((AuraMetaEntity)ent).SendFullUpdateToAll(); ((AuraMetaEntity)ent).SendFullUpdateToAll();
} }
// Auras To Client // Auras To Client
public void DisplayAuras(CMEntityCollection auraCollection, IClientAPI client) public void DisplayAuras(CMEntityCollection auraCollection, IClientAPI client)
{ {
foreach( Object ent in auraCollection.Auras.Values) foreach (Object ent in auraCollection.Auras.Values)
((AuraMetaEntity)ent).SendFullUpdate(client); ((AuraMetaEntity)ent).SendFullUpdate(client);
} }
// Auras from List To ALL // Auras from List To ALL
public void DisplayAuras(ArrayList list) public void DisplayAuras(ArrayList list)
{ {
foreach( Object ent in list) foreach (Object ent in list)
{ {
m_log.Debug("[CONTENT MANAGEMENT] displaying new aura riiiiiiiiiiiight NOW"); m_log.Debug("[CONTENT MANAGEMENT] displaying new aura riiiiiiiiiiiight NOW");
((AuraMetaEntity)ent).SendFullUpdateToAll(); ((AuraMetaEntity)ent).SendFullUpdateToAll();
} }
} }
// Entities to ALL // Entities to ALL
public void DisplayEntities(CMEntityCollection entityCollection) public void DisplayEntities(CMEntityCollection entityCollection)
{ {
foreach( Object ent in entityCollection.Entities.Values) foreach (Object ent in entityCollection.Entities.Values)
((ContentManagementEntity)ent).SendFullDiffUpdateToAll(); ((ContentManagementEntity)ent).SendFullDiffUpdateToAll();
} }
// Entities to Client // Entities to Client
public void DisplayEntities(CMEntityCollection entityCollection, IClientAPI client) public void DisplayEntities(CMEntityCollection entityCollection, IClientAPI client)
{ {
foreach( Object ent in entityCollection.Entities.Values) foreach (Object ent in entityCollection.Entities.Values)
((ContentManagementEntity)ent).SendFullDiffUpdate(client); ((ContentManagementEntity)ent).SendFullDiffUpdate(client);
} }
// Entities from List to ALL // Entities from List to ALL
public void DisplayEntities(ArrayList list) public void DisplayEntities(ArrayList list)
{ {
foreach( Object ent in list) foreach (Object ent in list)
((ContentManagementEntity)ent).SendFullDiffUpdateToAll(); ((ContentManagementEntity)ent).SendFullDiffUpdateToAll();
} }
// Entity to ALL // Entity to ALL
@ -138,7 +138,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
{ {
ContentManagementEntity group = m_model.GetMetaGroupByPrim(uuid); ContentManagementEntity group = m_model.GetMetaGroupByPrim(uuid);
if (group != null) if (group != null)
group.SendFullDiffUpdateToAll(); group.SendFullDiffUpdateToAll();
} }
/// <summary> /// <summary>
@ -158,14 +158,14 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
public void HideAllAuras() public void HideAllAuras()
{ {
foreach(Object obj in m_model.MetaEntityCollection.Auras.Values) foreach (Object obj in m_model.MetaEntityCollection.Auras.Values)
((MetaEntity)obj).HideFromAll(); ((MetaEntity)obj).HideFromAll();
} }
public void HideAllMetaEntities() public void HideAllMetaEntities()
{ {
foreach(Object obj in m_model.MetaEntityCollection.Entities.Values) foreach (Object obj in m_model.MetaEntityCollection.Entities.Values)
((ContentManagementEntity)obj).HideFromAll(); ((ContentManagementEntity)obj).HideFromAll();
} }
public void Initialise(CMModel model) public void Initialise(CMModel model)
@ -183,12 +183,12 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
{ {
// Deal with revisioned parts that have been deleted. // Deal with revisioned parts that have been deleted.
if (m_model.MetaEntityCollection.Entities.ContainsKey(group.UUID)) if (m_model.MetaEntityCollection.Entities.ContainsKey(group.UUID))
((ContentManagementEntity)m_model.MetaEntityCollection.Entities[group.UUID]).SendFullDiffUpdateToAll(); ((ContentManagementEntity)m_model.MetaEntityCollection.Entities[group.UUID]).SendFullDiffUpdateToAll();
// Deal with new parts not revisioned that have been deleted. // Deal with new parts not revisioned that have been deleted.
foreach(SceneObjectPart part in group.Children.Values) foreach (SceneObjectPart part in group.Children.Values)
if (m_model.MetaEntityCollection.Auras.ContainsKey(part.UUID)) if (m_model.MetaEntityCollection.Auras.ContainsKey(part.UUID))
((AuraMetaEntity)m_model.MetaEntityCollection.Auras[part.UUID]).HideFromAll(); ((AuraMetaEntity)m_model.MetaEntityCollection.Auras[part.UUID]).HideFromAll();
} }
public void SendMetaEntitiesToNewClient(IClientAPI client) public void SendMetaEntitiesToNewClient(IClientAPI client)

View File

@ -104,13 +104,13 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
#region Private Methods #region Private Methods
/// <summary> /// <summary>
/// Check if an entitybase list (like that returned by scene.GetEntities() ) contains a group with the rootpart uuid that matches the current uuid. /// Check if an entitybase list (like that returned by scene.GetEntities()) contains a group with the rootpart uuid that matches the current uuid.
/// </summary> /// </summary>
private bool ContainsKey(List<EntityBase> list, UUID uuid) private bool ContainsKey(List<EntityBase> list, UUID uuid)
{ {
foreach( EntityBase part in list) foreach (EntityBase part in list)
if (part.UUID == uuid) if (part.UUID == uuid)
return true; return true;
return false; return false;
} }
@ -118,9 +118,9 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
{ {
foreach (EntityBase ent in list) foreach (EntityBase ent in list)
{ {
if (ent is SceneObjectGroup) if (ent is SceneObjectGroup)
if (ent.UUID == uuid) if (ent.UUID == uuid)
return (SceneObjectGroup)ent; return (SceneObjectGroup)ent;
} }
return null; return null;
} }
@ -138,49 +138,49 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
System.Collections.Generic.List<EntityBase> sceneEntityList = m_Entity.Scene.GetEntities(); System.Collections.Generic.List<EntityBase> sceneEntityList = m_Entity.Scene.GetEntities();
DiffersFromSceneGroup = false; DiffersFromSceneGroup = false;
// if group is not contained in scene's list // if group is not contained in scene's list
if(!ContainsKey(sceneEntityList, m_UnchangedEntity.UUID)) if (!ContainsKey(sceneEntityList, m_UnchangedEntity.UUID))
{ {
foreach(SceneObjectPart part in m_UnchangedEntity.Children.Values) foreach (SceneObjectPart part in m_UnchangedEntity.Children.Values)
{ {
// if scene list no longer contains this part, display translucent part and mark with red aura // if scene list no longer contains this part, display translucent part and mark with red aura
if(! ContainsKey(sceneEntityList, part.UUID)) if (!ContainsKey(sceneEntityList, part.UUID))
{ {
// if already displaying a red aura over part, make sure its red // if already displaying a red aura over part, make sure its red
if (m_AuraEntities.ContainsKey(part.UUID)) if (m_AuraEntities.ContainsKey(part.UUID))
{ {
m_AuraEntities[part.UUID].SetAura(new Vector3(254,0,0), part.Scale); m_AuraEntities[part.UUID].SetAura(new Vector3(254,0,0), part.Scale);
} }
else else
{ {
AuraMetaEntity auraGroup = new AuraMetaEntity(m_Entity.Scene, AuraMetaEntity auraGroup = new AuraMetaEntity(m_Entity.Scene,
m_Entity.Scene.PrimIDAllocate(), m_Entity.Scene.PrimIDAllocate(),
part.GetWorldPosition(), part.GetWorldPosition(),
MetaEntity.TRANSLUCENT, MetaEntity.TRANSLUCENT,
new Vector3(254,0,0), new Vector3(254,0,0),
part.Scale part.Scale
); );
m_AuraEntities.Add(part.UUID, auraGroup); m_AuraEntities.Add(part.UUID, auraGroup);
} }
SceneObjectPart metaPart = m_Entity.GetLinkNumPart(part.LinkNum); SceneObjectPart metaPart = m_Entity.GetLinkNumPart(part.LinkNum);
SetPartTransparency(metaPart, MetaEntity.TRANSLUCENT); SetPartTransparency(metaPart, MetaEntity.TRANSLUCENT);
} }
// otherwise, scene will not contain the part. note: a group can not remove a part without changing group id // otherwise, scene will not contain the part. note: a group can not remove a part without changing group id
} }
// a deleted part has no where to point a beam particle system, // a deleted part has no where to point a beam particle system,
// if a metapart had a particle system (maybe it represented a moved part) remove it // if a metapart had a particle system (maybe it represented a moved part) remove it
if (m_BeamEntities.ContainsKey(m_UnchangedEntity.RootPart.UUID)) if (m_BeamEntities.ContainsKey(m_UnchangedEntity.RootPart.UUID))
{ {
m_BeamEntities[m_UnchangedEntity.RootPart.UUID].HideFromAll(); m_BeamEntities[m_UnchangedEntity.RootPart.UUID].HideFromAll();
m_BeamEntities.Remove(m_UnchangedEntity.RootPart.UUID); m_BeamEntities.Remove(m_UnchangedEntity.RootPart.UUID);
} }
DiffersFromSceneGroup = true; DiffersFromSceneGroup = true;
} }
// if scene list does contain group, compare each part in group for differences and display beams and auras appropriately // if scene list does contain group, compare each part in group for differences and display beams and auras appropriately
else else
{ {
MarkWithDifferences((SceneObjectGroup)GetGroupByUUID(sceneEntityList, m_UnchangedEntity.UUID)); MarkWithDifferences((SceneObjectGroup)GetGroupByUUID(sceneEntityList, m_UnchangedEntity.UUID));
} }
} }
@ -190,7 +190,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
public bool HasChildPrim(UUID uuid) public bool HasChildPrim(UUID uuid)
{ {
if (m_UnchangedEntity.Children.ContainsKey(uuid)) if (m_UnchangedEntity.Children.ContainsKey(uuid))
return true; return true;
return false; return false;
} }
@ -199,28 +199,28 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
/// </summary> /// </summary>
public bool HasChildPrim(uint localID) public bool HasChildPrim(uint localID)
{ {
foreach( SceneObjectPart part in m_UnchangedEntity.Children.Values) foreach (SceneObjectPart part in m_UnchangedEntity.Children.Values)
if ( part.LocalId == localID ) if (part.LocalId == localID)
return true; return true;
return false; return false;
} }
public override void Hide(IClientAPI client) public override void Hide(IClientAPI client)
{ {
base.Hide(client); base.Hide(client);
foreach(MetaEntity group in m_AuraEntities.Values) foreach (MetaEntity group in m_AuraEntities.Values)
group.Hide(client); group.Hide(client);
foreach(MetaEntity group in m_BeamEntities.Values) foreach (MetaEntity group in m_BeamEntities.Values)
group.Hide(client); group.Hide(client);
} }
public override void HideFromAll() public override void HideFromAll()
{ {
base.HideFromAll(); base.HideFromAll();
foreach(MetaEntity group in m_AuraEntities.Values) foreach (MetaEntity group in m_AuraEntities.Values)
group.HideFromAll(); group.HideFromAll();
foreach(MetaEntity group in m_BeamEntities.Values) foreach (MetaEntity group in m_BeamEntities.Values)
group.HideFromAll(); group.HideFromAll();
} }
/// <summary> /// <summary>
@ -234,92 +234,92 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
Diff differences; Diff differences;
bool changed = false; bool changed = false;
// Use "UnchangedEntity" to do comparisons because its text, transparency, and other attributes will be just as the user // Use "UnchangedEntity" to do comparisons because its text, transparency, and other attributes will be just as the user
// had originally saved. // had originally saved.
// m_Entity will NOT necessarily be the same entity as the user had saved. // m_Entity will NOT necessarily be the same entity as the user had saved.
foreach(SceneObjectPart UnchangedPart in m_UnchangedEntity.Children.Values) foreach (SceneObjectPart UnchangedPart in m_UnchangedEntity.Children.Values)
{ {
//This is the part that we use to show changes. //This is the part that we use to show changes.
metaEntityPart = m_Entity.GetLinkNumPart(UnchangedPart.LinkNum); metaEntityPart = m_Entity.GetLinkNumPart(UnchangedPart.LinkNum);
if (sceneEntityGroup.Children.ContainsKey(UnchangedPart.UUID)) if (sceneEntityGroup.Children.ContainsKey(UnchangedPart.UUID))
{ {
sceneEntityPart = sceneEntityGroup.Children[UnchangedPart.UUID]; sceneEntityPart = sceneEntityGroup.Children[UnchangedPart.UUID];
differences = Difference.FindDifferences(UnchangedPart, sceneEntityPart); differences = Difference.FindDifferences(UnchangedPart, sceneEntityPart);
if (differences != Diff.NONE) if (differences != Diff.NONE)
metaEntityPart.Text = "CHANGE: " + differences.ToString(); metaEntityPart.Text = "CHANGE: " + differences.ToString();
if (differences != 0) if (differences != 0)
{ {
// Root Part that has been modified // Root Part that has been modified
if ((differences&Diff.POSITION) > 0) if ((differences&Diff.POSITION) > 0)
{ {
// If the position of any part has changed, make sure the RootPart of the // If the position of any part has changed, make sure the RootPart of the
// meta entity is pointing with a beam particle system // meta entity is pointing with a beam particle system
if (m_BeamEntities.ContainsKey(m_UnchangedEntity.RootPart.UUID)) if (m_BeamEntities.ContainsKey(m_UnchangedEntity.RootPart.UUID))
{ {
m_BeamEntities[m_UnchangedEntity.RootPart.UUID].HideFromAll(); m_BeamEntities[m_UnchangedEntity.RootPart.UUID].HideFromAll();
m_BeamEntities.Remove(m_UnchangedEntity.RootPart.UUID); m_BeamEntities.Remove(m_UnchangedEntity.RootPart.UUID);
} }
BeamMetaEntity beamGroup = new BeamMetaEntity(m_Entity.Scene, BeamMetaEntity beamGroup = new BeamMetaEntity(m_Entity.Scene,
m_Entity.Scene.PrimIDAllocate(), m_Entity.Scene.PrimIDAllocate(),
m_UnchangedEntity.RootPart.GetWorldPosition(), m_UnchangedEntity.RootPart.GetWorldPosition(),
MetaEntity.TRANSLUCENT, MetaEntity.TRANSLUCENT,
sceneEntityPart, sceneEntityPart,
new Vector3(0,0,254) new Vector3(0,0,254)
); );
m_BeamEntities.Add(m_UnchangedEntity.RootPart.UUID, beamGroup); m_BeamEntities.Add(m_UnchangedEntity.RootPart.UUID, beamGroup);
} }
if (m_AuraEntities.ContainsKey(UnchangedPart.UUID)) if (m_AuraEntities.ContainsKey(UnchangedPart.UUID))
{ {
m_AuraEntities[UnchangedPart.UUID].HideFromAll(); m_AuraEntities[UnchangedPart.UUID].HideFromAll();
m_AuraEntities.Remove(UnchangedPart.UUID); m_AuraEntities.Remove(UnchangedPart.UUID);
} }
AuraMetaEntity auraGroup = new AuraMetaEntity(m_Entity.Scene, AuraMetaEntity auraGroup = new AuraMetaEntity(m_Entity.Scene,
m_Entity.Scene.PrimIDAllocate(), m_Entity.Scene.PrimIDAllocate(),
UnchangedPart.GetWorldPosition(), UnchangedPart.GetWorldPosition(),
MetaEntity.TRANSLUCENT, MetaEntity.TRANSLUCENT,
new Vector3(0,0,254), new Vector3(0,0,254),
UnchangedPart.Scale UnchangedPart.Scale
); );
m_AuraEntities.Add(UnchangedPart.UUID, auraGroup); m_AuraEntities.Add(UnchangedPart.UUID, auraGroup);
SetPartTransparency(metaEntityPart, MetaEntity.TRANSLUCENT); SetPartTransparency(metaEntityPart, MetaEntity.TRANSLUCENT);
DiffersFromSceneGroup = true; DiffersFromSceneGroup = true;
} }
else // no differences between scene part and meta part else // no differences between scene part and meta part
{ {
if (m_BeamEntities.ContainsKey(m_UnchangedEntity.RootPart.UUID)) if (m_BeamEntities.ContainsKey(m_UnchangedEntity.RootPart.UUID))
{ {
m_BeamEntities[m_UnchangedEntity.RootPart.UUID].HideFromAll(); m_BeamEntities[m_UnchangedEntity.RootPart.UUID].HideFromAll();
m_BeamEntities.Remove(m_UnchangedEntity.RootPart.UUID); m_BeamEntities.Remove(m_UnchangedEntity.RootPart.UUID);
} }
if (m_AuraEntities.ContainsKey(UnchangedPart.UUID)) if (m_AuraEntities.ContainsKey(UnchangedPart.UUID))
{ {
m_AuraEntities[UnchangedPart.UUID].HideFromAll(); m_AuraEntities[UnchangedPart.UUID].HideFromAll();
m_AuraEntities.Remove(UnchangedPart.UUID); m_AuraEntities.Remove(UnchangedPart.UUID);
} }
SetPartTransparency(metaEntityPart, MetaEntity.NONE); SetPartTransparency(metaEntityPart, MetaEntity.NONE);
} }
} }
else //The entity currently in the scene is missing parts from the metaentity saved, so mark parts red as deleted. else //The entity currently in the scene is missing parts from the metaentity saved, so mark parts red as deleted.
{ {
if (m_AuraEntities.ContainsKey(UnchangedPart.UUID)) if (m_AuraEntities.ContainsKey(UnchangedPart.UUID))
{ {
m_AuraEntities[UnchangedPart.UUID].HideFromAll(); m_AuraEntities[UnchangedPart.UUID].HideFromAll();
m_AuraEntities.Remove(UnchangedPart.UUID); m_AuraEntities.Remove(UnchangedPart.UUID);
} }
AuraMetaEntity auraGroup = new AuraMetaEntity(m_Entity.Scene, AuraMetaEntity auraGroup = new AuraMetaEntity(m_Entity.Scene,
m_Entity.Scene.PrimIDAllocate(), m_Entity.Scene.PrimIDAllocate(),
UnchangedPart.GetWorldPosition(), UnchangedPart.GetWorldPosition(),
MetaEntity.TRANSLUCENT, MetaEntity.TRANSLUCENT,
new Vector3(254,0,0), new Vector3(254,0,0),
UnchangedPart.Scale UnchangedPart.Scale
); );
m_AuraEntities.Add(UnchangedPart.UUID, auraGroup); m_AuraEntities.Add(UnchangedPart.UUID, auraGroup);
SetPartTransparency(metaEntityPart, MetaEntity.TRANSLUCENT); SetPartTransparency(metaEntityPart, MetaEntity.TRANSLUCENT);
DiffersFromSceneGroup = true; DiffersFromSceneGroup = true;
} }
} }
return changed; return changed;
} }
@ -328,8 +328,8 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
{ {
if (DiffersFromSceneGroup) if (DiffersFromSceneGroup)
{ {
foreach(AuraMetaEntity group in m_AuraEntities.Values) foreach (AuraMetaEntity group in m_AuraEntities.Values)
group.SendFullUpdate(client); group.SendFullUpdate(client);
} }
} }
@ -337,8 +337,8 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
{ {
if (DiffersFromSceneGroup) if (DiffersFromSceneGroup)
{ {
foreach(AuraMetaEntity group in m_AuraEntities.Values) foreach (AuraMetaEntity group in m_AuraEntities.Values)
group.SendFullUpdateToAll(); group.SendFullUpdateToAll();
} }
} }
@ -346,8 +346,8 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
{ {
if (DiffersFromSceneGroup) if (DiffersFromSceneGroup)
{ {
foreach(BeamMetaEntity group in m_BeamEntities.Values) foreach (BeamMetaEntity group in m_BeamEntities.Values)
group.SendFullUpdate(client); group.SendFullUpdate(client);
} }
} }
@ -355,8 +355,8 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
{ {
if (DiffersFromSceneGroup) if (DiffersFromSceneGroup)
{ {
foreach(BeamMetaEntity group in m_BeamEntities.Values) foreach (BeamMetaEntity group in m_BeamEntities.Values)
group.SendFullUpdateToAll(); group.SendFullUpdateToAll();
} }
} }
@ -365,9 +365,9 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
FindDifferences(); FindDifferences();
if (DiffersFromSceneGroup) if (DiffersFromSceneGroup)
{ {
SendFullUpdate(client); SendFullUpdate(client);
SendFullAuraUpdate(client); SendFullAuraUpdate(client);
SendFullBeamUpdate(client); SendFullBeamUpdate(client);
} }
} }
@ -376,9 +376,9 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
FindDifferences(); FindDifferences();
if (DiffersFromSceneGroup) if (DiffersFromSceneGroup)
{ {
SendFullUpdateToAll(); SendFullUpdateToAll();
SendFullAuraUpdateToAll(); SendFullAuraUpdateToAll();
SendFullBeamUpdateToAll(); SendFullBeamUpdateToAll();
} }
} }

View File

@ -27,7 +27,7 @@
#region Header #region Header
// ContentManagementModule.cs // ContentManagementModule.cs
// User: bongiojp // User: bongiojp
#endregion Header #endregion Header
@ -98,7 +98,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
{ {
if (source.Configs["CMS"] == null) if (source.Configs["CMS"] == null)
return; return;
m_enabled = source.Configs["CMS"].GetBoolean("enabled", false); m_enabled = source.Configs["CMS"].GetBoolean("enabled", false);
databaseDir = source.Configs["CMS"].GetString("directory", databaseDir); databaseDir = source.Configs["CMS"].GetString("directory", databaseDir);
database = source.Configs["CMS"].GetString("database", database); database = source.Configs["CMS"].GetString("database", database);
@ -122,7 +122,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
return; return;
} }
lock(this) lock (this)
{ {
if (!initialised) //only init once if (!initialised) //only init once
{ {
@ -131,7 +131,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
m_control = new CMController(m_model, m_view, scene, channel); m_control = new CMController(m_model, m_view, scene, channel);
m_model.Initialise(database); m_model.Initialise(database);
m_view.Initialise(m_model); m_view.Initialise(m_model);
initialised = true; initialised = true;
m_model.InitialiseDatabase(scene, databaseDir); m_model.InitialiseDatabase(scene, databaseDir);
} }
@ -148,7 +148,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
if (! m_enabled) if (! m_enabled)
return; return;
lock(this) lock (this)
{ {
if (!m_posted) //only post once if (!m_posted) //only post once
{ {

View File

@ -28,7 +28,7 @@
#region Header #region Header
// FileSystemDatabase.cs // FileSystemDatabase.cs
// User: bongiojp // User: bongiojp
#endregion Header #endregion Header
@ -88,13 +88,13 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
{ {
string scenedir; string scenedir;
if (!Directory.Exists(m_repodir)) if (!Directory.Exists(m_repodir))
Directory.CreateDirectory(m_repodir); Directory.CreateDirectory(m_repodir);
foreach (UUID region in m_scenes.Keys) foreach (UUID region in m_scenes.Keys)
{ {
scenedir = m_repodir + Slash.DirectorySeparatorChar + region + Slash.DirectorySeparatorChar; scenedir = m_repodir + Slash.DirectorySeparatorChar + region + Slash.DirectorySeparatorChar;
if (!Directory.Exists(scenedir)) if (!Directory.Exists(scenedir))
Directory.CreateDirectory(scenedir); Directory.CreateDirectory(scenedir);
} }
} }
@ -102,10 +102,14 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
private void SetupSerialiser() private void SetupSerialiser()
{ {
if (m_serialiser.Count == 0) if (m_serialiser.Count == 0)
foreach(UUID region in m_scenes.Keys) {
m_serialiser.Add(region, foreach (UUID region in m_scenes.Keys)
m_scenes[region].RequestModuleInterface<IRegionSerialiser>() {
); m_serialiser.Add(region,
m_scenes[region].RequestModuleInterface<IRegionSerialiser>()
);
}
}
} }
#endregion Private Methods #endregion Private Methods
@ -120,7 +124,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
public string GetRegionObjectHeightMap(UUID regionid) public string GetRegionObjectHeightMap(UUID regionid)
{ {
String filename = m_repodir + Slash.DirectorySeparatorChar + regionid + String filename = m_repodir + Slash.DirectorySeparatorChar + regionid +
Slash.DirectorySeparatorChar + "heightmap.r32"; Slash.DirectorySeparatorChar + "heightmap.r32";
FileStream fs = new FileStream( filename, FileMode.Open); FileStream fs = new FileStream( filename, FileMode.Open);
StreamReader sr = new StreamReader(fs); StreamReader sr = new StreamReader(fs);
String result = sr.ReadToEnd(); String result = sr.ReadToEnd();
@ -132,7 +136,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
public string GetRegionObjectHeightMap(UUID regionid, int revision) public string GetRegionObjectHeightMap(UUID regionid, int revision)
{ {
String filename = m_repodir + Slash.DirectorySeparatorChar + regionid + String filename = m_repodir + Slash.DirectorySeparatorChar + regionid +
Slash.DirectorySeparatorChar + "heightmap.r32"; Slash.DirectorySeparatorChar + "heightmap.r32";
FileStream fs = new FileStream( filename, FileMode.Open); FileStream fs = new FileStream( filename, FileMode.Open);
StreamReader sr = new StreamReader(fs); StreamReader sr = new StreamReader(fs);
String result = sr.ReadToEnd(); String result = sr.ReadToEnd();
@ -144,14 +148,14 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
public System.Collections.ArrayList GetRegionObjectXMLList(UUID regionid, int revision) public System.Collections.ArrayList GetRegionObjectXMLList(UUID regionid, int revision)
{ {
System.Collections.ArrayList objectList = new System.Collections.ArrayList(); System.Collections.ArrayList objectList = new System.Collections.ArrayList();
string filename = m_repodir + Slash.DirectorySeparatorChar + regionid + Slash.DirectorySeparatorChar + string filename = m_repodir + Slash.DirectorySeparatorChar + regionid + Slash.DirectorySeparatorChar +
+ revision + Slash.DirectorySeparatorChar + "objects.xml"; + revision + Slash.DirectorySeparatorChar + "objects.xml";
XmlDocument doc = new XmlDocument(); XmlDocument doc = new XmlDocument();
XmlNode rootNode; XmlNode rootNode;
//int primCount = 0; //int primCount = 0;
//SceneObjectGroup obj = null; //SceneObjectGroup obj = null;
if(File.Exists(filename)) if (File.Exists(filename))
{ {
XmlTextReader reader = new XmlTextReader(filename); XmlTextReader reader = new XmlTextReader(filename);
reader.WhitespaceHandling = WhitespaceHandling.None; reader.WhitespaceHandling = WhitespaceHandling.None;
@ -160,9 +164,9 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
rootNode = doc.FirstChild; rootNode = doc.FirstChild;
foreach (XmlNode aPrimNode in rootNode.ChildNodes) foreach (XmlNode aPrimNode in rootNode.ChildNodes)
{ {
objectList.Add(aPrimNode.OuterXml); objectList.Add(aPrimNode.OuterXml);
} }
return objectList; return objectList;
} }
return null; return null;
} }
@ -172,45 +176,46 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
int revision = NumOfRegionRev(regionid); int revision = NumOfRegionRev(regionid);
m_log.Info("[FSDB]: found revisions:" + revision); m_log.Info("[FSDB]: found revisions:" + revision);
System.Collections.ArrayList xmlList = new System.Collections.ArrayList(); System.Collections.ArrayList xmlList = new System.Collections.ArrayList();
string filename = m_repodir + Slash.DirectorySeparatorChar + regionid + Slash.DirectorySeparatorChar + string filename = m_repodir + Slash.DirectorySeparatorChar + regionid + Slash.DirectorySeparatorChar +
+ revision + Slash.DirectorySeparatorChar + "objects.xml"; + revision + Slash.DirectorySeparatorChar + "objects.xml";
XmlDocument doc = new XmlDocument(); XmlDocument doc = new XmlDocument();
XmlNode rootNode; XmlNode rootNode;
m_log.Info("[FSDB]: Checking if " + filename + " exists."); m_log.Info("[FSDB]: Checking if " + filename + " exists.");
if(File.Exists(filename)) if (File.Exists(filename))
{ {
Stopwatch x = new Stopwatch(); Stopwatch x = new Stopwatch();
x.Start(); x.Start();
XmlTextReader reader = new XmlTextReader(filename); XmlTextReader reader = new XmlTextReader(filename);
reader.WhitespaceHandling = WhitespaceHandling.None; reader.WhitespaceHandling = WhitespaceHandling.None;
doc.Load(reader); doc.Load(reader);
reader.Close(); reader.Close();
rootNode = doc.FirstChild; rootNode = doc.FirstChild;
foreach (XmlNode aPrimNode in rootNode.ChildNodes) foreach (XmlNode aPrimNode in rootNode.ChildNodes)
xmlList.Add(aPrimNode.OuterXml); {
xmlList.Add(aPrimNode.OuterXml);
x.Stop(); }
TimeToDownload += x.ElapsedMilliseconds;
m_log.Info("[FileSystemDatabase] Time spent retrieving xml files so far: " + TimeToDownload); x.Stop();
TimeToDownload += x.ElapsedMilliseconds;
return xmlList; m_log.Info("[FileSystemDatabase] Time spent retrieving xml files so far: " + TimeToDownload);
return xmlList;
} }
return null; return null;
} }
public void Initialise(Scene scene, string dir) public void Initialise(Scene scene, string dir)
{ {
lock(this) lock (this)
{ {
if (m_repodir == null) if (m_repodir == null)
m_repodir = dir; m_repodir = dir;
} }
lock(m_scenes) lock (m_scenes)
m_scenes.Add(scene.RegionInfo.RegionID, scene); m_scenes.Add(scene.RegionInfo.RegionID, scene);
} }
public System.Collections.Generic.SortedDictionary<string, string> ListOfRegionRevisions(UUID regionid) public System.Collections.Generic.SortedDictionary<string, string> ListOfRegionRevisions(UUID regionid)
@ -224,19 +229,21 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
StreamReader sr = null; StreamReader sr = null;
String logMessage = ""; String logMessage = "";
String logLocation = ""; String logLocation = "";
foreach(string revisionDir in directories) foreach (string revisionDir in directories)
{ {
try { try
logLocation = revisionDir + Slash.DirectorySeparatorChar + "log"; {
fs = new FileStream( logLocation, FileMode.Open); logLocation = revisionDir + Slash.DirectorySeparatorChar + "log";
sr = new StreamReader(fs); fs = new FileStream( logLocation, FileMode.Open);
logMessage = sr.ReadToEnd(); sr = new StreamReader(fs);
sr.Close(); logMessage = sr.ReadToEnd();
fs.Close(); sr.Close();
revisionDict.Add(revisionDir, logMessage); fs.Close();
} revisionDict.Add(revisionDir, logMessage);
catch (Exception) }
{} catch (Exception)
{
}
} }
return revisionDict; return revisionDict;
@ -254,9 +261,9 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
public void PostInitialise() public void PostInitialise()
{ {
SetupSerialiser(); SetupSerialiser();
m_log.Info("[FSDB]: Creating repository in " + m_repodir + "."); m_log.Info("[FSDB]: Creating repository in " + m_repodir + ".");
CreateDirectory(); CreateDirectory();
} }
public void SaveRegion(UUID regionid, string regionName, string logMessage) public void SaveRegion(UUID regionid, string regionName, string logMessage)
@ -266,44 +273,44 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
m_log.Info("[FSDB]: checking if scene directory exists: " + scenedir); m_log.Info("[FSDB]: checking if scene directory exists: " + scenedir);
if (!Directory.Exists(scenedir)) if (!Directory.Exists(scenedir))
Directory.CreateDirectory(scenedir); Directory.CreateDirectory(scenedir);
int newRevisionNum = GetMostRecentRevision(regionid)+1; int newRevisionNum = GetMostRecentRevision(regionid)+1;
string revisiondir = scenedir + newRevisionNum + Slash.DirectorySeparatorChar; string revisiondir = scenedir + newRevisionNum + Slash.DirectorySeparatorChar;
m_log.Info("[FSDB]: checking if revision directory exists: " + revisiondir); m_log.Info("[FSDB]: checking if revision directory exists: " + revisiondir);
if (!Directory.Exists(revisiondir)) if (!Directory.Exists(revisiondir))
Directory.CreateDirectory(revisiondir); Directory.CreateDirectory(revisiondir);
try { try {
Stopwatch x = new Stopwatch(); Stopwatch x = new Stopwatch();
x.Start(); x.Start();
if (m_scenes.ContainsKey(regionid)) if (m_scenes.ContainsKey(regionid))
{ {
m_serialiser[regionid].SerialiseRegion(m_scenes[regionid], revisiondir); m_serialiser[regionid].SerialiseRegion(m_scenes[regionid], revisiondir);
} }
x.Stop(); x.Stop();
TimeToSave += x.ElapsedMilliseconds; TimeToSave += x.ElapsedMilliseconds;
m_log.Info("[FileSystemDatabase] Time spent serialising regions to files on disk for " + regionName + ": " + x.ElapsedMilliseconds); m_log.Info("[FileSystemDatabase] Time spent serialising regions to files on disk for " + regionName + ": " + x.ElapsedMilliseconds);
m_log.Info("[FileSystemDatabase] Time spent serialising regions to files on disk so far: " + TimeToSave); m_log.Info("[FileSystemDatabase] Time spent serialising regions to files on disk so far: " + TimeToSave);
} }
catch (Exception e) catch (Exception e)
{ {
m_log.ErrorFormat("[FSDB]: Serialisation of region failed: " + e); m_log.ErrorFormat("[FSDB]: Serialisation of region failed: " + e);
return; return;
} }
try { try {
// Finish by writing log message. // Finish by writing log message.
FileStream file = new FileStream(revisiondir + "log", FileMode.Create, FileAccess.ReadWrite); FileStream file = new FileStream(revisiondir + "log", FileMode.Create, FileAccess.ReadWrite);
StreamWriter sw = new StreamWriter(file); StreamWriter sw = new StreamWriter(file);
sw.Write(logMessage); sw.Write(logMessage);
sw.Close(); sw.Close();
} }
catch (Exception e) catch (Exception e)
{ {
m_log.ErrorFormat("[FSDB]: Failed trying to save log file " + e); m_log.ErrorFormat("[FSDB]: Failed trying to save log file " + e);
return; return;
} }
} }

View File

@ -84,7 +84,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
} }
/// <summary> /// <summary>
/// Makes a new meta entity by copying the given scene object group. /// Makes a new meta entity by copying the given scene object group.
/// The physics boolean is just a stub right now. /// The physics boolean is just a stub right now.
/// </summary> /// </summary>
public MetaEntity(SceneObjectGroup orig, bool physics) public MetaEntity(SceneObjectGroup orig, bool physics)
@ -160,19 +160,19 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
{ {
//make new uuids //make new uuids
Dictionary<UUID, SceneObjectPart> parts = new Dictionary<UUID, SceneObjectPart>(); Dictionary<UUID, SceneObjectPart> parts = new Dictionary<UUID, SceneObjectPart>();
foreach(SceneObjectPart part in m_Entity.Children.Values) foreach (SceneObjectPart part in m_Entity.Children.Values)
{ {
part.ResetIDs(part.LinkNum); part.ResetIDs(part.LinkNum);
parts.Add(part.UUID, part); parts.Add(part.UUID, part);
} }
// make new localids // make new localids
foreach (SceneObjectPart part in m_Entity.Children.Values) foreach (SceneObjectPart part in m_Entity.Children.Values)
part.LocalId = m_Entity.Scene.PrimIDAllocate(); part.LocalId = m_Entity.Scene.PrimIDAllocate();
//finalize //finalize
m_Entity.UpdateParentIDs(); m_Entity.UpdateParentIDs();
m_Entity.RootPart.PhysActor = null; m_Entity.RootPart.PhysActor = null;
m_Entity.Children = parts; m_Entity.Children = parts;
} }
@ -188,8 +188,8 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
//This deletes the group without removing from any databases. //This deletes the group without removing from any databases.
//This is important because we are not IN any database. //This is important because we are not IN any database.
//m_Entity.FakeDeleteGroup(); //m_Entity.FakeDeleteGroup();
foreach( SceneObjectPart part in m_Entity.Children.Values) foreach (SceneObjectPart part in m_Entity.Children.Values)
client.SendKiPrimitive(m_Entity.RegionHandle, part.LocalId); client.SendKiPrimitive(m_Entity.RegionHandle, part.LocalId);
} }
/// <summary> /// <summary>
@ -197,10 +197,10 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
/// </summary> /// </summary>
public virtual void HideFromAll() public virtual void HideFromAll()
{ {
foreach( SceneObjectPart part in m_Entity.Children.Values) foreach (SceneObjectPart part in m_Entity.Children.Values)
m_Entity.Scene.ClientManager.ForEachClient(delegate(IClientAPI controller) m_Entity.Scene.ClientManager.ForEachClient(delegate(IClientAPI controller)
{ controller.SendKiPrimitive(m_Entity.RegionHandle, part.LocalId); } { controller.SendKiPrimitive(m_Entity.RegionHandle, part.LocalId); }
); );
} }
public void SendFullUpdate(IClientAPI client) public void SendFullUpdate(IClientAPI client)
@ -239,40 +239,40 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
Color4 texcolor; Color4 texcolor;
try try
{ {
tex = part.Shape.Textures; tex = part.Shape.Textures;
texcolor = new Color4(); texcolor = new Color4();
} }
catch(Exception) catch(Exception)
{ {
//m_log.ErrorFormat("[Content Management]: Exception thrown while accessing textures of scene object: " + e); //m_log.ErrorFormat("[Content Management]: Exception thrown while accessing textures of scene object: " + e);
return; return;
} }
for (uint i = 0; i < tex.FaceTextures.Length; i++) for (uint i = 0; i < tex.FaceTextures.Length; i++)
{ {
try { try {
if (tex.FaceTextures[i] != null) if (tex.FaceTextures[i] != null)
{ {
texcolor = tex.FaceTextures[i].RGBA; texcolor = tex.FaceTextures[i].RGBA;
texcolor.A = transparencyAmount; texcolor.A = transparencyAmount;
tex.FaceTextures[i].RGBA = texcolor; tex.FaceTextures[i].RGBA = texcolor;
} }
} }
catch (Exception) catch (Exception)
{ {
//m_log.ErrorFormat("[Content Management]: Exception thrown while accessing different face textures of object: " + e); //m_log.ErrorFormat("[Content Management]: Exception thrown while accessing different face textures of object: " + e);
continue; continue;
} }
} }
try { try {
texcolor = tex.DefaultTexture.RGBA; texcolor = tex.DefaultTexture.RGBA;
texcolor.A = transparencyAmount; texcolor.A = transparencyAmount;
tex.DefaultTexture.RGBA = texcolor; tex.DefaultTexture.RGBA = texcolor;
part.Shape.TextureEntry = tex.ToBytes(); part.Shape.TextureEntry = tex.ToBytes();
} }
catch (Exception) catch (Exception)
{ {
//m_log.Info("[Content Management]: Exception thrown while accessing default face texture of object: " + e); //m_log.Info("[Content Management]: Exception thrown while accessing default face texture of object: " + e);
} }
} }

View File

@ -89,7 +89,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
y.UUID = uuid; y.UUID = uuid;
y.LocalId = LocalId; y.LocalId = LocalId;
y.Shape = PrimitiveBaseShape.CreateBox(); y.Shape = PrimitiveBaseShape.CreateBox();
y.Scale = new Vector3(0.01f,0.01f,0.01f); y.Scale = new Vector3(0.01f,0.01f,0.01f);
y.LastOwnerID = UUID.Zero; y.LastOwnerID = UUID.Zero;

View File

@ -106,13 +106,13 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
private static bool AreVectorsEquivalent(Vector3 first, Vector3 second) private static bool AreVectorsEquivalent(Vector3 first, Vector3 second)
{ {
if(TruncateSignificant(first.X, 2) == TruncateSignificant(second.X, 2) if (TruncateSignificant(first.X, 2) == TruncateSignificant(second.X, 2)
&& TruncateSignificant(first.Y, 2) == TruncateSignificant(second.Y, 2) && TruncateSignificant(first.Y, 2) == TruncateSignificant(second.Y, 2)
&& TruncateSignificant(first.Z, 2) == TruncateSignificant(second.Z, 2) && TruncateSignificant(first.Z, 2) == TruncateSignificant(second.Z, 2)
) )
return true; return true;
else else
return false; return false;
} }
// Taken from Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs // Taken from Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs
@ -126,7 +126,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
private static int TruncateSignificant(float num, int digits) private static int TruncateSignificant(float num, int digits)
{ {
return (int) Math.Ceiling((Math.Truncate(num * 10 * digits)/10*digits)); return (int) Math.Ceiling((Math.Truncate(num * 10 * digits)/10*digits));
// return (int) ((num * (10*digits))/10*digits); // return (int) ((num * (10*digits))/10*digits);
} }
// Taken from Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs // Taken from Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs
@ -153,7 +153,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
#region Public Methods #region Public Methods
/// <summary> /// <summary>
/// Compares the attributes (Vectors, Quaternions, Strings, etc.) between two scene object parts /// Compares the attributes (Vectors, Quaternions, Strings, etc.) between two scene object parts
/// and returns a Diff bitmask which details what the differences are. /// and returns a Diff bitmask which details what the differences are.
/// </summary> /// </summary>
public static Diff FindDifferences(SceneObjectPart first, SceneObjectPart second) public static Diff FindDifferences(SceneObjectPart first, SceneObjectPart second)
@ -164,47 +164,47 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
Diff result = 0; Diff result = 0;
// VECTOR COMPARISONS // VECTOR COMPARISONS
if(! AreVectorsEquivalent(first.Acceleration, second.Acceleration)) if (!AreVectorsEquivalent(first.Acceleration, second.Acceleration))
result |= Diff.ACCELERATION; result |= Diff.ACCELERATION;
if(! AreVectorsEquivalent(first.AbsolutePosition, second.AbsolutePosition)) if (!AreVectorsEquivalent(first.AbsolutePosition, second.AbsolutePosition))
result |= Diff.POSITION; result |= Diff.POSITION;
if(! AreVectorsEquivalent(first.AngularVelocity, second.AngularVelocity)) if (!AreVectorsEquivalent(first.AngularVelocity, second.AngularVelocity))
result |= Diff.ANGULARVELOCITY; result |= Diff.ANGULARVELOCITY;
if(! AreVectorsEquivalent(first.OffsetPosition, second.OffsetPosition)) if (!AreVectorsEquivalent(first.OffsetPosition, second.OffsetPosition))
result |= Diff.OFFSETPOSITION; result |= Diff.OFFSETPOSITION;
if(! AreVectorsEquivalent(first.RotationalVelocity, second.RotationalVelocity)) if (!AreVectorsEquivalent(first.RotationalVelocity, second.RotationalVelocity))
result |= Diff.ROTATIONALVELOCITY; result |= Diff.ROTATIONALVELOCITY;
if(! AreVectorsEquivalent(first.Scale, second.Scale)) if (!AreVectorsEquivalent(first.Scale, second.Scale))
result |= Diff.SCALE; result |= Diff.SCALE;
if(! AreVectorsEquivalent(first.Velocity, second.Velocity)) if (!AreVectorsEquivalent(first.Velocity, second.Velocity))
result |= Diff.VELOCITY; result |= Diff.VELOCITY;
// QUATERNION COMPARISONS // QUATERNION COMPARISONS
if(! AreQuaternionsEquivalent(first.RotationOffset, second.RotationOffset)) if (!AreQuaternionsEquivalent(first.RotationOffset, second.RotationOffset))
result |= Diff.ROTATIONOFFSET; result |= Diff.ROTATIONOFFSET;
// MISC COMPARISONS (UUID, Byte) // MISC COMPARISONS (UUID, Byte)
if(first.ClickAction != second.ClickAction) if (first.ClickAction != second.ClickAction)
result |= Diff.CLICKACTION; result |= Diff.CLICKACTION;
if(first.ObjectOwner != second.ObjectOwner) if (first.ObjectOwner != second.ObjectOwner)
result |= Diff.OBJECTOWNER; result |= Diff.OBJECTOWNER;
// STRING COMPARISONS // STRING COMPARISONS
if(first.Description != second.Description) if (first.Description != second.Description)
result |= Diff.DESCRIPTION; result |= Diff.DESCRIPTION;
if(first.Material != second.Material) if (first.Material != second.Material)
result |= Diff.MATERIAL; result |= Diff.MATERIAL;
if(first.Name != second.Name) if (first.Name != second.Name)
result |= Diff.NAME; result |= Diff.NAME;
if(first.SitName != second.SitName) if (first.SitName != second.SitName)
result |= Diff.SITNAME; result |= Diff.SITNAME;
if(first.Text != second.Text) if (first.Text != second.Text)
result |= Diff.TEXT; result |= Diff.TEXT;
if(first.TouchName != second.TouchName) if (first.TouchName != second.TouchName)
result |= Diff.TOUCHNAME; result |= Diff.TOUCHNAME;
x.Stop(); x.Stop();
TimeToDiff += x.ElapsedMilliseconds; TimeToDiff += x.ElapsedMilliseconds;

View File

@ -176,8 +176,8 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
/// within this object). /// within this object).
/// </summary> /// </summary>
/// <param name="sceneObject"></param> /// <param name="sceneObject"></param>
/// <param name="assetUuids"></param> /// <param name="assetUuids"></param>
protected void GetSceneObjectAssetUuids(UUID sceneObjectUuid, IDictionary<UUID, int> assetUuids) protected void GetSceneObjectAssetUuids(UUID sceneObjectUuid, IDictionary<UUID, int> assetUuids)
{ {
AssetBase objectAsset = GetAsset(sceneObjectUuid); AssetBase objectAsset = GetAsset(sceneObjectUuid);

View File

@ -121,7 +121,7 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
public void setEstateTerrainBaseTexture(IClientAPI remoteClient, int corner, UUID texture) public void setEstateTerrainBaseTexture(IClientAPI remoteClient, int corner, UUID texture)
{ {
if(texture == UUID.Zero) if (texture == UUID.Zero)
return; return;
switch (corner) switch (corner)

View File

@ -388,10 +388,10 @@ namespace OpenSim.Region.Environment.Modules.World.NPC
get { return 0; } get { return 0; }
} }
public ulong GetGroupPowers(UUID groupID) public ulong GetGroupPowers(UUID groupID)
{ {
return 0; return 0;
} }
public virtual int NextAnimationSequenceNumber public virtual int NextAnimationSequenceNumber
{ {

View File

@ -71,7 +71,7 @@ namespace OpenSim.Region.Environment.Scenes
// FindObject(UUID) // FindObject(UUID)
// FindObject(int) // FindObject(int)
// FindPresence(UUID) // FindPresence(UUID)
public void Add(SceneObjectGroup obj) public void Add(SceneObjectGroup obj)
{ {
m_obj_by_uuid[obj.UUID] = obj; m_obj_by_uuid[obj.UUID] = obj;
@ -86,7 +86,7 @@ namespace OpenSim.Region.Environment.Scenes
public SceneObjectGroup RemoveObject(UUID uuid) public SceneObjectGroup RemoveObject(UUID uuid)
{ {
SceneObjectGroup sog = null; SceneObjectGroup sog = null;
try try
{ {
sog = (SceneObjectGroup)m_obj_by_uuid[uuid]; sog = (SceneObjectGroup)m_obj_by_uuid[uuid];
m_obj_by_uuid.Remove(uuid); m_obj_by_uuid.Remove(uuid);
@ -99,11 +99,11 @@ namespace OpenSim.Region.Environment.Scenes
} }
return sog; return sog;
} }
public ScenePresence RemovePresence(UUID uuid) public ScenePresence RemovePresence(UUID uuid)
{ {
ScenePresence sp = null; ScenePresence sp = null;
try try
{ {
sp = (ScenePresence)m_pres_by_uuid[uuid]; sp = (ScenePresence)m_pres_by_uuid[uuid];
m_pres_by_uuid.Remove(uuid); m_pres_by_uuid.Remove(uuid);
@ -113,7 +113,7 @@ namespace OpenSim.Region.Environment.Scenes
m_log.ErrorFormat("RemovePresence failed for {0}", uuid, e); m_log.ErrorFormat("RemovePresence failed for {0}", uuid, e);
sp = null; sp = null;
} }
return sp; return sp;
} }
public SceneObjectGroup FindObject(UUID uuid) public SceneObjectGroup FindObject(UUID uuid)
@ -132,7 +132,7 @@ namespace OpenSim.Region.Environment.Scenes
public SceneObjectGroup FindObject(int local) public SceneObjectGroup FindObject(int local)
{ {
try try
{ {
UUID uuid = (UUID)m_obj_by_local[local]; UUID uuid = (UUID)m_obj_by_local[local];
SceneObjectGroup sog = (SceneObjectGroup)m_obj_by_uuid[uuid]; SceneObjectGroup sog = (SceneObjectGroup)m_obj_by_uuid[uuid];

View File

@ -140,7 +140,7 @@ namespace OpenSim.Region.Environment.Scenes
List<EntityBase> updateEntities = GetEntities(); List<EntityBase> updateEntities = GetEntities();
foreach (EntityBase entity in updateEntities) foreach (EntityBase entity in updateEntities)
{ {
entity.Update(); entity.Update();
} }
} }
@ -325,7 +325,7 @@ namespace OpenSim.Region.Environment.Scenes
// Don't abort the whole update if one entity happens to give us an exception. // Don't abort the whole update if one entity happens to give us an exception.
try try
{ {
m_updateList[i].Update(); m_updateList[i].Update();
} }
catch (Exception e) catch (Exception e)
{ {

View File

@ -1581,7 +1581,7 @@ namespace OpenSim.Region.Environment.Scenes
/// Schedule a terse update for this scene object /// Schedule a terse update for this scene object
/// </summary> /// </summary>
public void ScheduleGroupForTerseUpdate() public void ScheduleGroupForTerseUpdate()
{ {
lock (m_parts) lock (m_parts)
{ {
foreach (SceneObjectPart part in m_parts.Values) foreach (SceneObjectPart part in m_parts.Values)

View File

@ -1321,7 +1321,7 @@ namespace OpenSim.Region.Environment.Scenes
public static SceneObjectPart FromXml(XmlReader xmlReader) public static SceneObjectPart FromXml(XmlReader xmlReader)
{ {
// It's not necessary to persist this // It's not necessary to persist this
XmlSerializer serializer = new XmlSerializer(typeof (SceneObjectPart)); XmlSerializer serializer = new XmlSerializer(typeof (SceneObjectPart));
SceneObjectPart newobject = (SceneObjectPart) serializer.Deserialize(xmlReader); SceneObjectPart newobject = (SceneObjectPart) serializer.Deserialize(xmlReader);
return newobject; return newobject;

View File

@ -287,10 +287,10 @@ namespace OpenSim.Region.Examples.SimpleModule
get { return 0; } get { return 0; }
} }
public ulong GetGroupPowers(UUID groupID) public ulong GetGroupPowers(UUID groupID)
{ {
return 0; return 0;
} }
public virtual int NextAnimationSequenceNumber public virtual int NextAnimationSequenceNumber
{ {

View File

@ -1990,7 +1990,7 @@ namespace OpenSim.Region.Physics.Meshing
Face f = faces[i]; Face f = faces[i];
mesh.triangles.Add(new Triangle(vertices[f.v1], vertices[f.v2], vertices[f.v3])); mesh.triangles.Add(new Triangle(vertices[f.v1], vertices[f.v2], vertices[f.v3]));
} }
//for (int i = 0; i < numFaces; i++) //for (int i = 0; i < numFaces; i++)
//{ //{
// Face f = primMesh.faces[i]; // Face f = primMesh.faces[i];

View File

@ -87,71 +87,71 @@ namespace OpenSim.Region.Physics.Meshing
//[1.0f, 1.0f, -2.4492127076447545e-016f]]; //[1.0f, 1.0f, -2.4492127076447545e-016f]];
/* /*
angles3 = [ angles3 = [
[0.0, 1.0, 0.0], [0.0, 1.0, 0.0],
[0.33333333333333331, -0.49999999999999978, 0.86602540378443871], [0.33333333333333331, -0.49999999999999978, 0.86602540378443871],
[0.66666666666666663, -0.50000000000000044, -0.86602540378443837], [0.66666666666666663, -0.50000000000000044, -0.86602540378443837],
[1.0, 1.0, -2.4492127076447545e-016]] [1.0, 1.0, -2.4492127076447545e-016]]
angles4 = [ angles4 = [
[0.0, 1.0, 0.0], [0.0, 1.0, 0.0],
[0.25, 0.0, 1.0], [0.25, 0.0, 1.0],
[0.5, -1.0, 0.0], [0.5, -1.0, 0.0],
[0.75, 0.0, -1.0], [0.75, 0.0, -1.0],
[1.0, 1.0, 0.0]] [1.0, 1.0, 0.0]]
angles24 = [ angles24 = [
[0.0, 0.5, 0.0], [0.0, 0.5, 0.0],
[0.041666666666666664, 0.48296291314453416, 0.12940952255126037], [0.041666666666666664, 0.48296291314453416, 0.12940952255126037],
[0.083333333333333329, 0.43301270189221935, 0.25], [0.083333333333333329, 0.43301270189221935, 0.25],
[0.125, 0.35355339059327379, 0.35355339059327373], [0.125, 0.35355339059327379, 0.35355339059327373],
[0.16666666666666666, 0.25, 0.4330127018922193], [0.16666666666666666, 0.25, 0.4330127018922193],
[0.20833333333333331, 0.12940952255126048, 0.4829629131445341], [0.20833333333333331, 0.12940952255126048, 0.4829629131445341],
[0.25, 0.0, 0.5], [0.25, 0.0, 0.5],
[0.29166666666666663, -0.12940952255126031, 0.48296291314453416], [0.29166666666666663, -0.12940952255126031, 0.48296291314453416],
[0.33333333333333331, -0.25, 0.43301270189221935], [0.33333333333333331, -0.25, 0.43301270189221935],
[0.375, -0.35355339059327373, 0.35355339059327379], [0.375, -0.35355339059327373, 0.35355339059327379],
[0.41666666666666663, -0.43301270189221924, 0.25], [0.41666666666666663, -0.43301270189221924, 0.25],
[0.45833333333333331, -0.4829629131445341, 0.12940952255126051], [0.45833333333333331, -0.4829629131445341, 0.12940952255126051],
[0.5, -0.5, 0.0], [0.5, -0.5, 0.0],
[0.54166666666666663, -0.48296291314453421, -0.12940952255126018], [0.54166666666666663, -0.48296291314453421, -0.12940952255126018],
[0.58333333333333326, -0.43301270189221941, -0.25], [0.58333333333333326, -0.43301270189221941, -0.25],
[0.62499999999999989, -0.35355339059327395, -0.35355339059327356], [0.62499999999999989, -0.35355339059327395, -0.35355339059327356],
[0.66666666666666663, -0.25, -0.43301270189221919], [0.66666666666666663, -0.25, -0.43301270189221919],
[0.70833333333333326, -0.12940952255126076, -0.48296291314453405], [0.70833333333333326, -0.12940952255126076, -0.48296291314453405],
[0.75, 0.0, -0.5], [0.75, 0.0, -0.5],
[0.79166666666666663, 0.12940952255126015, -0.48296291314453421], [0.79166666666666663, 0.12940952255126015, -0.48296291314453421],
[0.83333333333333326, 0.25, -0.43301270189221952], [0.83333333333333326, 0.25, -0.43301270189221952],
[0.875, 0.35355339059327368, -0.35355339059327384], [0.875, 0.35355339059327368, -0.35355339059327384],
[0.91666666666666663, 0.43301270189221919, -0.25], [0.91666666666666663, 0.43301270189221919, -0.25],
[0.95833333333333326, 0.48296291314453405, -0.12940952255126079], [0.95833333333333326, 0.48296291314453405, -0.12940952255126079],
[1.0, 0.5, 0.0]] [1.0, 0.5, 0.0]]
angles24 = [ angles24 = [
[0.0, 1.0, 0.0], [0.0, 1.0, 0.0],
[0.041666666666666664, 0.96592582628906831, 0.25881904510252074], [0.041666666666666664, 0.96592582628906831, 0.25881904510252074],
[0.083333333333333329, 0.86602540378443871, 0.5], [0.083333333333333329, 0.86602540378443871, 0.5],
[0.125, 0.70710678118654757, 0.70710678118654746], [0.125, 0.70710678118654757, 0.70710678118654746],
[0.16666666666666667, 0.5, 0.8660254037844386], [0.16666666666666667, 0.5, 0.8660254037844386],
[0.20833333333333331, 0.25881904510252096, 0.9659258262890682], [0.20833333333333331, 0.25881904510252096, 0.9659258262890682],
[0.25, 6.1230317691118863e-017, 1.0], [0.25, 6.1230317691118863e-017, 1.0],
[0.29166666666666663, -0.25881904510252063, 0.96592582628906831], [0.29166666666666663, -0.25881904510252063, 0.96592582628906831],
[0.33333333333333333, -0.5, 0.86602540378443871], [0.33333333333333333, -0.5, 0.86602540378443871],
[0.375, -0.70710678118654746, 0.70710678118654757], [0.375, -0.70710678118654746, 0.70710678118654757],
[0.41666666666666663, -0.86602540378443849, 0.5], [0.41666666666666663, -0.86602540378443849, 0.5],
[0.45833333333333331, -0.9659258262890682, 0.25881904510252102], [0.45833333333333331, -0.9659258262890682, 0.25881904510252102],
[0.5, -1.0, 1.2246063538223773e-016], [0.5, -1.0, 1.2246063538223773e-016],
[0.54166666666666663, -0.96592582628906842, -0.25881904510252035], [0.54166666666666663, -0.96592582628906842, -0.25881904510252035],
[0.58333333333333326, -0.86602540378443882, -0.5], [0.58333333333333326, -0.86602540378443882, -0.5],
[0.62499999999999989, -0.70710678118654791, -0.70710678118654713], [0.62499999999999989, -0.70710678118654791, -0.70710678118654713],
[0.66666666666666667, -0.5, -0.86602540378443837], [0.66666666666666667, -0.5, -0.86602540378443837],
[0.70833333333333326, -0.25881904510252152, -0.96592582628906809], [0.70833333333333326, -0.25881904510252152, -0.96592582628906809],
[0.75, -1.8369095307335659e-016, -1.0], [0.75, -1.8369095307335659e-016, -1.0],
[0.79166666666666663, 0.2588190451025203, -0.96592582628906842], [0.79166666666666663, 0.2588190451025203, -0.96592582628906842],
[0.83333333333333326, 0.5, -0.86602540378443904], [0.83333333333333326, 0.5, -0.86602540378443904],
[0.875, 0.70710678118654735, -0.70710678118654768], [0.875, 0.70710678118654735, -0.70710678118654768],
[0.91666666666666663, 0.86602540378443837, -0.5], [0.91666666666666663, 0.86602540378443837, -0.5],
[0.95833333333333326, 0.96592582628906809, -0.25881904510252157], [0.95833333333333326, 0.96592582628906809, -0.25881904510252157],
[1.0, 1.0, -2.4492127076447545e-016]] [1.0, 1.0, -2.4492127076447545e-016]]
*/ */
@ -159,15 +159,15 @@ angles24 = [
{ {
private float iX, iY; // intersection point private float iX, iY; // intersection point
private Angle[] angles3 = private Angle[] angles3 =
{ {
new Angle(0.0f, 1.0f, 0.0f), new Angle(0.0f, 1.0f, 0.0f),
new Angle(0.33333333333333333f, -0.5f, 0.86602540378443871f), new Angle(0.33333333333333333f, -0.5f, 0.86602540378443871f),
new Angle(0.66666666666666667f, -0.5f, -0.86602540378443837f), new Angle(0.66666666666666667f, -0.5f, -0.86602540378443837f),
new Angle(1.0f, 1.0f, 0.0f) new Angle(1.0f, 1.0f, 0.0f)
}; };
private Angle[] angles4 = private Angle[] angles4 =
{ {
new Angle(0.0f, 1.0f, 0.0f), new Angle(0.0f, 1.0f, 0.0f),
new Angle(0.25f, 0.0f, 1.0f), new Angle(0.25f, 0.0f, 1.0f),
@ -179,30 +179,30 @@ angles24 = [
private Angle[] angles24 = private Angle[] angles24 =
{ {
new Angle(0.0f, 1.0f, 0.0f), new Angle(0.0f, 1.0f, 0.0f),
new Angle(0.041666666666666664f, 0.96592582628906831f, 0.25881904510252074f), new Angle(0.041666666666666664f, 0.96592582628906831f, 0.25881904510252074f),
new Angle(0.083333333333333329f, 0.86602540378443871f, 0.5f), new Angle(0.083333333333333329f, 0.86602540378443871f, 0.5f),
new Angle(0.125f, 0.70710678118654757f, 0.70710678118654746f), new Angle(0.125f, 0.70710678118654757f, 0.70710678118654746f),
new Angle(0.16666666666666667f, 0.5f, 0.8660254037844386f), new Angle(0.16666666666666667f, 0.5f, 0.8660254037844386f),
new Angle(0.20833333333333331f, 0.25881904510252096f, 0.9659258262890682f), new Angle(0.20833333333333331f, 0.25881904510252096f, 0.9659258262890682f),
new Angle(0.25f, 0.0f, 1.0f), new Angle(0.25f, 0.0f, 1.0f),
new Angle(0.29166666666666663f, -0.25881904510252063f, 0.96592582628906831f), new Angle(0.29166666666666663f, -0.25881904510252063f, 0.96592582628906831f),
new Angle(0.33333333333333333f, -0.5f, 0.86602540378443871f), new Angle(0.33333333333333333f, -0.5f, 0.86602540378443871f),
new Angle(0.375f, -0.70710678118654746f, 0.70710678118654757f), new Angle(0.375f, -0.70710678118654746f, 0.70710678118654757f),
new Angle(0.41666666666666663f, -0.86602540378443849f, 0.5f), new Angle(0.41666666666666663f, -0.86602540378443849f, 0.5f),
new Angle(0.45833333333333331f, -0.9659258262890682f, 0.25881904510252102f), new Angle(0.45833333333333331f, -0.9659258262890682f, 0.25881904510252102f),
new Angle(0.5f, -1.0f, 0.0f), new Angle(0.5f, -1.0f, 0.0f),
new Angle(0.54166666666666663f, -0.96592582628906842f, -0.25881904510252035f), new Angle(0.54166666666666663f, -0.96592582628906842f, -0.25881904510252035f),
new Angle(0.58333333333333326f, -0.86602540378443882f, -0.5f), new Angle(0.58333333333333326f, -0.86602540378443882f, -0.5f),
new Angle(0.62499999999999989f, -0.70710678118654791f, -0.70710678118654713f), new Angle(0.62499999999999989f, -0.70710678118654791f, -0.70710678118654713f),
new Angle(0.66666666666666667f, -0.5f, -0.86602540378443837f), new Angle(0.66666666666666667f, -0.5f, -0.86602540378443837f),
new Angle(0.70833333333333326f, -0.25881904510252152f, -0.96592582628906809f), new Angle(0.70833333333333326f, -0.25881904510252152f, -0.96592582628906809f),
new Angle(0.75f, 0.0f, -1.0f), new Angle(0.75f, 0.0f, -1.0f),
new Angle(0.79166666666666663f, 0.2588190451025203f, -0.96592582628906842f), new Angle(0.79166666666666663f, 0.2588190451025203f, -0.96592582628906842f),
new Angle(0.83333333333333326f, 0.5f, -0.86602540378443904f), new Angle(0.83333333333333326f, 0.5f, -0.86602540378443904f),
new Angle(0.875f, 0.70710678118654735f, -0.70710678118654768f), new Angle(0.875f, 0.70710678118654735f, -0.70710678118654768f),
new Angle(0.91666666666666663f, 0.86602540378443837f, -0.5f), new Angle(0.91666666666666663f, 0.86602540378443837f, -0.5f),
new Angle(0.95833333333333326f, 0.96592582628906809f, -0.25881904510252157f), new Angle(0.95833333333333326f, 0.96592582628906809f, -0.25881904510252157f),
new Angle(1.0f, 1.0f, 0.0f) new Angle(1.0f, 1.0f, 0.0f)
}; };
private Angle interpolatePoints(float newPoint, Angle p1, Angle p2) private Angle interpolatePoints(float newPoint, Angle p1, Angle p2)

View File

@ -7546,7 +7546,7 @@ namespace OpenSim.Region.ScriptEngine.Common
// the object we are in // the object we are in
UUID objectID = m_host.ParentUUID; UUID objectID = m_host.ParentUUID;
if(objectID == UUID.Zero) return; if (objectID == UUID.Zero) return;
// we need the permission first, to know which avatar we want to set the camera for // we need the permission first, to know which avatar we want to set the camera for
UUID agentID = m_host.TaskInventory[invItemID].PermsGranter; UUID agentID = m_host.TaskInventory[invItemID].PermsGranter;
@ -7597,7 +7597,7 @@ namespace OpenSim.Region.ScriptEngine.Common
// the object we are in // the object we are in
UUID objectID = m_host.ParentUUID; UUID objectID = m_host.ParentUUID;
if(objectID == UUID.Zero) return; if (objectID == UUID.Zero) return;
// we need the permission first, to know which avatar we want to clear the camera for // we need the permission first, to know which avatar we want to clear the camera for
UUID agentID = m_host.TaskInventory[invItemID].PermsGranter; UUID agentID = m_host.TaskInventory[invItemID].PermsGranter;

View File

@ -7418,7 +7418,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
// the object we are in // the object we are in
UUID objectID = m_host.ParentUUID; UUID objectID = m_host.ParentUUID;
if(objectID == UUID.Zero) return; if (objectID == UUID.Zero) return;
// we need the permission first, to know which avatar we want to set the camera for // we need the permission first, to know which avatar we want to set the camera for
UUID agentID = m_host.TaskInventory[invItemID].PermsGranter; UUID agentID = m_host.TaskInventory[invItemID].PermsGranter;
@ -7469,7 +7469,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
// the object we are in // the object we are in
UUID objectID = m_host.ParentUUID; UUID objectID = m_host.ParentUUID;
if(objectID == UUID.Zero) return; if (objectID == UUID.Zero) return;
// we need the permission first, to know which avatar we want to clear the camera for // we need the permission first, to know which avatar we want to clear the camera for
UUID agentID = m_host.TaskInventory[invItemID].PermsGranter; UUID agentID = m_host.TaskInventory[invItemID].PermsGranter;

View File

@ -686,7 +686,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
{ {
// If we're currently in an event, just tell it to save upon return // If we're currently in an event, just tell it to save upon return
// //
if(m_InEvent) if (m_InEvent)
{ {
m_SaveState = true; m_SaveState = true;
return; return;

View File

@ -216,13 +216,13 @@ namespace OpenSim.Region.ScriptEngine.XEngine
if (sleepTime > 0) if (sleepTime > 0)
{ {
m_ThreadPool.QueueWorkItem(new WorkItemCallback(this.DoMaintenance), m_ThreadPool.QueueWorkItem(new WorkItemCallback(this.DoMaintenance),
new Object[]{ sleepTime }); new Object[]{ sleepTime });
} }
if (saveTime > 0) if (saveTime > 0)
{ {
m_ThreadPool.QueueWorkItem(new WorkItemCallback(this.DoBackup), m_ThreadPool.QueueWorkItem(new WorkItemCallback(this.DoBackup),
new Object[] { saveTime }); new Object[] { saveTime });
} }
@ -278,7 +278,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
instances.Clear(); instances.Clear();
if (saveTime > 0) if (saveTime > 0)
m_ThreadPool.QueueWorkItem(new WorkItemCallback(this.DoBackup), m_ThreadPool.QueueWorkItem(new WorkItemCallback(this.DoBackup),
new Object[] { saveTime }); new Object[] { saveTime });
return 0; return 0;
@ -301,7 +301,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
System.Threading.Thread.Sleep(sleepTime); System.Threading.Thread.Sleep(sleepTime);
m_ThreadPool.QueueWorkItem(new WorkItemCallback(this.DoMaintenance), m_ThreadPool.QueueWorkItem(new WorkItemCallback(this.DoMaintenance),
new Object[]{ sleepTime }); new Object[]{ sleepTime });
return 0; return 0;
@ -331,13 +331,13 @@ namespace OpenSim.Region.ScriptEngine.XEngine
{ {
m_firstStart = false; m_firstStart = false;
m_CurrentCompile = m_ThreadPool.QueueWorkItem( m_CurrentCompile = m_ThreadPool.QueueWorkItem(
new WorkItemCallback(this.DoScriptWait), new WorkItemCallback(this.DoScriptWait),
new Object[0]); new Object[0]);
return; return;
} }
m_CurrentCompile = m_ThreadPool.QueueWorkItem( m_CurrentCompile = m_ThreadPool.QueueWorkItem(
new WorkItemCallback(this.DoOnRezScriptQueue), new WorkItemCallback(this.DoOnRezScriptQueue),
new Object[0]); new Object[0]);
} }
} }
@ -352,7 +352,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
if (m_CompileQueue.Count > 0) if (m_CompileQueue.Count > 0)
{ {
m_CurrentCompile = m_ThreadPool.QueueWorkItem( m_CurrentCompile = m_ThreadPool.QueueWorkItem(
new WorkItemCallback(this.DoOnRezScriptQueue), new WorkItemCallback(this.DoOnRezScriptQueue),
new Object[0]); new Object[0]);
} }
else else
@ -383,7 +383,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
if (m_CompileQueue.Count > 0) if (m_CompileQueue.Count > 0)
{ {
m_CurrentCompile = m_ThreadPool.QueueWorkItem( m_CurrentCompile = m_ThreadPool.QueueWorkItem(
new WorkItemCallback(this.DoOnRezScriptQueue), new WorkItemCallback(this.DoOnRezScriptQueue),
new Object[0]); new Object[0]);
} }
else else
@ -493,7 +493,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
} }
m_DomainScripts[appDomain].Add(itemID); m_DomainScripts[appDomain].Add(itemID);
ScriptInstance instance = ScriptInstance instance =
new ScriptInstance(this,localID, new ScriptInstance(this,localID,
part.UUID, itemID, assetID, assembly, part.UUID, itemID, assetID, assembly,
m_AppDomains[appDomain], m_AppDomains[appDomain],
@ -657,7 +657,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
public IScriptWorkItem QueueEventHandler(object parms) public IScriptWorkItem QueueEventHandler(object parms)
{ {
return new XWorkItem(m_ThreadPool.QueueWorkItem( return new XWorkItem(m_ThreadPool.QueueWorkItem(
new WorkItemCallback(this.ProcessEventHandler), new WorkItemCallback(this.ProcessEventHandler),
parms)); parms));
} }
@ -723,7 +723,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
string[] pathList = new string[] {"bin", "ScriptEngines", string[] pathList = new string[] {"bin", "ScriptEngines",
Path.Combine("ScriptEngines", Path.Combine("ScriptEngines",
m_Scene.RegionInfo.RegionID.ToString())}; m_Scene.RegionInfo.RegionID.ToString())};
string assemblyName = args.Name; string assemblyName = args.Name;
if (assemblyName.IndexOf(",") != -1) if (assemblyName.IndexOf(",") != -1)
assemblyName = args.Name.Substring(0, args.Name.IndexOf(",")); assemblyName = args.Name.Substring(0, args.Name.IndexOf(","));